| 研究生: |
陳暐鈞 Chen, Wei-Chun |
|---|---|
| 論文名稱: |
基於 STM32MP257F 整合式邊緣神經處理單元(NPU)之多類別心電圖異位心搏物件偵測與低功耗藍牙傳輸系統 NPU-Accelerated AI Inference System with BLE Transmission on STM32MP257F: Multi-Class ECG Ectopic-Beat Object Detection on an Integrated Edge NPU |
| 指導教授: |
林哲偉
Lin, Che-Wei |
| 學位類別: |
碩士 Master |
| 系所名稱: |
工學院 - 生物醫學工程學系 Department of BioMedical Engineering |
| 論文出版年: | 2026 |
| 畢業學年度: | 114 |
| 語文別: | 英文 |
| 論文頁數: | 117 |
| 中文關鍵詞: | 心電圖 (ECG) 、異位心搏偵測 、物件偵測 、YOLO 、邊緣 AI 、神經處理單元 (NPU) 、STM32MP257F 、UINT8 量化 、Roofline 分析 、能源效率 、低功耗藍牙 、MIT-BIH |
| 外文關鍵詞: | Electrocardiogram (ECG), Ectopic-beat detection, Object detection, YOLO, Edge AI, Neural processing unit (NPU), STM32MP257F, UINT8 quantization, Roofline, Energy efficiency, Bluetooth Low Energy, MIT-BIH |
| 相關次數: | 點閱:120 下載:0 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
連續且長時間的心電圖(ECG)監測對於心律不整之早期偵測至關重要;然而傳統穿戴式系統多將原始訊號串流至遠端主機進行推論,因而衍生傳輸延遲、功耗負擔與資料隱私風險。本論文開發並評估一套硬體加速之邊緣運算框架,於裝置端進行多類別異位心搏(ectopic beat)偵測,其中神經網路前向推論由 STM32MP257F 微處理器內建之 VeriSilicon® 神經處理單元(NPU)加速,並透過低功耗藍牙(BLE)將偵測結果傳送至主機端圖形介面。
本研究將 MIT-BIH 心律不整資料庫之 5 秒單導程訊號切段轉繪為 256×256 灰階影像,將心律不整分析轉化為 2D 物件偵測任務。研究中比較兩個 STMicroelectronics Model Zoo 偵測器——基於錨點(anchor-based)之 ST-YOLO-LCv1(約 288K 參數),以及無錨點(anchor-free)之 ST-YOLO-X(約 913K 參數)——於分層五折交叉驗證下,針對 5、6、9 類三種任務進行訓練。兩模型皆經訓練後量化為8位元無符號整數(UINT8,per-tensor)並部署至 STM32MP257F NPU。
本研究提出四項主要發現:(1)同硬體比較下,ST-YOLO-X 一致較為準確(NPU 上 5/6/9 類之 mAP@0.5 為 0.90/0.94/0.86,優於 ST-YOLO-LCv1 的 0.77/0.84/0.75)。(2)量化敏感度差異顯著:FP32→UINT8 之 mAP 下降,ST-YOLO-X 僅 3–7 pp,而 ST-YOLO-LCv1 高達 12–15 pp。(3)相較板載 Arm® CPU,NPU 將推論加速約 38 倍(ST-YOLO-X)與 14.8 倍(ST-YOLO-LCv1),單次推論能耗降低約 4.6–7.5 倍。(4)反直覺地,架構較重的 ST-YOLO-X 反而有較低的前向推論延遲(約 3.67 ms(ST-YOLO-X)與 4.10 ms(ST-YOLO-LCv1)),對應較高的 PE 陣列利用率(以一階 Roofline 估計:ST-YOLO-X 達峰值之 8.9%、ST-YOLO-LCv1 僅 4.3%);逐層分析顯示深度可分離卷積僅能解釋此落差的一部分、而非大部分,其餘原因仍待實機量測進一步釐清。然而於端到端,較輕量的 ST-YOLO-LCv1 反而能效較佳(約 26 mJ(ST-YOLO-LCv1) 與 33 mJ(ST-YOLO-X);38 FPS/W(ST-YOLO-LCv1) 與 30 FPS/W(ST-YOLO-X)),因為 ST-YOLO-X 的多尺度偵測頭使 CPU 端後處理成為主要成本,其中又以解碼運算(而非NMS)為主要驅動因素。因此,於此 NPU 上,乘積累加運算量(MACC)與推論速度、端到端能效之間並非單純的線性關係。
就定位而言,本研究屬於平台特性化與邊緣部署研究,而非演算法架構上的創新:任務形式、影像管線與兩個架構皆取自前人工作與 STMicroelectronics Model Zoo。在本實驗室之研究脈絡中,其貢獻為:首次將此 2D-YOLO 心電圖偵測器部署於整合式 NPU、將 ST-YOLO-X 引入此心電圖任務並表現明顯優於先前採用的 ST-YOLO-LCv1,以及於同一NPU上進行模型間之準確度、延遲與能效之比較。完整的端到端系統——經 BMD101 前端與 USART6 介面擷取 ECG(訊號源為一台 ECG 訊號模擬器,可回放具代表性的 MIT-BIH 紀錄,並另以四肢夾電極之即時單導程訊號加以測試),再經 NPU 推論、BLE 上行與 PC-GUI 視覺化——皆已即時展示。
Continuous, long-term electrocardiogram (ECG) monitoring is central to the early detection of cardiac arrhythmia, yet conventional wearable systems stream raw signals to a remote host for inference, incurring transmission latency, power overhead, and data-privacy exposure. This thesis develops and characterizes a hardware-accelerated edge framework that performs multi-class ectopic-beat detection on-device, with the neural-network forward pass accelerated by the VeriSilicon® NPU integrated in the STM32MP257F microprocessor; the detection results are transmitted over Bluetooth Low Energy (BLE) to a host graphical interface.
Each 5-second single-lead segment of the MIT-BIH Arrhythmia Database was rendered as a 256×256 grayscale image, casting arrhythmia analysis as a 2D object-detection task. Two STMicroelectronics Model Zoo detectors—the anchor-based ST-YOLO-LCv1 (≈288K parameters) and the anchor-free ST-YOLO-X (≈913K parameters)—were trained under stratified five-fold cross-validation on 5-, 6-, and 9-class formulations. Both models were post-training quantized to 8-bit integer precision (unsigned, per-tensor) and deployed to the STM32MP257F NPU.
Four findings are reported. (1) A same-hardware comparison shows ST-YOLO-X to be consistently more accurate (NPU mAP@0.5 of 0.90/0.94/0.86 vs. 0.77/0.84/0.75 for the 5-/6-/9-class tasks). (2) Quantization sensitivity differs sharply: the FP32→UINT8 mAP drop is only 3–7 pp for ST-YOLO-X but 12–15 pp for ST-YOLO-LCv1. (3) The NPU accelerates inference ≈38× (ST-YOLO-X) and ≈14.8× (ST-YOLO-LCv1) over the on-board Arm® CPU, cutting energy per inference ≈4.6–7.5×. (4) Counter-intuitively, the heavier ST-YOLO-X has the lower NPU forward-pass latency (≈3.67 ms (ST-YOLO-X) vs. 4.10 ms (ST-YOLO-LCv1)) and higher measured PE-array utilization (8.9% vs. 4.3% of peak); a per-layer analysis attributes part, but not the majority, of this gap to convolution type, leaving the remainder an open question for on-target instrumentation. End-to-end, however, ST-YOLO-LCv1 is the more energy-efficient deployment ( ≈26 mJ (ST-YOLO-LCv1) vs. 33 mJ (ST-YOLO-X); 38 FPS/W (ST-YOLO-LCv1) vs. 30 FPS/W (ST-YOLO-X) ), because ST-YOLO-X's multi-scale detection heads make CPU-side post-processing the dominant cost, driven mainly by decode rather than NMS. On this NPU, MACC therefore bears no simple, linear relationship to either inference speed or end-to-end efficiency.
In scope, this is a platform-characterization and deployment study rather than a network-architecture contribution: the task formulation, image pipeline, and both architectures are drawn from prior work and the STMicroelectronics Model Zoo. Within this laboratory's line of research, its contributions are the first deployment of these 2D-YOLO ECG detectors on an integrated NPU, the introduction of ST-YOLO-X to this ECG task — where it markedly outperforms the previously used ST-YOLO-LCv1 — and a comparison of accuracy, latency, and energy efficiency between the two models on the same NPU. The complete end-to-end system—ECG acquisition through the BMD101 front-end over USART6 (the signal source is an AECG100 ECG simulator capable of replaying a single MIT-BIH recording, additionally exercised with live single-lead capture from limb-clip electrodes), on-NPU inference, BLE uplink, and PC-GUI visualization—is demonstrated in real time.
[1] C. W. Tsao et al., "Heart disease and stroke statistics—2023 update: A report from the American Heart Association," Circulation, vol. 147, no. 8, pp. e93–e621, 2023, doi: 10.1161/CIR.0000000000001123.
[2] A. Esteva et al., "A guide to deep learning in healthcare," Nat. Med., vol. 25, no. 1, pp. 24–29, 2019, doi: 10.1038/s41591-018-0316-z.
[3] M. Satyanarayanan, "The emergence of edge computing," Computer, vol. 50, no. 1, pp. 30–39, 2017, doi: 10.1109/MC.2017.9.
[4] D. Ngo, H.-C. Park, and B. Kang, "Edge intelligence: A review of deep neural network inference in resource-limited environments," Electronics, vol. 14, no. 12, p. 2495, 2025, doi: 10.3390/electronics14122495.
[5] R. Cordova-Cardenas, D. Amor, and Á. Gutiérrez, "Edge AI in practice: A survey and deployment framework for neural networks on embedded systems," Electronics, vol. 14, no. 24, p. 4877, 2025, doi: 10.3390/electronics14244877.
[6] F. Li, Y. Feng, Y. Fu, Z. Wu, and J. Yuan, "Design of a wearable ECG signal monitoring system and research on arrhythmia classification methods," in Proc. ISAIMS ’24, 2025, doi: 10.1145/3706890.3706907.
[7] I. Savelieva and A. J. Camm, "Clinical relevance of silent atrial fibrillation: Prevalence, prognosis, quality of life, and management," J. Interv. Card. Electrophysiol., vol. 4, pp. 369–382, 2000, doi: 10.1023/A:1009823001707.
[8] S. Alam, C. Yakopcic, Q. Wu, M. Barnell, S. Khan, and T. M. Taha, "Survey of deep learning accelerators for edge and emerging computing," Electronics, vol. 13, no. 15, p. 2988, 2024, doi: 10.3390/electronics13152988.
[9] A. Gholami, S. Kim, Z. Dong, Z. Yao, M. W. Mahoney, and K. Keutzer, "A survey of quantization methods for efficient neural network inference," arXiv:2103.13630, 2021.
[10] R. Krishnamoorthi, "Quantizing deep convolutional networks for efficient inference: A whitepaper," arXiv:1806.08342, 2018.
[11] S. L. Oh, E. Y. K. Ng, R. S. Tan, and U. R. Acharya, "Automated beat-wise arrhythmia diagnosis using modified U-net on extended electrocardiographic recordings with heterogeneous arrhythmia types," Comput. Biol. Med., vol. 105, pp. 92–101, 2019, doi: 10.1016/j.compbiomed.2018.12.012.
[12] Z. Ge, S. Liu, F. Wang, Z. Li, and J. Sun, "YOLOX: Exceeding YOLO series in 2021," arXiv:2107.08430, 2021.
[13] B. Hwang and J. Jeong, "Automatic detection of arrhythmias using a YOLO-based network with long-duration ECG signals," Eng. Proc., vol. 2, no. 1, p. 84, 2020, doi: 10.3390/ecsa-7-08229.
[14] Y.-L. Xie and C.-W. Lin, "YOLO-ResTinyECG: ECG-based lightweight embedded AI arrhythmia small object detector with pruning methods," Expert Syst. Appl., vol. 263, p. 125691, 2025, doi: 10.1016/j.eswa.2024.125691.
[15] 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," in Proc. 40th Annu. Int. Conf. IEEE EMBC, 2018, pp. 324–327, doi: 10.1109/EMBC.2018.8512242.
[16] 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 IFMBE Proc., vol. 118, 2025, pp. 366–372, doi: 10.1007/978-3-031-86323-3_43.
[17] 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, doi: 10.3390/math11081833.
[18] 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 J., vol. 24, no. 12, pp. 19636–19648, 2024, doi: 10.1109/JSEN.2024.3393469.
[19] C.-W. Chen, "Performance and accuracy evaluation of deep learning models for atrial fibrillation and ectopic beat detection on embedded platforms of ARM microcontrollers and FPGA," M.S. thesis, Dept. Biomed. Eng., National Cheng Kung Univ., Tainan, Taiwan, 2025.
[20] P. Busia, M. A. Scrugli, V. J. Jung, L. Benini, and P. Meloni, "A tiny transformer for low-power arrhythmia classification on microcontrollers," IEEE Trans. Biomed. Circuits Syst., vol. 19, pp. 142–152, 2024, doi: 10.1109/TBCAS.2024.3401858.
[21] Y. Akbari, N. Lei, N. Patel, Y. Peng, and O. Faust, "Atrial fibrillation detection on the embedded edge: Energy-efficient inference on a low-power microcontroller," Sensors, vol. 25, no. 21, p. 6601, 2025, doi: 10.3390/s25216601.
[22] S. S. Saha, S. S. Sandha, and M. Srivastava, "Machine learning for microcontroller-class hardware: A review," IEEE Sensors J., vol. 22, no. 22, pp. 21362–21390, 2022, doi: 10.1109/JSEN.2022.3210128.
[23] S. Sah et al., "MCUBench: A benchmark of tiny object detectors on MCUs," in Computer Vision – ECCV 2024 Workshops, 2025, pp. 295–311, doi: 10.1007/978-3-031-91979-4_22.
[24] Z. Ai, L. Zheng, H. Qi, and W. Cui, "Low-power wireless wearable ECG monitoring system based on BMD101," in Proc. 37th Chinese Control Conf. (CCC), 2018, pp. 7374–7379, doi: 10.23919/ChiCC.2018.8484125.
[25] Quadric, "Accelerating YOLO NPU NMS object detection," Technical blog, 2022.
[26] D. Yang, L. Chen, X. Hao, and Y. Zhang, "Object detection post processing accelerator based on co-design of hardware and software," Information, vol. 16, no. 1, p. 63, 2025, doi: 10.3390/info16010063.
[27] STMicroelectronics, "STM32 AI Model Zoo," 2025. [Online]. Available: https://github.com/STMicroelectronics/stm32ai-modelzoo
[28] STMicroelectronics, "UM3385: Discovery kit with STM32MP257F MPU," 2025. [Online]. Available: https://www.st.com/resource/en/user_manual/um3385-discovery-kit-with-stm32mp257f-mpu-stmicroelectronics.pdf
[29] 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, doi: 10.1016/j.measurement.2021.109243.
[30] G. B. Moody and R. G. Mark, "The impact of the MIT-BIH Arrhythmia Database," IEEE Eng. Med. Biol. Mag., vol. 20, no. 3, pp. 45–50, 2001, doi: 10.1109/51.932724.
[31] A. L. Goldberger et al., "PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals," Circulation, vol. 101, no. 23, pp. e215–e220, 2000, doi: 10.1161/01.CIR.101.23.e215.
[32] Association for the Advancement of Medical Instrumentation, ANSI/AAMI EC57:2012 — Testing and Reporting Performance Results of Cardiac Rhythm and ST Segment Measurement Algorithms, 2012.
[33] STMicroelectronics, "ST Edge AI Developer Cloud," 2025. [Online]. Available: https://stedgeai-dc.st.com/home
[34] WhaleTeq Co., Ltd., "AECG100 ECG Simulator User Manual," v.1.7.0, 2024. [Online]. Available: https://www.whaleteq.com/data/gdownload/files/health_wearables_testing/aecg100/manual/um_mix_en_v.1.7.0_240430.pdf
[35] STMicroelectronics Community, "Porting YOLOv11 model to STM32MP257," 2025. [Online]. Available: https://community.st.com/t5/edge-ai/porting-yolov11-model-to-stm32mp257/td-p/846679
[36] F. Pedregosa et al., "Scikit-learn: Machine learning in Python," J. Mach. Learn. Res., vol. 12, pp. 2825–2830, 2011.
[37] P. de Chazal, M. O’Dwyer, and R. B. Reilly, "Automatic classification of heartbeats using ECG morphology and heartbeat interval features," IEEE Trans. Biomed. Eng., vol. 51, no. 7, pp. 1196–1206, 2004, doi: 10.1109/TBME.2004.827359.
[38] Z. Zou, K. Chen, Z. Shi, Y. Guo, and J. Ye, "Object detection in 20 years: A survey," Proc. IEEE, vol. 111, no. 3, pp. 257–276, 2023, doi: 10.1109/JPROC.2023.3238524.
[39] M. Horowitz, "1.1 Computing’s energy problem (and what we can do about it)," in Proc. IEEE Int. Solid-State Circuits Conf. (ISSCC), 2014, pp. 10–14, doi: 10.1109/ISSCC.2014.6757323.
[40] H. A. Abushahla, D. Varam, A. J. N. Panopio, and M. I. AlHajri, "Neural network quantization for microcontrollers: A comprehensive survey of methods, platforms, and applications," arXiv:2508.15008, 2025.
[41] M. Nagel, M. Fournarakis, R. A. Amjad, Y. Bondarenko, M. van Baalen, and T. Blankevoort, "A white paper on neural network quantization," arXiv:2106.08295, 2021.
[42] STMicroelectronics, "X-LINUX-AI OpenSTLinux expansion package," 2025. [Online]. Available: https://www.st.com/en/embedded-software/x-linux-ai.html
[44] M. Rahman and B. I. Morshed, "Resource-constrained on-chip AI classifier for beat-by-beat real-time arrhythmia detection with an ECG wearable system," Electronics, vol. 14, no. 13, p. 2654, 2025, doi: 10.3390/electronics14132654.
[43] Z. Binici, T. Intzilakis, O. W. Nielsen, L. Køber, and A. Sajadieh, "Excessive supraventricular ectopic activity and increased risk of atrial fibrillation and stroke," Circulation, vol. 121, no. 17, pp. 1904–1911, 2010, doi: 10.1161/CIRCULATIONAHA.109.874982.
[45] S. Williams, A. Waterman, and D. Patterson, "Roofline: An insightful visual performance model for multicore architectures," Commun. ACM, vol. 52, no. 4, pp. 65–76, 2009, doi: 10.1145/1498765.1498785.
[46] R. Yang, Z. Chen, B. Wang, Y. Guo, and L. Hu, "A lightweight detection method for remote sensing images and its energy-efficient accelerator on edge devices," Sensors, vol. 23, no. 14, p. 6497, 2023, doi: 10.3390/s23146497.
[47] M. Nottebaum, M. Dunnhofer, and C. Micheloni, "Beyond MACs: Hardware efficient architecture design for vision backbones," Int. J. Comput. Vis., vol. 134, p. 295, 2026, doi: 10.1007/s11263-026-02873-5.