5. Object Detection and Image Segmentation5.2 Single Stage Detectors

Section 5.2
Single Stage Detectors

The object detectors described thus far are called two-stage detectors because they first involve proposing a set of bounding boxes and then each bounding box is individually classified. There is an alternative paradigm called single-stage detection, which does everything all at once. This approach to object detection was proposed at about the same time by Redmon et al. [84] and Liu et al. [67], although variants of the YOLO model of Redmon et al. [84] are by far the more popular model these days.

The single-stage detection approach is very similar to Faster R-CNN. Instead of first proposing bounding boxes that are then processed by pooling features over their corresponding regions, the single stage approach directly predicts bounding box coordinates and class probabilities from the same anchor point. Specifically, the input image is divided into a grid of \(S\)-by-\(S\) cells as illustrated in Figure 62. For each cell location we regress and classify \(m\) bounding boxes, resulting in an \((S \times S \times (5m + K))\)-tensor output, where the \(5m\) corresponds to the bounding box locations and scores and the \(K\) corresponds to the class probabilities. Flattening out the first dimensions we can think of the single-stage detector as taking in a fixed-size tensor, a \((3 \times H \times W)\)-image, and producing a fixed-size \(mS^2\)-length list of scored bounding boxes and class probability distributions,

\begin{align} \begin{bmatrix} \underbrace{\begin{matrix} x_1 & y_1 & w_1 & h_1 & s_1 \\ x_2 & y_2 & w_2 & h_2 & s_2 \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ x_{mS^2} & y_{mS^2} & w_{mS^2} & h_{mS^2} & s_{mS^2} \end{matrix}}_{\text{boxes}} & \underbrace{\begin{matrix} p_1^{(1)} & \ldots & p_1^{(K)} \\ p_2^{(1)} & \ldots & p_2^{(K)} \\ \vdots & & \vdots \\ p_{mS^2}^{(1)} & \ldots & p_{mS^2}^{(K)} \end{matrix}}_{\text{probabilities}} \end{bmatrix} \tag{192}\end{align}

The \(S\)-by-\(S\) grid has replaced the anchor box locations proposals from the two-stage network. As before, thresholding is applied to remove low probability detections followed by non-maximal suppression.

YOLO [84] network architecture for single-stage object detection
Figure 62: YOLO [84] network architecture for single-stage object detection.

YOLO is about ten times faster than Faster R-CNN with the same backbone CNN.