Scaling CV Defect Detection from Pilot Cell to Every Line

Why a defect detection model loses accuracy on new lines, and how to port it: characterise the gap, adapt before retraining, scope re-validation, monitor…

Scaling CV Defect Detection from Pilot Cell to Every Line
Written by TechnoLynx Published on 12 Jun 2026

A defect detection model that scored well in the pilot cell usually loses accuracy on a new line because the imaging conditions changed, not because the model is wrong. Ambient light leakage, lamp ageing, part pose variation, new supplier material and camera drift all push production images away from the training data. Scaling the model across a factory is mostly a variance-management problem. You characterise each line’s gap from the pilot, adapt the existing model before you think about retraining, re-validate only what changed, connect the decision to the PLC and MES with the PLC owning timing, and monitor for drift with a rollback path ready.

The accuracy loss has been measured on public benchmarks. The MVTec AD 2 benchmark (2025) includes test scenarios with lighting conditions absent from training, and the best published anomaly detection methods it evaluates stay below 60% average AU-PRO. On the original MVTec AD, by contrast, image AUROC is above 99%. The RobustAD benchmark exists for the same reason: it has controlled distribution shifts across several dimensions, and an “Average Relative Drop” metric for the loss against the training domain. The full set of causes is covered in why CV defect-detection pilots fail on the production line.

Reusing the Pilot’s Defect Detection Model on Lines with Different Cameras and Lighting

You do not need to rebuild the pilot model for every camera rig. Pre-training on a source domain and then fine-tuning on a small amount of target-domain data is a model-based transfer learning strategy. Domain adaptation, which aligns features between source and target domains, is a feature-based kind of transfer learning.

TechnoLynx handles that port line by line. TechnoLynx measures the domain gap between the pilot cell and each new rig, uses that evidence to choose between input normalisation, threshold recalibration and fine-tuning, builds the adaptation pipeline on the line’s own inference hardware, and tests each adapted model against that line’s qualification criteria before it goes live.

The options form an ordered ladder, and the cheapest step that passes qualification wins. Retraining from scratch is the fallback, not the default: pilot accuracy does not transfer unchanged, but the first fixes to try need few or no new labels.

Normalisation first. The AdaBN work hypothesises that a network’s domain knowledge is represented by its batch-normalisation statistics. If you re-estimate those statistics on target-domain images, the model can adapt without changing its learned weights. The same study found that domain shift affects both shallow and deep layers, so adjusting only the output layer is not enough. A study of camera-specific domain adaptation adds that annotating data for every camera setup is infeasible.

Vendor adaptation tools and small-sample fine-tuning next. Cognex’s VisionPro Deep Learning documentation describes an adaptation mode that adapts a trained tool to a small number of new images containing the variation. Cognex presents it as faster than retraining on a mix of old and new images. Li et al. (2024) trained a detector on magnetic-tile data from three factories plus a small labelled sample from a fourth. The domains differed mainly in brightness, contrast, texture and background. That is close to the pilot-to-line situation. They also found that unfiltered source data can hurt transfer, so more pilot data is not automatically better. For PCB defects, an LG CNS study (Journal of Imaging, 2025) benchmarked parameter-efficient fine-tuning methods that update typically under 2% of a foundation model’s parameters, with as few as 5, 10 or 20 labelled samples per class.

Test-time adaptation, which updates the model online during inference without offline retraining, is a further option. It needs care: a 2024 study of test-time adaptation for surface-defect detection found that, without filtering of noisy samples, incorrect pseudo-labels can accumulate until the adapted model is worse than the unadapted one.

Threshold recalibration sits alongside every rung, because the threshold decides how many defects escape and how many good parts are falsely rejected. One rule matters most here: never loosen a threshold to fix false rejects without understanding the underlying cause. Repeated adjustments across shifts are how the validated settings get lost.

Adaptation Ladder for a New Line

Rung When it fits What it needs from the new line Move on when
Input normalisation / BN-statistic re-estimation Global brightness or contrast shift Images from the line, standardised by their own domain statistics Accuracy stays below the pilot after normalisation
Threshold recalibration Scores shifted but good and bad parts still separate A labelled good/bad sample sized by a confidence-reliability plan The false-positive rate at the required recall is still unacceptable
Fine-tuning, adaptation mode or PEFT A gap remains after normalisation A small labelled per-line sample Qualification still fails
Full retraining Data changed drastically, or every lower rung failed qualification A representative dataset for the new conditions Not applicable: this is the fallback

Two caveats apply all the way down. Adaptation still needs a small sample of new images from the line, and TechnoLynx tests every adapted model against that line’s qualification criteria before deployment. For the detection mechanics themselves, see how image processing object detection works on a production inspection line.

