# AutoAugment: Learning Augmentation Policies from Data

Learned augmentation policies beat hand-designed recipes

Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, Quoc V. Le · arXiv · 2018-5-24

- **Problem** Data augmentation recipes are designed by hand for each dataset, which takes expert time and transfers poorly between datasets. Automated search has been applied to architectures but rarely to augmentation.
- **Method** AutoAugment searches a space of policies, each with five sub-policies that apply two image operations with set probabilities and magnitudes. A controller RNN proposes policies and is trained with Proximal Policy Optimization on the validation accuracy of a child network.
- **Results** The learned policy reaches 83.5% top-1 accuracy on ImageNet, 0.4% above the previous record of 83.1%. On CIFAR-10 it reaches 1.5% error, which is 0.6% better than the previous state of the art.

## Why augmentation needs a search

Data augmentation enlarges a training set with transformed copies of its images, and it teaches a model which variations it should ignore, such as small translations or flips. Architectures can encode some of the same invariances directly, but augmentation is often the easier route because it does not require changing the model.

The augmentation recipes used on ImageNet still follow an approach introduced in 2012, with only small changes since then. A transformation that helps on one dataset can fail on another: horizontal flipping helps on CIFAR-10 but not on MNIST, because the two datasets have different symmetries. Manually designed recipes for MNIST, CIFAR-10 and ImageNet differ, and each needs expert knowledge and time to build.

Architecture search had already been automated with reinforcement learning and evolution, so the authors ask whether the augmentation itself can be found the same way for any target dataset. The search is run on the target dataset, and the search outcome is judged by the accuracy of a network trained with the candidate augmentation.

## Search space: sub-policies built from image operations

The search treats augmentation as a discrete choice problem over policies. A policy holds five sub-policies, and each sub-policy applies two image operations in a fixed order. Every operation carries its own probability of being applied and a magnitude, so a sub-policy is a short ordered program with two stochastic steps. For each image in a mini-batch, one sub-policy is drawn uniformly at random, so the policy acts as a stochastic procedure rather than a fixed transformation.

The operations are image functions from the PIL library, filtered to those that take an image and return an image. The set covers shearing, translation, rotation, contrast-type adjustments, Invert, Equalize, Solarize, Posterize, AutoContrast, Color, Brightness and Sharpness, and it adds Cutout and Sample Pairing, which come from prior work.

In total there are 16 operations, and the magnitude of each is discretized into 10 values with uniform spacing. Probabilities are discretized into 11 uniformly spaced values, and identity is not an explicit operation but is obtained by setting an operation's probability to 0.

As an illustration, one SVHN sub-policy applies ShearX with probability 0.9 at magnitude 7 out of 10, then applies Invert with probability 0.8. Invert takes no magnitude, and the order of the two operations matters because they are applied in the specified sequence.

## Controller, child model and reward update

A controller RNN emits the policy as a sequence of softmax decisions, and each decision is fed to the next step as an embedding. The controller is a one-layer LSTM with 100 hidden units per layer. Five sub-policies with two operations each require 30 softmax predictions, since each operation needs a type, a magnitude and a probability.

Each sampled policy is used to train a child model from scratch, which is a small Wide-ResNet-40-2 trained on reduced CIFAR-10. Reduced CIFAR-10 contains 4,000 randomly chosen training examples, a size the authors found not to change the resulting policies much, and the child is trained for 120 epochs. A validation set is held out from the training data, and the child's validation accuracy is the reward returned to the controller.

About 15,000 policies are sampled on each dataset.

The authors choose 120 epochs because each sub-policy needs enough applications before the child benefits from it, and they estimate that child models need more than 80 to 100 epochs before they can use all of the sub-policies. Training the child for fewer epochs on more data was judged less useful than longer training on fewer examples for a fixed budget.

The reward is not differentiable with respect to the policy, so the controller is updated with policy gradients. The update uses Proximal Policy Optimization with a learning rate of 0.00035 and an entropy penalty weight of 0.00001 to encourage exploration.

The architecture-search text that the controller follows also describes 2 × 5B softmax predictions for two convolutional cells and 10B predictions in total, which does not match the 30 predictions stated for the policy, so this account follows the policy count. After the search, the sub-policies of the best five policies are concatenated into one final policy with 25 sub-policies.

