{"notes":[{"id":"object-detection/ssd","category":"object-detection","legacyPath":"object-detection/1512-ssd","legacySlug":"1512-ssd","legacyPaths":[],"title":"SSD","subtitle":"Save Time, Save Pooling","author":"Z. Yuan","paperDate":"2015-12-08","publishedOn":"2024-09-30","paperTitle":"SSD: Single Shot MultiBox Detector","paperUrl":"https://arxiv.org/abs/1512.02325","bibliography":{"title":"SSD: Single Shot MultiBox Detector","authors":["Wei Liu","Dragomir Anguelov","Dumitru Erhan","Christian Szegedy","Scott Reed","Cheng-Yang Fu","Alexander C. Berg"],"url":"https://arxiv.org/abs/1512.02325","pdfUrl":"https://arxiv.org/pdf/1512.02325","codeUrl":"https://github.com/weiliu89/caffe/tree/ssd","preprint":{"id":"1512.02325","submittedOn":"2015-12-08","url":"https://arxiv.org/abs/1512.02325"},"publication":{"venue":"ECCV","year":2016,"kind":"conference","url":"https://link.springer.com/chapter/10.1007/978-3-319-46448-0_2"},"citation":"@misc{objectdetectionssd2015,\n  title = {{SSD: Single Shot MultiBox Detector}},\n  author = {Wei Liu and Dragomir Anguelov and Dumitru Erhan and Christian Szegedy and Scott Reed and Cheng-Yang Fu and Alexander C. Berg},\n  year = {2015},\n  eprint = {1512.02325},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1512.02325}\n}\n","citationPath":"/content/papers/citations/object-detection/ssd.fa257a9f1a4b.bib"},"thumbnail":{"src":"/content/papers/assets/dc275040ac321a1d5717e3262cb4c1e1337baaef539b0fc289e632e469721ccf.jpg","width":1634,"height":626},"locale":"en","path":"/content/papers/en/object-detection/ssd.a91d79bf7afd.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solution","text":"Solution","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"positive-and-negative-sample-matching-strategy","text":"Positive and Negative Sample Matching Strategy","depth":3},{"id":"training-objective","text":"Training Objective","depth":3},{"id":"predicting-box-sizes-and-aspect-ratios","text":"Predicting Box Sizes and Aspect Ratios","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"data-augmentation","text":"Data Augmentation","depth":3},{"id":"variety-of-box-shapes","text":"Variety of Box Shapes","depth":3},{"id":"atrous-convolution","text":"Atrous Convolution","depth":3},{"id":"class-analysis","text":"Class Analysis","depth":3},{"id":"object-size-analysis","text":"Object Size Analysis","depth":3},{"id":"performance-on-coco-dataset","text":"Performance on COCO Dataset","depth":3},{"id":"visual-results","text":"Visual Results","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{"problem-definition":"defining-the-problem","predict-directly-from-multiple-feature-maps":"model-architecture","matching-boxes-to-ground-truth":"positive-and-negative-sample-matching-strategy","experimental-results-and-discussion":"discussion","voc-accuracy-speed-and-ablations":"data-augmentation","small-objects-remain-difficult":"object-size-analysis"},"guide":null,"relatedReading":[{"id":"feature-fusion/fpn","relation":"citing","topic":""}]},{"id":"feature-fusion/fpn","category":"feature-fusion","legacyPath":"feature-fusion/1612-fpn","legacySlug":"1612-fpn","legacyPaths":[],"title":"FPN","subtitle":"The Pyramid Structure","author":"Z. Yuan","paperDate":"2016-12-09","publishedOn":"2024-04-06","paperTitle":"Feature Pyramid Networks for Object Detection","paperUrl":"https://arxiv.org/abs/1612.03144","bibliography":{"title":"Feature Pyramid Networks for Object Detection","authors":["Tsung-Yi Lin","Piotr Dollár","Ross Girshick","Kaiming He","Bharath Hariharan","Serge Belongie"],"url":"https://arxiv.org/abs/1612.03144","pdfUrl":"https://arxiv.org/pdf/1612.03144","codeUrl":null,"preprint":{"id":"1612.03144","submittedOn":"2016-12-09","url":"https://arxiv.org/abs/1612.03144"},"publication":{"venue":"CVPR","year":2017,"kind":"conference","url":"https://doi.org/10.1109/cvpr.2017.106"},"citation":"@misc{featurefusionfpn2016,\n  title = {{Feature Pyramid Networks for Object Detection}},\n  author = {Tsung-Yi Lin and Piotr Dollár and Ross Girshick and Kaiming He and Bharath Hariharan and Serge Belongie},\n  year = {2016},\n  eprint = {1612.03144},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1612.03144}\n}\n","citationPath":"/content/papers/citations/feature-fusion/fpn.e4ffc8178c44.bib"},"thumbnail":{"src":"/content/papers/assets/4909dfc99cc56eb950023c336b6390fc9b1d1c637bba715e12905800bb1a12e8.jpg","width":1024,"height":887},"locale":"en","path":"/content/papers/en/feature-fusion/fpn.cfa34a497f0f.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"fpn-model-design","text":"FPN Model Design","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"is-it-really-better","text":"Is It Really Better?","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"feature-fusion/panet","relation":"next","topic":"Fusing multiscale features for detection"}]}],"text":"Faster R-CNN was still the industry benchmark.\n\nThe common workflow typically follows these steps:\n\n1. **Bounding Box Proposal**: Use an RPN to generate candidate boxes.\n2. **Feature Resampling for Each Box (RoI Pooling)**: Resample features for each proposed region.\n3. **Classification**: Send the features to a classifier.\n\n## Defining the Problem\n\nAlthough 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.\n\nThe authors see a bottleneck in processing and classifying each proposed region. Perhaps… we can skip that step.\n\n## Solution\n\n### Model Architecture\n\n![model arch](/content/papers/assets/21fe80f8a5237d6948480468c4e5edfc5c0a53f6d8d165761eba8a7dfd9300bc.jpg)\n\nTo address this problem, the authors proposed the SSD architecture. The image above compares SSD with YOLO-v1.\n\nAs shown, SSD eliminates region proposals and predicts directly from locations on several feature maps.\n\nWhile this may seem abstract, let’s break it down step by step:\n\n1. First, use VGG as the backbone and extract a feature map at a 1/8 scale, sized $38 \\times 38$.\n\n   At each location, the network predicts class scores and location offsets for four default boxes with different scales or aspect ratios.\n\n   This results in $38 \\times 38 \\times 4 = 5776$ candidate default boxes.\n\n\n> [!TIP]\n> \n> In the figure, the output size is $38 \\times 38 \\times 4 \\times (\\text{Classes}+4)$. For each default box, $\\text{Classes}+4$ means scores for all classes, including background, plus four location offsets relative to that box ($cx$, $cy$, $w$, $h$).\n\n\n---\n\n2. The feature map is then downsampled to $19 \\times 19$.\n\n   Here, 6 detection boxes are predicted per pixel, so this layer predicts $19 \\times 19 \\times 6 = 2166$ boxes.\n\n---\n\n3. Downsample the feature map again to $10 \\times 10$.\n\n   Six detection boxes are predicted, resulting in $10 \\times 10 \\times 6 = 600$ boxes.\n\n---\n\n4. Downsample again to $5 \\times 5$.\n\n   This layer predicts 6 boxes, yielding $5 \\times 5 \\times 6 = 150$ boxes.\n\n---\n\n5. Next, downsample to $3 \\times 3$.\n\n   This layer predicts 4 boxes, giving $3 \\times 3 \\times 4 = 36$ boxes.\n\n---\n\n6. Finally, downsample to $1 \\times 1$.\n\n   This layer predicts 4 boxes, resulting in $1 \\times 1 \\times 4 = 4$ boxes.\n\n---\n\nAdding all of these up: $5776 + 2166 + 600 + 150 + 36 + 4 = 8732$ candidate default boxes, before filtering and non-maximum suppression.\n\n\n> [!TIP]\n> \n> We’re not just throwing numbers around. The number 8732 appears in the paper, and we were curious how it was derived, so we did the math.\n> \n> Using feature maps all the way down to $1\\times1$ is also worth noticing in this architecture.\n\n\n### Positive and Negative Sample Matching Strategy\n\nDuring training, we need to decide which default boxes correspond to each ground-truth box.\n\nThe default boxes vary in position, aspect ratio, and scale so they can cover objects of different shapes and sizes.\n\nThe authors use **Jaccard overlap**, the ratio of intersection to union (usually called IoU), to match default boxes with ground truth.\n\nFor 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.\n\nUnlike 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.\n\nThis flexibility improves the accuracy of predictions when multiple suitable predicted boxes exist.\n\n### Training Objective\n\nSSD’s training objective extends the MultiBox loss function to handle multiple object classes.\n\n- [**[13.12] Scalable Object Detection using Deep Neural Networks**](https://arxiv.org/abs/1312.2249)\n\nLet $x_{ij}^{p}\\in\\{0,1\\}$ indicate whether default box $i$ matches ground-truth box $j$ of class $p$. Since one ground-truth box can match several default boxes, $\\sum_i x_{ij}^{p}\\geq1$.\n\nThe total loss is a weighted sum of **localization loss** ($L_{loc}$) and **confidence loss** ($L_{conf}$):\n\n$$\nL(x, c, l, g) = \\frac{1}{N}(L_{conf}(x, c) + \\alpha L_{loc}(x, l, g))\n$$\n\nHere $N$ is the number of matched default boxes; if $N=0$, the loss is set to zero. Cross-validation sets $\\alpha=1$.\n\n- **Localization Loss**\n\n  **Smooth L1 loss** compares the predicted offsets ($l$) with the target offsets ($\\hat g$) of ground truth ($g$) relative to a default box ($d$). As in Faster R-CNN, it regresses the center ($cx,cy$), width ($w$), and height ($h$):\n\n  $$\n  L_{loc}(x, l, g) = \\sum_{i \\in Pos} \\sum_{m \\in \\{cx, cy, w, h\\}} x_{ij}^p \\cdot smoothL1(l^m_i - \\hat{g}^m_j)\n  $$\n\n  The offsets for the ground truth boxes $\\hat{g}$ are computed as:\n\n  $$\n  \\hat{g}^{cx}_j = \\frac{g^{cx}_j - d^{cx}_i}{d^w_i}, \\quad \\hat{g}^{cy}_j = \\frac{g^{cy}_j - d^{cy}_i}{d^h_i}\n  $$\n\n  $$\n  \\hat{g}^w_j = \\log \\frac{g^w_j}{d^w_i}, \\quad \\hat{g}^h_j = \\log \\frac{g^h_j}{d^h_i}\n  $$\n\n\n> [!TIP]\n> \n> The center offsets are divided by the **default box's** width $d_i^w$ and height $d_i^h$; width and height use log ratios to that same box. This expresses regression targets at relative scales for objects of different sizes.\n\n\n- **Confidence Loss**\n\n  The confidence loss is based on **softmax loss** and measures the difference between predicted class scores and the true class:\n\n  $$\n  L_{conf}(x, c) = - \\sum_{i \\in Pos} x_{ij}^p \\log(\\hat{c}^p_i) - \\sum_{i \\in Neg} \\log(\\hat{c}^0_i)\n  $$\n\n  where $\\hat{c}^p_i$ is the predicted probability for class $p$:\n\n  $$\n  \\hat{c}^p_i = \\frac{\\exp(c^p_i)}{\\sum_q \\exp(c^q_i)}\n  $$\n\n  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.\n\n### Predicting Box Sizes and Aspect Ratios\n\nThe scales and aspect ratios of the prediction boxes in SSD are carefully designed. Suppose we have $m$ feature maps for prediction. The scale $s_k$ of the prediction box at layer $k$ is calculated as:\n\n$$\ns_k = s_{\\text{min}} + \\frac{s_{\\text{max}} - s_{\\text{min}}}{m - 1}(k - 1), \\quad k \\in [1, m]\n$$\n\nHere $s_{\\text{min}}=0.2$ and $s_{\\text{max}}=0.9$. The general formula spaces intermediate scales evenly between them.\n\nDifferent aspect ratios, $a_r \\in \\{1, 2, 3, \\frac{1}{2}, \\frac{1}{3}\\}$, are used for each prediction box.\n\nThe width and height of each prediction box are:\n\n$$\nw^a_k = s_k \\sqrt{a_r}, \\quad h^a_k = \\frac{s_k}{\\sqrt{a_r}}\n$$\n\nAdditionally, an extra box is added for aspect ratio 1, with the following scale:\n\n$$\ns'_k = \\sqrt{s_k s_{k+1}}\n$$\n\nThis 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 $1/3$ and $3$ aspect ratios and use only four boxes each; that is how the total becomes 8,732.\n\nThe center of each box is located at:\n\n$$\n\\left( \\frac{i+0.5}{|f_k|}, \\frac{j+0.5}{|f_k|} \\right)\n$$\n\nwhere $|f_k|$ is the size of feature map $k$, and $i,j\\in[0,|f_k|)$. The $0.2$ minimum is part of the general scale formula; on VOC, SSD300 separately sets the earliest conv4_3 scale to $0.1$.\n\nCombining 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 $4\\times4$ map but not one on the $8\\times8$ map: those finer-map default boxes do not overlap the dog enough and are treated as negatives during training.\n\n![dog](/content/papers/assets/dc275040ac321a1d5717e3262cb4c1e1337baaef539b0fc289e632e469721ccf.jpg)\n\n## Discussion\n\nThe authors performed an extensive analysis of the model’s design and evaluated its experimental results.\n\n![ablation](/content/papers/assets/bc4c1a72dadf92bec6327576c514941e42f52adffc1304614335abe10b81202c.jpg)\n\n### Data Augmentation\n\nLook at the first and last columns of the table above for SSD’s data augmentation.\n\nSSD 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.\n\n### Variety of Box Shapes\n\nThe design of default-box shapes significantly affects performance. The six-box configuration in this ablation includes aspect ratios $1/3,1/2,1,2,3$ and one extra scale at aspect ratio 1. As noted above, not every layer of the actual SSD300 configuration uses six boxes.\n\n- Removing aspect ratios $1/3$ and $3$ lowers mAP from 74.3% to 73.7%, a drop of **0.6 percentage points**.\n- Removing $1/2$ and $2$ as well lowers mAP to 71.6%, another **2.1 percentage points**.\n\nThis supports the use of varied default-box shapes to help predict object boundaries.\n\n### Atrous Convolution\n\nSSD 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.\n\nThat comparison changes several design choices together; the speed difference cannot be attributed to atrous convolution alone.\n\n### Class Analysis\n\n![class analysis](/content/papers/assets/ff785b969e48300cbb9aa2b3956a3f87867454fa9eea1498ef99acb1f4048cc6.jpg)\n\nThe authors conducted a detailed analysis across different classes (e.g., animals, vehicles, furniture) and studied the distribution of false positives.\n\nThe 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.\n\nThe 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.\n\nThese charts compare detections and error types among animal, vehicle, and furniture categories. Object size and aspect ratio belong to the next figure.\n\n### Object Size Analysis\n\n![size analysis](/content/papers/assets/55d578caf242dc593a7a4485e6bb6ff355e3a778c22e4afdc5b85e96d4f08235.jpg)\n\nThe authors also explored how the size and aspect ratio of bounding boxes impact model performance.\n\nIn 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.\n\n### Performance on COCO Dataset\n\n![coco result](/content/papers/assets/2ee5ec201f6ac19be49190d688efe28017a8e65e5bff94500eca52a712b6c28f.jpg)\n\nObjects in the COCO dataset are typically smaller than those in the PASCAL VOC dataset, so SSD adjusts its box sizes accordingly.\n\n- The minimum general box scale ($s_{\\text{min}}$) decreases from 0.2 to 0.15, while conv4_3 uses 0.07 (21 pixels in a 300×300 image).\n- For the SSD512 model, the minimum box scale is further reduced to 0.1, and the conv4_3 layer is set to 0.04.\n- SSD300 and SSD512 models are trained on the trainval35k dataset.\n- The training process consists of three stages: 160,000 iterations with a learning rate of $10^{-3}$, followed by 40,000 iterations at $10^{-4}$, and a final 40,000 iterations at $10^{-5}$.\n\n---\n\nOn COCO test-dev2015, SSD300 reaches **41.2 AP@0.5** and **23.2 AP@[0.5:0.95]**, both above the Fast R-CNN configurations in the table. Its AP@0.75 is 23.4, close to ION's 23.6 and Faster R-CNN's 23.5, while its AP@0.5 is below the latter's 45.3. These methods do not all use identical COCO training subsets.\n\nAt 512×512 input, **SSD512** reaches 46.5 AP@0.5 and 26.8 AP@[0.5:0.95], above the table's Faster R-CNN row at 45.3 and 24.2. Its AP@0.75 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 AP@0.5 gap is **1.2 percentage points**.\n\nAgainst 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.\n\n### Visual Results\n\n![visual](/content/papers/assets/37c938881e99a3a6b95c9b1e172ca4dd4932bef0cad6680e84d8b99be0739cfa.jpg)\n\n## Conclusion\n\nSSD'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.\n\nAdditionally, 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.\n\nSSD, as an efficient object detection method, deserves further study.\n","imageSizes":{"/content/papers/assets/21fe80f8a5237d6948480468c4e5edfc5c0a53f6d8d165761eba8a7dfd9300bc.jpg":{"width":1694,"height":948},"/content/papers/assets/dc275040ac321a1d5717e3262cb4c1e1337baaef539b0fc289e632e469721ccf.jpg":{"width":1634,"height":626},"/content/papers/assets/bc4c1a72dadf92bec6327576c514941e42f52adffc1304614335abe10b81202c.jpg":{"width":1212,"height":392},"/content/papers/assets/ff785b969e48300cbb9aa2b3956a3f87867454fa9eea1498ef99acb1f4048cc6.jpg":{"width":1224,"height":804},"/content/papers/assets/55d578caf242dc593a7a4485e6bb6ff355e3a778c22e4afdc5b85e96d4f08235.jpg":{"width":1878,"height":670},"/content/papers/assets/2ee5ec201f6ac19be49190d688efe28017a8e65e5bff94500eca52a712b6c28f.jpg":{"width":1492,"height":454},"/content/papers/assets/37c938881e99a3a6b95c9b1e172ca4dd4932bef0cad6680e84d8b99be0739cfa.jpg":{"width":1272,"height":1440}}}