You can estimate which lines will be hardest to port before committing engineering time. We would rank them by how far their cameras, lighting and sensors sit from the pilot cell (described in shared terms such as those of the EMVA 1288 camera characterisation standard). TechnoLynx can run that characterisation and quick test under an AI Porting & Deployment Pack and order the rollout by predicted effort. Treat the ranking as a guide: hardware deltas miss defect-mix differences, and a small sample can misjudge how varied full production is.

Making the Model Tolerate the Camera Fleet You Already Own

A phased, line-by-line rollout can fit a fixed procurement cycle if the pipeline is engineered to cope with the existing mix of cameras rather than waiting for identical hardware everywhere.

TechnoLynx scopes this as Computer Vision R&D. TechnoLynx inventories the camera and lighting variance across lines, agrees an acceptable performance envelope per line, builds the calibration and normalisation pipeline, fine-tunes on representative multi-camera data, and sequences line cutovers to your procurement calendar with a rollback plan for each line.

Robustness to mixed hardware starts with data collected across that hardware. Logic Unit’s guidance is to collect across camera positions or sites, lighting and environmental changes, shifts, line speeds and machine states, rather than letting convenient examples dominate the dataset. Okafor’s field notes point out that a hard stop or vacuum nest removes part-pose variation once and permanently, so the model does not spend capacity learning nuisance variation.

Is standardising cameras and lighting cheaper than adapting the software? None of the sources we hold compares the two costs directly, so this is judgement. We would standardise when the budget allows it in the current cycle, when there are many lines, or when rigs differ so much that each port becomes a fresh project. Otherwise we would invest in software robustness and keep the option to standardise in a later cycle. There is a limit, though. Extreme differences in resolution, sensor type or optics can exceed what software adaptation can compensate for. A phased rollout also means running two operating configurations side by side until the last line is cut over.

How Long Should the Trial on a New Line Run Before Its False-Reject Rate Can Be Trusted?

There is no fixed trial length. The number of parts comes from a confidence-reliability sampling plan for the rate you need to demonstrate. Taylor Enterprises’ statistical procedures for medical-device validation frame such plans as statements like “95% confidence the process is more than 99% conforming”, and note that a 90%/95% plan is equivalent to LTPD 0.1 = 5%. The same source recommends against an acceptance criterion for false rejections inside that plan. If you need one, it requires a separate sampling plan.

The arithmetic shows why the plan has to be computed rather than guessed. For a zero-failure plan, n = ln(1 − C) / ln(R). At 95% confidence and 99% reliability that is ln(0.05) / ln(0.99) ≈ 298, so about 299 consecutive correct results. On the false-accept side the plan needs defective parts to test, and well-run lines produce very few defects. Our judgement is to seed the trial with known-bad parts.

To document the vibration and lighting differences between the bench rig and the production station, record them as process variables. The GHTF SG3 process validation guidance lists vibration and light among the controllable causes of variation, depending on the process. AMD Machines’ maintenance schedule recommends verifying light intensity against a baseline every week. One integrator, MMSIS, calls lighting drift the most common reason accuracy drops, so it deserves its own baseline.

A hardware-in-the-loop soak on the real station is worth running before you freeze the thresholds. The practical form is a shadow run: iFactory describes running the model in parallel with existing inspection, logging results without triggering PLC rejects, while the quality team checks them against ground truth. We found no vision-specific source for soak duration. Our judgement is that the soak should span every shift, a changeover and a cleaning or maintenance cycle at minimum. A single batch can still miss seasonal or shift-based variability, and the sample size depends on a baseline reject rate you only estimate before the test starts.

Freezing the threshold is a business decision as much as a statistical one. One practitioner’s field notes report that overkill above 20% is not unusual for rule-based AOI under real production conditions. On a line making 500,000 parts a month, that sends 100,000 parts to manual re-verification. Those notes also show that a model at 99.6% image AUROC can still reject 8% of good parts once recall is pushed to 99.9%. Because the cost of a false reject depends on how fast a plant can replace scrapped parts, the same threshold can be correct in one plant and close to negligent in another. The threshold belongs to the plant, not to the model vendor. How that decision sits within control limits and cost-set thresholds is covered in where CV fits in QC engineering and in statistical process control for CV inspection.

What Re-Validation Does Each New Station Need, and When Can the Pilot Protocol Be Reused?

Each new station needs re-validation scoped to what differs from the validated pilot configuration, not a re-run of the pilot study. The GHTF SG3 guidance says changes in equipment should be evaluated to determine how much revalidation is needed. It names transferring a process from one facility to another as a revalidation trigger. It also states that revalidation need not be as extensive as the original. A new piece of equipment means repeating installation qualification, while most operational qualification still holds and some performance qualification may need repeating.

