TensorFlow 2 implementation of curated image augmentation techniques for improving regularization and accuracy of modern classifiers trained using popular CNN architectures. The data augmentation strategies were automatically searched from the data using policy optimisation methods and discrete state space search opposed to manually designed random data augmentation operations. The augmentation policies learned from the data vastly increases validation accuracy of the image classifiers.
In this repository, we provide implementation for the following research papers (both papers are authored by the Google Brain team):
- "AutoAugment: Learning Augmentation Strategies from Data" by Ekin D. Cubuk, Barret Zoph et al.
- "RandAugment: Practical automated data augmentation with a reduced search space" by Ekin D. Cubuk, Barret Zoph et al.
Some parts of this work have been accelerated with the help of Cloud TPU resources provided by the TensorFlow Research Cloud.
This project is currently a work in progress and includes the following components as of now.
- WideResNet(s)
- Wide Residual Networks (https://arxiv.org/abs/1605.07146)
- Image Ops(s)
- AutoContrast
- Invert
- Equalize
- Solarize
- Posterize
- Contrast
- Color
- Brightness
- Sharpness
- Cutout (https://arxiv.org/abs/1708.04552)
- Sample Pairing (https://arxiv.org/abs/1801.02929)
- Pre-processing using Baseline Augmentation and Standardization or Rescaling
- Image Data Augmentation
- Data augmentation using AutoAugment policies / RandAugment strategy
- Policy Augmentation (for AutoAugment)
- RandAugment
The following are the list of datasets that we're currently looking at for augmentation policy search and image classification:
- CIFAR-10, Reduced CIFAR-10
- CIFAR-100
- SVHN, Reduced SVHN
- ImageNet (ILSVRC 2012), Reduced ImageNet
The pre-requisites for this project include installation of TensorFlow v2.3 or tf-nightly package. Additional dependencies include TFDS-nightly and TFA-nightly, both of which require pre-release versions.
git clone https://github.com/tanzhenyu/image_augmentation
cd image_augmentation
pip3 install -r requirements.txt
python3 setup.py install
Post installation, the tests can be run as follows:
cd image_augmentation
pipenv install --dev --skip-lock --pre
pipenv shell pytest