Some original image labels are retained; figure captions and explanations are provided in English.

PART IX - ENGINEERING DECISIONS

Why Do Machine Vision Projects Fail? 12 Field Scenarios and Root Cause Analysis

Twelve illustrative scenarios examine failures such as disputed defect definitions, unstable optics, data leakage, PLC decisions applied to the wrong product and unowned maintenance. Each separates symptoms from root causes through diagnostic tests and distinguishes immediate containment from lasting correction. A 30-day recovery framework, incident records and regression tests turn the analysis into a follow-up plan.

Article sections1. Defining failure in operational terms2. Case 1 - Teams do not share the same definition of a defect3. Case 2 - The optical setup does not show the defect consistently4. Case 3 - The camera is not fixed in place, and the measurement system drifts5. Case 4 - Data leakage creates a false impression of success6. Case 5 - The success metric is disconnected from production needs7. Case 6 - The camera captures the right image, but the PLC rejects the wrong product8. Case 7 - Latency measured on a single test device does not hold up in the field9. Case 8 - Knowledge needed for maintenance remains with one person10. Case 9 - A new product recipe silently disrupts the system11. Case 10 - The false-positive workload brings the shift to a halt12. Case 11 - A model update performs well in testing but is risky in the field13. Case 12 - The project is technically complete, but ownership is unclear14. How is root cause analysis performed?15. How should the interactive diagnostic tool be interpreted?16. Separate the initial intervention from the permanent correction to choose the right action17. A 30-day framework for rescuing a project18. A systemic lesson: invisible dependencies surrounding the model19. What should we measure after a failure?20. Error logs determine the quality of diagnosis21. Narrowing the fault tree through hypotheses22. A test that distinguishes data drift from sensor failure23. The sample size problem for critical defects24. Addressing human factors appropriately in root cause analysis25. Update the control plan when a failure recurs26. The cost of leaving a failure unreproducible27. Prioritize failures by business impact28. Why is performance verification necessary after maintenance?29. The structure of a post-incident review report30. Redefining success after failure31. Build a regression test library from failure typesFrequently asked questionsSources and further reading
Standalone reading - 4,305 words - Interactive technical example

Most production projects suffer not from a single major technical error, but from an accumulation of small assumptions that initially seem unimportant. High test accuracy cannot compensate for poor image acquisition or incorrect product matching.

A machine vision system may perform successfully in the laboratory yet begin generating persistent false alarms three weeks after installation in the field. The results change even though the same model, weights, and code are being used. The initial response is to collect more data or retrain the model. But if a different light source is switched on during the new shift, the camera bracket is vibrating, or the wrong product recipe is being used, model training does not address the root cause.

This guide does not categorize failures simply as "not enough data" or "the model was not good enough." The initial symptom, misdiagnosis, how to verify the root cause, corrective action, and the control that prevents recurrence will be examined in that order. The following 12 cases are educational scenarios derived from classes of failures that can occur in real projects; they are not presented as verified incidents that occurred at a particular company.

1. Defining failure in operational terms

Failure does not always mean project cancellation. A system goes into production but works only during one shift; it catches some defects but exceeds manual review capacity; test scores remain high, but a developer must constantly be called in for maintenance. Each is a partial failure with a different cost. Looking only at model metrics can conceal these partial failures.

Four dimensions are useful for evaluating the impact of a problem: quality impact (missed defects, false rejects), time impact (cycle delays, downtime), operational workload (manual intervention, servicing requirements), and sustainability (maintenance, component replacement, version control). Deterioration in any one of these dimensions can affect the success of the entire system. Project acceptance criteria should cover these dimensions.

A failure can originate in very different layers of the system01Defect definition02Optics03Data / model04Synchronization05OperationsExample systematic workflow - Must be adapted to actual project conditions
Figure 3. A failure can originate in very different layers of the system. Explanatory diagram; not an actual experiment or facility measurement.

2. Case 1 - Teams do not share the same definition of a defect

The quality team labels every mark on the surface as a "scratch," while the production team considers only deep marks with a functional impact to be defects. Disagreement among annotators grows. During training, the model tries to learn two inconsistent decision rules at once; feedback from operators in the field is also contradictory. The system frequently produces false rejects, and no one can say with certainty which result is correct.

