Source-linked AI summary

Random Erasing Data Augmentation

Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, Yi Yang

arXiv:1708.04896v2cs.CV

TL;DR

CNNs need improved generalization to partially occluded inputs. This paper introduces Random Erasing, which randomly occludes image regions during training and consistently improves performance across image classification, object detection, and person re-identification.

  • Problem

    CNNs need improved generalization to partially occluded inputs because occlusion critically affects generalization and motivates invariance to varying occlusion levels.

  • Method

    Random Erasing randomly replaces an arbitrary rectangular image region with random values during training, generating varied occlusions without changing the CNN learning strategy.

  • Results

    Random Erasing consistently improved deep models across image classification, object detection, and person re-identification, while improving robustness to partially occluded samples.

  • Takeaways & Limitations

    The lightweight, parameter-learning-free method complements existing augmentation and regularization approaches and integrates with various CNN recognition models.

Abstract

from arXiv · show

In this paper, we introduce Random Erasing, a new data augmentation method for training the convolutional neural network (CNN). In training, Random Erasing randomly selects a rectangle region in an image and erases its pixels with random values. In this process, training images with various levels of occlusion are generated, which reduces the risk of over-fitting and makes the model robust to occlusion. Random Erasing is parameter learning free, easy to implement, and can be integrated with most of the CNN-based recognition models. Albeit simple, Random Erasing is complementary to commonly used data augmentation techniques such as random cropping and flipping, and yields consistent improvement over strong baselines in image classification, object detection and person re-identification. Code is available at: https://github.com/zhunzhong07/Random-Erasing.

1. Introduction

Random Erasing is introduced to improve CNN generalization and robustness to occlusion by augmenting training images with randomly erased rectangular regions. The method is lightweight, broadly integrable, complementary to existing techniques, and improves recognition across multiple tasks.

  • Motivation: CNNs can overfit when models are excessively complex, weakening generalization and causing failures on new data.The paper motivates improving generalization because models may fit random error or noise rather than the underlying data distribution.
  • Occlusion problem: Limited occlusion variance in training data can make CNNs fail to recognize partially occluded objects despite strong performance on unobstructed images.A robust classifier should recognize an object from its overall structure under various occlusion levels.
  • Random Erasing: Random Erasing randomly keeps an image unchanged or replaces pixels in a randomly sized rectangular region with random values or the ImageNet mean pixel value.This training procedure generates augmented images with various occlusion levels using a random-sized mask.
  • Relationship to existing methods: Random Erasing complements existing augmentation and regularization methods, further improving recognition performance when combined.The introduction specifically relates it to random flipping, random cropping, and Dropout while distinguishing its image-level rectangular erasure.
  • Method properties: Random Erasing requires no extra parameter learning or memory consumption and integrates with various CNN models without changing the learning strategy.The method is presented as a lightweight approach for CNN training.
  • Results: Random Erasing consistently improves deep models on image classification, object detection, and person re-identification while improving robustness to partially occluded samples.On an occluded CIFAR-10 testing dataset, it significantly outperforms the baseline model.

2. Related Work

Related work frames regularization as important for preventing CNN overfitting, including dropout-based methods and data augmentation. Data augmentation enlarges training data through transformations, with random flipping and cropping identified as especially popular and effective.

  • Regularization: Regularization is a key component for preventing overfitting when training CNN models.The paper notes that various regularization methods have been proposed.
  • Dropout-based methods: Dropout randomly sets hidden-neuron outputs to zero during training, while DropConnect instead randomly zeros weights.Adaptive dropout estimates a dropout probability for each hidden neuron.
  • Data augmentation: Data augmentation explicitly regularizes deep CNN training by enlarging datasets from existing data through transformations such as translation, rotation, flipping, cropping, and noise addition.The passage describes augmentation as widely used in deep CNN training.
  • Data augmentation: Random flipping and random cropping are described as the two most popular and effective data augmentation methods for training deep CNNs.Random flipping horizontally flips the input image, while random cropping is another commonly used transformation.

3. Datasets

The paper evaluates image classification on CIFAR-10, CIFAR-100, and Fashion-MNIST, object detection on PASCAL VOC 2007, and person re-identification on Market-1501 and DukeMTMC-reID. Classification results use top-1 error rates reported as mean ± std over 5 runs.

  • Image classification: Image classification uses CIFAR-10, CIFAR-100, and Fashion-MNIST, covering 32×32 color or 28×28 grayscale images from 10 or 100 classes.CIFAR-10 and CIFAR-100 each contain 50,000 training and 10,000 testing images; Fashion-MNIST contains 60,000 training and 10,000 testing images.
  • Image classification: Classification performance is measured by top-1 error rates reported as mean ± std over 5 runs.The evaluation uses the specified reporting format across the classification datasets.
  • Object detection: Object detection uses PASCAL VOC 2007, with 9,963 images and 24,640 annotated objects split into trainval for training and test for evaluation.The dataset includes training/validation and testing sets.
  • Person re-identification: Person re-identification uses Market-1501 and DukeMTMC-reID datasets containing 1,501 and 1,812 identities, respectively.Market-1501 has 32,668 labeled bounding boxes, with 12,936 training images and 19,732 testing images; its probe set contains 3,368 hand-drawn images.

