Constrained Contrastive Distribution Learning for Unsupervised Anomaly Detection and Localisation in Medical Images

Yu Tian, Guansong Pang, Fengbei Liu, Yuanhong Chen, Seon-Ho Shin, Johan W. Verjans, Rajvinder Singh, Gustavo Carneiro

This paper presents a novel approach to one of the most persistent challenges in medical AI: identifying rare diseases or lesions when you mostly have data from healthy patients.

TL;DR

The authors propose Constrained Contrastive Distribution learning (CCD), a self-supervised pre-training method that helps models detect and localize subtle medical anomalies using only "normal" images for training. By combining contrastive learning with specific pretext tasks like augmentation and location prediction, CCD achieves state-of-the-art performance in identifying lesions in colonoscopy and fundus images.

What Problem Does This Paper Address?

In medical imaging, "normal" (healthy) cases are abundant, while "abnormal" (diseased) cases are rare and expensive to label. This creates a massive class imbalance that makes traditional supervised learning difficult.

Unsupervised Anomaly Detection (UAD) aims to solve this by training models exclusively on healthy data. The model learns a representation of "normality"; anything that deviates from this pattern is flagged as an anomaly. However, UAD often struggles with subtle abnormalities—small lesions that don't look different enough from healthy tissue to trigger a detection. The gap lies in learning a feature representation that is sensitive enough to catch these tiny deviations without being overwhelmed by the natural variety found in healthy anatomy.

Methods

The core contribution is the CCD framework, which is used to pre-train an image encoder before it is plugged into a downstream anomaly detector. CCD consists of three main components:

  1. Contrastive Distribution Learning: Unlike standard contrastive learning (which often tries to spread features uniformly), CCD enforces a non-uniform distribution. It contrasts "weakly" augmented images against "strongly" augmented ones (like random permutations). The idea is that strong augmentations mimic the "abnormality" the model needs to eventually detect.
  2. Augmentation Prediction Constraint: The model is forced to classify which specific "strong" transformation was applied to an image. This encourages the model to learn discriminative features of what constitutes a "deviation" from the norm.
  3. Relative Patch Location Prediction: The model must predict the position of an image patch relative to the center. This "positional awareness" is crucial for fine-grained feature learning, which directly translates to better localization (pointing out exactly where a lesion is).

The resulting pre-trained encoder is "agnostic," meaning it can be used to improve various existing anomaly detection architectures like IGD, F-anoGAN, or MS-SSIM auto-encoders.

Datasets

The authors evaluated their method on three distinct medical benchmarks:

  • Hyper-Kvasir: A large-scale gastrointestinal dataset (colonoscopy) used for both detection and localization.
  • Liu et al.’s Colonoscopy Dataset: 18 videos from 15 patients, used specifically for anomaly detection.
  • LAG (Large-scale Attention-based Glaucoma): A fundus image dataset for glaucoma detection.

Key Insights and Ideas

  • Strong Augmentations as "Proxy" Anomalies: One of the "aha" moments is using jigsaw-style permutations and other strong distortions not just for variety, but as a proxy for the structural irregularities found in real lesions.
  • The Power of Constraints: The authors found that vanilla contrastive learning only gets you so far (91.3% AUC on Hyper-Kvasir). Adding the distribution contrast, augmentation classification, and patch location tasks boosted performance significantly (up to 97.2% AUC).
  • Localization via Self-Supervision: While many UAD methods are good at saying "this image is abnormal," they are often poor at saying "the lesion is here." By including the relative patch location task, CCD significantly improves the Mean Intersection over Union (mIoU) for lesion localization.

Key Results

  • State-of-the-Art (SOTA): CCD combined with the IGD detector achieved the highest AUC across all three datasets, outperforming previous methods like OCGAN and CAVGA.
  • Hyper-Kvasir Performance: The method reached an AUC of 0.972, a significant jump from the 0.939 achieved by the previous best version of IGD.
  • Localization Accuracy: In unsupervised localization, CCD achieved a Mean IoU of 0.372, outperforming the previous unsupervised SOTA (0.349).
  • Robustness: The method showed consistent improvements regardless of which downstream anomaly detector (IGD, F-anoGAN, or MS-SSIM) was used.

Limitations and Future Work

  • The Supervision Gap: While CCD is the best-performing unsupervised method, there is still a large gap between it and fully supervised models (which reach ~0.793 IoU on localization). Closing this gap without requiring thousands of labels remains the "holy grail."
  • Pretext Task Selection: The authors acknowledge that while their chosen pretext tasks (location and augmentation prediction) worked well, there may be other, more effective tasks specifically suited for different medical modalities (e.g., MRI or X-ray).
  • Future Directions: The team suggests investigating more complex pretext tasks and exploring how these self-supervised representations might transfer across different types of medical hardware or clinical settings.

Summary updated

BibTeX
@inproceedings{tian2021constrained,
  author = {Yu Tian and Guansong Pang and Fengbei Liu and Yuanhong Chen and Seon-Ho Shin and Johan W. Verjans and Rajvinder Singh and Gustavo Carneiro},
  title = {{Constrained Contrastive Distribution Learning for Unsupervised Anomaly Detection and Localisation in Medical Images}},
  booktitle = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year = {2021},
  doi = {10.1007/978-3-030-87240-3\_13},
}

Loading related content...

Figure