NelworksNelworks

ML & AI / Season 2 / EP08

Synthetic Data, Sim-to-Real Gap, and Distributional Shift

Shez

Prepare for takeoff! The 'SkyMaster AI' is ready.

Kurumi

You trained this pilot entirely in 'Unity', didn't you?

Shez

10 Million flight hours! I used **Synthetic Data Generation**.

Shez

I simulated wind, rain, snow, and even Godzilla attacks. This drone has seen everything.

Kurumi

It hasn't seen everything. It has seen a video game.

Kurumi

You trained it on your own imagination.

Shez

Data is data, Kurumi! The math is the same!

Shez

Launching in 3... 2... 1...

Shez

But... but...

Shez

In the simulation, it dodged lasers!

Kurumi

In the simulation, the air doesn't have turbulence unless you code it.

Kurumi

In the simulation, the gyroscope doesn't drift because of temperature changes.

Shez

I don't understand. The confidence score was 0.99! It *thought* it knew what to do!

Kurumi

That is exactly the problem.

Kurumi

When you flood the model with synthetic data, you create an echo chamber.

Kurumi

The model hears the same simplified message a million times. It becomes **Overconfident**.

Kurumi

It mistakes 'Repetition' for 'Truth.'

Kurumi

Look at the camera feed. See that grain? That's **Sensor Noise**.

Shez

It's just a little static.

Kurumi

Your synthetic data was perfect. Zero noise.

Kurumi

Your model learned to navigate using *perfect pixels*.

Kurumi

To the model, this 'static' looks like obstacles. It looks like the world is dissolving.

Kurumi

It panicked because it has never seen a 'dirty' pixel before.

Shez

But I added Gaussian noise to the simulation! I added blur!

Kurumi

Real noise isn't Gaussian, Shez.

Kurumi

Real noise is Poisson. It depends on the light level. It depends on the heat of the sensor.

Kurumi

This is **Distributional Shift**.

Kurumi

Your model spent 10 million hours learning Curve A.

Kurumi

It optimized its weights to be a god in Curve A.

Kurumi

When you put it in Curve B (Reality), its 'Prior Beliefs' are so strong that it ignores the new data.

Kurumi

It tries to force reality to fit the simulation.

Shez

The map says there should be a farm here! Why is there a skyscraper?!

Kurumi

You are using a map of a different world.

Shez

So synthetic data is useless?

Kurumi

No. It's useful. But you have to treat it like **Toxic Waste**.

Kurumi

It's powerful fuel. But if you don't contain it, it poisons the well.

Kurumi

You let the synthetic data overwhelm the real data.

Kurumi

We need to do two things.

Kurumi

1. **Domain Randomization**.

Shez

Make the domain... random?

Shez

What did you do?! It looks like a glitch!

Kurumi

I broke the physics. I broke the lighting.

Kurumi

If the simulator looks *nothing* like reality... the model can't overfit to the simulator.

Kurumi

By changing the textures to 'Pink' and 'Polka Dots,' we force the model to ignore color.

Kurumi

It has to learn the *shape* of the obstacle, because the color keeps changing.

Shez

You're forcing it to learn **Invariant Features**.

Kurumi

Yes. Features that are true in both the nightmare and the real world.

Kurumi

Geometry is real. Texture is a lie.

Kurumi

2. **Loss Re-Weighting**.

Shez

Weighting the real data higher?

Kurumi

Even if you only have 1 hour of real flight data, that hour is sacred.

Kurumi

Set = 100. Make the model pay 100x more penalty for failing on real data.

Shez

So the synthetic data teaches it 'how to fly generally.'

Shez

And the real data teaches it 'how to survive specifically.'

Shez

Okay. Retrained with Domain Randomization and Weighted Loss.

Shez

The confidence score dropped to 0.75.

Kurumi

Good. It's humble now.

Kurumi

A humble pilot checks the wind. An arrogant pilot crashes.

Shez

It's flying! It looks a bit shaky, but it's flying!

Kurumi

It's dealing with the noise. But it's actually *thinking* now, not just reciting a script.

Shez

Synthetic data is tricky.

Kurumi

It's a tool. Like a hammer.

Kurumi

Next time you want to use a simulator, remember:

Kurumi

Simulation is a hypothesis. Reality is the test. Never grade your own homework

Shez

Can I keep the pink sky mode though? It looks cool.

Kurumi

It will start hallucinating cotton candy.