## CIFAR and SVHN results

The final pipeline keeps the baseline pre-processing, which standardizes the data, applies horizontal flips with 50% probability, zero-pads and random-crops, and ends with Cutout of 16x16 pixels. The learned policy is inserted after the baseline augmentation and before Cutout, and all CIFAR results are averaged over 5 runs.

On CIFAR-10 with Wide-ResNet-28-10, the error rate (%) falls from 3.9 with baseline augmentation and 3.1 with Cutout to 2.6 ± 0.1 with AutoAugment. With PyramidNet+ShakeDrop the error falls from 2.7 baseline and 2.3 with Cutout to 1.5 ± 0.1, which the paper reports as 0.6% better than the prior state of the art.

The authors also evaluate the best model on a recently proposed CIFAR-10 test set, where PyramidNet+ShakeDrop with AutoAugment reaches 4.4% error, which is 2.9% above its error on the original test set. Recht et al. report 7.0% for Shake-Shake (26 2x64d) with Cutout and 7.7% for PyramidNet+ShakeDrop on that set, which are prior results for different models and not controlled comparisons with the authors' runs.

On CIFAR-100 the same policy lowers the error of PyramidNet+ShakeDrop to 10.7 ± 0.2, against the earlier record of 12.19% from ShakeDrop regularization. On reduced CIFAR-10, trained on 4,000 labelled examples without the 46,000 unlabeled ones, Shake-Shake (26 2x96d) falls from 17.1 baseline and 13.4 with Cutout to 10.0 ± 0.2. The authors note that the gain is larger on the reduced set than on the full set, and they expect data augmentation to matter less as the training set grows.

On SVHN the policy was searched on a reduced set of 1,000 examples taken from the core training set of 73,257 examples. Shake-Shake (26 2x96d) reaches 1.0 error on the full SVHN setup, against 1.4 with baseline augmentation and 1.2 with Cutout, and the text describes this as an improvement from the 1.3% reported in prior work. On reduced SVHN, Shake-Shake (26 2x96d) reaches 5.9 error with AutoAugment, against 12.3 with baseline augmentation and 24.2 with Cutout, and Cutout is not used there because it lowers accuracy.

The authors describe the reduced-SVHN result as comparable to leading semi-supervised methods, whose error ranges from 5.42% to 3.86%.

The policy found on CIFAR-10 mostly picks colour-based operations, with Equalize, AutoContrast, Color and Brightness as the most common, while geometric operations such as ShearX and ShearY are rare and Invert is almost never used. On SVHN the most common choices are Invert, Equalize, ShearX/Y and Rotate, and the authors connect this to digit colour mattering less than the contrast with the background and to house numbers being naturally sheared.

## ImageNet results

The ImageNet policy was searched on a reduced subset of 120 classes, with a Wide-ResNet 40-2 trained for 200 epochs under cosine decay with weight decay 10−5 and learning rate 0.1. The best policies are similar to those found on CIFAR-10 and focus on colour-based operations, with Rotate as the one geometric operation used commonly.

ResNet-50 and ResNet-200 are then trained from scratch on full ImageNet for 270 epochs with batch size 4096 and learning rate 1.6, decayed by 10-fold at epochs 90, 180 and 240. The baseline uses Inception-style pre-processing, which scales pixel values to \[-1,1\], flips horizontally with 50% probability and applies random colour distortions, and the AutoAugment models keep that pre-processing and add the learned policy.

The authors find that removing the random colour distortions does not change the AutoAugment results.

ResNet-50 rises from 76.3 / 93.1 to 77.6 / 93.8, and ResNet-200 from 78.5 / 94.2 to 80.0 / 95.0, in Top-1 / Top-5 validation accuracy (%). AmoebaNet-B (6,190) rises from 82.2 / 96.0 to 82.8 / 96.2, and AmoebaNet-C (6,228) from 83.1 / 96.1 to 83.5 / 96.5.

The authors describe the AmoebaNet-C gain as notable because the policy was discovered on 5,000 images, and they expect more search compute to help further. The 83.5% / 96.5% result is reported as the new state of the art in top-1 and top-5 accuracy on this dataset without multicrop or ensembling. A better 85.4% top-1 error result from prior work exists, but it uses a large amount of weakly labelled extra data, so it is not a like-for-like comparison.

