Document Type : Technical Paper

Authors

Faculty of Electrical and Computer Engineering, University of Tabriz, Iran.

Abstract

Medical image analysis, crucial for disease diagnosis and treatment, often suffers from the challenge of class imbalance, where the area of normal tissue significantly outweighs that of abnormal regions. Furthermore, the varying class ratios across different images within a dataset complicate the application of uniform loss adjustments. To address these issues and advance automated segmentation, this study proposes a novel deep learning model integrating the strengths of YOLO Version 8's efficient feature extraction modules (SPPF and C2F) within a U-shaped architecture enhanced by a Receptive Field Enhancement (RFE) module. The RFE module, acting as an advanced skip connection, strategically fuses multi-scale features from corresponding and subsequent encoder layers processed through SPPF and C2F to enrich feature transfer and improve receptive field. To specifically tackle the class imbalance and the diversity of class distributions across images, we introduce a novel Adapt Exponential Loss function. This pixel-level loss dynamically adjusts class weights for each image based on its individual lesion-to-total-pixel ratio (k). We evaluated our proposed model and loss function on challenging skin lesion datasets: ISIC 2018, ISIC 2017, and PH2. Our method achieved significant segmentation performance with IoU scores of 86.47%, 85.67%, and 93.13%, and Dice scores of 91.63%, 90.19%, and 96.02% on ISIC 2018, ISIC 2017, and PH2, respectively, demonstrating its effectiveness in accurately delineating skin lesions despite class imbalance and varying lesion proportions. This work contributes a robust framework for medical image segmentation, facilitating more reliable diagnostic tools in dermatology.

Keywords

Main Subjects

[1] N. Badshah and A. Ahmad, "ResBCU-Net: Deep learning approach for segmentation of skin images," Biomedical Signal Processing and Control, vol. 71, p. 103137, 2022.
 
[2] M. Dildar et al., "Skin cancer detection: a review using deep learning techniques," International journal of environmental research and public health, vol. 18, no. 10, p. 5479, 2021.
 
[3] S. Roshan, J. Tanha, M. Zarrin, A. F. Babaei, H. Nikkhah, and Z. Jafari, "A deep ensemble medical image segmentation with novel sampling method and loss function," Computers in Biology and Medicine, vol. 172, p. 108305, 2024.
 
[4] O. Ronneberger, P. Fischer, and T. Brox, "U-net: Convolutional networks for biomedical image segmentation," in Medical image computing and computer-assisted intervention–MICCAI 2015: 18th international conference, Munich, Germany, October 5-9, 2015, proceedings, part III 18, 2015: Springer, pp. 234-241.
 
[5] V. Badrinarayanan, A. Kendall, and R. Cipolla, "Segnet: A deep convolutional encoder-decoder architecture for image segmentation," IEEE transactions on pattern analysis and machine intelligence, vol. 39, no. 12, pp. 2481-2495, 2017.
 
[6] J. Long, E. Shelhamer, and T. Darrell, "Fully convolutional networks for semantic segmentation," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2015, pp. 3431-3440.
 
[7] Zhou, Z., Rahman Siddiquee, M.M., Tajbakhsh, N. and Liang, J., 2018, September. Unet++: A nested u-net architecture for medical image segmentation. In International workshop on deep learning in medical image analysis (pp. 3-11). Cham: Springer International Publishing.
 
[8] Oktay, O., Schlemper, J., Folgoc, L.L., Lee, M., Heinrich, M., Misawa, K., Mori, K., McDonagh, S., Hammerla, N.Y., Kainz, B. and Glocker, B., 2018. Attention u-net: Learning where to look for the pancreas. arXiv preprint arXiv:1804.03999.
 
[9] Çiçek, Ö., Abdulkadir, A., Lienkamp, S.S., Brox, T. and Ronneberger, O., 2016, October. 3D U-Net: learning dense volumetric segmentation from sparse annotation. In International conference on medical image computing and computer-assisted intervention (pp. 424-432). Cham: Springer International Publishing.
 
[10] Jadon, S., 2020, October. A survey of loss functions for semantic segmentation. In 2020 IEEE conference on computational intelligence in bioinformatics and computational biology (CIBCB) (pp. 1-7). IEEE.
 
[11] Diakogiannis, F.I., Waldner, F., Caccetta, P. and Wu, C., 2020. ResUNet-a: A deep learning framework for semantic segmentation of remotely sensed data. ISPRS Journal of Photogrammetry and Remote Sensing162, pp.94-114.
 
[12] Ruan, J., Xiang, S., Xie, M., Liu, T. and Fu, Y., 2022, December. Malunet: A multi-attention and light-weight unet for skin lesion segmentation. In 2022 IEEE International Conference on Bioinformatics and Biomedicine (BIBM) (pp. 1150-1156). IEEE.
 
