# Research on Vehicle Target Detection Method Based on Improved YOLOv8
## 3 Methods
### Adaptive Downsampling Module  
Standard pooling processes the entire image uniformly, which means that pooling cannot adjust the resolution according to the complexity of different regions and is prone to losing many spatial details, especially at the edges of objects and complex textures. Although stride-based downsampling is more flexible, it still applies the same step size to the entire feature map and does not adjust the feature complexity of specific areas. There is still a risk of losing important information in some areas, especially in small objects and detailed areas. The ADown module can dynamically adjust the downsampling method based on the content, scale, and semantic information of the feature map, rather than using a standard pooling or stride-based downsampling.  
The ADown module adjusts the resolution of the feature map in an adaptive way, which means that the resolution of each area can change dynamically according to its complexity. For example, in vehicle targets or complex scene areas, the ADown module maintains a high resolution to ensure that subtle spatial details, such as vehicle outlines, textures, and reflections are detected. For background areas, the ADown module moderately reduces resolution to effectively reduce computational overhead. This approach effectively reduces the amount of computation and memory consumption while retaining important spatial details, significantly improving the accuracy and efficiency of vehicle target detection. Figure 3 shows the ADown module network architecture.  
Vehicle target detection requires detecting targets with huge size differences, such as large trucks in the near distance and small cars in the far distance. Introducing the ADown module for downsampling can help the network better learn features of different scales. The ADown module can reduce computational complexity through dimensionality reduction and downsampling, improve feature extraction capabilities, enhance multiscale feature learning, and improve model efficiency and detection accuracy, especially when dealing with complex traffic scenarios. In addition, the ADown module can also help the model improve generalization and real-time performance, which is very useful for real-world traffic scenarios with limited computing resources.  
Figure 3: ADown module network structure diagram.  
Average pooling divides the input image into rectangular regions and outputs the average value of the elements within each region. Its mathematical expression is as follows:  
\[y_{kij}=\frac{1}{\left|R_{ij}\right|}\sum_{(p,q)\in R_{ij}}x_{kpq} \tag{1}\]  
where \(y_{kij}\) is the average output value of the aggregation of the region \(R\) associated with the \(k\)-th feature map, \(x_{kpq}\) is the element in position \((p,q)\) in the region \(R\), and \(R_{ij}\) is the number of elements in the rectangular region \(R\).  
Maximum pooling divides the input image into rectangular regions and outputs the maximum value of each region for the same input image. Its mathematical expression is as follows:  
\[z_{kij}=\max_{(p,q)\in R_{ij}}x_{kpq} \tag{2}\]  
where \(z_{kij}\) is the maximum output value for the aggregation of the region \(R\) associated with the map of the \(k\) -th characteristic.  
This algorithm introduces the ADown module to replace some CBS modules. A lightweight feature extraction and aggregation network is designed to effectively extract and aggregate vehicle target feature information at a low computational cost.