Computer Vision Lab Models SSDlite320 MobileNetV3-Large

SSDlite320 MobileNetV3-Large

Single-shot detector with depthwise heads

A lightweight detector that runs in the browser. Box decoding and NMS are done in JavaScript with the original model's anchors.

Object detectionRuns in the browser

ArchitectureSingle-shot detector with depthwise heads
TaskObject detection
Training dataCOCO 2017
the number of parameters3,440,060
FrameworkPyTorch → ONNX (fp16) + anchors
File size6.6 MB
LicenceBSD-3-Clause (torchvision code); weights trained on COCO 2017
Where it runsBrowser (ONNX Runtime Web)
Official sourcepytorch.org
Official weightsdownload.pytorch.org

Published metrics (from the official source, not measured by this site)

MetricValueEvaluation dataSource
box mAP21.3COCO val2017Source

Architecture diagram

Architecture diagram SSDlite320 MobileNetV3-LargeInput320×320×3MobileNetV3-LargebackboneFeature map 120×20 (stride 16)Feature map 210×10 (stride 32)Extra layers ×4maps 5×5, 3×3, 2×2, 1×1Class heads (depthwise separable)91 classes × 6 anchors, every mapBox heads (depthwise separable)4 offsets × 6 anchors, every mapDecode anchorscx, cy, w, h (all 6 maps)Score threshold + NMSdetections
SSDlite320 MobileNetV3-Large (torchvision implementation): six feature maps from the backbone and extra layers, depthwise separable convolution heads for classes and boxes on each map, then anchor decoding and NMS.
  • Input / output
  • Convolutional layer
  • Composite block
  • Memory / intermediate features
  • Output head
  • Operation (add, multiply, merge)

Detailed model explanation

Idea and intuition

SSDlite belongs to the family of one-stage detectors (Single Shot Detector): instead of proposing regions and then classifying them, the model predicts in a single pass, for each position in several feature maps, box offsets and class scores for a set of “anchors” of different sizes and ratios. The high-resolution maps capture small objects, and the deep low-resolution maps capture large objects.

“Lite” means replacing the ordinary convolutions in the prediction heads with depthwise separable convolutions, as the MobileNetV2 paper proposed, which greatly reduces the compute. The backbone here is MobileNetV3-Large, and the input resolution is 320×320.

How it works step by step

  1. The image is resized to 320×320 and normalised.
  2. MobileNetV3 extracts feature maps, and extra layers that gradually reduce the resolution are added to form a pyramid of six maps.
  3. In each cell of each map, and for each anchor, the regression head predicts four offsets (\Delta x,\Delta y,\Delta w,\Delta h) and the classification head 91 scores (the COCO classes plus background).
  4. The offsets are decoded into boxes, then duplicates are removed with non-maximum suppression (NMS) per class.

Mathematical formulation

Decoding the box from the anchor (a_x,a_y,a_w,a_h):

\hat x = a_x + \Delta x\, a_w,\quad \hat y = a_y + \Delta y\, a_h,\quad \hat w = a_w e^{\Delta w},\quad \hat h = a_h e^{\Delta h}

The loss function is the sum of a classification loss and a Smooth-L1 localisation loss on the positive anchors only, with hard negative mining at a ratio of about 3:1 to handle the dominance of the background:

\mathcal L = \frac{1}{N}\big(\mathcal L_{cls} + \alpha\,\mathcal L_{loc}\big)

Strengths

  • Very small (about 3.4 million parameters) and fast, so it runs in the browser and on mobile devices.
  • A single pass with no region proposal stage.
  • A structure that is clear for teaching anchors and NMS.

Limitations

  • Its accuracy is modest (box mAP = 21.3 on COCO val2017 according to torchvision) compared with heavy detectors.
  • Weak on very small objects because of the low 320×320 resolution.
  • It relies on hand-designed anchors and on NMS with thresholds that must be tuned.

Use in the lab

This model runs inside your browser, and the box decoding and NMS steps are done in JavaScript. Try changing the confidence threshold and the NMS IoU threshold and note their effect on the number of duplicate and missed boxes.

Uses

Detecting the 80 COCO classes.

Runtime requirements

A modern browser.

How to load

Included in the core pack.

References

  1. W. Liu et al. (2016).SSD: Single Shot MultiBox Detector. ECCV 2016 (LNCS 9905). doi:10.1007/978-3-319-46448-0_2
  2. A. Howard et al. (2019).Searching for MobileNetV3. ICCV 2019. doi:10.1109/ICCV.2019.00140
  3. T.-Y. Lin et al. (2014).Microsoft COCO: Common Objects in Context. ECCV 2014 (LNCS 8693). doi:10.1007/978-3-319-10602-1_48

Related algorithms

Run the model in the lab