Dynamic U-Net: A lightweight hierarchical network for accurate and efficient sperm morphology segmentation
Accurate sperm segmentation is essential for automated semen analysis and male fertility assessment, yet existing methods struggle to balance segmentation accuracy with computational efficiency. We propose Dynamic U-Net (Dy-UNet), a novel lightweight deep learning architecture that achieves state-of-the-art performance while maintaining exceptional efficiency. The architecture integrates four key innovations: a cross-resolution dual-branch network that preserves high-resolution spatial details, a dynamic snake convolution that adapts to curved sperm morphology, a grouped multi-axis Hadamard product attention that efficiently captures long-range dependencies, and a fast cross-resolution aggregation that enables multi-scale feature fusion. Comprehensive evaluation on the SegSperm dataset demonstrates that Dy-UNet substantially outperforms existing methods. Dy-UNet achieves a state-of-the-art mean Intersection over Union of 0.44260 and Dice similarity coefficient of 0.61362, which surpasses the baseline U-Net by 25.5% and 17.7%, respectively. Remarkably, Dy-UNet achieves this superior performance with only 184 K parameters, especially suitable for deploying mobile platforms and embedded systems in clinical settings. The lightweight architecture enables accurate, objective, and accessible automated sperm morphology assessment with significant implications for clinical fertility diagnosis and point-of-care testing.

