# Configurable Hardware Core for IoT Object Detection
## 2 Background and Related Work  
### Convolutional Neural Networks  
CNNs are mainly composed of convolutional layers. Other commonly found layers in CNNs are pooling, batch-normalize, shortcut, routing, and upsample layers.  
The input of convolutional layers is divided into C channels, where each channel is defined as a (W \(\times\) H) feature map (FM). Each kernel used in the convolution has C channels. The number of output channels N is the same as the number of kernels used. Each value on the output is the accumulation of the products of the input with the overlapped kernel.  
CNNs use pooling layers to reduce the size of the FMs. The most common pooling operations divide the feature map into \(2\times 2\) regions and select either the larger (max-pooling) or the average (average-pooling) value.  
Batch-normalize layers set the average of the input values to zero and the standard deviation to one. After that, the values are scaled and shifted using the (\(\gamma\),\(\beta\)) parameters also learned during training. This control of the input distribution speeds up training and improves accuracy. For a given value \(y\), the normalization outputs  
\[z=\frac{y-\mu}{\sqrt{\sigma^{2}+\epsilon}}\gamma+\beta, \tag{1}\]  
where \(\mu\) is the average, \(\sigma\) is the standard deviation, \(\epsilon\) is the scale, and \(\beta\) is the batch normalization bias. The additional \(\epsilon\) term is used to avoid numerical errors related with denominators too close to zero.  
A shortcut layer skips one or more layers by adding an output feature map of a previous layer to a current layer. Routing and upsampling layers are usually associated with objection detection [15]. The routing layer concatenates outputs from different layers creating stacked separate output channels. The upsampling layer increases the size (width and height) of a feature map to detect objects at different scales and obtain more information from features identified in the input map. The simplest upsample method consists in repeating each value in an feature map four times in a 2 \(\times\) 2 square.  
Many CNN models have been proposed since the success of AlexNet [20], VGG-16 [20], and GoogLeNet [20] for image classification. These CNN networks differ mainly in the number and sequence of layers and the number and size of kernels. Compared to the first two CNN models, GoogLeNet introduced parallel convolutions applied to the same input feature map (IFM), followed by concatenation. It basically allows processing the inputs at multiple scales. Deeper and larger CNN models have followed and improved accuracy at the cost of increased computational complexity. ResNet [20] is a deeper network compared to its predecessors. The network model introduces for the first time the shortcut layers to avoid the vanishing gradient problem observed during backpropagation.  
Some CNN models were specifically designed for object detection. Darknet-53 [15] is the base model of YOLOv3 that employs shortcut layers to allow a deeper network. Darknet-53 is the backbone model of the YOLOv3 object detector. In general, YOLO models have lightweight versions. A few lightweight versions were proposed for YOLOv3 like Tiny=YOLOv3 based on Tiny-Darnet-53, with a reduced number of weights (from 62 to 8.8 million parameters) and computations (from 33 to 2.8 GOPS) compared to the full model.