The Vision Journalmodel cards for computer vision

Model library › Applications

Skip the Model Zoo: Pick One Detector and Ship It

Model card filed 2026-10-28

01 Overview

Object detection is a core computer vision task that involves locating and classifying multiple objects within an image. Unlike image classification, which assigns a single label to an entire image, detection requires the model to output bounding boxes and class labels for each object of interest. This makes it fundamental for applications such as autonomous driving, surveillance, and retail analytics. While numerous detector architectures exist, many practitioners fall into the trap of endlessly experimenting with different models from a so-called model zoo, hoping to find the perfect one. This article argues for a different approach: pick one detector, understand it deeply, and ship it.

The model zoo refers to the vast collection of pre-trained models available in various repositories, each with its own trade-offs in speed, accuracy, and complexity. While having options is beneficial, the sheer number can lead to analysis paralysis. Teams may spend weeks or months benchmarking models, tweaking hyperparameters, and chasing marginal gains, delaying deployment. Instead, a more pragmatic strategy is to select a single, well-understood detector that meets the project's requirements and focus on optimizing the entire pipeline around it. This includes data collection, annotation, training, evaluation, and deployment.

By committing to one detector, you gain several advantages. You become intimately familiar with its strengths and weaknesses, enabling you to design better data augmentation, pre-processing, and post-processing steps. You can also optimize inference speed and memory usage for your specific hardware. Moreover, maintaining a single model simplifies versioning, monitoring, and updates in production. The goal is not to achieve state-of-the-art results on a benchmark but to deliver reliable, maintainable solutions that solve real-world problems. This article provides a comprehensive guide to selecting, training, and deploying a single-stage detector, using a generic architecture as an example.

02 What the model is for

A single-stage detector is designed to predict bounding boxes and class probabilities directly from an input image in a single forward pass. This contrasts with two-stage detectors, which first generate region proposals and then classify them. The single-stage approach prioritizes speed, making it suitable for real-time applications where latency is critical. Common use cases include detecting pedestrians in autonomous vehicles, identifying defects in manufacturing lines, and monitoring inventory on retail shelves. The model outputs a set of detections, each comprising a bounding box, a class label, and a confidence score. The confidence score indicates the model's certainty that the box contains an object of the specified class.

The primary purpose of this detector is to provide a balance between accuracy and efficiency. While it may not achieve the absolute highest accuracy on challenging benchmarks, it often delivers sufficient performance for many practical scenarios. For instance, in retail inventory monitoring, the detector must identify products on shelves, even when they are partially occluded or viewed from different angles. The model's ability to process images quickly allows for continuous monitoring, enabling timely restocking and reducing out-of-stock incidents. Similarly, in security and surveillance, the detector can flag intruders or suspicious activities in real time, allowing immediate response.

It is important to note that the detector is not a one-size-fits-all solution. Its performance depends heavily on the quality and diversity of the training data, as well as the complexity of the scenes it encounters. In environments with dense object arrangements or very small objects, the detector may struggle, producing missed detections or false positives. Therefore, understanding the intended application and its constraints is crucial before committing to this architecture. The following sections will delve into the data requirements, architectural details, training procedures, and limitations to help you make an informed decision.

03 The data it needs

Like all supervised deep learning models, a single-stage detector requires a large, well-annotated dataset. Each training image must be paired with ground-truth annotations that specify the bounding box coordinates and class labels for every object of interest. The quality of these annotations directly impacts the model's performance. Inconsistent or inaccurate boxes can lead to poor localization and classification. Therefore, investing time in creating a robust annotation pipeline is essential. This includes defining clear labeling guidelines, training annotators, and implementing quality checks. For some applications, semi-automated annotation tools can speed up the process, but human verification remains critical.

The dataset should be diverse, covering variations in lighting, weather, occlusion, object scale, and background clutter that the model will encounter in deployment. For example, a retail inventory detector should include images from different store layouts, shelf heights, and product arrangements. It should also include examples of partially visible products, products in different orientations, and products with varying packaging designs. If the model will be deployed in a new environment, it is advisable to collect and annotate a small set of images from that environment and fine-tune the model. This domain adaptation can significantly improve performance.

In addition to images and bounding boxes, some training regimes benefit from auxiliary data such as segmentation masks or keypoints, but these are not strictly necessary for basic detection. The dataset should be split into training, validation, and test sets. The training set is used to update the model weights, the validation set is used to tune hyperparameters and monitor for overfitting, and the test set provides an unbiased evaluation of the final model. A common split is 70% training, 15% validation, and 15% test, but the exact proportions depend on the dataset size. It is also important to ensure that the splits are representative of the overall distribution and that there is no data leakage between them.

04 Architecture in plain terms

A single-stage detector typically consists of three main components: a backbone network, a neck, and a detection head. The backbone is a convolutional neural network that extracts feature maps from the input image. It is often a classification network, such as a residual network, pre-trained on a large dataset like ImageNet. The backbone progressively downsamples the spatial dimensions while increasing the number of channels, producing feature maps at multiple scales. These multi-scale features are crucial for detecting objects of various sizes. The neck, such as a feature pyramid network, combines features from different levels to enhance the representation, especially for small objects. It upsamples deeper, semantically rich features and merges them with shallower, higher-resolution features.

The detection head takes the refined features and predicts bounding boxes and class probabilities at each spatial location. In anchor-based detectors, the head predicts offsets relative to a set of predefined anchor boxes of different scales and aspect ratios. In anchor-free detectors, the head directly predicts the center point and dimensions of objects, simplifying the design. The head typically consists of several convolutional layers followed by separate branches for classification and regression. The classification branch outputs a probability distribution over the classes for each anchor or location, while the regression branch outputs the four coordinates of the bounding box. During training, a matching strategy assigns anchors or locations to ground-truth objects based on intersection over union (IoU) thresholds.

