Software engineering · Moving into production

Designing a Computer Vision System: Edge AI and Pipeline Architecture

A two-camera inspection station traces the flow from camera triggering to PLC acknowledgement. The article separates frame and product identity, defines module boundaries and compares queues, backpressure and edge, server and cloud deployment. Connection loss, storage, backup and maintenance handover scenarios show how tests and traceable records support architectural decisions.

Article sectionsWhat is the actual system in a computer vision project?What should be defined before turning the problem into a hardware list?Why should camera images and product events be kept separate?What do the layers in a modular architecture do?How do you choose between Edge AI, an on-premises server, and the cloud?Which communication method suits the data flow?How do you establish a budget for real-time decisions?Why should product matching not rely on FIFO alone?How do queue design and backpressure work?Memory, buffers, and copying costsHow should system error states be classified?The relationship between technical debt and operating costsWhat is a dependency matrix for?Example field scenario: 100% inspection with two camerasHow do we document architectural decisions?How is the architecture's physical layout determined?How are availability and resilience measured?What happens when a retry policy is implemented incorrectly?What data should the storage architecture retain?How the design will be tested should be decided at the very first meetingWhen should a technology decision be revisited?How many cameras and lines should scalability planning cover?Business continuity: spare devices and restorationAn example monitoring dashboard for system metricsThe connection between data retention and retrainingQuestions to ask in an architectural decision reviewAn example decision for approving an architecture for productionThe final rehearsal before handing over a vision stationFrequently asked questions

What is the actual system in a computer vision project?

An image processing project on a production line often starts with the idea of "let's buy a camera and run the model." Yet the ultimate expectation is not to classify an image: it is to inspect the right product, at the right time, using the right mechanism. From the camera being triggered to the PLC receiving the result, numerous physical and software components work together. Each may behave correctly on its own while the overall system produces an incorrect decision.

Suppose we are detecting burrs on metal flanges. The model catches 99% of defects in laboratory images. Now imagine that decisions return in a different order when parts get close together during production: the result for product 106 may arrive before the result for 105. An output connection based only on sequence information applies a correct model prediction to the wrong part. This is why product identity, timing, and error behavior are just as important as model accuracy.

System architecture defines how events are generated, how images are transported, which module makes which decisions, and how the system behaves when a connection fails. Good architecture does not have to be complicated. What matters is that every critical assumption in the process is explicit, measurable, and testable.

End-to-end data flow from image to production decisionThe raw image and product identity travel together.TriggeringCamera + lightingPreprocessingModel / ruleDecision + PLCLogging / monitoring
Figure 1. The raw image and product identity travel together.

What should be defined before turning the problem into a hardware list?

First, define the production objective. Will every part be inspected, or will inspection use sampling? Which defects warrant rejection? Will multiple images of a product be captured at the same time? Who has the final say when operators disagree? How many products arrive on the line per hour, and what is the shortest interval between two parts? These questions directly influence the rest of the design. A request for a "60 FPS camera" is not a business requirement on its own.

In a measurable example, the camera and product diverter are 400 mm apart, and the belt moves at 800 mm/s. The physical window is therefore approximately 500 ms. The algorithm, communication, queuing, and mechanical response must all fit within this time. However, this value is only an example; conveyor speed variations and product position tolerances must be measured on the actual line. Without a clear timing requirement, the CPU/GPU budget cannot be calculated correctly.

Requirements should be divided into separate categories: quality objectives, maximum decision time, data retention period, failure policy, environmental conditions, access permissions, and maintenance expectations. Who will verify each requirement and how it will be tested should also be documented. Instead of "the system will be reliable," use testable statements such as "no unmatched product decisions will occur during a 24-hour load test."

Why should camera images and product events be kept separate?

A product may not correspond to a single frame. Systems using two cameras, different lighting arrangements, or multiple exposures of the same product have many images for one physical object. Therefore, frame_id can identify just the image, capture_event_id the image acquisition event, and product_id the physical product. These identifiers should be designed around the production line's actual setup.

An event record should include, at a minimum, the source camera, trigger time, product/sequence information, image format, model version, prediction, decision, error code, and PLC acknowledgment. Reusing the last valid frame when an image is missing is dangerous. A missing capture, a late result, and an ambiguous match should be represented as separate error states. This makes production records auditable after the fact.

