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

**Authors:** Ningning Tang, Qi Chen, Yunyu Meng, Daizai Lei, Li Jiang, Yikun Qin, Xiaojia Huang, Fen Tang, Shanshan Huang, Qianqian Lan, Qi Chen, Lijie Huang, Rushi Lan, Xipeng Pan, Huadeng Wang, Fan Xu, Wenjing He

PMC · DOI: 10.3389/fbioe.2025.1576513 · 2025-06-06

## TL;DR

This paper introduces a new AI method to detect corneal abnormalities in eye images without needing labeled examples of diseases.

## Contribution

A Transformer-based unsupervised anomaly detection model for IVCM images with interpretable anomaly maps and improved generalizability.

## Key findings

- The model achieved AUCs of 0.933 (internal) and 0.917 (external), outperforming existing methods.
- Anomaly scores showed statistically significant differences between normal and pathological images (p < 0.001).
- Explainable maps highlighted morphological deviations linked to potential corneal disease biomarkers.

## Abstract

In vivo confocal microscopy (IVCM) is a crucial imaging modality for assessing corneal diseases, yet distinguishing pathological features from normal variations remains challenging due to the complex multi-layered corneal structure. Existing anomaly detection methods often struggle to generalize across diverse disease manifestations. To address these limitations, we propose a Transformer-based unsupervised anomaly detection method for IVCM images, capable of identifying corneal abnormalities without prior knowledge of specific disease features.

Our method consists of three submodules: an EfficientNet network, a Multi-Scale Feature Fusion Network, and a Transformer Network. A total of 7,063 IVCM images (95 eyes) were included for analysis. The model was trained exclusively on normal IVCM images to capture and differentiate structural variations across four distinct corneal layers: epithelium, sub-basal nerve plexus, stroma, and endothelium. During inference, anomaly scores were computed to distinguish pathological from normal images. The model’s performance was evaluated on both internal and external datasets, and comparative analyses were conducted against existing anomaly detection methods, including generative adversarial networks (AnoGAN), generate to detect anomaly model (G2D), and discriminatively trained reconstruction anomaly embedding model (DRAEM). Additionally, explainable anomaly maps were generated to enhance the interpretability of model decisions.

The proposed method achieved an the areas under the receiver operating characteristic curve of 0.933 on internal validation and 0.917 on an external test dataset, outperforming AnoGAN, G2D, and DRAEM in both accuracy and generalizability. The model effectively distinguished normal and pathological images, demonstrating statistically significant differences in anomaly scores (p < 0.001). Furthermore, visualization results indicated that the detected anomalous regions corresponded to morphological deviations, highlighting potential imaging biomarkers for corneal diseases.

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.

## Full-text entities

- **Diseases:** corneal abnormalities (MESH:D003316)

## Figures

6 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12179219/full.md

---
Source: https://tomesphere.com/paper/PMC12179219