The initial diagnosis is usually "the model cannot understand the detail." The real check is to compile disagreements at the individual sample level. If experts make different decisions about the same images in a blind labeling round, part of the problem lies in the target definition. Corrective action consists of an approved defect catalog, borderline examples, and a disagreement resolution procedure. The preventive control is to version the definitions whenever a new product or customer standard is introduced.

3. Case 2 - The optical setup does not show the defect consistently

Fine scratches on a metal surface are clear in some photographs and invisible in others. The project team trains dozens of different CNNs; even the best results vary from shift to shift. Investigation reveals that the angle of incident light, together with the microscopic orientation of the part's surface, determines contrast. Because the information the camera sees is physically unstable, the model's decision is unstable too.

Corrective action is to compare different lighting geometries through controlled experiments and establish image quality acceptance criteria. The extent to which visibility changes can be demonstrated by rotating the same sample and imaging it at different times and with different lighting drivers. A new model should be tested after this improvement. It is not reasonable to expect a larger network to recover detail that the image does not contain at all.

Illustrative scratch contrast under changing lightingAngle A18Angle B29Angle C76Angle D53Angle E21Relative, illustrative values; not actual field measurements
Figure 3. Illustrative scratch contrast under changing lighting. Explanatory diagram; not an actual experiment or facility measurement.

4. Case 3 - The camera is not fixed in place, and the measurement system drifts

Calibration succeeds when the dimensional measurement system is installed, but as the temperature rises on the production line, the camera mount shifts slightly. The system begins reporting different hole diameters when measuring the same part. The first intervention is to change the measurement algorithm's thresholds. This masks the actual mechanical drift with software and makes the problem even harder to detect.

Demonstrating the root cause requires repeated measurements of a fixed reference gauge under different temperature and vibration conditions. It is necessary to distinguish whether the error depends on part characteristics, camera pose, or changes in optical focus. Corrective action involves mechanical rigidity, temperature management, and, if necessary, a recalibration procedure. The preventive control is trend monitoring using a reference part at defined intervals.

5. Case 4 - Data leakage creates a false impression of success

There are 20 consecutive images of a product. A random data split sends some of these images to training and others to testing. The test score looks outstanding because the model remembers the similar background, light reflections, and distinctive marks on the part. Performance drops sharply when a new production batch arrives. The team first looks for domain shift, whereas the real problem is that independent testing was never performed.

The correction is to rebuild the data split using appropriate groups such as product identity, production batch, or time window rather than individual images. An automated check should ensure that the same source does not appear in more than one set. If the score falls, that is not bad news, but necessary evidence that the previous evaluation did not represent the real world. A good test reveals a project's weak points early.

The difference made by product-based data splittingIncorrect splitSame partTrain + TestCorrect splitOne partOne setIndependent testNew lot + shift
Figure 3. The difference made by product-based data splitting. Explanatory diagram; not an actual experiment or facility measurement.

6. Case 5 - The success metric is disconnected from production needs

The pilot presentation reports 99.4% accuracy, and the project is declared successful. However, because the proportion of defective parts is two per thousand, the model could show high accuracy even if it classified every product as good. While critical defects continue to be missed in the field, the only reported metric remains optimistic. The manual review workload caused by false alarms is also invisible.

The root of the problem is the choice of the wrong metric. In defect detection, the defect capture rate, false rejects, product-level decisions, and error costs should be monitored together. Confidence intervals, the number of defects encountered in testing, and defect subtypes should also be reported. Presenting success as a single large number is easy, but sound decisions require several metrics to be interpreted together.

Accuracy can be misleading with imbalanced classesAccuracy99.4Defect recall74Precision42Product matching99.7Relative, illustrative values; not actual field measurements
Figure 3. Accuracy can be misleading with imbalanced classes. Explanatory diagram; not an actual experiment or facility measurement.

7. Case 6 - The camera captures the right image, but the PLC rejects the wrong product