Expressing a decision only as OK or NG is insufficient for some processes. UNKNOWN, TIMEOUT or INCOMPLETE_CAPTURE are examples of states that may be included in the production interface contract. How the PLC handles these states must be determined through process and safety analysis; a software developer should not independently assume a safe rejection/shutdown policy.

What do the layers in a modular architecture do?

The camera adapter receives frames and metadata from the physical device. The preprocessing component performs operations such as ROI selection, color conversion, geometric correction, and resizing. The model execution component generates predictions; the decision component evaluates those predictions against the product family, tolerances, and business rules. The PLC adapter transmits the result using the communication contract expected by the machine. The logging and observability layer enables retrospective event analysis.

These boundaries do not imply a requirement for separate microservices. Using modular components within a single process at one station can reduce copying and simplify deployment. Separate processes may make sense when independent scaling is necessary or teams need to work with different versions. Latency, maintenance capacity, fault isolation, and version dependencies should all be considered together when choosing.

Application layers and boundariesEach layer's behavior when a connection fails is defined in advance.Production layer: PLC, sensor, rejection mechanismAcquisition layer: driver, SDK, GenTL, timestampProcessing layer: preprocessing, model, thresholdApplication layer: event, log, HMI, MES
Figure 2. Each layer's behavior when a connection fails is defined in advance.

If changing the camera brand also requires changing the PLC protocol, responsibilities have not been separated well. Similarly, storing the model threshold in the reporting service makes decisions harder to reproduce. Defining a single source of truth for each variable and linking version information to events makes the system easier to maintain.

How do you choose between Edge AI, an on-premises server, and the cloud?

Edge AI is an approach in which images are processed on a device close to the machine. It can provide low network dependence and predictable latency, but the device has limited power, memory, and cooling capacity. An on-premises server can offer shared GPU use and centralized maintenance, while a network failure may affect multiple lines. The cloud is flexible for centralized archiving, retraining, and batch analysis; however, making a physical reject valve's time-critical decision dependent on an external connection is an unnecessary risk in most applications.

Edge, on-premises, and cloud optionsThe choice is not based on model speed alone.EdgeLow network dependenceLimited device resourcesOn-premises serverCentralized maintenanceNetwork latency and a singlepoint of failureCloudFlexible workloadsExternal network, cost, and datapolicy
Figure 3. The choice is not based on model speed alone.

A hybrid architecture can be a good option: product acceptance/rejection decisions are made at the edge; selected images, performance measurements, and event records are sent to a central system under an appropriate policy. Under what conditions can edge decisions continue when the network fails? In what order are records transferred when the central connection is restored? What happens when the disk is full? Each of these questions belongs in the architectural decision document.

Making a design "future-ready" does not always mean adding more services. If the initial installation has one camera, adding unnecessary distributed complexity because there might be ten cameras in five years can increase the maintenance burden. Identifying components likely to change and keeping interfaces stable is generally a better engineering decision.

Which communication method suits the data flow?

Camera streams, low-volume status queries, and MES reporting do not have the same data profile. An SDK buffer, shared memory, or a dedicated streaming mechanism may be appropriate for high-frequency raw frames. An HTTP API can be considered for configuration queries, the designated PLC protocol for machine automation, and a message queue for archiving and monitoring. Forcing all components to use a single communication technology can introduce unnecessary conversion and latency.

An event-driven design can use states such as CaptureRequested, FrameCaptured, InferenceCompleted and DecisionAcknowledged. However, duplication, reordering, and timeouts are inherent possibilities in distributed messaging. These must be addressed using product IDs, sequence numbers, idempotent operations, and event validity periods. In particular, a duplicate PLC message must not trigger the same physical valve action a second time.

Sometimes a single job queue is enough. Sometimes a shared-buffer strategy is necessary because moving images between the CPU and GPU increases the cost of additional copies. Making either "event-driven" or "microservices" a design goal before measuring the decision workload is not a good starting point.

How do you establish a budget for real-time decisions?

