Improving Rare Disease Prediction with Specialized Loss Functions
2025 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [en]
Automated medical coding aims to assign standardized diagnosis and procedure codes to clinical documents, but faces significant challenges due to severe class imbalance between common and rare codes. This thesis investigates how specialized loss functions can improve rare disease prediction in the context of automated ICD-9 code assignment using the large language models (LLMs) with the MIMIC-III dataset.
We implemented and evaluated two specialized loss functions Focal Loss (FL) and Asymmetric Loss (ASL) with the state-of-the-art PLM-ICD (Pre-trained Language Model for International Classification of Diseases) model architecture. These lossfunctions were designed to address class imbalance by differentially weighting the examples based on classification difficulty and positive/negative class separation.
Our experiments show that ASL achieved the best performance, improving Macro F1 scores by 0.023 to the standard Binary Cross-Entropy loss while maintaining comparable Micro-F1 performance. Focal Loss also consistently improved rare disease prediction across multiple parameter configurations.
Our findings confirm that loss function engineering is an effective approach for improving rare disease prediction in automated medical coding systems. This work contributes to addressing the performance gap between common and rare codes, potentially enhancing the clinical utility of automated coding systems in healthcare settings.
Abstract [sv]
Automatiserad medicinsk kodning syftar till att tilldela standardiserade diagnos och procedurkoder till kliniska dokument, men står inför betydande utmaningar på grund av allvarlig klassobalans mellan vanliga och sällsynta koder. Detta examensarbete undersöker hur specialiserade förlustfunktioner kan förbättra prediktion av sällsynta sjukdomar i samband med automatiserad ICD-9-kodning med hjälp avstora språkmodeller (LLMs) med MIMIC-III datasetet.
Vi implementerade och utvärderade två specialiserade förlustfunktioner Focal Loss (FL) och Asymmetric Loss (ASL) och integrerade med den topp presterande PLM-ICD (Pre-trained Language Model for International Classification of Diseases) modellarkitekturen. Dessa förlustfunktioner utformades för att hantera klassobalans genom att differentiellt vikta exempel baserat på klassificeringssvårighet och positiv/negativ klasseparation.
Våra experiment visar att ASL uppnådde bäst resultat, med en förbättring av Macro-F1 med 0.023 i förhållande till standard Binary Cross-Entropy loss, samtidigt som jämförbar Micro-F1-prestanda bibehölls. Focal Loss förbättrade också konsekvent prediktionen av sällsynta sjukdomar över flera parameterkonfigurationer.
Våra resultat bekräftar att förlustfunktionsutveckling är en effektiv metod för att förbättra prediktion av sällsynta sjukdomar i automatiserade medicinska kodningssystem. Detta arbete bidrar till att minska prestationsgapet mellan vanliga och sällsynta koder, vilket potentiellt förbättrar den kliniska applikationen av automatiserade kodningssystem inom vårdmiljöer.
Place, publisher, year, edition, pages
2025. , p. 36
Keywords [en]
Medical coding, rare disease prediction, loss functions, class imbalance, deep learning, transformer models, MIMIC-III, ICD-9 codes
Keywords [sv]
Medicinsk kodning, prediktion av sällsynta sjukdomar, förlustfunktioner, klassobalans, djupinlärning, transformatormodeller, MIMIC-III, ICD-9-koder
National Category
Other Engineering and Technologies Artificial Intelligence
Identifiers
URN: urn:nbn:se:hh:diva-56266OAI: oai:DiVA.org:hh-56266DiVA, id: diva2:1965860
Supervisors
Examiners
2025-06-092025-06-092025-10-01Bibliographically approved