Applying Google’s AutoAugment data augmentation policies to a Fastai object detection model

In 2019, the Google Brain Team published a paper entitled, “AutoAugment: Learning Augmentation Policies from Data”, by Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. AutoAugment is an automatic method of designing custom data augmentation policies for computer vision data sets and is especially effective in training object detection models. The derived policies apply to ImageNet, COCO, MNIST, and other data sets

We have taken the ImageNet policy and developed an implementation compatible with Fastai. We use RESNET50 as the backbone, along with a basic custom SSD frontend. We deliberately chose a small ImageNet data set, 4000 training images and 1000 validation images to confirm Google’s claim that AutoAugment is especially effective with small data sets. The results are impressive and confirm all of Google’s assertions, and then some.

You can find the notebook implementing the AutoAugment data augmentation methods here:

You may find some of the code useful and instructive. If you have comments or suggestions, please let me know.


Congrats on this fantastic work!

I suspect it would be quite a bit faster (since GPU augmentation is very well supported) and easier in v2, and also v2 has better inference capabilities. If you’re interested in giving that a try, feel free to ask any questions in #fastai-users:fastai-v2 and we’d be happy to help out wherever possible.


Thank you for your kind words, Sir. I will certainly be interested in porting the AutoAugment policy to Fastai v2 and will be grateful for your support. J A Villalobos