The model correctly flags the product as defective. Under heavy traffic, however, the association between the image result and the product identity is lost; the reject command is applied to the next part. Model predictions look correct in the software logs, yet defective products continue to reach the customer. Classification tests cannot identify this failure because the problem is in the timing and matching layer.

Root cause analysis should trace the product identity, trigger time, camera frame number, decision ID, and PLC acknowledgment from end to end. Queue congestion, retries, and timeout scenarios should be tested in particular. Corrective action may involve a state machine, idempotent message processing, and traceable product matching. The preventive control is to add fault injection and latency limits to acceptance testing.

Which stage should be investigated if the wrong product is sent for rejection?01Trigger02Frame ID03Prediction ID04PLC ack05Reject IDExample systematic workflow - Must be adapted to actual project conditions
Figure 3. Which stage should be investigated if the wrong product is sent for rejection? Explanatory diagram; not an actual experiment or facility measurement.

8. Case 7 - Latency measured on a single test device does not hold up in the field

The model runs quickly on the developer's computer. On the production computer, however, the GPU is shared, image copying adds overhead, and the system's p99 latency exceeds the decision window. Looking at average inference time, the team concluded that "18 ms is enough"; camera buffers and PLC communication were not included.

The proper analysis is an end-to-end timeline: trigger, exposure, transfer, preprocessing, inference, postprocessing, PLC notification, and actuator response are measured together. Long queues and outliers are examined separately. Corrective action sometimes means a faster model, sometimes an asynchronous architecture, and sometimes relocating the physical rejection point. An average FPS target alone is not enough.

9. Case 8 - Knowledge needed for maintenance remains with one person

The camera is replaced after the engineer who developed the system leaves. No one can find the old lens's working distance, lighting power settings, calibration record, or the dataset used to train the model. The new setup resembles the working system, but its results are inconsistent. Reinstallation takes weeks rather than hours.

This is organizational technical debt rather than primarily a software bug. NIST's lifecycle approach and Sculley et al.'s discussion of technical debt in machine learning help explain the scope of the problem. The solution is to keep versioned configurations, assembly drawings, reference images, device serial numbers, model/data provenance, recovery trials, and maintenance procedures in a single accessible system.

Hidden technical debtDataLabeling rulesConfigurationLighting / lens settingsDependencySDK / firmware
Figure 3. Hidden technical debt. Explanatory diagram; not an actual experiment or facility measurement.

10. Case 9 - A new product recipe silently disrupts the system

Production switches to a new surface coating. The quality department has approved the change, but the visual inspection team has not been informed. Light reflections change, some thresholds become meaningless, and anomaly detection treats the new normal surface as defective. Because the model's weights have not changed, the team interprets the situation as "inexplicable drift" for a long time.

To identify the root cause, the product version, production recipe, raw material batch, and image distribution should be examined together. The correction is revalidation under the new product conditions and, if necessary, a controlled model update. The preventive control is change management that ensures process changes are communicated to the machine vision station. Automatically retraining the model may further worsen conditions that lead to false acceptance.

11. Case 10 - The false-positive workload brings the shift to a halt

The pilot is accepted because it captures rare defects well. On the actual line, the defect rate is very low, and the model generates false alarms on one percent of good surfaces. In a system processing 10,000 products per hour, the number of products the operator must review exceeds planned capacity. Even with a high defect capture rate, the production workflow is unsustainable.

The root cause is not only selecting the model solely on recall, but also failing to calculate how the base rate, meaning the actual prevalence of defects, affects the workflow. Corrective action consists of adjusting thresholds according to operational cost, collecting hard negatives, and, if necessary, adding a secondary verification stage. The preventive control is to assess the false-alarm workload at actual production prevalence during acceptance testing.

Review workload caused by false alarms (illustrative)Hour 148Hour 270Hour 385Hour 493Hour 5100Relative, illustrative values; not actual field measurements
Figure 3. Review workload caused by false alarms (illustrative). Explanatory diagram; not an actual experiment or facility measurement.

12. Case 11 - A model update performs well in testing but is risky in the field

A new model has higher average accuracy. When it is put directly into production, the rate of missed critical defects rises for a particular product family. Because neither shadow operation nor a phased rollout was performed before moving the entire system to the new version, the impact grows. The statement "the new model is better" has hidden a condition-specific regression.

