# Data augmentation

> Canonical: https://skillalmanac.com/glossary/data-augmentation | Last verified: 2026-11-25 | Index status: index-eligible

Data augmentation creates extra training examples by changing existing ones, for example flipping or rotating images or replacing words in text, so a model sees more variety without new data being collected.

Also called: data augmentation deep learning, image augmentation, augmentation machine learning, dataset augmentation, training data augmentation.

## In plain language

Suppose you are teaching a child to recognise cats from a few photos. If you also show the same photos flipped, tilted and a bit darker, the child learns that a cat is still a cat from a slightly different angle. Data augmentation does this for a machine-learning model: it makes altered copies of the training examples. It helps most when there are few examples. It cannot add facts that were never in the data, and a careless change can alter the right answer, such as a flip that turns one character into another. It is usually applied to training data only.

## Technical definition

Data augmentation applies transformations to existing training samples to improve generalisation. IBM lists image techniques including geometric changes such as flips, photometric changes such as saturation or grayscale, noise injection, and text techniques including random deletion or insertion, synonym replacement and back-translation. The TensorFlow tutorial describes it as increasing the diversity of a training set through random but realistic transformations, shows Keras preprocessing layers such as RandomFlip and RandomRotation, and uses augmentation in training rather than default evaluation/prediction. That is its tutorial setup: the RandomFlip API also allows transformations when explicitly called with training=True, so inactivity is not a universal test-time rule. IBM contrasts it with synthetic data, which is entirely artificially generated.

## How it shows up when you use agents

Data augmentation belongs to model training, which most agent users do not do. Coding agents commonly call pretrained models; the inspected examples here cover data preparation rather than augmentation or training execution. It shows up when an agent helps you write a training pipeline, for example when you ask a coding agent for an image classifier and it adds random flips and rotations, or when you prepare a small text dataset for [fine-tuning](/glossary/fine-tuning).

The common failure is leakage. If augmented copies of one example end up on both sides of the split between training and test data, the test score looks better than it is. The TensorFlow tutorial applies random augmentation to training data by default. Split original examples or provenance groups before generating derived views. [split-leakage-check](/skills/skill-almanac/split-leakage-check) can inspect supplied CSV/JSONL group IDs and text signals; it cannot detect transformed images or prove the absence of leakage.

A second failure is a transformation that changes the label, such as flipping an image where left and right matter. IBM also says the best mix of techniques depends on the dataset and task, so choosing is hard. Next action: look at a sample of augmented examples by eye before training, and compare results with and without augmentation. It is one tool against [overfitting](/glossary/overfitting), alongside more real data. See also [synthetic data](/glossary/synthetic-data).

## Common confusions

- **Data augmentation versus synthetic data.** IBM says augmentation modifies existing samples, while synthetic data is entirely artificially generated.
- **Training time versus test time.** The tutorial's Keras augmentation layers are inactive during default evaluation/prediction. Explicit training=True can enable a layer such as RandomFlip outside fit; document any deliberate evaluation-time transformations and keep the evaluation protocol fixed.
- **Augmentation versus more real data.** An altered copy is not a new observation. IBM describes it as one effective means of increasing dataset size and variability.
- **Myth.** Augmentation helps every dataset. IBM says the right techniques depend on the dataset and task, and a bad transformation can mislead the model.

## Worked examples in this catalogue

### [split-leakage-check](https://skillalmanac.com/skills/skill-almanac/split-leakage-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A check of train, validation and test files for duplicates, shared groups, time and label leakage, printing JSON.

Why it exercises the concept: Keep derived copies with their original example when splitting. This CSV/JSONL checker can inspect supplied group IDs and text-copy signals, but explicitly misses image similarity and transformations. Original-image provenance needs a separate check; the skill does not perform augmentation.

### [data-analysis-eda](https://skillalmanac.com/skills/skill-almanac/data-analysis-eda)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A fixed exploratory-analysis procedure and CSV profiler that keeps findings descriptive, evidenced and caveated.

Why it exercises the concept: Deciding whether augmentation is needed starts with knowing how many examples you have and how they are spread. This is a way to profile a table first; it does not augment data.

### [mock-record-generator](https://skillalmanac.com/skills/skill-almanac/mock-record-generator)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Seeded mock records as CSV or JSON, generated from a JSON field list or a simple TypeScript interface.

Why it exercises the concept: It makes records from a field list, not by altering real ones, so it is a contrast case: closer to synthetic data than to augmentation.

### [huggingface-datasets](https://skillalmanac.com/skills/huggingface/huggingface-datasets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A way to read Hugging Face datasets through the Dataset Viewer API: metadata, rows, search and filters.

Why it exercises the concept: Public datasets are a common starting point before augmenting. This inspected reader lets you inspect rows and metadata first; it does not perform training or augmentation.

## Related terms

- [Overfitting](https://skillalmanac.com/glossary/overfitting.md)
- [Training data](https://skillalmanac.com/glossary/training-data.md)
- [Synthetic data](https://skillalmanac.com/glossary/synthetic-data.md)
- [Machine learning (ML)](https://skillalmanac.com/glossary/machine-learning.md)
- [Regularization](https://skillalmanac.com/glossary/regularization.md)
- [Transfer learning](https://skillalmanac.com/glossary/transfer-learning.md)

## Sources

- [What is data augmentation?](https://www.ibm.com/think/topics/data-augmentation), IBM (accessed 2026-11-24)
- [Data augmentation (TensorFlow tutorial)](https://www.tensorflow.org/tutorials/images/data_augmentation), TensorFlow (accessed 2026-11-24)
- [tf.keras.layers.RandomFlip: inference and training argument](https://www.tensorflow.org/api_docs/python/tf/keras/layers/RandomFlip), TensorFlow 2.21 (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
