# The Effectiveness of Data Augmentation in Image Classification using Deep Learning

Learned augmentation networks can stretch small image datasets further than fixed transforms

Luis Perez, Jason Wang · arXiv · 2017-12-13

- **Problem** Classifiers trained on small curated image sets fit their training images closely and generalize poorly to new images. Collecting more labelled data is often restricted, as with medical patient data.
- **Method** Neural augmentation uses a small Augmentation Network, trained jointly with the classifier, to transform pairs of same-class images instead of applying fixed transforms.
- **Results** On dogs versus goldfish, neural augmentation reached 0.915 validation accuracy, against 0.855 with no augmentation.

## Why small curated image sets need augmentation

Specialized image classification tasks often run short of labelled data, and medical work is a common case because access to patient data is restricted for privacy reasons. A classifier trained on a small set fits its training images closely and generalizes poorly to validation and test images, which is the overfitting problem that augmentation targets.

Augmentation enlarges the training set by transforming images the model already has, so no new data collection is needed.

The study asks whether a small, curated set can be stretched further by augmentation rather than by collecting a much larger unstructured corpus. It compares three routes: fixed affine transformations, style transfer produced by GANs, and a learned augmentation network that is trained together with the classifier. Each route is judged by validation accuracy on two-class subsets of tiny-imagenet-200 and on a 0-versus-8 MNIST task.

## Fixed augmentations: affine transforms and GAN styling

Traditional transformations pair each training image with one duplicate produced by an affine transformation, such as a shift, zoom, rotation, flip, distortion or hue shading. All of these operations are affine maps of the form y = Wx + b applied to the original image. Both the original and the duplicate are fed into the network, so a dataset of size N becomes a dataset of size 2N.

The GAN route assigns each input image one style from six options: Cezanne, Enhance, Monet, Ukiyoe, Van Gogh and Winter. The styled image is produced with CycleGAN, which is also the network that moves dataset images to fixed targets such as day or night and winter or summer. As with the affine route, the original and the styled image are both used for training, which again doubles the data.

## Neural augmentation: a learned pairing network

Neural augmentation replaces the fixed transform with a small convolutional network, the Augmentation Network, that receives two images from the same class. The two images are concatenated along the channel axis into a six-channel input, or a two-channel input for gray-scale data. The network outputs a three-channel image with the same height and width as the input images.

During training, a batch of original images goes through SmallNet, and randomly sampled same-class pairs go through the Augmentation Network, whose output is also passed into SmallNet. The loss is back-propagated into both networks, so the augmenting layers and the classification layers are updated together.

Any two same-class images can form a pair, so a dataset of size N yields N squared pairs, which the authors describe as a magnitude increase. The design rests on the idea that paired images from a small dataset can produce new images that improve training.

## Augmentation losses and the combined objective

Training combines a classification loss, L\_c, and an augmentation loss, L\_a, into the weighted sum \\\\(\\\\alpha L\_c + \\\\beta L\_a\\\\). Setting \\\\(\\\\beta = 0\\\\) removes the augmentation loss, so the augmentation layers are trained only through the classification loss. The classification loss is a multi-class cross entropy applied to the sigmoids of the SmallNet scores.

The content loss compares the augmented image A with a target image T of the same size, with D the side length of the images. As printed, it is \\\\(L\_{\\\\text{content}\_a} = \\\\frac{1}{D^2}\\\\sum\_{i,j}(A\_{ij}-T\_{ij})\\\\), and the text calls it a mean squared error. The style loss applies the same kind of comparison to gram matrices, defined as \\\\(G\_{ij} = \\\\sum\_k F\_{ik}F\_{jk}\\\\), with C the number of channels.

In the paper the gram matrix is taken on the raw images, and the style loss is written as \\\\(L\_{\\\\text{style}\_a} = \\\\frac{1}{C^2}\\\\sum\_{i,j}(G^A\_{ij}-G^T\_{ij})\\\\).

The third arm computes no augmentation loss, so the augmenting layers learn only from the classification loss. The authors also suggest that the augmentation loss acts as a regularizer that keeps the augmented images close to the training data.

## Datasets and training setup

The three tasks are dogs against cats and dogs against goldfish, both drawn from tiny-imagenet-200, and 0 against 8 from MNIST. For the tiny-imagenet subsets, 400 images per class go to training and the remaining 100 per class to validation, following an 80:20 split. The goldfish class replaces cats in the second task because goldfish look very different from dogs, while cats resemble dogs closely.

The MNIST subset has 1000 images per class.