[13] Valanarasu, J.M.J. and Patel, V.M., 2022, September. Unext: Mlp-based rapid medical image segmentation network. In International conference on medical image computing and computer-assisted intervention (pp. 23-33). Cham: Springer Nature Switzerland.
 
[14] J. Redmon, "You only look once: Unified, real-time object detection," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016.
 
[15] He, K., Zhang, X., Ren, S. and Sun, J., 2016. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 770-778).
 
[16] Ragab, M.G., Abdulkadir, S.J., Muneer, A., Alqushaibi, A., Sumiea, E.H., Qureshi, R., Al-Selwi, S.M. and Alhussian, H., 2024. A comprehensive systematic review of YOLO for medical object detection (2018 to 2023). IEEE Access12, pp.57815-57836.
 
[17] Darlow, L.N. and Storkey, A., 2020. What information does a ResNet compress?. arXiv preprint arXiv:2003.06254.
 
[18] Han, Z., Jian, M. and Wang, G.G., 2022. ConvUNeXt: An efficient convolution neural network for medical image segmentation. Knowledge-based systems253, p.109512.
 
[19] Valanarasu, J.M.J., Oza, P., Hacihaliloglu, I. and Patel, V.M., 2021, September. Medical transformer: Gated axial-attention for medical image segmentation. In International conference on medical image computing and computer-assisted intervention (pp. 36-46). Cham: Springer International Publishing.
 
[20] Nikkhah, H., Tanha, J., Zarrin, M., Roshan, S. and Kazempour, A., 2025. YM-WML: A new Yolo-based segmentation Model with Weighted Multi-class Loss for medical imaging. arXiv preprint arXiv:2506.22955.
 
[21] Nasalwai, N., Punn, N.S., Sonbhadra, S.K. and Agarwal, S., 2021, May. Addressing the class imbalance problem in medical image segmentation via accelerated tversky loss function. In Pacific-Asia conference on knowledge discovery and data mining (pp. 390-402). Cham: Springer International Publishing.
 
[23] Li, X., Li, M., Yan, P., Li, G., Jiang, Y., Luo, H. and Yin, S., 2023. Deep learning attention mechanism in medical image analysis: Basics and beyonds. International Journal of Network Dynamics and Intelligence, pp.93-116.
 
[24] Cao, H., Wang, Y., Chen, J., Jiang, D., Zhang, X., Tian, Q. and Wang, M., 2022, October. Swin-unet: Unet-like pure transformer for medical image segmentation. In European conference on computer vision (pp. 205-218). Cham: Springer Nature Switzerland.
 
[25] Codella, N.C., Gutman, D., Celebi, M.E., Helba, B., Marchetti, M.A., Dusza, S.W., Kalloo, A., Liopyris, K., Mishra, N., Kittler, H. and Halpern, A., 2018, April. Skin lesion analysis toward melanoma detection: A challenge at the 2017 international symposium on biomedical imaging (isbi), hosted by the international skin imaging collaboration (isic). In 2018 IEEE 15th international symposium on biomedical imaging (ISBI 2018) (pp. 168-172). IEEE.
 
[26] Codella, N., Rotemberg, V., Tschandl, P., Celebi, M.E., Dusza, S., Gutman, D., Helba, B., Kalloo, A., Liopyris, K., Marchetti, M. and Kittler, H., 2019. Skin lesion analysis toward melanoma detection 2018: A challenge hosted by the international skin imaging collaboration (isic). arXiv preprint arXiv:1902.03368.
 
[27] Mendonça, T., Ferreira, P.M., Marques, J.S., Marcal, A.R. and Rozeira, J., 2013, July. PH 2-A dermoscopic image database for research and benchmarking. In 2013 35th annual international conference of the IEEE engineering in medicine and biology society (EMBC) (pp. 5437-5440). IEEE.
 
[28] Venkatesh, G.M., Naresh, Y.G., Little, S. and O’Connor, N.E., 2018, September. A deep residual architecture for skin lesion segmentation. In International Workshop on Computer-Assisted and Robotic Endoscopy (pp. 277-284). Cham: Springer International Publishing.
 
[29] Al-Masni, M.A., Al-Antari, M.A., Choi, M.T., Han, S.M. and Kim, T.S., 2018. Skin lesion segmentation in dermoscopy images via deep full resolution convolutional networks. Computer methods and programs in biomedicine162, pp.221-231.
 
[30] Goyal, M., Oakley, A., Bansal, P., Dancey, D. and Yap, M.H., 2019. Skin lesion segmentation in dermoscopic images with ensemble deep learning methods. Ieee Access8, pp.4171-4181.
 
[31] K He, K., Gkioxari, G., Dollár, P. and Girshick, R., 2017. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision (pp. 2961-2969).
 
