📚 Course contents
AI & Computer Vision, lesson 10 of 52
What Makes Good Sports Data?
Introduction
From Unit 4 on you'll train AI models. A model learns only from the examples you give it, so the most important work happens before training. Today you'll learn what makes a good football dataset, measure blur and brightness with code, catch sneaky duplicate frames, and audit a dataset like a professional.
By the end of this lesson you'll be able to:
- Explain why a model is only as good as its data
- Name the main data quality problems in field sports: blur, occlusion, lighting, scale, angle and class imbalance
- Measure blur and brightness with code
- Find near-duplicate frames and explain why they cause a false sense of success
- Audit a dataset and write up 5 specific problems with evidence
- Describe what "diverse" means for a football dataset
Working principle
Garbage in, garbage out
A model learns patterns from examples. If the examples are narrow, blurry, wrongly labelled or repeated, the model learns the wrong thing. You can't fix poor data with a clever model.
Quality problems in football data
| Problem | What it looks like | Why it hurts |
|---|---|---|
| Motion blur | A sprinting player or a ball smeared into a streak | The model sees shapes that never appear when things are still |
| Occlusion | Players overlap, or the ball is hidden behind a leg | Hard to label. The model must learn partial objects. |
| Lighting | Sunny, cloudy, floodlit, backlit, shadows | Colours and edges change. A sunny-only model fails at night. |
| Scale | The ball is 5 pixels wide from the far side of the pitch | Too small to learn. Detectors struggle with tiny objects. |
| Angle | All frames from one sideline | The model fails from behind the goal or from above |
| Class imbalance | 500 players, 8 balls | The model hardly learns the rare class |
| Duplicates | 40 frames in a row of the same still scene | Test results look great, but they're fake (see below) |
| Wrong labels | A box on the wrong player, or a missed ball | The model learns the mistake |
Diversity
A good dataset covers the situations the model will meet: different angles, distances, lighting, teams and kits, pitch surfaces, weather, players (age, height, skin tone), and moments (play, set pieces, celebrations, empty pitch). If a group is missing, the model will be worse on it. This comes back in lesson 43.
The duplicate trap
Video gives you 30 almost identical frames per second. If you shuffle all the frames and split them into training and test sets, near-identical frames land in both. The model "remembers" the test frames, and the score looks perfect. This is called leakage. In lesson 13 we fix it by splitting by video, not by frame.
Measuring quality in code
- Blur score: the variance of the Laplacian. A sharp image has strong edges, so a high variance. A blurry one is low. As a rough guide, below about 80 is blurry, but check on your own images.
- Brightness: the mean of the grayscale pixels. Below about 50 is very dark. Above about 205 is washed out.
- Near-duplicates: shrink each image to 8 by 8 grayscale and compare tiny fingerprints (an "average hash"). Few differing bits means the same scene.

