7 min read · Machine vision

A factory that has just installed a vision inspection system usually wants to switch on rejection straight away. But if the system rejects wrongly at the start, good product gets thrown away and defects may get through, and nobody yet knows where the system goes wrong. The safer route is to run the AI alongside the people first, with the AI’s results not yet used to decide anything. The examples in this article are hypothetical.
What is shadow mode?
Shadow mode means the system judges every part as it would in live use, but its reject signal is not connected, it does not stop the line, and it does not change the inspectors’ work. People inspect as before, and the system records its own results alongside. Afterwards the two sets of results are compared.
Why start this way?
- You see how the system behaves with real product, real lighting and real dust, which differ from the training images.
- No good product is lost and no extra risk of releasing defects is taken, because people are still the deciding gate.
- You learn that inspectors do not always agree with each other either, and that some cases where the system is “wrong” are cases where the person missed something.
- The team sees the results and starts to trust or distrust the system based on data, not on feeling.
- You find cases that were never in the training data, such as a new part colour or a mark nobody had labelled.
Steps
- Before starting, set the duration and the minimum number of parts, covering several shifts, several lots and each common type of defect.
- Have the system record every part with the image, score, time and part or lot number, without connecting the reject signal.
- Have the inspectors record their own results as usual, in the same format, and do not let them see the system’s result before they decide.
- At the end of each day or shift, pair the people’s results with the system’s results part by part.
- Have an experienced judge, who is not the person who inspected that part, review the image and the part for every case where the two sides disagree.
- Summarise the results weekly and check whether the trend is stabilising before deciding the next step.
Reading the disagreements
Pairing the results gives four combinations. The first two are agreement, and the last two are disagreement, which is where you learn the most.
| Person | System | Possible meaning | What to do |
|---|---|---|---|
| Pass | Pass | Agreement, but if both missed something, no one will see it | Randomly re-check some of the parts that both passed |
| Fail | Fail | Agreement, most likely a real defect | Sample to confirm, and note the defect type |
| Pass | Fail | The system raised a false alarm, or the system saw something the person overlooked | The judge examines the real part and classifies it as system correct or false alarm |
| Fail | Pass | The system missed a defect, or the person judged too strictly | The judge examines the real part and classifies it as system missed or person too strict |
Then group the causes, for example by defect type, position on the part, shift and lot. If the disagreements cluster on one defect type or one shift, they can usually be fixed directly, for example by adjusting the lighting, adding training examples or reviewing the criteria people use.
Set the criteria in advance for when it may go live
Write the criteria before you start collecting data, not after seeing the results, because once you see the numbers you will be tempted to adjust the criteria so the system passes. The criteria should answer at least three questions: how many missed defects are acceptable, how many false alarms are acceptable, and how many consecutive weeks the results must stay stable. For defects that affect safety, the person responsible for that area should set the criteria themselves, in a way that can be audited.
Move up in stages rather than switching on full rejection at once.
- Shadow mode: the system decides but does not reject.
- System alerts the inspector: the system marks suspect parts and a person makes the decision.
- System rejects only clear-cut parts, and passes borderline parts to a person.
- Full automatic rejection, with regular spot checks by people and a golden sample set for checking the system.
If you will connect the reject signal to a PLC, see the article on sending camera inspection results to a PLC for how to match results to parts.
Common mistakes
- Collecting data for too short a time, so odd lots or the night shift are never seen.
- Assuming people are always right, when people also get tired and do not judge the same way every time.
- Never checking the parts that both sides passed, so you do not know whether there are defects that both missed.
- Changing the model or the lighting during the trial and then combining the data from before and after.
- Letting inspectors see the system’s result first, so they follow the system and the comparison is no longer independent.
- Adjusting the criteria after seeing the results so that the system passes.
Hypothetical example: a carton inspection line
Suppose a line inspects cartons for tears and poorly sealed tape. Shadow mode runs for 5 days, with 6,000 parts compared. The paired results are as follows: 5,820 passed by both, 90 failed by both, 60 passed by the person but failed by the system, and 30 failed by the person but passed by the system, 6,000 in total.
The disagreements number 90 parts, or 1.5 percent of the total. People failed 120 parts in all (2.0 percent) and the system failed 150 in all (2.5 percent). The judge examined the 90 disputed parts. In the group of 60, the system found 25 real defects that people had overlooked, and raised 35 false alarms. In the group of 30, the system missed 20 real defects, and people were too strict on 10.
If the 90 parts failed by both are taken as real defects, the known defects total 90 + 25 + 20 = 135. The system caught 90 + 25 = 115, about 85 percent. People caught 90 + 20 = 110, about 81 percent. These figures count only the defects that were found. Parts passed by both have not been inspected, so there may be further defects that both sides missed. The team therefore decided to randomly inspect more of the parts that both passed, look into the causes of the 20 parts the system missed and the 35 false alarms, fix the lighting and add training examples, and then collect another round of data before moving to stage 2.
Limits and cautions
Shadow mode takes time and needs extra people at the start. Good results during the trial do not mean the results will stay good. When raw material, lighting or the type of work changes, you have to re-check and monitor changes in the model. Decisions that involve safety or high cost of failure should keep a person checking. All figures in this article, such as 6,000 parts or 85 percent, are hypothetical.
Starting references
- Wikipedia — Confusion matrix
- Wikipedia — Cohen's kappa
- Wikipedia — Inter-rater reliability
- NIST — AI Risk Management Framework




