Abstract
As deep learning datasets grow to million-scale proportions, the prevalence of redundant "near-duplicate" (ND) images has become a significant bottleneck. These images consume excessive computational resources and can lead to inflated performance metrics through data leakage. This paper introduces CE-Dedup, a framework that utilizes computationally efficient image hashing to identify and remove redundant data. Our experiments demonstrate that CE-Dedup can reduce dataset sizes by up to 75% with minimal accuracy loss, or by 23% with no loss in performance, while providing a 30% reduction in training time.
Introduction
The dominant paradigm in computer vision has been that larger datasets inevitably lead to better models. However, this focus on quantity often overlooks dataset quality. Large-scale datasets like ImageNet and SVHN frequently contain near-duplicates—images that are nearly identical due to minor variations in lighting, cropping, or sequential capture.
These redundancies cause two primary issues: unnecessary resource consumption during training and "data leakage," where similar images appear in both training and testing sets, leading to over-optimistic evaluation results.
Methodology: The CE-Dedup Framework
CE-Dedup employs a two-stage pipeline designed for efficiency.
Stage 1: Lightweight Image Deduplication
Rather than using resource-intensive neural networks for feature extraction, CE-Dedup utilizes four classic hashing algorithms:
- Average Hashing (AHash): Based on pixel intensity relative to the mean.
- Difference Hashing (DHash): Based on the intensity gradient between adjacent pixels.
- Perceptual Hashing (PHash): Uses Discrete Cosine Transforms to focus on low-frequency components, making it robust to resizing and minor transformations.
- Wavelet Hashing (WHash): Utilizes Discrete Wavelet Transforms for frequency analysis.
Images are converted to grayscale and down-sampled to an 8x8 grid to generate a 64-bit hash. Redundancy is determined by the Hamming distance between hashes; if the distance falls below a specific threshold ($th$), the image is flagged as a duplicate and removed.
Stage 2: Model Training
The pruned dataset is used to train a standard ResNet50 architecture. This allows for a direct comparison of training efficiency and model accuracy against the original, full-scale dataset.
Experimental Results
The framework was evaluated on CIFAR10, CIFAR100, and SVHN, alongside a custom benchmark, Aug-UKBench, designed to test robustness against common image augmentations.
Efficiency and Accuracy
On the SVHN dataset, CE-Dedup achieved remarkable results:
- Lossless Pruning: Using PHash or DHash, the dataset size was reduced by 23% without any decrease in validation accuracy.
- Aggressive Pruning: By accepting a 5% accuracy trade-off, the dataset could be trimmed by 75%.
- Computational Savings: Pruning resulted in a 30% reduction in total training time, significantly lowering the energy and financial costs of model development.
Addressing Data Leakage
Analysis of the CIFAR dataset revealed that 75% of sampled near-duplicate pairs were split between the training and testing sets. By removing these duplicates, CE-Dedup ensures a more rigorous and honest evaluation of model generalization.
Discussion and Conclusion
The study highlights that PHash and DHash provide the most stable performance, with a recommended Hamming distance threshold between 6 and 8. While AHash and WHash are more aggressive in finding duplicates, they can negatively impact accuracy if the threshold is too high.
CE-Dedup proves that dataset deduplication is a high-ROI preprocessing step. Future research will explore the framework's applicability to more complex tasks like object detection and its performance across diverse architectures such as Vision Transformers.
Summary updated