Skip to main content

Addressing Class Imbalance Problem in Semantic Segmentation Using Binary Focal Loss

  • Conference paper
  • First Online:
Proceedings of Ninth International Congress on Information and Communication Technology (ICICT 2024 2024)

Part of the book series: Lecture Notes in Networks and Systems ((LNNS,volume 1013))

Included in the following conference series:

  • 87 Accesses

Abstract

Image segmentation is a foundational technique in computer vision with wide-ranging applications, including its critical role in medical imaging for object identification, automatic labeling, and disease diagnosis. Advancements in deep learning have significantly improved the accuracy and efficiency of image segmentation, making it an increasingly valuable tool in various domains. Class imbalanced datasets are a frequent problem experienced when trying to train segmentation networks. Class imbalance occurs when some classes (semantic categories) in the image have significantly more instances (pixels) than others. In semantic segmentation, this often happens because certain object categories are more prevalent in the real world or dataset, while others are rarer. When training a deep learning model for semantic segmentation, this imbalance can lead to several problems. In this article, we have experimented with the class weightage parameters of binary focal loss to address the class imbalance problem in semantic segmentation. By utilizing the CANDID-PTX dataset, we have utilized U-Net architecture containing upsampling (encoder) and a downsampling (decoder) network for comparing binary focal loss rates among different alpha and gamma coefficients class weights. Doing so, we found that the adjustment of class weights in the loss function could notably help in resolving the class imbalance problems.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 219.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 249.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Megahed FM, Chen YJ, Megahed A, Ong Y, Altman N, Krzywinski M (2021) The class imbalance problem. Nat Methods 18(11):1270–1272. https://doi.org/10.1038/s41592-021-01302-4

    Article  Google Scholar 

  2. Raghuwanshi BS, Shukla S (2018) Class-specific extreme learning machine for handling binary class imbalance problem. Neur Netw Official J Int Neur Netw Soc 105:206–217. https://doi.org/10.1016/j.neunet.2018.05.011

    Article  Google Scholar 

  3. Desuky AS, Hussain S (2021) An improved hybrid approach for handling class imbalance problem. Arab J Sci Eng 46(4):3853–3864. https://doi.org/10.1007/s13369-021-05347-7

    Article  Google Scholar 

  4. Wang D, Wu H (2021) IoU regression with H+L-sampling for accurate detection confidence. Sensors (Basel, Switzerland) 21(13):4433. https://doi.org/10.3390/s21134433

    Article  Google Scholar 

  5. Al-Stouhi S, Reddy CK (2016) Transfer learning for class imbalance problems with inadequate data. Knowl Inf Syst 48(1):201–228. https://doi.org/10.1007/s10115-015-0870-3

    Article  Google Scholar 

  6. Zhang W, Chen Y, Yang W, Wang G, Xue JH, Liao Q (2021) Class-variant margin normalized softmax loss for deep face recognition. IEEE Trans Neur Netw Learn Syst 32(10):4742–4747. https://doi.org/10.1109/TNNLS.2020.3017528

    Article  Google Scholar 

  7. Aloo R, Mutoh A, Moriyama K, Matsui T, Inuzuka N (2022) Ensemble method using real images, metadata and synthetic images for control of class imbalance in classification. Artif Life Robot 27(4):796–803. https://doi.org/10.1007/s10015-022-00781-8

    Article  Google Scholar 

  8. Feng LX, Li X, Wang HY, Zheng WY, Zhang YQ, Gao DR, Wang MQ (2021) Automatic sleep staging algorithm based on time attention mechanism. Front Hum Neurosci 15:692054. https://doi.org/10.3389/fnhum.2021.692054

    Article  Google Scholar 

  9. Müller D, Soto-Rey I, Kramer F (2022) Towards a guideline for evaluation metrics in medical image segmentation. BMC Res Notes 15(1):210. https://doi.org/10.1186/s13104-022-06096-y

    Article  Google Scholar 

  10. Tyas DA, Ratnaningsih T, Harjoko A, Hartati S (2022) Erythrocyte (red blood cell) dataset in thalassemia case. Data Brief 41:107886. https://doi.org/10.1016/j.dib.2022.107886

    Article  Google Scholar 

  11. Feng S, Azzollini D, Kim JS, Jin CK, Gordon SP, Yeoh J, Kim E, Han M, Lee A, Patel A, Wu J, Urschler M, Fong A, Simmers C, Tarr GP, Barnard S, Wilson B (2021) Curation of the CANDID-PTX dataset with free-text reports. Radiol Artif Intell 3(6):e210136. https://doi.org/10.1148/ryai.2021210136

    Article  Google Scholar 

  12. Sarhan A (2021) Run length encoding based wavelet features for COVID-19 detection in X-rays. BJR Open 3(1):20200028. https://doi.org/10.1259/bjro.20200028

    Article  MathSciNet  Google Scholar 

  13. Semantic segmentation losses and metrics (2024). Retrieved from: https://github.com/qubvel/segmentation_models/blob/master/segmentation_models/losses.py

  14. Hossain S, John B, Andrew P (2020) Dual focal loss to address class imbalance in semantic segmentation. Retrieved from: https://users.monash.edu/~app/papers/20_NeuroC_prostate.pdf

  15. Yousef R, Khan S, Gupta G, Siddiqui T, Albahlal BM, Alajlan SA, Haq MA (2023) U-Net-based models towards optimal MR brain image segmentation. Diagnostics (Basel, Switzerland) 13(9):1624. https://doi.org/10.3390/diagnostics13091624

    Article  Google Scholar 

Download references

Funding

This work was primarily supported by the National Science Foundation EPSCoR Program under NSF Award # OIA-2242812.

Supplementary File

Training code can be found here: https://github.com/rushikeshchopaderc/Semantic_Segmentation_Code.

Supplementary file 1: Transformer-based U-Net model architecture.

Author information

Authors and Affiliations

Authors

Contributions

Rushikesh Chopade, Shrikant Pawar, and Aditya Stanam conceived the concepts, planned, and designed the article. Shrikant Pawar and Rushikesh Chopade primarily wrote and edited the manuscript.

Competing Interests

The authors declare that they have no competing interests.

Corresponding author

Correspondence to Shrikant Pawar .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Chopade, R., Stanam, A., Pawar, S. (2024). Addressing Class Imbalance Problem in Semantic Segmentation Using Binary Focal Loss. In: Yang, XS., Sherratt, S., Dey, N., Joshi, A. (eds) Proceedings of Ninth International Congress on Information and Communication Technology. ICICT 2024 2024. Lecture Notes in Networks and Systems, vol 1013. Springer, Singapore. https://doi.org/10.1007/978-981-97-3559-4_28

Download citation

  • DOI: https://doi.org/10.1007/978-981-97-3559-4_28

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-97-3558-7

  • Online ISBN: 978-981-97-3559-4

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics