The YOLO object detection model (YOLO stands for You Only Look Once) treats detection as a regression problem: a single neural network looks at the full image once and predicts bounding boxes and class probabilities together. Each prediction is a box, a class label and a confidence score between 0 and 1. That single-pass design is what makes YOLO fast. It also means the detector only sees what reaches its input, and on a high-resolution inspection image resized to 640×640, a small defect can shrink to a few pixels and be missed. So the useful question on a production line is not only how YOLO works. It is which stage of the pipeline should fix a given miss: the model, or a classical step in front of it.
How Does YOLO Object Detection Actually Work in One Pass?
The original design divides the image into an S×S grid, and each cell is responsible for objects whose centres fall inside it. Each cell predicts a fixed number of boxes (centre coordinates relative to the cell, width and height relative to the image, and a confidence score) plus conditional class probabilities, so the whole output is one tensor of shape S×S×(B×5+C) produced in a single forward pass.
A worked example makes the shape concrete. In one published custom detector, a 416×416 RGB input with five anchor boxes per cell and a single class produced a 13×13×30 output: each of the 169 cells returns 30 numbers, five anchors times six values (objectness, four box coordinates, one class score).
Because the same object is often detected several times, a post-processing step called non-maximum suppression (NMS) keeps the highest-confidence prediction and removes others that overlap it beyond an Intersection over Union (IoU) threshold. In practice, then, a YOLO stage is three things you ship together: the network, the box decoding, and NMS with its confidence and IoU thresholds. Change any of the three and the detections change, which is why a threshold tweak in a notebook and a threshold in production need to be the same number.
How Do YOLO’s Single-Shot Grid Predictions Differ from Region-Proposal Detectors?
One-stage detectors such as YOLO drop the region proposal stage entirely and classify and localise in one step, treating detection as dense prediction over a regular grid. Two-stage models such as Faster R-CNN first generate candidate regions and then classify them, and single-stage YOLO models are markedly faster at inference. The original paper reported 45 frames per second for the base model and 155 for the smaller Fast YOLO.
The speed came with a known trade: the authors found YOLO made more localisation errors than the leading detectors of the time but was far less likely to report an object where none existed. For throughput planning, the practical consequence is that a single-shot detector’s cost per frame is set by the input resolution and the network, not by how many candidate regions a scene produces.
The YOLO Architecture: Backbone, Neck and Detection Head
YOLOv10 keeps the modular structure of backbone, neck and head from its YOLOv8 baseline. Reading the architecture as a diagram, a frame flows through these stages:
- Backbone extracts features. In YOLOv3, Darknet-53 does this with stride-2 convolutions that downsample the feature maps as the image moves deeper.
- Neck fuses scales. The feature pyramid idea adds a top-down pathway with lateral connections so that deep, semantically rich features combine with shallower, spatially precise ones; YOLOv7 uses a PAN-FPN neck that passes features in both directions.
- Head predicts boxes, objectness and classes at several scales. YOLOv3 predicts at strides 32, 16 and 8, which for a 416×416 input gives 13×13, 26×26 and 52×52 maps for large, medium and small objects respectively. At a 640×640 input the same strides give 20×20, 40×40 and 80×80 maps (640 divided by 32, 16 and 8).
- Post-processing removes duplicates with NMS, or in NMS-free versions uses a one-to-one head that emits one prediction per object.
YOLOX introduced a decoupled head with separate classification and regression branches to reduce interference between the two tasks, and that decoupled design became a defining feature of YOLOv8 and later. Our explainer on where the detection head decides box geometry goes further into what the head outputs and when rotated boxes are worth their cost.
The original design’s coarse final feature map, the result of successive downsampling, hinders precise localisation of small objects and biases the model towards large, well-separated ones.
How to Read YOLO Results: IoU, mAP50 and mAP50-95
IoU measures the overlap between a predicted box and a ground-truth box, from 0 to 1, and a threshold of 0.50 is the usual cut-off for counting a prediction as a true positive. Precision is the share of predicted boxes that match a real object; recall is the share of real objects the model finds. Mean Average Precision (mAP) summarises precision across recall levels and averages it over classes.
The two headline variants answer different questions. [email protected] comes from the PASCAL VOC challenge, while [email protected]:0.95 comes from COCO and averages AP over IoU thresholds from 0.5 to 0.95 in steps of 0.05. COCO treats the averaged version as its primary metric because averaging over IoUs rewards better localisation, and it makes no distinction between AP and mAP.
| Metric | What it tells you | When to weight it |
|---|---|---|
| mAP50 | Whether the model finds and labels objects with loose box fit | Counting, presence or absence of a defect |
| mAP50-95 | Whether boxes are also tightly placed | Overlapping objects, measurement from the box |
| Precision | How often a reported detection is real | False rejects are expensive |
| Recall | How many real objects are found | Every missed defect matters |
| AP small | Performance on objects under 32² pixels | Small-defect inspection |
One PCB study reports recall separately for boxes under 64 px² at the 640-pixel input scale, at the operating confidence threshold. In that PCB study, full-image inference at 640 found none of the 16 to 64 px² defects, a failure size-split recall exposes.
Does Object Detection Replace Feature Extraction and Segmentation in a Hybrid CV Pipeline?
No. Object detection is one stage among several, and in a hybrid pipeline it sits beside classical feature extraction and segmentation rather than replacing them. The small-object literature itself groups its fixes into network architecture, pre- and post-processing, and bounding-box optimisation, which is a reminder that the detector is only one of the places where accuracy is won or lost.
Histograms of oriented gradients are normalised across blocks to increase robustness to illumination and contrast changes. The classical layer of feature extraction and image processing covers those stages in their own right, alongside the business case for classical computer vision.
What Compute and Accuracy Trade-Offs Come from Running YOLO on Full Frames Versus Pre-Cropped ROIs for Small-Defect Detection?
By the conventional definition, objects smaller than 32×32 pixels count as small. Full-frame inference makes many defects small that were not small in the original image: when one PCB dataset is rescaled so its longest side is 640 pixels, the median defect box is about 177 px² (roughly 13×13 pixels) and 4.9% of boxes fall below 64 px², where detection reliability degrades substantially.
Measured tiling results from that PCB study show the size of the effect. On boxes of 16 to 64 px² at 640-pixel scale, full-image inference at 640 recovered none of them, while every tile-based method recovered 46.2% on PCB-Defect and 100% on HRIPCB. Tiling at 640 with NMS reached mAP@50 of 0.707 and 0.901 on the two datasets, and adding overlap plus a tile-aware merging step (TA-TM) reached 0.722 and 0.936. The SAHI paper reported AP gains of 6.8%, 5.1% and 5.3% for FCOS, VFNet and TOOD on aerial datasets, applied on top of the detector without fine-tuning.
The price is compute per image. In the PCB study, full-image inference took 54 to 94 ms per image against 247 to 459 ms for tile-based methods, which the authors judge practical for offline inspection. On aerial imagery, combining full-image and slice predictions cut speed from 30 to 18 FPS. If the part position is known, a classical crop to the region of interest also avoids downsampling the whole image before detection. Our deeper treatment of SAHI with YOLO for small-object detection goes further into slicing.
The Tiling Failure Mode: Training and Inference Scale Must Match
Tiling fails badly when the model was trained on resized full images. In the same study, a detector trained on full images collapsed to mAP@50 of 0.01 under tile inference, while the same architecture trained on 640×640 tile crops reached 0.72 and 0.94 on the two datasets. The reverse also holds: a tile-trained detector run on full images at 640 scored only 0.072 and 0.192. The authors’ conclusion is to align training and inference scale before touching the detector architecture.
The second failure sits at tile edges. Without overlap, recall for defects within 16 pixels of a tile boundary fell to 26.1% on PCB-Defect, and a 128-pixel overlap raised it to 69.6%, and from 62.9% to 100% on HRIPCB. That overlap costs about 35% more tiles per image, with a matching rise in inference time. The TA-TM merging gain was moderate on top of a strong detector, and the authors expect larger gains with weaker detectors or more boundary defects.
Contrast Normalisation on Reflective Parts
A 2026 study on industrial bolt inspection paired Contrast-Limited Adaptive Histogram Equalization (CLAHE) with an unmodified YOLOv8 and reported mAP@50 of 0.9364 and mAP@50-95 of 0.7121 under 3-fold cross-validation, at 29.79 FPS. That is one study on one part type, not a general rule. A separate defect-detection study also adjusted contrast and brightness during preprocessing to reduce the effect of lighting variation.
So where does a classical preprocessing stage improve YOLO results in a production inspection pipeline? In our reading of this evidence, in two places most of all: where the defect occupies too few pixels after resizing (crop or tile at native scale), and where lighting, glare or reflective surfaces hide the defect’s contrast (normalise before detection). It follows a position we hold in general: the largest gains are often in restructuring what is computed, not in computing the same thing faster, and a preprocessing step is exactly that kind of change, unless the pipeline is fixed by an external reference that cannot be altered.
When Should a Team Fine-Tune YOLO Versus Write a Classical Stage in Front of It?
Fine-tune when the model does not know what the target looks like; add a classical stage when the model would recognise the target if it could see it clearly.
TechnoLynx runs a computer vision pipeline architecture review for pipelines where a YOLO detector is one stage, assessing where classical cropping, contrast normalisation or tiling should wrap the model and where fine-tuning is the better fix.
Fine-tuning starts from pretrained weights rather than random initialisation and converges on custom data far faster than training from scratch, because the backbone has already learned general features such as edges, textures and shapes.
In a 2026 aquaculture benchmark, YOLOv8 variants reached 90% mAP50 with 400 training images, while YOLO26 nano and small variants needed about 1,000. Those numbers belong to that dataset and task, but they show that the annotation budget depends on the model generation as well as on the problem.
Deciding per Stage
The decision is easiest when you diagnose the miss before choosing a fix. This table maps common symptoms to the stage we would change first:
| Symptom | First fix | Why |
|---|---|---|
| Missed defects fall below about 64 px² at the input scale | Crop or tile at native resolution, then train on tiles | Resolution collapse; scale must match |
| Misses cluster near tile edges | Add tile overlap and merge predictions | Boundary recall rose from 26.1% to 69.6% with overlap |
| Misses follow lighting, glare or low contrast | Contrast normalisation such as CLAHE | Measured gain with no model change, single study |
| A defect class the model has never seen | Fine-tune on labelled examples | Pretrained features transfer; new classes must be taught |
| Imagery far from COCO (microscopy, aerial) | Two-stage fine-tuning: frozen backbone, then full model at a lower learning rate | Avoids instability from training everything at once |
| Old classes degrade after fine-tuning | Merge original examples into the training set | The only reliable guard against forgetting |
Small datasets also favour freezing, which speeds up training and reduces overfitting when data is small relative to model capacity. The two routes combine, too: SAHI’s slicing-aided fine-tuning lifted AP gains to 12.7%, 13.4% and 14.5% cumulatively for the same three detectors. Our guide to building the right pipeline around a YOLO-family detector takes this per-stage choice further into model selection.
How Does a YOLO Detection Stage Move from an OpenCV/Python Prototype to Production?
Production means exporting the trained model to a runtime matched to the hardware, and Ultralytics’ export mode exists to make a trained model deployable across platforms and devices. Ultralytics states up to 5× GPU speedup with TensorRT and 3× CPU speedup with ONNX or OpenVINO; those are the vendor’s figures.
Independent measurement gives conditional figures. A 2026 industrial machine-vision benchmark found TensorRT cut YOLOv8 latency by roughly 30 to 56% against the next-best framework on NVIDIA GPUs, including Jetson. OpenVINO was fastest on Intel CPUs, while ONNX Runtime was fastest on the Jetson CPU. The ranking is not universal: for the transformer-based Grounding DINO, plain PyTorch beat TensorRT on desktop GPUs. That benchmark also measured network time only, excluding pre- and post-processing. So the CLAHE call, the crop and the tile loop need porting and timing of their own, since a fast engine behind a slow Python preprocessing loop still misses the cycle time. Our article on YOLO inference on GPU and what batching changes covers the server side in more depth.
Quantisation: PTQ or QAT
INT8 export in the Ultralytics docs is post-training quantisation (PTQ), with ranges set in one calibration pass; quantisation-aware training (QAT) instead fine-tunes with fake quantisation in the loop to recover accuracy that calibration loses. On COCO with TensorRT, the vendor reports QAT costing 0.008 to 0.017 mAP50-95 against FP32, while PTQ cost 0.010 on yolo26n and 0.038 to 0.057 on larger models. The same docs say to expect different figures on another dataset, format or TensorRT version and to measure your own.
Edge Hardware: Measure on the Target
GPU speed rankings need not carry over to edge hardware. In the aquaculture benchmark, inference speed rankings on an A100 GPU did not carry over to the CPU-only Raspberry Pi 5, and choosing on GPU speed would have picked the wrong model. On Rockchip NPUs, a 2026 benchmark found latency tracked accuracy and architecture more closely than FLOPs, resolution scaling departed from quadratic predictions because of memory bandwidth, and memory contention slowed the lower-end SoCs by 50 to 270%. Its deployment path ran ONNX export, INT8 quantisation by PTQ or QAT, compilation with the vendor toolkit, then execution on the NPU.
If bandwidth limits how far resolution can scale, cropping to the region of interest before the detector reduces what the NPU has to move as well as what it has to compute. What keeps a deployed model reliable once it runs line-side is covered in our piece on the artefacts that keep an industrial CV inspection model running.
Is YOLO Still a Current Choice, and What Has Changed Since the Original Design?
Yes, YOLO remains relevant in research and industry, though its design has moved a long way from the original grid. YOLOv2 brought anchor boxes, and YOLOX began the move to anchor-free prediction of object centres and sizes. Ultralytics released YOLOv8 on 10 January 2023 with an anchor-free split head. YOLOv10, released in 2024, removed NMS from inference with consistent dual assignments: a one-to-many head for rich training supervision and a one-to-one head used alone at inference. The NMS-free version had a cost: in the smallest models, one-to-many training with NMS still beat NMS-free training by 1.0 AP for YOLOv10-N and 0.5 AP for YOLOv10-S. YOLOv12 brought attention modules into the pipeline while aiming to keep real-time speed.
YOLO26 is an Ultralytics family with optional native end-to-end inference from a one-to-one head and a default one-to-many path that still uses NMS for accuracy. Independent results show selective benefits. On the Raspberry Pi 5, YOLO26n was the fastest nano model at 7.51 FPS, yet its gain over YOLO11n was 11.9%, well short of the up to 43% Ultralytics reports on an Intel Xeon. On GPU, YOLO26 had the highest end-to-end latency across size tiers in that study.
End-to-end transformer detectors offer an alternative. The RT-DETR authors argue that NMS hurts YOLO’s speed and accuracy and that end-to-end DETR-style detectors remove it, though earlier DETRs were held back by computational cost. The comparison of RT-DETR and YOLO for production inspection works through that choice. A 2025 review reads the last decade as a maturing architecture that favours efficiency, stability and deployability over peak COCO scores.
FAQ
Is YOLO a CNN?
Classic YOLO versions are convolutional networks: YOLOv3, for example, uses the Darknet-53 convolutional backbone. Recent versions mix in other modules, and YOLOv12 adopts an attention-focused design.
Is Fine-Tuning the Same as Training?
Fine-tuning is training that starts from pretrained weights instead of random initialisation, so it converges faster and needs less data than training from scratch.