# AugMix: augmentation that mixes images and checks its own consistency

> AugMix is a research code release from Google that mixes augmented images and enforces consistent embeddings of them, which improves robustness and uncertainty calibration without per-method tuning. It suits someone reproducing the ICLR 2020 result or applying the idea to a new vision task, and the pinned dependencies are old enough to be an obstacle.

**google-research/augmix** — AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty

- Repository: https://github.com/google-research/augmix
- Stars: 991 · Forks: 155
- Language: Python
- License: Apache-2.0
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/google-research-augmix

## The idea in one paragraph

AugMix is a data processing technique that mixes augmented images and enforces consistent embeddings of the augmented images, which results in increased robustness and improved uncertainty calibration. The README states the core motivation plainly: AugMix does not require tuning to work correctly, as with random cropping or CutOut, and thus enables plug-and-play data augmentation.

The reported effect is that AugMix significantly improves robustness and uncertainty measures on challenging image classification benchmarks, closing the gap between previous methods and the best possible performance by more than half in some cases. With AugMix, the authors say they obtain state-of-the-art on ImageNet-C, ImageNet-P and in uncertainty estimation when the train and test distribution do not match.

That last phrase is the one that captures the problem being solved. Robustness benchmarks like ImageNet-C and ImageNet-P measure how a model behaves when the input is corrupted or shifted away from the training distribution, and a well known symptom is that a model which is accurate on clean data can become badly miscalibrated, its confidence scores no longer meaning anything, precisely when you would want them to.

The paper is the ICLR 2020 paper, AugMix: A Simple Data Processing Method to Improve Robustness and Uncertainty, and the repository includes an animation of the method and an image of the pseudocode rather than the pseudocode as text, so the algorithm itself is read from the paper.

## What the repository actually contains

The Contents section is short and names three files, and the division between them matters if you are deciding what to use.

There is a reference implementation in NumPy of the augmentation method used in AugMix, in augment_and_mix.py. There is also augmentations.py, which holds the individual augmentation operations. Then there are PyTorch re-implementations of AugMix on both CIFAR-10 and 100 and on ImageNet, in cifar.py and imagenet.py respectively, and both support training and evaluation on CIFAR-10 and 100-C and on ImageNet-C.

The README is precise about the split between augmentation and loss. The full AugMix method also adds a Jensen-Shannon Divergence consistency loss to enforce consistent predictions between two different augmentations of the input image and the clean image itself.

So the augmentation and the training objective are separable. The mixing of augmented images is one thing, and the consistency loss that makes the mixed result meaningful is another, and the flag --no-jsd disables the loss term for faster training at the cost of slightly lower performance. That is a genuinely useful knob to know about, because a lot of people reproduce these methods and end up training for a long time without the loss term, which is a different experiment from the published one.

The rest of the tree is a models/ directory for the network definitions, a third_party/ directory, an assets/ directory with the animation and the pseudocode image, and the requirements.txt and the README.

The primary language is Python, the licence is Apache-2.0, and the last push to the master branch was on 2026-07-17. There are no GitHub releases, so there is no tagged version to pin.

## Installing, and the dependency versions that will bite you

The requirements are the first thing to look at, and they are pinned hard:

```
numpy>=1.15.0
Pillow>=6.1.0
torch==1.2.0
torchvision==0.2.2
```

Torch is an exact pin at 1.2.0 and torchvision is an exact pin at 0.2.2, while numpy and Pillow have floors rather than ceilings. The setup step is a single command:

```
pip install -r requirements.txt
```

The exact pins are the practical obstacle. Those versions of PyTorch predate the current Python releases and the current CUDA stack, so installing them today means an older Python, a CPU-only wheel, or a container built for the period. For a research codebase that is normal, and for anyone who only wants the augmentation logic it is an argument for reading augment_and_mix.py and augmentations.py and porting the few operations rather than fighting the pins.

The datasets come next, and the corruption benchmarks are the ones you need for evaluation. For CIFAR, the setup downloads both the CIFAR-10-C and CIFAR-100-C archives into a data/cifar directory:

```
mkdir -p ./data/cifar
curl -O https://zenodo.org/record/2535967/files/CIFAR-10-C.tar
curl -O https://zenodo.org/record/3555552/files/CIFAR-100-C.tar
tar -xvf CIFAR-100-C.tar -C data/cifar/
tar -xvf CIFAR-10-C.tar -C data/cifar/
```

For ImageNet-C the archive is split per corruption type, and the four types are pulled separately:

```
mkdir -p ./data/imagenet/imagenet-c
curl -O https://zenodo.org/record/2235448/files/blur.tar
curl -O https://zenodo.org/record/2235448/files/digital.tar
curl -O https://zenodo.org/record/2235448/files/noise.tar
curl -O https://zenodo.org/record/2235448/files/weather.tar
tar -xvf blur.tar -C data/imagenet/imagenet-c
tar -xvf digital.tar -C data/imagenet/imagenet-c
tar -xvf noise.tar -C data/imagenet/imagenet-c
tar -xvf weather.tar -C data/imagenet/imagenet-c
```

Getting the corruption set right matters, because ImageNet-C is what the reported robustness numbers are measured on.

## The training recipes, one per architecture

