# Video-Based Parking Occupancy Detection for Smart Control System
## 2 Materials and Methods
### Detection Model
#### 2.2.2 MobileNet  
Deep learning requiring high-performance computers to achieve fast computing is a common bottleneck because the depth of neural networks requires many parameters and is poorly-suited for use on embedded devices. MobileNet reduces the computational complexity of CNNs, allowing deep learning to be performed under limited hardware conditions to achieve the desired effect. The basic convolution structure of MobileNet is presented in Figure 8. Figure 8a reveals the conventional convolutional filter, which is four-dimensional. MobileNet proposes a separable convolution structure that replaces the original convolutional layer. It consists of a depthwise convolutional layer and  
Figure 7: Relationship between anchor box and ground truth. pointwise convolution layer. Figure 8b displays the depthwise convolutional layers using \(3\times 3\) kernels, with each kernel only iterating one channel of an image, unlike traditional convolution, in which a set of kernels iterates all channels of an image. Figure 8b displays the common pointwise convolutional layers by using \(1\times 1\) kernels. These layers have smaller computational costs than do standard convolution layers. The depthwise separable convolution layers function on the factorization principle. The first layer of the architecture is fully convoluted; in addition, the remainder of the MobileNet structure is built on depthwise separable convolutions. The final fully connected layer has complete linearity and feeds into a softmax layer for classification. Data distribution is changed by each convolution layer during network training. The vanishing gradient problem occurs when the activation function for the neural net becomes saturated, and the parameters are no longer updated. This problem is typically solved by using rectified linear units (ReLUs) for activation. Batch normalization is a technique for increasing speed, performance, and stability. Each convolution result is treated through the batch normalization algorithm and the activation function ReLU. Stride convolution in depthwise convolutions handle downsampling for the first layer and the rest of the network. Final average pooling reduces spatial resolution to 1 and counts depthwise and pointwise convolutions as separate layers before fully connecting the layer. Furthermore, the deep and separable convolutional structure enables MobileNet to accelerate training and considerably reduces the number of calculations. The reasons are as follows:  
First, the standard convolution structure can be expressed as follows: \(D_{F}\) denotes the input feature picture side length, \(D_{K}\) the convolution kernel side length, \(M\) the number of input channels, \(N\) the number of output channels, \(K\) the convolution kernel, and \(F\) the feature map. The output feature map for standard convolution assumes that stride one and padding are computed as follows:  
\[G_{kJ,n}=\sum_{i,j,k}K_{k+i=1,J+j-1,m} \tag{2}\]  
The computing cost is \(D_{K}\), \(D_{K}\), \(M\), \(N\), \(D_{F}\), and \(M\) and \(N\) are the numbers of input and output channels, respectively. During standard convolution, the input image, including the feature image FM,  
Figure 8: MobileNet architecture diagram. (**a**) Standard convolution with \(3\times 3\) kernel. (**b**) Convolution operation is replaced with depthwise and pointwise convolution. includes feature maps, which use the zero-padding fill style. Equation (4) is the depthwise separable convolutions cost. The first item is the depthwise separable convolutions calculation and the latter is the calculation of the pointwise convolutions.