Semantic Retrieval of Similar Radiological Images using Vision Transformers

Anjali Thakrar, Michael Jayasuriya, Adrian Serapio, Xiao Wu, Eric Davis, Jamie Schroeder, Maya Vella, Jae Ho SohnmedRxiv 2023

TL;DR

This paper demonstrates that Vision Transformers (ViTs) can bridge the "semantic gap" in medical imaging by retrieving radiological images that are both visually and diagnostically similar. By learning high-dimensional embeddings from Chest X-rays and CT scans, the model achieved up to 86% agreement with expert radiologists, outperforming traditional pixel-based retrieval methods.

What Problem Does This Paper Address?

In clinical practice, radiologists often need to find "similar cases" to help with a difficult diagnosis, create teaching files, or build research cohorts. However, searching through massive databases is difficult.

Existing Content-Based Image Retrieval (CBIR) tools usually fall into two traps:

  1. The Visual Trap: They find images that look similar at a pixel level (e.g., similar brightness or contrast) but have completely different medical meanings.
  2. The Label Trap: They find images with the same diagnosis label but vastly different visual presentations (e.g., a mild vs. severe case).

This is known as the semantic gap. The authors tackle this by using Vision Transformers to create a system that understands both the "what" (diagnosis) and the "how it looks" (visual features) simultaneously.

Methods

The researchers employed a standard Vision Transformer (ViT) architecture, which differs from traditional Convolutional Neural Networks (CNNs) by using "attention" to look at the entire image at once rather than focusing on small local patches.

  • Training Strategy:
    • For X-rays (CXR): They trained an ensemble of binary classifiers on four labels: Cardiomegaly (enlarged heart), Opacity, Emphysema, and "No Finding."
    • For CT Scans: They used a regression task, training the model to predict patient weight. This served as a "proxy task" to force the model to learn structural and anatomical features (like body habitus and fat distribution).
  • Retrieval Mechanism: Once trained, they removed the final classification layer. The remaining "activations" from the last layer became a latent space embedding—a mathematical fingerprint of the image.
  • Similarity Measure: To find similar images, the system calculates the L2 or cosine distance between these fingerprints. The "closest" images in this mathematical space are retrieved as the most similar.

Datasets

The study utilized two major public datasets:

  • NIH ChestX-ray14: 112,120 frontal view X-ray images. This is a standard benchmark for chest pathology.
  • National Lung Screening Trial (NLST): 25,354 unique patients, from which they extracted 111,955 CT slices.

Key Insights and Ideas

  • Global Context is King: ViTs are particularly well-suited for radiology because certain diagnoses (like Cardiomegaly) require understanding the relationship between different parts of the image (e.g., the size of the heart relative to the chest wall). CNNs often struggle with these long-range spatial relationships.
  • Proxy Tasks Work: One of the most interesting findings was that training a model to predict patient weight on CT scans successfully clustered images by "body habitus." This proves the model can learn meaningful clinical features even without explicit pathology labels.
  • Beyond Binary Labels: The model doesn't just find "another case of emphysema." It tends to find cases with a similar severity or visual presentation, which is much more useful for a doctor than a simple keyword search.
  • Human-Centric Validation: Instead of just relying on math, the authors conducted a "reader study" where five radiologists picked similar images. The high agreement between the model and the experts (Cohen’s Kappa of 0.65) suggests the model's "intuition" aligns with human clinical judgment.

Key Results

  • Quantitative Performance: The CXR model achieved a Mean Average Precision (mAP@5) of 0.76 for Cardiomegaly and a Normalized Discounted Cumulative Gain (nDCG@5) of 0.73 overall.
  • Radiologist Agreement: The model’s top picks agreed with the consensus of five radiologists on 86% of CXR samples and 79.2% of CT samples.
  • Clustering: t-SNE visualizations (a way to map high-dimensional data into 2D) showed clear, distinct clusters for different pathologies and weight categories, validating that the latent space is organized logically.

Limitations and Future Work

  • Data Hunger: ViTs typically require massive amounts of data. While 100k+ images is a lot, the authors note that training on 10M+ images in a self-supervised manner would likely yield even better results.
  • Label Noise: The NIH dataset is known to have "noisy" (sometimes incorrect) labels, which acts as a ceiling for how well any model can perform.
  • Sample Size: The qualitative reader study was relatively small (50 total image sets).
  • Future Directions: The authors suggest extending this to multi-class classification and more complex 3D clustering to create a truly modular and intelligent retrieval system for hospitals.

Summary updated

BibTeX
@misc{thakrar2023semantic,
  author = {Anjali Thakrar and Michael Jayasuriya and Adrian Serapio and Xiao Wu and Eric Davis and Jamie Schroeder and Maya Vella and Jae Ho Sohn},
  title = {{Semantic Retrieval of Similar Radiological Images using Vision Transformers}},
  year = {2023},
  doi = {10.1101/2023.02.16.23286056},
  howpublished = {medRxiv},
}
Figure