Learning Data Augmentation Strategies for Object Detection

Barret Zoph, Ekin D. Cubuk, Golnaz Ghiasi, Tsung-Yi Lin, Jonathon Shlens, Quoc V. Le

Introduction

Data augmentation is a foundational technique in image classification, yet its application to object detection is significantly more complex. In detection tasks, transformations must be "box-aware": any geometric distortion applied to an image, such as rotation or shearing, requires a corresponding transformation of the ground-truth bounding boxes. Furthermore, detection datasets are typically smaller and more expensive to label than classification datasets, making effective augmentation critical for preventing overfitting.

Historically, researchers have relied on hand-crafted augmentation strategies, such as simple horizontal flips. This paper addresses whether an optimal augmentation policy for detection can be discovered automatically and if such learned policies outperform manual heuristics.

The authors frame the search for augmentation strategies as a discrete optimization problem, utilizing a Reinforcement Learning (RL) approach. An RNN controller is trained to predict "policies" using Proximal Policy Optimization (PPO). The reward signal for the controller is the mean Average Precision (mAP) of a "child" model trained on a 5,000-image subset of the COCO dataset.

The Search Space

The search space encompasses 22 different operations across three categories:

  1. Color operations: Distortions that affect color channels without altering box locations (e.g., Equalize, Contrast).
  2. Geometric operations: Distortions of the entire image that require updating bounding box coordinates (e.g., Rotate, Shear).
  3. Bounding box operations: A novel category where transformations are applied exclusively to the pixels within the bounding boxes (e.g., BBox_Only_Equalize).

Policy Structure

A discovered policy consists of five sub-policies. During training, one sub-policy is randomly selected for each image. Each sub-policy contains two operations applied in sequence, each defined by a specific probability and magnitude (intensity).

Visual examples of the learned sub-policies applied to a COCO image. Note the effectiveness of operations that target only the area inside the bounding boxes.

Key Insights and Ideas

  • The Power of BBox-Only Operations: A significant finding was the effectiveness of augmenting only the content within bounding boxes. This encourages the model to become invariant to local variations within objects without distorting the global context.
  • Geometric Invariance: Operations like Rotate and Shear appeared frequently in high-performing policies, suggesting that geometric invariance is more crucial for detection than previously recognized.
  • Regularization Effects: Learned augmentation increases training loss while decreasing the $L_2$ norm of model weights, indicating that the policy acts as a powerful regularizer.
  • Impact on Small Datasets: The benefits of these policies are inversely proportional to dataset size. While helpful for large datasets, they are transformative for smaller ones.
Mean average precision (mAP) vs. training examples. The learned augmentation policy (red) consistently outperforms the baseline (black), with the most significant relative gains occurring at smaller data scales.

Results and Transferability

The learned policies achieved state-of-the-art performance. Combining the policy with a high-capacity AmoebaNet + NAS-FPN architecture resulted in 50.7 mAP on COCO. On a standard RetinaNet with a ResNet-50 backbone, the policy improved mAP by +2.3, outperforming other regularization techniques like DropBlock.

Crucially, these policies demonstrate universal transferability. A policy learned on COCO was applied to PASCAL VOC without retraining and yielded a +2.7 mAP improvement. This suggests that optimal augmentation strategies capture general properties of natural images and objects that are not dataset-specific.

Conclusion

While the initial search for an optimal policy is computationally intensive (requiring 400 TPUs for 48 hours), the resulting policies can be applied to new models and datasets with no additional search cost. Future work may extend this automated approach to other complex tasks, such as semantic segmentation, where pixel-perfect masks introduce further geometric complexity.

Summary updated

BibTeX
@inproceedings{zoph2020learning,
  author = {Barret Zoph and Ekin D. Cubuk and Golnaz Ghiasi and Tsung-Yi Lin and Jonathon Shlens and Quoc V. Le},
  title = {{Learning Data Augmentation Strategies for Object Detection}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58583-9\_34},
}
Figure