# Research on a UAV-View Object-Detection Method Based on YOLOv7-Tiny
## 3 UAV View Object-Detection Method Based on YOLOv7-Tiny
### The Improved YOLOv7-tiny Algorithm
#### 3.2.5 Dilatable Wide-Range (DWR) Attention Module  
The attention mechanism is an important technique in deep learning, inspired by the human visual attention mechanism--where we tend to focus on a specific part of a visual scene while ignoring other irrelevant information. In deep learning algorithms, the attention mechanism allows the algorithm to automatically focus on the most important parts when processing information, thus improving efficiency [7]. Since UAV views often contain complex backgrounds and diverse objects, and object sizes may vary significantly due to factors such as distance and angle, it is worth considering the introduction of the Dilated Residual (DWR) attention module in the YOLOv7-tiny algorithm. The DWR module acts as a regulator throughout detection, optimizing information flow and highlighting key features. It fine-tunes feature weights during the post-feature fusion stage. It works in coordination with AKConv and Partial_C_Detect, ensuring that the final detection boxes accurately reflect the position and category of the actual objects.  
The Dilated Residual (DWR) attention module is an efficient attention mechanism designed to enhance the algorithm's performance when handling complex visual data. This module combines the traditional Residual Network (ResNet) architecture with a dynamic attention mechanism, allowing the algorithm to capture and emphasize important features more effectively while maintaining the integrity of the input information, thereby improving adaptability and accuracy [31]. The core design idea of the DWR module is to optimize information flow through dilated residual connections and Dilated Convolution (DConv) [32]. This structural design enables the module to adjust its internal parameters dynamically based on different inputs, adapting to complex data features and task requirements.  
Figure 6: The trend in the number of convolutional parameters with increasing convolutional kernel size.  
Figure 7: AKConv workflow diagram.  
As shown in Figure 8, within the residual block, a two-step method is employed to effectively extract multi-scale contextual information, followed by the fusion of feature maps generated by different receptive fields [32]. First, a standard 3 \(\times\) 3 convolution layer is used for feature extraction, dividing the regional feature map into several groups. Each convolution layer is followed by Batch Normalization (BN) and ReLU activation functions to enhance the network's nonlinear processing capability. Second, 3 \(\times\) 3 Dilated Convolutions (DConv) with different dilation rates, such as D-3 and D-5 in Figure 8, are applied to different groups at varying rates of dilated depth convolution to capture broader contextual information and adapt to features of different sizes. The feature maps are then fed into a 1 \(\times\) 1 convolution layer to reduce the feature dimensions, and a residual connection is used to add the input before convolution to the output after convolution, forming a shortcut connection to mitigate the vanishing gradient problem and maintain the integrity of information flow [32].  
By integrating multiple convolution and attention mechanisms, this architecture significantly enhances the network's ability to capture key features and improves overall performance. When processing UAV views with complex backgrounds, small objects, or highly dynamic changes, it reduces background noise interference and lowers the rates of missed and false detections.