skip to main content

Enhancing Brain Tumor Classification on Mildly Imbalanced Datasets Using Categorical Focal Cross-Entropy

1Faculty of Computer Science, Universitas Dian Nuswantoro, Indonesia

2School of Mechanical Engineering, Pusan National University, South Korea

3Anugrah General Hospital, Indonesia

Received: 21 Feb 2026; Revised: 21 Jul 2026; Accepted: 19 Aug 2026; Published: 9 Sep 2026.
Open Access Copyright (c) 2026 The authors. Published by Department of Informatics Universitas, Diponegoro
Creative Commons License This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Citation Format:
Abstract

Brain tumor is a dangerous disease that requires accurate diagnosis, but medical datasets often suffer from class imbalance, resulting in bias in deep learning-based classification models. This study proposes using Categorical Focal Cross Entropy (CFCE) in a Convolutional Neural Network (CNN) to address this issue by comparing it with Categorical Cross-Entropy (CCE). CFCE is designed to emphasize minority class samples and hard-to-classify examples, thereby reducing the dominance of the majority class. Experiments were conducted on a brain tumor dataset with class imbalance, where the CNN model with CFCE achieved 84.57% accuracy, 83.57% precision, 85.27% recall, and 83.97% F1-score, outperforming the model with CCE (81.30% accuracy, 81.77% precision, 82.83% recall, and 81.15% F1-score). These results show that Focal Loss effectively improves the classification performance on imbalanced data, with a better ability to detect brain tumors, especially in the minority class. This study contributes to developing a more robust and reliable deep learning-based diagnosis system for medical applications.

Keywords: Class Imbalance; Convolutional Neural Network; Focal Loss; Brain Tumor Classification;