[32] Wei, J., Hu, Y., Zhang, R., Li, Z., Zhou, S.K. and Cui, S., 2021, September. Shallow attention network for polyp segmentation. In International conference on medical image computing and computer-assisted intervention (pp. 699-708). Cham: Springer International Publishing.
 
[33] Baghersalimi, S., Bozorgtabar, B., Schmid-Saugeon, P., Ekenel, H.K. and Thiran, J.P., 2019. DermoNet: densely linked convolutional neural network for efficient skin lesion segmentation. EURASIP Journal on Image and Video Processing2019(1), p.71.
 
[34] Abraham, N. and Khan, N.M., 2019, April. A novel focal tversky loss function with improved attention u-net for lesion segmentation. In 2019 IEEE 16th international symposium on biomedical imaging (ISBI 2019) (pp. 683-687). IEEE.
 
[35] Cui, Z., Wu, L., Wang, R. and Zheng, W.S., 2019, October. Ensemble transductive learning for skin lesion segmentation. In Chinese Conference on Pattern Recognition and Computer Vision (PRCV) (pp. 572-581). Cham: Springer International Publishing.
 
[36] Singh, V.K., Abdel-Nasser, M., Rashwan, H.A., Akram, F., Pandey, N., Lalande, A., Presles, B., Romani, S. and Puig, D., 2019. FCA-Net: Adversarial learning for skin lesion segmentation based on multi-scale features and factorized channel attention. Ieee Access7, pp.130552-130565.
 
[37] Saini, S., Gupta, D. and Tiwari, A.K., 2019, December. Detector-segmentor network for skin lesion localization and segmentation. In National Conference on Computer Vision, Pattern Recognition, Image Processing, and Graphics (pp. 589-599). Singapore: Springer Singapore.
 
[38] Nathan, S. and Kansal, P., 2020. Lesion Net--Skin Lesion Segmentation Using Coordinate Convolution and Deep Residual Units. arXiv preprint arXiv:2012.14249.
 
[39] Jin, Q., Cui, H., Sun, C., Meng, Z. and Su, R., 2021. Cascade knowledge diffusion network for skin lesion diagnosis and segmentation. Applied soft computing99, p.106881.
 
[40] Saini, S., Jeon, Y.S. and Feng, M., 2021, April. B-SegNet: branched-SegMentor network for skin lesion segmentation. In Proceedings of the Conference on Health, Inference, and Learning (pp. 214-221).
 
[41] Chen, P., Huang, S. and Yue, Q., 2022. Skin lesion segmentation using recurrent attentional convolutional networks. IEEE Access10, pp.94007-94018.
 
[42] Liu, X., Fan, W. and Zhou, D., 2022, November. Skin lesion segmentation via intensive atrous spatial transformer. In International Conference on Wireless Algorithms, Systems, and Applications (pp. 15-26). Cham: Springer Nature Switzerland.
 
[43] Kaur, R., GholamHosseini, H. and Sinha, R., 2022. Skin lesion segmentation using an improved framework of encoder‐decoder based convolutional neural network. International Journal of Imaging Systems and Technology32(4), pp.1143-1158.
 
[44] Ruan, J., Xie, M., Gao, J., Liu, T. and Fu, Y., 2023, October. Ege-unet: an efficient group enhanced unet for skin lesion segmentation. In International conference on medical image computing and computer-assisted intervention (pp. 481-490). Cham: Springer Nature Switzerland.
 
[45] Sun, Y., Dai, D., Zhang, Q., Wang, Y., Xu, S. and Lian, C., 2023. MSCA-Net: Multi-scale contextual attention network for skin lesion segmentation. Pattern Recognition139, p.109524.
 
[46] Qiu, S., Li, C., Feng, Y., Zuo, S., Liang, H. and Xu, A., 2023. GFANet: Gated fusion attention network for skin lesion segmentation. Computers in Biology and Medicine155, p.106462.
 
[47] Qiu, S., Li, C., Feng, Y., Zuo, S., Liang, H. and Xu, A., 2023. GFANet: Gated fusion attention network for skin lesion segmentation. Computers in Biology and Medicine155, p.106462.
 
[48] Scholz, D., Erdur, A.C., Buchner, J.A., Peeken, J.C., Rueckert, D. and Wiestler, B., 2024. Imbalance-aware loss functions improve medical image classification. Medical imaging with deep learning, pp.1341-1356.
 
[49] Le, N., Le, T., Yamazaki, K., Bui, T., Luu, K. and Savides, M., 2021, January. Offset curves loss for imbalanced problem in medical segmentation. In 2020 25th International Conference on Pattern Recognition (ICPR) (pp. 9189-9195). IEEE.
 
[50] Cabezas, M. and Diez, Y., 2024. An analysis of loss functions for heavily imbalanced lesion segmentation. Sensors24(6), p.1981.
 
