A ML models first training run is a starting point. Reliability comes from studying where it fails.
In a frame from an amateur tennis video, the ball is often just a smear a few pixels wide. It might be almost the same color as a player's shirt and it changes speed and direction faster than anything else on court. A racket or a player's body can hide it completely and video compression can make it disappear against a textured background. Through all this, a person watching the video can still follow where it goes. A computer first has to learn how.
I ran into this problem while building an app that helps people analyze their tennis gameplay from match recordings. Before that project, my work with AI mostly involved basic prompting of language models with the occasional automation of a workflow by wiring an agent into it. But learning how to use a model is one skill. Training one for a specific task, especially one without a ready-made solution takes a deeper understanding of how these models work. That is what this project gave me, though obviously what I trained cannot be compared to a modern LLM, as both scale and architecture are fundamentally different.
The terms behind the method
To understand what I worked on, it helps to know a few terms from this branch of AI.
Computer vision is the branch of AI that turns images and video into quantifiable information a computer can act on. In the case of the tennis app, finding the ball in each frame is an object detection task, a subset of computer vision.
Supervised learning is one way to train such a model. Much like humans learn, it works by being "shown" examples where the correct answer is already marked. The model then adjusts itself until it produces those answers on its own. This training step is the most computationally expensive part of the whole process, while labeling mostly costs human time. In my case, each example was a video frame with the ball's position marked by hand. The model never receives a codified rule for what a tennis ball looks like, so everything it knows about finding one comes from these marked examples, called labels.
Human-in-the-loop training keeps a person involved after the first round of labeling. After the first training run, the model is fed new footage and predicts where the object in question is within the frame. A person then reviews these predictions and corrects its mistakes and those corrections become the labels for the next round of training.
The model attaches a confidence score to each of its predictions. That score is the model's own estimate and can be wrong and it gets used in two different ways. In active learning, the least confident predictions go to a person first. That way, human effort goes where the model is most uncertain, which maximizes the value of each new label. In pseudo-labeling, the most confident predictions are accepted as labels without detailed review. This saves time when most of them are correct, but any confident mistake goes straight into the training data, which depending on the nature of the mistake can be detrimental to the learning success.
The first training run is a diagnosis
The first model is not the product. It is the best instrument you have for finding out what kind of data is missing. Run it on new images that it has never seen and its weaknesses will show. It may find the object easily in good conditions and miss it when the object is small or partly hidden. Human-in-the-loop training turns those failures into training data. In my project, the loop looked like this:
1. Train on an initial set of labeled examples.
2. Run the model on new images.
3. Review its predictions, especially confident mistakes and uncertain calls.
4. Label more examples of the situations it failed on.
5. Retrain, then test on data held back from training.
6. Repeat
I went through this round after round, and each round went into the cases the model found hardest. That loop was most of the project
Newsletter
Stay up to date on AI.
Clear updates on what AI can do right now and how it affects your work. Every new piece lands in your inbox the day it's published. Free, and you can unsubscribe anytime.
The data decides what the model can learn
Issues in detection arise when the training footage lacks the variety the model will encounter during use. In the tennis example, if all the footage comes from one court and is captured under the same lighting conditions, from the same camera angle, the model learns to rely on those conditions. And while it may identify the ball well under those specific conditions, just moving the camera slightly or changing the lighting will cause it to struggle. To reliably recognize the ball across different recordings and situations, it needs training footage that varies in the same ways. A few difficult cases, such as a ball partly hidden, blurred, far from the camera or blending into the background, can teach it more than many additional easy and nearly identical frames. In my project, a few dozen examples of a failure case often did more than a thousand more frames of what the model already handled.
The training data also needs negative examples: things that resemble the ball but are explicitly marked as not being one. These help the model distinguish the ball from objects that look like it. Over the project, I labeled tens of thousands of frames, but some of the biggest improvements to the model came from focusing on the model's false positives: shirts, court lines and clutter it had identified as a ball. Labeling those as negative examples helped it avoid making the same mistakes again, significantly improving its perfomance.
A good score is not the same as a model that generalizes
Measuring that performance is harder than it looks. Every training run ends with a validation step that produces an overall accuracy figure, a simple figure computed from held out labelled frames stating how close the model got to the hand labelled ground truth. It’s always exciting to see that number beat the previous model generation, but that single number hides where the errors sit. To find them, you have to ask more specific questions: does the model fail at certain angles, on small objects or against busy backgrounds? The only way to find out is to test the model on recordings of exactly those scenarios that it never saw during training and checking the results for each condition separately. The confident mistakes deserve a separate look as well. Because the confidence score is only the model’s estimate, those are the errors that pseudo-labeling lets into the training data unchecked.
Go deeper
The articles argue the position. The courses build the skill.
Learning material built with practitioners, structured chapter by chapter, for readers who want to work through a topic instead of reading about it once.
The model is only one part of the system
A model rarely runs alone in a real application. In my case, physics based rules about how a ball can move filled gaps the detector could not. When the ball disappears behind a player for a few frames, its position can be estimated from the arc it was on before and after. A detection far away from that arc is most likely a false positive and can be thrown out. Those additions help fill in gaps but only work on top of a detector that is already reliable and don’t substitue for poor model performance.
Why this matters beyond tennis
This project changed how I think about AI. I stopped seeing a trained model as a finished product that either works or fails. Instead, I began to see how its performance depends on the “learning materials” I give it, and how each round of training affects its further improvement.
That view matters for companies, because many of their problems look more like my tennis ball than like a chatbot. Think of a scratch on a part coming off a production line, a damaged package in a warehouse or a weed between crop rows. Each is a narrow visual task in a specific environment. A general-purpose model rarely handles it well out of the box and running one for such a narrow task isn’t economical either. The good news is that pretrained models and labeling tools have made building a specialized model much cheaper and easier. Whether that model holds up in production then comes down to two things: how closely its training data matches what it will actually encounter, and whether there is a loop in place around it that allows it to keep improving.
This changes what deploying this flavour of AI looks like in practice. First, these models have gotetn small and efficient enough to run locally on a camera or a factory computer, so images never leave the site and there is no large cloud bill. Second, the most valuable input is domain knowledge rather than computing power. The workers who already spot defects by eye are best placed to label the hard cases, which makes them part of building the system. Third, training is a continous process and continues after launch. A new camera, a different factory hall or a change in lighting shifts what the model sees and the same loop of reviewing errors and retraining keeps it reliable.