- World Health Organization. Infertility Prevalence Estimates, 1990-2021; 2023. Available from: https://www.who.int/ publications/i/item/978920068315 [Last accessed on 2025 Sep 26].
- Cox CM, Thoma ME, Tchangalova N, et al. Infertility prevalence and the methods of estimation from 1990 to 2021: A systematic review and meta-analysis. Hum Reprod Open. 2022;2022(4):hoac051. doi: 10.1093/hropen/hoac051
- World Health Organisation. WHO Laboratory Manual for the Examination and Processing of Human Semen; 2021. Available from: https://www.who.int/publications/i/ item/9789240030787 [Last accessed on 2025 Sep 26].
- Chang V, Saavedra JM, Castañeda V, Sarabia L, Hitschfeld N, Härtel S. Gold-standard and improved framework for sperm head segmentation. Comput Methods Progr Biomed. 2014;117(2):225-237. doi: 10.1016/j.cmpb.2014.06.018
- Lee RKK, Hou JW, Ho HY, et al. Sperm morphology analysis using strict criteria as a prognostic factor in intrauterine insemination. Int J Androl. 2002;25(5):277-280. doi: 10.1046/j.1365-2605.2002.00355.x
- Katz DF, Overstreet JW, Samuels SJ, Niswander PW, Bloom TD, Lewis EL. Morphometric analysis of spermatozoa in the assessment of human male fertility. J Androl. 1986;7(4):203-210. doi: 10.1002/j.1939-4640.1986.tb00913.x
- Chen W, Song H, Dai C, et al. Automated Sperm Morphology Analysis Based on Instance-Aware Part Segmentation. [Preprint]; 2024. p. 17743-17749. doi: 10.1109/icra57147.2024.10611339
- Dai C, Zhang Z, Huang J, et al. Automated non-invasive measurement of single sperm’s motility and morphology. EEE Trans Med Imaging. 2018;37(10):2257-2265. doi: 10.1109/tmi.2018.2840827
- Dai W, Wu Z, Liu R, et al. Automated non-invasive analysis of motile sperms using sperm feature-correlated network. IEEE Trans Autom Sci Eng. 2024;22:3960-3970. doi: 10.1109/tase.2024.3404488
- Brennan P, Silman A. Statistical methods for assessing observer variability in clinical measures. BMJ. 1992;304(6840):1491-1494. doi: 10.1136/bmj.304.6840.1491
- Lewandowska E, Węsierski D, Mazur-Milecka M, Liss J, Jezierska A. Ensembling noisy segmentation masks of blurred sperm images. Comput Biol Med. 2023;166:107520. doi: 10.1016/j.compbiomed.2023.107520
- Ilhan HO, Serbes G, Aydin N. Dual Tree Complex Wavelet Transform Based Sperm Abnormality Classification. In: 2018 41st International Conference on Telecommunications and Signal Processing (TSP); 2018. p. 1-5. doi: 10.1109/tsp.2018.8441431
- Shaker F, Monadjemi SA, Alirezaie J, Naghsh-Nilchi AR. A dictionary learning approach for human sperm heads classification. Comput Biol Med. 2017;91:181-190. doi: 10.1016/j.compbiomed.2017.10.009
- Chang V, Garcia A, Hitschfeld N, Härtel S. Gold-standard for computer-assisted morphological sperm analysis. Comput Biol Med. 2017;83:143-150. doi: 10.1016/j.compbiomed.2017.03.004
- Riordon J, McCallum C, Sinton D. Deep learning for the classification of human sperm. Comput Biol Med. 2019;111:103342-103342. doi: 10.1016/j.compbiomed.2019.103342
- Ilhan HO, Serbes G. Sperm morphology analysis by using the fusion of two-stage fine-tuned deep networks. Biomed Sign Process Control. 2021;71:103246. doi: 10.1016/j.bspc.2021.103246
- Yüzkat M, Ilhan HO, Aydin N. Multi-model CNN fusion for sperm morphology analysis. Comput Biol Med. 2021;137:104790-104790. doi: 10.1016/j.compbiomed.2021.104790
- Liu R, Wang M, Wang M, Yin J, Yuan Y, Liu J. Automatic microscopy analysis with transfer learning for classification of human sperm. Appl Sci. 2021;11(12):5369-5369. doi: 10.3390/app11125369
- Zhang Y, Zhang J, Zha X, Zhou Y, Cao Y, Chen D. Improving Human Sperm Head Morphology Classification With Unsupervised Anatomical Feature Distillation. In: 2022 IEEE 19th International Symposium on Biomedical Imaging (ISBI). United States: IEEE; 2022. p. 1-5. doi: 10.1109/isbi52829.2022.9761633
- Fariba Shaker. Human Sperm Head Morphology Dataset (HuSHeM). Australia: OPAL (Open@LaTrobe) (La Trobe University); 2018. p. 3. doi: 10.17632/tt3yj2pf38.3
- Ilhan HO, Sigirci IO, Serbes G, Aydin N. A fully automated hybrid human sperm detection and classification system based on mobile-net and the performance comparison with conventional methods. Med. Biol. Eng. Comput. 2020;58(5):1047-1068. doi: 10.1007/s11517-019-02101-y
- Aktas A, Serbes G, Huner Yigit M, Aydin N, Uzun H, Osman Ilhan H. Hi-LabSpermMorpho: A novel expert-labeled dataset with extensive abnormality classes for deep learning-based sperm morphology analysis. IEEE Access. 2024;12:196070-196091. doi: 10.1109/access.2024.3521643
- Sapkota N, Zhang Y, Li S, et al. Shmc-Net: A Mask-Guided Feature Fusion Network for Sperm Head Morphology Classification. In: 2024 IEEE International Symposium on Biomedical Imaging (ISBI); 2024. p. 1-5. doi: 10.1109/isbi56570.2024.10635339
- Yi WJ, Park KS, Paick JS. Parameterized characterization of elliptic sperm heads using fourier representation and wavelet transform. In: Proceedings of the 20th Annual International Conference of the IEEE Engineering in Medicine and Biology Society. Vol.20 Biomedical Engineering Towards the Year 2000 and Beyond (Cat. No.98CH36286). Vol. 2. United States: IEEE; 1998. p. 974-977. doi: 10.1109/iembs.1998.745610
- Ronneberger O, Fischer P, Brox T. U-Net: Convolutional networks for biomedical image segmentation. In: International Conference on Medical Image Computing and Computer Assisted Intervention. Berlin: Springer; 2015. p. 234-241. doi: 10.1007/978-3-319-24574-4_28
- Zhou Z, Siddiquee MMR, Tajbakhsh N, Liang J. UNet++: Redesigning skip connections to exploit multiscale features in image segmentation. IEEE Trans Med Imaging. 2020;39(6):1856-1867. doi: 10.1109/tmi.2019.2959609
- Ruan J, Xiang S, Xie M, Liu T, Fu Y. MALUNet: A multi-attention and light-weight UNet for skin lesion segmentation. In: 2022 IEEE International Conference on Bioinformatics and Biomedicine (BIBM). United States: IEEE; 2022. p. 1150-1156. doi: 10.1109/bibm55620.2022.9995040
- Ruan J, Xie M, Gao J, Liu T, Fu Y. EGE-UNet: An efficient group enhanced UNet for skin lesion segmentation. In: Lecture Notes in Computer Science. Berlin: Springer Nature Switzerland; 2023. p. 481-490. doi: 10.1007/978-3-031-43901-8_46
- Dai W, Liu R, Wu Z, et al. Exploiting scale-variant attention for segmenting small medical objects. IEEE Trans Neural Netw Learn Syst. 2026:1-18. doi: 10.1109/tnnls.2025.3645355
- Oktay O, Schlemper J, Folgoc LL, et al. Attention U-Net: Learning Where to Look for the Pancreas. arXiv [Preprint]; 2018. doi: 10.48550/arXiv.1804.03999
- Zhou Z, Rahman Siddiquee MM, Tajbakhsh N, Liang J. UNet++: A nested u-net architecture for medical image segmentation. In: Deep Learning in Medical Image Analysis and Multimodal Learning for Clinical Decision Support. Vol. 11045. Berlin: Springer; 2018. p. 3-11. doi: 10.1007/978-3-030-00889-5_1
- Chen J, Lu Y, Yu Q, et al. TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation. arXiv [Preprint]; 2021. doi: 10.48550/arXiv.2102.04306
- Dosovitskiy A, Beyer L, Kolesnikov A, et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv [Preprint]; 2020. doi: 10.48550/arXiv.2010.11929
- Cao H, Wang Y, Chen J, et al. Swin-unet: Unet-like pure transformer for medical image segmentation. In: Lecture Notes in Computer Science. Berlin: Springer Nature Switzerland; 2023. p. 205-218. doi: 10.1007/978-3-031-25066-8_9
- Liu Z, Lin Y, Cao Y, et al. Swin transformer: Hierarchical vision transformer using shifted windows. In: 2021 IEEE/ CVF International Conference on Computer Vision (ICCV). United States: IEEE; 2021. p. 9992-10002. doi: 10.1109/iccv48922.2021.00986
- Howard AG, Zhu M, Chen B, et al. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. arXiv [Preprint]; 2017. doi: 10.48550/arXiv.1704.04861
- Sandler M, Howard A, Zhu M, Zhmoginov A, Chen LC. MobileNetV2: Inverted residuals and linear bottlenecks. In: 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. United States: IEEE; 2018. p. 4510-4520. doi: 10.1109/cvpr.2018.00474
- Ma N, Zhang X, Zheng HT, Sun J. ShuffleNet V2: Practical guidelines for efficient CNN architecture design. In: Computer Vision - ECCV 2018 (Lecture Notes in Computer Science). Berlin: Springer International Publishing; 2018. p. 122-138. doi: 10.1007/978-3-030-01264-9_8
- Yu C, Wang J, Peng C, Gao C, Yu G, Sang N. BiSeNet: Bilateral segmentation network for real-time semantic segmentation. In: Computer Vision - ECCV 2018 (Lecture Notes in Computer Science). Berlin: Springer International Publishing; 2018. p. 334-349. doi: 10.1007/978-3-030-01261-8_20
- Zhao H, Qi X, Shen X, Shi J, Jia J. ICNet for real-time semantic segmentation on high-resolution images. In: Computer Vision - ECCV 2018 (Lecture Notes in Computer Science). Berlin: Springer International Publishing; 2018. p. 418-434. doi: 10.1007/978-3-030-01219-9_25
- Jiang J, Wang M, Tian H, Cheng L, Liu Y. LV-UNet: A lightweight and vanilla model for medical image segmentation. In: 2024 IEEE International Conference on Bioinformatics and Biomedicine (BIBM). United States: IEEE; 2024. p. 4240-4246. doi: 10.1109/bibm62325.2024.10822465
- Howard A, Sandler M, Chen B, et al. Searching for mobileNetV3. In: 2019 IEEE/CVF International Conference on Computer Vision (ICCV). United States: IEEE; 2019. p. 1314-1324. doi: 10.1109/iccv.2019.00140
- Yu C, Xiao B, Gao C, et al. Lite-HRNet: A Lightweight high-resolution network. In: 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). United States: IEEE; 2021. p. 10435-10445. doi: 10.1109/cvpr46437.2021.01030
- Qi Y, He Y, Qi X, Zhang Y, Yang G. Dynamic snake convolution based on topological geometric constraints for tubular structure segmentation. In: 2023 IEEE/CVF International Conference on Computer Vision (ICCV). United States: IEEE; 2023. p. 6047-6056. doi: 10.1109/iccv51070.2023.00558
- Lewandowska E, Węsierski D, Mazur-Milecka M, Liss J, Jezierska A. SegSperm: A Dataset of Sperm Images for Blurry and Small Object Segmentation. London: Open Research Data, Bridge of Knowledge; 2023. doi: 10.34808/6wm7-1159
- Alom MZ, Yakopcic C, Hasan M, Taha TM, Asari VK. Recurrent residual U-Net for medical image segmentation. J Med Imaging (Bellingham). 2019;6(01):014006. doi: 10.1117/1.jmi.6.1.014006
- Yang Z, Peng X, Yin Z, Yang Z. Deeplab_v3_plus-net for image semantic segmentation with channel compression. In: 2020 IEEE 20th International Conference on Communication Technology (ICCT). United States: IEEE; 2020. p. 1320-1324. doi: 10.1109/icct50939.2020.9295748