Every run trains for 40 epochs with Adam optimization at a learning rate of 0.0001. SmallNet has three convolution layers with batch normalization and max pooling, followed by two fully connected layers, the second of which outputs the two class scores. The Augmentation Network has four 16-channel convolution layers followed by a final 3-channel convolution layer.

Each table reports one accuracy per setting, the best validation accuracy over the 40 epochs.

## Dogs versus goldfish accuracy

Neural augmentation without an augmentation loss reached 0.915 validation accuracy, against 0.855 with no augmentation. Neural augmentation with content loss reached 0.900 and with style loss 0.890. Traditional transformations reached 0.890 and GANs reached 0.865, both above the no-augmentation baseline.

In the control arm, the same two images are fed into the Augmentation Network, which is meant to approximate a larger network trained on a single image without pairing. The control reached 0.840, below the 0.855 baseline. The authors read this as evidence that extra layers alone do not reduce overfitting on a small dataset, and they suggest that a larger net with a different learning rate might explain it.

The discussion ranks neural augmentation second on this task at 77.0% against 70.5%, while Table I gives 0.915 against 0.855 for the same comparison. The percentage pair in the text does not match the table, so the table values are used here.

## Dogs versus cats accuracy

On dogs versus cats, neural augmentation without loss reached 0.765 and with content loss 0.770, against 0.705 with no augmentation. Traditional transformations reached 0.775, the highest value in Table II, GANs reached 0.720, and neural augmentation with style loss reached 0.740.

The control arm reached 0.710 against 0.705 without augmentation, so on this task it is not below the baseline. The statement that only the control does worse than no augmentation holds on dogs versus goldfish, where the control reached 0.840, but not on dogs versus cats.

The discussion states that neural augmentation performs best on dogs versus cats with 91.5% against 85.5%. Table II gives 0.765 for neural augmentation without loss and 0.705 with no augmentation for the same pair, so the text's values do not match the table.

## MNIST 0-versus-8 results

Without augmentation the 0-versus-8 task reached 0.972 validation accuracy. Neural augmentation without loss reached 0.975, and with content loss 0.968. Only the content loss was tried on this gray-scale data, because the gram matrix does not produce a meaningful quantity for gray-scale images.

The authors conclude that neural augmentation has no effect on MNIST. They hypothesize that a simple CNN already performs well on MNIST, that the digits are simple enough that combining them adds little information, and that the digit variations leave few new images for the network to see.

## What the augmented images look like

For goldfish, the augmented images are mostly combinations of the two source images, with the golden bodies of the fish merged while the background grass is smoothed out. For dogs, the augmented image takes on the characteristics of one source while keeping only the contours of the other dog, such as the nose and legs.

Some augmented dog images show no clear dog shape and consist only of contours of ears and legs. The images that help most appear regularized, with faded color and background noise reduced. Orange backgrounds from the source images are picked up, and the dog ears are colored greenish against the orange background.

## Loss curves and training accuracy

The content loss decreased from about 1.6 to a range of 1.3 to 1.5 after 30 epochs and never converged, while the style loss hovered around 0.5. The authors argue that minimizing these losses fully would amount to an oracle that recreates any dog from any pair of dog images, which convolutional layers alone are unlikely to achieve.

For most of the first 20 epochs, training accuracy with augmentation is slightly lower than without it. The authors read this as a sign that learned augmentation helps the classifier generalize. A comparison of the losses across arms is not made, since the arms use different loss functions.

## Limitations

Every augmentation arm uses SmallNet, and the authors list a VGG16 classifier as future work to test whether augmentation still helps a deeper network. Only the two tiny-imagenet subsets and the 0-versus-8 MNIST task were tested.

Each setting has one reported value, the best validation accuracy over 40 epochs at a learning rate of 0.0001, and no variation across runs is shown. One passage calls the reported score test accuracy and another calls it validation accuracy.

The authors report that the GAN and neural augmentation methods took almost three times the compute time of traditional augmentation. Traditional transformations reached nearly the same accuracy at a smaller time cost, according to the authors. Combining traditional transformations with neural augmentation was not tested, although the authors suggest it could help.

## Paper info

