ODFormer: Semantic fundus image segmentation using Transformer for optic nerve head detection

Jiayi Wang, Yi-An Mao, Xiaoyu Ma, Sicen Guo, Yuting Shao, Xiao Lv, Wenting Han, Mark Christopher, Linda M. Zangwill, Yanlong Bi, Rui Fan

Introduction

In ophthalmology, the accurate detection and segmentation of the Optic Nerve Head (ONH) serves as a critical "North Star" for diagnostic tasks, most notably in calculating the cup-to-disc ratio for glaucoma assessment. While deep learning has significantly advanced semantic segmentation, ONH detection faces a persistent challenge: generalizability.

Most existing models are trained on datasets captured by a single type of fundus camera. When these models are deployed on different hardware—such as transitioning from a high-end desktop camera to a portable handheld device—performance often degrades due to variations in image resolution, illumination, and field of view. ODFormer addresses this gap by introducing a novel Transformer-based architecture designed for robustness across diverse imaging conditions.

Proposed Methodology

ODFormer is built upon the Swin Transformer architecture, enhanced by three specific architectural innovations designed to capture the nuances of medical imagery while maintaining computational efficiency.

Multi-Scale Context Aggregator (MSCA)

Standard Transformers typically split images into fixed patches, which can inadvertently discard local spatial priors. To mitigate this, ODFormer utilizes a Multi-Scale Context Aggregator (MSCA). By employing a series of atrous convolutions with increasing dilation rates during the initial feature extraction phase, the model is able to perceive features at multiple scales simultaneously before they enter the first Transformer block.

Improved Positional Encoding

To better capture the specific geometry of the eye, the authors integrated a convolutional layer to extract a relative position bias map. This improved positional encoding helps the model understand the spatial relationships between patches more effectively, which is vital for accurately identifying the characteristic oval shape of the ONH.

Lightweight Bidirectional Feature Recalibrator (LBFR)

Traditional upsampling methods in decoders, such as bilinear interpolation, often lose high-frequency spatial details necessary for precise boundary detection. The LBFR module addresses this by using 1D spatially separable convolutions—processing horizontal and vertical directions independently. This allows for efficient feature refinement and fusion, reducing information loss without significantly increasing the model's parameter count.

Experimental Setup and Datasets

The study evaluates ODFormer using three key datasets, including a new benchmark introduced by the authors:

  • TongjiU-DROD (New): A large-scale dataset featuring 147 participants. It is unique in providing images of the same eyes captured by two different devices: a high-resolution Zeiss CLARUS 500 and a portable NES-1000P handheld camera.
  • DRIONS-DB: A standard public dataset consisting of 110 fundus images used for model validation.
  • DRISHTI-GS1: A dataset of 101 high-resolution images encompassing both healthy and glaucomatous eyes.

Key Results and Discussion

ODFormer was benchmarked against 11 Convolutional Neural Networks (including U-Net and PSPNet) and 5 Transformer-based models (such as SegFormer and Swin-T).

Performance and Generalization

ODFormer achieved state-of-the-art results, reaching an Intersection over Union (IoU) of 88.35% on the TongjiU-DROD dataset. More importantly, the model demonstrated superior generalization in cross-dataset experiments. When trained on one dataset and tested on another, ODFormer outperformed the baseline Swin Transformer by up to 21.97% in IoU, proving its resilience to varying hardware and imaging conditions.

Qualitative Advantages

Visual analysis indicates that ODFormer produces significantly cleaner and more accurate ONH boundaries. It performs particularly well in challenging scenarios involving artifacts or blurred edges, where traditional models often produce fragmented or noisy segmentations.

Conclusion and Future Work

ODFormer demonstrates that a hybrid approach—combining the global context of Transformers with the spatial priors of CNNs—is highly effective for medical image segmentation. By training on the dual-resolution TongjiU-DROD dataset, the model learns features that are largely hardware-agnostic, making it a viable candidate for clinical deployment in diverse environments.

Future research will focus on incorporating dedicated denoising modules to handle extremely low-quality scans and exploring the architecture's applicability to other medical tasks, such as the segmentation of skin lesions or polyps, where multi-scale context is equally essential.

Summary updated

BibTeX
@article{wang2024odformer,
  author = {Jiayi Wang and Yi-An Mao and Xiaoyu Ma and Sicen Guo and Yuting Shao and Xiao Lv and Wenting Han and Mark Christopher and Linda M. Zangwill and Yanlong Bi and Rui Fan},
  title = {{ODFormer: Semantic fundus image segmentation using Transformer for optic nerve head detection}},
  journal = {Information Fusion},
  year = {2024},
  doi = {10.1016/j.inffus.2024.102533},
}
Figure