YOLO inference on an inspection line is one forward pass per captured image. The trained network reads the image and returns bounding boxes, class labels and confidence scores in a single step, instead of first proposing candidate regions and then classifying each one. The YOLO family’s balance of detection speed and accuracy has made it a mainstream choice for industrial computer vision inspection. That reputation does not tell you whether the station will keep up with the line or behave on an edge box the way it did in a notebook. Those answers depend on the hardware and need direct measurement of latency, memory and throughput on the target platform.
What YOLO Inference Does When a Part Passes the Camera
Inside the forward pass, a backbone extracts multi-scale feature maps from the image, a neck fuses them, and a detection head produces box predictions and class scores. Classic YOLO heads emit raw one-to-many predictions, which a post-processing step called non-maximum suppression (NMS) then filters. Newer heads remove that step: YOLOv10 introduced one-to-one matching so prediction no longer relies on NMS, and YOLO26 produces a compact, non-redundant set of predictions directly.
On a station, those detections are not the end of the chain. The camera exposure, image transfer, preprocessing, model prediction, post-processing and the write of a pass or reject signal to the PLC all happen inside each cycle. In Ultralytics predict mode the confidence threshold defaults to 0.25, and detections below it are disregarded. Tuning that threshold is a topic of its own, and after INT8 quantisation it should be picked again from the quantised model’s own F1 curve (more on that in the deployment section).
A short orientation on the lineage is enough for inspection work. YOLOv1 recast detection as a single regression problem, YOLOv3 added multi-scale prediction that substantially improved small-object detection, and YOLO11 refined the backbone and neck with C3k2 and C2PSA modules. For the mechanics in more depth, including where classical image processing still earns a place ahead of the network, see how object detection with YOLO works and where classical preprocessing still helps.
How Fast Does YOLO Inference Need to Run on an Inspection Line?
Fast enough that the whole chain, from camera trigger to reject signal, fits inside the time between parts on the slowest cycle, not the average one. The model’s own milliseconds are only one slice of that.
The Budget Is End-to-End, and the Tail Decides It
The vendor iFactory gives a worked case: a line running 200 parts per minute leaves roughly 300 ms per part (60,000 ms divided by 200), and capture, transfer, preprocessing, inference, post-processing and the fieldbus write must all fit inside it. The same vendor’s station-design rule of thumb takes one over the line rate and subtracts 20 ms for reject actuation, so a 300-unit-per-minute line has 200 ms per unit and inference must finish inside 180 ms. These are vendor sizing heuristics rather than measured studies, and we would treat them as arithmetic for a first estimate, not as a standard.
The SLF-YOLO authors (Scientific Reports, 2025) cite high-speed lines demanding detection within 100 ms per workpiece, and resource-constrained settings demanding inference below 10 ms with a memory footprint under 100 MB. A 2025 survey of industrial defect detection notes that inspection pipelines often have to sustain more than 20 to 30 frames per second in high-throughput settings.
Average latency is the wrong number to size against. A line with one part every 300 ms cannot absorb an occasional 700 ms spike, because that one late verdict is either a defect passed or a good part kicked. MLPerf Inference also measures the tail: its single-stream scenario reports 90th-percentile latency, and its server scenario allows no more than 1% of vision queries to exceed the latency bound. The same vendor claims, without a published measurement, that a cloud round trip from plant to server adds 200 ms to 2 s of variable latency, and gives that as its reason for running line-side inference at the edge.
What Decides the Model’s Share of the Budget
The runtime alone changes the number on the same RTX 5090 workstation. HDR-YOLO ran at 139.93 FPS (7.15 ms) under PyTorch and 196.68 FPS (5.08 ms) through ONNX. Ultralytics documents up to 3x CPU speedup from ONNX or OpenVINO export and up to 5x GPU speedup from TensorRT, which are the vendor’s ceilings, not guarantees.
Lower numeric precision cuts it further. On an NVIDIA Jetson Orin NX 16GB at 640x640, Ultralytics reports YOLO11s at 14.53 ms per image in TensorRT FP32, 7.91 ms in FP16 and 6.05 ms in INT8. A characterisation of quantisation on edge devices measured INT8 models in the MLPerf offline scenario at 3.3x and 4x the FP32 performance with OpenVINO on an Intel CPU and TFLite on a Raspberry Pi, but also found that without instruction-set support or optimised libraries, quantisation can make inference slower.
Operation counts are an oversimplified guide to any of this. In the MLPerf Inference paper, SSD-ResNet-34 needed 175x more operations per image than SSD-MobileNet-v1, yet its measured throughput was only 50 to 60x lower, a consistent 3x gap caused by network structure. A 2025 overview of the Ultralytics models adds memory bandwidth, operator support, kernel-launch overhead and compiler behaviour as reasons models of similar theoretical complexity show different real latency. Our position is to profile the exported model on the target device before optimising anything or assuming it fits the line, because the context that makes a tuning choice right only shows up in a profile. TensorRT reinforces this: an engine is tuned on the GPU it was built on and is not a portable model file, so it must be built for the deployment GPU.
Can YOLO Reliably Find Scratches, Pits and Hairline Cracks?
Not uniformly: in HDR-YOLO’s published per-class results, low-contrast defects with weak boundaries score lowest, and extremely small ones remain challenging. On two public steel datasets, HDR-YOLO scored a per-class mAP50 of 0.624 on crazing and 0.684 on rolled-in scale, and 0.977 on crescent gap but only 0.520 on inclusion, 0.590 on rolled pit and 0.641 on crease. The authors attribute the low scores to irregular morphology, weak boundaries, low contrast and subtle texture, and say extremely small defects remain challenging. Those are results on two public steel datasets, not a forecast for your parts (the mAP scoring behind YOLO benchmarks explains how they are scored).
One cause is lost spatial detail. Fine detail attenuates as features pass through deep layers. On PCBs, most defects occupy around 0.1% of a high-resolution image and are easily lost in downsampling and feature fusion, and YOLO11’s bilinear upsampling tends to smooth their edges further. In crack inspection, full-image inference often fails to activate on millimetre-scale cracks because resizing the image to the network’s input destroys the spatial information.
Small-Defect Mitigations and What Each Costs at the Line
| Mitigation | What it does | Cost or caveat |
|---|---|---|
| Pixel budget at capture | iFactory’s rule: the smallest defect should span at least 3 pixels; a 100 mm field of view on a 2,448-pixel sensor gives about 41 µm per pixel, so a 0.15 mm defect covers 3.6 pixels | Vendor heuristic; fixed by lens, sensor and stand-off, not by the model |
| Stable imaging | HDR-YOLO’s authors list stable imaging with sufficient resolution and consistent illumination as deployment prerequisites | Lighting and optics work, outside the network |
| High-resolution head | A P2 branch feeds shallow, high-resolution features into the detection head, improving response to very small cracks | Architecture change and retraining |
| Slicing inference (SAHI) | Runs the detector on overlapping tiles; on aerial datasets it raised AP by 6.8, 5.1 and 5.3 points for FCOS, VFNet and TOOD, and up to 14.5 with slicing-aided fine-tuning | Standard SAHI at 30% overlap carries about 43% redundant computation; HiResInfer, an adaptive variant, cut that to 18% |
| Small-target training | YOLO26’s STAL label assignment gives tiny and low-contrast instances more supervisory signal | Improves learning, not image information |
Slicing deserves the hardest look on a timed line. Every extra tile is another forward pass inside the same cycle, so a model that fits the budget at full-frame may not fit it sliced. Retraining on your own defect set is covered in fine-tuning YOLO for manufacturing-line defect detection, including what it fixes and what it does not. Where the station itself is the limit, where off-the-shelf vision QC stops working picks up the argument.
Is YOLO Still a Good Choice, or Have Newer Detection Models Replaced It?
YOLO is still a sound default for line-side detection, but the version matters and transformer detectors are a credible alternative rather than a curiosity. Ultralytics’ current guidance (on its own models and on others’) is that YOLO26 offers an optional NMS-free design for more predictable inference times and runs up to 43% faster on CPUs than previous generations, that YOLO11 remains recommended for teams needing proven stability, and that it does not recommend YOLO12 or YOLO13 for production because of training instability, memory use, slower CPU inference and reproducibility concerns. An independent overview puts YOLO26n at about 38.9 ms per image on CPU against about 56.1 ms for YOLO11n, at comparable accuracy.
The counterview is real. The RT-DETR authors report 53.1% and 54.3% AP on COCO for RT-DETR-R50 and R101 at 108 and 74 FPS on a T4 GPU, which they say beats earlier YOLOs on both speed and accuracy. The HDR-YOLO authors, working on steel defects, argue the opposite: transformer detectors generally carry higher latency on the same hardware, and RT-DETR-18 needed about 20M parameters and 60 GFLOPs yet scored lower on NEU-DET. The two sources measure different things (COCO on a T4 GPU versus steel defect datasets, and the steel paper left RT-DETR out of its latency test), so neither settles the question for an inspection line. For that trade-off in full, see RT-DETR vs YOLO for production inspection pipelines, and for the wider field, object detection model selection for production deployment.
What Changes Between YOLO Predict in a Notebook and Inference at the Line
In a notebook, model.predict() returns Results objects. At the line you choose the runtime, the precision, the output format and how frames are queued, and each choice changes either speed or behaviour.
| Aspect | Notebook predict |
Edge deployment at the line |
|---|---|---|
| Runtime | PyTorch, FP32 by default | Exported engine such as ONNX, TensorRT or ExecuTorch; a TensorRT engine must be built for the deployment GPU |
| Precision | FP32 | FP16 or INT8; INT8 can shift confidence values, so Ultralytics advises picking the operating threshold from the INT8 model’s own F1 curve |
| Post-processing | Done inside the library | Default YOLO26 detection exports return raw predictions that need external NMS; nms=False gives NMS-free output shaped (batch, max_det, 6) |
| Frame handling | stream_buffer=False drops old frames to stay real-time; True queues every frame but adds latency if inference is slower than the stream |
On a triggered station a dropped frame is an uninspected part, so the trigger design decides which behaviour is acceptable |
| Batching | batch only applies to directories, video files or .txt sources |
One part at a time; per-part latency matters more than batch throughput |
| Timing | A per-image breakdown of preprocess, inference and postprocess milliseconds | First INT8 TensorRT calls run slower than usual, as do calls at an image size different from export |
The runtime gap alone can be large. Ultralytics’ ExecuTorch benchmark shows YOLO26n at 314.80 ms per image in PyTorch and 142 ms in ExecuTorch, and YOLO26s at 930.90 ms against 376.1 ms, though ExecuTorch export is fixed at FP32 with no FP16 or INT8 conversion. Accuracy can move on export too: the MLPerf authors found that converting SSD-MobileNet-v1 from TensorFlow to TensorFlow Lite, which implements a different NMS, dropped mAP from 23.1% to 22.3%. Ultralytics supports validating an exported model directly, and we would run that check on every export before trusting a confidence threshold carried over from the notebook.
For batching on a GPU, see what batching really changes for YOLO inference on GPU; building the right pipeline around a YOLO-family detector covers the stages around the model.
How Do MLPerf’s YOLO Results Help Choose Inspection Hardware?
MLPerf results compare hardware under fixed rules on one YOLO workload, which is useful for shortlisting edge devices but does not measure your model, resolution or pipeline. MLCommons chose YOLO11l for the MLPerf Inference v6.0 YOLO benchmark, at 53.4% mAP on COCO with 25.3 million parameters. It runs in three scenarios: Offline measures peak throughput with all queries sent at once, Single-Stream measures latency for one image at a time over 1,024 queries and 60 seconds, and Multi-Stream measures how many concurrent streams the system supports.
Two accuracy tiers sit on top. A yolo-95 submission must reach 95% of the reference score and a yolo-99 submission 99%, which works out to about 0.507 and 0.529 mAP against the 0.534 reference.
Reading these for a station, we would map scenarios to the physical setup: Single-Stream is closest to one camera triggered per part, Multi-Stream to several cameras sharing one box, and Offline is throughput a part-by-part line never gets. The MLPerf paper shows why the distinction matters: the server scenario’s latency constraint cut throughput relative to Offline by as little as 3% for some systems and by 50% for others. Whether a device’s result met yolo-99 or only yolo-95 tells you whether that system stayed within 1% or within 5% of the reference accuracy.
The limits are just as concrete. MLPerf allows untimed preprocessing, so transforming inputs into a system’s ideal format falls outside the measured latency. The workload is COCO, not your defects, and YOLO11l is far larger than the 2.6M-parameter nano variant MLCommons lists for mobile and IoT edge. Use the published results to rule devices in or out, then measure the shortlisted ones with your exported model at your resolution.
The Number That Should Sign off the Station
The figure worth signing against is not the model’s average milliseconds. It is the 99th-percentile trigger-to-reject latency, measured on the target device with the exported and quantised model at production resolution, together with per-class recall on the smallest defect class you are obliged to catch. Get those two from the actual hardware and the earlier choices (version, export path, slicing) become checkable rather than hopeful. What keeps those numbers true after go-live, as models are retrained and defect classes added, is the subject of the production reliability artefacts that keep a line-side model running.