- **Authors**: Luis Perez, Jason Wang
- **Venue**: arXiv · Preprint
- **First published**: 2017-12-13
- **Added**: 2026-11-12
- **Updated**: 2017-12-13
- **Version**: v1
- **arXiv**: 1712.04621
- **Category**: cs.CV
- **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/1712.04621v1) · [PDF ↗](https://arxiv.org/pdf/1712.04621v1)

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

Luis Perez, Jason Wang (2017). The Effectiveness of Data Augmentation in Image Classification using Deep Learning. arXiv:1712.04621v1. https://arxiv.org/abs/1712.04621v1

**BibTeX**

```
@misc{perez2017effectiveness,
  title = {{The Effectiveness of Data Augmentation in Image Classification using Deep Learning}},
  author = {Luis Perez and Jason Wang},
  year = {2017},
  eprint = {1712.04621},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.04621v1}
}
```

## Related papers

- [Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift](https://refivu.com/en/papers/bd3e1105-da91-407a-8b28-4217cd2afedf-batch-normalization-accelerating-deep-network-training-by.md)
- [MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications](https://refivu.com/en/papers/a2a0cf15-7ef8-4a03-b85e-0062c7082283-mobilenets-efficient-convolutional-neural-networks-for.md)
- [A Neural Algorithm of Artistic Style](https://refivu.com/en/papers/7a83cd1c-7f82-4bea-8cb3-b9282fec51d7-a-neural-algorithm-of-artistic-style.md)
- [Generative Adversarial Network in Medical Imaging: A Review](https://refivu.com/en/papers/52fe40f2-c64e-4c29-a115-6564288d69f5-generative-adversarial-network-in-medical-imaging-a-review.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)
- [A Survey on Deep Learning in Medical Image Analysis](https://refivu.com/en/papers/4d173b56-9ea6-4644-98f2-af1794e63965-a-survey-on-deep-learning-in-medical-image.md)

## Other paper commentary

- [Holistically-Nested Edge Detection](https://refivu.com/en/papers/4e4005ad-53a4-40bd-8c81-abf1f3ea35bf-holistically-nested-edge-detection.md)
- [Multi-View 3D Object Detection Network for Autonomous Driving](https://refivu.com/en/papers/f58134ec-87c8-446c-9cb7-11f607b68051-multi-view-3d-object-detection-network-for-autonomous.md)
- [Return of the Devil in the Details: Delving Deep into Convolutional Nets](https://refivu.com/en/papers/799263cd-4207-4a10-a587-306f8a7610b7-return-of-the-devil-in-the-details-delving.md)
- [Depth Map Prediction from a Single Image using a Multi-Scale Deep Network](https://refivu.com/en/papers/c95f6db5-ef02-41ca-945a-e4e0afa1fb1c-depth-map-prediction-from-a-single-image-using.md)
- [KPConv: Flexible and Deformable Convolution for Point Clouds](https://refivu.com/en/papers/aadc9ee6-ee0e-485d-ae5a-841bc5fcdfb3-kpconv-flexible-and-deformable-convolution-for-point-clouds.md)
- [RandAugment: Practical automated data augmentation with a reduced search space](https://refivu.com/en/papers/8b56147c-5b9a-4e55-85b2-0f0992053956-randaugment-practical-automated-data-augmentation-with-a.md)
- [Selective Kernel Networks](https://refivu.com/en/papers/958e4edd-4fd5-43a9-a954-172b1f630ca0-selective-kernel-networks.md)
- [Using Information Content to Evaluate Semantic Similarity in a Taxonomy](https://refivu.com/en/papers/23ad22de-7daf-406d-8e06-0f53f8035655-using-information-content-to-evaluate-semantic-similarity-in.md)
- [OpenAI o1 System Card](https://refivu.com/en/papers/86efdb99-0408-42d7-9138-ff8f4765106f-openai-o1-system-card.md)
- [NetVLAD: CNN architecture for weakly supervised place recognition](https://refivu.com/en/papers/2bcdc73b-8d7c-43d5-bbd7-bdc18c43eeaa-netvlad-cnn-architecture-for-weakly-supervised-place.md)
- [HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units](https://refivu.com/en/papers/4fe3f455-0287-4182-b603-63ebb7e4b5fc-hubert-self-supervised-speech-representation-learning-by.md)

## Terms in this paper

- [MNIST](https://refivu.com/en/terms/28b9bb66d1c6-mnist)
- [Data Augmentation](https://refivu.com/en/terms/cc5618231f4a-data-augmentation)
- [Generative adversarial networks](https://refivu.com/en/terms/889f2a50b737-generative-adversarial-networks)
- [Image classification](https://refivu.com/en/terms/e15c43f3bb32-image-classification)
- [CycleGAN](https://refivu.com/en/terms/aa174ef15835-cyclegan)
- [Content loss](https://refivu.com/en/terms/a9d3f062c834-content-loss)
- [style loss](https://refivu.com/en/terms/162c474955cc-style-loss)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/dce0e6e2-408a-4750-8e27-0acf7a41b5e6-the-effectiveness-of-data-augmentation-in-image)