The architecture is designed to be fully convolutional, allowing it to process images of varying sizes, though a fixed input size like 640x640 is common for training and inference. The output is a set of detections after applying non-maximum suppression (NMS) to remove duplicate boxes. NMS is a post-processing step that keeps the highest-scoring box among overlapping ones. The entire model is trained end-to-end with a multi-task loss that combines classification loss (e.g., cross-entropy) and localization loss (e.g., smooth L1). This unified loss enables the model to learn both what and where objects are simultaneously.

05 Training and evaluation

Training a single-stage detector involves several key steps: data preparation, model initialization, loss computation, and optimization. First, the dataset is preprocessed, which may include resizing images to a fixed input size, normalizing pixel values, and applying data augmentation techniques such as random cropping, flipping, and color jittering. Data augmentation helps improve generalization by exposing the model to varied versions of the training data. The model is typically initialized with weights pre-trained on a large classification dataset, which speeds up convergence and improves performance, especially when the detection dataset is small. The detection head is randomly initialized. The model is then trained using stochastic gradient descent (SGD) or a variant like Adam, with a learning rate schedule that decays over time.

The loss function is a combination of classification loss and localization loss. For classification, a common choice is cross-entropy loss, which measures the difference between predicted class probabilities and true labels. For localization, smooth L1 loss or IoU-based losses are used to penalize differences between predicted and ground-truth box coordinates. The total loss is a weighted sum of these components, and the weights are hyperparameters that need tuning. During training, the model's performance is monitored on the validation set using metrics like mean Average Precision (mAP). mAP is computed by averaging the precision-recall curves across all classes and IoU thresholds (e.g., 0.5). A higher mAP indicates better detection performance.

After training, the model is evaluated on the test set to obtain an unbiased estimate of its performance. It is important to also evaluate the model's speed (e.g., frames per second) and memory footprint, as these are critical for deployment. If performance is unsatisfactory, one can iterate on data collection, augmentation, architecture tweaks, or hyperparameters. However, it is crucial to avoid overfitting to the validation set. Techniques like early stopping and cross-validation can help. Once satisfied, the model is exported for deployment, often using a format that optimizes inference on the target hardware.

06 Limitations and failure modes

Despite their versatility, single-stage detectors have several limitations. One major challenge is detecting small objects. Because the backbone downsamples the image, small objects may occupy only a few pixels in the deepest feature maps, making them hard to distinguish. While feature pyramid networks help by combining high-resolution features, performance on tiny objects often remains inferior to two-stage detectors or specialized architectures. In dense scenes with many overlapping objects, the model may produce duplicate detections or miss objects due to non-maximum suppression thresholds that are too aggressive or too lenient. Tuning NMS is a delicate balance: a high threshold may keep duplicates, while a low threshold may suppress valid detections of nearby objects.

Another limitation is the domain gap. A model trained on one dataset may perform poorly on images from a different distribution, such as a new camera, lighting condition, or geographic location. This is because the model learns biases present in the training data. For example, if trained only on daytime images, it may fail at night. Similarly, if trained on a specific product line, it may not generalize to new products. Addressing this requires continuous data collection and retraining, which can be resource-intensive. Additionally, the model's confidence scores are not always well-calibrated; a high score does not guarantee correctness, and a low score does not necessarily mean the detection is wrong. This can lead to false positives or false negatives in critical applications.

Finally, single-stage detectors can be sensitive to hyperparameters such as anchor sizes, loss weights, and learning rate. Poor choices can lead to slow convergence or suboptimal performance. They also require substantial computational resources for training, often necessitating GPUs. Inference on edge devices may require model compression techniques like quantization or pruning, which can further degrade accuracy. It is essential to understand these limitations and plan for them. Regular monitoring and updating of the model in production are necessary to maintain performance as the environment changes.

07 Frequently asked questions

Q: How do I choose between a single-stage and a two-stage detector? A: Single-stage detectors are generally faster and simpler, making them ideal for real-time applications. Two-stage detectors often achieve higher accuracy, especially on small objects, but at the cost of speed. If latency is critical, start with a single-stage detector. If accuracy is paramount and you can afford the computational cost, consider two-stage. However, with recent advances, the gap has narrowed, and a well-tuned single-stage detector can suffice for many use cases.

Q: What input size should I use? A: The input size depends on the object sizes in your application and the available computational budget. Larger inputs (e.g., 640x640 or higher) improve small object detection but increase inference time and memory. Smaller inputs (e.g., 320x320) are faster but may miss small objects. Start with a standard size like 640x640 and experiment. Ensure that the aspect ratio of your objects is preserved or appropriately handled.

Q: How much data do I need? A: There is no fixed number; it depends on the complexity of the task and the variability of the objects. As a rule of thumb, you need at least a few thousand annotated instances per class for decent performance. More data generally leads to better results, but quality matters more than quantity. Focus on diverse, well-annotated data that covers edge cases.

Q: Can I use a pre-trained model? A: Yes, using a backbone pre-trained on a large classification dataset is standard practice and highly recommended. It speeds up training and improves performance, especially when your detection dataset is limited. You can also fine-tune a detector pre-trained on a similar detection dataset if available.

Q: How do I handle class imbalance? A: Class imbalance is common in detection. Techniques include oversampling rare classes, using focal loss to down-weight easy negatives, and adjusting loss weights. Also, ensure your evaluation metrics account for per-class performance, not just overall mAP.