Telegraph pole inclination detection method based on deep learning
By constructing an enhanced utility pole tilt detection dataset and deep learning model, combined with multi-scale convolution and attention mechanisms, the response lag and robustness problems of utility pole tilt detection are solved, and efficient and reliable utility pole tilt detection is achieved.
Patent Information
- Application Number
- CN202510697157.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-09-12
AI Technical Summary
Existing utility pole tilt detection technology has problems such as response lag, limited coverage, high false detection rate, and difficulty in achieving real-time detection around the clock. In addition, deep learning models have incomplete feature expression in complex environments and poor robustness, especially in extreme weather conditions where performance degrades.
By collecting multi-scene images through drones, an enhanced utility pole tilt detection dataset is constructed. A deep learning-based utility pole positioning detection model is adopted, combined with multi-scale convolution and attention mechanism to extract utility pole features. The LSD algorithm is applied to calculate the tilt angle to achieve automatic detection.
The positioning accuracy of utility poles and the calculation efficiency of the system are improved, the adaptability of the model to complex environments is enhanced, and the practicality and reliability of utility pole detection are significantly improved.
Smart Images

Figure CN120634978A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of utility poles, and in particular to a method for detecting utility pole inclination based on deep learning. Background Art
[0002] As power grids continue to expand, safety requirements become increasingly stringent. Utility pole tilt detection has become a core technology for ensuring the smooth and safe operation of power grids. As a vital component of national infrastructure, the power grid encompasses key nodes such as high-voltage equipment, substations, and power dispatching centers. The safety of these facilities directly impacts the normal functioning of society and the economy.
[0003] However, with the increasing complexity of power grid operations and the increase in external environmental factors, traditional pole inspection methods have exposed many drawbacks, including the following problems:
[0004] 1. Currently, detection of fallen utility poles along power transmission lines in power systems relies primarily on manual inspections or basic sensor monitoring. These issues include delayed response times and limited coverage, making it difficult to achieve all-weather, real-time risk warnings. Furthermore, existing mainstream object detection algorithms are computationally intensive, making them inadequate for real-time detection in practical applications.
[0005] 2. Existing deep learning models have limitations when capturing the features of targets of different sizes and long strip structures on poles. The feature expression is incomplete, making it difficult to balance details and global semantics, which affects subsequent posture or tilt judgments.
[0006] 3. In complex environments such as vegetation obstruction, uneven lighting, and intersecting high-voltage power lines, the existing algorithms experience a significant increase in false detection rates due to feature confusion and background interference. Their robustness decreases sharply, especially in extreme weather conditions such as rain, snow, fog, and haze.
[0007] Based on the above, a method for detecting the tilt of utility poles based on deep learning is invented. Summary of the Invention
[0008] To solve the above technical problems, according to one aspect of the present invention, the present invention provides the following technical solutions:
[0009] A method for detecting the tilt of a utility pole based on deep learning includes the following specific steps:
[0010] S1: Use drones to capture images of utility poles in normal, tilted, and fallen states. Ensure that the images cover different environments, weather conditions, time periods, and viewing distances. Manual visual screening is used to remove invalid images that are blurry, severely occluded, or highly repetitive. After image screening, professional annotation tools are used to accurately annotate the locations of utility poles, ultimately forming a multi-scene and multi-pose utility pole tilt detection dataset, D1.
[0011] S2: Data operations such as data rotation, flipping, cropping, contrast adjustment, and noise addition are performed on D1 to obtain the enhanced utility pole tilt detection dataset D2. Subsequently, D2 is randomly divided into training data, validation data, and test data according to a certain ratio to obtain dataset D3 for model training, dataset D4 for model verification, and dataset D5 for model performance testing.
[0012] S3: Build a deep learning-based utility pole location detection model, input the utility pole images in D2 into the model, and realize the location detection of utility poles in the transmission line scene;
[0013] S4: Use the enhanced utility pole tilt detection dataset to train a utility pole positioning detection model to obtain a trained utility pole positioning detection model;
[0014] S5: After the model training is completed, the trained pole positioning detection model is applied to the current pole image for recognition and analysis; finally, the specific position recognition result of the pole is output, that is, the coordinate information of three prediction boxes is output; the largest IoU is selected from the three output prediction boxes as the optimal prediction box, and then the coordinates of the optimal prediction box are converted according to the center point coordinates (x, y), width w and height h of the optimal prediction box to (x min ,y min ,x max ,y max ), where x min ,y min is the coordinate of the upper left corner of the optimal prediction box, x max ,y max is the coordinate of the lower right corner of the optimal prediction box;
[0015] S6: For the detected utility pole area, the LSD algorithm is applied to extract the linear features of the utility pole edge. By analyzing the geometric relationship of the straight lines, the tilt angle of the utility pole is calculated. According to the tilt range standard, the tilt detection is completed.
[0016] As a preferred solution of the utility pole tilt detection method based on deep learning described in the present invention, the specific steps of S3 are as follows:
[0017] S31: Input X1 into the ConvBNSiLU module to obtain the pole feature map X2; input X2 into the ConvBNSiLU module to obtain the pole feature map X3; input X3 into the EMBAConv module to obtain the pole feature map X4; input X4 into the ConvBNSiLU module to obtain the pole feature map X5; input X5 into the EMBAConv module to obtain the pole feature map X6; input X6 into the ConvBNSiLU module to obtain the pole feature map X7; input X7 into the EMBAConv module to obtain the pole feature map X8; input X8 into the ConvBNSiLU module to obtain the pole feature map X9; input X9 into the EMBAConv module to obtain the pole feature map X 10 ;
[0018] S32: Transform the pole feature map X 10 Input into the MSDAF module to obtain the pole feature map X 11 ;
[0019] S33: X again 11 Upsample to obtain the pole feature map X 12 ; X8 and X 12 Perform channel splicing to obtain the pole feature map X 13 ; X 13 Input into the EMBAConv module to obtain the pole feature map X 14 ; for X 14 Upsample to obtain the pole feature map X 15 ; X6 and X 15 Perform Concat operation to obtain the pole feature map X 16 ; X 16 Input into the EMBAConv module to obtain the pole feature map X 17 ; X 17 Input into the ConvBNSiLU module to obtain the pole feature map X 18 ; X 14 and X 18 Perform Concat operation to obtain the pole feature map X 19 ; X 19 Input into the EMBAConv module to obtain the pole feature map X 20 ; X 20 Input into the ConvBNSiLU module to obtain the pole feature map X 21 ; X 11 and X 21 Perform channel splicing to obtain the pole feature map X 22 ; X 22Input into the EMBAConv module to obtain the pole feature map X 23 At the same time, X4 is input into the EMBAConv module to obtain the pole feature map X5', X5' is input into the ConvBNSiLU module to obtain the pole feature map X6', and X 18 and X6' to obtain the pole feature map X7'; input X7' into the EMBAConv module to obtain the pole feature map X8'; 21 Connect the channel with X9' to get the pole feature map X 10 ';X 10 'Input into the EMBAConv module to obtain the pole feature map X 11 ';
[0020] S34: X 23 、X8'、X 11 ' are input into the target prediction head Head to generate prediction information; the prediction information includes a 23 The corresponding prediction frame coordinate information, a prediction frame coordinate information corresponding to X8', a prediction frame coordinate information corresponding to X 11 'The corresponding prediction box coordinate information; each prediction box coordinate information includes the center point coordinates (x, y), width w and height h of the prediction box.
[0021] As a preferred solution of the deep learning-based utility pole tilt detection method described in the present invention, the EMBAConv module in S31 adopts a dual-branch structure, and each branch integrates the MCFA sub-module and the ECA sub-module; the MCFA sub-module uses a multi-scale convolution kernel to mine the fine-grained structural features of the utility pole and enhance the edge and morphological expression; the channel attention mechanism of the ECA sub-module is introduced into the sub-branch to highlight the key channels and improve the discrimination of the feature expression; after the output results of the two branches are spliced by the channel, the CBAM sub-module performs spatial and channel joint attention optimization to further focus on the salient areas of the utility pole.
[0022] As a preferred solution of the utility pole tilt detection method based on deep learning described in the present invention, the construction and execution process of the EMBAConv module is as follows:
[0023] Process 1: First, split T1 by channel to obtain the electric pole feature map T2 and electric pole feature map T3 of size C / 2×H×W; then extract the electric pole features through two branches;
[0024] Process 2: In the first branch, T2 is first input into the MCFA submodule to obtain a pole feature map T4 of size C / 2×H×W; its MCFA submodule adopts a multi-scale convolution structure, using 3×3 convolution to extract the details of the pole, 5×5 convolution to extract the local shape of the pole, and 7×7 convolution to extract the overall structure of the pole, so that the EMBAConv module can accurately identify the edge features and morphological changes of the pole, and effectively improve the model's target differentiation ability under complex background interference such as vegetation occlusion, uneven lighting and image blur; then T4 is input into the ECA submodule to obtain a pole feature map of size C / 2×H×W. Pole feature map T5; its ECA submodule uses local cross-channel interaction to generate attention weights and finely weights the edge, top and bottom key areas of the pole; then T5 is split by channel to obtain a pole feature map T6 of size C / 4×H×W and a pole feature map T7 of size C / 4×H×W; T6 is input into the MCFA submodule to obtain a pole feature map T8 of size C / 4×H×W; T7 and T8 are then channel-joined to obtain a pole feature map T9 of size C / 2×H×W; finally, T9 is input into the MCFA submodule to obtain a pole feature map T 10 ;
[0025] Process 3: At the same time, in the second branch, first input T3 into the MCFA submodule to obtain the pole feature map T4' of size C / 2×H×W; input T4' into the MCFA submodule to obtain the pole feature map T5' of size C / 2×H×W; input T5' into the ECA submodule to obtain the pole feature map T6' of size C / 2×H×W;
[0026] Process 4: Finally, T 10 Perform channel splicing with T6' to obtain the pole feature map T with a size of C×H×W 11 ; T 11 Input into the CBAM submodule to obtain the pole feature map T of size C×H×W 12 The CBAM submodule strengthens key features and salient areas through channel and spatial attention, thereby effectively preserving the overall shape and local detail features of the pole feature map in complex scenes such as occlusion and low light. 12 Input into the GSConv submodule to obtain the pole feature map T of size C×H×W 13 The GSConv submodule models the structure of the pole feature map through group convolution and channel shuffling strategies. First, the GSConv submodule divides the pole feature map into four subgroups, and each subgroup extracts the fine-grained structural features of the pole top, middle, bottom and cable connection area. 13Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation to 13 The number of channels is adjusted to obtain the pole feature map T of size C'×H×W 14 , where the value of C' needs to be determined according to the specific adjustment situation; T 14 This is the feature map of the utility poles that is the final output of the EMBAConv module.
[0027] As a preferred solution of the utility pole tilt detection method based on deep learning described in the present invention, the construction and execution process of the MCFA submodule is as follows:
[0028] Process 1: Let the input pole feature map be F1, input F1 into the Conv2d layer with a convolution kernel size of 1×1 for convolution operation to obtain the pole feature map F2; perform batch normalization on F2 to obtain the pole feature map F3; use the ReLU6 activation function on F3 to obtain the nonlinear transformed pole feature map F4;
[0029] Process 2: In the first branch, F4 is first input into the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_1 ; Then F 4_1 Input to the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_4 ; for F 4_4 Use the ReLU6 activation function to obtain the nonlinear transformed pole feature map F 4_7 ;
[0030] Process 3: At the same time, in the second branch, F4 is first input into the Conv2d layer with a convolution kernel size of 5×5 for convolution operation to obtain the pole feature map F 4_2 ; Then F 4_2 Input to the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_5 ; for F 4_5 Use the ReLU6 activation function to obtain the nonlinear transformed pole feature map F 4_8 ;
[0031] Process 4: At the same time, in the third branch, F4 is first input into the Conv2d layer with a convolution kernel size of 7×7 for convolution operation to obtain the pole feature map F 4_3 ; Then F 4_3 With F in the second branch 4_2 By element-wise addition operation, we can get the pole feature map F 4_6 ; Then F 4_6Using the ReLU6 activation function, we can obtain the nonlinear transformed pole feature map F 4_9 ;
[0032] Step 5: Finally, F 4_7 、F 4_8 、F 4_9 Perform element-wise addition to obtain the electric pole feature map F5; input F5 into the Conv2d layer with a convolution kernel size of 1×1 for convolution operation to obtain the electric pole feature map F6; perform batch normalization on F6 to obtain the electric pole feature map F7; then perform element-wise addition on F3 and F7 to obtain the electric pole feature map F8; apply the Swish activation function to the electric pole feature map F8 to obtain the enhanced electric pole feature map F9.
[0033] As a preferred solution of the utility pole tilt detection method based on deep learning described in the present invention, the construction and execution process of the MSDAF module in S32 is as follows:
[0034] Process 1: In the first branch, first perform a depth-wise separable convolution on Y1 with a kernel size of 5×5 to obtain a utility pole feature map Y of size C×H×W 1_1 ; Its DWConv can effectively reduce the complexity of the model while enhancing the perception of multi-scale pole structures; then Y 1_1 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the pole feature map Y of size C / 4×H×W 1_3 ;
[0035] Process 2: At the same time, in the second branch, first perform a depth-wise separable convolution on Y1 with a convolution size of 3×3 to obtain a utility pole feature map Y with a size of C×H×W 1_2 ; Then Y 1_2 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the pole feature map Y of size C / 4×H×W 1_4 ;
[0036] Process 3: Then Y 1_3 、Y 1_4By performing element-wise addition operations, a pole feature map Y2 of size C / 4×H×W is obtained. Batch normalization is performed on Y2 to obtain a pole feature map Y3 of size C / 4×H×W. Y3 is input into the GAM submodule to obtain a pole feature map Y4 of size C / 4×H×W. The GAM submodule strengthens the response of key areas through the channel and spatial joint attention mechanism, highlights the structural features of the pole top, pole body, and cable connection section, suppresses the interference of the sky and vegetation background, and provides more discriminative support for the semantic feature reconstruction of the subsequent MLpBlock submodule. Maximum pooling is performed on Y4 to obtain a pole feature map Y5 of size C / 4×H×W. The Max Pooling operation is used to extract spatial information at different scales, helping the model better capture the spatial relationship of poles in the image.
[0037] Process 4: Then input Y5 into the MLpBlock submodule to obtain the pole feature map Y6 of size C / 4×H×W; its MLpBlock submodule realizes fine feature reconstruction by dynamically focusing on local edges and global semantics; its structure can take into account both the details and global morphology of the poles, significantly improving its edge and contour recognition accuracy; perform maximum pooling on Y5 to obtain the pole feature map Y7 of size C / 4×H×W; input Y7 into the MLpBlock submodule to obtain the pole feature map Y8 of size C / 4×H×W; perform maximum pooling on Y7 to obtain the pole feature map Y9 of size C / 4×H×W; input Y9 into the MLpBlock submodule to obtain the pole feature map Y 10 ; Change Y6, Y8, Y 10 Perform channel splicing to obtain the pole feature map Y of size 2C×H×W 11 ; Y 11 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the utility pole feature map Y of size C×H×W 12 ; Y 12 This is the utility pole feature map that is finally output by the MSDAF module.
[0038] As a preferred solution of the utility pole tilt detection method based on deep learning described in the present invention, the specific steps of S4 are as follows:
[0039] S41: Before training the utility pole location detection model, you first need to set a series of key hyperparameters, including selecting an optimizer, determining the initial learning rate, batch size, and number of training rounds. This initial configuration determines the model's training efficiency and ultimate performance.
[0040] S42: After completing the initial setup, the training set and validation set need to be divided into multiple batches, each containing a certain amount of data. During each training, the model extracts data from the training set according to the set batch size for forward calculation and generates prediction results. Based on the calculated prediction results, the AW-IoU loss function is used to calculate the loss value of each batch, and then the parameters are gradually adjusted according to the loss value to optimize performance.
[0041] S43: When the number of training rounds reaches the preset value and the validation loss tends to be stable, the training process of the utility pole location detection model ends. Finally, an optimized utility pole location detection model is obtained. The model can accurately detect the location of utility poles and maintain strong performance in different environments and at different scales.
[0042] S44: After training, the utility pole location detection model will have optimized parameters and strong adaptability, and will be able to efficiently perform utility pole location detection in a variety of scenarios.
[0043] As a preferred solution of the utility pole tilt detection method based on deep learning described in the present invention, in S42, the aspect ratio-driven dynamic weight α is introduced when designing the AW-IoU loss function, and its expression is:
[0044]
[0045] The width-aware weight w in its dynamic weight α ratio , height perception weight h ratio for:
[0046] w ratio =w gt / (w gt +h gt )
[0047] h ratio =h gt / (w gt +h gt )
[0048] w ratio +h ratio =1
[0049] AW-IoU loss function L AWIoU The function expression looks like this:
[0050]
[0051] The IoU expression is as follows:
[0052]
[0053] In the above formula, IoU represents the intersection-over-union ratio between the predicted box and the real box; B represents the predicted box; B gt Real frame; w gt Indicates the width of the true bounding box; h gt Represents the height of the true bounding box; dw1 represents the absolute value of the distance between the left edge of the predicted box and the left edge of the true box; dw2 represents the absolute value of the distance between the right edge of the predicted box and the right edge of the true box; dh1 represents the absolute value of the distance between the upper edge of the predicted box and the upper edge of the true box; dh2 represents the absolute value of the distance between the lower edge of the predicted box and the lower edge of the true box.
[0054] As a preferred solution of the utility pole tilt detection method based on deep learning described in the present invention, the specific steps of S6 are as follows:
[0055] S61: First, according to the coordinates of the optimal prediction box (x min ,y min ,x max ,y max ), crop the main area of the electric pole from the original image I roi ;
[0056] S62: Then use the LSD algorithm to detect the main area I of the utility pole roi The line segments inside get the line segment set For each line segment l in the set i , can be achieved through the endpoint coordinates (x i1 ,y i1 ) and (x i2 ,y i2 ) to calculate the line segment l i Angle θ with the horizontal direction i , the specific calculation formula is as follows:
[0057]
[0058] θ i =arctan(|k i |)
[0059] Then use the length of the line segment i As the weight, its calculation formula is:
[0060]
[0061] Since longer straight segments usually correspond to the main structural features of the pole, they should be given more weight in the final slope calculation;
[0062] S63: Finally, the angles θ of all the above line segments are i The weighted summation gives the overall pole tilt angle β, which can be expressed as:
[0063]
[0064] Compared with existing technologies:
[0065] This paper uses a utility pole positioning detection model to effectively improve the positioning accuracy and system computational efficiency of utility poles in complex environments. The model also enhances its adaptability to irregular shapes and multi-scale targets, significantly improving the practicality and reliability of the utility pole detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a schematic diagram of the process of the present invention;
[0067] Figure 2 This is a structural diagram of the utility pole positioning detection model of the present invention;
[0068] Figure 3 This is the EMBAConv module structure diagram of the present invention;
[0069] Figure 4 This is a structural diagram of the MCFA submodule of the present invention;
[0070] Figure 5 This is the structural diagram of the MSDAF module of the present invention. DETAILED DESCRIPTION
[0071] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0072] The present invention provides a method for detecting the tilt of electric poles based on deep learning. Figure 1-Figure 5 This invention aims to rapidly detect and calculate the tilt angle of utility poles in various states. First, multi-scene images are collected and the locations of utility poles are annotated to construct a utility pole tilt detection dataset. Data enhancement techniques are then employed to obtain an enhanced utility pole tilt detection dataset. A deep learning-based utility pole positioning detection model is then trained to locate utility poles in complex backgrounds. After detecting the utility pole area, the LSD algorithm is applied to extract the main axis segments. The tilt angle is then calculated using geometric methods. Automatic detection of the utility pole tilt state is then completed based on the tilt range standard.
[0073] The specific steps are as follows:
[0074] S1: Use drone photography to capture images of utility poles in normal, tilted, and toppled states. Ensure that the images cover different environments (e.g., urban, suburban, and outdoor), weather conditions (sunny, cloudy, rainy, and foggy), time periods (sunrise, noon, and dusk), and viewing distances (e.g., long-distance images of 100 meters and medium-distance images of 10 meters). Manual visual screening is used to eliminate invalid images that are blurry, severely occluded, or highly repetitive. After image screening, professional annotation tools are used to accurately annotate the locations of utility poles, ultimately forming a multi-scene and multi-pose utility pole tilt detection dataset D1.
[0075] Among them, commonly used image annotation tools include LabelImg, LabelME, etc.
[0076] S1 includes but is not limited to the following embodiments: processing 3,000 images of utility poles taken by a drone. The 3,000 images of utility poles consist of 1,000 images of utility poles in normal state, 1,200 images of utility poles in tilted state, and 800 images of utility poles in fallen state. These utility pole images cover urban, suburban and outdoor scenes, including sunny, cloudy and rainy and foggy weather conditions. The shooting time covers sunrise, noon and dusk, and the shooting distance spans from a long distance of 100 meters to a medium distance of 10 meters. Then, through manual visual screening, invalid images that are blurred, severely occluded or have too high repetition are eliminated to ensure image quality. The labeling tool LabelImg is then used to manually annotate the images and generate the corresponding xml label file, which contains the utility pole target annotation box information. Finally, a utility pole tower tilt detection dataset D1 containing multiple scenes and multiple postures is obtained.
[0077] S2: Data operations such as data rotation, flipping, cropping, contrast adjustment, and noise addition are performed on D1 to obtain the enhanced utility pole tilt detection dataset D2. Subsequently, D2 is randomly divided into training data, validation data, and test data according to a certain ratio to obtain dataset D3 for model training, dataset D4 for model verification, and dataset D5 for model performance testing.
[0078] Among them, data rotation: rotate the image at a certain angle to increase the diversity of the data.
[0079] Flip: Flip the image horizontally or vertically.
[0080] Cropping: Cut out a part of the image.
[0081] Contrast adjustment: Adjust the contrast of the image to make the bright parts brighter and the dark parts darker.
[0082] Noise Addition Technique: Add random noise to the image.
[0083] S2 includes but is not limited to an embodiment: The utility pole tilt detection dataset D1 contains a total of 3,000 utility pole images. First, all images are uniformly cropped to 512×512 pixels. Subsequently, a variety of data enhancement techniques are used to expand the dataset, including data rotation, flipping, cropping, contrast adjustment, and noise addition, all of which can be implemented using the Python language. Among them, the rotation operation is implemented by the cv2.getRotationMatrix2D() function; the image flipping is implemented using the cv2.flip() function; the cropping operation is implemented by cv2.resize(), the contrast adjustment is implemented using ImageEnhance.Contrast(), and the noise addition is implemented using the cv2.randPepper() function. After the above enhancement processing, D1 is expanded to an enhanced utility pole tilt detection set D2 containing 12,000 utility pole images. Subsequently, D2 is randomly divided into training data, verification data, and test data in a ratio of 7:2:1, to obtain the dataset D3 for training the model, the dataset D4 for verifying the model effect, and the dataset D5 for testing the model performance, respectively. D3 contains 8,400 images of electric poles, D4 contains 2,400 images of electric poles, and D5 contains 1,200 images of electric poles.
[0084] S3: Build a deep learning-based utility pole location detection model, input the utility pole image in D2 into the model, and realize the location detection of utility poles in the transmission line scene; the structure diagram of the utility pole location detection model is as follows Figure 2 shown.
[0085] The specific steps of S3 are as follows:
[0086] S31: Input X1 into the ConvBNSiLU module to obtain the pole feature map X2; input X2 into the ConvBNSiLU module to obtain the pole feature map X3; input X3 into the EMBAConv module to obtain the pole feature map X4; input X4 into the ConvBNSiLU module to obtain the pole feature map X5; input X5 into the EMBAConv module to obtain the pole feature map X6; input X6 into the ConvBNSiLU module to obtain the pole feature map X7; input X7 into the EMBAConv module to obtain the pole feature map X8; input X8 into the ConvBNSiLU module to obtain the pole feature map X9; input X9 into the EMBAConv module to obtain the pole feature map X 10 .
[0087] Among them, the ConvBNSiLU module is composed of a Conv2d layer with a convolution kernel size of 3×3 and a stride of 2, a BN layer (batch normalization layer), and a SiLU activation function connected in series. The Conv2d layer, BN layer, and SiLU activation function are all publicly available basic modules of convolutional neural networks. The Conv2d layer is used to extract local features, the BN layer implements batch normalization to stabilize network training, and the SiLU activation function introduces nonlinear transformation to enhance feature expression.
[0088] This paper designs an Efficient Multi-Branch Attention Conv (EMBAConv) module to improve the detection accuracy and feature robustness of utility poles in complex backgrounds, occlusion interference, and multi-scale variations. By integrating multi-scale convolution, channel and spatial attention mechanisms, and structural region modeling strategies, this module accurately extracts key features of utility poles and provides detailed perception of regional structure, enhancing the model's ability to identify utility poles in complex scenes.
[0089] The EMBAConv module in S31 adopts a dual-branch structure, with the MCFA submodule and the ECA submodule integrated in each branch. The MCFA submodule uses a multi-scale convolution kernel to mine the fine-grained structural features of the utility poles and enhance edge and morphological expression. The channel attention mechanism of the ECA submodule is introduced into the sub-branch to highlight key channels and improve the discrimination of feature expression. After the output results of the two branches are spliced through the channels, the CBAM submodule performs spatial and channel joint attention optimization to further focus on the salient areas of the utility poles.
[0090] In order to enhance the module's adaptability to the structures of different parts of the utility pole, EMBAConv introduces the GSConv submodule, which groups and models the top, middle, bottom and cable connection areas, and enhances local information interaction through channel shuffling. The EMBAConv module structure is as follows: Figure 3 shown.
[0091] The utility pole feature map X3 is used as the input to the EMBAConv module. For ease of presentation, X3 is denoted as T1, and its size is C×H×W, where C is the number of channels in T1, H is the height of T1, and W is the width of T1.
[0092] The construction and execution process of the EMBAConv module is as follows:
[0093] Process 1: First, split T1 by channel (i.e. Figure 3 The Split operation in the , obtains the electric pole feature map T2 and the electric pole feature map T3 of size C / 2×H×W; then the electric pole feature extraction is performed through two branches;
[0094] Process 2: In the first branch, T2 is first input into the MCFA submodule to obtain a pole feature map T4 of size C / 2×H×W; its MCFA submodule adopts a multi-scale convolution structure, using 3×3 convolution to extract the details of the pole, 5×5 convolution to extract the local morphology of the pole, and 7×7 convolution to extract the overall structure of the pole, so that the EMBAConv module can accurately identify the edge features and morphological changes of the pole, and effectively improve the model's target differentiation ability under complex background interference such as vegetation occlusion, uneven lighting and image blur; then T4 is input into the ECA submodule to obtain a pole feature map T5 of size C / 2×H×W; its ECA submodule uses local cross-channel interaction to generate attention weights, and finely weights the edge, top and bottom key areas of the pole; then T5 is split by channel (i.e. Figure 3 The Split operation in the MCFA submodule is used to obtain a pole feature map T6 of size C / 4×H×W and a pole feature map T7 of size C / 4×H×W. T6 is input into the MCFA submodule to obtain a pole feature map T8 of size C / 4×H×W. T7 and T8 are then channel-joined (i.e. Figure 3 Concat operation in the middle) to obtain the pole feature map T9 of size C / 2×H×W; finally, T9 is input into the MCFA submodule to obtain the pole feature map T of size C / 2×H×W 10 ;
[0095] Process 3: At the same time, in the second branch, first input T3 into the MCFA submodule to obtain the pole feature map T4' of size C / 2×H×W; input T4' into the MCFA submodule to obtain the pole feature map T5' of size C / 2×H×W; input T5' into the ECA submodule to obtain the pole feature map T6' of size C / 2×H×W;
[0096] Process 4: Finally, T 10 and T6' for channel splicing (i.e. Figure 3 Concat operation in the middle), we get the pole feature map T of size C×H×W 11 ; T 11 Input into the CBAM submodule to obtain the pole feature map T of size C×H×W 12 The CBAM submodule strengthens key features and salient areas through channel and spatial attention, thereby effectively preserving the overall shape and local detail features of the pole feature map in complex scenes such as occlusion and low light. 12 Input into the GSConv submodule to obtain the pole feature map T of size C×H×W 13The GSConv submodule models the structure of the pole feature map through group convolution and channel shuffling strategies. First, the GSConv submodule divides the pole feature map into four subgroups, and each subgroup extracts the fine-grained structural features of the pole top, middle, bottom and cable connection area. 13 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation to 13 The number of channels is adjusted to obtain the pole feature map T of size C'×H×W 14 , where the value of C' needs to be determined according to the specific adjustment situation; T 14 This is the feature map of the utility poles that is the final output of the EMBAConv module.
[0097] Among them, the CBAM sub-module (Convolutional Block Attention Module) is a lightweight module that combines channel and spatial attention, which can effectively enhance key information and suppress irrelevant features, thereby improving the model's feature expression ability and recognition effect.
[0098] The ECA submodule (Efficient Channel Attention) is an efficient channel attention mechanism for deep convolutional neural networks (CNNs), which aims to enhance the model's attention to feature channels and thus improve network performance.
[0099] The GSConv submodule (Group Shuffle Convolution) is an improved convolution operation for convolutional neural networks, designed to improve the model's feature extraction capabilities and computational efficiency. By grouping convolution kernels and performing feature shuffling between groups, it enhances information interaction between features in different groups, enabling the model to better learn diverse features, thereby improving accuracy and generalization in tasks such as image recognition and object detection.
[0100] The structure diagram of the multi-scale convolutional feature aggregation submodule MCFA (Multi-Scale Convolutional Feature Aggregation) in the EMBAConv module is as follows Figure 4 shown.
[0101] The construction and execution process of the MCFA submodule is as follows:
[0102] Process 1: Let the input pole feature map be F1, input F1 into the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the pole feature map F2; perform batch normalization on F2 (i.e. Figure 4The Batch Norm operation in
[15] is used to obtain the pole feature map F3. The ReLU6 activation function is applied to F3 to obtain the nonlinearly transformed pole feature map F4.
[0103] Process 2: In the first branch, F4 is first input into the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_1 ; Then F 4_1 Input to the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_4 ; for F 4_4 Use the ReLU6 activation function to obtain the nonlinear transformed pole feature map F 4_7 ;
[0104] Process 3: At the same time, in the second branch, F4 is first input into the Conv2d layer with a convolution kernel size of 5×5 for convolution operation to obtain the pole feature map F 4_2 ; Then F 4_2 Input to the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_5 ; for F 4_5 Use the ReLU6 activation function to obtain the nonlinear transformed pole feature map F 4_8 ;
[0105] Process 4: At the same time, in the third branch, F4 is first input into the Conv2d layer with a convolution kernel size of 7×7 for convolution operation to obtain the pole feature map F 4_3 ; Then F 4_3 With F in the second branch 4_2 Element-wise addition (i.e. Figure 4 in ) operation to obtain the pole feature map F 4_6 ; Then F 4_6 Using the ReLU6 activation function, we can obtain the nonlinear transformed pole feature map F 4_9 ;
[0106] Step 5: Finally, F 4_7 、F 4_8 、F 4_9 Element-wise addition (i.e. Figure 4 in ) operation to obtain the pole feature map F5; F5 is input into the Conv2d layer with a convolution kernel size of 1×1 for convolution operation to obtain the pole feature map F6; F6 is batch normalized (i.e. Figure 4 Batch Norm operation in the , get the pole feature map F7; then add F3 and F7 element by element (i.e. Figure 4 in ) operation to obtain the utility pole feature map F8; and applying the Swish activation function to the utility pole feature map F8 to obtain the enhanced utility pole feature map F9.
[0107] S32: Transform the pole feature map X 10 Input into the MSDAF module to obtain the pole feature map X 11 This paper designs a multi-scale depth attention fusion module MSDAF (Multi-Scale Depthwise Attention Fusion), which improves the model's recognition ability for different-sized electric poles through multi-scale feature fusion and dynamic attention guidance. It is suitable for accurate detection and structural analysis of small targets at long distances and large targets at close range in complex scenes. The MSDAF module structure diagram is shown in the figure below. Figure 5 shown.
[0108] The pole feature map X 10 As the input feature map of the MSDAF module. For the convenience of description, X 10 Denoted as Y1, its size is C×H×W, where C is the number of channels of the feature map, H is the height of the feature map, and W is the width of the feature map.
[0109] The construction and execution process of the MSDAF module in S32 is as follows:
[0110] Process 1: In the first branch, first perform a depth-wise separable convolution on Y1 with a kernel size of 5×5 (i.e. Figure 5 DWConv5×5 operation in the CNN) to obtain the pole feature map Y of size C×H×W 1_1 ; Its DWConv can effectively reduce the complexity of the model while enhancing the perception of multi-scale pole structures; then Y 1_1 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the pole feature map Y of size C / 4×H×W 1_3 ;
[0111] Process 2: At the same time, in the second branch, Y1 is first subjected to a depth-wise separable convolution of size 3×3 (i.e. Figure 5 DWConv3×3 operation in the CNN) to obtain the pole feature map Y of size C×H×W 1_2 ; Then Y 1_2 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the pole feature map Y of size C / 4×H×W 1_4 ;
[0112] Process 3: Then Y 1_3 、Y 1_4 Element-wise addition (i.e. Figure 5 in ) operation to obtain the pole feature map Y2 of size C / 4×H×W; perform batch normalization on Y2 (i.e. Figure 5 The Batch Norm operation in the algorithm is used to obtain a pole feature map Y3 of size C / 4×H×W; Y3 is input into the GAM submodule to obtain a pole feature map Y4 of size C / 4×H×W; its GAM submodule strengthens the key area response through the channel and space joint attention mechanism, highlights the structural features of the pole top, pole body, and cable connection section, suppresses the interference of the sky and vegetation background, and provides more discriminative support for the semantic feature reconstruction of the subsequent MLpBlock submodule; Y4 is max-pooled (i.e. Figure 5 The Max Pooling operation in
[15] is used to obtain a pole feature map Y5 of size C / 4 × H × W. The Max Pooling operation is used to extract spatial information at different scales, helping the model better capture the spatial relationship of poles in the image.
[0113] Process 4: Then, Y5 is input into the MLpBlock submodule to obtain the pole feature map Y6 of size C / 4×H×W; its MLpBlock submodule realizes fine feature reconstruction by dynamically focusing on local edges and global semantics; its structure can take into account both the details and global morphology of the pole, significantly improving its edge and contour recognition accuracy; Y5 is subjected to maximum pooling (i.e. Figure 5 Max Pooling operation in ), and obtain the pole feature map Y7 of size C / 4×H×W; input Y7 into the MLpBlock submodule, and obtain the pole feature map Y8 of size C / 4×H×W; perform maximum pooling on Y7 (i.e. Figure 5 MaxPooling operation in the MLpBlock submodule) to obtain the pole feature map Y9 of size C / 4×H×W; Y9 is input into the MLpBlock submodule to obtain the pole feature map Y of size C / 4×H×W 10 ; Change Y6, Y8, Y 10 Perform channel splicing (i.e. Figure 3 Concat operation in the middle) to obtain the pole feature map Y of size 2C×H×W 11 ; Y 11 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the utility pole feature map Y of size C×H×W 12 ; Y 12 This is the utility pole feature map that is finally output by the MSDAF module.
[0114] The MLpBlock (Multi-scale Lightweight Perception Block) submodule is a multi-scale lightweight perception module designed to enhance the perception of multi-scale features in images while maintaining computational efficiency. This module effectively integrates local and global information through a parallel or hierarchical multi-scale feature extraction structure, thereby improving the diversity and discriminability of feature expression.
[0115] The GAM submodule (Global Attention Module) is a global attention module designed to enhance the model's response to key regions by introducing a joint channel-spatial attention mechanism. This module effectively highlights the salient features of the target structure and suppresses background interference, thereby improving the model's discriminative ability and robustness. It excels in feature extraction and object recognition tasks in complex environments.
[0116] DWConv (Depthwise Convolution) is a lightweight convolution operation that effectively reduces the number of parameters and computational overhead by splitting standard convolution into channel-by-channel convolution and point-by-point convolution. This operation improves efficiency while maintaining feature extraction capabilities, making it particularly suitable for object detection and recognition tasks on mobile devices or in real-time scenarios.
[0117] S33: X again 11 Upsampling (i.e. Figure 2 Upsample operation in ), and get the pole feature map X 12 ; X8 and X 12 Perform channel splicing (i.e. Figure 2 Concat operation in the middle) to obtain the pole feature map X 13 ; X 13 Input into the EMBAConv module to obtain the pole feature map X 14 ; for X 14 Upsampling (i.e. Figure 2 Upsample operation in ), and get the pole feature map X 15 ; X6 and X 15 Perform Concat operation to obtain the pole feature map X 16 ; X 16 Input into the EMBAConv module to obtain the pole feature map X 17 ; X 17 Input into the ConvBNSiLU module to obtain the pole feature map X 18 ; X 14 and X 18 Perform Concat operation to obtain the pole feature map X 19; X 19 Input into the EMBAConv module to obtain the pole feature map X 20 ; X 20 Input into the ConvBNSiLU module to obtain the pole feature map X 21 ; X 11 and X 21 Perform channel splicing (i.e. Figure 2 Concat operation in the middle) to obtain the pole feature map X 22 ; X 22 Input into the EMBAConv module to obtain the pole feature map X 23 At the same time, X4 is input into the EMBAConv module to obtain the pole feature map X5', X5' is input into the ConvBNSiLU module to obtain the pole feature map X6', and X 18 and X6' for channel splicing (i.e. Figure 2 Concat operation in the middle) to obtain the pole feature map X7'; input X7' into the EMBAConv module to obtain the pole feature map X8'; 21 and X9' for channel splicing (i.e. Figure 2 Concat operation in the middle) to obtain the pole feature map X 10 ';X 10 'Input into the EMBAConv module to obtain the pole feature map X 11 '.
[0118] S34: X 23 、X8'、X 11 ' are input into the target prediction head Head to generate prediction information; the prediction information includes a 23 The corresponding prediction frame coordinate information, a prediction frame coordinate information corresponding to X8', a prediction frame coordinate information corresponding to X 11 'The corresponding prediction box coordinate information; each prediction box coordinate information includes the center point coordinates (x, y), width w and height h of the prediction box.
[0119] In the deep learning object detection model, the Head is responsible for directly predicting the location of the object from the feature map, that is, generating the coordinate information of the prediction box. This coordinate information mainly includes the following parameters:
[0120] (1) Center point (x, y): relative to the center point of the feature map cell, the position of the center of the prediction box in the entire image is determined by offset calculation.
[0121] (2) Width and height (w,h): The width and height of the predicted box, which are expressed relative to the width and height of the entire image to ensure the accuracy of the scale and position of the predicted box.
[0122] S3 includes but is not limited to the following embodiments:
[0123] Assume that the size of the feature map is H×W×C, where H is the height of the feature map, W is the width of the feature map, and C is the number of channels of the feature map.
[0124] The utility pole image X1 of size 512×512×3 is used as the input of the utility pole positioning detection model. First, X1 is input into the ConvBNSiLU module to obtain the utility pole feature map X2 of size 256×256×64; X2 is input into the ConvBNSiLU module to obtain the utility pole feature map X3 of size 128×128×128; X3 is input into the EMBAConv module to obtain the utility pole feature map X4 of size 128×128×256; X4 is input into the ConvBNSiLU module to obtain the utility pole feature map X5 of size 64×64×512; X5 is input into the EMBAConv Module, get the pole feature map X6 of size 64×64×512; input X6 into the ConvBNSiLU module, get the pole feature map X7 of size 32×32×512; input X7 into the EMBAConv module, get the pole feature map X8 of size 32×32×512; input X8 into the ConvBNSiLU module, get the pole feature map X9 of size 16×16×512; input X9 into the EMBAConv module, get the pole feature map X10 of size 16×16×512 10 ; X 10 Input into the MSDAF module to obtain the pole feature map X with a size of 16×16×512 11 ; for X 11 Upsampling (i.e. Figure 2 Upsample operation in ), we get the pole feature map X with a size of 32×32×512 12 ; X8 and X 12 Perform channel splicing (i.e. Figure 2 Concat operation in the middle), we get the pole feature map X with a size of 32×32×1024 13 ; X 13 Input into the EMBAConv module to obtain the pole feature map X of size 32×32×512 14 ; for X 14 Upsampling (i.e. Figure 2 Upsample operation in ), we get the pole feature map X with a size of 64×64×512 15 ; X6 and X 15 Perform the Concat operation to obtain the pole feature map X with a size of 64×64×102416 ; X 16 Input into the EMBAConv module to obtain the utility pole feature map X with a size of 64×64×256 17 ; X 17 Input into the ConvBNSiLU module to obtain the utility pole feature map X of size 32×32×256 18 ; X 14 and X 18 Perform channel splicing (i.e. Figure 2 Concat operation in the middle), we get the pole feature map X with a size of 32×32×768 19 ; X 19 Input into the EMBAConv module to obtain the pole feature map X of size 32×32×512 20 ; X 20 Input into the ConvBNSiLU module to obtain the utility pole feature map X with a size of 16×16×512 21 ; X 11 and X 21 Perform channel splicing (i.e. Figure 2 Concat operation in the middle) to obtain the electric pole feature map X with a size of 16×16×1024 22 ; X 22 Input into the EMBAConv module to obtain the utility pole feature map X with a size of 16×16×512 23 At the same time, X4 is input into the EMBAConv module to obtain the electric pole feature map X5' with a size of 128×128×512, and X5' is input into the ConvBNSiLU module to obtain the electric pole feature map X6' with a size of 32×32×512. 18 and X6' for channel splicing (i.e. Figure 2 Concat operation in the module) to obtain a 32×32×768 electric pole feature map X7'; input X7' into the EMBAConv module to obtain a 32×32×512 electric pole feature map X8'; input X8' into the ConvBNSiLU module to obtain a 16×16×512 electric pole feature map X9'; input X 21 and X9' for channel splicing (i.e. Figure 2 Concat operation in the middle), and obtain the electric pole feature map X with a size of 16×16×1024 10 ';X 10 'Input into the EMBAConv module to obtain the pole feature map X of size 16×16×256 11 ';X 23 、X8'、X 11'Input into the target detection head to generate prediction information. The prediction information contains a 23 The corresponding prediction frame coordinate information, a prediction frame coordinate information corresponding to X8', a prediction frame coordinate information corresponding to X 11 'The corresponding prediction box coordinate information. Each prediction box coordinate information includes the center point coordinates (x, y), width w and height h of the prediction box.
[0125] S4: Use the enhanced utility pole tilt detection dataset to train a utility pole positioning detection model to obtain a trained utility pole positioning detection model;
[0126] The specific steps of S4 are as follows:
[0127] S41: Before training the utility pole location detection model, you first need to set a series of key hyperparameters, including selecting an optimizer, determining the initial learning rate, batch size, and number of training rounds. This initial configuration determines the model's training efficiency and ultimate performance.
[0128] S42: After completing the initial setup, the training set and validation set need to be divided into multiple batches, each containing a certain amount of data; during each training, the model will extract data from the training set according to the set batch size for forward calculation and generate prediction results; based on the calculated prediction results, the loss value of each batch is calculated using the AW-IoU loss function, and then the parameters are gradually adjusted according to the loss value to optimize performance.
[0129] The present invention designs the AW-IoU loss function as the training loss function of the pole positioning detection model. By introducing a dynamic weight distribution mechanism driven by aspect ratio, the model has stronger geometric perception ability when processing slender targets such as poles. Since poles usually have obvious height-width asymmetry, traditional IoU is not sensitive enough to the height-width difference, which easily leads to inaccurate positioning. AW-IoU dynamically adjusts the weights of the horizontal and vertical errors according to the aspect ratio of the target true frame, so that the model pays more attention to the matching in the height direction during training and accurately detects the boundaries of the poles. At the same time, the loss function also introduces a nonlinear function to modulate the prediction error. When the predicted frame and the true frame are highly overlapped, its gradient value approaches zero, thereby effectively suppressing the gradient response caused by small deviations and reducing unnecessary disturbances to high-quality prediction frames. This mechanism not only improves the optimization efficiency of the model in key areas, but also enhances its positioning robustness and generalization ability for pole targets in complex environments (such as occlusion, low contrast, etc.).
[0130] In order to make the model have stronger geometric perception ability when dealing with slender targets such as telephone poles, the aspect ratio-driven dynamic weight α is introduced when designing the AW-IoU loss function, and its expression is:
[0131]
[0132] The width-aware weight w in its dynamic weight α ratio , height perception weight h ratio for:
[0133] w ratio =w gt / (w gt +h gt )
[0134] h ratio =h gt / (w gt +h gt )
[0135] w ratio +h ratio =1
[0136] AW-IoU loss function L AWIoU The function expression looks like this:
[0137]
[0138] The IoU expression is as follows:
[0139]
[0140] In the above formula, IoU represents the intersection-over-union ratio between the predicted box and the real box; B represents the predicted box; B gt Real frame; w gt Indicates the width of the true bounding box; h gt Represents the height of the true bounding box; dw1 represents the absolute value of the distance between the left edge of the predicted box and the left edge of the true box; dw2 represents the absolute value of the distance between the right edge of the predicted box and the right edge of the true box; dh1 represents the absolute value of the distance between the upper edge of the predicted box and the upper edge of the true box; dh2 represents the absolute value of the distance between the lower edge of the predicted box and the lower edge of the true box.
[0141] In the utility pole location detection task, the AW-IoU loss function uses a dynamic weight α to strengthen the penalty for width errors and reduce the impact of height errors, thereby more accurately correcting the shape deviations of the predicted boxes and improving boundary fitting accuracy. Furthermore, AW-IoU adjusts the error using a nonlinear modulation function, suppressing the gradient response caused by small deviations in high-overlap areas and avoiding excessive penalty for high-quality predicted boxes. This mechanism allows the model to focus more on key areas of the utility pole during training, improving the model's positioning accuracy in complex scenarios.
[0142] S43: When the number of training rounds reaches the preset value and the validation loss tends to be stable, the training process of the utility pole location detection model ends. Finally, an optimized utility pole location detection model is obtained. The model can accurately detect the location of utility poles and maintain strong performance in different environments and at different scales.
[0143] S44: After training, the utility pole location detection model will have optimized parameters and strong adaptability, enabling efficient utility pole location detection in a variety of scenarios.
[0144] S5: After the model training is completed, the trained pole positioning detection model is applied to the current pole image for recognition and analysis; finally, the specific position recognition result of the pole is output, that is, the coordinate information of three prediction boxes is output; the largest IoU is selected from the three output prediction boxes as the optimal prediction box, and then the coordinates of the optimal prediction box are converted according to the center point coordinates (x, y), width w and height h of the optimal prediction box to (x min ,y min ,x max ,y max ), where x min ,y min is the coordinate of the upper left corner of the optimal prediction box, x max ,y max is the coordinate of the lower right corner of the optimal prediction box;
[0145] S6: For the detected electric pole area, the LSD algorithm is applied to extract the straight line features of the electric pole edge. By analyzing the geometric relationship of the straight lines, the tilt angle of the electric pole is calculated. According to the tilt range standard, the tilt detection is completed;
[0146] The specific steps of S6 are as follows:
[0147] S61: First, according to the coordinates of the optimal prediction box (x min ,y min ,x max ,y max ), crop the main area of the electric pole from the original image I roi ;
[0148] S62: Then use the LSD algorithm to detect the main area I of the utility pole roi The line segments inside get the line segment set For each line segment l in the set i , can be achieved through the endpoint coordinates (x i1 ,y i1 ) and (x i2 ,y i2 ) to calculate the line segment l i Angle θ with the horizontal direction i , the specific calculation formula is as follows:
[0149]
[0150] θ i =arctan(|k i |)
[0151] Then use the length of the line segment i As the weight, its calculation formula is:
[0152]
[0153] Since longer straight segments usually correspond to the main structural features of the pole, they should be given more weight in the final slope calculation;
[0154] S63: Finally, the angles θ of all the above line segments are i The weighted summation gives the overall pole tilt angle β, which can be expressed as:
[0155]
[0156] This ensures that longer segments have a greater influence on the overall tilt angle, thus more accurately reflecting the overall structural tilt of the pole.
[0157] According to the current national standard "Operational Regulations for Overhead Transmission Lines" (DL / T 741-2019), the inclination of a power pole is γ = S / H, and the inclination angle β = arctan(S / H), where S is the horizontal offset of the top of the tower relative to the bottom, and H is the vertical height from the ground to the top of the tower. From γ = S / H and β = arctan(S / H), we can get:
[0158] γ=tanβ
[0159] According to the current national standard, "Operational Regulations for Overhead Transmission Lines" (DL / T 741-2019), the tilt of power poles and towers is determined to be within the permitted safety range. For voltage levels of ±500 kV and below, the maximum allowable tilt for towers under 50 meters is 1.0%, and for towers 50 meters and above, the maximum allowable tilt is 0.5%. For towers under 50 meters, tilt is considered present if γ exceeds 1.0%. For towers 50 meters or higher, tilt is considered present if γ exceeds 0.5%.
[0160] The LSD algorithm (Line Segment Detector) is an efficient line segment detection algorithm designed to quickly and accurately extract straight line segments with significant geometric structure from images. Combining edge detection with a region growing strategy, it robustly detects line segments of varying scales, orientations, and lengths while maintaining low computational cost. It is widely used in geometric analysis and object recognition tasks in structured scenes.
[0161] The national standard that defines the tilt range of utility pole towers is: Overhead Transmission Line Operation Regulations: DL / T741-2019[S].2019.
[0162] Based on the above, the present invention designs an efficient multi-branch attention convolution module EMBAConv for the task of utility pole tilt detection. This module adopts a Split multi-branch structure, processes the input utility pole feature map through a dual-branch multi-scale path, and combines the multi-scale convolution structure of the MCFA sub-module, that is, using 3×3 convolution to extract the details of the utility pole, 5×5 convolution to extract the local morphology of the utility pole, and 7×7 convolution to extract the overall structure of the utility pole, thereby enhancing the recognition ability under complex backgrounds. Residual connection improves the efficiency of deep feature transmission, and Swish activation enhances nonlinear modeling capabilities, improving detection stability under adverse conditions such as occlusion and blur. In the feature enhancement stage, the attention mechanism of the ECA sub-module and the CBAM sub-module is introduced: the ECA sub-module focuses on the edges and key structures of the utility pole, and the CBAM sub-module optimizes the spatial and channel dimension features after fusion, improving the model's response to the main structural areas. Ultimately, through the group convolution operation and channel shuffling operation of the GSConv sub-module, accurate modeling of the overall structural relationship of the utility poles was achieved, effectively enhancing the integrity and consistency of the feature expression, thereby significantly improving the overall accuracy and robustness of the detection system.
[0163] This paper designs an MSDAF module that combines multi-scale feature fusion with a dynamic attention mechanism to improve the recognition performance of utility poles of different sizes. It is particularly suitable for detecting small targets at a distance and large targets at close range in complex scenarios. The module uses DWConv for efficient feature extraction, thereby reducing the amount of computation. MaxPooling is used to extract spatial information at different scales, helping the model better capture the spatial relationship of utility poles in the image. At the same time, the MLpBlock submodule dynamically focuses on local edge details and global semantic information to achieve fine feature reconstruction. This module takes into account both the local details and global morphology of the utility poles, significantly improving the recognition accuracy of edges and contours, and providing high-quality, semantically rich feature support for subsequent line extraction in LSD.
[0164] This paper designs an AW-IoU loss function specifically for power transmission line pole detection. This function introduces an aspect ratio-driven dynamic weight allocation mechanism. It adaptively adjusts the penalty weights for lateral and longitudinal errors based on the structural characteristics of utility poles with large disparities in aspect ratio. This allows the model to focus more on fitting in the height direction during training, improving boundary positioning accuracy. At the same time, it integrates a nonlinear modulation function to compress the gradient response when the predicted frame and the true frame highly overlap, effectively suppressing disturbances caused by minor deviations and avoiding excessive penalties for high-quality predicted frames. This mechanism significantly improves the model's optimization efficiency in key areas, positioning stability, and generalization capabilities in complex environments.
[0165] Although the present invention has been described above with reference to embodiments, various modifications may be made thereto and equivalent components may be substituted without departing from the scope of the present invention. In particular, as long as there are no structural conflicts, the various features of the embodiments disclosed herein may be combined with each other in any manner, and the omission of an exhaustive description of such combinations in this specification is solely for the sake of space and resource conservation. Therefore, the present invention is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A method for detecting electric pole tilt based on deep learning, characterized in that: The specific steps are as follows: S1: Use drones to capture images of utility poles in normal, tilted, and fallen states. Ensure that the images cover different environments, weather conditions, time periods, and viewing distances. Manual visual screening is used to remove invalid images that are blurry, severely occluded, or highly repetitive. After image screening, professional annotation tools are used to accurately annotate the locations of utility poles, ultimately forming a multi-scene and multi-pose utility pole tilt detection dataset, D1. S2: Data operations such as data rotation, flipping, cropping, contrast adjustment, and noise addition are performed on D1 to obtain the enhanced utility pole tilt detection dataset D2. Subsequently, D2 is randomly divided into training data, validation data, and test data according to a certain ratio to obtain dataset D3 for model training, dataset D4 for model verification, and dataset D5 for model performance testing. S3: Build a deep learning-based utility pole location detection model, input the utility pole images in D2 into the model, and realize the location detection of utility poles in the transmission line scene; S4: Use the enhanced utility pole tilt detection dataset to train a utility pole positioning detection model to obtain a trained utility pole positioning detection model; S5: After the model training is completed, the trained pole positioning detection model is applied to the current pole image for recognition and analysis; finally, the specific position recognition result of the pole is output, that is, the coordinate information of three prediction boxes is output; the largest IoU is selected from the three output prediction boxes as the optimal prediction box, and then the coordinates of the optimal prediction box are converted according to the center point coordinates (x, y), width w and height h of the optimal prediction box to (x min ,y min ,x max ,y max ), where x min ,y min is the coordinate of the upper left corner of the optimal prediction box, x max ,y max is the coordinate of the lower right corner of the optimal prediction box; S6: For the detected utility pole area, the LSD algorithm is applied to extract the linear features of the utility pole edge. By analyzing the geometric relationship of the straight lines, the tilt angle of the utility pole is calculated. According to the tilt range standard, the tilt detection is completed.
2. The method for detecting electric pole tilt based on deep learning according to claim 1, characterized in that: The specific steps of S3 are as follows: S31: Input X1 into the ConvBNSiLU module to obtain the pole feature map X2; input X2 into the ConvBNSiLU module to obtain the pole feature map X3; input X3 into the EMBAConv module to obtain the pole feature map X4; input X4 into the ConvBNSiLU module to obtain the pole feature map X5; input X5 into the EMBAConv module to obtain the pole feature map X6; input X6 into the ConvBNSiLU module to obtain the pole feature map X7; input X7 into the EMBAConv module to obtain the pole feature map X8; input X8 into the ConvBNSiLU module to obtain the pole feature map X9; input X9 into the EMBAConv module to obtain the pole feature map X 10 ; S32: Transform the pole feature map X 10 Input into the MSDAF module to obtain the pole feature map X 11 ; S33: X again 11 Upsample to obtain the pole feature map X 12 ; X8 and X 12 Perform channel splicing to obtain the pole feature map X 13 ; X 13 Input into the EMBAConv module to obtain the pole feature map X 14 ; for X 14 Upsample to obtain the pole feature map X 15 ; X6 and X 15 Perform Concat operation to obtain the pole feature map X 16 ; X 16 Input into the EMBAConv module to obtain the pole feature map X 17 ; X 17 Input into the ConvBNSiLU module to obtain the pole feature map X 18 ; X 14 and X 18 Perform Concat operation to obtain the pole feature map X 19 ; X 19 Input into the EMBAConv module to obtain the pole feature map X 20 ; X 20 Input into the ConvBNSiLU module to obtain the pole feature map X 21 ; X 11 and X 21 Perform channel splicing to obtain the pole feature map X 22 ; X 22 Input into the EMBAConv module to obtain the pole feature map X 23 At the same time, X4 is input into the EMBAConv module to obtain the pole feature map X5', X5' is input into the ConvBNSiLU module to obtain the pole feature map X6', and X 18 and X6' to obtain the pole feature map X7'; input X7' into the EMBAConv module to obtain the pole feature map X8'; 21 Connect the channel with X9' to get the pole feature map X 10 ';X 10 'Input into the EMBAConv module to obtain the pole feature map X 11 '; S34: X 23 、X8'、X 11 ' are input into the target prediction head Head to generate prediction information; the prediction information includes a 23 The corresponding prediction frame coordinate information, a prediction frame coordinate information corresponding to X8', a prediction frame coordinate information corresponding to X 11 'The corresponding prediction box coordinate information; each prediction box coordinate information includes the center point coordinates (x, y), width w and height h of the prediction box.
3. The method for detecting electric pole tilt based on deep learning according to claim 2, characterized in that: The EMBAConv module in S31 adopts a dual-branch structure, with the MCFA sub-module and the ECA sub-module integrated in each branch. The MCFA sub-module uses a multi-scale convolution kernel to mine the fine-grained structural features of the utility poles and enhance the edge and morphological expression. The channel attention mechanism of the ECA sub-module is introduced into the sub-branch to highlight key channels and improve the discrimination of feature expression. After the output results of the two branches are spliced through the channels, the CBAM sub-module performs joint spatial and channel attention optimization to further focus on the salient areas of the utility poles.
4. The method for detecting electric pole tilt based on deep learning according to claim 3, characterized in that: The construction and execution process of the EMBAConv module is as follows: Process 1: First, split T1 by channel to obtain the electric pole feature map T2 and electric pole feature map T3 of size C / 2×H×W; then extract the electric pole features through two branches; Process 2: In the first branch, T2 is first input into the MCFA submodule to obtain a pole feature map T4 of size C / 2 × H × W. Its MCFA submodule adopts a multi-scale convolutional structure, using 3×3 convolution to extract pole details, 5×5 convolution to extract pole local morphology, and 7×7 convolution to extract pole overall structure. This enables the EMBAConv module to accurately identify the edge features and morphological changes of poles, and effectively improves the model's target differentiation ability under complex background interference such as vegetation occlusion, uneven lighting, and image blur. Then, T4 is input into the ECA submodule to obtain a pole feature map T5 of size C / 2 × H × W. Its ECA submodule uses local cross-channel interaction to generate attention weights and finely weights the edge, top, and bottom key areas of the utility pole. T5 is then split by channel to obtain a utility pole feature map T6 of size C / 4×H×W and a utility pole feature map T7 of size C / 4×H×W. T6 is input into the MCFA submodule to obtain a utility pole feature map T8 of size C / 4×H×W. T7 and T8 are then spliced together through channels to obtain a utility pole feature map T9 of size C / 2×H×W. Finally, T9 is input into the MCFA submodule to obtain a utility pole feature map T 10 ; Process 3: At the same time, in the second branch, first input T3 into the MCFA submodule to obtain the pole feature map T4' of size C / 2×H×W; input T4' into the MCFA submodule to obtain the pole feature map T5' of size C / 2×H×W; input T5' into the ECA submodule to obtain the pole feature map T6' of size C / 2×H×W; Process 4: Finally, T 10 Perform channel splicing with T6' to obtain the pole feature map T with a size of C×H×W 11 ; T 11 Input into the CBAM submodule to obtain the pole feature map T of size C×H×W 12 ; The CBAM submodule strengthens key features and salient areas through channel and spatial attention, thereby effectively preserving the overall shape and local detail features of the pole feature map in complex scenes such as occlusion and low light. 12 Input into the GSConv submodule to obtain the pole feature map T of size C×H×W 13 ; The GSConv submodule models the structure of the pole feature map through group convolution and channel shuffling strategies. First, the GSConv submodule divides the pole feature map into four subgroups, and each subgroup extracts the fine-grained structural features of the pole top, middle, bottom and the area connected to the cable. 13 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation to 13 The number of channels is adjusted to obtain the pole feature map T of size C'×H×W 14 , where the value of C' needs to be determined according to the specific adjustment situation; T 14 This is the feature map of the utility poles that is the final output of the EMBAConv module.
5. The method for detecting electric pole tilt based on deep learning according to claim 4, characterized in that: The construction and execution process of the MCFA submodule is as follows: Process 1: Let the input pole feature map be F1, input F1 into the Conv2d layer with a convolution kernel size of 1×1 for convolution operation to obtain the pole feature map F2; perform batch normalization on F2 to obtain the pole feature map F3; use the ReLU6 activation function on F3 to obtain the nonlinear transformed pole feature map F4; Process 2: In the first branch, F4 is first input into the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_1 ; Then F 4_1 Input to the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_4 ; for F 4_4 Use the ReLU6 activation function to obtain the nonlinear transformed pole feature map F 4_7 ; Process 3: At the same time, in the second branch, F4 is first input into the Conv2d layer with a convolution kernel size of 5×5 for convolution operation to obtain the pole feature map F 4_2 ; Then F 4_2 Input to the Conv2d layer with a convolution kernel size of 3×3 for convolution operation to obtain the pole feature map F 4_5 ; for F 4_5 Use the ReLU6 activation function to obtain the nonlinear transformed pole feature map F 4_8 ; Process 4: At the same time, in the third branch, F4 is first input into the Conv2d layer with a convolution kernel size of 7×7 for convolution operation to obtain the pole feature map F 4_3 ; Then F 4_3 With F in the second branch 4_2 By element-wise addition operation, we can get the pole feature map F 4_6 ; Then F 4_6 Using the ReLU6 activation function, we can obtain the nonlinear transformed pole feature map F 4_9 ; Step 5: Finally, F 4_7 、F 4_8 、F 4_9 Perform element-wise addition to obtain the electric pole feature map F5; input F5 into the Conv2d layer with a convolution kernel size of 1×1 for convolution operation to obtain the electric pole feature map F6; perform batch normalization on F6 to obtain the electric pole feature map F7; then perform element-wise addition on F3 and F7 to obtain the electric pole feature map F8; apply the Swish activation function to the electric pole feature map F8 to obtain the enhanced electric pole feature map F9.
6. The method for detecting electric pole tilt based on deep learning according to claim 2, characterized in that: The construction and execution process of the MSDAF module in S32 is as follows: Process 1: In the first branch, first perform a depth-wise separable convolution on Y1 with a kernel size of 5×5 to obtain a utility pole feature map Y of size C×H×W 1_1 ; Its DWConv can effectively reduce the complexity of the model while enhancing the perception of multi-scale pole structures; then Y 1_1 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the pole feature map Y of size C / 4×H×W 1_3 ; Process 2: At the same time, in the second branch, first perform a depth-wise separable convolution on Y1 with a convolution size of 3×3 to obtain a utility pole feature map Y with a size of C×H×W 1_2 ; Then Y 1_2 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the pole feature map Y of size C / 4×H×W 1_4 ; Process 3: Then Y 1_3 、Y 1_4 Perform element-wise addition to obtain a pole feature map Y2 of size C / 4×H×W; perform batch normalization on Y2 to obtain a pole feature map Y3 of size C / 4×H×W; input Y3 into the GAM submodule to obtain a pole feature map Y4 of size C / 4×H×W; Its GAM submodule strengthens the response of key areas through a joint channel and spatial attention mechanism, highlighting the structural features of the pole top, pole shaft, and cable connection section, suppressing background interference from the sky and vegetation, and providing more discriminative support for the semantic feature reconstruction of the subsequent MLpBlock submodule. Maximum pooling is performed on Y4 to obtain a pole feature map Y5 of size C / 4×H×W. Its Max Pooling operation is used to extract spatial information at different scales, helping the model better capture the spatial relationship of utility poles in the image; Process 4: Then input Y5 into the MLpBlock submodule to obtain the pole feature map Y6 of size C / 4×H×W; its MLpBlock submodule realizes fine feature reconstruction by dynamically focusing on local edges and global semantics; its structure can take into account both the details and global morphology of the poles, significantly improving its edge and contour recognition accuracy; perform maximum pooling on Y5 to obtain the pole feature map Y7 of size C / 4×H×W; input Y7 into the MLpBlock submodule to obtain the pole feature map Y8 of size C / 4×H×W; perform maximum pooling on Y7 to obtain the pole feature map Y9 of size C / 4×H×W; input Y9 into the MLpBlock submodule to obtain the pole feature map Y 10 ; Change Y6, Y8, Y 10 Perform channel splicing to obtain the pole feature map Y of size 2C×H×W 11 ; Y 11 Input to the Conv2d layer with a convolution kernel size of 1×1 for convolution operation, and obtain the utility pole feature map Y of size C×H×W 12 ; Y 12 This is the utility pole feature map that is finally output by the MSDAF module.
7. The method for detecting electric pole tilt based on deep learning according to claim 1, characterized in that: The specific steps of S4 are as follows: S41: Before training the utility pole location detection model, you first need to set a series of key hyperparameters, including selecting an optimizer, determining the initial learning rate, batch size, and number of training rounds. This initial configuration determines the model's training efficiency and ultimate performance. S42: After completing the initial setup, the training set and validation set need to be divided into multiple batches, each containing a certain amount of data. During each training, the model extracts data from the training set according to the set batch size for forward calculation and generates prediction results. Based on the calculated prediction results, the AW-IoU loss function is used to calculate the loss value of each batch, and then the parameters are gradually adjusted according to the loss value to optimize performance. S43: When the number of training rounds reaches the preset value and the validation loss tends to be stable, the training process of the utility pole location detection model ends. Finally, an optimized utility pole location detection model is obtained. The model can accurately detect the location of utility poles and maintain strong performance in different environments and at different scales. S44: After training, the utility pole location detection model will have optimized parameters and strong adaptability, and will be able to efficiently perform utility pole location detection in a variety of scenarios.
8. The method for detecting electric pole tilt based on deep learning according to claim 7, characterized in that: In the S42, the aspect ratio-driven dynamic weight α is introduced when designing the AW-IoU loss function, and its expression is: The width-aware weight w in its dynamic weight α ratio , height perception weight h ratio for: w ratio =w gt / (w gt +h gt ) h ratio =h gt / (w gt +h gt ) w ratio +h ratio =1 AW-IoU loss function L AWIoU The function expression looks like this: L AWIoU =1-IoU+1-e -α2 ,0≤L AWIoU ≤2 The IoU expression is as follows: In the above formula, IoU represents the intersection-over-union ratio between the predicted box and the real box; B represents the predicted box; B gt Real frame; w gt Indicates the width of the true bounding box; h gt Represents the height of the true bounding box; dw1 represents the absolute value of the distance between the left edge of the predicted box and the left edge of the true box; dw2 represents the absolute value of the distance between the right edge of the predicted box and the right edge of the true box; dh1 represents the absolute value of the distance between the upper edge of the predicted box and the upper edge of the true box; dh2 represents the absolute value of the distance between the lower edge of the predicted box and the lower edge of the true box.
9. The method for detecting electric pole tilt based on deep learning according to claim 1, characterized in that: The specific steps of S6 are as follows: S61: First, according to the coordinates of the optimal prediction box (x min ,y min ,x max ,y max ), crop the main area of the electric pole from the original image I roi ; S62: Then use the LSD algorithm to detect the main area I of the utility pole roi The line segments inside get the line segment set For each line segment l in the set i , can be achieved through the endpoint coordinates (x i1 ,y i1 ) and (x i2 ,y i2 ) to calculate the line segment l i Angle θ with the horizontal direction i , the specific calculation formula is as follows: θ i =arctan(|k i |) Then use the length of the line segment i As the weight, its calculation formula is: Since longer straight segments usually correspond to the main structural features of the pole, they should be given more weight in the final slope calculation; S63: Finally, the angles θ of all the above line segments are i The weighted summation gives the overall pole tilt angle β, which can be expressed as:
Citation Information
Patent Citations
Remote sensing image marine ship identification system and method based on improved YOLOv4 algorithm
CN113920436A
Telegraph pole tower inclination monitoring method based on rotating target detection
CN116503798A
Power line extraction method and device, storage medium and computer equipment
CN116843909A
Method, device and equipment for detecting inclination of concrete pole and storage medium
CN117670818A
Cited By
Telegraph pole inclination angle detection method, device and equipment and storage medium
CN121564100A
