## 3 Proposed Method
### Improved YOLOV9 Detection Module  
Figure 2 illustrates the proposed enhanced YOLOV9 detection network architecture. Conv was used to extract image features, RepNCSPELAN4 was the feature extraction fusion module in YOLOv9, Concat was used to concatenate feature maps from different layers, and SPPF was used to enhance the network's detection capability for targets at different scales. It pooled feature maps at different scales and then concatenated them to capture multi-scale information of targets. Conv CLS (Convolutional Layer for Classification) was the convolutional layer for target classification, classifying each bounding box. Detect transformed the output into the final object detection results, applying non-maximum suppression (NMS) to remove overlapping bounding boxes and filtering the final detection results based on class confidence. Arrows indicated the direction of data flow, starting from the input image and passing through a series of convolutional layers, concatenation operations, and detection layers and, finally, obtaining the object detection results. Figure 2: Improved YOLOV9 structure diagram. The red part represents the proposed three-layer routing attention mechanism module. Uncontrollable factors such as the size, shape, position, orientation of the objects, and occlusions under adverse weather conditions make it difficult to achieve accurate detection using traditional convolutional operations on images that have already been processed and enhanced. Issues such as extensive false positives or negatives may arise. To address these challenges and improve the model's ability to recognize objects like power lines and trees in images after processing, this paper proposes the incorporation of the Three-Layer Routing Attention module at the last part of the backbone. The Three-Layer Routing Attention module module was integrated into the entire network and underwent end-to-end training with appropriate loss functions, ensuring that the model could simultaneously learn image features, processing parameters, and attention weights. This adaptation enhanced the model's focus and generalization capabilities for different image processing and enhancement tasks. The proposed Three-Layer Routing Attention module, as shown in Figure 3, demonstrated an improved three-layer routing attention mechanism, comprising the following levels. The first layer was the Region Routing Attention Mechanism (RRAM), which operated at a macroscopic region level and introduced a method for constructing association graphs. Utilizing dynamic and adaptive association graph construction strategies, RRAM flexibly adapted to feature relationships in different scenes. This adaptability was achieved through an adaptive threshold mechanism. Equation (11) defines the feature tensor of the input image, respectively. \(X\) represents the feature tensor of the input image, \(H\) is the height of the feature tensor, \(W\) is the width of the feature tensor, \(C\) is the number of channels in the feature tensor, and \(R\) represents the number of regions after partitioning. Equation (12) demonstrates the process of region partitioning and input projection, transforming the input tensor \(X\) into \(X_{r}\), where \(S_{1}S_{2}\) represents the size of the region partition. The operation Reshape rearranges the elements of a tensor into a new shape while preserving the order of the elements. In this context, it reshapes the input tensor \(X\) into \(X_{r}\), which has a size of \(S_{1}S_{2}\) regions, each of size \(HW/S_{1}S_{2}\) with \(C\) channels. \[X\in R^{H\times W\times C} \tag{11}\]  
\[X_{r}=Reshape(X,S_{1}S_{2}\times(HW/S_{1}S_{2})\times C) \tag{12}\]  
\(W_{k}\) and \(W_{v}\) are the projection weights used to project \(X_{r}\) into queries, keys, and values, respectively, in Equation (13). They were learned parameters of the model and were  
Figure 3: Tri-Level Routing Attention Module. The mm and softmax modules represented the operations of matrix transpose multiplication, using the softmax function to normalize attention weights.