## 2 Methods
### MobileNetv2 as the YOLOv4 Backbone Network  
The original YOLOv4 network uses CSPDarknet-53 as the feature extraction network, which is a kind of full-convolution network with a complex structure and has a strong feature extraction ability; however, with the increase in the number of residual units and  
Figure 1: Motion-blurred-image processing flow. Figure 2: Template of the Laplace operator. network channels, it leads to a sharp increase in the number of network parameters, which affects the speed of model detection. For the multi-target detection of the electric locomotive driving scene, it is more necessary for the network to perform rapid detection; therefore, there is no need for a feature extraction network that is too complex. Therefore, taking advantage of the deep separable convolution and inverse residual structure of lightweight network Mobilenetv2, it was used as the feature extraction network of YOLOv4 to reduce the model's capacity and number of parameters, improve the detection speed of the model, and solve the problem of slow network training caused by the limited hardware. Depthwise separable convolution is a form of convolution that divides a standard convolution into two parts, namely, depth (\(D\)Conv) and point (\(P\)Conv) convolutions. Figure 3 shows the general process of depthwise separable convolution. Firstly, a filter is input into each channel to generate a feature map, namely, \(D\)Conv. \(D\)Conv can be expressed as:  
\[D\text{Conv}(W_{d},\,x)_{(i,j)}=\sum_{m=0}^{M}\sum_{n=0}^{N}W_{d}\cdot x_{(i+m, j+n)} \tag{3}\]  
where \(W_{d}\) is the weight matrix of \(D\)Conv; \(x\) is the input feature mapping of the convolution layer; \((i,j)\) is the coordinate point of output feature mapping; \(M\) and \(N\) represent the height and width of the input layer, respectively; and \(m\) and \(n\) represent the two-dimensional space of the convolution kernel. Then, \(P\)Conv is used to combine the output of \(D\)Conv, which can effectively extract the spatial features. \(P\)Conv can be expressed as follows:  
\[P\text{Conv}(W_{p},\,x)_{(i,j)}=\sum_{k=0}^{K}W_{p}\cdot x_{(i,j)} \tag{4}\]  
where \(W_{p}\) is the weight matrix of \(P\)Conv; \(K\) represents the input depth of this layer; \(k\) represents the convolution kernel. In summary, the overall process of depthwise separable convolution can be expressed as:  
\[DSC\text{Conv}(W_{p},W_{d},\,x)_{(i,j)}=PC\text{Conv}(W_{p},\,x)_{(i,j)}\times (W_{p},\,D\text{Conv}(W_{d},\,x)_{(i,j)}) \tag{5}\]  
The computational complexities of ordinary and depthwise separable convolutions are compared below. Let \(D_{k}\times D_{k}\times U\) be the size of the input feature map and \(D_{F}\times D_{F}\times U\) be the size of the convolution kernel, whose quantity is \(X\). The computational level of the ordinary convolution is:  
\[D_{k}\times D_{k}\times D_{F}\times D_{F}\times U\times X \tag{6}\]  
The computational level of the depth-separable convolution is:  
\[D_{k}\times D_{k}\times D_{F}\times D_{F}\times U+U\times X\times D_{k}\times D _{k} \tag{7}\]  
Figure 3: Depths-wise separable convolution. The computational cost ratio of depth separable to ordinary convolutions is:  
\[\frac{D_{k}\times D_{k}\times D_{F}\times D_{F}\times U+U\times X\times D_{k} \times D_{k}}{D_{k}\times D_{k}\times D_{F}\times D_{F}\times U\times X}=\frac{1} {X}+\frac{1}{D_{F}^{2}} \tag{8}\]  
It can be observed from the calculation results above that the calculation for depthwise separable convolution is much lower than that of the ordinary convolution. Mobilenetv2 with the depthwise separable convolution was used as the backbone feature extraction network, which can effectively reduce the number of model parameters and computations. Although depthwise separable convolution can reduce the number of model parameters well, it extends the number of network layers, resulting in the disappearance of gradients, and the residual structure can solve this situation very well. Figure 4 shows the residual structure and Figure 5 presents the inverse residual structure.