Dataset-Agnostic Vessel Segmentation of Retinal Fundus Images by a Vector Quantized Variational Autoencoder

Tejas Prabhune, D. WalzJournal of Student Research 2021

Abstract

Vessel segmentation is a critical step in diagnosing retinal diseases like diabetic retinopathy. While deep learning models such as U-Net have automated this process, they often struggle to generalize across different datasets due to variability in image acquisition, a phenomenon known as domain shift. This research proposes a dataset-agnostic approach using a Vector Quantized Variational Autoencoder (VQ-VAE). By utilizing a discrete embedding space, the VQ-VAE learns structural features that are robust to camera-specific noise and textures. When trained on the DRIVE dataset and tested on IOSTAR and CHASE_DB1, the VQ-VAE maintained consistent performance (F1 scores ~0.76), whereas the standard U-Net failed to produce meaningful segmentations on out-of-domain data. This model offers a resource-efficient solution for clinical environments where diverse imaging hardware is used.

Introduction

The analysis of retinal fundus images is essential for identifying vascular changes associated with systemic and ocular diseases. Manual vessel segmentation is time-intensive and prone to observer bias, leading to the widespread adoption of automated AI models. However, a major hurdle in deploying these models is "domain shift"—the performance drop when a model trained on one dataset is applied to another with different characteristics, such as lighting, resolution, or sensor noise.

Standard architectures like U-Net are highly sensitive to these variations. As shown in Figure 1, even minor perturbations or changes in image style can cause a U-Net to produce entirely blank outputs or incorrect segmentations, rendering them unreliable for cross-clinic use.

Figure 1: Illustration of U-Net failure due to domain shift. Example (a) shows a complete failure (black screen) when noise is added, while example (b) shows a significant degradation in segmentation quality.

Methodology

To address the lack of generalization, this study introduces a cross-domain VQ-VAE. Unlike traditional autoencoders that use a continuous latent space, the VQ-VAE employs a discrete codebook.

Architecture and Quantization

The model consists of an encoder that compresses the input image and a decoder that reconstructs the vessel segmentation mask. The innovation lies in the quantization step: the encoder's continuous output is mapped to the nearest vectors in a discrete embedding space. This process acts as a powerful regularizer, forcing the model to ignore high-frequency "style" noise and focus on the "macro-features" of vessel structures.

Training Objectives

The model is optimized using a tripartite loss function:

  • Reconstruction Loss: Ensures the predicted mask matches the ground truth.
  • L2 Loss: Encourages the encoder's output to stay close to the selected codebook vectors.
  • Commitment Loss: Ensures the encoder "commits" to specific embeddings, preventing the latent space from fluctuating excessively and ensuring the model learns structural rather than textural features.

Experimental Setup

The model was trained exclusively on the DRIVE dataset, which contains 40 images. To evaluate generalization, it was tested on two unseen datasets:

  • IOSTAR: Images captured via Scanning Laser Ophthalmoscopy (SLO), featuring distinct textures compared to DRIVE.
  • CHASE_DB1: Images from a different camera model with varying lighting conditions.

Results and Discussion

The VQ-VAE demonstrated remarkable robustness across all three datasets, achieving "zero-shot" generalization. While the U-Net's performance plummeted to near-zero F1 scores on out-of-domain data, the VQ-VAE remained stable.

Dataset U-Net F1 Score VQ-VAE F1 Score
DRIVE (In-domain) Successful 0.767
IOSTAR (Out-of-domain) ~0.000 (Failed) 0.761
CHASE_DB1 (Out-of-domain) ~0.000 (Failed) 0.758

Qualitative analysis confirmed that the VQ-VAE successfully captured both major vessels and finer branches across different imaging modalities. The discrete bottleneck effectively filtered out the domain-specific "noise" that typically confuses continuous-feature models like U-Net.

Conclusion

The proposed VQ-VAE provides a dataset-agnostic solution for retinal vessel segmentation, eliminating the need for costly retraining or complex style-transfer techniques. This makes it highly suitable for real-world clinical deployment across diverse healthcare settings. Future work will focus on reducing false positives near the optic disc and image edges, potentially by integrating self-attention mechanisms to better distinguish vascular structures from other anatomical features.

Summary updated

BibTeX
@article{prabhune2021dataset,
  author = {Tejas Prabhune and D. Walz},
  title = {{Dataset-Agnostic Vessel Segmentation of Retinal Fundus Images by a Vector Quantized Variational Autoencoder}},
  journal = {Journal of Student Research},
  year = {2021},
  doi = {10.47611/jsrhs.v10i3.2280},
}
Figure