You Only Look Once
You Only Look Once is a series of real-time object detection systems based on convolutional neural networks. First introduced by Joseph Redmon et al. in 2015, YOLO has undergone several iterations and improvements, becoming one of the most popular object detection frameworks.
The name "You Only Look Once" refers to the fact that the algorithm requires only one forward propagation pass through the neural network to make predictions, unlike previous region proposal-based techniques like R-CNN that require thousands for a single image.
Overview
Compared to previous methods like R-CNN and OverFeat, instead of applying the model to an image at multiple locations and scales, YOLO applies a single neural network to the full image. This network divides the image into regions and predicts bounding boxes and probabilities for each region. These bounding boxes are weighted by the predicted probabilities.OverFeat
OverFeat was an early influential model for simultaneous object classification and localization. Its architecture is as follows:- Train a neural network for image classification only. This could be one like the AlexNet.
- The last layer of the trained network is removed, and for every possible object class, initialize a network module at the last layer. The base network has its parameters frozen. The regression network is trained to predict the coordinates of two corners of the object's bounding box.
- During inference time, the classification-trained network is run over the same image over many different zoom levels and croppings. For each, it outputs a class label and a probability for that class label. Each output is then processed by the regression network of the corresponding class. This results in thousands of bounding boxes with class labels and probability. These boxes are merged until only one single box with a single class label remains.
Versions
YOLOv1
The original YOLO algorithm, introduced in 2015, divides the image into an grid of cells. If the center of an object's bounding box falls into a grid cell, that cell is said to "contain" that object. Each grid cell predicts B bounding boxes and confidence scores for those boxes. These confidence scores reflect how confident the model is that the box contains an object and how accurate it thinks the box is that it predicts.In more detail, the network performs the same convolutional operation over each of the patches. The output of the network on each patch is a tuple as follows:where
- is the conditional probability that the cell contains an object of class, conditional on the cell containing at least one object.
- are the center coordinates, width, and height of the -th predicted bounding box that is centered in the cell. Multiple bounding boxes are predicted to allow each prediction to specialize in one kind of bounding box. For example, slender objects might be predicted by while stout objects might be predicted by.
- is the predicted intersection over union of each bounding box with its corresponding ground truth.
During training, for each cell, if it contains a ground truth bounding box, then only the predicted bounding boxes with the highest IoU with the ground truth bounding boxes is used for gradient descent. Concretely, let be that predicted bounding box, and let be the ground truth class label, then are trained by gradient descent to approach the ground truth, is trained towards, other are trained towards zero.
If a cell contains no ground truth, then only are trained by gradient descent to approach zero.