[51] Roy, S., Tyagi, M., Bansal, V. and Jain, V., 2022. Svd-clahe boosting and balanced loss function for covid-19 detection from an imbalanced chest x-ray dataset. Computers in Biology and Medicine150, p.106092.
 
[52] Gökkan, O. and Kuntalp, M., 2022. A new imbalance-aware loss function to be used in a deep neural network for colorectal polyp segmentation. Computers in Biology and Medicine151, p.106205.
 
[53] Kofler, F., Shit, S., Ezhov, I., Fidon, L., Horvath, I., Al-Maskari, R., Li, H.B., Bhatia, H., Loehr, T., Piraud, M. and Erturk, A., 2023, June. Blob loss: Instance imbalance aware loss functions for semantic segmentation. In International Conference on Information Processing in Medical Imaging (pp. 755-767). Cham: Springer Nature Switzerland.
 
[54] Sugino, T., Kawase, T., Onogi, S., Kin, T., Saito, N. and Nakajima, Y., 2021, July. Loss weightings for improving imbalanced brain structure segmentation using fully convolutional networks. In Healthcare (Vol. 9, No. 8, p. 938). MDPI.
 
[55] Borawar, L. and Kaur, R., 2023, March. ResNet: Solving vanishing gradient in deep networks. In Proceedings of International Conference on Recent Trends in Computing: ICRTC 2022 (pp. 235-247). Singapore: Springer Nature Singapore.
 
[56] Liu, G., Hu, Y., Chen, Z., Guo, J. and Ni, P., 2023. Lightweight object detection algorithm for robots with improved YOLOv5. Engineering Applications of Artificial Intelligence123, p.106217.
 
[57] Zhang, Z., 2023. Drone-YOLO: An efficient neural network method for target detection in drone images. Drones7(8), p.526.
 
[58] Sriram, S., Vinayakumar, R., Sowmya, V., Alazab, M. and Soman, K.P., 2020, July. Multi-scale learning based malware variant detection using spatial pyramid pooling network. In IEEE INFOCOM 2020-IEEE conference on computer communications workshops (INFOCOM WKSHPS) (pp. 740-745). IEEE.
 
[59] Wang, X., Gao, H., Jia, Z. and Li, Z., 2023. BL-YOLOv8: An improved road defect detection model based on YOLOv8. Sensors23(20), p.8361.
 
[60] Chen, L.C., Papandreou, G., Kokkinos, I., Murphy, K. and Yuille, A.L., 2017. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE transactions on pattern analysis and machine intelligence40(4), pp.834-848.
 
[61] Schapire, R.E. and Singer, Y., 1998, July. Improved boosting algorithms using confidence-rated predictions. In Proceedings of the eleventh annual conference on Computational learning theory (pp. 80-91).
 
[62] Elfwing, S., Uchibe, E. and Doya, K., 2018. Sigmoid-weighted linear units for neural network function approximation in reinforcement learning. Neural networks107, pp.3-11.
 
[63] Deng, J., Dong, W., Socher, R., Li, L.J., Li, K. and Fei-Fei, L., 2009, June. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition (pp. 248-255). Ieee.
 
[64] Yuan, C., Zhao, D. and Agaian, S.S., 2024. UCM-Net: A lightweight and efficient solution for skin lesion segmentation using MLP and CNN. Biomedical Signal Processing and Control96, p.106573.
 
[65] Chen, J., Lu, Y., Yu, Q., Luo, X., Adeli, E., Wang, Y., Lu, L., Yuille, A.L. and Zhou, Y., 2021. Transunet: Transformers make strong encoders for medical image segmentation. arXiv preprint arXiv:2102.04306.
 
[66] Zhang, Y., Liu, H. and Hu, Q., 2021, September. Transfuse: Fusing transformers and cnns for medical image segmentation. In International conference on medical image computing and computer-assisted intervention (pp. 14-24). Cham: Springer International Publishing.
 
[67] He, K., Zhang, X., Ren, S. and Sun, J., 2015. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE transactions on pattern analysis and machine intelligence37(9), pp.1904-1916.
 
[68] Miri Rostami, S. and Ahmadzadeh, M., 2018. Extracting predictor variables to construct breast cancer survivability model with class imbalance problem. Journal of AI and Data Mining6(2), pp.263-276.
 
[69] A. Kazempour, J. Tanha, S. Roshan, M. Zarrin and H. Nikkhah, "MC-BioCLIPSR: A Mamba-CNN Hybrid Network with BioMedCLIP-Guided Loss for High-Resolution Brain MRI Reconstruction," 2025 15th International Conference on Computer and Knowledge Engineering (ICCKE), Mashhad, Iran, Islamic Republic of, 2025, pp. 1-6, doi: 10.1109/ICCKE68588.2025.11273813.