Business and operations

Machine learning for quality control

In quality control, machine learning predicts which production runs will fail from process sensor readings, finds scratches, cracks and other defects in product images, and flags unusual measurements for inspection. Models trained mostly on good parts are common because defects are rare.

How machine learning is used in quality control

Predicting failures from line measurements

Each part collects tests and measurements as it moves along a production line. A classifier trained on past pass and fail outcomes ranks parts by their chance of failing, so inspection can focus on the riskiest. Failures are rare, so gradient-boosted trees with imbalance-aware metrics are common.

Real exampleBosch production line failure predictionA paper on the Bosch production line performance challenge uses test and measurement records from each assembly-line stage to train a model that predicts which parts are most likely to fail.

Finding surface defects from good examples only

Defects are rare and varied, so many visual inspection systems learn what normal parts look like and flag image regions that differ. These anomaly detection models use features from pretrained image networks and can also localise the defect.

Real examplePatchCorePatchCore fits a model using images of non-defective parts only, keeps a memory bank of normal patch features and reports detection and localisation results on the MVTec AD benchmark.

Classifying semiconductor wafer defect patterns

Wafer test results form a map of working and failing chips, and the spatial pattern of failures points to the process step or equipment at fault. Convolutional neural networks classify these maps into pattern types such as centre, edge-ring and scratch.

Real exampleEfficient CNNs for wafer bin map classificationA peer-reviewed study compares lightweight convolutional networks for classifying nine wafer defect pattern types on the open WM-811K dataset, looking at accuracy, resource use and speed.

Can you learn machine learning for quality control?

Yes. Quality and process engineers already know statistical process control and the failure modes of their product, which is a strong base. Learn Python and pandas, then classification and anomaly detection on sensor data, then image models for visual inspection.

  1. Python and pandas for process dataLoad measurement and test exports, align them by part or batch and handle the many missing values typical of line data.Learn it in Data Tools
  2. Statistics for rare eventsControl limits, base rates and confidence intervals explain why accuracy is misleading when only a small share of parts fail.Learn it in Statistics
  3. Classification and anomaly detectionTrain classifiers for pass or fail and anomaly detectors for unusual readings, judged by recall at a fixed inspection rate.Learn it in Machine Learning
  4. Computer vision for inspectionConvolutional networks and pretrained image features power defect detection and localisation on product images.Learn it in Deep Learning

Moving into machine learning for quality control

If you already work in the field

Quality engineers already know the product, the test plan and which defects matter most. Add Python, classification with imbalanced data and, for visual inspection, image models. A realistic first move is to predict failing batches from existing test data and compare the result with current sampling inspection.

If you come from data science or ML

If you come from ML, learn the production process, statistical process control and how inspection decisions are recorded. Work with quality engineers on labels, because defect definitions and acceptance limits vary between product lines.

Roles that do this workQuality engineerProcess engineerManufacturing data scientistComputer vision engineerYield engineer

Tools you will use

ToolWhat you use it for
AnomalibTrain and benchmark image anomaly-detection models for visual defect inspection.
PyODScore unusual sensor readings with dozens of outlier-detection algorithms behind one API.
scikit-learnClassify pass and fail runs from process measurements and handle imbalanced classes.
scikit-imagePreprocess inspection images with filtering, thresholding and region measurement.

Public data to practise on

  • UCI SECOM: Semiconductor process sensor readings with pass and fail labels; predict which runs fail.
  • MVTec AD: Images of industrial objects and textures with labelled defects; detect and locate anomalies. Free download via form, non-commercial licence.

Your first project

Download the UCI SECOM data, predict failing runs with a random forest, and compare it with logistic regression using recall of failures at a fixed inspection rate.

Common questions

How is machine learning different from statistical process control?

Statistical process control monitors one or a few measurements against control limits. Machine learning can combine hundreds of measurements or whole images to predict a failure or spot an anomaly. They work well together, with SPC remaining the standard monitoring tool.

How many defect images are needed for visual inspection?

Supervised defect classifiers need labelled examples of each defect type. Anomaly detection methods can start from images of good parts only, which helps when defects are rare, though some defect images are still needed to test the system.

What data is used for quality prediction?

Process sensor readings, in-line test results, machine settings, material batches and final pass or fail outcomes, linked by part or batch ID. Linking these sources correctly is often most of the work.

Courses for these skills

New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.