The correction involves a safe rollback to the previous version, tracking affected batches and products, subgroup error analysis, and returning the new version to the validation protocol. The preventive control is to monitor not only aggregate metrics but also critical defect classes, latency, calibration, and system output when comparing versions. Rollback means not only installing an older software package but also restoring data/configuration consistency.

13. Case 12 - The project is technically complete, but ownership is unclear

The system passes FAT and SAT, but no one has decided who in production operations will evaluate fault alarms, replace the lighting driver, determine which data is retained and for how long, or repeat testing when a new product arrives. At the first failure, the quality, production, IT, and automation teams pass responsibility to one another. Although the system exists, it cannot provide a reliable service.

The solution is not a new model but operational ownership. A responsibility matrix such as RACI, critical incident response, a maintenance plan, version approval, and change communication should be prepared before commissioning. Acceptance of the system does not mean "no one needs to look after it anymore." Acceptance marks the beginning of the transition to sustainable operations.

Responsibility after commissioningProductionOperating the lineQualityDefect limitsMaintenance / ITFaults & versions
Figure 3. Responsibility after commissioning. Explanatory diagram; not an actual experiment or facility measurement.

14. How is root cause analysis performed?

The common method in the cases above is not to confuse symptoms with causes. "False alarms increased" is a symptom. A lighting change, inconsistent labels, the product mix, or an inadequate threshold are separate candidate causes. In root cause analysis, these candidates should be tested one by one through observation and experimentation. Tools such as Ishikawa (fishbone) diagrams, the 5 Whys, and fault trees organize thinking, but objective evidence is required before the correct cause can be considered verified.

For example, if false alarms have increased over three days, camera settings, new recipes, maintenance records, and part samples from the same period can be compared. An increase in errors appearing alongside a particular change in lighting power strengthens the possibility of a causal relationship; a controlled A/B trial or reference gauge test helps verify it. Coincidence in time alone is not evidence of causation.

Root cause hypotheses: increased false rejectsPeopleMachineMaterialMethodMeasurementEnvironmentIncreased false rejects
Figure 3. Root cause hypotheses: increased false rejects. Explanatory diagram; not an actual experiment or facility measurement.

15. How should the interactive diagnostic tool be interpreted?

The tool below prioritizes layers to check based on observed symptoms. It is not an automatic definitive judgment, such as a medical diagnosis, or a probability calculation; it is a checklist that makes hypotheses that are easy to overlook during field investigations visible. Several symptoms may appear at once, and a single root cause may produce multiple symptoms.

Layers to check by symptom

Select one or more symptoms. The tool does not estimate probabilities; it lists hypotheses to investigate in field testing.

Select a symptom to view potential areas for investigation.

The priorities are educational rules. If there is a safety or critical quality risk, the authorized team must decide whether the system should operate.

16. Separate the initial intervention from the permanent correction to choose the right action

When production stops, the first goal is to restore service under safe conditions; comprehensive root cause analysis may continue later. Switching to a backup station, manually separating suspect parts, or rolling back to the previous version may be acceptable temporary interventions. However, recording these temporary steps as permanent solutions leads to recurrence of the same problem.

A permanent correction is a change directed at a verified root cause. Preventive action, in turn, prevents a similar failure from occurring on another line or again in the future. For example, replacing a faulty cable on a line is corrective action; a standard installation procedure that protects the cable routing from vibration is preventive action. The effectiveness of both should be verified in a repeat test.

Moving from a problem to learning01Symptom02Verification03Corrective action04Preventive control05RetestExample systematic workflow - Must be adapted to actual project conditions
Figure 3. Moving from a problem to learning. Explanatory diagram; not an actual experiment or facility measurement.

17. A 30-day framework for rescuing a project

Before changing the entire architecture of a troubled system, a short, evidence-based improvement period can be designed. In the first week, the integrity of production and error logs is verified, and representative failure samples are collected. In the second week, physical visibility, product matching, and label consistency are examined separately. In the third week, a limited change targeting the greatest risk is made. In the final week, gains relative to the previous state and side effects are measured using the same test protocol.