A model running in 18 ms does not mean the system's total latency is 18 ms. Exposure, camera transfer, decoding, preprocessing, CPU-GPU copies, inference, postprocessing, decision rules, and PLC transmission times accumulate to produce latency. Some stages can run in parallel, while others necessarily wait for a preceding stage. First define the flow's start and end points, then timestamp the individual stages.

In an example budget, 4 ms of exposure, 8 ms of transfer, 6 ms of preprocessing, 18 ms of inference, 4 ms for the final decision, and 12 ms of PLC transfer add up to 52 ms. This total excludes queuing, jitter, and the valve's physical response. If a change is claimed to have made the system faster, compare both p50 and p95/p99 latency, as well as behavior during extended operation without production interruptions.

Example processing timeline for an individual productExample total: 52 ms; excluding queuing and actuator response.Exposure: 4 msTransfer: 8 msPreprocessing: 6 msInference: 18 msDecision: 4 msPLC transmission: 12ms
Figure 4. Example total: 52 ms; excluding queuing and actuator response.

Why are throughput and latency reported separately?

In a pipeline, the model can process the first product while the camera captures the second. This parallelism increases the number of jobs completed per second, but the total time between image acquisition and the result for one product may not decrease proportionally. Increasing batch size can improve GPU efficiency while increasing latency because the first product must wait for the batch to fill. Thus, a result of "100 images per second" does not mean "each image completed in 10 ms."

Why should product matching not rely on FIFO alone?

Let two products be captured in order, A then B. Suppose the model takes 42 ms for A because of a complex defect in its image, and 18 ms for B. In an asynchronous system, B's result may finish first. Software that distributes decisions based on order can apply B's result to A. This is an integration error, distinct from a model error; high accuracy does not reveal it.

A join key for identifying the correct product might combine the trigger event, product sequence number, physical carrier ID, and camera identity. The key under which the PLC accepts the final decision must be tested. If the key is lost, the system should produce a state that prevents an incorrect match rather than guessing.

An event message that preserves product identityThe same ID is written to both the production decision and the quality record.Line / stationProduct IDTrigger timeImage IDDecision + confidenceModel version
Figure 5. The same ID is written to both the production decision and the quality record.

Alongside the product trace, retain the model version, processing configuration, timestamp, and a link to an evidence image, if available. Retaining all raw images indefinitely may not be necessary; the retention policy is defined according to defect criticality, data volume, and the business's traceability needs.

How do queue design and backpressure work?

If the camera produces 60 frames per second and the processing service produces 55, the average input rate exceeds the output rate. An unbounded queue hides the short-term problem but causes decisions to arrive progressively later. The behavior when a bounded queue overflows must be explicit: the line can be slowed down, products can be routed for separate inspection, or certain images can be skipped if the process allows it. When quality inspection is mandatory for every product, silently dropping frames is generally unacceptable.

Per-product performance and overall throughput are different measuresValues are illustrative products/second; higher throughput does not guarantee lower latency.Sequential individual processing25Asynchronous stages54Batch workload processing85
Figure 6. Values are illustrative products/second; higher throughput does not guarantee lower latency.

Queue growth is not caused only by differences in average rates. GPU heating, disk writes, bulk network transfers, or resource consumption by other processes can create temporary backlogs. Metrics to monitor include queue length, the age of the oldest job, stage durations, and whether results exceed the product's decision validity window.

Memory, buffers, and copying costs

If raw images are copied from the camera SDK into another object, then into a CPU tensor, and then into GPU memory, data movement can cost more than expected. Zero-copy and similar techniques can reduce copying on suitable hardware and APIs, but incorrect buffer ownership and lifetime management can cause corrupted data or race conditions. Ignoring memory safety for performance is not acceptable.

When two model services need access to one GPU, memory allocation, runtime contexts, and priorities must be defined. Even if the model weights occupy 600 MB, total VRAM use can be higher because of activation tensors, batches, and workspaces. Effects of extended operation, such as heating and memory fragmentation, may not appear in a short benchmark.

How should system error states be classified?

Conditions such as a camera not being found, the GPU failing to allocate memory, the PLC not responding, and the MES being temporarily offline must be distinguished. When no image arrives, an old decision must not be resent, and a late result must not be assigned to another product. A brief MES connection outage, on the other hand, can be handled as a scenario in which local decisions continue uninterrupted while records are queued, if the process allows it.

