SSD: Single Shot MultiBox Detector
- Publication
- ECCV 2016Conference
- First submitted to arXiv
- arXiv:1512.02325
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{objectdetectionssd2015,
title = {{SSD: Single Shot MultiBox Detector}},
author = {Wei Liu and Dragomir Anguelov and Dumitru Erhan and Christian Szegedy and Scott Reed and Cheng-Yang Fu and Alexander C. Berg},
year = {2015},
eprint = {1512.02325},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1512.02325}
}
Faster R-CNN was still the industry benchmark.
The common workflow typically follows these steps:
- Bounding Box Proposal: Use an RPN to generate candidate boxes.
- Feature Resampling for Each Box (RoI Pooling): Resample features for each proposed region.
- Classification: Send the features to a classifier.
Defining the Problem
Although these methods are accurate, their computational cost remains high, especially for embedded systems. Even the high-accuracy Faster R-CNN comparison in the paper reaches only about 7 FPS.
The authors see a bottleneck in processing and classifying each proposed region. Perhaps… we can skip that step.
Solution
Model Architecture
To address this problem, the authors proposed the SSD architecture. The image above compares SSD with YOLO-v1.
As shown, SSD eliminates region proposals and predicts directly from locations on several feature maps.
While this may seem abstract, let’s break it down step by step:
-
First, use VGG as the backbone and extract a feature map at a 1/8 scale, sized .
At each location, the network predicts class scores and location offsets for four default boxes with different scales or aspect ratios.
This results in candidate default boxes.
-
The feature map is then downsampled to .
Here, 6 detection boxes are predicted per pixel, so this layer predicts boxes.
-
Downsample the feature map again to .
Six detection boxes are predicted, resulting in boxes.
-
Downsample again to .
This layer predicts 6 boxes, yielding boxes.
-
Next, downsample to .
This layer predicts 4 boxes, giving boxes.
-
Finally, downsample to .
This layer predicts 4 boxes, resulting in boxes.
Adding all of these up: candidate default boxes, before filtering and non-maximum suppression.
Positive and Negative Sample Matching Strategy
During training, we need to decide which default boxes correspond to each ground-truth box.
The default boxes vary in position, aspect ratio, and scale so they can cover objects of different shapes and sizes.
The authors use Jaccard overlap, the ratio of intersection to union (usually called IoU), to match default boxes with ground truth.
For each ground-truth box, they first select the default box with the highest IoU. This ensures that every ground-truth box has at least one match and gives the network a box from which to learn a location adjustment.
Unlike MultiBox, SSD does not stop there. It also matches default boxes with IoU greater than 0.5 against any ground-truth box. Multiple overlapping default boxes can therefore become positives instead of retaining only each ground truth's best match.
This flexibility improves the accuracy of predictions when multiple suitable predicted boxes exist.
Training Objective
SSD’s training objective extends the MultiBox loss function to handle multiple object classes.
Let indicate whether default box matches ground-truth box of class . Since one ground-truth box can match several default boxes, .
The total loss is a weighted sum of localization loss () and confidence loss ():
Here is the number of matched default boxes; if , the loss is set to zero. Cross-validation sets .
-
Localization Loss
Smooth L1 loss compares the predicted offsets () with the target offsets () of ground truth () relative to a default box (). As in Faster R-CNN, it regresses the center (), width (), and height ():
The offsets for the ground truth boxes are computed as:
-
Confidence Loss
The confidence loss is based on softmax loss and measures the difference between predicted class scores and the true class:
where is the predicted probability for class :
Most default boxes are background after matching. The authors select harder negatives by confidence loss and keep at most a 3:1 negative-to-positive ratio, rather than training on all of them.
Predicting Box Sizes and Aspect Ratios
The scales and aspect ratios of the prediction boxes in SSD are carefully designed. Suppose we have feature maps for prediction. The scale of the prediction box at layer is calculated as:
Here and . The general formula spaces intermediate scales evenly between them.
Different aspect ratios, , are used for each prediction box.
The width and height of each prediction box are:
Additionally, an extra box is added for aspect ratio 1, with the following scale:
This set of aspect ratios generally yields six default boxes per location. In the SSD300 configuration shown above, conv4_3, conv10_2, and conv11_2 omit the and aspect ratios and use only four boxes each; that is how the total becomes 8,732.
The center of each box is located at:
where is the size of feature map , and . The minimum is part of the general scale formula; on VOC, SSD300 separately sets the earliest conv4_3 scale to .
Combining positions, scales, and aspect ratios lets SSD cover different object shapes and sizes. In the figure below, the dog's ground-truth box matches a default box on the map but not one on the map: those finer-map default boxes do not overlap the dog enough and are treated as negatives during training.
Discussion
The authors performed an extensive analysis of the model’s design and evaluated its experimental results.
Data Augmentation
Look at the first and last columns of the table above for SSD’s data augmentation.
SSD uses a broader cropping and distortion strategy similar to YOLO. In this Table 2 comparison, switching that setting raises VOC2007 test mAP from 65.5% to 74.3%, a gain of 8.8 percentage points. The authors speculate that methods with RoI pooling may benefit less, but the table does not test those methods.
Variety of Box Shapes
The design of default-box shapes significantly affects performance. The six-box configuration in this ablation includes aspect ratios and one extra scale at aspect ratio 1. As noted above, not every layer of the actual SSD300 configuration uses six boxes.
- Removing aspect ratios and lowers mAP from 74.3% to 73.7%, a drop of 0.6 percentage points.
- Removing and as well lowers mAP to 71.6%, another 2.1 percentage points.
This supports the use of varied default-box shapes to help predict object boundaries.
Atrous Convolution
SSD uses atrous convolution in an adjusted high-level VGG16 configuration. In Table 2, a comparison with the full VGG16 base, original pool5 setting, changed fc6/fc7 subsampling, and a conv5_3 prediction map yields 74.2% mAP versus 74.3% for the original setup, but runs about 20% slower.
That comparison changes several design choices together; the speed difference cannot be attributed to atrous convolution alone.
Class Analysis
The authors conducted a detailed analysis across different classes (e.g., animals, vehicles, furniture) and studied the distribution of false positives.
The top row shows cumulative shares of correct detections and different false-positive types as the number of detections grows. The solid red line is recall under the 0.5 IoU criterion, and the dashed line uses the looser 0.1 IoU criterion; the latter is higher.
The bottom graph categorizes false positives in each class into errors due to poor localization (Loc), confusion with similar classes (Sim), confusion with other classes (Oth), and background (BG) errors.
These charts compare detections and error types among animal, vehicle, and furniture categories. Object size and aspect ratio belong to the next figure.
Object Size Analysis
The authors also explored how the size and aspect ratio of bounding boxes impact model performance.
In the left plot, very small and small objects fare noticeably worse than larger ones in several categories; for example, SSD300's chair score is around 0.09 for XS and 0.67 for M. SSD512 generally improves XS. The right plot varies by category and shows no uniform rule that a more extreme aspect ratio always means lower accuracy. The results support the choice of varied default-box shapes.
Performance on COCO Dataset
Objects in the COCO dataset are typically smaller than those in the PASCAL VOC dataset, so SSD adjusts its box sizes accordingly.
- The minimum general box scale () decreases from 0.2 to 0.15, while conv4_3 uses 0.07 (21 pixels in a 300×300 image).
- For the SSD512 model, the minimum box scale is further reduced to 0.1, and the conv4_3 layer is set to 0.04.
- SSD300 and SSD512 models are trained on the trainval35k dataset.
- The training process consists of three stages: 160,000 iterations with a learning rate of , followed by 40,000 iterations at , and a final 40,000 iterations at .
On COCO test-dev2015, SSD300 reaches 41.2 [email protected] and 23.2 AP@[0.5:0.95], both above the Fast R-CNN configurations in the table. Its [email protected] is 23.4, close to ION's 23.6 and Faster R-CNN's 23.5, while its [email protected] is below the latter's 45.3. These methods do not all use identical COCO training subsets.
At 512×512 input, SSD512 reaches 46.5 [email protected] and 26.8 AP@[0.5:0.95], above the table's Faster R-CNN row at 45.3 and 24.2. Its [email protected] is 27.8 versus 23.5, a 4.3-percentage-point gap according to the table; the paper's prose says 5.3%, which does not match those rows. The [email protected] gap is 1.2 percentage points.
Against that same Faster R-CNN row, SSD512 has 4.8-percentage-point higher AP and 4.6-point higher AR for large objects, versus only 1.3-point higher AP and 2.0-point higher AR for small objects. The gains are more visible for large objects in this COCO comparison; small objects remain harder.
Visual Results
Conclusion
SSD's main advantage is that it dispenses with region proposals and predicts detections directly from feature maps. That substantially improves speed while retaining strong accuracy. SSD300 reports 59 FPS and higher VOC detection accuracy than the contemporary YOLOv1; the paper's timing table measures that 59 FPS at batch size 8, while its YOLOv1 row uses batch size 1.
Additionally, SSD performs multi-scale object detection by predicting from multiple feature maps. This design allows the model to effectively detect objects of various sizes and shapes.
SSD, as an efficient object detection method, deserves further study.