Edge Vision on a Conveyor: Camera, Lighting and a Reject in Under 100 ms

The model scored above 98 percent on the test set. On the bench, with a phone camera and a desk lamp, it found every cracked and discoloured item in the sample tray. On the line it did something nobody had tested: the air jet fired, a good item flew into the reject bin, and the cracked one beside it rode on to the packing table.
Over the next week the failures multiplied. Some defects were missed because the images were smeared. Some good items were rejected because a reflection looked like a crack. When the line ran faster after lunch, the rejects drifted further from their targets. The vision team retrained the model twice. Neither retraining changed much, because the model was not the problem.
This is how conveyor vision projects usually go wrong. The neural network gets the attention, and the physics around it decides the outcome: how long the shutter is open while the belt moves, how the light falls on the product, how many pixels each defect gets, how many milliseconds pass between the shutter and the ejector, and how the system knows where an item is once it has left the camera's view. Each of these is simple arithmetic. Each is easy to skip when a project starts as a model demonstration.
This post follows that chain from the camera to the reject bin, in the order the problems usually appear on a new line. The numbers come from a small budget calculation for a belt at 2 metres per second and from a reject queue written in C and tested against a simulated belt. The aim is a system that rejects the right item, at line speed, every time, not one that scores well on a test set.
The Bench Test That Lied
A bench test differs from a production line in four ways, and each matters.
The product stands still on the bench. On the line it moves, often at one to three metres a second, and every millisecond the shutter is open smears the image along the direction of travel.
The bench has stable light. The line has daylight from windows that changes through the day, overhead fluorescent tubes that flicker at twice the mains frequency, and reflections from stainless steel guards.
The bench test asks whether the model can find a defect. The line asks whether the system can act on the decision in time, at the right place, on the right item, while the next items keep arriving.
And the bench test uses a curated tray. The line delivers whatever the upstream process produces, including orientations, sizes and contaminants nobody put in the training set.
A conveyor vision system is a timing system with a camera attached. The model decides what is wrong; the timing decides which item pays for it.
Motion Blur Is Arithmetic, Not Bad Luck
The smear in a moving image equals the belt speed times the exposure time. At 2 metres per second, a 2-millisecond exposure smears every edge by 4 millimetres. The question is how that compares with a pixel and with the defect you need to see.
Take a camera with 1,920 pixels across a 400-millimetre field of view. Each pixel covers about 0.21 millimetres of belt. A crack you want to detect should span at least three pixels, so the smallest reliable defect is about 0.6 millimetres.
Exposure | Blur at 2 m/s | Blur in pixels | Effect on a 0.6 mm defect |
2,000 µs | 4.00 mm | 19.2 px | Invisible; smeared into the background |
500 µs | 1.00 mm | 4.8 px | Smeared to several times its length; unreliable |
100 µs | 0.20 mm | 1.0 px | Acceptable; edges soften slightly |
50 µs | 0.10 mm | 0.5 px | Sharp |
The rule of thumb is to keep blur at or below one pixel. At 2 metres per second that needs an exposure of about 100 microseconds or less. Short exposures let in very little light, so the camera then needs either a very bright continuous light or a strobe that fires a short, intense flash synchronised with the shutter. A global-shutter sensor, which exposes every pixel at once, is strongly preferred over a rolling-shutter sensor for moving products, because a rolling shutter exposes rows one after another and skews moving objects.
The calculation also sets the camera. If the defect is smaller, or the field of view wider, you need more pixels, a narrower field per camera, or several cameras side by side. If the belt runs faster, the exposure must shrink in proportion, and the light must grow.
Lighting Decides What the Model Can Learn
Lighting is where most of the engineering effort in industrial vision goes, and where most of the failed projects skimped. The goal is to make the defect obvious and everything else boring: high contrast on the feature that matters, and as little variation as possible in everything that does not.
Technique | How it works | Good for | Watch out for |
Diffuse dome or tunnel light | Light from all directions, no hard shadows | Shiny or curved products; colour inspection | Bulky; hard to fit over a fast belt |
Low-angle dark-field light | Light skims across the surface | Scratches, cracks, embossed text | Sensitive to height variation |
Backlight | Product between light and camera | Outline, holes, fill level in clear containers | Shows only silhouettes |
Coaxial light | Light along the camera axis through a beam splitter | Flat reflective surfaces | Small field of view |
Strobed LED bar | Short, intense flash synchronised with exposure | Freezing motion; rejecting ambient light | Needs trigger wiring and driver design |
Two practical rules carry over to almost every line. First, enclose the inspection zone, even partially, so the system's own light dominates daylight and room lighting. A hood over the belt with a strobe inside it can make the image almost independent of the time of day. Second, strobe rather than run continuously, both to freeze motion and because a flash many times brighter than the room makes ambient light irrelevant during the short exposure.
Spend the first week on light, not on the model. A defect that the lighting makes obvious needs a small model; a defect the lighting hides cannot be found by any model.
Triggering: Know Where the Item Is
The camera needs to capture each item at the same position in the frame. Free-running video at a fixed frame rate catches items wherever they happen to be, sometimes half out of view, sometimes twice in two frames. The better approach is to trigger the camera from the item itself.
A photoelectric sensor across the belt, a few centimetres before the camera, detects the leading edge of each item and triggers the camera and strobe. For continuous products, such as a web of material or a stream of granules, triggering comes from a shaft encoder on the belt, firing every so many millimetres of travel.
The encoder matters even with item triggering, because it is how the system knows where every item is after the photo is taken. Belt speed is never perfectly constant: it sags under load, changes with motor temperature and steps when operators adjust it. A reject scheduled by time drifts when the speed changes. A reject scheduled by encoder counts does not, because it tracks distance, which is what actually matters.
The Latency Chain From Shutter to Ejector
Every inspection has a chain of delays between the moment the shutter opens and the moment the ejector acts. The table gives a planning budget for an edge system at 2 metres per second; each value is an illustrative estimate to replace with measurements from your own hardware.
Step | Planning time | Belt travel at 2 m/s |
Exposure | 0.1 ms | 0.2 mm |
Sensor readout | 8 ms | 16 mm |
Transfer to the processor | 4 ms | 8 mm |
Pre-processing | 3 ms | 6 mm |
Inference | 12 ms | 24 mm |
Decision and output | 1 ms | 2 mm |
Valve or pusher response | 15 ms | 30 mm |
Total | 43.1 ms | 86 mm |
With 10 milliseconds of jitter on top, from an operating system scheduling another task or a slow inference on a complex image, the worst-case travel is about 106 millimetres. The ejector must therefore sit comfortably further down the belt than that, and the system must schedule each reject by distance, not by the moment the decision happens to arrive.
Three practices keep the chain predictable. Run the vision pipeline on hardware and software where timing can be measured and bounded: a dedicated accelerator, fixed input sizes, and no unrelated workloads on the same processor. Timestamp every image with the encoder count at the moment of the trigger, so the decision carries its own position. And measure the full chain on the line with a high-speed camera or a logic analyser watching the trigger and the valve, rather than adding up datasheet figures.
The Reject Queue: Scheduling by Distance
The core of the reject system is a short queue. When the camera captures an item, the system records the encoder count. When the model decides an item is bad, the controller adds an entry to the queue: fire the ejector when the encoder reaches the capture count plus the distance from the camera line to the ejector. On every encoder tick, the controller checks the head of the queue and fires when the count is reached.
This design has three useful properties. The decision can arrive at any time before the item reaches the ejector, so variable inference time does not matter as long as it is bounded. Belt speed changes are handled automatically, because everything is measured in counts. And if the queue ever fills, which means decisions are arriving faster than items should, the controller can fail safe, for example by diverting everything until an operator checks the system.
#define QLEN 64
typedef struct { uint32_t fire_at[QLEN]; uint8_t head, tail; } rq_t;
static int rq_push(rq_t *q, uint32_t count) {
uint8_t n = (uint8_t)((q->head + 1) % QLEN);
if (n == q->tail) return -1; /* full: fail safe upstream */
q->fire_at[q->head] = count; q->head = n; return 0;
}
/* call on every encoder tick; returns 1 when the ejector should fire now */
static int rq_tick(rq_t *q, uint32_t now) {
if (q->tail == q->head) return 0;
if ((int32_t)(now - q->fire_at[q->tail]) >= 0) {
q->tail = (uint8_t)((q->tail + 1) % QLEN);
return 1;
}
return 0;
}
The signed subtraction in the comparison is deliberate: it keeps working when the 32-bit encoder count wraps around after billions of ticks.
The test simulates a belt with an encoder at 4 counts per millimetre, items every 100 millimetres and the ejector 300 millimetres past the camera line. Items 3, 4 and 9 of 16 are defective, and every decision arrives late, after the item has travelled a further 80 millimetres, which is roughly the latency chain above. The ejector fired exactly three times, each exactly when a defective item reached it, including the two adjacent defective items. A separate check confirmed that scheduling still works across a counter wrap.
Ejectors Have Physics Too
The last link is mechanical, and it has its own timing and limits.
Air jets are fast and gentle on light items: a solenoid valve opens in milliseconds and a short blast pushes the item off the belt into a chute. They struggle with heavy items, and their timing changes as the valve ages and the air supply pressure varies. Pushers and flippers move heavier items but are slower and need more clearance. Diverter gates switch a whole stream and suit lines where items are spaced closely.
Three details catch teams out. The ejector's response time must be measured under the real air pressure and with the real item, because a datasheet response time is for the valve alone. Items close together need a gap at least as large as the ejector's effective width, or the neighbour gets rejected with the target; this is often the real explanation for the "wrong item kicked" failure in the opening. And the reject bin needs a sensor too, so the system can confirm that a reject actually landed there, rather than assuming it.
What the Model Needs From the Line
Once the optics, lighting, triggering and timing are right, the model's job becomes much smaller, and its data needs change.
Collect training images from the line, with the final camera, lens, light and trigger, not from a bench setup. A model trained on bench images learns the bench. Collect continuously for the first weeks, and label a sample of everything the system rejects and a sample of what it passes, so you learn both kinds of error.
Defects are rare, which makes a balanced training set hard. Two techniques help. Train an anomaly-detection model on good items only, which then flags anything unusual, and pair it with a smaller classifier for the defect types you know. And keep a library of the rare defects you do find, with their images, so the classifier improves as the line runs.
Quantise and test the model on the target hardware early. A model that meets its accuracy target in full precision on a workstation may lose accuracy or time when it is compressed for an edge accelerator; our post on quantisation objections covers how to check that before it matters.
Measuring the System, Not Just the Model
A model's test accuracy says little about the line. The measures that matter are the ones the plant manager cares about.
Measure | What it tells you | How to get it |
Escape rate | Defective items that reached the customer | Audit a sample of passed items downstream |
False reject rate | Good items thrown away | Re-inspect a sample of the reject bin |
Correct-item reject rate | Rejects that hit the intended item | Reject-bin sensor plus logged item positions |
Line availability | Time the system was running and trusted | Controller logs, operator overrides |
Latency, worst case | Margin before the ejector | Encoder-stamped decisions against capture counts |
The third measure is the one most systems never record, and it is the one the opening failure would have revealed on the first day. If the ejector fires at the wrong time, the reject bin contains good items and the defect escapes, and both the false reject rate and the escape rate rise together with no change in the model.
Audit the reject bin and the passed stream, not the test set. A system that kicks the wrong item looks like a bad model until someone checks where the rejects landed.
Wide Belts, Several Cameras and Both Sides of the Item
The pixel arithmetic earlier assumed one camera across a 400-millimetre field. Many lines are wider, and many products have defects on more than one face.
For a wide belt, the choice is between one camera with a wide lens and several cameras side by side. One wide camera is simpler to mount and trigger, but it spreads the same pixels over more belt, so each pixel covers more product and small defects get fewer pixels. Several narrower cameras keep the pixel footprint small; they need careful alignment, overlapping fields so no item falls between them, and a controller that merges their decisions per item. Line-scan cameras, which capture one row of pixels at a time as the belt moves under them, suit very wide or continuous products and fast belts, because the encoder clocks each row and the image is built from the motion itself.
Layout | Pixel footprint | Complexity | Best for |
One area camera, wide lens | Large | Low | Large defects, narrow belts |
Two to four area cameras side by side | Small | Medium: alignment, overlap, merging | Wide belts with small defects |
Line-scan camera with encoder clock | Small, set by the encoder and optics | Medium: synchronisation and lighting line | Continuous products, very wide or fast belts |
Cameras above and below, or a rolling transfer | Depends on each camera | High: product handling and timing | Defects on several faces |
Defects on the underside need either a camera looking up through a gap between two belts, which is mechanically awkward, or a transfer that turns the product over between two inspection points. Each added camera adds a trigger, a light and a decision that must be merged with the others before the ejector fires, so the reject queue in the earlier section becomes a per-item record that collects decisions from every camera and fires once if any of them says reject.
The decision about layout belongs at the start of the project, with the line's mechanical team, because adding a second camera or a gap between belts after the line is installed is far more expensive than designing it in.
Hygiene, Dust and Washdown
Many conveyor inspection lines handle food, pharmaceuticals or other products where hygiene rules shape the hardware. A camera housing above an open food product must not shed particles, must survive the plant's cleaning routine and must not trap water or residue.
The practical requirements are familiar to anyone who has fitted equipment in a food plant. Enclosures rated for the washdown method used, often with high ingress-protection ratings against water jets. Stainless steel or food-compatible plastics, with smooth surfaces and no crevices. Windows of polycarbonate or protected glass where the plant's rules restrict glass near open product. Cables routed and sealed so cleaning water cannot wick into connectors. And mounting that lets the cleaning crew reach every surface.
Dust is the dry-plant equivalent. Flour, sugar, spices, powders and mineral fines settle on lenses and light covers and slowly darken the image. An air knife across the lens window, a scheduled wipe in the operator's checklist, and an automatic check that alerts when the average image brightness drifts all help. The image-brightness check is the cheapest of the three and catches the problem before the model starts missing defects.
Keeping It Working After Month One
A vision system that works on commissioning day is not finished. Over months the lights age, lenses get dirty, cameras get bumped during maintenance, products change and operators find ways around the system when it annoys them. Each of these erodes performance slowly enough that nobody notices until an escape reaches a customer.
Three habits keep the system honest. First, run golden samples: a small set of known good and known defective items, passed through the line at the start of each shift or each day, with the result logged. If a known defect is passed, the system is not trusted until someone finds out why. Second, monitor the image itself: average brightness, contrast and sharpness in a fixed region, logged per hour, with an alert when they drift. A lamp that is dimming or a lens that is fogging shows up here weeks before it shows up in escapes. Third, log every operator override, such as a disabled ejector or a raised threshold, with who made it and why, and review the overrides weekly.
A vision system degrades quietly. Golden samples each shift, image-quality trends and a log of every override catch the drift before a customer does.
Retraining becomes routine rather than a crisis. The rejects reviewed by quality staff, the occasional escape found downstream and the new product variants introduced by the plant all feed a labelled set, and the model is retrained on a schedule, tested on the golden samples and on a held-out set from the line, and deployed only when it is at least as good on both.
Running on the Edge, Not the Cloud
Conveyor inspection belongs on hardware next to the line. A round trip to a cloud service adds tens to hundreds of milliseconds of variable latency, which turns a predictable reject into a gamble, and a network outage stops the line or lets defects through. An edge processor next to the camera keeps the latency bounded and keeps working when the plant's internet does not.
The edge hardware should be chosen for bounded latency, not just throughput. An accelerator that processes a hundred frames a second on average but occasionally stalls for 50 milliseconds is worse for this job than one that does sixty frames a second without fail. Our comparison of edge accelerators for vision products covers how to measure that, and the plant's own case is worth testing with the real model and camera before buying in volume.
Data still flows upward. Images of rejects, a sample of passes, the counts and the system health go to a server for review, retraining and reporting. The decision that moves the ejector stays at the line.
Commissioning on a Live Line
Commissioning a conveyor vision system without stopping production takes a staged plan.
Mount and measure. Install the camera, light and trigger sensor, and measure the belt speed range and encoder counts per millimetre. Calculate the exposure needed for one pixel of blur at the top speed.
Collect without rejecting. Run the camera for a week, triggering and logging images with encoder counts, while the line runs normally. Label a sample.
Shadow mode. Run the model and the reject queue with the ejector disconnected, logging the item each reject would have hit. Compare with a manual audit.
Measure the chain. With a logic analyser or high-speed camera, measure trigger-to-valve latency and ejector response at the line's real air pressure.
Enable the ejector at low speed. Turn on rejection at the slowest normal line speed with conservative thresholds and audit the reject bin every shift.
Raise speed and tighten. Increase line speed in steps and tune thresholds against the escape and false-reject audits, not against the test set.
A Budget for the Whole Station
Teams that price a conveyor vision project as "a camera and a model" are surprised twice: once when the lighting, enclosure and mounting cost as much as the camera, and again when commissioning takes longer than development. A realistic budget lists every part of the station, because the line needs all of them to work.
The hardware side covers the camera and lens, the light and its strobe driver, the enclosure or hood, the trigger sensor and encoder, the edge processor, the ejector with its valve and air supply, the reject chute and its confirmation sensor, and the mounting frame. The engineering side covers optical design and lighting trials, data collection and labelling on the line, model training and quantisation, the controller and reject queue, integration with the line's control system and its safety interlocks, and the commissioning weeks in shadow mode. The running side covers golden samples, cleaning, periodic retraining and someone who owns the station.
Line downtime for installation is often the most expensive item, and it does not appear on any quotation. Design the mounting and wiring so the station can be fitted in a planned stop, and run shadow mode on live production rather than on a dedicated test run.
When a Vision System Is the Wrong Answer
Some inspection problems are better solved without a camera. A weight check catches missing parts and underfilled packs faster and more reliably than vision. A metal detector catches metal contamination that a camera cannot see inside a product. A simple photoelectric sensor checks presence and orientation for a fraction of the cost.
Vision is also the wrong answer when the defect cannot be seen from the line's camera positions: an internal crack, an underside fault on an item that cannot be turned, or a chemical property. Near-infrared or X-ray inspection may be needed instead.
And a vision system cannot fix an upstream process that produces too many defects. If one item in ten is bad, the right investment is usually in the process that makes them; the camera then becomes a monitor of that process, not a filter at the end of it.
Back to the Wrong Item in the Bin
The model in the opening was never as bad as it looked. The images were smeared because the exposure was set for a desk lamp, the reflections came from an unshielded stainless guard, and the wrong items were rejected because the reject was scheduled by time on a belt whose speed changed after lunch, with items spaced closer than the air jet's width. A strobe in a hood, a shorter exposure, an encoder-based reject queue and a check of the reject bin fixed all three. The model was retrained once more, on images from the line, and that time it made a difference, because the images finally showed it what the line looked like.
Get the light, the timing and the reject bin right first. Then the model has a fair chance to show what it can do.
Related service: Industrial Edge Vision Systems
Related case study: Low-Latency Vision for Conveyor Anomaly Detection
Related reading: Jetson Orin vs Hailo-8: Choosing an Edge AI Accelerator for Vision Products, Model Quantisation in Practice: Eight Objections to INT8 and INT4, Tested and Can Edge AI Vision Survive a Poultry Shed?
EurthTech is an engineering-first product design and embedded systems company with a development center in Hyderabad. To discuss a project, write to connect@eurthtech.com or see https://www.eurthtech.com/case-studies.




Comments