Classification of Retinal OCT Images on an Imbalanced Dataset Using a Swin Transformer
Small and severely imbalanced optical coherence tomography (OCT) datasets pose a major challenge for deep learning algorithms while reflecting the reality of smaller ophthalmology centers, where rare retinal pathologies such as retinal artery occlusion (RAO) and vitreomacular interface disease (VID) occur only sporadically. The experiments were performed on the imbalanced OCTDL dataset (seven classes, 2064 images) and on a custom imbalanced subset of OCT-C8 (eight classes) matching the OCTDL class distribution. An extended ablation of eight loss functions was carried out under 10-fold stratified cross-validation (CV). As the loss for the final Swin Transformer Base model, we adopt dual-weighted PolyLoss (DW-PolyLoss), a lightweight modification of PolyLoss in which inverse-frequency class weights are applied symmetrically to both the cross-entropy and the polynomial correction terms. Under 10-fold stratified CV, the mean OCTDL accuracy is 95.63%, and a logit-averaging ensemble of the 10-fold models reaches 96.71% accuracy on OCTDL and 96.21% on a custom imbalanced subset of OCT-C8 constructed to match the OCTDL class distribution. Score-CAM analysis suggests that the model attends to clinically interpretable retinal structures, supporting potential use as a screening-triage tool subject to prospective clinical validation.
Authors
- Andrzej E. Grzybowski (ORCID: https://orcid.org/0000-0002-3724-2391)
- Marian Wysocki (ORCID: https://orcid.org/0000-0003-3564-4247)
- Paweł Borkowski (ORCID: https://orcid.org/0009-0003-5203-5782)
- Anna Wiśniewska-Borkowska (ORCID: https://orcid.org/0000-0001-6774-5953)
Institutions
- Rzeszów University of Technology (PL)
- Medical University of Lublin (PL)
- Foundation for Cardiac Surgery (BE)
- University of Warmia and Mazury in Olsztyn (PL)
- Adam Mickiewicz University in Poznań (PL)
Publication Details
- Journal
- Applied Sciences
- Published
- 2026-07-02
- DOI
- https://doi.org/10.3390/app16136628
- Primary Topic
- Retinal Imaging and Analysis
- Type
- article
- Field-Weighted Citation Impact
- 0.00