Failure behavior: startup, operation, shutdownSafety functions must remain in the certified control system.Camera unavailableNo-image eventControlled line decisionGPU memory errorProcessing stopsCritical alarm / rollbackMES offlineCan decisions continue independently?Queuing and logging policy
Figure 7. Safety functions must remain in the certified control system.

A watchdog should check not only whether a process is alive but also how recent the last successful image acquisition, decision generation, and PLC acknowledgment are. However, a watchdog is general-purpose control software; emergency-stop and protective-equipment functions related to human safety must remain in an appropriately certified industrial safety system. This boundary must be explicitly verified during acceptance testing.

Why is fault injection necessary?

Briefly disconnecting the camera network, sending two triggers at once, delaying a result message, shutting down the MES, or restarting the device reveals the system's real resilience. The outcome is not simply whether the software crashed. Did the operator see the correct alarm? Was a product's inspection status left uncertain? Was an old product's result reused when the system restarted? Each of these must be tested.

The relationship between technical debt and operating costs

Keeping all parameters in one file is quick for a prototype. In production, allowing a field operator to change that same file may cause the model threshold to shift unnoticed. Versioning the configuration, applying critical changes with approval, and retaining before-and-after test reports makes maintenance costs more predictable.

Security considerations such as the retention policy for actual product images, network segmentation, user roles, and access logs should also be considered from the first release. Adding encryption or authentication later can lead to much more expensive changes in a system integrated with a physical production line.

What is a dependency matrix for?

In system design, a matrix can show each module's dependencies on the camera SDK, runtime, PLC, and MES. If changing models also requires changing the camera interface, architectural boundaries are not sufficiently separated. Similarly, if PLC decisions cannot be generated when the reporting service stops, the reporting layer may be creating an unnecessarily strong dependency.

Dependency matrixHigh dependency expands the failure domain.ModuleSDKModelPLCMESImage acquisition✓———Decision service✓✓✓—Reporting———✓
Figure 8. High dependency expands the failure domain.

Updating this kind of matrix after every change provides important information for the future team. Dependencies may include not just code calls but also driver versions, hardware ports, licenses, and network access permissions. The effect of each additional dependency on the failure domain must be determined.

Example field scenario: 100% inspection with two cameras

Suppose a station inspects metal parts with top and side cameras. A combined decision is produced when both frames for product 1001 arrive. If the top camera is unavailable, the decision is INCOMPLETE_CAPTURE; the model does not issue a definitive non-defective decision using only the side image. To link the two results, product_id=1001 and the camera identities are used. If the decision is not completed on time, the PLC is notified of a predefined invalid/review state.

In the initial test, the system may only log decisions in shadow mode. A controlled pilot with the actuator follows. During acceptance testing, reflections, consecutive products, high line speed, a single-camera failure, and extended operation are tested as separate scenarios. Shadow mode does not replace testing the actual valve's movement.

How do we document architectural decisions?

Keeping a short architectural decision record (ADR) is a good habit: document the problem, options, rationale for the choice, accepted risks, and when the decision should be reconsidered. A record such as "a modular monolith for a single station; network-based service separation will be reconsidered if deployment expands to a second facility" tells a future team not just what was done but why.

Deployment validation stagesEvery transition requires measurable evidence.LaboratoryShadow modeControlled pilotAcceptance testingMonitoring / rollback
Figure 9. Every transition requires measurable evidence.

The operations document should include the startup sequence, version information, camera/PLC connection verification, alarm codes, emergency change procedure, authorized users, and rollback steps. This prevents the system from depending on a single developer's memory.

How is the architecture's physical layout determined?

The layout drawing should show the camera, lighting, trigger sensor, edge computer, PLC, product diverter, HMI, and network connections together. The abstract pipeline in the developer's mind and the machine seen by maintenance staff are different things. A camera cable affected by machine movement, the temperature in the PLC cabinet, or camera lighting that changes with mechanical vibration can cause performance problems that cannot be explained at the software layer. The initial architecture diagram must therefore also be a physical connection diagram.