The usage section gives one command per architecture from the paper, and the flags are the whole configuration surface.

```
WRN: `python cifar.py`
```

```
AllConv: `python cifar.py -m allconv`
```

```
ResNeXt: `python cifar.py -m resnext -e 200`
```

```
DenseNet: `python cifar.py -m densenet -e 200 -wd 0.0001`
```

```
ResNet-50: `python imagenet.py <path/to/imagenet> <path/to/imagenet-c>`
```

The -m flag selects the architecture and the -e flag is the epoch count, since the defaults are clearly tuned for the smaller CIFAR runs and the paper's recipes need 200 epochs for ResNeXt and DenseNet. The -wd flag sets weight decay, and 0.0001 is the value in the DenseNet recipe, which tells you the default is different.

The ImageNet script takes two paths, the standard ImageNet root and the ImageNet-C directory you unpacked in the previous step, so evaluation against the corruption set is part of the normal run rather than a separate script.

The one flag that changes the method itself is the one already mentioned, --no-jsd, which drops the Jensen-Shannon Divergence consistency loss for faster training at the cost of slightly lower performance. The documentation is clear that the JSD term is what enforces consistent predictions between two different augmentations of the input and the clean image, so turning it off is not a pure speed optimisation, it is a different method.

There is also a note that AugMix does not require tuning to work correctly, as with random cropping or CutOut, so there are no per-augmentation hyper-parameters to set here beyond the standard ones.

## The pretrained weights, and what they let you check

Pretrained weights are provided for a ResNet-50 ImageNet classifier trained with AugMix for 180 epochs, hosted on Google Drive.

Two numbers are given for that checkpoint: a 65.3 mean Corruption Error and a 77.53 percent top-1 accuracy on clean ImageNet data. Those are the numbers you can check your own port against, which is the most useful thing about them.

mCE, the mean Corruption Error, is the metric ImageNet-C is built around, and it normalises each corruption type's error by the error of a reference model so that the average is comparable across corruption types. A model with a lower mCE holds up better on average, and because the normalisation is against a reference, the number is only meaningful when the same evaluation code is used. So the checkpoint is a test fixture as much as a starting point.

The citation is the other artefact worth noting, and it is the full BibTeX entry for the ICLR 2020 paper, with Hendrycks, Mu, Cubuk, Zoph, Gilmer and Lakshminarayanan as authors, in Proceedings of the International Conference on Learning Representations, 2020.

The project is a research release rather than a maintained library, and the README says nothing about ongoing support, so the reasonable expectation is that the code stays as it is and the pinned dependency versions stay as they are. The last push to the master branch was on 2026-07-17, which is recent enough that the repository is not abandoned, but there are no releases to look to for a newer version.

## Conclusion

Adopt AugMix as a reference implementation if you want to reproduce the published robustness and calibration numbers, because the repository contains both the original NumPy augmentation and PyTorch training code for CIFAR and ImageNet, plus pretrained weights you can test against. Do not adopt it as a drop-in augmentation library for a modern training stack, because the requirements pin torch to 1.2.0 and torchvision to 0.2.2 and the code was written against that era. Before you start, plan to either build an isolated environment for these pins or port the augmentation yourself, and remember that the JSD consistency loss is a separate training term rather than part of the data pipeline, so the two pieces can be adopted independently.

## FAQ

### What does AugMix do and why does it not need tuning?

AugMix mixes augmented images and enforces consistent embeddings of the augmented images, which improves robustness and uncertainty calibration. The README says it does not require tuning to work correctly, as with random cropping or CutOut, and so enables plug-and-play data augmentation, with state-of-the-art results reported on ImageNet-C, ImageNet-P and on uncertainty estimation when train and test distributions differ.

### What is in the AugMix repository?

A NumPy reference implementation of the augmentation in augment_and_mix.py, the individual augmentations in augmentations.py, and PyTorch re-implementations for CIFAR-10 and 100 in cifar.py and for ImageNet in imagenet.py, both supporting training and evaluation on the corruption sets. There is also a models/ directory, a third_party/ directory and the assets for the animation and pseudocode.

### How do I install AugMix and its dependencies?

Run `pip install -r requirements.txt`. The requirements pin numpy>=1.15.0, Pillow>=6.1.0, torch==1.2.0 and torchvision==0.2.2, so the exact PyTorch pins mean an older environment is usually needed to run this code as published.

### How do I train the AugMix models?

The paper's recipes are one command per architecture, such as `python cifar.py` for WRN, `python cifar.py -m allconv` for AllConv, `python cifar.py -m resnext -e 200` for ResNeXt, `python cifar.py -m densenet -e 200 -wd 0.0001` for DenseNet, and `python imagenet.py <path/to/imagenet> <path/to/imagenet-c>` for ResNet-50. Adding --no-jsd disables the Jensen-Shannon Divergence consistency loss for faster training at slightly lower performance.

## Sources

- [google-research/augmix on GitHub](https://github.com/google-research/augmix)
- [Issues](https://github.com/google-research/augmix/issues)
- [License: Apache-2.0](https://github.com/google-research/augmix/blob/master/LICENSE)
- [README](https://github.com/google-research/augmix/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/google-research-augmix
