A Unified Loss Function for Robust Myocardium Segmentation in Short-Axis Cine Cardiac Magnetic Resonance Images

Keywords: Myocardium Segmentation, Cardiac MRI, Loss Function Design, Compound Loss Function, Class Imbalance, Deep Learning

Abstract

Myocardium segmentation in cardiac magnetic resonance imaging (MRI) is difficult because the myocardium is thin, has low contrast at its outer boundary, and covers a small part of each image. Most studies improve segmentation with new network designs. This study examines the loss function instead. We propose MIFOCAT, a compound loss function that combines Mean Squared Error (MSE), Focal Loss (FO), and Categorical Cross-Entropy (CAT). We compare it with five other loss functions on the ACDC 2017 dataset. We use U-Net and TransUNet, both trained from scratch, on end-diastolic slices at 128 × 128 pixels, with one training run per loss function. A gradient analysis derives the distinct probability-dependent signals of the three terms. The loss function changes the result much more for TransUNet than for U-Net. The six loss functions span 2.33 percentage points of mean validation IoU on U-Net and 30.54 percentage points on TransUNet, and their order inverts between the networks. CAT is the weakest loss function on U-Net (86.94%) and the strongest on TransUNet (89.49%). MIFOCAT is not the best loss function on either network, with 89.11% on U-Net and 87.30% on TransUNet. Among the compound loss functions, MIFOCAT changes by 1.81 percentage points between the networks, more than MSE + CAT (1.45). It adds at most 3.6% to U-Net training time and decreases TransUNet training time by 9.7%. Pixel accuracy is dominated by background pixels and is therefore not a useful metric here. All data come from one single-center dataset; the loss comparisons are validation results, and the per-pathology myocardium results were obtained on the 50-patient ACDC test set. These findings describe loss sensitivity under fixed settings and do not establish a benefit of adding FO; multi-center validation is required before any clinical use

Downloads

Download data is not yet available.

References

P. Khosravi, S. Mohammadi, F. Zahiri, M. Khodarahmi, and J. Zahiri, “AI-Enhanced Detection of Clinically Relevant Structural and Functional Anomalies in MRI: Traversing the Landscape of Conventional to Explainable Approaches,” Journal of Magnetic Resonance Imaging, vol. 60, no. 6, pp. 2272–2289, 2024, doi: 10.1002/jmri.29247.

R. R. Upendra, B. J. Wentz, R. Simon, S. M. Shontz, and C. A. Linte, “CNN-Based Cardiac Motion Extraction to Generate Deformable Geometric Left Ventricle Myocardial Models from Cine MRI,” in Functional Imaging and Modeling of the Heart, vol. 12738, D. B. Ennis, L. E. Perotti, and V. Y. Wang, Eds., Cham: Springer International Publishing, 2021, pp. 253–263. doi: 10.1007/978-3-030-78710-3_25.

C. Chen et al., “Deep Learning for Cardiac Image Segmentation: A Review,” Front. Cardiovasc. Med., vol. 7, p. 25, 2020, doi: 10.3389/fcvm.2020.00025.

N. Zaki, W. Qin, and A. Krishnan, “Graph-based methods for cervical cancer segmentation: Advancements, limitations, and future directions,” AI Open, vol. 4, pp. 42–55, 2023, doi: 10.1016/j.aiopen.2023.08.006.

K. Sivakumar, S. Lavanya, K. Himanandini, and V. Keerthana, “A Unified Automated Segmentation Technique for the Left Ventricle Segmentation in Cardiac MRI,” IOP Conf. Ser. Mater. Sci. Eng., vol. 993, no. 1, p. 012068, 2020, doi: 10.1088/1757-899X/993/1/012068.

Z. Liu et al., “A review of self-supervised, generative, and few-shot deep learning methods for data-limited magnetic resonance imaging segmentation,” NMR Biomed., vol. 37, no. 8, p. e5143, 2024, doi: 10.1002/nbm.5143.

H. Cui, M. Piao, X. Huang, X. Zhu, H. Ma, and Y. Peng, “Advancing cardiac MRI multi-structure segmentation: A semi-supervised multidimensional consistency constraint learning network,” Med. Phys., vol. 52, no. 7, p. e17805, 2025, doi: 10.1002/mp.17805.

M. R. Avendi, A. Kheradvar, and H. Jafarkhani, “Automatic segmentation of the right ventricle from cardiac MRI using a learning‐based approach,” Magn. Reson. Med., vol. 78, no. 6, pp. 2439–2448, Dec. 2017, doi: 10.1002/mrm.26631.

