Machine learning for quality control in manufacturing means training a model on examples of good and bad parts, or on process data from good and bad batches, so that it can flag defects or predict out-of-specification output faster and more consistently than a person looking at every item. It supplements statistical process control and gauging; it does not replace the quality system around them.
What are the three ways machine learning is used for quality?
Most factory quality projects fit one of three patterns. Choosing the right one is half the work.
1. Image classification and detection. A camera captures each part and a model decides pass or fail, or draws a box around a scratch, void or missing component. This needs labelled images of both good and defective parts. It is the most common pattern and is covered in more depth in our computer vision inspection guide.
2. Anomaly detection. When defects are rare or varied, you train only on good parts and let the model flag anything that looks different. You need far fewer defect examples, but you get more false alarms and less explanation of what is wrong.
3. Process-based prediction. Instead of looking at the part, the model uses machine settings, temperatures, pressures and material data to predict whether the output will be in specification. This is sometimes called a soft sensor. It can warn an operator before scrap is made, but it only works when the process data is stable and well recorded.

How does it compare with statistical process control?
Statistical process control (SPC) watches a measured characteristic over time and signals when the process drifts. It is cheap, well understood and auditable, and every quality engineer should be fluent in it. Its limit is that control charts look at one or a few variables at a time.
Machine learning handles inputs that charts cannot: images, sound, vibration spectra and dozens of interacting variables. In practice the two work together. SPC keeps watching the key dimensions; a model watches the surface finish or the pattern of settings that SPC cannot see. If a model's alert cannot be linked to a measurable cause, a quality engineer will rightly distrust it.
How do you measure whether a quality model is good enough?
Accuracy alone is misleading. If 1 part in 200 is defective, a model that passes everything is 99.5 percent "accurate" and useless. Measure these instead:
- Escape rate (false negatives): defective parts the model passed. This is what reaches the customer, so it usually matters most.
- False reject rate (false positives): good parts the model scrapped. This costs money and erodes operator trust.
- Precision and recall per defect type: a model may be excellent at scratches and poor at porosity.
- Performance on a held-out set from a different day and shift, not a random split of the same batch. Splitting at random from the same batch leaks information and gives results that collapse on the line.
Treat the model like any other inspection method. Check it against a reference set of known good and known defective parts at the start of each shift, record the result, and set a rule for when it must be recalibrated or taken out of service. Many sites fold this into their existing measurement system analysis and ISO 9001 controls.
What does a UK example look like?
Under the Made Smarter Innovation Technology Accelerator programme, the Somerset start-up Machine Intelligence worked with BAE Systems' Air division in the North West of England. They developed and tested a tool that uses machine learning to analyse X-ray images and find defects in the joints of metal parts, assisting human inspectors. The brief asked for something explainable that could adapt to other assemblies with limited data. BAE applied the result to an existing inspection process and is trialling it on another.
The lessons carry over to smaller sites: keep a human in the loop at first, ask for explanations rather than a bare score, and choose methods that work when you have few defect examples.
What hardware and software do you need?
You can prototype with a laptop, a decent industrial camera and open-source libraries such as OpenCV, PyTorch or TensorFlow. For line-speed inspection, models usually run on an edge device, for example an NVIDIA Jetson module or an industrial PC next to the camera, so images do not need to travel to a server. Lighting and optics decide success more than the model: a stable, repeatable image from a fixed camera position beats a clever algorithm fed variable pictures. Our article on machine vision and PLC integration shows how the pass or fail result gets back to the machine.
How do you run a first pilot?
Pick one defect that costs real money and that people already agree on. Collect a few weeks of images or process data with the inspectors' decisions recorded alongside, since those decisions become your labels. Train a first model, then run it silently in parallel with the existing inspection and compare. Review every disagreement with a quality engineer; many turn out to be label errors, which is useful news. Only when escape and false reject rates meet the target should the model take any action on the line, and even then start with a hold-for-review lane rather than automatic scrapping.
What are the common mistakes?
- Training on too few defect types and then meeting a new one in production.
- Letting the camera, lighting or fixture change without retraining or re-validating.
- Reporting results on the same data used for training.
- Hiding the model from operators instead of showing them the image and the reason for rejection.
- Ignoring maintenance: nobody owns retraining, so performance drifts silently.
How do quality engineers build these skills?
You do not need a research degree. You need to read images and data critically, run a model through Python notebooks, and judge results with the same rigour you apply to a gauge.
- Learn the practical side with the free Machine Vision and AI Quality Inspection course, which builds a defect detector, then Computer Vision with OpenCV for image basics.
- Add the process view with Lean Manufacturing, OEE and TPM and Six Sigma Green Belt training.
- Practise in the Computer Vision Engineer job simulation, where you specify, label and evaluate an inspection model for a production line, or the Quality Engineer simulation for 8D, PFMEA and SPC. These are practice, not employment.
- Browse all free AI courses and check current openings on our computer vision jobs page.
Start free
Take the free Machine Vision and AI Quality Inspection course, try the first five free days of the Computer Vision Engineer job simulation, and see what employers ask for on the computer vision jobs page. For a structured, self-paced route into industrial AI with graded projects, the EDWartens AI Module is available; check its page for the current price and syllabus first.




