Chapter 13
System Engineering, Deployment, and Performance Analytics
Bachelor Program in Mechatronics Engineering
Machine Vision and Image Processing
•
Bachelor
System Engineering, Deployment, and Performance Analytics
Introduction
Machine vision becomes an engineering system—not merely an image-processing algorithm—when it is connected to production equipment, communicates decisions reliably, operates within time constraints, and remains maintainable throughout its life cycle. A camera may classify a component correctly in a laboratory yet fail on a factory line because of vibration, illumination drift, network congestion, product variation, cybersecurity weaknesses, or poorly defined acceptance criteria.
System engineering provides the disciplined process for converting an inspection need into a verifiable technical solution. It links requirements, optical design, image acquisition, algorithms, industrial control, data infrastructure, safety, cybersecurity, deployment, and economic justification. For mechatronics engineers, this integration is especially important because the vision system interacts with mechanical devices, sensors, actuators, programmable logic controllers (PLCs), robots, supervisory systems, and enterprise software.
This chapter presents a practical framework for specifying, designing, deploying, and evaluating machine-vision systems. It emphasizes measurable requirements, architectural trade-offs, performance analytics, reliability, governance, and return on investment.
Learning Objectives
After studying this chapter, students should be able to:
Translate an inspection or guidance problem into measurable system requirements.
Integrate vision systems with PLCs, robots, industrial networks, edge platforms, cloud services, and digital twins.
Analyze latency, throughput, accuracy, repeatability, availability, and maintainability.
Evaluate cybersecurity, safety, data governance, lifecycle cost, vendor alternatives, and return on investment.
Develop a deployment, validation, monitoring, and continuous-improvement plan.
1. Requirements Engineering for Vision Systems
1.1 From operational need to engineering specification
A requirement states what the system must accomplish, under what conditions, and with what degree of confidence. “Inspect parts using a camera” is not an adequate requirement. A stronger requirement is: “The system shall detect missing fasteners on 600 assemblies per hour, with a false-accept rate below 0.1%, while communicating a reject decision to the PLC within 150 ms of image exposure.”
Requirements should be:
Specific: describing the object, defect, action, and environment.
Measurable: including thresholds and units.
Traceable: linked to a business or process need.
Testable: verifiable by an agreed acceptance procedure.
Prioritized: distinguishing essential constraints from desirable features.
A requirements specification normally covers the following categories:
Category
Typical questions
Function
What must be detected, measured, located, or guided?
Product
What sizes, materials, colors, finishes, and variants occur?
Performance
What accuracy, speed, confidence, and false-decision rates are acceptable?
Environment
What temperature, dust, vibration, moisture, and electromagnetic interference exist?
Integration
Which PLC, robot, MES, database, or network must be used?
Safety
Can a wrong decision create a hazardous condition?
Data
What images, metadata, audit records, or models must be retained?
Lifecycle
Who will maintain the system, and for how many years?
Economics
What capital cost, operating cost, and payback are acceptable?
1.2 Acceptance criteria and traceability
Acceptance criteria should define the test population, test conditions, sampling plan, and pass/fail rules. For example, a system may be required to classify 1,000 known-good and 1,000 known-defective samples under normal production illumination. The specification should state whether performance is measured per image, per part, or per production batch.
A traceability matrix connects each requirement to a design element and a verification method. A requirement such as “reject a defective part” may trace to the image-processing model, PLC output, pneumatic rejector, and an end-to-end timing test. Traceability prevents the common error of validating the algorithm while neglecting the actuator or communication path.
2. Vision-System Architecture
A typical industrial vision system contains six functional layers:
Scene formation: object presentation, optics, illumination, enclosure, and mechanical fixturing.
Acquisition: camera, trigger, exposure control, and image transfer.
Computation: preprocessing, segmentation, feature extraction, machine learning, and decision logic.
Control: PLC, robot controller, motion system, reject mechanism, or process controller.
Information: historian, manufacturing execution system (MES), dashboard, database, or cloud platform.
Governance: safety, cybersecurity, configuration management, validation, and maintenance.
Figure: Functional layers of an industrial machine-vision system.
The architecture should distinguish hard real-time control from non-real-time analytics. A reject decision that must occur within a fixed cycle should normally be executed locally at the edge, whereas long-term trend analysis or model retraining may use a server or cloud platform. Sending every time-critical decision through a remote cloud introduces network and availability dependencies that are usually inappropriate for deterministic control.
3. Selecting Hardware and Software
3.1 Cameras, optics, and illumination
Camera selection begins with the required field of view, spatial resolution, exposure time, frame rate, spectral response, and interface. A line-scan camera is appropriate for continuous web products or rotating cylindrical surfaces; an area-scan camera is generally suitable for discrete parts. Monochrome cameras often provide greater sensitivity and simpler intensity analysis, while color cameras are necessary when color differences are functionally important.
The required pixel resolution depends on the smallest feature that must be distinguished. If a feature of physical size d must occupy at least n pixels, the approximate pixel pitch at the object plane should satisfy:
p ≤ d / n
Here, p is the object-space size represented by one pixel, d is the smallest relevant feature dimension, and n is the chosen number of pixels across that feature. This is a design guideline, not a complete detectability theorem. Lens quality, contrast, noise, focus, motion blur, and algorithmic performance also affect detection.
For a sensor with N horizontal pixels and object-space pixel pitch p, the field width W is approximately:
W = Np
The approximation assumes a sufficiently small perspective variation or a telecentric/controlled imaging arrangement. In perspective imaging, scale changes with depth, so calibration is necessary.
Motion blur can be estimated by:
b = v te
where b is blur distance, v is object velocity, and t_e is exposure time. Units must be consistent; for example, metres per second multiplied by seconds gives metres. If the allowable blur is b_max, exposure should satisfy t_e ≤ b_max/v. Stroboscopic lighting can permit a short effective exposure while maintaining adequate image brightness.
Lighting should be selected to maximize defect contrast and minimize sensitivity to uncontrolled environmental variation. Common arrangements include diffuse dome lighting, backlighting for silhouette measurement, coaxial lighting for flat reflective surfaces, low-angle dark-field lighting for scratches and edges, and structured lighting for three-dimensional shape.
3.2 Processing hardware
Processing platforms include smart cameras, industrial PCs, PLC-integrated vision modules, graphics-processing-unit (GPU) edge computers, and centralized servers. Selection depends on image size, model complexity, number of cameras, latency, environmental rating, maintainability, and software support.
A smart camera simplifies installation and often provides an integrated industrial interface. An industrial PC offers greater algorithmic flexibility and easier integration with multiple cameras. GPU hardware accelerates neural-network inference but may increase power consumption, cost, thermal requirements, and software complexity. The relevant performance measure is not a vendor’s peak computational rating alone; it is validated end-to-end performance on the actual image size and model.
3.3 Software architecture
Software should separate acquisition, preprocessing, inference, decision rules, communication, logging, and diagnostics. This modularity supports testing and replacement of components. A production model must be versioned together with its training data, preprocessing parameters, calibration, thresholds, and runtime dependencies.
Classical methods—thresholding, edge detection, morphology, template matching, and geometric measurement—remain valuable when appearance is controlled and explainability is important. Machine learning is advantageous when defects vary in shape or texture, but it requires representative data, annotation quality, drift monitoring, and controlled deployment.
4. Integration with Industrial Automation
4.1 PLC and robot integration
A common sequence is: the PLC detects a part, issues a trigger, the camera acquires an image, the vision processor evaluates it, and the result is returned to the PLC. The PLC then permits the process, activates a rejector, or sends a pose to a robot.
Signals should include more than a single pass/fail bit. A robust interface may contain:
trigger and acquisition acknowledgment;
busy, complete, and fault states;
inspection result and confidence or measurement values;
part identifier and recipe identifier;
communication timeout and watchdog status;
calibration or maintenance status.
For robot guidance, the vision coordinate frame must be related to the robot base or tool frame. Calibration may use a known target and estimate a transformation between coordinate systems. Errors can arise from lens distortion, camera mounting movement, robot repeatability, depth variation, and incorrect hand-eye calibration. A robot should not act on a pose unless the system confirms that the image, part identity, and calibration state are valid.
4.2 Industrial networks
Ethernet-based protocols, fieldbuses, and vendor-specific interfaces differ in determinism, bandwidth, diagnostic capability, and interoperability. A network design should document data ownership, update rates, addressing, time synchronization, segmentation, and failure behavior. The vision system should fail safely when communication is lost rather than silently producing stale results.
Time synchronization is important when correlating images with encoder positions, robot movements, and process events. Network time protocols can provide synchronization, but the required accuracy depends on the application. High-speed motion correlation may require hardware timestamps or deterministic industrial synchronization rather than ordinary enterprise time services.
4.3 Edge, cloud, and digital twins
Edge computing places acquisition and time-critical inference near the machine. It reduces latency, preserves operation during wide-area-network failure, and limits transmission of sensitive images. Cloud platforms provide elastic storage, fleet-level analytics, remote monitoring, and centralized model management, but introduce connectivity, governance, and cybersecurity considerations.
A digital twin is a computational representation linked to a physical asset or process. In machine vision, it may represent camera pose, lighting, product geometry, production state, or expected inspection results. A twin can support virtual commissioning, synthetic data generation, what-if analysis, and maintenance planning. It is not automatically accurate: the twin must be calibrated and its assumptions documented. Synthetic images should not replace validation on real production data.
5. Performance Analytics
5.1 Latency and throughput
End-to-end latency is the elapsed time between the relevant physical event and the completed control action. A useful decomposition is:
Each term must be measured or bounded under realistic load. Average latency alone is insufficient; percentile or worst-case latency may determine whether a part reaches the reject station before the actuator must respond.
If a system processes one independent inspection every T_cycle seconds, its theoretical service rate is:
R = 1 / Tcycle
where R is in inspections per second when T_cycle is in seconds. In a pipeline with parallel stages, throughput may be determined by the slowest stage rather than the sum of all stage times. If a conveyor carries parts at speed v and the usable spacing is s, the arrival rate is approximately:
λ = v / s
where λ is parts per second, v is metres per second, and s is metres per part. The system should have capacity above the arrival rate, with margin for bursts and recovery.
Worked example. A conveyor moves at 0.75 m/s and parts are spaced 0.15 m apart. The arrival rate is λ = 0.75/0.15 = 5 parts/s, or 300 parts/min. An inspection pipeline has an effective capacity of 6 parts/s. The nominal utilization is 5/6 = 0.833, or 83.3%. This may be acceptable for a stable process but leaves limited margin for retransmissions, reinspection, or temporary processing delays.
5.2 Classification performance
For a binary inspection, the confusion matrix contains true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN). Important measures are:
Accuracy = (TP + TN) / (TP + TN + FP + FN)
Precision = TP / (TP + FP)
Recall = TP / (TP + FN)
Accuracy can be misleading when defects are rare. Precision answers, “When the system declares defective, how often is that correct?” Recall answers, “How many actual defects are detected?” The appropriate balance depends on the cost of escapes, false rejects, rework, and customer risk.
Worked example. Suppose 10,000 parts contain 200 defective parts. The system detects 190 defects and incorrectly rejects 80 good parts. Then TP = 190, FN = 10, FP = 80, and TN = 9,720. Recall is 190/(190 + 10) = 95%. Precision is 190/(190 + 80) ≈ 70.4%. Accuracy is (190 + 9,720)/10,000 = 99.1%. The high accuracy does not eliminate the operational concern that nearly 30% of rejected parts are false rejects.
For continuous measurements, repeatability describes variation when the same item is measured repeatedly under unchanged conditions. Reproducibility concerns variation caused by changes such as operators, cameras, fixtures, or days. A measurement system study should separate equipment variation from part-to-part variation and compare measurement uncertainty with the engineering tolerance.
5.3 Reliability and availability
Availability is commonly defined as the proportion of scheduled time during which the system is operational:
A = MTBF / (MTBF + MTTR)
MTBF is mean time between failures and MTTR is mean time to repair, both expressed in the same time unit. This simple model assumes repairable equipment, statistically stable failure and repair behavior, and no distinction between partial and complete performance. For example, MTBF = 1,000 h and MTTR = 5 h give A = 1000/1005 ≈ 99.50%.
Availability should be analyzed by subsystem. A camera may be available while the lighting controller, network, model service, or reject mechanism is unavailable. Maintenance indicators include mean time to detect, mean time to recover, spare-part lead time, calibration interval, and percentage of failures caused by configuration changes.
6. Validation, Deployment, and Lifecycle Control
Deployment should proceed through controlled stages:
Concept validation: prove that the visual feature is observable under realistic conditions.
Prototype: test optics, lighting, acquisition, and algorithms on representative samples.
Pilot: operate alongside the existing process without controlling production.
Qualification: verify requirements, safety, timing, performance, and maintainability.
Production release: approve software, model, configuration, drawings, and operating procedures.
Monitoring: track drift, false decisions, downtime, and user interventions.
Change control: reassess the system after product, lighting, software, or process changes.
A validation data set should be independent of training data and should include normal variation, borderline cases, rare defects, new batches, orientation changes, contamination, and realistic environmental conditions. Performance must be reported with the operating threshold and test prevalence; otherwise comparisons can be misleading.
Model monitoring should detect data drift, concept drift, sensor degradation, and changes in defect prevalence. Retraining should be governed rather than automatic. Each new model requires version identification, regression tests, approval, rollback capability, and an updated record of known limitations.
7. Cybersecurity, Safety, and Governance
A connected vision system expands the attack surface of a production cell. Basic controls include asset inventory, network segmentation, least-privilege accounts, strong authentication, secure remote access, patch management, encrypted communication where appropriate, backup and recovery, logging, and removal of unused services. Industrial systems require special care because uncontrolled patching can interrupt validated production or affect real-time behavior.
Cybersecurity does not replace functional safety. A vision result should not be the sole safeguard against access to hazardous machinery unless the complete safety design has been assessed using applicable machinery-safety principles and validated safety-related components. Emergency stops, guards, safety-rated scanners, and interlocks must remain independent where required.
Governance issues include ownership of images, retention periods, employee privacy, use of facial or biometric data, intellectual property in training data, auditability of AI decisions, and supplier access. Organizations should define who may view images, how long records are retained, how models are approved, and how incidents are investigated.
8. Vendor and Architecture Evaluation
Vendor selection should compare complete lifecycle value rather than purchase price alone. Relevant criteria include optical and computational performance, supported protocols, environmental ratings, documentation, training, local service, spare-part availability, software licensing, cybersecurity posture, data portability, and migration risk.
A weighted decision matrix can make priorities explicit. If criterion i has weight w_i and vendor score s_i, with weights normalized so that ∑w_i = 1, the weighted score is:
S = ∑(wi si)
Scores are meaningful only when the criteria, scales, evidence, and evaluators are documented. A high total score should not override a mandatory failure such as inability to meet a safety or timing requirement.
Lifecycle cost includes acquisition, integration, training, installation, energy, licenses, maintenance, calibration, downtime, cybersecurity, upgrades, and disposal. A simple total-cost model is:
The terms represent costs over the selected analysis period, and V_residual is recoverable residual value. Costs should be discounted when comparing investments over several years; a nominal sum is only a simplified estimate.
For a basic investment calculation:
ROI = (B − C) / C × 100%
B is the quantified benefit over the chosen period and C is the investment cost over that same basis. Benefits may include labor reduction, reduced scrap, fewer warranty claims, increased throughput, and avoided downtime. Payback period is approximately investment divided by annual net cash benefit, but this measure ignores benefits after payback and the time value of money.
An illustrative automotive subassembly line produces 420 units per hour. Each unit requires inspection of four fasteners. Missing or incorrectly seated fasteners can create a costly downstream failure. Operators currently perform a visual check, but fatigue and inconsistent lighting produce escapes.
Problem
The proposed system must inspect every unit, provide a decision within 250 ms, achieve at least 99% recall for missing fasteners, and maintain false rejects below 2%. The system must interface with an existing PLC and reject station.
Analysis
The required production rate is 420/60 = 7 units/min, or 0.1167 units/s. The maximum average interval between units is approximately 1/0.1167 = 8.57 s, so raw throughput is not demanding. However, the 250 ms decision requirement and reliable synchronization with the reject station are critical. Backlighting and controlled diffuse illumination are selected after trials show that fastener presence creates a stable geometric contrast. A monochrome area camera is sufficient, reducing unnecessary color-processing complexity.
Approach and solution
A photoelectric sensor triggers image acquisition. The edge computer performs geometric localization followed by a trained classifier for ambiguous seating conditions. The PLC receives inspection ID, result, confidence, completion, and fault status. A watchdog marks the result invalid if the response exceeds 200 ms, leaving margin before the 250 ms requirement. Images of failures and a statistically selected sample of passes are stored locally and transferred to a central server when bandwidth is available.
Qualification uses separate samples from multiple production lots, including clean, contaminated, rotated, and borderline assemblies. A golden reference artifact is checked at the start of each shift. The system is placed in a segmented industrial network, and remote maintenance requires authenticated, logged access.
Outcome
During a four-week pilot, the system detects 99.5% of known missing-fastener cases and produces 1.3% false rejects. Mean response time is 118 ms, with the 99th percentile at 171 ms. The pilot also reveals that dust on the protective window causes gradual confidence reduction. A cleaning interval and a low-confidence maintenance alarm are added before production release.
Learning points
The case demonstrates that algorithm accuracy alone is not system performance. Triggering, timing, reject synchronization, cleaning, data retention, network design, and maintenance procedures are part of the engineered solution. The pilot also shows why percentile latency, independent validation data, and environmental drift testing are necessary.
10. Contemporary Developments and Best Practices
Current systems increasingly combine classical vision with deep learning, 3-D sensing, event-based cameras, and edge accelerators. These technologies are useful when they solve a documented problem, not simply because they are newer. Explainable measurements may be preferable for dimensional compliance, while deep learning may be appropriate for variable cosmetic defects.
Best practice is to:
control the scene before increasing algorithmic complexity;
define requirements in measurable operational terms;
design for deterministic local control and resilient data services;
validate the complete sensor-to-actuator chain;
report confusion-matrix measures with operating conditions;
monitor drift, latency, uptime, and false decisions after deployment;
version models, data, calibration, and software together;
provide bypass, fallback, and safe-state behavior;
evaluate lifecycle cost and supplier dependence;
train operators and maintenance personnel before handover.
Chapter Summary
Machine-vision deployment is a systems-engineering activity involving scene formation, image acquisition, computation, control, information management, and governance. Effective requirements specify function, operating conditions, performance, interfaces, safety, data, lifecycle, and economics. Hardware selection must consider optics, illumination, resolution, motion blur, interfaces, environmental conditions, processing load, and maintainability.
Industrial integration requires deliberate coordination with PLCs, robots, networks, edge computers, cloud platforms, and digital twins. Time-critical decisions should generally remain local and deterministic, while cloud services are valuable for storage, fleet analytics, and controlled model management. Performance analysis must distinguish latency, throughput, accuracy, precision, recall, repeatability, reliability, and availability. Confusion matrices reveal errors that aggregate accuracy can conceal.
Validation continues throughout the lifecycle. Pilot testing, independent data, drift monitoring, model versioning, cybersecurity, functional safety, and change control are essential. Vendor selection should use documented criteria and lifecycle cost rather than purchase price alone. Finally, economic justification should include measurable benefits, investment cost, downtime, maintenance, risk, and long-term value.
Key Terms
Requirements engineering: The disciplined process of defining, tracing, and verifying system needs.
Acceptance criterion: A measurable condition used to determine whether a requirement has been satisfied.
Field of view: The physical region visible to the imaging system.
Object-space pixel pitch: Physical distance represented by one image pixel at the object.
Motion blur: Image displacement caused by object motion during exposure.
Edge computing: Processing performed near the machine or data source.
Digital twin: A computational representation linked to a physical asset or process.
Latency: Time between an initiating event and the resulting system action.
Throughput: Number of inspections or parts processed per unit time.
True positive: A defective or positive case correctly identified as positive.
False positive: A negative case incorrectly identified as positive.
Precision: Fraction of positive decisions that are correct.
Recall: Fraction of actual positive cases detected.
Repeatability: Variation under unchanged measurement conditions.
Availability: Proportion of scheduled time that a system is operational.
MTBF: Mean time between failures.
MTTR: Mean time to repair.
Lifecycle cost: Total cost of acquisition, operation, maintenance, downtime, and retirement.
Model drift: Change in data or process conditions that reduces model performance.
Traceability matrix: Table linking requirements to design elements and verification evidence.
Review Questions
Short Answer Questions
Why is “inspect parts using a camera” an inadequate engineering requirement?
Distinguish precision from recall in a binary inspection system.
Why should a time-critical reject decision normally be executed at the edge?
What is the difference between repeatability and reproducibility?
Identify four cybersecurity controls relevant to an industrial vision system.
Long Answer Questions
Explain how optics, illumination, camera selection, and processing hardware should be selected as one integrated design problem.
Describe a complete validation and deployment pathway from prototype to production release.
Discuss the roles and limitations of PLCs, robots, industrial networks, edge platforms, cloud services, and digital twins.
Explain why accuracy alone is insufficient for evaluating a machine-vision classifier.
Develop a framework for comparing two competing vision-system vendors using technical, operational, cybersecurity, and economic criteria.
Analytical / Application Questions
A conveyor moves at 0.60 m/s and parts are spaced 0.12 m apart. Calculate the required arrival rate in parts per second and parts per minute. If an inspection system can process 4.5 parts/s, assess whether it has sufficient nominal capacity.
In a test of 5,000 parts, 100 are defective. The system detects 96 defects and falsely rejects 75 good parts. Calculate recall, precision, and accuracy. Which metric most directly describes the risk of escaping a defect?
A proposed system costs $48,000 and is expected to generate $18,000 in annual net benefit. Estimate simple payback time and discuss at least three factors that could make the estimate unreliable.
Multiple Choice Questions with Answers
Question 1
Which requirement is most suitable for formal acceptance testing?
A. The camera should provide excellent images.
B. The system shall detect missing fasteners at 600 assemblies per hour with recall of at least 99%.
C. The software should be modern and flexible.
D. The operator should find the system easy to use.
Correct Answer: B. The system shall detect missing fasteners at 600 assemblies per hour with recall of at least 99%.
Question 2
A part moves at 0.5 m/s and the allowable motion blur is 0.25 mm. What is the maximum exposure time?
A. 0.05 ms
B. 0.5 ms
C. 5 ms
D. 50 ms
Correct Answer: C. 5 ms
Question 3
Which metric answers the question: “Of all actual defects, what fraction did the system detect?”
A. Accuracy
B. Precision
C. Recall
D. Availability
Correct Answer: C. Recall
Question 4
A system has MTBF of 900 h and MTTR of 10 h. Using A = MTBF/(MTBF + MTTR), its availability is approximately:
A. 89.0%
B. 98.9%
C. 99.9%
D. 90.0%
Correct Answer: B. 98.9%
Question 5
Which task is generally most appropriate for a cloud platform rather than a hard-real-time edge controller?
A. Immediate activation of a reject actuator
B. Emergency-stop processing
C. Long-term fleet-level trend analysis
D. Camera exposure synchronization
Correct Answer: C. Long-term fleet-level trend analysis
Question 6
What is the principal purpose of a requirements traceability matrix?
A. To increase camera resolution automatically
B. To link requirements with design elements and verification evidence
C. To replace functional safety analysis
D. To eliminate the need for acceptance testing
Correct Answer: B. To link requirements with design elements and verification evidence
Question 7
A conveyor speed is 0.75 m/s and part spacing is 0.15 m. What is the nominal arrival rate?
A. 0.20 parts/s
B. 5 parts/s
C. 11.25 parts/s
D. 50 parts/s
Correct Answer: B. 5 parts/s
Question 8
Why can overall accuracy be misleading in a defect-inspection application?
A. Accuracy cannot be calculated from a confusion matrix.
B. Accuracy ignores all true negatives.
C. A large number of good parts can hide poor detection of rare defects.
D. Accuracy is measured only in milliseconds.
Correct Answer: C. A large number of good parts can hide poor detection of rare defects.
Question 9
Which design choice best supports safe behavior during loss of communication with the PLC?
A. Continue using the last inspection result indefinitely.
B. Silently discard communication errors.
C. Use a watchdog and transition to a defined invalid or safe state.
D. Increase image brightness automatically.
Correct Answer: C. Use a watchdog and transition to a defined invalid or safe state.
Question 10
Which item should be included in lifecycle cost evaluation?
A. Only the initial camera purchase price
B. Only annual software licensing
C. Acquisition, integration, maintenance, downtime, and retirement costs
D. Only the algorithm developer’s salary
Correct Answer: C. Acquisition, integration, maintenance, downtime, and retirement costs
Machine Vision and Image Processing
Chapter 13
of 14