AIAIGuide
Machine Vision Project Planning for Facilities and Production
Machine vision can inspect products, read codes and count items consistently, but success depends on lighting, optics, mechanical setup and well-defined defects as much as on the AI model. This guide covers planning from feasibility to production.
- Published
- Updated
- Reading
- 4 minutes
- Prepared by
- EngineSpire Technologies
Key points
- Define what counts as a defect with example images and acceptance limits agreed with quality teams.
- Lighting and optics decide whether a defect is visible; no model can find what the image does not show.
- Run a feasibility test with real parts and line conditions before committing to a design.
- Use rule-based vision for measurable, consistent features and deep learning for variable appearance defects; many systems combine both.
- Validate with production samples, define how rejects are handled and monitor after go-live.
What machine vision is good at
- Checking presence or absence of components, labels and caps.
- Measuring dimensions, gaps and positions.
- Detecting surface defects such as scratches, dents and contamination.
- Reading printed text, barcodes and 2D codes such as lot numbers and expiry dates.
- Verifying assembly steps and orientation.
- Counting items on conveyors or in trays.
Define the problem precisely
- A defect catalog with images of each defect type and borderline examples.
- Acceptance criteria agreed with quality: what size or severity makes a part a reject?
- Line speed, parts per minute and how parts are presented to the camera.
- Product variation: colors, finishes, sizes and packaging changes.
- The current inspection method and how many defects escape it.
- The relative cost of rejecting good parts versus shipping bad ones.
Test feasibility first
Capture images of good and defective parts with candidate cameras, lenses and lighting. A simple test: can a person clearly see the defect in the captured image? If not, change the optics or lighting before thinking about software. Check that the smallest defect covers enough pixels to be detected reliably, and that exposure time is short enough to avoid motion blur at line speed, using strobed lighting if needed.
Hardware decisions
| Component | Decisions |
|---|---|
| Camera | Area scan or line scan, resolution, frame rate, color or monochrome |
| Lens | Field of view, working distance, depth of field, distortion |
| Lighting | Backlight for silhouettes, dome lights for shiny surfaces, low-angle light for scratches, coaxial light for flat reflective parts |
| Triggering | Sensors or PLC signals that fire the camera at the right moment |
| Enclosure and mounting | Protection from dust, water and ambient light; rigid mounts that resist vibration |
| Compute | Smart camera, industrial PC or edge server near the line |
Rule-based vision or deep learning
| Approach | Best for | Limitations |
|---|---|---|
| Rule-based tools | Measurements, edges, pattern matching, code reading | Struggles with natural variation in appearance |
| Deep learning classification or detection | Appearance defects that vary in shape and texture | Needs labeled images and careful validation |
| Anomaly detection | Rare defects, trained mainly on good parts | May flag harmless variation that needs review |
Data collection and labeling
- Collect images across shifts, batches, suppliers and seasons.
- Label with quality experts using written definitions, and check that labelers agree.
- Expect few defect examples; plan anomaly detection or targeted collection of defects.
- Keep a held-out test set that is never used for training.
- Version datasets and models together.
Integration with the line
- Signals to PLCs for reject mechanisms, with confirmation that rejected parts actually left the line.
- Results and images logged to quality or manufacturing execution systems.
- An operator screen that shows results and the reason for each reject.
- Operational technology network segmentation for cameras and vision computers.
- A latency budget that fits the time between image capture and the reject point.
Validate before switching over
- Test with reference sets of known good and known defective parts.
- Measure false rejects and escaped defects against the acceptance criteria.
- Run the same parts through several times to check repeatability.
- Run the system in shadow mode beside the current inspection before relying on it.
Running it in production
- Monitor reject rates and image quality, since lights age and lenses get dirty.
- Schedule cleaning and calibration checks.
- Retrain models through change control, with the held-out test repeated each time.
- Keep spare cameras, lenses and lights, and train operators and maintenance staff.
- If cameras capture people, for example in safety monitoring, handle the images as personal information.
Common questions
How many images do we need to train an inspection model?
It depends on defect variety, part variation and the approach. Anomaly detection can start mainly with images of good parts, while classifiers need enough labeled examples of each defect type. A feasibility study with your parts gives a realistic estimate.
Can machine vision replace manual inspection completely?
For well-defined, visible defects under controlled conditions, it can inspect every part consistently. Many sites still keep human checks for ambiguous cases, new defect types and periodic audits of the system's decisions.
Why do vision systems that worked in the lab fail on the production line?
Common causes are changing ambient light, vibration, variation in part position, dust on lenses and product variation missing from lab samples. Test in real line conditions and control lighting with enclosures.
Sources and further reading
- [1]AI Risk Management Framework — NIST
Need this applied to your environment?
We can turn this guide into a scoped assessment of your own sites, systems and constraints.
Keep reading
- AIBuilding a Secure Internal AI AssistantAn internal AI assistant that answers questions from company documents can save time, but it can also expose confidential information, invent answers or be manipulated. This guide covers architecture, permissions, prompt injection, evaluation and governance.4 min read
- AIAI Automation Opportunity Assessment: How to Prioritize WorkflowsThe best first automation projects are rarely the most impressive ones. This guide shows how to find candidate workflows, measure their current cost, score value against feasibility and risk, and choose a first project you can prove.3 min read
- AIDocument Processing with AI: Controls for Accuracy and ReviewAI can read invoices, forms and contracts far faster than people, but extracted data flows into payments, records and decisions. This guide covers document classification, confidence thresholds, validation rules, human review and audit trails.3 min read
