Detecting Spurious Correlations With Sanity Tests for Artificial Intelligence Guided Radiology Systems

Usman Mahmood, Robik Shrestha, David D. B. Bates, Lorenzo Mannelli, Giuseppe Corrias, Yusuf E. Erdi, Christopher Kanan · DOI

Deep learning models in medical imaging often achieve high accuracy by exploiting "spurious correlations"—non-biological shortcuts such as scanner noise or background artifacts—rather than learning actual pathology. This paper introduces a suite of "sanity tests" designed to detect these failures early in the development cycle, preventing the deployment of models that are "right for the wrong reasons."

The Problem: "Lazy" AI in Radiology

Deep learning models are inherently "lazy," seeking the path of least resistance to minimize error. In radiology, this often results in the model identifying a specific hospital's scanner fingerprint or technician-specific cropping patterns instead of biological markers. While external validation is the gold standard for catching these errors, it is expensive and time-consuming. The authors propose "failing fast" by using sanity tests during initial development to identify when a model is "cheating."

Methodology and Sanity Tests

The researchers developed CTNet, a 3D classification system based on the Inception v4 architecture, to detect pancreatic cancer. To evaluate its reliability, they implemented three core sanity tests:

  1. Target Present vs. Absent: Images were modified to digitally remove the target organ (the pancreas). If the model maintains high diagnostic accuracy without the organ, it is clearly relying on spurious background features.
  2. Noise Image Testing: A novel method generated "noise images" that capture imaging hardware "fingerprints" without containing any human anatomy.
  3. ROI (Region of Interest) Consistency: Models were trained on precisely cropped organs versus full slices to test generalization across different views of the same data.
Figure 6: Overview of data preparations for sanity testing. (A) Original CT slice with segmented tumor and pancreas. (B) "Without Pancreas" test with organ masking. (C) Cropped Region of Interest (ROI). (D) Generated noise image capturing hardware fingerprints.

Experimental Setup and Datasets

The study utilized three primary data sources to test for bias and generalization:

  • TCIA (The Cancer Imaging Archive): Used for 82 "normal" pancreas scans.
  • MSD (Medical Image Segmentation Decathlon): Used for 82 "abnormal" pancreas scans.
  • DECT (Dual Energy CT): An independent generalization dataset of 116 patients from a different institution.

The use of two different datasets (TCIA and MSD) for the binary classification task created a classic environment for spurious correlations, as the model could learn to distinguish between the acquisition parameters of the two sources rather than the disease state.

Key Insights and Results

The sanity tests revealed significant flaws in the models' learning processes:

  • The Noise Image Revelation: A model trained only on noise images achieved a near-perfect AUC of 0.98. This proved the AI didn't need to see any human anatomy to "diagnose" the patient based on dataset-specific noise.
  • The Optional Organ: Models performed almost identically on original images (AUC 0.95) and images where the pancreas was entirely removed (AUC 0.96). This indicated the model was almost entirely ignoring the organ it was supposed to be analyzing.
  • Robustness vs. Performance: The most clinically sound model—forced to look only at the pancreas—had the lowest performance on the development set (AUC 0.82). However, it proved more robust on the generalization set compared to "cheating" models, which failed significantly when tested on the independent DECT data.

Conclusion

While these sanity tests are effective at detecting bias, they do not automatically mitigate it. The authors emphasize the need for integrating such tests into standard AI development frameworks and improving data-reporting standards to minimize the hardware "fingerprints" that allow models to bypass learning actual medical features. Failing fast during development ensures that only models with true clinical utility proceed to expensive external validation.

Summary updated

BibTeX
@article{mahmood2021detecting,
  author = {Usman Mahmood and Robik Shrestha and David D. B. Bates and Lorenzo Mannelli and Giuseppe Corrias and Yusuf E. Erdi and Christopher Kanan},
  title = {{Detecting Spurious Correlations With Sanity Tests for Artificial Intelligence Guided Radiology Systems}},
  journal = {Frontiers Digit. Health},
  year = {2021},
  doi = {10.3389/fdgth.2021.671015},
}
Figure