NelworksNelworks

ML & AI / Season 2 / EP09

Label Noise, Confident Learning, and Ground Truth Bias

Shez

The accuracy... it's too high.

Shez

Last time I got 99%, I leaked the future. The time before that, I overfitted to a single user.

Shez

I'm not falling for it this time. I'm not a rookie anymore.

Shez

I'm going to check the 'False Negatives.' The ones the model got 'wrong.'

Shez

Show me where you failed, you silicon brat.

Shez

...What?

Shez

THE LABELS ARE WRONG.

Shez

I paid the annotators $50,000! I outsourced this to 'Premium Labeling Corp'!

Shez

And they just clicked random buttons?!

Shez

It's all garbage! The 'Ground Truth' is a lie!

Shez

If the labels are wrong, my loss function is meaningless! I'm optimizing for hallucinations!

Shez

My data is poisoned. My career is over. I can't train a model on lies.

Kurumi

You're screaming at spreadsheets again. Is this a new debugging technique?

Shez

Kurumi, it's over. The dataset is compromised.

Shez

Look at this! It's a Banana labeled as an Apple! 10% of the data is mislabeled!

Shez

I have to throw it all away.

Kurumi

You have 100,000 images. You want to throw them away because humans are incompetent?

Shez

Garbage In, Garbage Out! That's the first rule of engineering!

Kurumi

That rule is for junior engineers.

Kurumi

Senior engineers know that **Garbage is Information**.

Kurumi

Your model predicted 'Banana' with 98% confidence. The label said 'Apple.'

Kurumi

What does that tell you about your model?

Shez

That it's wrong! According to the loss function, it made a huge error!

Kurumi

No. It tells you your model is **Smarter than the Annotator**.

Shez

Smarter?

Kurumi

Your model knows math. The teacher is drunk.

Kurumi

If the student is **Confident** (p=0.99) and the teacher disagrees... trust the student.

Shez

But... the model learned from the teacher! How can it know better?

Kurumi

Because the model saw *thousands* of examples.

Kurumi

The 'Apple' mistake was random (or lazy).

Kurumi

But the visual features of a Banana are consistent across the other 9,000 bananas.

Kurumi

The model learned the **Pattern**, not the **Individual Labels**.

Kurumi

We assume the noise is mostly random.

Kurumi

Deep Learning models fit *easy* patterns (clean data) first. They memorize the *hard* patterns (noisy labels) last.

Shez

So... the fact that my model 'failed' on these specific images...

Kurumi

Is actually the model flagging the errors for you.

Kurumi

It's screaming: 'Hey boss, this label doesn't look like the others!'

Kurumi

We are going to use the **Off-Diagonals**.

Shez

The what?

Kurumi

We estimate, for example, that the chance an Apple gets mislabeled as a Banana is about 2%. P(y=Banana | y^*=Apple) = 0.02.

Kurumi

Most of the time, labels are correct, so the diagonal cells are close to 1. But some pairs—like Cat/Dog—can have slightly higher confusion, like 1.5%.

Kurumi

If this confusion probability is high—say, above 10%—your annotators are probably systematically confused.

Kurumi

But if it's low—like 1% or 2%—and the model is very confident, then it’s likely a specific, fixable data error.

Kurumi

'import cleanlab'.

Kurumi

'cleanlab.filter.find_label_issues(labels, pred_probs)'.

Shez

It's scanning the dataset... comparing the model's confidence to the human labels.

Shez

(Laughing hysterically) They labeled a cat as a hot dog!

Kurumi

Probably a 'Not Hot Dog' app gone wrong.

Shez

They are all errors! The model found them!

Shez

My model isn't broken. It's a **Whistleblower**.

Kurumi

Now, you have a choice.

Kurumi

1. Prune the bad data (Delete the 4,000 rows).

Kurumi

2. Correct them (Human-in-the-loop review).

Shez

I'm going to prune them. I want a clean dataset.

Shez

'df_clean = df.drop(issue_indices)'

Shez

Retraining...

Shez

It dropped. It was 99.2%. Now it's 97.5%.

Kurumi

Of course it dropped.

Kurumi

Before, you were graded by a drunk teacher. Now you are being graded by reality.

Kurumi

That 1.7% drop was the 'Hallucination Gap.'

Kurumi

You were memorizing the lies. Now you are learning the truth.