4. Our Approach

Random Erasing augments CNN training by probabilistically selecting images and replacing pixels in a randomly initialized rectangular region with random values. Its procedure controls the erased region through area and aspect-ratio ranges, generating images with varied occlusion levels.

  • Procedure: Random Erasing applies to each training image with probability p, while probability 1 − p leaves the image unchanged.This produces training images with various levels of occlusion.
  • Procedure: The method randomly selects a rectangular region Ie and erases its pixels with random values.The input image has width W, height H, and area S = W × H.
  • Procedure: The erased area ratio is initialized between sl and sh, and the rectangle’s aspect ratio is initialized between r1 and r2.The resulting erased-region dimensions are determined from its area and aspect ratio.
  • Procedure: A point P = (xe, ye) is randomly initialized, and the region is accepted when xe + We ≤ W and ye + He ≤ H.The accepted region is defined as Ie = (xe, ye, xe + We, ye + He).

4 else · 17 end

Random Erasing selects rectangular regions and replaces their pixels with random values, with task-specific strategies for classification, person re-identification, and object detection. Compared with random cropping, it preserves overall object structure while introducing partial occlusion and image noise.

  • 17 end: The method repeatedly selects an appropriate rectangle and assigns every pixel within it a random value from [0, 255].The selection and erasing procedure is specified in Algorithm 1.
  • 4.2. Random Erasing for Image Classification and Person Re-identification: For image classification, Random Erasing is applied to the whole image because training data generally lacks object-location information.The procedure follows Algorithm 1.
  • 4.2. Random Erasing for Image Classification and Person Re-identification: For person re-identification, rectangle regions are erased across the whole pedestrian image because pedestrians may be occluded at any position.Detected bounding boxes place pedestrians roughly in the same position and cover most of each image.
  • 4.3. Random Erasing for Object Detection: Figure 2 illustrates Image-aware Random Erasing, Object-aware Random Erasing, and Image and object-aware Random Erasing for object detection.These examples visualize the three detection schemes.
  • 4.3. Random Erasing for Object Detection: Object detection uses Image-aware Random Erasing on the whole image or Object-aware Random Erasing within each object’s bounding box.The passage also introduces a third scheme, Image and object-aware Random Erasing.
  • 4.4. Comparison with Random Cropping: Unlike random cropping, Random Erasing retains the object’s overall structure while occluding only parts of it.Random cropping can shift learning toward object parts, whereas Random Erasing preserves more of the object structure.
  • 4.4. Comparison with Random Cropping: Random Erasing reassigns erased pixels to random values, which can be viewed as adding noise to the image.This distinguishes its pixel treatment from random cropping.

5. Experiment · 5.1. Image Classification

The experiments compare CNNs trained with and without Random Erasing under matched initializations and common regularization and augmentation settings. Across datasets, architectures, hyper-parameters, erasing values, competing methods, and occlusion conditions, the results support broad classification gains and robustness.

  • 5.1.1 Experiment Settings: Experiments compare CNN models trained with or without Random Erasing from the same weight initialization.Weight decay, batch normalization, dropout, flipping, padding, and cropping are also employed.
  • 5.1.1 Experiment Settings: Four architectures are evaluated on CIFAR-10, CIFAR-100, and Fashion-MNIST: ResNet, pre-activation ResNet, ResNeXt, and Wide Residual Networks.ResNet and pre-activation ResNet use 20-, 32-, 44-, 56-, and 110-layer networks; pre-activation ResNet also uses an 18-layer network.
  • 5.1.2 Classification Evaluation: Random Erasing significantly improves accuracy across the evaluated CNN architectures and datasets.The method improves CIFAR-10 accuracy by 0.49% with ResNet-110 and 0.33% with ResNet-110-PreAct.
  • 5.1.2 Classification Evaluation: 3.08% error rate on CIFAR-10 with WRN-28-10 improves accuracy by 0.72% and achieves a new state of the art.On Fashion-MNIST, Random Erasing improves WRN-28-10 top-1 error from 4.01% to 3.65%.
  • 5.1.2 Classification Evaluation: 4.48% average classification error under p ∈[0.2, 0.8] and sh ∈[0.2, 0.8] beats the 5.17% baseline.The best aspect-ratio result has r1 = 0.3 and error rate = 4.31%, reducing classification error by 0.86% versus the baseline.
  • 5.1.2 Classification Evaluation: 4.31% error rate with Random Erasing is lower than 6.52% for random noise when the random-noise and erasing-pixel counts are approximately equal.Random noise error increases from 5.17% to 6.52%, while Random Erasing reduces error to 4.31%.
  • 5.1.2 Classification Evaluation: 4.31% error rate from combining Random Erasing, random flipping, and random cropping represents a 7% improvement over the baseline without augmentation.Random cropping alone achieves 6.33% and outperforms the other two individual methods.
  • 5.1.2 Classification Evaluation: Random Erasing is evaluated for robustness by testing CIFAR-10 under increasing occlusion levels using randomly selected regions filled with random values.The occlusion region’s aspect ratio is randomly chosen from [0.3, 3.33], and baseline performance drops quickly as occlusion level l increases.