N. Das and S. Das, “Epoch and accuracy based empirical study for cardiac MRI segmentation using deep learning technique,” PeerJ, vol. 11, p. e14939, 2023, doi: 10.7717/peerj.14939.

G. Litjens et al., “State-of-the-Art Deep Learning in Cardiovascular Image Analysis,” JACC Cardiovasc. Imaging, vol. 12, no. 8, pp. 1549–1565, 2019, doi: 10.1016/j.jcmg.2019.06.009.

Z. Chen, J. Bai, and Y. Lu, “Dilated convolution network with edge fusion block and directional feature maps for cardiac MRI segmentation,” Front. Physiol., vol. 14, p. 1027076, 2023, doi: 10.3389/fphys.2023.1027076.

T. Geroski, N. Filipovic, and A. Amini, “Segmentation of ACDC challenge cardiac MRI dataset across diverse neural network architectures,” in Medical Imaging 2025: Clinical and Biomedical Imaging, Proc. SPIE, vol. 13410, B. S. Gimi and A. Krol, Eds. Bellingham, WA, USA: SPIE, 2025, doi: 10.1117/12.3049100.

R. Wang, T. Lei, R. Cui, B. Zhang, H. Meng, and A. K. Nandi, “Medical image segmentation using deep learning: A survey,” IET Image Process., vol. 16, no. 5, pp. 1243–1267, Apr. 2022, doi: 10.1049/ipr2.12419.

J. Wang, H. Huang, C. Chen, W. Ma, Y. Huang, and X. Ding, “Multi-sequence Cardiac MR Segmentation with Adversarial Domain Adaptation Network,” 2019, in Statistical Atlases and Computational Models of the Heart (STACOM 2019), Lecture Notes in Computer Science. Cham, Switzerland: Springer, 2020, pp. 254–262, doi: 10.1007/978-3-030-39074-7_27.

E. Abouei et al., “Cardiac MRI segmentation using block-partitioned transformer with global-local information integration,” in Medical Imaging 2024: Clinical and Biomedical Imaging, Proc. SPIE, vol. 12930, B. S. Gimi and A. Krol, Eds. Bellingham, WA, USA: SPIE, 2024, Art. no. 1293021, doi: 10.1117/12.3006929.

S. Cai et al., “Segmentation of cardiac tissues and organs for CCTA images based on a deep learning model,” Front. Phys., vol. 11, p. 1266500, 2023, doi: 10.3389/fphy.2023.1266500.

J. Wang, S. Wang, W. Liang, N. Zhang, and Y. Zhang, “The auto segmentation for cardiac structures using a dual‐input deep learning network based on vision saliency and transformer,” J. Appl. Clin. Med. Phys., vol. 23, no. 5, p. e13597, 2022, doi: 10.1002/acm2.13597.

W. Yao, J. Bai, W. Liao, Y. Chen, M. Liu, and Y. Xie, “From CNN to Transformer: A Review of Medical Image Segmentation Models,” Journal of Imaging Informatics in Medicine, vol. 37, no. 4, pp. 1529–1547, Mar. 2024, doi: 10.1007/s10278-024-00981-7.

G. Huo, R. Dai, L. Shao, and H. Tang, “SAMba-UNet: SAM2-Mamba UNet for Cardiac MRI in Medical Robotic Perception,” 2025, arXiv. doi: 10.48550/ARXIV.2505.16304.

Z. Xing et al., “SegMamba-V2: Long-Range Sequential Modeling Mamba for General 3-D Medical Image Segmentation,” IEEE Trans. Med. Imaging, vol. 45, no. 1, pp. 4–15, 2026, doi: 10.1109/TMI.2025.3589797.

Y. Du, K. Huang, M. Yue, C. Chen, X. Deng, and N. Wang, “CASNet: curvature-aware cardiac MRI segmentation with multi-scale and attention-driven encoding for enhanced risk-oriented structural analysis,” Front. Med. (Lausanne)., vol. 12, p. 1688872, 2025, doi: 10.3389/fmed.2025.1688872.

T.-M.-N. Nguyen, T.-T. Nguyen, and A.-C. Phan, “Swin-FABNET: A Fuzzy Deep Learning Model For Cardiac MRI Segmentation,” in Future Data and Security Engineering, vol. 2709, T. K. Dang, J. Küng, and T. M. Chung, Eds., Singapore: Springer Nature Singapore, 2025, pp. 451–458. doi: 10.1007/978-981-95-4724-1_33.

