Deploying Deep Medical Segmentation Models on Edge Devices: A Case Study of Nested U-Net with Attention and Fuzzy Pooling on Raspberry Pi
Keywords:
Attention Mechanism, Deep Learning for Medical Imaging, Fuzzy Pooling, Nested U-Net, Raspberry PiAbstract
The process of medical image segmentation plays a critical role in modern diagnosis, but most
high-performance deep learning models require significant computational resources that limit their use in
real-time or remote clinical settings. This study addresses this gap by proposing a lightweight hybrid
segmentation framework optimized for Raspberry Pi deployment, which can be defined as a cost-effective,
portable, energy-efficient platform suitable for point-of-care medical applications. The model integrates the
improved U-Net backbones with attention and fuzzy pooling mechanisms to improve segmentation
accuracy while maintaining a compact computational footprint. The proposed model was evaluated on the
cardiac magnetic resonance imaging ACDC dataset, achieving a mean Dice score of 98.21% and a
classification accuracy of 98%. Most importantly of all, real-time inference on Raspberry Pi was achieved
with minimal latency and resource consumption, and this demonstrates the model's suitability for edge
deployment in low-resource or remote environments. These results underscore the possibility of embedding
advanced segmentation models into lightweight devices to enable scalable medical image analysis that can
be accessed across diverse clinical scenarios.
Downloads
References
G. Huang, et al., “Channel-Attention U-Net: Channel Attention Mechanism for Semantic Segmentation of Esophagus and Esophageal Cancer,” IEEE Access, vol. 8, pp. 122798–122810, 2020. doi: 10.1109/ACCESS.2020.3007719.
A. K. Dennis, Raspberry Pi Computer Architecture Essentials, 2016.
Z. Zhou, M. M. R. Siddiquee, N. Tajbakhsh, and J. Liang, “UNet++: A Nested U-Net Architecture for Medical Image Segmentation,” Lecture Notes in Computer Science, vol. 11045, pp. 3–11, 2018. doi: 10.1007/978-3-030-00889-5_1.
X. Fan, et al., “DMC-UNet-Based Segmentation of Lung Nodules,” IEEE Access, vol. 11, pp. 110809–110826, 2023. doi: 10.1109/ACCESS.2023.3322437.
D. E. Diamantis and D. K. Iakovidis, “Fuzzy Pooling,” IEEE Transactions on Fuzzy Systems, vol. 29, no. 11, pp. 3481–3488, 2021. doi: 10.1109/TFUZZ.2020.3024023.
O. Bernard, et al., “Deep Learning Techniques for Automatic MRI Cardiac Multi-Structures Segmentation and Diagnosis: Is the Problem Solved?,” IEEE Transactions on Medical Imaging, vol. 37, no. 11, pp. 2514–2525, 2018. doi: 10.1109/TMI.2018.2837502.
A. Al-Saegh, A. Daood, and M. H. Ismail, “Dual Optimization of Deep CNN for Motor Imagery EEG Tasks Classification,” Diyala Journal of Engineering Sciences, vol. 17, no. 4, pp. 75–91, 2024. doi: 10.24237/djes.2024.17405.
R. Ahmmed, A. S. Swakshar, M. F. Hossain, and M. A. Rafiq, “Classification of Tumors and Its Stages in Brain MRI Using SVM and ANN,” in Proceedings of the ECCE 2017, pp. 229–234, 2017. doi: 10.1109/ECACE.2017.7912909.
D. A. Shoieb, et al., “CAT-Seg: Cascaded Medical Assistive Tool Integrating Residual Attention and Squeeze-Net,” Phys. Eng. Sci. Med., vol. 47, no. 1, pp. 153–168, 2024. doi: 10.1007/s13246-023-01352-2.
M. Z. Alom, et al., “Recurrent Residual U-Net for Medical Image Segmentation,” Journal of Medical Imaging, vol. 6, no. 1, 014006, 2019. doi: 10.1117/1.jmi.6.1.014006.
M. Cui, et al., “CM-Unet: A Novel Remote Sensing Image Segmentation Method,” IEEE Access, vol. 11, pp. 56994–57005, 2023. doi: 10.1109/ACCESS.2023.3282778.
H. Cao, et al., “Swin-Unet: U-Net-Like Pure Transformer for Medical Image Segmentation,” Lecture Notes in Computer Science, vol. 13803, pp. 205–218, 2023. doi: 10.1007/978-3-031-25066-8_9.
H. Ye, et al., “FMAM-Net: Fusion Multi-Scale Attention for Building Segmentation,” IEEE Access, vol. 10, pp. 134241–134251, 2022. doi: 10.1109/ACCESS.2022.3231362.
M. H. Guo, et al., “Attention Mechanisms in Computer Vision: A Survey,” Computational Visual Media, vol. 8, no. 3, pp. 331–368, 2022. doi: 10.1007/s41095-022-0271-y.
N. Abdullah and S. Al-Kazzaz, “Evaluation of Physiotherapy Exercise by Motion Capturing Based on AI,” Al-Rafidain Engineering Journal, vol. 28, no. 2, pp. 237–251, 2023. doi: 10.33899/rengj.2023.138562.1235.
H. Wang, et al., “Multilevel Attention U-Net Segmentation Algorithm for Lung Cancer,” Computers, Materials & Continua, vol. 78, no. 2, pp. 1569–1589, 2024. doi: 10.32604/cmc.2023.046821.
H. Y. Zhou, et al., “nnFormer: Interleaved Transformer for Volumetric Segmentation,” arXiv preprint, pp. 1–10, 2021. Available: http://arxiv.org/abs/2109.03201
D. Cheng, et al., “Attention Based Multi-Scale Nested Network for Biomedical Segmentation,” Heliyon, vol. 10, no. 14, e33892, 2024. doi: 10.1016/j.heliyon.2024.e33892.
H. Cui, H. Pan, and K. Zhang, “SCU-Net++: A Nested U-Net with Sharpening Filter and Channel Attention,” Wireless Communications and Mobile Computing, vol. 2022, article ID 2848365, 2022. doi: 10.1155/2022/2848365.
A. Al-Saegh, “Identifying a Suitable Signal Processing Technique for MI EEG Data,” Tikrit Journal of Engineering Sciences, vol. 30, no. 3, pp. 140–147, 2023. doi: 10.25130/tjes.30.3.14.
Z. Mahmoud and M. A. M. Abdullah, “Comparison of Deep Learning and Machine Learning Techniques for Diagnosis of Acute Lymphoblastic Leukemia,” Al-Rafidain Engineering Journal, vol. 30, no. 1, pp. 175–185, 2025. doi: 10.33899/arej.2024.152478.1366.
A. Kumar, et al., “Sarcasm Detection Using Multi-Head Attention Based Bidirectional LSTM,” IEEE Access, vol. 8, pp. 6388–6397, 2020. doi: 10.1109/ACCESS.2019.2963630.
S. Karthikeyan, et al., “A Systematic Analysis on Raspberry Pi Prototyping: Uses, Challenges, Benefits, and Drawbacks,” IEEE Internet of Things Journal, vol. 10, no. 16, pp. 14397–14417, 2023. doi: 10.1109/JIOT.2023.3262942.
A. Al-Saegh, S. A. Dawwd, and J. M. Abdul-Jabbar, “Towards Efficient Motor Imagery EEG-Based BCI Systems Using DCNN,” in 2024 Arab ICT Conference (AICTC), pp. 59–66, 2024. doi: 10.1109/AICTC58357.2024.10735028.
M. M. Hasan, et al., “FP-CNN: Fuzzy Pooling-Based CNN for Lung Ultrasound Classification with Explainable AI,” Computers in Biology and Medicine, vol. 165, 107407, 2023. doi: 10.1016/j.compbiomed.2023.107407.
W. Liu, Y. Sun, and Q. Ji, “MDAN-UNet: Multi-Scale and Dual Attention Enhanced Nested U-Net,” Algorithms, vol. 13, no. 3, 2020. doi: 10.3390/a13030060.
Y. Jia, L. Liu, and C. Zhang, “Moon Impact Crater Detection Using Nested Attention UNet++,” IEEE Access, vol. 9, pp. 44107–44116, 2021. doi: 10.1109/ACCESS.2021.3066445.
L. Li, et al., “ICUnet++: An Inception-CBAM Network Based on UNet++ for MR Spine Segmentation,” International Journal of Machine Learning and Cybernetics, vol. 14, no. 10, pp. 3671–3683, 2023. doi: 10.1007/s13042-023-01857-y.
G. Bekaroo and A. Santokhee, “Power Consumption of the Raspberry Pi: A Comparative Analysis,” in Proceedings of the 2016 IEEE International Conference on Emerging Technologies (EmergiTech), pp. 361–366, 2016. doi: 10.1109/EmergiTech.2016.7737367.
W. Glegoła, A. Karpus, and A. Przybyłek, “MobileNet Family Tailored for Raspberry Pi,” Procedia Computer Science, vol. 192, pp. 2249–2258, 2021. doi: 10.1016/j.procs.2021.08.238.
M. Ali, et al., “Brain Tumour Image Segmentation Using Deep Networks,” IEEE Access, vol. 8, pp. 153589–153598, 2020. doi: 10.1109/ACCESS.2020.3018160.
A. Dosovitskiy, et al., “An Image Is Worth 16x16 Words: Transformers for Image Recognition at Scale,” in Proceedings of the International Conference on Learning Representations (ICLR), 2021. Available: https://arxiv.org/abs/2010.11929
J. Chen, et al., “TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation,” arXiv preprint, pp. 1–13, 2021. Available: https://arxiv.org/abs/2102.04306
A. Tragakis, et al., “The Fully Convolutional Transformer for Medical Image Segmentation,” in Proceedings of the IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 3649–3658, 2023. doi: 10.1109/WACV56688.2023.00365.
C. Li, et al., “ANU-Net: Attention-Based Nested U-Net to Exploit Full Resolution Features,” Computers & Graphics, vol. 90, pp. 11–20, 2020. doi: 10.1016/j.cag.2020.05.003.
D. Keč and I. Kunović, “Ball Detection Using Deep Learning Implemented on an Educational Robot Based on Raspberry Pi,” Sensors, vol. 23, no. 8, 4071, 2023. doi: 10.3390/s23084071.
S. P. Baller, et al., “DeepEdgeBench: Benchmarking DNNs on Edge Devices,” in Proceedings of the IEEE International Conference on Cloud Engineering (IC2E), pp. 20–30, 2021. doi: 10.1109/IC2E52221.2021.00016.
R. B. Loureiro, et al., “Efficient Deployment of Machine Learning Models on Microcontrollers: Quantization and Pruning,” Proceedings Blucher, 2023. doi: 10.5151/siintec2023-305873.
P. D. I. Torino, Master Degree Thesis: Neural Networks Hardware-Specific Optimization Using Different Frameworks, 2022.