For example, suppose the camera is 20 meters from the PLC cabinet and connected over GigE. Even if the physical connection distance appears suitable, packet loss or jitter can occur when cameras share a switch with heavy unrelated traffic. Conversely, using a separate NIC for each camera does not reduce overall memory and CPU resource use; it only separates some network bottlenecks. The system layout must be validated on site for cable routing, electrical interference, and safe maintenance access.

The architectural plan should show each device's source, power requirements, and connection point. It should explain how the IP settings, camera calibration, and timestamp configuration are restored when a spare device is installed. This requirement helps ensure not just hardware replacement but unchanged quality decisions when maintenance is performed years later.

How are availability and resilience measured?

A vision station's availability is not simply the percentage of time its computer stays on. If the camera acquires images and the model runs but the PLC does not accept the decision, the station is functionally unavailable. Therefore, end-to-end availability must be defined: a valid image and timely decision for every expected product, the result matching the corresponding physical product, and the required record being created. If any of these conditions is not met, the product's inspection status must be shown separately.

MTBF and MTTR can inform maintenance planning, but they should not be calculated with false precision from a small number of failures. Failures do not have equal impact: sending data to the MES late may be tolerable for a few minutes, while products passing with the camera off may be unacceptable. Service-level indicators should therefore measure not only module health but also the availability of quality decisions.

An acceptance report might include observations such as "zero image losses in 10,000 triggers," "late decisions reported with an explicit code," and "no old decisions reapplied during restart." These can be defined as targets before actual measurement; in the results section, estimated and measured values must be distinguished.

What happens when a retry policy is implemented incorrectly?

When a network request times out in a distributed system, the recipient may have processed the message but failed to return the acknowledgment. If the sender transmits the same decision again, the PLC or decision service may mistake it for a new product event. This is why the following actions must not be treated as equivalent: resending a message, repeating the physical operation. Duplicate messages must be safely recognized using product identity, decision sequence number, and acceptance status.

The number of retries must be limited. Otherwise, thousands of messages may be retried while the PLC connection is down, and old decisions may be sent all at once when the network recovers. Results must have a validity period, and decisions whose time window has expired must be treated as invalid. Discarding an invalid decision is different from deleting the product's quality status from the record: the audit trail must preserve why that product could not be inspected.

Where the "last processed event" information is stored matters during restart. If a counter held only in RAM resets, the new session may reuse old IDs. With multiple stations, collisions should be prevented using a station identity or unique session information. This prevents different products with the same number from being mixed up in the records.

What data should the storage architecture retain?

Raw frames, processed images, model scores, and production decisions have different retention needs. Writing every frame to disk at high quality may initially seem like a good evidence policy, but continuously recording high-resolution data from four cameras quickly consumes storage and network capacity. Selective recording can focus on critical defects, uncertain results, random quality samples, and error states. However, production traceability requirements determine which records are mandatory.

For example, recording a 3 MB raw frame 30 times per second produces approximately 5.4 GB per minute and 324 GB per hour. Actual file size varies with compression and format; calculating the cost of raw recording early is still important. Latency may also be affected if disk writes share the same I/O path as inference.

The recording policy may cover retention periods, access permissions, data cleanup, file integrity, and generating hashes for evidentiary purposes. In particular, if records awaiting processing during a production stoppage are held in memory or a durable queue, alarms and controlled behavior for a full disk must be defined.

How the design will be tested should be decided at the very first meeting

Once the architectural drawing is ready, rather than proceeding straight to coding, a test matrix can be created. Rows cover the camera, product identity, model, PLC, and logging; columns cover normal operation, heavy load, connection loss, duplication, and restart. An observable expected outcome is written for every cell. This approach demonstrates that the design addresses unexpected events as well as the successful happy path.

For example, if two cameras return results for the same product at different times, a maximum waiting time for combining them is needed. If what happens to a product with an incomplete image set after that interval is unclear, the architectural decision is incomplete. In another example, when a PLC ACK message is delayed, the application must behave so that the same physical rejection action is not triggered again. This behavior can be tested with an emulator and later with the actual PLC.

Test responsibilities must also be assigned. The software team verifies log integrity, the automation team verifies physical valve timing, the quality team verifies defect acceptance criteria, and the information security team verifies access boundaries. Results are accepted with separate evidence rather than collapsed into a single "successful test" label.