Article Metrics:

  1. The Global Cancer Observatory (GCO), “Global Cancer Data.” [Online]. Available: https://gco.iarc.fr/en
  2. B. Bhinder, C. Gilvary, N. S. Madhukar, and O. Elemento, “Artificial Intelligence in Cancer Research and Precision Medicine,” Cancer Discov., vol. 11, no. 4, pp. 900–915, Apr. 2021, doi: 10.1158/2159-8290.CD-21-0090
  3. D. G. Poalelungi et al., “Advancing Patient Care: How Artificial Intelligence Is Transforming Healthcare,” J. Pers. Med., vol. 13, no. 8, p. 1214, Jul. 2023, doi: 10.3390/jpm13081214
  4. W. Abbaoui, S. Retal, B. El Bhiri, N. Kharmoum, and S. Ziti, “Towards revolutionizing precision healthcare: A systematic literature review of artificial intelligence methods in precision medicine,” Inform. Med. Unlocked, vol. 46, p. 101475, 2024, doi: 10.1016/j.imu.2024.101475
  5. A. A. Akinyelu, F. Zaccagna, J. T. Grist, M. Castelli, and L. Rundo, “Brain Tumor Diagnosis Using Machine Learning, Convolutional Neural Networks, Capsule Neural Networks and Vision Transformers, Applied to MRI: A Survey,” J. Imaging, vol. 8, no. 8, p. 205, Jul. 2022, doi: 10.3390/jimaging8080205
  6. Y. Xie et al., “Convolutional Neural Network Techniques for Brain Tumor Classification (from 2015 to 2022): Review, Challenges, and Future Perspectives,” Diagnostics, vol. 12, no. 8, p. 1850, Jul. 2022, doi: 10.3390/diagnostics12081850
  7. D. R. Sarvamangala and R. V. Kulkarni, “Convolutional neural networks in medical image understanding: a survey,” Evol. Intell., vol. 15, no. 1, pp. 1–22, Mar. 2022, doi: 10.1007/s12065-020-00540-3
  8. Yogita K. Desai, “Diagnosis of Medical Images Using Convolutional Neural Networks,” J. Electr. Syst., vol. 20, no. 6s, pp. 2371–2376, May 2024, doi: 10.52783/jes.3220
  9. E. Tasci, Y. Zhuge, K. Camphausen, and A. V. Krauze, “Bias and Class Imbalance in Oncologic Data—Towards Inclusive and Transferrable AI in Large Scale Oncology Data Sets,” Cancers, vol. 14, no. 12, p. 2897, Jun. 2022, doi: 10.3390/cancers14122897
  10. P. Kaur and A. Gosain, “Empirical Assessment of Ensemble based Approaches to Classify Imbalanced Data in Binary Classification,” Int. J. Adv. Comput. Sci. Appl., vol. 10, no. 3, 2019, doi: 10.14569/IJACSA.2019.0100307
  11. R. Walsh and M. Tardy, “A Comparison of Techniques for Class Imbalance in Deep Learning Classification of Breast Cancer,” Diagnostics, vol. 13, no. 1, p. 67, Dec. 2022, doi: 10.3390/diagnostics13010067
  12. M. Khushi et al., “A Comparative Performance Analysis of Data Resampling Methods on Imbalance Medical Data,” IEEE Access, vol. 9, pp. 109960–109975, 2021, doi: 10.1109/ACCESS.2021.3102399
  13. S. Bagui and K. Li, “Resampling imbalanced data for network intrusion detection datasets,” J. Big Data, vol. 8, no. 1, p. 6, Dec. 2021, doi: 10.1186/s40537-020-00390-x
  14. G. Varotto, G. Susi, L. Tassi, F. Gozzo, S. Franceschetti, and F. Panzica, “Comparison of Resampling Techniques for Imbalanced Datasets in Machine Learning: Application to Epileptogenic Zone Localization From Interictal Intracranial EEG Recordings in Patients With Focal Epilepsy,” Front. Neuroinformatics, vol. 15, p. 715421, Nov. 2021, doi: 10.3389/fninf.2021.715421
  15. Muljono, S. A. Wulandari, H. A. Azies, M. Naufal, W. A. Prasetyanto, and F. A. Zahra, “Breaking Boundaries in Diagnosis: Non-Invasive Anemia Detection Empowered by AI,” IEEE Access, vol. 12, pp. 9292–9307, 2024, doi: 10.1109/ACCESS.2024.3353788
  16. D. Dablain, B. Krawczyk, and N. V. Chawla, “DeepSMOTE: Fusing Deep Learning and SMOTE for Imbalanced Data,” IEEE Trans. Neural Netw. Learn. Syst., vol. 34, no. 9, pp. 6390–6404, Sep. 2023, doi: 10.1109/TNNLS.2021.3136503
  17. Y. Chen et al., “Generative Adversarial Networks in Medical Image augmentation: A review,” Comput. Biol. Med., vol. 144, p. 105382, May 2022, doi: 10.1016/j.compbiomed.2022.105382
  18. A. Kebaili, J. Lapuyade-Lahorgue, and S. Ruan, “Deep Learning Approaches for Data Augmentation in Medical Imaging: A Review,” J. Imaging, vol. 9, no. 4, p. 81, Apr. 2023, doi: 10.3390/jimaging9040081
  19. “Survey on Generative Adversarial Behavior in Artificial Neural Tasks,” Iraqi J. Comput. Sci. Math., pp. 83–94, Mar. 2022, doi: 10.52866/ijcsm.2022.02.01.009
  20. M. Mulyanto, M. Faisal, S. W. Prakosa, and J.-S. Leu, “Effectiveness of Focal Loss for Minority Classification in Network Intrusion Detection Systems,” Symmetry, vol. 13, no. 1, p. 4, Dec. 2020, doi: 10.3390/sym13010004
  21. K. Pasupa, S. Vatathanavaro, and S. Tungjitnob, “Convolutional neural networks based focal loss for class imbalance problem: a case study of canine red blood cells morphology classification,” J. Ambient Intell. Humaniz. Comput., vol. 14, no. 11, pp. 15259–15275, Nov. 2023, doi: 10.1007/s12652-020-01773-x
  22. Y. Ho and S. Wookey, “The Real-World-Weight Cross-Entropy Loss Function: Modeling the Costs of Mislabeling,” IEEE Access, vol. 8, pp. 4806–4813, 2020, doi: 10.1109/ACCESS.2019.2962617
  23. F. Alzami, M. Naufal, H. A. Azies, S. Winarno, and M. A. Soeleman, “Time Distributed MobileNetV2 with Auto-CLAHE for Eye Region Drowsiness Detection in Low Light Conditions,” Int. J. Adv. Comput. Sci. Appl., vol. 15, no. 11, 2024, doi: 10.14569/IJACSA.2024.0151146
  24. J. Cheng, “brain tumor dataset.” figshare, p. 879509079 Bytes, 2017. doi: 10.6084/M9.FIGSHARE.1512427.V5
  25. “Hybrid Chicken Swarm Optimization (CSO) and Fuzzy Logic (FL) Model for Handling Imbalanced Datasets,” Int. J. Intell. Eng. Syst., vol. 14, no. 6, pp. 10–19, Dec. 2021, doi: 10.22266/ijies2021.1231.02
  26. L. Tuggener, J. Schmidhuber, and T. Stadelmann, “Is it enough to optimize CNN architectures on ImageNet?,” Front. Comput. Sci., vol. 4, p. 1041703, Nov. 2022, doi: 10.3389/fcomp.2022.1041703
  27. M. Naufal, H. Al Azies, and R. M. Brilianto, “Enhanced Brain Tumor Classification through Gamma Correction in Deep Learning,” SISTEMASI, vol. 13, no. 6, p. 2348, Nov. 2024, doi: 10.32520/stmsi.v13i6.4474
  28. L. Wang, C. Wang, Z. Sun, S. Cheng, and L. Guo, “Class Balanced Loss for Image Classification,” IEEE Access, vol. 8, pp. 81142–81153, 2020, doi: 10.1109/ACCESS.2020.2991237
  29. T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollár, “Focal Loss for Dense Object Detection,” Feb. 07, 2018, arXiv: arXiv:1708.02002. doi: 10.48550/arXiv.1708.02002
  30. M. Muljono, P. N. Andono, S. A. Wulandari, H. A. Azies, and M. Naufal, “Tempo Recognition of Kendhang Instruments Using Hybrid Feature Extraction,”, Journal of Applied Science and Engineering, vol. 27, no. 3, Mar. 2024, doi: 10.6180/jase.202403_27(3).0004
  31. M. N. Razali, N. Arbaiy, P.-C. Lin, and S. Ismail, “Optimizing Multiclass Classification Using Convolutional Neural Networks with Class Weights and Early Stopping for Imbalanced Datasets,” Electronics, vol. 14, no. 4, p. 705, Feb. 2025, doi: 10.3390/electronics14040705

Last update:

No citation recorded.

Last update: 2026-10-02 17:02:41

No citation recorded.