5.2. Object Detection

The object-detection experiment uses Fast-RCNN with VGG16, ImageNet initialization, selective-search proposals, and the A-Fast-RCNN training procedure. Random Erasing improves detection mAP with instance-level, overall-image, and combined erasing schemes.

  • Experimental Setup: Fast-RCNN uses ImageNet-initialized VGG16, selective-search proposals, and 80K SGD iterations following A-Fast-RCNN training.The learning rate starts at 0.001 and decreases to 0.0001 after 60K iterations.
  • Experimental Setup: Random Erasing uses p = 0.5, sl = 0.02, sh = 0.2, r1 = 1, and r2 = 0.3 during detector training.
  • Detection Results: 69.1% mAP is the VOC07 trainval baseline, increasing to 70.5% with IRE and 71.0% with ORE.ORE performs slightly better than IRE.
  • Detection Results: 76.2% mAP is achieved with I+ORE, surpassing the baseline by 1.4%.I+ORE applies Random Erasing to the overall image and objects during training.

5.3. Person Re-identification

Random Erasing is evaluated across IDE, TriNet, and SVDNet person re-identification baselines on Market-1501, DukeMTMC-reID, and CUHK03. It consistently improves recognition performance and achieves competitive results with state-of-the-art methods, especially when combined with re-ranking.

  • Experimental setup: The study evaluates IDE, TriNet, and SVDNet baselines using resized 256 × 128 input images across three person re-identification datasets.IDE and SVDNet use Softmax loss, whereas TriNet uses triplet loss.
  • Experimental setup: Experiments use ResNet-18, ResNet-34, or ResNet-50 backbones with ImageNet pretraining, random cropping, horizontal flipping, and Random Erasing.Random Erasing uses p = 0.5, sl = 0.02, sh = 0.2, and r1 = 1 r2 = 0.3.
  • Baseline evaluation: SVDNet with ResNet-50 achieves rank-1 accuracy of 84.41% and 76.82% on Market-1501 and DukeMTMC-reID, respectively, exceeding TriNet by 1.81% and 4.38%.IDE with ResNet-50 achieves 83.14% and 71.99% on the same datasets.
  • Baseline evaluation: Random Erasing improves rank-1 accuracy by 3.10% for IDE and 2.67% for SVDNet on Market-1501 with ResNet-50.On DukeMTMC-reID, IDE rises from 71.99% to 74.24%, while SVDNet rises from 76.82% to 79.31%.
  • Comparison with state-of-the-art methods: Based on SVDNet or TriNet, Random Erasing reaches rank-1 accuracies of 87.08% on Market-1501, 79.31% on DukeMTMC-reID, and 58.14% or 55.50% on CUHK03.The CUHK03 results correspond to labeled and detected settings, respectively.
  • Comparison with state-of-the-art methods: With re-ranking, final rank-1 performance reaches 89.13% on Market-1501, 84.02% on DukeMTMC-reID, and 64.43% on CUHK03 under the detected setting.These results reflect the combined system rather than Random Erasing alone.

6. Conclusion

The paper concludes that Random Erasing is an easy-to-implement augmentation method effective across multiple CNN recognition tasks. Future work will extend it to image retrieval and face recognition.

  • Conclusion: Random Erasing randomly occludes an arbitrary input-image region during each training iteration.The method is presented as easy to implement for CNN training.
  • Conclusion: Experiments on CIFAR10, CIFAR100, and Fashion-MNIST with various architectures validate the method’s effectiveness.
  • Conclusion: Reasonable improvements on object detection and person re-identification demonstrate good performance across various recognition tasks.
  • Conclusion: Future work will apply Random Erasing to other CNN recognition tasks, including image retrieval and face recognition.
Loading 1708.04896v2…