When should a technology decision be revisited?

Using one computer may be appropriate for the initial installation, but shared GPU capacity may become insufficient as the number of cameras or lines grows. Similarly, while a message queue may be unnecessary at one station, an event-driven structure can become valuable when ten independent stations need centralized observability. It is healthier to regard architecture as a set of conditional decisions rather than fixed dogma.

Triggers for reassessment can be added to the decision record: an increased camera count, a p99 limit violation, the impact scope of a single failure, growth of the maintenance team, or expansion across facilities. This makes it clear in advance when a choice that is "adequate for now" will become inadequate.

Every architectural change should be discussed in terms of both operational benefit and new risk. A shared GPU server may use hardware more efficiently but require camera data to be transported over the network. Separate edge devices may reduce the failure domain but make centralized version management harder. The right option meets the user's business requirements with the lowest total risk.

How many cameras and lines should scalability planning cover?

Even if the initial installation has only one camera, the limit in the data flow that will constrain growth can be calculated. In a setup where one camera produces 150 MB/s of raw data, four cameras approach 600 MB/s. Feeding four streams into the same network port and CPU memory path may not be solved simply by increasing GPU capacity. Scalability therefore requires the camera interface, memory, disk, and PLC messaging capacity to grow alongside processing power.

A design document can describe the "next expansion" concretely: which module changes when a second camera, second product family, or second production line is added? Replicating the camera adapter may be easy, but if the PLC result contract is coded for a single camera, the system needs more changes than expected. This is why identifying boundaries that will change in the future matters, without introducing unnecessary distributed services for the current scope.

When separate lines share a GPU, one line's peak load can delay another. The shared resource's capacity and priority policy must be tested; in particular, measure whether critical quality decisions exceed their deadlines under load from the other line.

Business continuity: spare devices and restoration

Starting a second device when a production computer fails can support business continuity. However, simply booting the replacement computer is not enough if it does not have the correct camera calibration, PLC connection details, model, runtime, and product-family parameters. The backup strategy therefore covers more than file copies: a version manifest, database, key management, certificates, and device-related configurations must also be considered.

Recovery time can be measured from the connection failure until the system is declared Ready again. The state in which the production line remains during this process must be approved by the process owner. Decision generation should resume only after test frames, actual timestamps, and product identity have been verified for the reconnected camera. Delayed jobs in the old queue must not be applied to new products.

The presence of a spare device alone does not prove high availability. Periodic replacement drills show how the application will behave during a real outage. An event record and improvement actions can be created after the test.

An example monitoring dashboard for system metrics

It is useful to separate four families of indicators on a field dashboard. Image acquisition: expected triggers, completed frames, missing frames, and camera connection status. Processing: average and p99 duration, queue length, and CPU/GPU/RAM usage. Production decisions: on-time decision rate, incorrect matches, uncertain products, and PLC ACKs. Quality: rejection rate by defect type, manual review, and verified error rates.

These numbers must be interpreted together. For example, if the rejection rate increases while camera lighting intensity has changed, physical image acquisition rather than the model itself may have been affected. If the queue grows while GPU utilization falls, investigate CPU or network bottlenecks. Diagnosing the system from a single chart can lead to the wrong intervention.

Alarm thresholds should also be defined in context. A one-second latency spike may warrant a warning if no production decision was missed, whereas a single incorrect product match may count as a critical event. The alarm policy should align with operational risk.

The connection between data retention and retraining

Not all data retained for monitoring is automatically suitable for model training. Images of products automatically rejected in production, for example, overrepresent the distribution the model finds suspicious. When improving the model with these records, include not only defective products but also randomly selected non-defective products and difficult examples verified by an operator. Otherwise, the new model's learning of actual defect prevalence may be distorted.

Keeping metadata such as product ID, capture conditions, decision, human verification, and the reason for collecting a sample in field records makes retraining data more reliable. When creating a new dataset version for retraining, preserve the independence of the production test set. This process requires planning data flows in the system architecture; simply placing images in a folder is not enough.

Questions to ask in an architectural decision review

