簡易檢索 / 詳目顯示

研究生: 陳政瑋
Chen, Chang-Wei
論文名稱: 心房顫動及異位心搏的深度學習辨識於ARM微控制器與可程式化邏輯閘陣列的硬體實現效率與準確性評估
Performance and Accuracy Evaluation of Deep Learning Models for Atrial Fibrillation and Ectopic Beat Detection on Embedded Platforms of ARM Microcontrollers and FPGA
指導教授: 林哲偉
Lin, Che-Wei
學位類別: 碩士
Master
系所名稱: 工學院 - 生物醫學工程學系
Department of BioMedical Engineering
論文出版年: 2025
畢業學年度: 113
語文別: 英文
論文頁數: 97
中文關鍵詞: 心房顫動異位心搏輕量化模型YOLO模型STM32微控制器單元 (MCU)PYNQ-Z2現場可程式化邏輯閘陣列 (FPGA)心電圖 (ECG)
外文關鍵詞: Atrial Fibrillation, Ectopic Beat, Lightweight Model, YOLO, STM32 Microcontroller Unit (MCU), PYNQ-Z2 FPGA, Electrocardiogram (ECG)
相關次數: 點閱:17下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 本研究提出並應用輕量化深度學習模型,以實現心房顫動 (Atrial Fibrillation)與異位性心搏 (Ectopic Beat)之分類 (Classification)與物件偵測 (Object Detection),並部署於資源受限的嵌入式平台──STM32H743微控制器單元 (MCU)與PYNQ-Z2現場可程式化邏輯閘陣列 (FPGA)──以進行效能驗證與分析。分類模型以MIT-BIH心律不整資料庫為基礎開發,並採用五摺交叉驗證,確保模型在心房顫動辨識與5類、6類及9類異位心搏分類任務中具備良好之泛化能力。心房顫動資料經每5秒切分為一筆,共取得16606筆ECG片段;異位心搏資料則以每個心搏的R波峰為中心,擷取256個資料點作為單筆樣本,共取得109443筆心搏資料。所有模型皆在軟體模擬與實體硬體平台上進行測試集驗證,以評估其效能之客觀性與實作可行性。在分類任務中,本研究根據先前成果,將二維卷積層簡化為一維卷積層後,提出超輕量模型1D-SEmbedNet,並應用於心房顫動與異位性心搏辨識。在軟體模擬環境中,該模型於心房顫動辨識任務中達成 94.74% 的準確率,於異位心搏的5類、6類、9類分類任務中分別達成98.02%、96.95%、97.88%的分類準確率。部署至嵌入式平台後,STM32H743可於各任務中維持與模擬結果一致的準確率,而PYNQ-Z2分別於上述四項任務中達成93.41%、97.74%、95.68%、83.70%的分類準確率。在延遲與功耗方面,PYNQ-Z2在推論延遲上具優勢,在心房顫動與異位心搏分類任務中分別達到約0.06 ms與0.08 ms,顯著優於STM32H743所需之約1.9 ms與2.2 ms;然而,STM32H743的功耗則相對較低,皆為約為1428 mW,而PYNQ-Z2則為2070 mW與2209 mW,顯示兩平台在效能與能耗之間存在明顯權衡。
    鑒於臨床上對即時心律異常事件辨識的需求,以及物件偵測模型於結果可解釋性與醫療可信度上的優勢,本研究進一步探討其於MCU嵌入式系統上實現異位心搏定位的可行性。資料處理方面,將ECG訊號以每5秒切分為一段,共取出16389個ECG片段資料,並對每段中每一心搏依異位類別標註為獨立物件,作為訓練資料。本研究採用為STM32運行優化的輕量化YOLO架構──ST-YOLO-LCv1。於軟體模擬中,其於5類、6類與9類異位心搏偵測任務中分別達成89.0%、94.3%、87.2%的平均精度均值mAP (@IoU=0.5);部署至STM32H743後,對應mAP分別為82.41%、88.97%、82.38%。在運算時間方面,STM32H743 於此三項任務中之平均推論延遲約為325 ms,與軟體模擬環境下約為328 ms的結果相近,顯示模型在實際嵌入式系統中具良好實作性。雖目前僅完成於STM32H743上之部署,且模型準確度仍有進一步優化空間,然實驗結果已驗證輕量化物件偵測模型於低資源嵌入式平台上實現即時異位心搏偵測之可行性,未來亦可進一步提升模型表現並部署至PYNQ-Z2,以發揮FPGA架構之運算加速潛力。綜合考量準確度、mAP表現、推論延遲與功耗結果,兩平台各具優勢: PYNQ-Z2在推論速度上佔優,而STM32H743於功耗與分類準確率方面表現更佳。因此,於目前情境下,STM32H743更適合作為嵌入式心律異常分類與偵測系統之運算核心平台。本研究亦證實,物件偵測模型可實際應用於極低資源環境下之即時心律異常偵測任務。

    This study presents lightweight deep learning models for classifying atrial fibrillation (AF) and ectopic beat (EB), as well as detecting EB events, on resource-constrained embedded platforms including the STM32H743 microcontroller (MCU) and PYNQ-Z2 FPGA. The classification models were developed based on the MIT-BIH Arrhythmia Database and evaluated using 5-fold cross-validation to ensure good generalization in atrial fibrillation detection and in the classification of ectopic beats across 5-class, 6-class, and 9-class. For atrial fibrillation, the ECG signals were segmented into 5-second intervals, yielding a total of 16,606 segments. For ectopic beat data, each heartbeat was centered at the R peak and extracted as a single sample consisting of 256 data points, resulting in 109,443 heartbeat samples. All models were validated on both software simulation and physical hardware platforms to assess their objective performance and practical feasibility.
    For classification tasks, by simplifying 2D convolutional layer to 1D convolutional layer , an improved ultra-lightweight model, 1D-SEmbedNet, was proposed based on prior work and applied to both AF and EB detection. In software simulations, the model achieved an accuracy of 94.74% for AF detection, and 98.02%, 96.95%, and 97.88% for 5-class, 6-class, and 9-class EB classification, respectively. When deployed to embedded platforms, STM32H743 maintained the same accuracies as in simulation, while PYNQ-Z2 achieved 93.41%, 97.74%, 95.68%, and 83.70% for the corresponding tasks. In terms of latency and power, PYNQ-Z2 demonstrated faster inference speeds—approximately 0.06 ms and 0.08 ms per segment for AF and EB tasks, respectively—compared to 1.9 ms and 2.2 ms on the STM32H743. However, the STM32H743 exhibited significantly lower power consumption, with both 1428 mW for AF and EB tasks, respectively, in contrast to 2070 mW and 2209 mW on the PYNQ-Z2, indicating a clear trade-off between performance and energy efficiency. Given the clinical importance of real-time arrhythmia detection and the interpretability advantages of object detection frameworks, this study further explores the feasibility of implementing beat-level EB localization on MCU-based systems. In data preprocessing, ECG signals were segmented into 5-second intervals, resulting in 16,389 ECG segments. Each heartbeat within a segment was labeled as an individual object according to its ectopic class, serving as training data for the object detection model.. The proposed ST-YOLO-LCv1, a YOLO-based architecture optimized for STM32, was employed for this purpose. In software simulation, the model achieved mean average precision (mAP @IoU=0.5) of 89.0%, 94.3%, and 87.2% for the 5-, 6-, and 9-class EB detection tasks, respectively. When deployed on STM32H743, the corresponding mAPs were 82.41%, 88.97%, and 82.38%, with inference latency of approximately 325 ms, which is comparable to the simulation results of 328 ms, demonstrating feasible real-time deployment.
    While the current implementation was limited to STM32H743, results demonstrate the feasibility of deploying lightweight object detection models for real-time EB detection on low-resource embedded systems. Comparative evaluation shows that PYNQ-Z2 offers faster inference, whereas STM32H743 excels in power efficiency and classification accuracy, making it a preferred platform for embedded arrhythmia analysis. The findings affirm the practical applicability of object detection models for real-time ECG interpretation in constrained environments.

    摘要 I Abstract III 誌謝 VI Table of Contents VII List of Tables IX List of Figures XI List of Abbreviations XIII Chapter 1 Introduction and Background 1 1.1 Background 1 1.2 Challenges of AI application on ECG monitoring devices 2 1.3 Lightweight CNN for atrial fibrillation and ectopic beat classification 4 1.4 CNN-based object detector on arrhythmia detection 4 1.5 Arrhythmia detection on embedded AI devices 5 1.6 Research objective and organization of thesis 7 Chapter 2 Material and Methodology 8 2.1 Classification and object detection for atrial fibrillation and ectopic beat 8 2.1.1 Microcontroller Unit (MCU): STM32 NUCLEO-H743ZI2 12 2.1.2 Field-programmable Gate Array (FPGA): PYNQ-Z2 14 2.1.3 Windowing and Normalization 17 2.1.4 Fast Fourier Transform 18 2.1.5 Signal-to-image transformation and Binarization 21 2.1.6 1D-SEmbedNet 22 2.1.7 ST-YOLO-LCv1 25 2.1.8 K-fold Cross Validation 29 2.2 Process for Model Migration 30 2.3 Evaluation Metrics 34 2.4 Experimental Environment and System Specifications 36 Chapter 3 Experimental Result 38 3.1 MIT-BIH Arrhythmia ECG database 38 3.2 Performance of 1D-SEmbedNet for Atrial Fibrillation on Classification 42 3.3 Performance of 1D-SEmbedNet for Ectopic Beat on Classification 44 3.4 Performance of ST-YOLO-LCv1 for Ectopic Beat on Object Detection 50 Chapter 4 Discussion, Conclusion, and Future Works 52 4.1 Discussion 52 4.1.1 Connections on results and clinical characteristic 53 4.1.2 Comparison across platforms and influencing factor on performance 54 4.1.3 Exploration of the effects from signal resolutions 58 4.1.4 Exploration of the effects from heartbeat signal incompleteness 61 4.1.5 External Dataset Validation 63 4.1.6 Selection of hardware implementation 67 4.1.7 Compared with the existing literature 70 4.2 Conclusion and Future works 73 References 76

    [1] H. A. Helaly, M. Badawy, and A. Y. Haikal, “A review of deep learning approaches in clinical and healthcare systems based on medical image analysis,” Multimedia Tools and Applications, vol. 83, no. 12, pp. 36039-36080, 2024.
    [2] J. P. Simon, “Artificial intelligence: scope, players, markets and geography,” Digital Policy, Regulation and Governance, vol. 21, no. 3, pp. 208-237, 2019.
    [3] A. Esteva et al., “A guide to deep learning in healthcare,” Nature medicine, vol. 25, no. 1, pp. 24-29, 2019.
    [4] “Global Cloud Index Projects Cloud Traffic to Represent 95 Percent of Total Data Center Traffic by 2021.” [Online]. Available: https://newsroom.cisco.com/press-release-content?articleId=1908858
    [5] “Cisco Annual Internet Report (2018–2023) White Paper.” [Online]. Available: https://www.cisco.com/c/en/us/solutions/collateral/executive-perspectives/annual-internet-report/white-paper-c11-741490.html
    [6] M. Satyanarayanan, “The emergence of edge computing,” Computer, vol. 50, no. 1, pp. 30-39, 2017.
    [7] C. Zhang, P. Li, G. Sun, Y. Guan, B. Xiao, and J. Cong, “Optimizing FPGA-based accelerator design for deep convolutional neural networks,” in Proceedings of the 2015 ACM/SIGDA international symposium on field-programmable gate arrays, 2015, pp. 161-170.
    [8] Y.-L. Xie, X.-R. Lin, C.-Y. Lee, and C.-W. Lin, “Design and implementation of an ARM-based AI module for ectopic beat classification using custom and structural pruned lightweight CNN,” IEEE Sensors Journal, 2024.
    [9] S. Jain and H. Sohal, “A Low Power Wearable ECG Module for Heart Rate Variability Classification System,” Jaypee University of Information Technology, Solan, HP, 2020.
    [10] L. Falaschetti, M. Alessandrini, G. Biagetti, P. Crippa, and C. Turchetti, “ECG-based arrhythmia classification using recurrent neural networks in embedded systems,” Procedia Computer Science, vol. 207, pp. 3479-3487, 2022.
    [11] Y. Wu, F. Yang, Y. Liu, X. Zha, and S. Yuan, “A comparison of 1-D and 2-D deep convolutional neural networks in ECG classification,” arXiv preprint arXiv:1810.07088, 2018.
    [12] K. Sekhar and K. Priyadarsini, “Efficient detection of cardiac arrhythmias using low-latency fpga-accelerated hybrid deep learning models,” Engineering Research Express, vol. 7, no. 2, p. 025277, 2025.
    [13] “Digital health center of excellence, Artificial intelligence and machine learning (AI/ML)-Enabled medical devices.” [Online]. Available: https://www.fda.gov/medical-devices/software-medical-device-samd/artificial-intelligence-and-machine-learning-aiml-enabled-medical-devices
    [14] G. Cosoli, S. Spinsante, F. Scardulla, L. D'Acquisto, and L. Scalise, “Wireless ECG and cardiac monitoring systems: State of the art, available commercial devices and useful electronic components,” Measurement, vol. 177, p. 109243, 2021.
    [15] ANSI/AAMI EC57:2012. Testing and Reporting Performance Results of Cardiac Rhythm and ST Segment Measurement Algorithms, A. f. t. A. o. M. I. (AAMI), Arlington, VA, 2012. [Online]. Available: https://webstore.ansi.org/standards/aami/ansiaamiec572012r2020
    [16] I. Savelieva and A. J. Camm, “Clinical relevance of silent atrial fibrillation: prevalence, prognosis, quality of life, and management,” Journal of Interventional Cardiac Electrophysiology, vol. 4, pp. 369-382, 2000.
    [17] C. W. Tsao et al., “Heart disease and stroke statistics—2023 update: a report from the American Heart Association,” Circulation, vol. 147, no. 8, p. e93, 2023.
    [18] G. D. Clifford et al., “AF classification from a short single lead ECG recording: The PhysioNet/computing in cardiology challenge 2017,” in 2017 computing in cardiology (CinC), 2017: IEEE, pp. 1-4.
    [19] J. Xie, S. Stavrakis, and B. Yao, “Automated identification of atrial fibrillation from single-lead ECGs using multi-branching ResNet,” Frontiers in Physiology, vol. 15, p. 1362185, 2024.
    [20] M. Yazid and M. A. Rahman, “Atrial fibrillation detection from electrocardiogram signal on low power microcontroller,” IEEE Access, 2024.
    [21] Y.-L. Xie and C.-W. Lin, “Imbalanced ectopic beat classification using a low-memory-usage CNN LMUEBCNet and correlation-based ECG signal oversampling,” Mathematics, vol. 11, no. 8, p. 1833, 2023.
    [22] Z. Zou, K. Chen, Z. Shi, Y. Guo, and J. Ye, “Object detection in 20 years: A survey,” Proceedings of the IEEE, vol. 111, no. 3, pp. 257-276, 2023.
    [23] S. L. Oh, E. Y. Ng, R. San Tan, and U. R. Acharya, “Automated beat-wise arrhythmia diagnosis using modified U-net on extended electrocardiographic recordings with heterogeneous arrhythmia types,” Computers in biology and medicine, vol. 105, pp. 92-101, 2019.
    [24] W. H. Hwang, C. H. Jeong, D. H. Hwang, and Y. C. Jo, “Automatic detection of arrhythmias using a YOLO-based network with long-duration ECG signals,” Engineering Proceedings, vol. 2, no. 1, p. 84, 2020.
    [25] Y. Zhao, Z. Shang, and Y. Lian, “A 13.34 μW event-driven patient-specific ANN cardiac arrhythmia classifier for wearable ECG sensors,” IEEE transactions on biomedical circuits and systems, vol. 14, no. 2, pp. 186-197, 2019.
    [26] S. S. Saha, S. S. Sandha, and M. Srivastava, “Machine learning for microcontroller-class hardware: A review,” IEEE Sensors Journal, vol. 22, no. 22, pp. 21362-21390, 2022.
    [27] N. Wang, J. Zhou, G. Dai, J. Huang, and Y. Xie, “Energy-efficient intelligent ECG monitoring for wearable devices,” IEEE transactions on biomedical circuits and systems, vol. 13, no. 5, pp. 1112-1121, 2019.
    [28] Y. Xing et al., “Accurate ECG classification based on spiking neural network and attentional mechanism for real-time implementation on personal portable devices,” Electronics, vol. 11, no. 12, p. 1889, 2022.
    [29] N. Zhang, X. Wei, H. Chen, and W. Liu, “FPGA implementation for CNN-based optical remote sensing object detection,” Electronics, vol. 10, no. 3, p. 282, 2021.
    [30] W. He, Z. Huang, Z. Wei, C. Li, and B. Guo, “TF-YOLO: An improved incremental network for real-time object detection,” Applied Sciences, vol. 9, no. 16, p. 3225, 2019.
    [31] “ STM32 configurators and code generators: STM32CubeMX.” https://www.st.com/en/development-tools/stm32cubemx.html (accessed 16-Jun, 2025).
    [32] P. Duhamel and M. Vetterli, “Fast Fourier transforms: a tutorial review and a state of the art,” Signal processing, vol. 19, no. 4, pp. 259-299, 1990.
    [33] S. Mangaraj, P. Oraon, S. Ari, A. K. Swain, and K. Mahapatra, “Fpga accelerated convolutional neural network for detection of cardiac arrhythmia,” in 2024 IEEE 4th International Conference on VLSI Systems, Architecture, Technology and Applications (VLSI SATA), 2024: IEEE, pp. 1-6.
    [34] C.-Y. Lee, C.-W. Chen, and C.-W. Lin, “Comparing the Hardware Efficiency and Accuracy of 1D and 2D Convolutional Neural Networks for Ectopic Beat Detection on ARM Embedded Systems,” in International Conference on Biomedical and Health Informatics, 2024: Springer, pp. 366-372.
    [35] Y.-L. Xie and C.-W. Lin, “YOLO-ResTinyECG: ECG-based lightweight embedded AI arrhythmia small object detector with pruning methods,” Expert Systems with Applications, vol. 263, p. 125691, 2025.

    無法下載圖示 校內:2030-07-21公開
    校外:2030-07-21公開
    電子論文尚未授權公開,紙本請查館藏目錄
    QR CODE