---
title: "Catching the defect at the press | B&C Associates"
description: "Moulding defects were being found on the customer assembly line. A camera and a small model at the press caught them in the cycle instead, with a 1.4% false reject rate against a 2% ceiling."
language: "en"
canonical: "https://bcass.net/work/visual-inspection"
---

# Catching the defect at the press, not at the customer

_Injection moulding · 1 plant · 18 presses_

Short shots and flow lines were being found on the customer assembly line. We put a camera and a small model at the press, and the parts stopped leaving the building.

## The situation

A supplier of moulded interior trim to the automotive tier one market. Visual defects, mostly short shots, flow lines, sink marks and burn, were caught by a final visual check on a sample basis, roughly one part in fifty.

Two customer complaints in one year. Each one meant a containment action, a sorting operation at the customer site, and a quality engineer on a plane for a week. The cost of the complaints was never the scrap. It was the containment.

## What made it hard

- Cycle time runs from 22 to 48 seconds depending on the tool. The decision has to be made before the next part arrives, every time.
- No cloud. The customer contract forbids images of their parts leaving the plant, and that is not negotiable in this industry.
- Nobody on site can retrain a model, and nobody on site wants to. Whatever we built had to stay correct without an on site data scientist.
- A false reject costs a good part. A false accept costs a containment. The plant would accept scrapping good parts at up to two percent, and not a point more.

## How we built it

1. **Establish that the defect is visible** (Weeks 1 to 3)
   A fixed lighting rig and a five megapixel camera on one press. Four thousand images, labelled by the plant own quality inspectors rather than by us, because they are the ones who decide what a defect is.
   You get: A labelled image set, and the honest answer that two of the four defect classes were separable under that lighting and sink marks were not.

2. **Fix the lighting before the model** (Weeks 4 to 5)
   Sink marks became obvious under a low angle grazing light. We changed the rig and captured again. This step is where most of the accuracy came from, and it involved no machine learning at all.
   You get: A lighting specification precise enough for the plant electrician to reproduce it on the other presses.

3. **Train small, run at the edge** (Weeks 6 to 9)
   A small convolutional classifier, fine tuned on the labelled set, running in about seven milliseconds on an embedded GPU box bolted to the press. Small enough to run in the cycle, small enough to explain.
   You get: A model at 99.1% recall on the classes in scope and 1.4% false reject, both measured on a held out set the plant chose and we never saw during training.

4. **Wire it to the process** (Weeks 10 to 12)
   A rejected part goes into a locked bin with a counter, not onto the floor where it can be picked back up. The MES receives the reason code. Three consecutive rejects stop the press and call the setter, because three in a row is a process problem, not a part problem.
   You get: Live on two presses, integrated with the existing MES quarantine flow.

5. **The retraining loop** (Weeks 13 to 14)
   Every rejected part is photographed and held for the shift quality check. A weekly job scores the model against what the inspector agreed with. When agreement falls below the threshold, it emails us. It does not email them.
   You get: The loop running, and a written statement of who is responsible for what when it fires.

## What it runs on

Everything stays inside the plant. No image ever leaves the building, which was a contractual requirement before it was an architectural one.

- Five megapixel GigE Vision camera, fixed mount, hardware triggered
- Diffuse dome lighting plus a grazing bar for surface defects
- An embedded GPU module at the press, roughly 7 ms per inference
- PyTorch for training, ONNX Runtime for what actually runs on the line
- MQTT to the existing MES for reason codes and quarantine
- On premise S3 compatible object storage for the image history

## What changed

- **1 in 50 → every part** — inspection coverage on the presses in scope
- **99.1%** — recall on the defect classes in scope
- **1.4%** — false reject rate, against a 2% ceiling
- **0** — customer complaints for these defects since go live

The lighting change did more than the model did. That is the usual result and it is worth saying plainly: two of the four defect classes only became a machine vision problem after somebody moved a light.

The plant still runs its sample visual check. We did not ask them to stop, and they should not. The camera watches for four things. A human still notices the fifth.

## Have a defect you keep catching too late?

Send us photographs of the good part and the bad one. We will tell you whether this is a vision problem, a lighting problem, or a process problem, before you spend anything.

[Start a conversation](/contact)