This schedule is not a promise of an actual project duration; it is an example for sequencing the work. If there is a critical safety or quality risk, keeping the system in production before the assessment is complete may be inappropriate. To keep the scope manageable, avoid changing the lighting, camera, model, and PLC timing at the same time. When multiple variables are changed simultaneously, it becomes unclear which one produced the result.

18. A systemic lesson: invisible dependencies surrounding the model

Some technical debt in machine learning projects accumulates outside the code. Data collection procedures, the image processing steps the model depends on, outputs expected by higher-level systems, undeclared consumers, and configuration rules are all part of this debt. Sculley et al.'s Hidden Technical Debt in Machine Learning Systems study discusses how these dependencies can make system maintenance more difficult.

Sambasivan et al.'s Data Cascades research, in turn, shows how problems accumulate and create downstream effects in high-stakes applications where data quality is neglected. This study was not conducted directly on factory vision; nevertheless, it offers a transferable warning for projects that treat data management as secondary work. The research findings should not be confused with the fictional production cases presented here.

19. What should we measure after a failure?

To determine whether the correction worked, do not look only at the number of recurring alarms. Defect capture, false rejects, product matching integrity, worst-case latency, and operator workload should be measured again in the product group where the failure occurred. Add monitoring metrics for new failures if necessary. Troubleshooting should leave behind a new performance baseline and control plan.

Failure analysis should never turn into a competition to blame an individual. Processes genuinely improve when the questions are "Why was this failure not visible earlier, which control was missing, and where else could the same problem occur?" rather than "Who made the mistake?" Senior engineering here is as much about the ability to build a learning organization as it is about technical knowledge.

20. Error logs determine the quality of diagnosis

Root cause analysis becomes difficult if a system's fault log consists only of lines saying "an error occurred." Meaningful event logging at a machine vision station should link the timestamp, product ID, camera ID, acquisition parameters, model version, prediction, decision threshold, PLC notification, and, where necessary, an image sample. Continuously storing all this information at full resolution for every product can be costly. The logging policy should be designed around business needs, data security, and storage limits.

Clocks must be synchronized to reproduce an incident. If a camera computer's clock is 600 ms behind the PLC's, linking events for the same product becomes difficult. Chained tracing by product ID may be more robust than relying on timestamps alone. Good logs help investigate both the sequence of events and cause-and-effect relationships.

When model confidence scores become abnormal in production, not only the result but also the image processing stages must be traceable. If there is a format mismatch between the input image, the normalized image, and the model output, the problem may lie in the transformation chain rather than inside the model. This distinction is not easy to see without the right log fields.

21. Narrowing the fault tree through hypotheses

In a root cause investigation, it is useful to start with the tests that produce the most evidence and carry the lowest risk. For example, when false rejects increase, repeatedly imaging the same reference part under different lighting conditions can provide information much faster than restarting the model's entire training process. If the reference part's image is stable but incorrect decisions are concentrated in new lots, changes in material and data distribution become stronger hypotheses.

When ranking hypotheses, keep "what was measured" separate from "what was inferred." A rise in GPU temperature may have been measured, but it may not yet be proven that this directly caused the increase in latency. Examining load and temperature as separate variables may reveal that the cause is memory pressure or synchronization.

A fishbone diagram opens up all possible categories; a test plan narrows them down. The diagram does not finish the work; it starts it. The final report should document hypotheses, experiments performed, observations, and rejected causes. This way, the team does not start from scratch when the same failure recurs.

22. A test that distinguishes data drift from sensor failure

Data drift is a change in statistical distribution; by itself, it does not mean an increase in defects or degradation of the model. Average brightness in production images may have changed because a new product surface was introduced or because the light source weakened. The appropriate interventions differ in these two cases. The first may require model validation under the new conditions; the second may require physical maintenance.

A fixed reference part can be used for a distinguishing experiment. If the reference part also looks different than before, a change in the sensor, lens, or lighting is a strong candidate. If the reference remains stable while only new production lots change, the product/process side should be investigated. Even so, a single test may not be conclusive; camera position, ambient light, and image transformation settings should also be checked.

