Concepts / Data Augmentation for AI Training

Data Augmentation for AI Training

Procedural generation means using algorithms to generate data, as opposed to generating it manually, and it is common in gaming for levels, maps, items, and characters.

  • Programming

Why Training Data Is Sometimes Missing

Training an AI model usually depends on data. Sometimes the data you need is scarce, expensive to gather, or missing the cases you care most about. A common response is to create data artificially rather than waiting to collect more of it.

The idea of creating data artificially is older than AI. Data synthesis has a long history in software testing, gaming, and robotics, and the techniques developed in those fields are the foundation for the approaches covered in this article. Before asking how the process is done for AI, it helps to understand the older methods that it builds on.

Key point

Data augmentation, as covered here, is the family of methods for generating data artificially. This article follows the three main branches of that family: rule-based, simulation-based, and AI-powered synthesis. Along the way, it also introduces procedural generation, the algorithmic idea that underlies generating data without writing each item by hand.

Making Data by Hand or by Procedure

There are two broad ways to get a set of data items. In manual generation, a person creates each item by hand. Using algorithms to generate data is called procedural generation. In procedural generation, a program produces the items according to a defined procedure, so the same procedure can produce many items without a person writing each one.

The clearest everyday illustration comes from gaming. Procedural generation is commonly used in games to create levels, maps, items, and characters on the fly. The content is produced as the game runs rather than being stored in advance. The source notes that most data generation techniques used in these industries can be applied to AI. That is the bridge: a method that builds game worlds can, in principle, help build training data.

QuestionManual generationProcedural generation
Who creates each item?A person, by handA program, following a defined procedure
Where does the work happen?In each person's effort for each itemIn the procedure, which is written once and then run
Can it scale to many items?Only as fast as people can write themThe same procedure can produce many items
Typical everyday exampleA hand-written list of sample sentencesA game creating levels, maps, items, and characters as it runs

Manual and procedural generation differ in where the creative work is done. The last row is a generated illustration built on the gaming example from the source.

Rule-Based Synthesis: Rules Come First

Rule-based data synthesis is a traditional approach that produces data from predefined rules. The rules are written before generation begins. The generator does not learn them from examples; it applies them. Each output is therefore a product of the rules, and understanding a rule-based generator means understanding its rules.

Start value 2Apply rule: add 3Produces 5Apply rule: add 3Produces 8Apply rule: add 3Produces 11Check: at most 10?11 fails the checkOutput: 2, 5, 8rule appliedrule appliedrule appliedcheckstop, keep earlier values
Given a starting value and a rule, which sequence of rule applications produces each new data point, and when does the process stop?

Because the rules are explicit, a rule-based approach makes the structure of the output easy to control. If a rule says a value must fall in a certain range, every generated value falls in that range. The same explicitness is also the limit: the generator can only produce what the rules describe. A rule-based generator's output is bounded by its rules, so its structure is predictable, but its coverage is limited to what those rules describe.

Tracing a Rule-Based Generator by Hand

The following example uses rules invented for teaching purposes; the source does not describe these specific rules. Suppose a generator has two rules. Rule one: the next value is the previous value plus 3. Rule two: a value is kept only if it is at most 10. The generator starts at 2 and produces values until a value fails rule two.

Worked example

Hand-Tracing the Generator Step by Step

Starting at 2, with the rules add 3 and keep only values at most 10, which items does the generator output?

  1. 1
    Step 1: starting value

    The generator begins at 2. This starting value is kept because it is at most 10.

  2. 2
    Step 2: apply rule one

    2 plus 3 gives 5. Rule two checks 5, which is at most 10, so 5 is kept.

  3. 3
    Step 3: apply rule one again

    5 plus 3 gives 8. Rule two checks 8, which is at most 10, so 8 is kept.

  4. 4
    Step 4: apply rule one again

    8 plus 3 gives 11. Rule two checks 11, which is greater than 10, so 11 is rejected.

  5. 5
    Step 5: stop

    Because the value failed a rule, the generation stops. Every item in the output was produced by applying the rules, and none was written by hand.

Result

The generator outputs 2, 5, 8. Nothing beyond these values is produced, because the rules define the limit of what can be generated.

Simulation-Based Synthesis: Recording a Run

