Article sections
What exactly is industrial computer vision?How do you understand the problem on the factory floor?How do we make success measurable?Let us think through an example from start to finishWhat should you have after the first site visit?Conclusion: Make the problem visible firstImagine a metal part arriving in front of a camera on a production line. There is a fine scratch on its surface. An engineer might focus on finding that line in the image, while the person responsible for quality asks a different question: Is this scratch enough to reject the product? For the production manager, what matters is making the decision without stopping the line. The maintenance team thinks about camera vibration, while the operator thinks about good parts rejected by mistake.
All these people looking at the same part are right. Industrial image processing is a bigger problem than finding an object in an image. It means making a production decision reliably under the changing conditions of the real world.
In this article, we set model architectures, training code, and the latest detection algorithms aside. We will first address more fundamental questions: What problem are we actually solving? What does the camera need to see? Which errors are acceptable, and which are not? How do we prove that a system works?
Throughout the article, we will follow the example of inspecting a machined metal housing for surface defects. This way, the concepts will not remain mere definitions; we will move from a site visit toward actionable technical requirements.
The central idea of this article: A successful industrial vision project starts not with a good choice of model, but with a correctly defined problem.
What exactly is industrial computer vision?
In its simplest definition, computer vision seeks to extract meaningful information from images. We can determine where a part is in an image, what a marking on it says, or whether there is an unexpected mark on its surface. Industrial computer vision makes this information usable in production, quality, measurement, or automation processes.
The difference may seem small, but it is decisive in practice. A model finding a scratch in an image is not enough on its own. The system must determine whether the scratch is a defect under the quality standard, link that decision to the correct product, keep the necessary records, and, if needed, divert the product at the right time.
Image processing, computer vision, and artificial intelligence are not the same thing
These three terms are often used interchangeably in everyday language. In a technical project, however, we need to preserve the distinctions between them.
Image processing encompasses operations used to transform an image or extract specific features from it. Examples include reducing noise, adjusting contrast, thresholding, and extracting edges. Computer vision uses these operations, among other tools, to reach a conclusion about the object or scene in an image. Machine learning is one family of methods that can be used to reach that conclusion. Not every computer vision problem necessarily requires deep learning.
For example, if you are checking the number of holes in a part held in a fixed position, thresholding and connected component analysis with good lighting may be sufficient. If you want to distinguish different cosmetic defects on surfaces with varying brightness and texture, a learning-based method may be more appropriate. Sometimes image processing is not needed at all: a simple presence/absence check can be handled with a photoelectric sensor.
The important point is not to ask "Which model is the most powerful?" too early. The better question is: What information do we really need for this decision, and how can we obtain it with the least complexity?
What problems do we solve in industry?
Grouping applications solely under "defect detection" is inadequate. Measurement, barcode reading, and surface defect detection have different sources of error and criteria for success.
| Application | Typical output | The most critical engineering question |
|---|---|---|
| Surface quality inspection | Defect presence/absence, type, location, severity | Which defects actually justify rejection? |
| Dimensional measurement | Length, diameter, angle, gap | Is the measurement uncertainty sufficiently small relative to the tolerance? |
| Assembly verification | Missing, reversed, or incorrect part | How will product variants be distinguished? |
| OCR and code reading | Serial number, date, lot, barcode | How will misreads and unreadable codes be handled? |
| Position determination and robot guidance | Coordinates, orientation | How stable are calibration and mechanical tolerance? |
| Video-based process monitoring | Event, motion, or sequence violation | How will latency, loss of visibility, and temporal relationships be addressed? |
Each row in this table could be the start of a different engineering project. Using the same camera does not make them the same problem.
Why does a system that works in the laboratory struggle in production?
In computer vision research, the dataset is usually prepared in advance. The origin of the images is known, labels are available, and the model's task is to learn from them and produce predictions on a test set. This setup is valuable for comparing methods. But the work on a real production line does not end there.
The camera can get dirty over time. The lighting angle can change. A new product variant can be introduced. The same part may arrive with a different surface gloss on a different shift. An operator may move a fixture. Even if the model makes the correct decision, the reject mechanism may act on the next part instead.
This is why a high score on a research dataset is not sufficient evidence of success on site. MVTec AD 2, for example, offers challenging anomaly detection scenarios that include different lighting conditions. Such datasets are very useful for developing and comparing methods; nevertheless, they cannot be assumed to represent a particular factory's product distribution, mechanical constraints, and acceptance criteria. [1]
Sometimes a better image is worth more than a better model
Suppose we are looking for a fine scratch on a shiny metal surface. Direct lighting can make the surface appear almost entirely white to the camera. The scratch is there, but glare makes it indistinguishable. In this case, training a larger model may not solve the fundamental problem: the image does not contain enough information to distinguish the scratch.
Changing the angle of incident light, particularly using low-angle lighting, may make the scratch stand out. Polarization or different wavelengths may help on some surfaces. Which approach works depends on the material and the physical properties of the defect. [2]
For this reason, it is not right to evaluate the solution solely in terms of algorithms. First, examine whether the part can be held in place, whether the lighting arrangement can be improved, and whether a simpler sensor would suffice. Training a complex model is sometimes the right decision, but it should be a decision made after considering the alternatives.
Industrial vision also does not automatically constitute a machine safety system. A quality inspection camera should not replace a safety function intended to protect people without a separate safety design and appropriate validation. Machine safety has its own risk assessment and validation process; ISO 12100 is one of the fundamental reference standards in this field. [3]
How do you understand the problem on the factory floor?
When a customer says, "We want a system that detects scratches on metal parts," they have not yet defined a solvable technical problem. This sentence expresses a need, not the boundaries of the solution.
Which marks will count as scratches? Will every scratch cause a part to be rejected? Will the mark remain visible after painting? How fast is the line? Which product family will be inspected? What happens if a false rejection occurs? How much time is there between two products on the same line? Choosing a camera, lens, or model before answering these questions is usually premature.
The first task is to observe the process, not choose an algorithm
The first task during a site visit is to follow the product's journey: Where does the part come from, where does it stop, what operation does it undergo, how is it oriented, and what happens after inspection? It is also important to see how inspection is performed today. Which area does an operator look at, at what angle do they turn the part, and what do they do when in doubt?
Observing this sometimes reveals details that cannot be learned in a meeting. For example, the quality team may have said, "The top surface is enough," but the operator turns certain parts to check an edge. This small movement shows that the proposed single-camera solution may be incomplete.
Before visiting the site, you can request product drawings, current quality guidelines, rejection records, and, if possible, sample defective parts. On site, four things must be observed: product, process, decision and action. After the visit, these must be turned into a written, verifiable problem definition.
The same process has different owners
Starting a project with only the software team is easy, but insufficient. The quality team knows which defects are unacceptable; the production team knows the limits on speed and downtime; the maintenance team knows the environmental conditions in which the system will operate; and the operator knows the daily exceptions. The automation team explains how triggering and reject signals can be implemented. Information technology handles matters such as data retention and network access.
Do not assume in the first meeting that everyone uses the same word with the same meaning. An "error" may mean a surface flaw to quality, a missed trigger to automation, and a failed inference to software. This is why discussing sample parts or images is so useful. Disagreements quickly become visible when the discussion focuses on concrete cases rather than abstract statements.
Do not collect defect data before writing the defect definition
One of the hardest issues in visual quality inspection is the boundary between "normal" and "defective." Not every mark is a defect. Machining marks, surface texture, material differences, or natural production variation can sometimes resemble defects. Conversely, a very small crack may appear cosmetically insignificant yet be functionally critical.
For this reason, prepare as clear a definition as possible for each defect: its name, physical appearance, the regions in which it matters, any measurable threshold, and borderline examples. "Scratch" should not be a stand-alone label; distinguish "machining mark," "cosmetic scratch," and "critical surface damage" if needed.
If quality personnel cannot agree on two borderline examples, the model's score also becomes debatable. If people assign different labels to the same part, it is unclear what the system is supposed to learn. First, reach a shared decision using examples and determine how disagreements will be resolved.
Example: A small mark on the sealing surface of a machined metal housing may matter more than a larger mark on its exterior. A single rule such as "reject if the scratch exceeds 3 mm in length" is misleading if it does not specify the region of the part. Actual tolerances are determined by the quality standard and the product's intended use; the dimensions given here are not a specification.
What the camera sees is not the same as the actual state of the part
Observability means whether the characteristic we are looking for is actually visible in the chosen imaging arrangement. A scratch on top may be clearly visible while a crack on an edge is completely outside the camera's view. The part's gloss, surface angle, field of view, motion speed, and depth differences directly affect the image.
At this stage, the question is not "How many megapixels should the camera have?" First, understand where the defect is, how small it is, from which viewpoint it is visible, and how much contrast it produces in the image. Resolution, optics, lighting, exposure, and triggering are then chosen together.
On moving production lines, time is as important as the image. When will the sensor detecting the part's presence trigger? Which part will the image be associated with? How much time is available before the product reaches the reject point? What will the system do if a frame is lost or no decision can be produced? If the imaging arrangement and automation logic are designed separately, even a good detection model can cause the wrong part to be rejected.
Do not select only clean images when collecting data
During initial trials, everyone tends to choose the clearest possible images. The drawback is that this makes the model appear more successful than it really is. Real production includes different shifts, product lots, surface types, machine settings, operator interventions, and changes over time. The data collection plan must cover these.
Especially for rare defects, instead of collecting "nice examples," collect both the possible forms of the defect and good surfaces that resemble it. A strong reflection, oil stain, or normal machining mark can cause the model to produce false rejections repeatedly. This is why not only defective parts but also challenging but good examples are very valuable.
Part identity and data provenance must also be recorded: the station where the image was captured, date, product type, lot, and, if possible, machine state and quality decision. This information should be retained without collecting unnecessary personal data and in compliance with the required retention and access rules. Otherwise, investigating the cause of a failed prediction weeks later becomes difficult.
Do not call the project ready just because the preliminary investigation succeeded
One good demo does not mean a system is ready for production. First, demonstrate that the defect can be imaged; then try different methods on a limited sample. Next, evaluate using unseen examples representative of production conditions. Finally, test the system together with the actual hardware and automation.
These steps do not answer the same question. The optical trial answers "Is the defect visible?"; the prototype answers "Is there a possible solution?"; independent evaluation answers "Does it generalize to different examples?"; and the site test answers "Does the system work as a whole?"
If the following situations remain after returning from the site, clarify them before advancing the project:
- If the quality team cannot define the boundary between defective and good examples, prepare acceptance criteria first.
- If the critical defect is not visible from the current viewpoint, change the optical and mechanical arrangement first.
- If there are almost no examples of the target defect, redesign the data and testing strategy.
- If product identity and the reject signal cannot be matched reliably, resolve the automation risk.
- If the acceptance criterion is expressed only as "99% accuracy," define decision costs and error types separately.
These issues do not necessarily mean the project must be canceled. They simply show that there is not yet enough basis to move on to model development.
How do we make success measurable?
Suppose we have toured the site, understood the defect, and can obtain suitable images. The next question is: What evidence will let us say the system is successful? Statements such as "It finds scratches" or "Its accuracy is high" are not clear enough to serve as the basis for a contract or production acceptance.
It is useful to think at three separate levels here. The business objective describes the loss or risk we want to reduce. The system requirement states what the solution must do on the production line. The technical success criterion determines how we will measure this.
For example, the business objective may be to reduce critical defects that escape to the customer. The system requirement is to image every product, record its decision with the product identity, and divert defective products at the correct point. Technical criteria consist of separate indicators such as critical defect detection rate, false rejection rate for good products, latency, and availability.
Why can a single accuracy percentage be misleading?
Consider a line producing 20,000 parts per day. Suppose 2% are genuinely defective. Assume the system detects 98% of the defects and incorrectly rejects 1% of the good parts. All these figures are purely a calculation example; they are not the actual performance of any system.
The calculation is quite instructive. Of 400 defective parts, 392 are correctly rejected and 8 are missed. Of 19,600 good parts, 196 are falsely rejected and 19,404 are correctly accepted. The overall proportion of correct decisions is approximately %98,98. That may sound very good. But every day, 8 defective products escaping and 196 good parts being unnecessarily diverted may matter significantly to the business.
Moreover, only 392 of the 588 rejected parts are actually defective; approximately one-third of rejections are false rejections. This is why we need to discuss metrics that directly describe the problem rather than just "accuracy."
| Metric | Value in this example | What question does it answer? |
|---|---|---|
| Defect detection rate (recall) | %98 | What proportion of actual defects did we find? |
| False rejection rate for good products | %1 | What proportion of good products did we divert unnecessarily? |
| Precision of the reject decision (precision) | %66,7 | What proportion of rejected products are actually defective? |
| Overall accuracy (accuracy) | %98,98 | How many decisions across all parts were correct? |
Which metric takes priority depends on the product's risk. For example, the cost of missing a safety-critical or functionally critical defect may be very different from missing a cosmetic defect. The cost of false rejection is not limited to scrap either; it can include reinspection, downtime, and operator time.
Do not choose a decision threshold without discussing error costs
A model often produces a score rather than saying "reject" or "accept" on its own. The threshold that turns this score into a decision creates a trade-off between the two types of error the business can tolerate. A highly sensitive threshold may catch more defects but also reject more good products. Relaxing the threshold may reduce false rejections but increase the risk of missing defects.
Threshold selection should therefore not end with examining only an ROC or precision-recall curve. Work with the quality and production teams to clarify which errors have more serious consequences under which conditions. In some applications, routing uncertain products to a separate human inspection may be better than rejecting them outright. This also requires a separate process and incurs a cost.
A small number of successful tests does not provide a definitive guarantee
When a system correctly diverts all 100 defective parts, one can say "the defect detection rate is 100%." But that does not show it will never make an error in real life. Especially for rare defects, the number of examples and how independent they are from one another matter greatly.
There is a simple approximate rule: if no errors are observed in n trials assumed to be independent and identically distributed, an approximate one-sided 95% upper bound on the error probability can be taken as 3/n. For example, observing zero errors in 100 independent examples provides only a rough bound suggesting that the error probability is below about 3%; it does not prove zero risk. If the parts come from the same lot, have the same form of defect, or are very similar to one another, this approach may be overly optimistic.
Sampling design is as important as sample count for increasing statistical confidence. Rare but critical defects are evaluated separately; different product families, shifts, and borderline cases are represented in the test. The confidence required in demonstrating that the acceptance target is met must be established before testing begins.
What matters is the whole system keeping up, not just model speed
For a real-time production line, it is not enough to consider only how many milliseconds a model takes to predict on a GPU. Image acquisition, transfer from the camera, processing, delivery of the decision to the PLC, and movement of the physical diverter together make up the total time.
For example, suppose there is a 200-millisecond window to decide on a part and divert it. It is not possible to allocate all this time to the model. The graphic below shows an illustrative time budget. The figures are not measurements from any factory.
Although model inference takes 45 ms in this example, the other steps in the decision chain determine the total. More importantly, evaluate high-latency cases and failures rather than just average latency. If the system usually keeps up but occasionally falls behind, it may still be unreliable for production.
Also, do not confuse line speed with the interval between parts. Parts may arrive 100 ms apart but take 700 ms to reach the reject station; multiple parts are then in the processing pipeline at once. The right solution is not merely to process a single frame quickly, but to track part identities and the next action reliably.
Write the requirement together with how it will be tested
"High accuracy," "real-time operation," and "an easy-to-maintain system" are well-intentioned but unmeasurable statements. A requirement must include both what is expected and the test that will demonstrate it. For example, the following items could form an initial project draft:
| Draft requirement | Verification method |
|---|---|
| Every image must be matched to a product identity. | Trigger and product-tracking scenarios, lost-frame tests |
| Critical defects must be detected at a rate above a predetermined target. | An independent, representative, defect-specific test set |
| The false rejection rate for good products must not exceed the accepted limit. | Site testing across diverse shifts and lots |
| The system must make its decision on time at maximum line speed. | End-to-end timestamps and latency percentiles |
| Expected behavior during camera or network failures must be defined in advance. | Failure scenarios, event logs, recovery testing |
Target percentages and times should differ from project to project. A good specification does not copy ready-made numbers found online; it is justified by quality risk, production conditions, and measurements on site.
What is technically feasible is not always economical
Demonstrating that a defect can be detected is not enough to show that the investment makes sense. Cameras, optics, lighting, mechanical design, development, integration, data collection, operator training, and maintenance costs must be considered together. The scrap, rework, customer complaints, or manual inspection workload the system will reduce should be evaluated in the same analysis.
Sometimes a rare cosmetic defect that requires very expensive automation to detect can be reduced through a simpler process improvement. Conversely, if even a single missed critical defect can have very costly consequences, the case for investment may be strong. Making the right decision requires avoiding a premature commitment to either extreme.
When should development continue, and when should the direction change?
Rather than challenging the project with the same question at every stage, it is more useful to write down the evidence required to move forward. This approach helps allocate a limited budget to the right place earlier.
| Unanswered question | What is needed before proceeding |
|---|---|
| Which defect are we looking for? | An approved defect definition and borderline examples |
| Is the defect distinguishable in the image? | A repeatable imaging trial under different conditions |
| Can the selected method generalize? | Comparison using representative and independent data |
| Can the system keep up with the production line? | End-to-end timing measurements and stable product matching |
| Is it ready for production? | Acceptance tests, responsibilities, maintenance, and a rollback plan |
Read this table not as a bureaucratic checklist but as a tool for spotting costly mistakes early. For example, changing the lighting design first may be a much better investment than spending six months labeling data for a defect that is invisible in the image.
Let us think through an example from start to finish
Now let us return to the initial metal housing example. The business wants to automatically inspect particular surfaces of a CNC-machined part for scratches and dents. The initial request is "Let us find defects with a camera."
First, we learn how the quality decision is made. We see that marks on sealing surfaces and marks affecting external appearance do not have the same importance. With the quality team, we choose several good, defective, and borderline examples and clarify the acceptance criteria. We are not training a model yet.
Next, we conduct an imaging trial. The part is examined from different angles. A single overhead camera sees some regions but misses an edge. Surface glare under direct lighting hides fine marks. By trying different lighting angles and securing the part, we establish the basic imaging arrangement.
Then, we work out the production flow. The part moves along the belt, receives a trigger at a particular point, and is diverted farther downstream. Records, not just sequence order, verify which part the image belongs to. The production and automation teams agree on how the system should behave if the decision is late or an image cannot be acquired.
Now, we can compare methods. Is monitoring contrast changes in specific regions enough? Does classical image processing work? Does data diversity require a classification or anomaly detection method? We evaluate the options not just by test score, but also by explainability, data needs, latency, maintenance cost, and false rejection behavior.
Finally, we establish the acceptance plan. Instead of going live immediately after good initial tests, data is collected across different lots and shifts. Critical defect types are reported separately. Cases such as lost frames, a delayed reject signal, and a changed camera position after cleaning are also tested. Results are compared against the acceptance criteria; unmet points are recorded visibly.
In this example, the most beneficial decision may not be choosing the most complex model. Perhaps a second lighting angle, a correctly positioned fixture, or clarification of the quality standard will improve the entire system more. After all, the project's purpose is to solve a production problem, not showcase technology.
What should you have after the first site visit?
After a site discussion, returning with only an image folder and meeting notes is not enough. At a minimum, prepare an initial document on which agreement can be reached. It need not be very long; clearly showing unresolved points matters more.
A good initial document should answer these questions: Which products will be inspected, what counts as a defect, who makes the final quality decision, under what conditions will the product be imaged, how will we know which part an image belongs to, what do missed defects and false rejections cost, and which test will demonstrate success?
Missing answers must not be hidden. Writing "unknown," "site testing required," or "awaiting quality approval" makes project risks visible. This is not a technical weakness; it is a mature engineering approach.
The brief checklist below can be used for an initial meeting or discovery visit. I have also placed the detailed questions in an expandable section at the end of the page rather than scattering them through the article and interrupting its flow.
- The product family, variants, and defect types to be inspected have been defined.
- Acceptance/rejection criteria and borderline examples have been discussed with the person responsible for quality.
- Imaging angle, lighting, and motion conditions have been observed.
- Line speed, triggering, product identity, and the reject point have been established.
- Error types, business impacts, and success criteria have been distinguished.
- Responsibilities for data collection, prototyping, and acceptance testing have been assigned.
- Open questions and subsequent verification steps have been documented.
Conclusion: Make the problem visible first
In industrial image processing, the right method is sometimes a deep learning model, sometimes a few classical image processing steps, and sometimes a new camera angle. Which option is right becomes clear only after the real problem is understood.
This is why not spending all of the first weeks writing code is not a loss. Clarifying when a product counts as defective, understanding the physical conditions, ensuring that the decision applies to the correct part, and making success measurable prevent expensive corrections later.
A good industrial vision engineer does not only ask what is in the image. They also ask what production decision this finding becomes, how reliable that decision is, and what happens when it is wrong.
The natural next step is how to obtain images suited to these questions: selecting the camera, lens, lighting, and triggering. But now we know which part we are imaging and why. That knowledge is also the starting point for choosing the right hardware.