At the end of an architectural design meeting, the following questions need written answers: Which component acquires the image, and under what conditions does it mark it invalid? If several images belong to one product, where are results combined? What happens if the product ID is lost? After what interval is a decision no longer valid? How are retries made safe if the PLC acknowledgment is lost? How is the number of affected products determined when the camera or model service restarts?

The documentation must also explain which parameters affect quality decisions, who can change them, how evidence images are retained, and how long it takes to roll back to the current version. Without clear answers, high-level architectural boxes may look attractive but do not provide sufficient evidence for production acceptance.

Even a system built by a single engineer should be documented so it can be handed over to a maintenance team. An understandable system is an engineering advantage that reduces unnecessary complexity and reveals root causes faster.

An example decision for approving an architecture for production

Imagine a team starting with one camera and planning to serve three production lines in the future. Initial options might be a monolith on one PC, several services on a shared server, or a separate edge device for each line. None is universally best. If the current requirement is 60 products/minute with a 300 ms decision window per product, measure whether the single PC meets the p99 latency requirement under real load. A shared server can introduce risks such as transporting camera packets over the network and a single-device failure stopping all three lines. Separate edge devices can increase licensing and maintenance burdens.

Two tables are used in the decision meeting. The first covers mandatory requirements: product ID matching, maximum latency, failure behavior, camera support, and network security. Any option that fails these requirements is eliminated. The second covers preferences: purchase cost, energy, ease of deployment, flexibility, and maintenance cost. This prevents an architecture that looks cheap or fast but fails a process-critical requirement from accidentally receiving a high score.

The decision should conclude with explicit limitations: "The single-PC design is suitable for this station's current load; CPU/RAM/p99 will be retested before adding a second camera." This statement makes it easier to revisit the architecture later.

The final rehearsal before handing over a vision station

Without the system's developer present, the maintenance team restarts the test device, verifies camera profiles, checks the expected frame count, reads the model version, checks PLC connection status, and tests a sample product. They demonstrate that unplugging the camera cable produces the correct alarm, that no old decision is applied to a new product, and that the recovery procedure is understandable. This rehearsal measures not only user experience but also whether knowledge depends on a particular individual.

Documentation and logs must provide end-to-end traceability for a product. Selecting a specific product ID should reveal whether a raw image exists, which model ran, what the PLC acknowledged, and where the quality record was written. Such a trace reduces pressure to change the model arbitrarily when problems occur.

Declaring the system production-ready merely by looking at the image display before the rehearsal is complete is not appropriate. Actual production acceptance also includes physical actuator timing, risk analysis, and failure scenarios.

Frequently asked questions

Do we have to use microservices in every system?

No. For small, latency-sensitive stations, a modular monolith can offer lower maintenance costs and fewer data copies. Separate processes should be justified by measured requirements such as scaling and fault isolation.

Is edge always faster?

No. Edge can reduce network latency, but limited CPU/GPU capacity and thermal load can become bottlenecks. The same workload must be compared using the same system metrics.

Why should decisions not be made without a product ID?

With parallel model execution, results can return in reverse order. Product identity is the essential linking information that prevents a correct prediction from being applied to the wrong product.

What happens if the camera and MES disconnect at the same time?

The policy must be determined by process risk. Camera loss invalidates the quality decision; MES loss can be handled by continuing local decisions and transferring records later on lines where this is permitted.

Interactive tool: see when a queue grows

An educational single-server simulation with fixed arrival and processing intervals. Capacity covers waiting frames only; one frame being processed is counted separately. The first arrival is at t=1/λ. At most 60 seconds are modeled; this is not real hardware or PLC control.

—Processed
—Dropped (buffer full)
—Longest queue

Technical sources and verification

Manufacturers' and standards organizations' documentation was used as the basis for standards and runtime details of the methods. Unless explicitly stated otherwise, all example numbers are for educational purposes.

  1. NVIDIA - TensorRT performance benchmarking
  2. ONNX Runtime - Execution Providers
  3. OPC Foundation - What is OPC?
  4. NIST - OT security

Visual note: The nine technical diagrams are original, and numerical examples are for educational purposes. The illustrations are not actual device benchmarks, facility measurements, or factory acceptance tests.