Retraining the model is sometimes necessary, but the quality labels in the current data must first be reliably verified. Learning the new surface from incorrectly labeled examples can turn a temporary visibility issue into a more persistent performance problem.

23. The sample size problem for critical defects

A model capturing all 100 critical defects in a test does not mean that its defect capture rate is certainly 100%. Statistical uncertainty can be wide if the number of independent samples is small. This is a major practical problem for rare defects: a very high confidence level may be required while real defective samples are limited. In such cases, validated test parts, physical references, and additional stress scenarios may be needed rather than simply waiting for naturally occurring defects.

However, substituting synthetic defects for naturally occurring defects also has limitations. Synthetic images may be useful for testing image processing stages, but they cannot be assumed to fully represent the optical and physical variation of actual production defects. Reports should keep naturally occurring, deliberately produced under controlled conditions, and synthetic samples separate.

When the defect rate is very low, overall accuracy is not decisive. Sensitivity, false acceptance, and confidence bounds should also be measured for each defect class. This makes it clear over what range of data the statement "the pilot was successful" holds.

24. Addressing human factors appropriately in root cause analysis

If an operator selected the wrong recipe, the question should not be limited to "Why did they choose incorrectly?" Were the recipe names too similar, could the system automatically check against the product identity, was the incorrect selection noticeable on screen, and how realistic was the procedure during product changeover? Treating repeated training as the only solution can allow the same interface error to recur.

Human factors are an inherent part of software and operational design. A system that generates many alarms and expects the operator to evaluate each one with equal care can create alarm fatigue over time. Improving the source of false alarms may be more effective than burdening the operator with additional warning messages.

For fundamental corrective action, failure behavior should be designed to be predictable and recoverable. A system that prevents an inspection station from operating with an incorrect configuration as far as possible is more resilient than one that requires the operator to behave flawlessly at all times.

25. Update the control plan when a failure recurs

After a failure is corrected, the adequacy of previous tests should be reconsidered. For example, if a wrong-product rejection problem is discovered, acceptance testing should include queue saturation, successive triggers, disconnection, and retry scenarios. These scenarios should be rerun not only for the next software version but also when the camera or PLC is replaced.

Linking acceptance tests to fault records allows operational experience to feed back into product quality. For a critical incident, it may be useful to define a preventive test, a measurable alarm, and a clear owner. Creating dozens of new controls for every incident, however, can increase complexity; consolidating similar causes into a single standard is more sustainable.

System reliability is measured not only by a reduction in failures but also by the ability to diagnose quickly, roll back safely, and learn systematically when a failure occurs. A root cause report should therefore include lasting outcomes such as change management, documentation, and maintenance training alongside the technical correction.

26. The cost of leaving a failure unreproducible

Failures that appear once in the field and then disappear can cast a long shadow over system reliability if good records are not kept. Particularly in image transfer and PLC matching problems, a one-frame timing shift may not reappear during testing. Data such as the frame ID, decision message, and processing latency at the time of the incident should therefore be retained. Trying to understand random incidents by relying only on an operator's screenshot may be insufficient.

If the failure cannot be reproduced, controlled load and interruption tests are useful. Camera transfer can be slowed, buffer buildup simulated, or the PLC response delayed. These tests should be performed in a controlled test environment; the risk of generating an incorrect reject command in actual production must be considered. The aim is to build a setup that tests the suspected root cause.

An incident being very rare does not mean it is unimportant. Depending on production speed, an identity mismatch occurring once in a million instances can still affect a meaningful number of products at large annual volumes. Impact and frequency should be evaluated together.

27. Prioritize failures by business impact

The most frequent problem in error logs is not always the one that should be solved first. A brief camera warning that occurs a hundred times a week and is automatically compensated for may be less risky than a critical product matching failure occurring once a month. Prioritization should consider probability, impact, detectability, and safe rollback capability together.

When choosing corrective action for a failure, the cost of alternatives should also be considered. If retraining is needed to reduce false alarms, it carries data collection and acceptance testing costs. If the same problem can be solved by stabilizing the light source, that may be a less costly approach. However, this decision must be supported by a controlled experiment.