TechnoLynx builds that scoped evidence as part of a Production AI Monitoring Harness. TechnoLynx catalogues each station’s camera, lighting and vibration differences from the pilot baseline, defines and runs a per-station re-evaluation against the pilot’s acceptance criteria, re-applies runtime lockdown on the station’s edge GPU, and documents the results for your quality system’s sign-off.

What to Repeat for Each Kind of Change

What changed at the station Evidence to produce
Nothing material: same camera, lighting and vibration profile Reuse the pilot protocol; revalidation need not repeat every original element
New camera, lens or edge hardware Repeat installation qualification, plus the performance-qualification elements the new equipment affects
Different lighting or vibration envelope Scoped re-evaluation of accuracy and throughput under that station’s worst-case conditions
Product, label or packaging change Full algorithm re-training and re-validation on representative samples across all defect categories
Line-speed change that alters pixel resolution Re-validation of dimension-dependent algorithms

Test on data held out from training by production boundaries. Logic Unit warns that randomly splitting near-identical frames from one run gives misleading results, and recommends testing on later periods, batches or lines held out from training. Whether a station counts as a “new configuration” is decided by your own change-control policy, not a universal rule. Scoped checks can also miss interactions that only appear at full combined line speed, and runtime lockdown has to be re-verified after every software or model update, not only at first qualification. They can inform the choice, but they say nothing about how your inspection model behaves on it.

Is a New Failure at Line Speed an Optics Fix or a Retraining Problem?

Test for vibration blur and lighting shift with a staged, instrumented run at target speed before rollout. When a new failure mode appears, compare image quality against the pilot baseline. If the images have degraded, fix the optics. If the images match the pilot and the errors persist, the model has a generalisation gap.

TechnoLynx sets this up under the Production AI Monitoring Harness. TechnoLynx instruments the inference pipeline to log blur, exposure and contrast next to every decision, replays the pilot’s defect and no-defect parts at full line speed, and keeps tracking both after rollout so residual drift stays visible.

The physics is simple enough to check on paper. Motion blur grows with part speed and exposure time. Blur in pixels equals part speed × exposure time ÷ the object-space size of one pixel, so the exposure you can afford follows from the blur you can tolerate. Vision-Doctor notes that blur of 0.5 to 2 pixels is invisible to the eye but still degrades measurement accuracy, and that typical industrial exposures run from 0.1 to 20 ms. Vibration adds blur at longer exposures and, over time, can loosen lens lock rings and shift focus.

Triage then follows this order:

  1. Capture the failing images and step through the inspection on them, as FSI recommends for any false-reject investigation.
  2. Compare their sharpness, exposure and contrast with the pilot-era images.
  3. If image quality has measurably dropped, adjust exposure, strobe, lighting or mounting first, since a defect that does not modulate light into the sensor cannot be recovered by any model.
  4. If image quality matches the pilot but errors persist, retrain with targeted coverage of newly collected line-speed images.
  5. Redeploy with version control and regression checks, fixing the smallest lever that addresses the cause, as Tensorleap frames it.

The split is not always clean. Blur that pushes borderline confidence over the threshold is a mixed cause and may need both fixes. A staged rig does not fully reproduce the combined vibration and lighting interaction on the real line, so some risk remains until a limited production trial has run. Generic model benchmarks do not cover your defects or your optics.

The PCB pilot-to-line example walks through these steps on one printed-circuit inspection workload. For label and packaging lines, choosing a printing inspection system covers how CV catches print defects on the production line.

Wiring the Reject Decision into the PLC and MES

For Siemens Opcenter, Siemens documents an architecture in which edge AI inference results such as defect classifications and anomaly events flow through Connect MOM into Opcenter and arrive as non-conformances or quality holds. The physical reject goes separately to the PLC, as a tag write over OPC UA, Modbus TCP or EtherNet/IP, or over native S7 communication on Industrial Edge. TechnoLynx builds the inference-to-PLC and inference-to-MES interfaces and tunes inference latency to the line’s budget on the target hardware.

Who Owns the Trigger, the Reject and the Latency Budget on a Fast Line?

The vision system decides what happened, and the PLC decides how the machine responds. The PLC keeps ownership of timing, interlocks and the physical reject. The vision side reports a decision such as reject_required, and the PLC fires the actuator once the right part reaches the reject station, tracked by timer, shift register, encoder position or product identifier. Object tracking for line-side inspection covers how each reject stays tied to exactly one part.

TechnoLynx handles the trigger integration within an AI Porting & Deployment Pack. TechnoLynx captures line speed, part spacing, PLC I/O and actuator response time, designs the trigger, strobe and exposure synchronisation, integrates the PLC trigger with the GPU inference unit, and measures end-to-end detection-to-actuator latency at full line speed against the budget.