G. Ren et al., “CFG-MambaNet: Contextual and Frequency-Guided Mamba Network for medical image segmentation,” NPJ Digit. Med., vol. 9, no. 1, p. 202, 2026, doi: 10.1038/s41746-026-02393-z.

C. Florea, L. Florea, and C. Vertan, “Top-k Bottom All but σ Loss Strategy for Medical Image Segmentation,” Diagnostics, vol. 15, no. 17, p. 2189, 2025, doi: 10.3390/diagnostics15172189.

Y. Yokoi and K. Hotta, “Multiplicative Loss for Enhancing Semantic Segmentation in Medical and Cellular Images,” in Proc. IEEE/CVF Int. Conf. Comput. Vis. Workshops (ICCVW), 2025, pp. 1284–1292, doi: 10.1109/ICCVW69036.2025.00137.

J. Ma et al., “Loss odyssey in medical image segmentation,” Med. Image Anal., vol. 71, p. 102035, 2021, doi: 10.1016/j.media.2021.102035.

K. Ghosh, C. Bellinger, R. Corizzo, P. Branco, B. Krawczyk, and N. Japkowicz, “The class imbalance problem in deep learning,” Mach. Learn., vol. 113, no. 7, pp. 4845–4901, Jul. 2024, doi: 10.1007/s10994-022-06268-8.

K. Hammouda et al., “A New Framework for Performing Cardiac Strain Analysis from Cine MRI Imaging in Mice,” Sci. Rep., vol. 10, no. 1, p. 7725, 2020, doi: 10.1038/s41598-020-64206-x.

T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar, “Focal Loss for Dense Object Detection,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 42, no. 2, pp. 318–327, 2020, doi: 10.1109/TPAMI.2018.2858826.

B. H. Menze et al., “The Multimodal Brain Tumor Image Segmentation Benchmark (BRATS),” IEEE Trans. Med. Imaging, vol. 34, no. 10, pp. 1993–2024, 2015, doi: 10.1109/TMI.2014.2377694.

D. M. Vigneault, W. Xie, C. Y. Ho, D. A. Bluemke, and J. A. Noble, “Ω-Net (Omega-Net): Fully automatic, multi-view cardiac MR detection, orientation, and segmentation with deep neural networks,” Med. Image Anal., vol. 48, pp. 95–106, 2018, doi: 10.1016/j.media.2018.05.008.

S. Jadon, “A survey of loss functions for semantic segmentation,” in Proc. IEEE Conf. Comput. Intell. Bioinform. Comput. Biol. (CIBCB), 2020, pp. 1–7, doi: 10.1109/CIBCB48159.2020.9277638.

S. A. Taghanaki et al., “Combo loss: Handling input and output imbalance in multi-organ segmentation,” Computerized Medical Imaging and Graphics, vol. 75, pp. 24–33, Jul. 2019, doi: 10.1016/j.compmedimag.2019.04.005.

F. Isensee, P. F. Jaeger, S. A. A. Kohl, J. Petersen, and K. H. Maier-Hein, “nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation,” Nat. Methods, vol. 18, no. 2, pp. 203–211, Feb. 2021, doi: 10.1038/s41592-020-01008-z.

M. Yeung, E. Sala, C.-B. Schönlieb, and L. Rundo, “Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medical image segmentation,” Computerized Medical Imaging and Graphics, vol. 95, p. 102026, 2022, doi: 10.1016/j.compmedimag.2021.102026.

J. Mukhoti, V. Kulharia, A. Sanyal, S. Golodetz, P. H. S. Torr, and P. K. Dokania, “Calibrating Deep Neural Networks using Focal Loss,” Oct. 2020, in Advances in Neural Information Processing Systems (NeurIPS), vol. 33, 2020, pp. 15288–15299. [Online]. Available: https://proceedings.neurips.cc/paper/2020/hash/aeb7b30ef1d024a76f21a1d40e30c302-Abstract.html

A. Mehrtash, W. M. Wells, C. M. Tempany, P. Abolmaesumi, and T. Kapur, “Confidence Calibration and Predictive Uncertainty Estimation for Deep Medical Image Segmentation,” IEEE Trans. Med. Imaging, vol. 39, no. 12, pp. 3868–3878, Dec. 2020, doi: 10.1109/TMI.2020.3006437.

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, Lecture Notes in Computer Science, vol. 9351, N. Navab, J. Hornegger, W. M. Wells, and A. F. Frangi, Eds. Cham, Switzerland: Springer, 2015, pp. 234–241, doi: 10.1007/978-3-319-24574-4_28.

