Should factory vision run at the edge or in the cloud?
In most factories, the inference that drives the reject decision should run at the edge; the cloud is the place for training and monitoring, not for the decision. This is less a technology preference than a consequence of the line's physical constraints: if the decision must arrive before the part reaches the reject point, if inspection must continue through an outage, or if images may not leave the site, the choice has largely been made for you. Where latency does not matter, as in batch analysis and comparisons across several sites, the cloud's flexibility comes to the fore.
In this article, "edge" means devices next to the line such as an industrial PC, an embedded board with a GPU or a smart camera; an "on-premises server" is a server in the plant's own server room; and "cloud" is a service running at a provider outside the site. Four questions drive the choice: how quickly the line needs a decision, how much bandwidth the image stream takes, where the images may go, and what happens when the connection drops. The fifth is operations: who will update and monitor the devices.
How quickly does the line need a decision?
The decision has to arrive before the part reaches the reject point. Derive the time budget from physics: divide the distance between camera and reject gate by the maximum belt speed, then subtract the reject mechanism's response time and a safety margin. What remains must cover exposure, image transfer, queueing, preprocessing, inference, postprocessing and communication with the controller (PLC).
Hypothetical calculation: The belt runs at 0.5 m/s and the reject gate sits 250 mm after the camera. A part reaches the gate in 500 ms. If the pneumatic pusher needs 60 ms and the safety margin is 100 ms, 340 ms are left for software and communication. A device next to the line can stay comfortably within that budget. If the same image is 5 MB and the plant's shared uplink is 100 Mbit/s, uploading it to the cloud alone takes 400 ms (5 MB × 8 = 40 Mbit); the budget is gone before inference and the return path are even counted. Lossy compression shortens the upload but can erase fine defects, and it does not remove the variation in round-trip time.
Be careful about what you measure. NVIDIA DeepStream's latency measurement API computes the latency of frames in a batch from the decoder input up to the point where the API is called. That is useful for looking inside the pipeline, but it does not cover exposure, transfer from the camera or the signal to the PLC. Measure end to end with timestamps taken at the trigger and at the reject signal, and compare the 99th percentile on the busiest shift, not the average, with the budget.
How much bandwidth do you need?
Calculate it from your own cameras' real frame sizes; do not decide from average traffic. Hypothetical calculation: a 5-megapixel (2448 × 2048) monochrome 8-bit camera produces about 5 MB of raw data per frame. At 10 frames per second that is about 50 MB/s, or 400 Mbit/s; four cameras mean roughly 1.6 Gbit/s of raw stream. Even if you assume tenfold compression, a sustained 160 Mbit/s does not fit through a shared 100 Mbit/s uplink.
A system that runs inference at the edge does not need to send every frame. It sends the part ID and decision, images of rejected parts, borderline samples and a sample selected for monitoring. Before you rely on that, write down which original images the quality team needs for disputes and root-cause analysis, and for how long; an image you delete cannot be recovered.
Can production images leave the factory?
Start by listing what the images contain: operators' faces or hands, customer brands, unreleased designs, dimensional and process information. If identifiable people appear, you are processing personal data. The cross-border transfer guide of Turkey's Personal Data Protection Authority (KVKK) treats storage in a provider's cloud located abroad, and remote access from a third country (even when it is only viewing data on a screen for support), as a transfer when the guide's criteria are met. Article 9 of Law No. 6698 ties such transfers to a tiered regime of adequacy decisions, appropriate safeguards and incidental transfers; when a standard contract is used, it must be notified to the Authority within five business days of being signed. This is not legal advice: confirm the legal basis with your legal team, and where possible mask faces before an image leaves the site.
The second question is network security. NIST's guide to operational technology security, SP 800-82 Rev. 3, generally recommends separating operational technology (OT) networks from the corporate network, notes that every connection between them adds risk, and describes isolation devices configured to permit only explicitly authorised communication between segments. A vision device next to the line that talks to the cloud is exactly such a connection. Write down from the start which device talks to which address, on which port and in which direction, and restrict the firewall rules to that list.
What happens when the connection drops?
Edge inspection keeps making decisions when the wide-area link goes down; only the records bound for the centre wait. Microsoft's Azure IoT Edge offline documentation describes this behaviour concretely: once a device has synced with IoT Hub, it can keep operating offline indefinitely, stores upstream messages locally and delivers them in the order they were stored when the connection returns. The same page sets two limits: message time-to-live defaults to 7,200 seconds (two hours), and storage is bounded by disk space. There is also a trap: while the device is offline, its status in the portal can keep showing "200 OK". Estimate how long an outage could last, size the time-to-live and the disk accordingly, and monitor device health with a signal that does not depend on the portal status.
For inspection that runs only in the cloud, an outage cuts the decision path. Write down in advance what happens then: are all parts diverted to manual inspection, does the line stop safely, or is uninspected production accepted for a set period? The choice depends on the line's risk, but a silent "no decision, part passed" is acceptable on no line.
A connectivity and privacy decision matrix
Fill in the matrix below for the edge, on-premises and cloud options, using your own measurement in every cell.
| Criterion | Edge device | On-premises server | Cloud |
|---|---|---|---|
| Decision latency | Shortest; no wide-area network | Plant network latency added | Upload and round trip added, and they vary |
| If the wide-area link fails | Inspection continues | Inspection continues | Inspection stops; a fallback is needed |
| Where images live | Next to the line | Inside the plant | Outside the site; transfer rules apply if abroad |
| Bandwidth | Only results, events and samples | Full stream on the plant network | Full stream or selected frames over the wide-area link |
| Hardware and maintenance | A device per line, patches, spare parts | Central server and accelerator capacity | At the provider; cost depends on usage |
| Model updates | Fleet rollout and rollback plan | From one place | From one place |
| Training and batch analysis | Not suitable | Depends on capacity | Suitable |
The matrix does not decide on its own; your line sets the weights. If the time budget is exceeded, or if inspection stopping during an outage is unacceptable, deciding in the cloud is no longer an option and what remains is how to split the work.
How is the work split in a hybrid architecture?
- Next to the line: triggering, image capture, inference, the accept or reject decision, the PLC signal, short-term local storage and the operator screen.
- Inside the plant: the image archive for several lines (under the retention policy), the labelling tool, per-line reports and, if needed, central inference for multi-camera jobs.
- In the cloud or a central site: model training on permitted and, where necessary, masked data, the model registry, cross-site monitoring dashboards and reports that work on metadata only.
Manage model updates like a software release: a signed model package, shadow mode on one line first, then line-by-line rollout, and the ability to return to the previous model on every device. Store which model version made each decision on which line in every record.
Hypothetical example: a food packaging plant with three lines
The plant has three packaging lines and six cameras in total. The time budget on every line is under 300 ms, the uplink is shared with office traffic, and one camera also sees the area where operators work. The matrix leads to this design: inference and the reject decision on an edge device at each line; the image archive and labelling tool on a server inside the plant; and model training at the central site, using only images whose faces are masked and whose transfer basis is settled. What goes to the cloud is not a raw image stream but per-line decision counts, reject rates and monitoring metrics. With this layout, a wide-area outage does not affect production; only the central dashboard updates late.
Which failures should a pilot rehearse?
A fallback drawn on a diagram does not count as working until operators have exercised it. During the pilot, rehearse the following in a controlled way:
- Measure end-to-end latency on the busiest shift with the largest product image, and compare the 99th percentile with the budget.
- Cut the wide-area link for longer than the message time-to-live, and count any lost records.
- Restart the edge device and the on-premises server separately, and measure how long the line is left without a decision.
- Fill the disk, and see which data the device deletes first and whether decisions are affected.
- Confirm that the same event is not recorded twice when the connection returns.
- Check that device clocks are synchronised; wrong timestamps spoil root-cause analysis.
- Release a model update and roll it back, recording how long each step takes and its effect on the line.
Common mistakes
- Measuring latency as model inference time only.
- Sizing bandwidth from average traffic.
- Sending images to the cloud without asking whether they contain personal data or confidential designs.
- Connecting the edge device straight to the corporate network without written communication rules.
- Never rehearsing an outage or a device restart.
- Leaving updates, monitoring and spare parts for edge devices without an owner.
Our computer vision and image recognition service page also compares edge devices, on-premises servers and the cloud in terms of latency, connectivity and privacy.