An explainable unsupervised learning approach for anomaly detection on corneal in vivo confocal microscopy images

Ningning Tang, Y. H. Meng, Daizai Lei, Li Jiang, Yikun Qin, Jimmy Xiangji Huang, Fen Tang, Shanshan Huang, Qianqian Lan, Qi Chen, L. Huang, Rushi Lan, Xipeng Pan, Huadeng Wang, Fan Xu, Wenjing HeFrontiers in Bioengineering and Biotechnology 2025 · DOI

Abstract

This study presents an efficient and interpretable unsupervised anomaly detection model for In Vivo Confocal Microscopy (IVCM) images, effectively identifying corneal abnormalities without requiring labeled pathological samples. By training on healthy tissue distributions, the proposed method enhances screening efficiency and reduces annotation costs, offering significant potential for scalable intelligent diagnosis of corneal diseases.

Introduction

Corneal diseases represent a major global cause of blindness. Diagnosis often relies on In Vivo Confocal Microscopy (IVCM), a non-invasive imaging technique providing high-resolution, layer-by-layer views of the cornea. However, the sheer volume of data—hundreds of images per eye—makes manual analysis by clinicians exhausting and prone to error. While supervised deep learning models can assist, they typically require massive datasets of expert-labeled pathological images, which are difficult to obtain for rare conditions.

Methodology

The researchers developed a Transformer-based unsupervised "normality-learning" model. Instead of learning specific disease patterns, the model is trained exclusively on healthy corneal tissue to understand the distribution of "normal" features.

As shown in the architecture diagram below, the system comprises three primary components:

  1. Feature Extraction: Utilizing a pre-trained EfficientNet-B3 to extract high-level semantic patterns.
  2. Multi-Scale Feature Fusion Network (MFFN): Merges features from multiple network layers to capture both fine textures and broader structural morphology.
  3. Transformer Network: The core reconstruction engine, employing Neighbor Masked Encoders (NME) and Layer-wise Query Decoders (LQD).
The architecture of the proposed anomaly detection model, featuring EfficientNet-B3 for feature extraction, a Multi-Scale Feature Fusion Network, and a Transformer Network for reconstruction.

The underlying logic is based on reconstruction error: the model learns to reconstruct healthy images with high fidelity. When presented with a pathological image (an anomaly), the reconstruction fails, and the resulting error serves as an "anomaly score." To prevent the model from simply copying adjacent pixels, the Neighbor Masked Encoder forces the network to learn deeper structural relationships.

Experimental Results

The model was evaluated using a dataset of 7,063 IVCM images (4,250 for training, 1,389 for internal validation, and 1,424 for external testing). The pathologies included various forms of keratitis, corneal dystrophy, and chemical burns.

  • Performance: The model achieved an Area Under the Curve (AUC) of 0.933 on internal data and 0.917 on the external test set, demonstrating robust generalizability.
  • Comparative Analysis: The proposed method significantly outperformed existing state-of-the-art unsupervised models, such as AnoGAN (AUC 0.706) and DRAEM (AUC 0.880).
  • Explainability: Beyond detection, the system generates "anomaly maps" (heatmaps) that highlight the specific regions of the lesion, providing clinicians with visual evidence for the AI's decision.

Discussion and Limitations

By focusing on "normality," this model acts as a universal detector capable of flagging rare diseases without prior exposure to them. Furthermore, its ability to handle multi-layer heterogeneity—processing the epithelium, stroma, and endothelium within a single model—streamlines the clinical workflow.

However, certain limitations remain. The model currently functions as a screening tool (detecting that something is wrong) rather than a diagnostic tool (identifying what the disease is). Additionally, subtle early-stage anomalies can sometimes be missed if they closely resemble normal tissue variations. Future work will focus on multi-center studies to ensure performance across different imaging hardware and more diverse patient populations.

Summary updated

Abstract

This study presents an efficient and interpretable unsupervised anomaly detection model for IVCM images, effectively identifying corneal abnormalities without requiring labeled pathological samples. The proposed method enhances screening efficiency, reduces annotation costs, and holds great potential for scalable intelligent diagnosis of corneal diseases.
BibTeX
@inproceedings{tang2025explainable,
  author = {Ningning Tang and Y. H. Meng and Daizai Lei and Li Jiang and Yikun Qin and Jimmy Xiangji Huang and Fen Tang and Shanshan Huang and Qianqian Lan and Qi Chen and L. Huang and Rushi Lan and Xipeng Pan and Huadeng Wang and Fan Xu and Wenjing He and Wenjing He},
  title = {{An explainable unsupervised learning approach for anomaly detection on corneal in vivo confocal microscopy images}},
  booktitle = {Frontiers in Bioengineering and Biotechnology},
  year = {2025},
  doi = {10.3389/fbioe.2025.1576513},
}
Figure