## Transfer of the ImageNet policy to fine-grained datasets

Inception v4 is trained from scratch for 1,000 epochs with cosine learning rate decay at 448x448 pixels on five FGVC-style datasets, with hyperparameters chosen on the validation set and then retrained on the combined training and validation sets. Baseline models use Inception pre-processing, and the transfer models use the policy learned on ImageNet with the same pipeline.

Test-set top-1 error falls from 6.7 to 4.6 on Oxford Flowers, from 19.4 to 13.1 on Caltech-101, from 13.5 to 11.0 on Oxford-IIIT Pets, from 9.1 to 7.3 on FGVC Aircraft and from 6.4 to 5.2 on Stanford Cars. The reductions on FGVC Aircraft and Stanford Cars are 1.8% and 1.2% in test error, which the authors present as an alternative to weight transfer, since fine-tuning ImageNet weights helps little on these datasets.

The authors note that policies learned on distributions closer to the target work best, since a CIFAR-10 policy helps SVHN only slightly compared with the SVHN-learned policy.

In the reported experiments the learned policies never reduced accuracy, even when transferred to a different dataset. Cutout on reduced SVHN is the counterexample in the paper, raising Wide-ResNet-28-10 error from 13.2 to 32.5.

## Ablations and comparison with GAN-based augmentation search

To test the effect of the number of sub-policies, the authors trained Wide-ResNet-28-10 on CIFAR-10 for 200 epochs with random subsets drawn from a pool of 500 good sub-policies, using five random draws per set size. Validation accuracy improves as more sub-policies are used, up to about 20 sub-policies.

Randomizing the probabilities and magnitudes while keeping the operations gives an average error of 3.0% with standard deviation 0.1, averaged over 20 instances. This is 0.4% worse than the original AutoAugment policy, whose error is 2.6 ± 0.1 in Table 2.

Randomizing the operations as well gives an average error of 3.1 with standard deviation 0.1, averaged over 20 runs, and the best random policy reaches 3.0 over 5 independent runs. Randomly sampled policies still lower error below the baseline of 3.9, so the probability and magnitude information learned by the search seems important, but it is not the only source of gain.

Ratner et al. use GANs to generate augmentation sequences that fool a discriminator, while the present method optimizes classification accuracy directly. Trained with the same policy as in the CIFAR experiments, ResNet-32 goes from 7.7 to 4.5 error and ResNet-56 from 6.6 to 3.6, reported as improvements of 3.2 and 3.0. The prior LSTM and MF results of Ratner et al.

are 7.7 to 6.0 and 7.7 to 5.6 on a ResNet-56, so the ResNet-56 baseline differs from the one in the AutoAugment row.

## Limitations

The ImageNet search subset is described as 6,000 samples in one place and the best policy as discovered on 5,000 images in another, and the paper gives both numbers without reconciling them.

The controller is trained with PPO partly for convenience, since augmented random search and evolutionary strategies may perform as well or slightly better. The search algorithm is one of many possible choices, and genetic programming or random search could also be used.

All transfer experiments are image classification with Inception v4 on five FGVC-style datasets, so transfer to other architectures or tasks is not tested in the reported experiments. The random-policy and sub-policy-count ablations are run on CIFAR-10 with Wide-ResNet-28-10 only.

## Paper info

