Self-supervised pseudo multi-class pre-training for unsupervised anomaly detection and segmentation in medical images

Yu Tian, Fengbei Liu, Guansong Pang, Yuanhong Chen, Yuyuan Liu, Johan W. Verjans, Rajvinder Singh, Gustavo Carneiro

TL;DR

This paper introduces PMSACL, a novel self-supervised pre-training method for unsupervised anomaly detection (UAD) in medical images. By creating "pseudo" abnormal classes from healthy images, PMSACL trains models to better distinguish subtle anomalies, significantly improving the performance of existing UAD techniques across various medical imaging tasks.

What Problem Does This Paper Address?

Medical image analysis often faces a challenge: screening datasets are heavily imbalanced, with a vast majority of normal images and very few abnormal ones. Unsupervised Anomaly Detection (UAD) methods are designed to handle this by training exclusively on normal images, but this can lead to models that learn representations too generic to detect subtle, varied anomalies. Existing self-supervised learning (SSL) approaches, while promising, often adapt generic computer vision techniques without leveraging domain-specific knowledge, failing to effectively cluster normal data or prepare for the UAD task's inherent one-class nature. This paper aims to bridge this gap by proposing a pre-training method that specifically addresses the unique challenges of UAD in medical imaging.

Methods

The core of this work is the Pseudo Multi-class Strong Augmentation via Contrastive Learning (PMSACL). It's a self-supervised pre-training strategy that uses only normal training images. The key innovations are:

  • Pseudo Multi-class Formulation: Instead of treating all normal images as a single class, PMSACL synthesizes "pseudo" abnormal classes by applying strong augmentations (MedMix) to the normal images. This creates a pseudo multi-class problem where one class represents normal images, and others represent simulated anomalies.
  • MedMix Augmentation: This novel augmentation technique generates realistic-looking anomalies by cutting and pasting deformed patches from normal images, then applying transformations like color jittering, Gaussian noise, and non-linear distortions. This is designed to simulate a variety of lesion appearances.
  • Constrained Contrastive Learning: PMSACL employs a modified contrastive loss that encourages dense clusters for each class (normal and pseudo-abnormal). It introduces a "multi-centring loss" to pull feature representations towards their respective class centers and a refined contrastive loss that balances intra-class tightness and inter-class separation.
  • Auxiliary Pretext Tasks: The method also incorporates two standard pretext tasks: a classification loss to predict the type of strong augmentation applied and a positional prediction loss to learn local image features.

Datasets

The proposed PMSACL method was evaluated on four medical imaging datasets:

  • Hyper-Kvasir: A large, multi-class dataset for gastrointestinal endoscopy (colonoscopy).
  • LAG: A dataset of fundus images for glaucoma diagnosis.
  • Liu et al.'s Colonoscopy Dataset: Another colonoscopy dataset.
  • Covid-X: A dataset of Chest X-ray (CXR) images for COVID-19 detection.

The authors used subsets of these datasets for training (normal images) and testing (both normal and abnormal images, with segmentation masks where available).

Key Insights and Ideas

  • Simulating Anomalies is Crucial: The paper strongly suggests that simply using generic image augmentations is insufficient for UAD in medical imaging. Creating realistic "pseudo" anomalies that mimic real-world variations is key to effective pre-training.
  • Pseudo Multi-class Learning for UAD: Reframing UAD as a pseudo multi-class problem, even when using only normal data, allows the model to learn more discriminative features by explicitly contrasting simulated anomalies against normal data.
  • Dense Clusters for Normalcy: The multi-centring loss and refined contrastive learning are vital for ensuring that normal image representations form tight, dense clusters, making it easier to identify deviations.
  • Domain-Specific Augmentation Matters: MedMix's success over generic augmentations highlights the importance of tailoring data augmentation to the specific characteristics of medical anomalies.

Key Results

PMSACL significantly improved the performance of state-of-the-art UAD methods (PaDiM and IGD) across all tested datasets.

  • Hyper-Kvasir: Achieved SOTA AUC of 99.6% with PaDiM and 99.5% with IGD, outperforming previous methods by a considerable margin.
  • LAG: Achieved SOTA AUC of 90.8% with IGD, showing substantial improvements over ImageNet pre-training.
  • Liu et al.'s Colonoscopy: Achieved SOTA AUC of 85.1% with IGD.
  • Covid-X: Achieved SOTA AUC of 87.2% with IGD, demonstrating effectiveness on subtle lesions in X-rays.
  • Anomaly Segmentation: PMSACL also improved anomaly localization metrics like IoU and Dice scores, with PaDiM achieving SOTA 40.6% IoU and 55.4% Dice on Hyper-Kvasir.

Limitations and Future Work

  • Limitations:
    • The paper notes that iteratively updating class centers during training can be computationally expensive and sometimes unstable. They found pre-defining centers to be more efficient and stable.
  • While MedMix is effective, the optimal number of pseudo-abnormal classes (|A|) needs to be determined, and the paper shows performance drops if it's too few or too many.
  • Future Work:
    • The authors plan to design a new anomaly detector that is specifically tailored to the characteristics learned by their self-supervised PMSACL pre-training.

Summary updated

BibTeX
@article{tian2023self,
  author = {Yu Tian and Fengbei Liu and Guansong Pang and Yuanhong Chen and Yuyuan Liu and Johan W. Verjans and Rajvinder Singh and Gustavo Carneiro},
  title = {{Self-supervised pseudo multi-class pre-training for unsupervised anomaly detection and segmentation in medical images}},
  journal = {Medical Image Analysis},
  year = {2023},
  doi = {10.1016/j.media.2023.102930},
}

Loading related content...

Figure