A computer vision inspection line is in statistical control when its stream of pass/fail verdicts stays inside control limits and forms a random pattern. A point outside the limits, or a systematic pattern, points to an assignable cause worth investigating. Statistical process control (SPC) is how you separate common-cause from special-cause variation. You chart the defect rate instead of reacting to each rejected frame, choose a chart that suits binary data, and set run rules according to what a false line stop costs you.
How Does Statistical Process Control Work in Practice on an Inspection Line?
Every source of variation falls into one of two classes. Common causes act on the process all the time and together produce a stable, repeatable distribution. Special (assignable) causes affect only some of the output and tend to be intermittent. A control chart exists to separate the two, and running one is a continuous activity, not a one-off check. That has been the core aim of SPC since Shewhart in the 1920s.
A control chart has a centre line at the in-control mean and an upper and lower control limit (UCL, LCL), chosen so that almost every point falls between them while the process stays in control. A point outside the limits means the process is probably out of control and should be investigated. Points that stay inside the limits but form a systematic pattern also mean something is wrong.
On a CV line, we would chart the model’s own output: the fraction of parts rejected per subgroup, or the defect probability the network assigns to each part. One distinction matters here more than anywhere else. Control limits tell you whether the process is producing consistent output. Specification limits tell you whether the product will work. We treat the model’s reject threshold as closer to a specification limit. The control limits on the reject rate are a separate statement about stability, so the classifier should not be tuned to quieten the chart.
Keeping the Defect-Rate Stream in Statistical Control: Which Charts Fit
A pass/fail verdict is attributes data. Each inspected item is sorted into one of two buckets, conforming or nonconforming. The NIST/SEMATECH handbook names the standard attribute charts: p charts for the fraction defective, c charts for defect counts, and u charts for defects per unit. For a classifier that rejects whole parts, we would take the p chart as the baseline. When a detector counts several defects on one part, u is the better fit.
The p chart has known limits. Classical charts are insensitive to small, sustained shifts, their performance depends heavily on sample size, and being univariate they do not scale directly to several parallel lines or cameras. The classical charts also assume normality and independence, which discrete outcomes such as defect rates often violate. CUSUM and EWMA charts are used to improve sensitivity to small or persistent shifts. NIST’s comparison puts it plainly: the Shewhart chart is better for large shifts and the CUSUM is faster for small ones.
| Output stream | Chart to start with | Why |
|---|---|---|
| Reject fraction per subgroup (shift, batch, hour) | p chart | Standard attribute chart for fraction defective |
| Same, with large subgroups and overdispersion | Laney P’ chart | Adjusts limits for overdispersion so false alarms drop |
| Per-part pass/fail, low defect rate, small rises matter | Bernoulli CUSUM | Updates after every part and detects increases in fraction defective quickest |
| Several cameras or lines monitored as one binary process | Multiple-stream binary EWMA | Built for binomial proportions across parallel streams |
| Continuous defect probability from a CNN | One-sided EWMA on the probability | Accumulates evidence of small persistent shifts that per-part inspection misses |
For the formulas behind each chart, see our deeper treatment of control charts for CV defect detection. How these charts sit alongside Pareto and cause-and-effect analysis is covered in statistical process control tools paired with defect detection.
Which Run Rules Map Cleanly to a CV Defect-Detection Output Stream?
The Western Electric (WECO) rules add pattern-based detectors that use the zones below 3 sigma. NIST names them, together with trend rules, as rules used to determine out-of-control on classical Shewhart charts. The four rules, with the fit we would expect on a reject-rate chart:
| Rule | Fires on | Catches | Fit to a CV reject-rate chart |
|---|---|---|---|
| 1 | One point beyond ±3σ | Large, sudden shifts | Always on: a lighting failure, a lens knocked out of focus or a bad material lot |
| 2 | 2 of 3 points beyond ±2σ, same side | Shifts of about 2σ | Useful on the upper side once subgroups are big enough for the normal approximation |
| 3 | 4 of 5 points beyond ±1σ, same side | Drifts of about 1σ | Sensitive, and noisy if the data are overdispersed |
| 4 | 8 consecutive points on one side of the centre line | Slow drifts with no single point out | The best match for gradual model or process drift |
We would apply the WECO rules to a p chart only when subgroups are large enough for the normal approximation to hold. At low defect rates the p chart’s lower limit is often cut off at zero. Even so, the lower side is worth reading. A run of reject rates below the centre line can mean the process improved, but on a CV line it can equally mean the model has stopped seeing a defect class. We would treat it as a model-health signal and audit a sample by hand before celebrating.
Every rule you add raises the false-alarm rate. A Shewhart chart that signals only on points beyond 3σ gives a false alarm about once every 371 points on average. Adding the WECO rules raises that to about once every 91.75 points, according to NIST. The rules detect small drifts sooner because they accept a higher false-alarm rate. If a signal stops the line, we would weigh that trade-off by how often operators get pulled away from good production.
How Do You Avoid False-Alarm Line Stops While Still Catching Real Defect-Rate Excursions?
Begin by checking whether the p chart’s limits are trustworthy at all. Traditional P and U charts are prone to false alarms from overdispersion. In large subgroups this gets worse, because bigger subgroups give narrower limits, and limits that are too tight make an in-control process look out of control. On a CV line that inspects every part, we would expect subgroups such as one shift’s output to be large. Laney’s P’ chart allows for the fact that no process has a truly constant rate. It includes between-subgroup variation, widens the limits where overdispersion exists and narrows them where there is underdispersion. Minitab’s diagnostic compares observed with expected variation: a ratio above the 95% upper limit indicates overdispersion, and a ratio below 60% raises a concern about underdispersion.
Next, set the false-alarm budget deliberately. ARL0 is the expected number of samples before a false alarm. A value of 370 is analogous to traditional 3σ limits, and 500 represents stricter false-alarm control. In Sandia’s Bernoulli CUSUM case for an expensive, high-consequence component, false alarms were costly enough that the design called for a median run length of at least 8000 parts at the nominal defect rate. The right number comes from what a stop costs compared with what an escape costs, so it is an operations decision, not a statistical default.
Third, decide in advance what a signal does. NIST’s guidance is that the engineer looks for an assignable cause by following the out-of-control action plan (OCAP) attached to the chart. We would let the plan stop the line, divert parts to manual inspection or trigger an audit of the model, as the signal warrants. Writing it down before the first signal is what stops reflex line stops.
Finally, make sure the signal is real data. A pass/fail stream is only as good as the unit counting behind it. We would expect counting one part twice, across two cameras or several frames, to distort the defect rate and the limits. We would check that each unit is counted once through part re-identification, tracking parts across the line before any argument about run rules.
How Do SPC Control Limits Separate Genuine Model Drift from Normal Process Variation?
“Out of control” means rejecting the assumption that current data come from the same population as the data used to set the original limits. The limits therefore carry the meaning, and they are only as good as the baseline behind them.
In Phase I, you collect at least 20 to 25 subgroups under normal operation, plot them retrospectively, remove any subgroup with an assignable cause and recompute. Once the process is stable, the limits are frozen. Phase II plots each new subgroup against those frozen limits to detect drift. With fewer subgroups the estimates are noisy, the limits widen and future signals get masked. On a CV line, we would make the Phase I window cover the normal spread of lighting, shifts and material lots. Unit counting should be validated, using the same tracking of parts across the line, before the limits are frozen.
Control charts separate special causes from common ones. On their own, they do not say whether the special cause is the process or the model. A rise in the reject rate looks the same either way. For that reason we would run a second chart on the model’s inputs or confidence alongside the reject-rate chart. The MODERN framework charts a CNN’s estimated defect probability with a one-sided EWMA that builds up evidence of an upward shift and resets when the data suggest otherwise, so it catches small persistent shifts that inspecting each part alone would miss. Separately, FDA authors proposed an ML-enabled SPC framework that monitors feature representations of incoming images to detect out-of-distribution data and drift.
We would suspect the process if the reject rate shifts and the input-drift chart stays quiet. If both shift together, suspect the inputs, and so the model’s view of them, before you touch the machine.
MODERN uses an applicability test to confirm that a pretrained network separates in-control from out-of-control images in the new setting, then fits the limit with an augmented bootstrap. Its authors report that a few hundred images were enough to reach common ARL0 values. That compares with the tens of thousands of images the authors say are typically needed otherwise. We would recalculate limits after a deliberate change, such as a model release, a new product variant or a camera move. Do not recalculate just because the chart is signalling, since that resets away the drift you meant to catch.
What Are Some Statistical Process Control Examples on a Production Line Using Defect-Detection Model Results?
In Sandia’s published Bernoulli CUSUM (Crowder), mapped here onto a model’s per-part verdicts, one rejected part never triggers a signal and two within 25 parts do.
- Choose the nominal fraction defective p0 and the rate p1 you cannot accept. The chart tests continuously whether the rate has moved from p0 towards p1.
- Update after every part: Bt = max(0, Bt−1 + Xt − r), starting from B0 = 0, where r is a small constant between 0 and 1.
- Signal when Bt reaches the threshold H. H and r are chosen together to meet the false-alarm target.
- Read the behaviour. With H = 1.0 and r = 0.04, a single reject lifts the statistic to 0.96, which then falls by 0.04 for each good part. The chart signals whenever two rejects arrive within 1/r = 25 parts.
The method provides a moving window of current process performance. In Sandia’s case, the CUSUM showed a process problem at around test 1800 and was then kept for ongoing production monitoring.
A published image-based example shows an EWMA chart accumulating evidence over time. In one case, the MODERN authors used 245 of 277 in-control images to set a limit for ARL0 = 50. The process was out of control from t = 21 onward. Both MODERN and a Markov-field comparison method warned at t = 22, but the Markov-field chart gave two false signals while the process was still in control, and MODERN correctly indicated a persistent shift. Treat it as a demonstration of the mechanism.
How Does SPC Instrumentation Feed the Time-to-Detect-on-Drift Metric?
ARL1 is the expected number of samples needed to detect a sustained shift of a given size. Expected time-to-detect is therefore ARL1 multiplied by the sampling interval, and expected time between false alarms is ARL0 multiplied by the same interval. A chart design is good when ARL0 is high at the acceptable quality level and ARL1 is low at the rejectable one.
Published figures give a sense of scale. In simulations of a binary multiple-stream EWMA with ARL0 at 370, ARL1 fell to 3 to 6 samples for a moderate shift (δ = 0.20). Small shifts (δ = 0.05) took 23 to 30 samples, which the authors describe as a marked improvement on the memoryless p chart. Their recommended defaults were λ ≈ 0.2 and L ≈ 1.4 for ARL0 ≈ 370, or λ ≈ 0.15 and L ≈ 1.55 for ARL0 ≈ 500. In the FDA team’s chest X-ray simulation of 100 cases a day, a drift in out-of-distribution input from 0–1% to 3–5% was detected within two days at a low false-positive rate. Both results are simulations, one in a different domain, so the transferable lesson is the method. Run your own ARL calculation for your defect rate and sampling interval.
We see this as turning “we monitor drift” into a number that operations can hold a deployment to. We see drift detection as one of the reliability artefacts that catch production regressions before customers do, separate from the model’s accuracy. The other artefacts are covered in the reliability artefacts that keep a line-side model running. Where SPC sits in the move out of the pilot stage is covered in how CV defect-detection models survive the move from pilot to production. TechnoLynx treats SPC charts and their control limits as part of the monitoring instrumentation it specifies for line-side CV deployments, to surface drift the lab will not show, within its AI engineering for manufacturing.
How Does SPC Relate to a Six Sigma Programme, and Where Does CV-Inspection SPC Fit?
ISO 13053-1:2011 describes Six Sigma as a business improvement methodology that usually runs in five phases: define, measure, analyse, improve and control (DMAIC). The standard applies to manufacturing as well as service processes, and ISO last reviewed and confirmed it in 2022. ASQ describes the Control phase as setting up mistake-proofing, long-term measurement, reaction plans, standard operating procedures and process capability. We read a CV reject-rate chart with an OCAP attached as long-term measurement plus a reaction plan, so we place it in Control.
The less obvious fit is earlier. ASQ’s Measure phase includes identifying, validating and improving measurement systems, and establishing baseline performance with trustworthy data. We treat a defect-detection model as a measurement system. If it is not validated in Measure, every chart in Control inherits its errors. When a chart signals, the follow-up uses familiar quality tools such as Ishikawa diagrams, designed experiments and Pareto charts to find the special cause. We would not give CV inspection a separate quality framework. It needs to be accepted into the existing one as a measurement system with known behaviour, and quality control engineering for CV defect detection goes into that ownership question.
The hard part is not the chart. It is agreeing, before go-live, what a signal on the model-confidence chart obliges anyone to do when the reject-rate chart looks fine. That rule decides whether SPC makes the model legible to operations or just adds another screen.
FAQ
What Is the Difference Between Statistical Process Control and Statistical Quality Control?
ASQ defines statistical quality control (SQC) as applying its 14 statistical tools to monitor process outputs, and SPC as applying the same tools to control process inputs. The terms are often used interchangeably, but SQC includes acceptance sampling and SPC does not.
What Are Some Common Statistical Quality Control Techniques?
ASQ lists the seven basic quality tools: the cause-and-effect diagram, check sheet, control chart, histogram, Pareto chart, scatter diagram and stratification.