Article sections
1. When is retraining really necessary?2. How should new training data be selected?3. A model version is not a single file4. What should offline evaluation examine?5. How does shadow testing work?6. How are canary deployments and A/B tests implemented in production?7. Does rollback simply mean copying the old file?8. Change approval and separation of duties9. Example update scenario10. Model update checklist11. Including the model version identifier in every decision record12. Dataset provenance and changes to labeling policy13. A threshold update is also a production change14. Equivalence after model conversion and quantization15. Ensuring that shadow testing compares the same frame16. Choosing a physical unit for a canary deployment17. Canary alarm and stop conditions18. The causality problem in A/B comparisons19. Not overlooking the technical dependencies of rollback20. How should post-release quality monitoring be planned?21. What should an example deployment manifest contain?22. What evidence should support a go/no-go decision?23. Lessons from a rollback drill24. How should the cost impact of a new model be assessed?25. Why is adapting only to recent data risky?26. Helping operators understand the version changeFrequently asked questionsDeploying a new version of a machine vision model to production involves more than copying new weights over an old file on a computer. While the new model may detect certain defects better, it may increase the false reject rate for other product types, use more GPU memory, or fail to deliver decisions within the physical rejection window. A version update is therefore a measurable engineering change.
1. When is retraining really necessary?
Many teams consider retraining as soon as model scores decline. However, the underlying problem must be identified first. If the lens is dirty, a model update may turn poor imagery into the new normal. If product tolerances have changed, training a model without updating the labeling policy may mix old and new quality decisions. If there is a data processing bug, the new model will fail again on the same faulty inputs.
The reason for retraining should be documented: a new material, a new defect class, a verified performance decline, a changed acceptance standard, or a significant error in a specific subset. A measurable objective is set for each reason. For example, it may be necessary to reduce missed scratches on parts from a new metal supplier while keeping the false reject rate for previous suppliers within the acceptance limit.
Calendar-based decisions such as 'retrain once a month' do not show whether the data has actually changed. A regular evaluation schedule is useful, but retraining should be initiated based on the evidence obtained and the available maintenance capacity. Human approval may be required at the end of each automated cycle; the risk level determines this decision.
2. How should new training data be selected?
Data collected in production is more realistic but harder to label. If products rejected by the model are inspected frequently while accepted products are not checked, the new training set becomes systematically skewed toward rejected products. This selection bias may cause the model to learn the normal production distribution incorrectly. Representative samples from the accepted stream and targeted samples from critical subsets should therefore also be selected.
Labels for new defects need expert verification. Not every image an operator marks as 'faulty' should be treated as a defect example for model training; dirt, reflections, partial visibility, and mechanical shifts may be false alarms. Label definitions should be versioned, and whether old data remains valid under the new policy should be assessed.
Independence between the training set, validation set, and final test set must be maintained. If hyperparameters were selected by examining new production images, it is not appropriate to present those images as an unbiased new test. Different frames of the same part or similar samples from the same production batch can cause leakage between splits. Group-based and time-based splitting should be used where necessary.
3. A model version is not a single file
To reproduce a production decision, the hash of the .onnx or weights file alone is not enough. Preprocessing, color channel order, input size, normalization, threshold, class dictionary, product recipe, inference runtime, driver, and camera settings also change behavior. The deployment package must therefore be a defined version encompassing all these dependencies.
Relationships between the model registry and versions are kept explicit: which training run, data snapshot, and code change produced this artifact? Systems such as MLflow Model Registry provide model versions, tags, and aliases; however, the project must separately manage the PLC, camera, and recipe configurations required for the physical line.
Critical acceptance tests should be reassessed not only when model weights change in a release, but also when preprocessing or the decision threshold changes. Verifying that the files needed to return to the previous version are accessible is an integral part of the rollback plan.
4. What should offline evaluation examine?
The new model should not be selected solely on its overall historical benchmark score. A separate performance breakdown by defect type, product batch, lighting condition, and camera is needed. In particular, the new model should not regress on subsets where the old model performs well; this check can be regarded as regression testing.
The candidate model's p95/p99 latency, memory consumption, and device compatibility are also measured. A model achieving a higher mAP may have become more resource-intensive and may fail to deliver its decision before the rejection point. If the quality threshold also needs retuning, this adjustment must follow the same independence rules.
Where possible, offline model comparisons use the same images, reference labels, and decision definitions. Directly comparing two models' percentage success rates on different test sets is misleading. If there are very few examples of critical defects, the confidence interval for the improvement may be wide; this uncertainty is included in the report.
5. How does shadow testing work?
In shadow mode, the new model receives real production data and produces predictions, but the old model remains the version controlling the physical reject decision. The candidate model's decisions and latency are logged, and differences from the old model are examined. This approach exposes the new version to the real image distribution without directly affecting production outcomes.
Shadow mode is not a substitute for actual quality labels. If the old and new models make the same decision, both may be wrong. Products on which their decisions differ can be referred for expert review; however, sampling only disagreements produces a biased estimate of overall accuracy. The candidate model must also not consume GPU resources in a way that increases the old model's latency; these effects must be measured.
Shadow results should be matched by product ID. When camera frames do not arrive on time, comparing one model's result for product A with a result for product B creates spurious differences. Both models' predictions should be generated for the same frame and the same preprocessing, with appropriate resource limits.
Model update / canary simulator
Adjust illustrative quality and latency values for the new model. This tool does not send commands to a physical PLC; it only evaluates example acceptance gates.
Example reference limits: recall ≥ 99%, false reject rate ≤ 2%, p99 ≤ 80 ms. In real projects, these thresholds are determined through risk analysis.
6. How are canary deployments and A/B tests implemented in production?
A canary deployment aims to activate the new version in a limited portion of production. In cloud services, routing 5% of traffic to the new model may be relatively easy. On a physical production line, however, two different reject commands cannot be issued for the same product, so the deployment unit must be chosen carefully: a separate station, a specific product family, a particular shift, or a controlled product group may be more appropriate.
Canary success is not measured solely by the current error rate. A sufficient number of critical defect examples may not yet have been observed. A minimum observation scope and quality approval are therefore required for the transition. If the product mix differs between the old and new models during the evaluation window, the comparison may not be fair. Where possible, paired shadow results are combined with a controlled transition plan.
A/B testing must be planned differently from customer-facing interface experiments. A less-validated model should not be applied to randomly selected products in a way that puts production quality or safety at risk. On physical lines, safe canary conditions and a rollback mechanism take precedence over the objective of statistical comparison.
7. Does rollback simply mean copying the old file?
No. Even if the old model's weights are retained, rollback may be incomplete if the new preprocessing code, class dictionary, driver, threshold, or PLC message format has changed. The rollback package must contain all mutually compatible components. Which camera and PLC parameters need to be reloaded when the system returns to the old version must be documented.
Rollback conditions must be defined in advance. For example, a missed critical defect, p99 latency exceeding the physical limit, a specified number of PLC timeouts, or incorrect product matching may justify an immediate return to the previous version. These thresholds are determined by the contract, risk, and test plan. The safety logic that determines the production line's safe state must remain independent of model deployment management.
A rollback procedure that has never been rehearsed is only text. The previous version should be restored in a test environment and during an appropriate maintenance window, followed by revalidation of decision behavior using conforming and defective reference parts. After rollback, incident records must identify which products were processed by the new and old versions.
8. Change approval and separation of duties
The model developer prepares the technical documentation demonstrating that the new version is suitable for deployment. The quality team evaluates defect-related behavior, the production team assesses line impact, the automation team reviews the PLC and reject mechanism, and IT/OT personnel assess system security. Individuals may hold multiple roles in small teams; nevertheless, the evidence supporting each decision must be clear.
The change package includes release notes, affected products, expected improvements, known limitations, a comparison table, shadow-mode results, the canary plan, alarm thresholds, and rollback steps. 'The model looks better' is not a sufficient justification for a change. Particularly if camera or lighting hardware has also changed recently, the effects must be separated and documented.
An intensified monitoring plan can be established for the first shift and first week after rollout. If nonconformity trends, operator objections, new types of false alarm, or performance metrics deviate from expectations, decisions are made according to the plan. A successful deployment ends not merely when the service restarts, but when validation under field conditions is complete.
9. Example update scenario
Suppose a surface defect system starts producing excessive false alarms on parts from a new aluminum supplier. Initial inspection finds the lighting and camera settings in good condition, but the new product's surface texture differs from the old training data. Expert-reviewed new normal samples and verified defective samples are collected. The old test set is preserved, and a separate stress test set is created for the new supplier.
If the candidate model produces fewer false alarms on the new texture while preserving critical crack detection on old parts and meeting latency limits, shadow mode can be tried. In shadow mode, the actual quality reference is verified; the model is then deployed on a limited basis within a controlled product family. The version and timestamp are recorded at each stage. If an unexpected deviation occurs, the compatible previous package is loaded.
This process is an example of decision logic; each project differs in data access, quality risk, and production architecture. The main goal is to manage change through demonstrable stages rather than a single button press.
10. Model update checklist
- Are the reason for the change and the target subset clear?
- Are product/batch/station details and label provenance recorded for the new data?
- Are the training data and final test data independent?
- Has regression testing been performed on products where the old model performs well?
- Have latency and resource usage been measured on the same device?
- Has it been demonstrated that shadow mode does not interfere with actual production decisions?
- Is the canary unit safe for the physical line?
- Are the rollback package and rollback drill ready?
- Have operators and maintenance personnel been informed of the change?
- Is initial monitoring of the new version defined?
11. Including the model version identifier in every decision record
When a production problem occurs, there must be a definitive answer to 'Which model was running?' Looking only at the deployment schedule is not enough; some stations may be using the old version while others simultaneously use the canary version. Every decision record should therefore contain the model artifact identifier, preprocessing version, active threshold or recipe, and, where possible, an execution environment identifier. This traceability becomes particularly important when comparing performance against quality labels that arrive later.
Writing the version number only in the filename may not be reliable. The content hash, packaging information, and immutable artifact identifier in the registry can be retained together. Deployment changes are kept in an event log stating when the transition occurred, at which station, and with whose approval. After rollback, reference images and records, rather than the application's own declaration, should verify that the old version is actually active.
12. Dataset provenance and changes to labeling policy
If the model regresses on new products, collecting more images alone may not be enough. How defect decisions are made may also have changed. For example, if fine scratches that were previously accepted are now considered defects under a new customer standard, mixing old and new labels into a single class creates inconsistency for training. Each dataset version should therefore retain the labeling guidelines, decision date, and reference measurement policy.
The proportion of labels produced from model suggestions versus independent expert review must also be traceable. Relabeling products on which the old model was wrong using only its own predictions may reinforce the error. Independent checks and sampling rules are fundamental to assessing the new dataset's contribution to actual performance improvement. Decisions to delete data or relabel it must also be recorded.
13. A threshold update is also a production change
Some teams try to improve production performance simply by changing the confidence threshold without training a new model. This technically easy operation may have significant quality implications. Lowering the threshold may flag more products as defective; raising it may reduce false rejects while missing critical defects. The new threshold should therefore also be treated as a versioned deployment configuration.
The threshold should be selected using a separate validation set and expected error costs, not the test set used during model training. A threshold change requires regression testing and production monitoring of the same scope afterward. The same threshold may not be valid for different product types; applying product-recipe-specific thresholds to the correct product must also be validated together with PLC/MES integration.
14. Equivalence after model conversion and quantization
When a model is converted from PyTorch to ONNX or quantized from FP32 to INT8, its predictions may change slightly. Although this difference is insignificant for most examples, it can change the reject/accept outcome for parts close to the decision threshold. A transition to a new runtime should therefore be evaluated not only in terms of milliseconds saved, but also through decision equivalence on the same image set and differences on borderline examples.
The candidate system's performance must be measured on the target hardware. A model that runs faster on a laboratory GPU is not guaranteed to deliver the same performance on an edge computer with limited fan cooling. Memory usage, p99 latency, temperature, and sustained-load testing should be included in version validation. Whether the calibration dataset used for quantization represents the new product distribution should also be examined.
15. Ensuring that shadow testing compares the same frame
When comparing outputs from two models in shadow mode, the same product ID and image content must be used. If the old system processed product A's image with 50 ms latency and the candidate system processed product B's image with 80 ms latency, the decision difference is not a real model difference. Both inferences must be matched by frame ID and timestamp. Different preprocessing steps also change how the comparison should be interpreted.
Resource usage in shadow mode must be checked separately. If the second model runs on the same GPU, it may increase the existing model's latency. In that case, the assumption that 'shadow operation has no effect on the physical decision' is false in practice. Load, memory, and latency should be measured, and a separate device or low-priority inference schedule should be used if necessary. Although shadow mode may be non-intervening in quality decisions, it may not be non-intervening in system performance.
16. Choosing a physical unit for a canary deployment
In a web application, randomly routing 5% of users to a new version may be common. On a quality inspection line, however, each product is linked to a physical reject mechanism. Sending random frames to the new model can mix up product decisions. A safer canary unit may be an independent station, a product family, or a controlled shift. The appropriate unit depends on production topology and quality risk.
Comparing different product mixes during a canary deployment also creates problems. If the new model runs only on easy products while the old model handles difficult ones, the candidate appears artificially better. Results should therefore be evaluated, where possible, using paired images, the same product type, and similar conditions. Rare critical defects may not appear at all during a short canary period; this should be reported as 'no evidence.'
17. Canary alarm and stop conditions
When the new version enters limited production, looking only at the overall false reject rate is insufficient. Events such as a missed critical defect, a product identity mismatch, a decision timeout, a lost PLC ACK, or an exceedance of the specified p99 limit may each be separate stop conditions. The alarm level, responsible person, and rollback step for each condition must be defined in advance. A stop decision should not simply wait for the dashboard to turn red.
If an automatic rollback rule is being considered, the boundaries of valid data and safe operating states must be clear. For example, a mechanism that keeps switching between the old and new versions whenever it sees three false alarms may destabilize production. Hysteresis, a minimum observation sample, and human approval may be needed. The authority boundary between critical production decisions and automatic deployment management must be maintained.
18. The causality problem in A/B comparisons
The false reject rate may have decreased after the new model was deployed, but product quality may also have improved or a new supplier may have been introduced during the same period. In this case, attributing the performance difference solely to the model change is not appropriate. Experimental design should account for differences in time, product mix, station, and operator. Paired shadow-mode predictions help control for some differences.
Where fully randomized A/B testing is not possible in a physical environment, phased implementation and suitable regression comparisons may be preferred. When interpreting results, rather than saying 'quality improved because the model was upgraded,' specify the period, products, and reference labels on which improvement was observed. This distinction makes technical decisions auditable.
19. Not overlooking the technical dependencies of rollback
Even if the model version is old, the new application may not support the old preprocessing function. If the new release changed the output classes, rolling back with the old PLC mapping may produce unexpected product decisions. A compatible runtime, configuration, threshold, class dictionary, and integration parameters must therefore be retained with the old package. If necessary, the old and new packages are tested together; the rollback procedure defines all dependencies.
Rollback is itself a production event. Records must show which product was processed with which version, how many products were routed to manual inspection during rollback, and which authorized person permitted production to resume after testing. Trying the backup package installation during a routine maintenance drill reduces the risk of unexpected dependencies emerging during an actual failure.
20. How should post-release quality monitoring be planned?
Rolling out the new model across the entire line after a successful canary does not mean the project is finished. In the first days, false alarm types specific to the new version, performance across shifts, memory/GPU load, operator corrections, and actual defect feedback should be monitored closely. The reporting frequency for these indicators and who intervenes when must be documented.
The new model's advantage should not be judged solely by the first day's aggregate percentage. Rare critical defects, in particular, appear over long periods; missing none in the first week is therefore not, on its own, sufficient evidence for high confidence. Continuous monitoring should continue for a defined period or until sufficient sample coverage is achieved, and the option to return to the previous version should be retained where needed.
21. What should an example deployment manifest contain?
A model deployment manifest should not consist only of a version name and file path. It should identify the model artifact hash, training dataset version, preprocessing and threshold parameters, target runtime, camera profile, PLC interface version, acceptance test report, and rollback package. An engineer should be able to understand from this document the system conditions under which the new version was validated.
For example, model=v2.4.1 can be accompanied by values such as recipe=A-17, preprocess=r3, threshold=0.62, runtime=ONNX-...; these are examples of format only. The actual version record should comply with the project's management system. When a production problem occurs, the manifest helps distinguish the model's effect from the effect of optical or PLC configuration.
22. What evidence should support a go/no-go decision?
The observed score improvement for a new model should not be the sole approval condition. Explicit conditions are needed, such as no unacceptable regression in specific critical defect classes, a false reject rate that does not exceed workload limits, latency within the rejection window, and expert review of shadow disagreements. At the decision meeting, each condition can be shown as a 'pass/fail/uncertain' record.
Automatically converting an uncertain condition into a 'pass' is a serious risk. For example, if no new examples of a critical defect have been observed, the test should not be presented as 'no errors.' A longer pilot, targeted reference testing, or a temporary manual inspection plan can be prepared for this condition. The go/no-go decision is the responsibility not only of the software team, but also of the relevant quality and production stakeholders.
23. Lessons from a rollback drill
During a rollback drill, the old model may run, but the system may produce an unexpected error if the old camera's image dimensions were changed in the new release. A rollback test is therefore also a dependency audit. It must verify not only that the old model loads, but also that it makes correct decisions on reference products, responds to the PLC on time, and records the required logs.
During the drill, which steps are manual and how long they take can be measured. If rollback requires a special tool available only on one engineer's computer, there is a continuity risk. A working rollback procedure must be documented so that another trained person with that responsibility can also carry it out when necessary. This requirement is one of the prerequisites for approving a new model for production.
24. How should the cost impact of a new model be assessed?
A model update may reduce the false reject rate while increasing GPU requirements. If the new runtime consumes more energy per device, requires additional edge computers because of latency, or creates another bottleneck in the manual review system, the net benefit may be smaller than expected. Evaluation should therefore not be limited to improvements in mAP or F1. Total operating cost, spare device needs, and maintenance workload should also be included in the decision.
For example, reducing the false reject rate from 3% to 2% on a line processing 100 conforming products per minute means approximately one fewer false alarm per minute. If each reinspection takes 30 seconds, this example scenario could reduce manual workload by 30 seconds per minute. However, constant production speed, verified actual false reject rates, and other error types must be checked separately. The calculation explains the business value of a model update; it does not replace an assessment of quality risk.
25. Why is adapting only to recent data risky?
When performance declines on a new material batch, training entirely on the last week's data may cause the model to forget image characteristics of older products. This is called catastrophic forgetting. Especially if rare defects are absent from the new dataset, the model may lose its ability to represent them. Training with a controlled mixture of data representing old and new conditions, together with regression testing across all product families, is therefore important.
Looking only at overall accuracy can hide this regression. Improvements on high-volume new products can mask a decline in a low-volume but critical old defect class in the average. Model evaluation should be reported by defect class, product type, and station; minimum acceptance limits should be maintained for high-risk subsets. The development team's goal is to preserve previously validated capabilities as well as adapt to new data.
26. Helping operators understand the version change
Even if the new model produces fewer false alarms, operators should be told what has changed on the decision screen. If a new defect class has been added, class names, colors, or alarm routing may have changed. Automatically accepting parts that were routed to manual inspection in the old process may require quality team approval. Training notes and the alarm glossary should be updated along with the release notes.
During a phased rollout, some stations may run the old model while others run the new one. The operator interface should clearly display the active model version. This makes it easier to investigate different alarm rates for the same product family in a shift report. If only the engineering team knows the system has been updated, incorrect interventions and comparison errors may result.
Frequently asked questions
Is a new SAT required for every model update?
The scope of revalidation should be determined by the change's impact. A change to model weights or the decision threshold may require quality and performance tests; if the PLC protocol or physical rejection behavior has changed, integration tests may also be needed.
Does shadow testing prove that the new model is better?
Not on its own. It shows decision differences on the same frames and production load; actual quality performance requires independent reference labels.
Why should a canary not be applied randomly to every product?
Physical production involves product identity, reject output, and quality risk. A controlled station-based or product-family-based rollout may be safer and easier to interpret.
Is a model registry sufficient for rollback?
It helps preserve the model version, but preprocessing, runtime, threshold, camera, and PLC configuration must also be available in their correct versions.
Sources and technical references
The sources link to official institutional and project documentation. The diagrams and calculation examples were created for this article; they are not presented as measured results from a specific facility.
Publication note: A test or example value does not replace a contract-specific acceptance specification or the facility's risk analysis. There are no code examples.