How AI Defect Detection Works on a Production Line
Follow one molded part through AI defect detection: camera trigger, model output, tolerance rules, the reject signal and the weekly review after go-live.

Picture a pink polypropylene tub coming off an injection press, several parts a second, cavity after cavity. One of them has a short shot: a corner that didn’t fill. The easiest way to understand how AI defect detection works is to follow that one tub, from the moment it breaks a photo-eye to the moment someone learns something from it a week later.
The model gets most of the attention in vendor slides. On the line it’s one box in a chain that starts with a light and a trigger and ends with an air jet or a PLC bit. If any link in that chain is slow or flaky, the model’s accuracy stops mattering.
The trigger and the frame
The tub rides the takeaway conveyor into the inspection station and breaks a photo-eye. That edge tells the cameras the part is in position, and they fire under the station’s lights. On a continuous web like film there’s no part to wait for. A line-scan camera reads one line at a time, synced to the line encoder, and the image builds up as the material moves past.
For a tub, one camera looks straight down into it and angled cameras cover the walls, since a short shot can sit on a corner the top view can’t see well. Usually 2–3 2D cameras per station is enough. Round parts are handled with the rotation the line already has, or a rotation stage is added.
The lights are doing as much work as the cameras. Glossy resin throws highlights that move every time a part sits a little differently on the belt, so lighting that controls glare goes in before anyone starts arguing about sensors. The lights are usually strobed off the same trigger, which freezes the moving tub and keeps ambient light from the skylights or the next cell out of the picture.
Each frame is stamped with the trigger count and the time as it’s captured. That sounds like bookkeeping, and it is, but it’s what lets the system tell the PLC later which tub a decision belongs to.
What the station can ever catch is decided here, by the camera and lens chosen for the smallest defect and the field of view. If you’re sizing that for a purchase, the buyer’s checklist walks through the calculation.

What the model sends back
The frames travel over the local plant network to an edge GPU server near the line. Keeping inference in the building is mostly about time, and partly about keeping production images at home; the edge AI brief covers the architecture for IT.
The model doesn’t answer yes or no. For our tub it returns a class (short shot), a location (a box, or a pixel mask outlining the unfilled corner), a size and a confidence score. Every defect in the frame gets the same treatment, so the same tub might also come back with a faint flow line on one wall and a second, lower-confidence detection on the rim.
What lets this work on shiny pink plastic is where the model starts. Tristar begins from a foundation model that already understands materials. It looks past background, reflections, gradients, shadows, opacity and gloss, and focuses on the material. The sheen on the tub and the conveyor behind it aren’t things the model has to be taught to ignore.
That head start is why a new application needs about 100 samples to begin. Tristar does the labeling and training, and your quality engineers validate the edge cases, the parts your inspectors argue about at the end of the line. A new SKU later doesn’t mean starting over, because what the model learned on the first tub carries across to the next one.
Pass or fail is a quality decision
Is a short shot scrap? Almost always. Is a faint flow line? Depends which face it’s on and who the customer is. Your quality team owns that judgment, so it shouldn’t be buried inside model weights.
A thin layer of explicit rules sits on top of the model’s output:
- Per-class tolerances. Any short shot rejects; a flow line under a set length on a non-cosmetic face passes.
- Size and count limits, such as minimum defect area, number of holes or circularity of a punched feature.
- Confidence thresholds, set separately for each defect type.
- Zones. A scratch on the sealing lip is a reject, and the same scratch on the underside doesn’t matter.
Because these rules live outside the model, a quality engineer can read them, move a tolerance without retraining, and show an auditor exactly why a given tub went in the scrap bin.
Our tub’s short shot trips the first rule, so it’s a reject. Its faint flow line sits on the outside wall below the length limit, so on its own it would have passed. Both findings get logged either way, because a flow line that’s slowly getting longer shift after shift is exactly the trend a process engineer wants to see before it crosses the limit.
The signal has to beat the part
Our tub is still moving while all of this happens. The decision has to reach the reject point before the tub does, and that’s the hard engineering constraint of the whole station.
What happens next depends on the process:
- A PLC signal (Allen-Bradley is common) fires the reject gate or air jet, or tells a robot to pull the part.
- On a web, flaggers and edge markers mark the defect position so converting can cut around it.
- The operator gets a real-time alert on screen and a sound alert, and mass alerting kicks in when a defect rate spikes.
- A record goes to MES/ERP, with the defect traceable to the lot.
For the tub, kicking it off the conveyor is the obvious action. The alert is often worth more. Short shots showing up on the same cavity every few cycles point at the mold, maybe a blocked vent or a cold gate, and the operator should hear about it while the press is still running that tool. Injection molding defects AI can catch goes through what each defect type tends to say about the process.
After go-live, the model keeps learning
The model that went live has only seen the defects that existed on install day. Then the resin supplier changes, a mold comes back from maintenance slightly different, and something shows up on the tubs that nobody labeled.
Tristar handles this with active learning:
- The system flags anomalies it isn’t confident about or hasn’t seen before, and keeps the images.
- Once a week, your quality team and Tristar’s engineers go through the flagged images in a short review.
- Together you set or adjust tolerances, and new defect types are added to the model.
- The updated model goes back onto the edge server under your change control.
Between reviews, plant engineers can add an inspection point on their own with a handful of images, say a check for a missing label on the lid.
Plants usually see this pay off sooner than they expect. A Director of Engineering at a Tier-1 automotive OEM put it this way: “The implementation was much smoother than we expected. Within days we were already identifying issues we hadn’t been catching before.”
Then the next tub breaks the photo-eye, and the loop starts again.
Frequently asked questions
How many samples does AI defect detection need to get started?
Tristar starts with about 100 samples. Tristar does the labeling and training, and your quality team validates the edge cases, the borderline parts your inspectors tend to argue about.
What happens when the model sees a defect it wasn't trained on?
It flags the image as an anomaly. In the weekly review, your team decides whether it's a real defect and what the tolerance should be, and the new defect type is added to the model.
How fast does AI defect detection need to be?
Fast enough for the decision to reach the reject point before the part does. Divide the distance from camera to reject point by line speed, and that's the time available for capture, inference, the decision and the PLC signal.


