Lesson 5 of 5 · Open

Skewed data, skewed results

Why a model gets it wrong more often for some people than for others.

You dictate a message to your phone, and it gets almost every word right. With a coworker who has a strong dialect, the same app makes many more mistakes. Same phone, same software. What could be the reason?

A speech recognizer is a model that learned from examples: from recordings of spoken sentences, each with the written sentence as its label. What it can do comes from this training data. Imagine that 9 of 10 recordings came from people without a strong dialect, group A. Only one in 10 came from people with a strong dialect, group B.

The training data: group A (orange) appears nine times as often as group B (blue).

In training, the system looks for patterns. Because group A is so common, the patterns it finds mostly fit that group. How people in group B say the same words came up far less often. So the model is wrong more often for them, and they are the ones at a disadvantage.

Quick check

The app is used in a region where almost everyone speaks a strong dialect. What should you expect?

The model treats every voice the same way. What is skewed is what it learned: it gets one group right more often than the other, and not by chance, but again and again in the same direction. Such a skew is called bias.

What helps most against this is choosing the data well. Training data is called representative if it contains all the cases the model is needed for, in fitting shares. For speech recognition this means voices with and without a dialect, as often as the app will hear them.

New terms

bias
a skew that makes a model wrong more often for one group than for another, again and again
representative
describes data that contains all the cases a model is needed for, in fitting shares

A test for each group

A test shows whether a model is biased, but only if you look closely. The accuracy overall can be high and still be low for one group. That is why it is worked out for each group separately. The numbers here are made up, but this is what a test could look like.

Example

100 test sentences

In the test, group A speaks 80 sentences and group B speaks 20. None of them was in training.

  1. Group A: 76 of 80 correct, 76 over 80 = 95 over 100, which is 95%
  2. Group B: 14 of 20 correct, 14 over 20 = 70 over 100, which is 70%
  3. Overall: 76 + 14 = 90 of 100 correct, which is 90%
  4. The 90% sounds good. But for group B, 3 of 10 sentences are wrong.

This is not limited to speech. If software meant to find signs of skin cancer in photos of skin spots was trained almost only on photos of light skin, it can be wrong more often on dark skin.

Sometimes it is not that a group is rare, but that the labels are skewed. A system that presorts job applications learns from past decisions about who was invited to an interview. If one group was invited less often in the past, that old preference is in the labels, and the model copies it.

Typical mistake

Assuming that a computer is neutral and its result is therefore fair. That cannot be right: it does treat everyone the same way, but its patterns come from the training data. If that data is skewed, so are the patterns. The test above shows it: 95% for group A, 70% for group B.

What helps and what does not

More data of the same kind hardly helps. Even more recordings of group A do not change the fact that group B is rare in the data. What can help is collecting recordings of group B on purpose, so that the data becomes representative, and testing for each group before the system is put to use. This does not have to make the bias vanish completely, but it becomes visible and usually smaller.

Remember

A model takes on the skews of its training data. If a group is rare there, the model is wrong more often for it, and only a test for each group shows this.

Tasks

Three tasks complete the lesson. The order does not matter, the text above stays where it is.

Task 1 · Order

A camera at an entrance fails more often to recognize older people's faces. Put the chain in the order it happens.

Drag the rows into the right order.

  1. 1It is wrong more often for older people
  2. 2Older people are locked out more often
  3. 3Photos of older people are rare in the training data
  4. 4The model mostly learns patterns of younger faces

Task 2 · Several right

An app estimates travel times. In the countryside it is often off, in cities rarely. What can contribute to this?

Several answers are right. Pick all of them.

Task 3 · Choice

A model has 92% accuracy overall on a test. What does that tell you about a rare group?

One answer is right.

Go deeper

Three more tasks, optional. They do not count for completing the lesson.

Task 4 · Input · optional

On a test, an app recognizes 57 of 60 voices from group A and 13 of 20 from group B. What is the accuracy for group B?

Enter the result.

Accuracy for B =%

Task 5 · Fill in · optional

A model is to presort loan applications. Fill in the words.

Tap a word, it goes into the marked gap.

The model learns from old decisions: for each past application, approved or rejected is its . If one group was rejected more often in the past, the model copies that. This skew is called . A test for each can reveal it.

Task 6 · Choice · optional

A speech recognizer is often wrong for group B. What helps most?

One answer is right.

Back to the chapter