Abstract
Deep convolutional neural networks (CNNs) have achieved remarkable results in image processing tasks, but their high capacity often leads to overfitting. While data augmentation techniques like Cutout and Mixup have been proposed to mitigate this, they often discard information or create unnatural pixel intensities. We introduce Random Image Cropping and Patching (RICAP), a spatial data augmentation technique that constructs new training samples by stitching together four randomly cropped image patches. By mixing class labels proportionally to each patch's area, RICAP encourages models to learn from the entire image context rather than just salient features. Our method achieved a state-of-the-art test error of 2.19% on CIFAR-10 and demonstrated significant improvements across ImageNet classification and COCO object detection tasks.
Introduction
Modern deep CNNs are prone to memorizing specific, salient features of training data—such as the head of a bird—rather than learning a generalized representation of the object. This tendency leads to poor generalization on unseen data. Traditional augmentation methods like flipping and rotation provide limited variety. Recent advancements like Cutout, which masks parts of an image, and Mixup, which blends two images at the pixel level, have improved performance. However, Cutout loses information, and Mixup creates "unnatural" images that do not reflect real-world distributions. RICAP addresses these issues by creating a "spatial blend" that preserves local feature integrity while diversifying global context.
Methodology: Random Image Cropping and Patching (RICAP)
The RICAP process is a simple yet effective four-step pipeline designed to enrich the training set with spatially diverse samples.
- Image Selection: Four images are randomly sampled from the training dataset.
- Boundary Determination: A split point $(w, h)$ is selected within the target image dimensions $(I_x, I_y)$. This point is drawn from a Beta distribution, controlled by a hyperparameter $\beta$.
- Cropping and Patching: The split point divides the final image into four quadrants. For each quadrant, a random crop is taken from one of the four source images to fill that specific area.
- Label Mixing: The target label for the new image is a "soft" label. The class probabilities are weighted based on the area (occupancy) of each patch in the final image.
This approach effectively transforms the classification task into an "occupancy estimation" task. By forcing the model to identify the proportion of each class present, RICAP provides a form of weak supervision that encourages the network to utilize the entire image, including background context.
Experimental Results
The authors evaluated RICAP across several benchmark datasets and tasks:
- CIFAR-10: When combined with the Shake-Shake regularization model, RICAP achieved a test error of 2.19%, outperforming both Cutout and Mixup.
- ImageNet: RICAP improved the Top-1 error of a WideResNet-50 from 21.90% to 20.33%.
- Object Detection (COCO): Using RICAP for image patching improved the mAP of YOLOv3 from 51.3 to 52.7, demonstrating that spatial augmentation benefits localization tasks as well.
- Image-Caption Retrieval: RICAP improved R@1 scores on the Microsoft COCO dataset using the VSE++ framework.
Discussion and Conclusion
RICAP provides a robust mechanism for preventing overfitting by increasing feature diversity and forcing models to learn from non-salient regions. The hyperparameter $\beta$ plays a critical role; a value of $\beta=0.3$ was found to be optimal, preventing the split point from staying too close to the center, which would result in excessive label smoothing.
While highly effective for standard classification and detection, RICAP may conflict with "part-based" models (e.g., in Person Re-identification) where fixed spatial structures are expected. Future work could explore more sophisticated label mixing for detection tasks or optimizing I/O performance for the four-image sampling process. Overall, RICAP stands as a powerful, spatially-aware alternative to pixel-blending augmentation techniques.
Summary updated