Simulation-based data synthesis is the second traditional approach. Instead of writing data-producing rules directly, it generates data by running a simulation. The source describes this approach briefly as a traditional technique alongside rule-based synthesis, and it places robotics among the fields where data synthesis has a long history.

A simple way to picture the difference is this. A rule-based generator asks, for each item, what the rules allow. A simulation-based generator lets a modeled process unfold and records what it produces. The data comes out of the run of the model rather than being assembled field by field.

SimulatedenvironmentCurrent state of the modelSimulator rulesLet the process unfoldRun of the modelWhat the process producesRecorded samplesTraining datastate entersprocess runsoutput recorded
How does data flow from the simulated environment's state, through the simulator's rules, out into recorded training samples?

Placing the Three Approaches Side by Side

Traditionally, data synthesis and augmentation have followed two approaches: rule-based and simulation-based. A newer method, made possible by advanced AI models, uses AI itself to synthesize data. The diagram below places these three under the general idea of data synthesis. Read it as a family tree of methods rather than a sequence of steps.

Data synthesisCreating data artificiallyRule-basedPredefined rulesSimulation-basedRunning a simulationAI-poweredAn AI model synthesizesdataapproachapproachapproach
How do the rule-based, simulation-based, and AI-powered methods relate to one another as parts of the broader data synthesis category?
ApproachWhere the generating logic comes fromWhat produces the data
Rule-basedPredefined rules written before generation beginsApplying the rules to inputs
Simulation-basedA modeled process or simulated environmentRunning the simulation and recording what it produces
AI-poweredAn advanced AI modelThe AI model itself synthesizes the data

The key distinction is where the generating logic comes from: hand-designed rules or simulations on one side, and a learned AI model on the other. The source introduces the AI-powered method only as a preview, and it is developed in the next section.

The first two approaches rely on rules or simulations that a person designs. The third relies on an AI model to produce the data. At the conceptual level, that is the main thing to hold onto before the AI-powered method is examined in detail.

Mistakes Beginners Make With These Approaches

  • Common mistake

    Expecting a rule-based generator to produce variety beyond its rules

    What it looks like

    Using the rules add 3 and keep values at most 10, then expecting the output to include 11.

    Why it fails

    A rule-based generator's output is bounded by its rules, so coverage is limited to what the rules describe.

    Do this instead

    To get a value outside the rules, change the rules themselves and then trace the generator again.

  • Common mistake

    Assuming rules and simulations are the same thing

    Why it fails

    Rule-based synthesis applies explicit rules to each item, while simulation-based synthesis lets a modeled process unfold and records what it produces.

    Do this instead

    Ask whether the generator checks rules item by item or runs a process and records the result.

  • Common mistake

    Thinking procedural generation and manual generation differ only in speed

    Why it fails

    The difference is where the creative work happens: in each person's effort for manual generation, or in a procedure that is written once and then run.

    Do this instead

    Look at who or what defines each item and where that definition lives.

  • Common mistake

    Treating the terms data synthesis and data augmentation as interchangeable without checking the context

Practice: Changing the Rules

EASY

Using the same style of rule-based generator as before, suppose the rules are changed: the generator starts at 2, the next value is the previous value plus 4, and a value is kept only if it is at most 10. Trace the generator by hand. Which items are output?

Hints
  • Apply the add-4 rule to 2 first, then check the result against the at-most-10 rule.
  • Keep going until a value fails the check, then stop.
  • Write out each step, as in the earlier worked example, so you can explain each output by pointing to a rule.

What do you think happens?

Before reading the answer, predict the output of the add-4 generator described above.

Reveal answer
Answer:

2, 6, 10

Starting at 2, adding 4 gives 6, which is kept. Adding 4 again gives 10, which is at most 10, so it is kept. Adding 4 once more gives 14, which fails the check, so generation stops.

Key Takeaways

  • Procedural generation uses algorithms to produce data according to a defined procedure, while manual generation means a person creates each item by hand.
  • Rule-based synthesis applies predefined rules written before generation begins, so its output is predictable but bounded by what the rules describe.
  • Simulation-based synthesis runs a simulated process and records what it produces, rather than assembling each data field from rules.
  • The traditional approaches rely on rules or simulations that a person designs, while the newer AI-powered approach relies on an AI model to synthesize the data.

Related concepts

More concepts starting with D