A Quantitative Comparison Between Focal Loss and Binary Cross-Entropy Loss in Brain Tumor Auto-Segmentation Using U-Net

  • Mahdi Shafiei Neyestanak Department of Epidemiology and Biostatistics, School of Public Health, Tehran University of Medical Sciences, Tehran, Iran.
  • Hamid Jahani Department of Data Science, Faculty of Interdisciplinary Science and Technology, Tarbiat Modares University, Tehran, Iran.
  • Mohsen Khodarahmi Bahar Medical Imaging Center, Karaj, Iran.
  • Javad Zahiri Department of Neuroscience, University of California San Diego, La Jolla, San Diego, CA, USA.
  • Mostafa Hosseini Department of Integrative Structural and Computational Biology, The Scripps Research Institute, La Jolla, San Diego, CA, USA.
  • Amirali Fatoorchi Department of Industrial engineering, IT engineering Group, P.hD. student, K. N.Toosi University of Technology, Tehran, Iran.
  • Mir Saeed Yekaninejad Department of Epidemiology and Biostatistics, School of Public Health, Tehran University of Medical Sciences, Tehran, Iran.
Keywords: Brain tumor segmentation; Deep learning; Convolutional neural network; U-net- architecture; Diagnosis; MRI image

Abstract

Introduction: Brain tumors are among the most fatal cancers and cause the deaths of many people annually. Early diagnosis of a brain tumor can help save the patient’s life.

Methods: We have collected a dataset consisting of 314 brain MRI images in all planes taken after administering a contrast medium with the dimension of 800*512, which offers the highest resolution. First, skull stripping has been implemented to separate the brain from other parts in the images. Next, we have annotated the tumors in the images under the supervision of experienced radiologists to create ground truth. To determine the most effective model versions for all three loss functions, hyperparameter tuning was performed. Following the comparison, the study further evaluates the effectiveness of two loss functions, Binary Cross-Entropy (BCE) and Focal loss, specifically in handling tumor regions within the dataset.

Results: The two proposed loss functions were evaluated using 5-fold cross-validation, and the average precision, recall, and F1-score were 76.16%, 71.9%, and 74.52 for BCE loss and 82.92%, 79.32%, and 81% for the Focal loss on the test data, respectively. Moreover, the accuracy for BCE loss was 99.03% and 99.44% for the Focal loss.

Conclusion: We recommend using BCE loss cautiously in classification tasks without data imbalance and emphasize the adoption of Focal loss for more accurate and reliable results in brain tumor segmentation.

Published
2025-08-01
Section
Articles