The latency budget is not something the vision team picks. iFactory describes it as whatever remains of the takt window after mechanical, transport and control times are subtracted. Their example: at 200 parts per minute, the whole window from capture to a pass or reject signal reaching the PLC is roughly 300 ms (60,000 ms ÷ 200), and inference is only one slice of it. The other slices are camera exposure, image transfer, PLC scan time, actuator response and a safety margin. At 600 bottles a minute, ten bottles pass each second, so the camera must trigger and expose within a 100 ms pitch. The decision deadline is set by the travel time from camera to actuator. Budget against the 95th and 99th percentile latency, not the average, because a single late decision lets a defect through. iFactory puts a cloud round trip at 200 ms to 2 s of variable latency, which is why reject decisions are made at the edge. The wider cost and latency comparison of edge versus centralised placement is outside this page’s scope.

On responsibility, we would give the PLC trigger logic to whoever owns the PLC program and the camera and inference integration to the vision side, with a joint interface spec both sign. Three safety rules go in that spec. A missing image is never a pass, and a heartbeat lets the PLC reject unverified parts or stop the line. The model gets no unrestricted control-system access. When the model or connectivity is unavailable, the process reverts to an approved inspection mode. Expect the timing to need re-checking: trigger timing drifts when conveyor speed changes or PLC scan time changes after program edits. Actuator response time is part of that same budget.

Monitoring Drift and Keeping a Rollback Path on Every Line

Once the model is live, labels are seldom available in time, so you monitor proxies. Klaise et al. (2020) recommend monitoring the statistics of input data and output predictions as a proxy for performance when live labels are unavailable. Ultralytics’ documentation names the Kolmogorov-Smirnov test and the Population Stability Index for comparing new data with the training distribution. Monitoring should be sliced by site, device, lighting and product type, so one line’s drift is not averaged away by the others.

Watch both error directions, because they surface very differently. Rising false rejects are noticed within a shift because the bin fills up. Rising escapes are reported by the customer months later. Physical degradation can also look like model degradation, so lens, lighting and fixture maintenance belongs in the same plan.

Production AI reliability is a discipline separate from model accuracy. The deliverables are drift detection, regression suites and release gates that catch a regression before the customer does, not a dashboard. On a line, that means treating every model update as a controlled production change, with version, dataset, evaluation, approval and rollback preserved. A consequence-based rollback rule is a good default. If drift undermines a high-consequence output, escalate to review or roll back. If it is low-impact and explainable, document it and schedule a controlled recalibration. The detail lives in how to monitor model drift on a production CV inspection line and how to design a rollback strategy for a production CV inspection model. For the on-call and escalation path, see who owns the model in production.

Keeping Track of Which Model Version Runs on Which Line

Fleet tooling exists, and it is worth adopting before the third line goes live. Siemens describes Industrial Edge Management as a single place to deploy apps, push updates and manage AI models across sites, without on-site intervention. iFactory describes PLC changeover signals triggering model reloads on the edge device that typically complete in under two seconds. Outside the Siemens ecosystem, AWS SageMaker’s shadow tests follow the same principle: route a copy of live requests to a candidate variant and return only the production variant’s responses.

Whatever the tooling, the record we would insist on is one row per line and station, holding the model version, training-data version, threshold, camera and lighting configuration, and the validation evidence that approved them. Without that row, “which version is running where” becomes an investigation during an incident instead of a lookup.

Who Can Port Our Pilot Inspection Model to the Rest of the Factory?

TechnoLynx ports a working pilot defect-detection model to the rest of the factory’s lines. TechnoLynx characterises each line’s gap, adapts the model before retraining. When choosing a partner, ask how they would measure the domain gap and what evidence they would hand to your quality system. TechnoLynx scopes the work as an AI Porting & Deployment Pack, part of its AI engineering for manufacturing.

This engagement does not suit everyone. It assumes a pilot that already works. If feasibility is still open, when industrial computer vision inspection actually works comes first. Teams on a single vendor platform can use that vendor’s own adaptation tools, such as Cognex’s adaptation mode, which Cognex presents as faster than retraining. Machine vision system integrators are the natural route for optics, enclosures and PLC panel work. We would rather say at the outset which lines look risky and why than discover it at cutover.

What a Hardened Rollout Still Cannot Promise

None of the steps above makes a model regression impossible. Drift is normal factory physics: lighting angles shift after maintenance, lenses haze, fixtures wear and suppliers change surface finish. The aim is to see a change quickly and know what to roll back to, which is a different promise from zero stoppages, as what deployment does not guarantee spells out. The question left for each plant is how much residual risk each line can carry at the threshold its own economics justify.