- **Authors**: Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, Quoc V. Le
- **Venue**: arXiv · Preprint
- **First published**: 2018-5-24
- **Added**: 2026-11-12
- **Updated**: 2019-4-11
- **Version**: v3
- **arXiv**: 1805.09501
- **Category**: cs.CV · cs.LG · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1805.09501v3) · [PDF ↗](https://arxiv.org/pdf/1805.09501v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, Quoc V. Le (2018). AutoAugment: Learning Augmentation Policies from Data. arXiv:1805.09501v3. https://arxiv.org/abs/1805.09501v3

**BibTeX**

```
@misc{cubuk2018autoaugment,
  title = {{AutoAugment: Learning Augmentation Policies from Data}},
  author = {Ekin D. Cubuk and Barret Zoph and Dandelion Mane and Vijay Vasudevan and Quoc V. Le},
  year = {2018},
  eprint = {1805.09501},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.09501v3}
}
```

## Other paper commentary

- [CNN Features off-the-shelf: an Astounding Baseline for Recognition](https://refivu.com/en/papers/7a883e97-7894-49b3-9ad9-4cec774f4e63-cnn-features-off-the-shelf-an-astounding-baseline.md)
- [Learning without Forgetting](https://refivu.com/en/papers/3784f887-f12a-406c-9f7c-0b1573555ee3-learning-without-forgetting.md)
- [Learning Deconvolution Network for Semantic Segmentation](https://refivu.com/en/papers/9a41459e-1e6d-4d79-b532-13493bd8cf30-learning-deconvolution-network-for-semantic-segmentation.md)
- [UNet++: Redesigning Skip Connections to Exploit Multiscale Features in Image Segmentation](https://refivu.com/en/papers/5be5e543-8f10-4ce6-ae1e-1194b9773c52-unet-redesigning-skip-connections-to-exploit-multiscale.md)
- [Restormer: Efficient Transformer for High-Resolution Image Restoration](https://refivu.com/en/papers/df4b04d0-730a-42b5-952f-56ce280f457e-restormer-efficient-transformer-for-high-resolution-image.md)
- [Striving for Simplicity: The All Convolutional Net](https://refivu.com/en/papers/a95bd630-88c1-480e-8223-b0666111b3e5-striving-for-simplicity-the-all-convolutional-net.md)
- [Character-level Convolutional Networks for Text Classification](https://refivu.com/en/papers/7b769c87-9db2-455d-a744-b9548d185e67-character-level-convolutional-networks-for-text.md)
- [XNOR-Net: ImageNet Classification Using Binary Convolutional Neural Networks](https://refivu.com/en/papers/a24ab4a0-5bb0-49ce-a4e8-1e280720a977-xnor-net-imagenet-classification-using-binary-convolutional.md)
- [Variational Inference: A Review for Statisticians](https://refivu.com/en/papers/9499b5e2-6ec4-4fcc-8d8e-4709801c41a4-variational-inference-a-review-for-statisticians.md)
- [Qwen2 Technical Report](https://refivu.com/en/papers/edc7be28-5a87-45ae-afa8-a9b7e9819cd7-qwen2-technical-report.md)
- [OPT: Open Pre-trained Transformer Language Models](https://refivu.com/en/papers/dd696b35-00bf-4198-8591-a1a5b74fa7d4-opt-open-pre-trained-transformer-language-models.md)

## Terms in this paper

- [ImageNet](https://refivu.com/en/terms/5eadad128667-imagenet)
- [CIFAR-10](https://refivu.com/en/terms/19035a518d0a-cifar-10)
- [LSTM](https://refivu.com/en/terms/ba10547646d9-lstm)
- [Top-1 accuracy](https://refivu.com/en/terms/653c0b9eaa58-top-1-accuracy)
- [Data Augmentation](https://refivu.com/en/terms/cc5618231f4a-data-augmentation)
- [Generative adversarial networks](https://refivu.com/en/terms/889f2a50b737-generative-adversarial-networks)
- [SVHN](https://refivu.com/en/terms/c24d35c2e4d0-svhn)
- [proximal policy optimization](https://refivu.com/en/terms/59b59e5d0f9d-proximal-policy-optimization)
- [semi-supervised learning](https://refivu.com/en/terms/437382161673-semi-supervised-learning)
- [top-5 accuracy](https://refivu.com/en/terms/6de0752ac469-top-5-accuracy)
- [policy gradient](https://refivu.com/en/terms/abaf88e7ce4d-policy-gradient)
- [Cutout](https://refivu.com/en/terms/a97c27442439-cutout)
- [image recognition](https://refivu.com/en/terms/b92f065c611b-image-recognition)
- [Validation accuracy](https://refivu.com/en/terms/2883cfa87701-validation-accuracy)
- [search space](https://refivu.com/en/terms/d4098da0fb33-search-space)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/4b6d74c6-1851-4ea4-8417-b325823c633e-autoaugment-learning-augmentation-policies-from-data)