J. Chen et al., “TransUNet: Rethinking the U-Net architecture design for medical image segmentation through the lens of transformers,” Med. Image Anal., vol. 97, p. 103280, Oct. 2024, doi: 10.1016/j.media.2024.103280.

O. Bernard et al., “Deep Learning Techniques for Automatic MRI Cardiac Multi-Structures Segmentation and Diagnosis: Is the Problem Solved?,” IEEE Trans. Med. Imaging, vol. 37, no. 11, pp. 2514–2525, Nov. 2018, doi: 10.1109/TMI.2018.2837502.

A. A. Taha and A. Hanbury, “Metrics for evaluating 3D medical image segmentation: analysis, selection, and tool,” BMC Med. Imaging, vol. 15, no. 1, p. 29, Dec. 2015, doi: 10.1186/s12880-015-0068-x.

G. W. Brier, “Verification of Forecasts Expressed in Terms of Probability,” Mon. Weather Rev., vol. 78, no. 1, pp. 1–3, Jan. 1950, doi: 10.1175/1520-0493(1950)078<0001:VOFEIT>2.0.CO;2.

A. Mao, M. Mohri, and Y. Zhong, “Cross-Entropy Loss Functions: Theoretical Analysis and Applications,” in Proc. 40th Int. Conf. Mach. Learn. (ICML), PMLR, vol. 202, 2023, pp. 23803–23828.

H. Rezatofighi, N. Tsoi, J. Gwak, A. Sadeghian, I. Reid, and S. Savarese, “Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression,” in Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR), 2019, pp. 658–666, doi: 10.1109/CVPR.2019.00075.

F. Isensee, P. F. Jaeger, P. M. Full, I. Wolf, S. Engelhardt, and K. H. Maier-Hein, “Automatic cardiac disease assessment on cine-MRI via time-series segmentation and domain specific features,” in Statistical Atlases and Computational Models of the Heart (STACOM 2017), Lecture Notes in Computer Science, vol. 10663, M. Pop et al., Eds. Cham, Switzerland: Springer, 2018, pp. 120–129, doi: 10.1007/978-3-319-75541-0_13.

H. Cao et al., “Swin-Unet: Unet-Like Pure Transformer for Medical Image Segmentation,” Computer Vision – ECCV 2022 Workshops, Lecture Notes in Computer Science, vol. 13803, L. Karlinsky, T. Michaeli, and K. Nishino, Eds. Cham, Switzerland: Springer, 2023, pp. 205–218, doi: 10.1007/978-3-031-25066-8_9.

G. Xu, X. Zhang, X. He, and X. Wu, “LeViT-UNet: Make Faster Encoders with Transformer for Medical Image Segmentation,” in Pattern Recognition and Computer Vision (PRCV 2023), Lecture Notes in Computer Science, vol. 14432, Q. Liu et al., Eds. Singapore: Springer, 2024, pp. 42–53, doi: 10.1007/978-981-99-8543-2_4.

X. Huang, Z. Deng, D. Li, X. Yuan, and Y. Fu, “MISSFormer: An Effective Transformer for 2D Medical Image Segmentation,” IEEE Trans. Med. Imaging, vol. 42, no. 5, pp. 1484–1494, May 2023, doi: 10.1109/TMI.2022.3230943.

H.-Y. Zhou et al., “nnFormer: Volumetric Medical Image Segmentation via a 3D Transformer,” IEEE Transactions on Image Processing, vol. 32, pp. 4036–4045, 2023, doi: 10.1109/TIP.2023.3293771.

P. Peng, K. Lekadir, A. Gooya, L. Shao, S. E. Petersen, and A. F. Frangi, “A review of heart chamber segmentation for structural and functional analysis using cardiac magnetic resonance imaging,” Magn. Reson. Mater. Phys. Biol. Med., vol. 29, no. 2, pp. 155–195, 2016, doi: 10.1007/s10334-015-0521-4.

Published
2026-12-01
How to Cite
[1]
R. Riandini, F. S. Mukti, E. M. Yuniarno, I. K. E. Purnama, E. Setijadi, and M. H. Purnomo, “A Unified Loss Function for Robust Myocardium Segmentation in Short-Axis Cine Cardiac Magnetic Resonance Images”, j.electron.electromedical.eng.med.inform, vol. 9, no. 1, pp. 33-51, Dec. 2026.
Section
Medical Informatics