Abstract
Most benchmark datasets for computer vision contain irrelevant images, near duplicates, and label errors. Consequently, model performance on these benchmarks may not be an accurate estimate of generalization capabilities. This is a particularly acute concern in computer vision for medicine where datasets are typically small, stakes are high, and annotation processes are expensive and error-prone. In this paper we propose SelfClean, a general procedure to clean up image datasets exploiting a latent space learned with self-supervision. By relying on self-supervised learning, our approach focuses on intrinsic properties of the data and avoids annotation biases. We formulate dataset cleaning as either a set of ranking problems, which significantly reduce human annotation effort, or a set of scoring problems, which enable fully automated decisions based on score distributions. We demonstrate that SelfClean achieves state-of-the-art performance in detecting irrelevant images, near duplicates, and label errors within popular computer vision benchmarks, retrieving both injected synthetic noise and natural contamination. In addition, we apply our method to multiple image datasets and confirm an improvement in evaluation reliability.
Introduction
In the era of "Big Data," data quality is often overlooked. While massive models can sometimes learn through noise, benchmark datasets are frequently riddled with issues. For instance, ImageNet-1k has an estimated label error rate of 3.4%. In high-stakes fields like medical imaging, even a small fraction of poor-quality data can lead to skewed performance estimates and dangerous conclusions. Manual cleaning is unscalable, and existing automated tools often rely on pre-trained models or supervised methods that introduce their own biases. SelfClean addresses this by providing an intrinsic cleaning method that understands the specific context of a dataset without external references.
The SelfClean Framework
SelfClean leverages Self-Supervised Learning (SSL) to audit dataset quality through a three-step process:
- Representation Learning: A feature extractor (e.g., SimCLR or DINO) is trained directly on the noisy dataset. Since SSL does not use labels, it is resilient to label noise and learns the inherent visual structure of the data.
- Distance-Based Indicators: Images are mapped into a latent space where geometric logic identifies three types of issues:
- Off-topic Samples: Detected via agglomerative clustering; "lonely" samples or those merging late into clusters are flagged.
- Near Duplicates: Identified by finding pairs with the smallest pairwise distances.
- Label Errors: Found using an intra-/extra-class distance ratio. A label is suspicious if an image's nearest neighbor of a different class is significantly closer than its nearest neighbor of the same class.
- Operation Modes: SelfClean can act as a ranking tool for human-in-the-loop verification or as a fully automatic scorer using statistical distributions to prune data.
Experimental Setup and Datasets
The authors validated SelfClean across 12 diverse datasets, including general computer vision benchmarks (ImageNet-1k, STL-10, CelebA, Food-101N) and specialized medical domains (CheXpert, VinDR-BodyPartXR, PatchCamelyon, and various dermatology datasets like Fitzpatrick17k). Synthetic "contaminated" versions were also used to measure detection precision.
Results and Key Insights
SelfClean outperformed state-of-the-art unsupervised methods (e.g., HBOS, ECOD) and specialized tools like FastDup across almost all categories.
- Intrinsic Advantage: Training SSL on noisy data often works better than using models pre-trained on massive external datasets like ImageNet, as the model learns the specific visual context (e.g., lighting, sensor noise) of the target domain.
- Efficiency: Ranking problematic samples allows humans to be 5 to 50 times more efficient in auditing. By focusing on the top of the ranked list, auditors find the vast majority of errors quickly.
- Real-World Impact: In the Fitzpatrick17k dataset, SelfClean identified that nearly 15% of images were near-duplicates, many representing leaks between training and evaluation sets. In dermatology data, it achieved a twofold increase in Average Precision for label error detection.
Limitations and Future Work
While effective, SelfClean has limitations. Training self-supervised Transformers from scratch is computationally expensive. Additionally, near-duplicate detection scales quadratically ($O(N^2)$), requiring approximation for million-scale datasets. Future work will focus on distinguishing between "hard examples" and actual errors, as well as developing optimal remediation strategies such as re-labeling versus deletion.
Summary updated