# Research on Vehicle Target Detection Method Based on Improved YOLOv8
## 3 Methods
### Lightweight Shared Convolutional Detection Head  
The batch normalization (BN) layer standardizes the output, ensuring that the mean of each feature in a small batch is near 0 and the variance is close to 1, thus ensuring the stability of the data in the network. However, when the batch size becomes smaller, the simulation effect of BN is not good. Group normalization (GN) [33] is a new deep learning normalization method that solves the impact of BN on the dependence of batch size. Its main idea is to divide the channels into several groups and then normalize the channels in each group. Generally speaking, the output of the previous layer is \(X=\{x_{1},x_{2},\cdots,x_{m}\}\). The normalization method is as follows:  
\[\mu_{\beta}=\frac{1}{m}\sum_{i=1}^{m}\left(x_{i}\right) \tag{3}\]  
where \(\mu\) represents the average value of the output from the previous layer, \(m\) is the size of the training sample batch, and \(\beta\) is a vector of parameter that controls the translation of the normalized data. \[\sigma_{\beta}^{2}=\frac{1}{m}\sum_{i=1}^{m}\left(x_{i}-\mu_{\beta}\right)^{2} \tag{4}\]  
where \(\sigma\) represents the standard deviation of the output data from the preceding layer. \[\hat{x_{i}}=\frac{x_{i}-\mu_{\beta}}{\sqrt{\sigma_{\beta}^{2}+\varepsilon}} \tag{5}\]  
where \(\varepsilon\) is a small value close to 0, and its size can be adjusted to prevent the denominator from becoming 0, without compromising the stability of the formula. \[y_{i}=\gamma\hat{x_{i}}+\beta \tag{6}\]  
where \(\gamma\) is a vector of parameter that determines the degree of scaling of the normalized data. The BN and GN algorithms are illustrated in Figure 4. For an image with an input size of \([N,C,H,W]\), where \(N\) denotes the batch size, \(C\) represents the number of input channels, and \(H\) and \(W\) are the height and width of the input image, respectively, group normalization divides the input channels \(C\) into \(G\) groups. The normalization is then applied to each group, transforming the input feature dimensions from \(C\) to \(G\), and the normalized dimensions become \([C/G,H,W]\), where each group contains \([C/G]\) channels. The performance and stability of BN are generally best when training large batches. For vehicle object detection, especially when real-time processing and low latency are required, smaller batches are usually used, and the instability of small batch statistics leads to fluctuations during training. During the inference phase, BN needs to use the statistics of the entire training set to normalize the feature maps. However, in real-time object detection, the size of each input image or video frame is usually small, so using the global mean and variance during training for inference may lead to unstable behavior. GN normalizes each sample by grouping channels for normalization, rather than relying on the mean and variance of the entire batch. This makes GN particularly effective in small batch training or inference in real time. This is particularly important for vehicle target detection, as such applications often require single-frame inference, where BN often does not work stably. GN uses the same statistics, the mean and variance within each group, during both training and inference, making it more stable during inference. For real-time inference in vehicle target detection, GN can avoid the instability caused by BN during inference due to fluctuations in batch statistics. Modern vehicle target detection tasks usually require processing a large number of high-resolution images, and low latency and high computational efficiency are the core requirements that must be met. In vehicle target detection, the appearance and structure of the vehicle are relatively fixed, and many tasks have similar low-level features. Improving the original detection head by designing a shared convolutional layer through GN can significantly reduce redundant calculations and parameters, thereby achieving the purpose of improving computational efficiency.