It is useful to establish common metrics that field teams can agree on: the number of missed critical defects, unnecessary manual reviews, minutes of production downtime, recurrence frequency, and intervention time. These data translate technical debt into operational impact.

28. Why is performance verification necessary after maintenance?

After a lens is cleaned or a camera is replaced, the system may continue producing images, but its field of view, focus, calibration, and light intensity may no longer match the previous conditions. Simply checking that "the camera produces an image" is not enough. The visibility of known defects on a reference part and measurement repeatability should be verified.

If a new threshold is set after maintenance, the change should be recorded and critical failure scenarios retested. A simple cable replacement may not directly affect the product ID flow; replacing the camera trigger cable, however, may require timing integrity to be verified. Impact analysis allows risky areas to be selected without unnecessarily rerunning every test.

The lasting process is a short maintenance and revalidation matrix specifying which check should follow each component replacement. This matrix ensures that the field team's experience does not remain solely in individuals' memories.

29. The structure of a post-incident review report

The first section of a report prepared after a critical failure should contain the incident's start and end times, the affected line, the number of products, and how the incident was detected. The second section explains temporary safety or production measures taken during the incident. The third contains the timeline and measured evidence. The fourth covers possible causes and experiments that test them. The final section contains corrective actions, owners, and revalidation results.

The report's language should explain unprotected points in the system rather than blame individuals. For example, alongside the sentence "the operator selected the wrong recipe," the report should explain why there was no check for recipe consistency against the product barcode. A single incident may not require the entire system design to change, but the possible prevalence of similar failures should be investigated.

Hypotheses that remain open after the investigation should also be recorded. Selecting a single cause without evidence may lead to the wrong correction. A properly scoped statement of "we do not know yet" is more valuable than an unverified categorical claim.

30. Redefining success after failure

After the project recovers, the new success criterion should not simply be a return to the old test score. For example, if a longstanding failure was caused by incorrect product matching, product ID integrity and timeout behavior should become new acceptance criteria. If a lighting change after maintenance went unnoticed, reference image trends and maintenance verification should become part of the system.

In this way, every major failure creates an opportunity to learn and improve system observability. Even so, generating endless alarms and tests can increase system complexity. What matters is choosing a small number of reliable controls that reduce measured risk. Redundant and inconsistent alarms checking the same function can fatigue the operator.

In a successful improvement report, the "before/after" comparison should be made under the same conditions. A new model scoring highly on a different dataset does not mean that the old problem has been solved. The condition that caused the failure should specifically be reproduced and the correction verified.

31. Build a regression test library from failure types

Reporting recurring field incidents individually is useful, but a representative regression test library should be prepared to prevent the same incident from happening again. For example, separate tests might check that the wrong product is not rejected when the camera disconnects, that a quality warning is generated when lighting power decreases, and that critical defect examples are not missed after a model update. It should be specified which software, hardware, and configuration changes require these checks to be rerun.

The test library should not consist only of trouble-free examples. Cases such as borderline defects, hard negatives, corrupted image formats, timeouts, duplicate messages, and missing product IDs can be added. However, every test should be based on a concrete risk; otherwise, maintenance workload grows while the ability to catch failures remains limited. The aim of good tests is not a higher test count but fewer surprises.

Frequently asked questions

Why can errors increase in production despite high test accuracy?

Optical conditions, the product mix, non-independent test sets, latency, incorrect product matching, or new production recipes may be factors. The layer that changed must be identified first.

Should failure analysis start with the model?

No. Model behavior should be evaluated after correct image acquisition, product identity, and label consistency have been verified.

What is the difference between a root cause and a symptom?

An increase in false rejects is a symptom. Its cause may be a lighting change, camera vibration, a threshold error, or data drift. The root cause must be verified through experiments and records.

Should every instance of data drift trigger retraining?

No. A distribution change should first be examined in terms of its causes and performance impact. Masking a hardware failure through retraining does not solve the problem.

When should a project rescue decision be made?

When critical defects are being missed, physical constraints cannot be met, or error costs are unacceptable, a decision on safe operation comes first; the feasibility of improvement is then assessed.

Sources and further reading

The case narratives are fictional educational scenarios. The research links do not prove that these incidents occurred at a particular factory.