Abstract
Deep learning-based MR image analysis is highly sensitive to input quality, yet manual quality control is unscalable and supervised models often fail to generalize across different scanners and protocols. We present a fully unsupervised framework for MR image quality control (IQC) that detects artifacts by mapping images into a latent space. Our method combines a contrastive artifact encoder with normalizing flows to estimate the density of "normal" high-quality images. Artifact-heavy images are identified as low-probability outliers in a standard Gaussian distribution. Evaluation on 16 cohorts demonstrates that our approach effectively flags diverse artifacts with high sensitivity and specificity, providing a robust, label-free solution for automated IQC.
Introduction
The "garbage in, garbage out" principle is a significant hurdle for deep learning in medical imaging. Artifacts such as motion blur, noise, or hardware issues can bias segmentation and registration results, leading to erroneous clinical conclusions. Traditional IQC relies on manual inspection—which is slow and subjective—or supervised models requiring thousands of expert-labeled images. This paper addresses these limitations by proposing an unsupervised system that learns to distinguish high-quality images from corrupted ones by modeling the distribution of artifact features without human labels.
Methodology
The proposed pipeline consists of two primary components: an artifact encoder and a density estimation module.
Artifact Encoding via Contrastive Learning
An "Artifact Encoder" ($E(\cdot)$) is trained using contrastive learning to extract features relevant to image quality while ignoring anatomical variations. The model learns to map slices with similar artifact levels close together in a 2D latent space ($m \in \mathbb{R}^2$). To achieve this without labels, the model is shown "positive" pairs (slices from the same 3D volume) and "negative" pairs (slices from different volumes or those corrupted with simulated noise and motion). This allows the encoder to focus on the "texture" of artifacts rather than anatomical structures.
Density Estimation via Normalizing Flows
Because the distribution of learned artifact features ($m$) is complex and unknown, a normalizing flow (specifically RealNVP) is employed to map $m$ into a simple, standard Gaussian distribution ($z \sim \mathcal{N}(0, I)$). This transformation provides a mathematically grounded way to handle unsupervised data by turning feature detection into a probability problem.
Unsupervised Classification
In the Gaussian space, high-quality images cluster near the high-density center, while artifact-heavy images fall into the low-probability "tails." By defining a likelihood threshold ($\tau$), the system automatically flags images as "failed" cases if their probability density falls below the threshold.
Experimental Setup
The study utilized T1-weighted MR volumes from 16 different cohorts, including open datasets (IXI-Brain, OASIS3, BLSA) and six private internal cohorts. The encoder was trained on 200 volumes, while 1,400 volumes were used for density estimation. Validation was performed on a separate set of 569 manually rated images to assess real-world performance against expert standards.
Results and Discussion
The framework was tested against both simulated and real-world artifacts, including bias fields, wrap-around artifacts, and registration errors.
- Simulated Artifacts: The model successfully identified eight common types of MR artifacts as low-probability outliers.
- Real-World Performance: Against expert ratings, the model achieved 91.0% sensitivity and 97.8% specificity at a 5% threshold ($\tau = 5\%$). Increasing the threshold to 3% improved specificity to 99.4%, ensuring that almost no high-quality data was accidentally discarded.
The primary limitation is the requirement for manual threshold selection at test time, which may vary depending on the specific dataset or downstream task. Future work aims to incorporate semi-supervised learning to automate this process and extend the framework to other MR modalities beyond T1-weighted images.
Conclusion
By combining contrastive feature learning with normalizing flows, this work provides a robust, unsupervised method for MR image quality control. The approach is scalable across diverse datasets and offers a principled alternative to manual inspection, ensuring the reliability of automated medical image analysis pipelines.
Summary updated