DAL: Dynamic Angular Loss for Imbalanced Medical Image Classification
Organizations: Department of Informatics, University of Zurich, Zurich, Switzerland
Abstract
Class imbalance remains a major obstacle in medical image classification, where rare but clinically important classes are often overshadowed by majority categories. Although current strategies for reducing bias, including angle-based softmax (ABS) losses, offer strong discriminative features, their behavior in settings with a small number of severely imbalanced classes remains insufficiently understood. Previous approaches that estimate the intrinsic parameters of ABS rely on the assumption of many classes, which does not hold in medical settings. We derive data-driven upper and lower bounds for the scale parameter and an upper bound for the angular margin using negative-angle statistics, and use these to drive a batch-adaptive angular margin (BAAM), which we combine with dynamically-weighted cross entropy (DWCE) to define our dynamic angular loss (DAL). Across four highly imbalanced medical image classification benchmarks spanning dermatology, ophthalmology, and gastrointestinal endoscopy, our method consistently achieves superior balanced accuracy and the lowest coefficient of variation of per-class recall. Although this entails a small performance reduction on majority classes, the gains on minority categories are substantial, yielding a reliable and equitable overall classifier. Our source code is available at: https://github.com/msalman95/DAL.
Figures & tables
| Method | ISIC 2018 | ISIC 2019 | ||||||||
| Acc | F1 | BA | IBA 1 | CoV | Acc | F1 | BA | IBA 1 | CoV | |
| Cross-Entropy | 0.7779 | 0.6182 | 0.6015 | 0.3887 | 0.2612 | 0.6378 | 0.4633 | 0.4562 | 0.2551 | 0.4281 |
| AdaCos Zhang et al. (2019) | 0.7741 | 0.5899 | 0.5897 | 0.4097 | 0.2910 | 0.6388 | 0.3744 | 0.3827 | 0.2243 | 0.7255 |
| ArcFace Deng et al. (2022) | 0.7857 | 0.6375 | 0.6407 | 0.4187 | 0.2101 | 0.6434 | 0.4517 | 0.4239 | 0.2424 | 0.5614 |
| Focal Loss Lin et al. (2017) | 0.7722 | 0.6195 | 0.6095 | 0.3969 | 0.2473 | 0.6466 | 0.4792 | 0.4687 | 0.2634 | 0.4193 |
| CCE Loss Kim et al. (2021) | 0.7738 | 0.6162 | 0.6084 | 0.3991 | 0.2339 | 0.6467 | 0.4756 | 0.4576 | 0.2574 | 0.4377 |
| Method | ISIC 2018 | APTOS 2019 | ||||
|---|---|---|---|---|---|---|
| Acc | BAcc | F1 | Acc | BAcc | F1 | |
| DenseNet121 | ||||||
| LDAM-DRW Cao et al. (2019) | — | 0.6876 | 0.6820 | — | 0.6217 | 0.6225 |
| DWB Fernando and Tsokos (2021) | — | 0.6204 | 0.6826 | — | 0.6555 | 0.6417 |
| MAAW Roy et al. (2023) | — | 0.7060 | 0.7019 | — | 0.6733 | 0.6701 |
| DAL (Ours) | 0.8448 | 0.7685 | 0.7480 | 0.8172 | 0.6934 | 0.6887 |
| Method | Acc | F1 | BAcc | IBA 1 | CoV | p-value | ||
|---|---|---|---|---|---|---|---|---|
| ArcFace | 4 | 0.0 | 0.7553 | 0.6458 | 0.7238 | 0.5352 | 0.1068 | |
| ArcFace | 4 | 0.1 | 0.7665 | 0.6560 | 0.7103 | 0.5101 | 0.1138 | |
| ArcFace | 4 | 0.2 | 0.7595 | 0.6601 | 0.7060 | 0.5032 | 0.1223 | |
| ArcFace | 4 | 0.3 | 0.7684 | 0.6618 | 0.6919 | 0.4992 | 0.1049 | |
| ArcFace | 8 | 0.1 | 0.7559 | 0.6604 | 0.7113 | 0.5271 | 0.0957 | |
| ArcFace | 16 | 0.3 | 0.7698 | 0.6651 | 0.7035 | 0.5090 | 0.1038 |
Class-Imbalanced Learning
Class-imbalanced learning develops classifiers that recognize rare classes without sacrificing performance on common ones.
See all 276 papers