Distribution network line multi-scale target defect identification method, device, equipment and medium

By combining large-scale and small-scale recognition models with the improved YOLO11 detection algorithm, the problems of insufficient detection rate and high false detection in multi-scale target defect recognition during drone inspection of distribution network lines are solved, achieving efficient and accurate multi-scale target defect recognition and improving inspection efficiency and accuracy.

CN120431086BActive Publication Date: 2025-09-09HUAYAN INTELLIGENT TECH (GRP) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510874282.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-09-09
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

In the existing technology of drone inspection of distribution network lines, the multi-scale target defect recognition method has the problems of insufficient detection rate and high false detection, which cannot meet the needs of automatic identification of multi-scale target defects.

Method used

Large-scale and small-scale recognition models are used to identify large and small target defects respectively. Hierarchical filtering and fusion are performed through the preset target scale deletion rule and non-maximum suppression processing algorithm. Combined with the improved YOLO11 detection algorithm, the spatial attention module and SwinTransformer module are used to enhance feature extraction to achieve accurate recognition of multi-scale target defects.

Benefits of technology

It improves the efficiency of distribution network line inspection, effectively prevents missed detection and false detection, and ensures the timely discovery and processing of multi-scale target defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431086B_ABST
    Figure CN120431086B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and discloses a method, device, equipment and medium for multi-scale target defect recognition of distribution network lines. The method comprises: obtaining a distribution network line inspection image, inputting the distribution network line inspection image into a large-scale recognition model and a small-scale recognition model respectively, and obtaining a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types, and a plurality of small-scale defect rectangular frames and a plurality of small-scale defect types; using a preset target scale deletion rule to perform hierarchical filtering and fusion on the large-scale defect rectangular frames and the large-scale defect types, and the small-scale defect rectangular frames and the small-scale defect types, and obtain a multi-scale target defect recognition result; judging whether the multi-scale target defect recognition result is empty, if so, recording the multi-scale target defect list as empty, and if not, recording the multi-scale target defect recognition result in the multi-scale target defect list. The present application greatly improves the working efficiency of power inspection and effectively prevents missed detection and false detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, equipment and medium for identifying multi-scale target defects in distribution network lines. Background Art

[0002] In drone inspection images of distribution network lines, multi-scale target defects are characterized by large objects appearing larger and small objects appearing smaller. Typical multi-scale target defects include foreign objects on towers, bird nests on towers, foreign objects on conductors, and broken conductors. If these defects are not discovered and corrected promptly, they can easily lead to faults such as line leakage and power outages, seriously threatening the safe operation of distribution lines.

[0003] At present, the multi-scale target defect identification method for distribution network lines often uses detection algorithms such as the YOLO series and Cascade-RCNN. However, due to the characteristics of multi-scale target defects, large targets are very large and small targets are very small. Therefore, directly using one-stage detection algorithms or multi-stage detection algorithms often results in insufficient detection rate and relatively high false detection rate, which cannot meet the needs of automatic identification of multi-scale target defects. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device, equipment and medium for identifying multi-scale target defects in distribution network lines.

[0005] The present invention provides the following technical solutions:

[0006] In a first aspect, an embodiment of the present disclosure provides a method for identifying multi-scale target defects in distribution network lines, the method comprising:

[0007] Obtaining a distribution network line inspection image, inputting the distribution network line inspection image into a large-scale recognition model and a small-scale recognition model respectively, obtaining a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types through the large-scale recognition model, and obtaining a plurality of small-scale defect rectangular frames and a plurality of small-scale defect types through the small-scale recognition model;

[0008] Using a preset target scale deletion rule, each large-scale defect rectangular box and each large-scale defect type, and each small-scale defect rectangular box and each small-scale defect type are hierarchically filtered and fused to obtain a multi-scale target defect recognition result, wherein the multi-scale target defect recognition result includes a multi-scale target defect rectangular box and its corresponding multi-scale target defect type;

[0009] Determine whether the multi-scale target defect recognition result is empty. If so, record the multi-scale target defect list of the distribution network line inspection image as empty and save it. Otherwise, record the multi-scale target defect rectangular box and its corresponding multi-scale target defect type in the multi-scale target defect list of the distribution network line inspection image and save it.

[0010] In an optional embodiment, the preset target scale deletion rule is used to perform hierarchical filtering and fusion on each of the large-scale defect rectangular boxes and each of the large-scale defect types, and each of the small-scale defect rectangular boxes and each of the small-scale defect types to obtain a multi-scale target defect recognition result, including:

[0011] Obtaining the confidence of each of the large-scale defect rectangular frames, and deleting rectangular frames whose confidence is lower than a first preset confidence threshold, to obtain a plurality of first large-scale defect rectangular frames;

[0012] Calculating the overlap rate of each of the first large-scale defect rectangular frames using a non-maximum suppression processing algorithm, and deleting rectangular frames with an overlap rate greater than a preset overlap rate threshold, to obtain a plurality of second large-scale defect rectangular frames;

[0013] Filtering each of the second-largest-scale defect rectangular frames using the first target scale deletion rule to obtain a plurality of third-largest-scale defect rectangular frames;

[0014] Obtaining the confidence of each of the small-scale defect rectangular frames, and deleting rectangular frames whose confidence is lower than a second preset confidence threshold, to obtain a plurality of first small-scale defect rectangular frames;

[0015] Calculating the variation overlap rate of each of the first small-scale defect rectangular frames using an area non-maximum suppression processing algorithm, and deleting rectangular frames whose variation overlap rate is greater than a preset variation overlap rate threshold, to obtain a plurality of second small-scale defect rectangular frames;

[0016] Filtering each of the second small-scale defect rectangular frames using a second target scale deletion rule to obtain a plurality of third small-scale defect rectangular frames;

[0017] Merging the third large-scale defect rectangular frames and their corresponding large-scale defect types, and the third small-scale defect rectangular frames and their corresponding small-scale defect types, to obtain fused defect rectangular frames and their corresponding defect types;

[0018] The fused defect rectangular frame is filtered using the area non-maximum suppression processing algorithm to obtain the multi-scale target defect rectangular frame and its corresponding multi-scale target defect type.

[0019] In an optional implementation manner, the first target scale deletion rule is:

[0020]

[0021] Where, Indicates whether to delete the second largest scale defect rectangle. If it is 1, it means to delete it. If it is 0, it means not to delete it. represents the relative long side of the second largest scale defect rectangle, , represents the relative network width of the target, Indicates the relative network height of the target; Indicates the preset relative long edge threshold;

[0022] The second target scale deletion rule is:

[0023]

[0024] Where, Indicates whether to delete the second small-scale defect rectangle. If it is 1, it means to delete it. If it is 0, it means not to delete it. represents the relatively short side of the second small-scale defect rectangle, , represents the relative network width of the target, Indicates the relative network height of the target; Indicates the preset relative short edge threshold;

[0025] The calculation formulas for the target's relative network width and target's relative network height are as follows:

[0026]

[0027] Where, Indicates the width of the target, represents the width of the detection network, Indicates the width of the image, Indicates the height of the target, represents the height of the detection network, Indicates the height of the image.

[0028] In an optional embodiment, the area non-maximum suppression processing algorithm is used to calculate the variation overlap rate of each of the first small-scale defect rectangular frames, and the rectangular frames whose variation overlap rate is greater than a preset variation overlap rate threshold are deleted to obtain multiple second small-scale defect rectangular frames, including:

[0029] Step S1, sorting the areas of the first small-scale defect rectangular frames according to a preset order;

[0030] Step S2, determining the first small-scale defect rectangular frame with the largest area as the registration rectangular frame;

[0031] Step S3, using a preset variation overlap rate calculation formula to calculate the variation overlap rate of each remaining rectangular frame with the registration rectangular frame, and deleting the rectangular frames whose variation overlap rate is greater than the preset variation overlap rate threshold, and retaining the rectangular frames whose variation overlap rate is less than or equal to the preset variation overlap rate threshold;

[0032] Step S4: repeating steps S1-S3 in the remaining rectangular frames until the variation overlap ratios between all remaining rectangular frames and the current registration rectangular frame are less than or equal to the preset variation overlap ratio threshold, and using the registration rectangular frames determined in each iteration as multiple second small-scale defect rectangular frames;

[0033] The preset mutation overlap rate calculation formula is:

[0034]

[0035] Where, is the variation overlap rate of rectangular box ABCD and rectangular box EFGH, is the intersection area of ​​rectangular box ABCD and rectangular box EFGH, is the area of ​​rectangular box ABCD, is the area of ​​the rectangular frame EFGH, is the horizontal coordinate of the upper left point A of the rectangular frame ABCD, is the ordinate of the upper left point A of the rectangular frame ABCD, is the horizontal coordinate of the lower right point C of the rectangular frame ABCD, is the ordinate of the lower right point C of the rectangular frame ABCD, is the horizontal coordinate of the upper left point E of the rectangular frame EFGH, is the ordinate of the upper left point E of the rectangular frame EFGH, is the horizontal coordinate of the lower right point G of the rectangular frame EFGH, It is the vertical coordinate of the lower right point G of the rectangular frame EFGH.

[0036] In an optional embodiment, the large-scale recognition model and the small-scale recognition model are both based on an improved YOLO11 detection algorithm, the improved YOLO11 detection algorithm includes a backbone network, a feature pyramid network and a decoupling head, the feature pyramid network includes a first spatial attention module, a second spatial attention module, a first convolution module, a second convolution module, a first SwinTransformer module, a second SwinTransformer module and a third SwinTransformer module, the decoupling head includes a first classification regression module, a second classification regression module and a third classification regression module, the large-scale recognition model is used to obtain a plurality of large-scale defect rectangular boxes and a plurality of large-scale defect types, and the small-scale recognition model is used to obtain a plurality of small-scale defect rectangular boxes and a plurality of small-scale defect types, including:

[0037] Inputting the distribution network line inspection image into the large-scale recognition model, using the large-scale recognition model to perform target defect detection, and obtaining a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types;

[0038] The distribution network line inspection image is cropped according to a preset cropping resolution through a sliding window to obtain a cropped image set, the cropped image set is input into the small-scale recognition model, the small-scale recognition model is used to perform target defect detection, and the defect rectangular frame and defect type of the cropped image set are obtained. The coordinates of the defect rectangular frame of the cropped image set are mapped back to the coordinates of the distribution network line inspection image to obtain multiple small-scale defect rectangular frames and multiple small-scale defect types.

[0039] In an optional embodiment, the inputting of the distribution network line inspection image into the large-scale recognition model, using the large-scale recognition model to perform target defect detection, and obtaining a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types, includes:

[0040] Inputting the distribution network line inspection image into the backbone network to obtain a first-layer feature map, a second-layer feature map, and a third-layer feature map;

[0041] Inputting the third layer feature map and the second layer feature map into the first spatial attention module to obtain a first spatial attention feature map, and cascading the first spatial attention feature map and the second layer feature map to obtain a first fusion map;

[0042] Inputting the first fusion map and the first layer feature map into the second spatial attention module to obtain a second spatial attention feature map, and cascading the second spatial attention feature map with the first layer feature map to obtain a second fusion map;

[0043] Inputting the second fusion map into the first convolution module to obtain a first feature map, and concatenating the first feature map with the first fusion map to obtain a third fusion map;

[0044] Inputting the third fusion map into the second convolution module to obtain a second feature map, and concatenating the second feature map with the third layer feature map to obtain a fourth fusion map;

[0045] Inputting the second fused image into the first SwinTransformer module to obtain a first fine-grained feature map, inputting the third fused image into the second SwinTransformer module to obtain a second fine-grained feature map, and inputting the fourth fused image into the third SwinTransformer module to obtain a third fine-grained feature map;

[0046] The first fine-grained feature map, the second fine-grained feature map, and the third fine-grained feature map are respectively input into the first classification regression module, the second classification regression module, and the third classification regression module to obtain a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types.

[0047] In an optional embodiment, inputting the third layer feature map and the second layer feature map into the first spatial attention module to obtain the first spatial attention feature map includes:

[0048] The second layer feature map is subjected to channel maximum pooling and channel average pooling respectively to obtain a maximum value feature map and a mean feature map, respectively, and the maximum value feature map and the mean feature map are channel-joined to obtain a two-channel feature map, and the two-channel feature map is subjected to 1×1 convolution to obtain a single-channel feature map, and the single-channel feature map is subjected to an activation function to obtain a spatially weighted feature map;

[0049] Performing 1×1 convolution and upsampling on the third layer feature map in sequence to obtain an upsampled feature map;

[0050] Multiplying the spatial weighted feature map by the upsampled feature map to obtain the first spatial attention feature map.

[0051] In a second aspect, an embodiment of the present disclosure provides a device for identifying multi-scale target defects in distribution network lines, the device comprising:

[0052] a recognition module, configured to obtain a distribution network line inspection image, input the distribution network line inspection image into a large-scale recognition model and a small-scale recognition model respectively, obtain a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types through the large-scale recognition model, and obtain a plurality of small-scale defect rectangular frames and a plurality of small-scale defect types through the small-scale recognition model;

[0053] a fusion module, configured to perform hierarchical filtering and fusion of each of the large-scale defect rectangular boxes and each of the large-scale defect types, and each of the small-scale defect rectangular boxes and each of the small-scale defect types, using a preset target scale deletion rule, to obtain a multi-scale target defect recognition result, wherein the multi-scale target defect recognition result includes the multi-scale target defect rectangular boxes and their corresponding multi-scale target defect types;

[0054] A recording module is used to determine whether the multi-scale target defect recognition result is empty. If so, the multi-scale target defect list of the distribution network line inspection image is recorded as empty and saved. Otherwise, the multi-scale target defect rectangular box and its corresponding multi-scale target defect type are recorded in the multi-scale target defect list of the distribution network line inspection image and saved.

[0055] In a third aspect, an embodiment of the present disclosure provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the distribution network line multi-scale target defect identification method described in the first aspect are implemented.

[0056] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the distribution network line multi-scale target defect identification method described in the first aspect.

[0057] Beneficial effects of this application:

[0058] The multi-scale target defect identification method for distribution network lines provided in the embodiment of the present application is based on a deep learning algorithm, uses a large-scale recognition model to identify large targets of multi-scale target defects, and uses a small-scale recognition model to identify small targets of multi-scale target defects. By hierarchical fusion of defect scales of large and small scale targets, the work efficiency of power inspection can be greatly improved, and missed detection and false detection can be effectively prevented.

[0059] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be considered as limiting the scope. A person of ordinary skill in the art can also derive other relevant drawings based on these drawings without inventive effort. Similar components are numbered similarly in the various drawings.

[0061] Figure 1 A flow chart of a method for identifying multi-scale target defects in distribution network lines provided by an embodiment of the present application is shown;

[0062] Figure 2 A schematic diagram of the network structure of an improved Yolo11 detection algorithm provided in an embodiment of the present application is shown;

[0063] Figure 3 A schematic diagram of the network structure of a first spatial attention module provided in an embodiment of the present application is shown;

[0064] Figure 4 A schematic diagram of the network structure of a first SwinTransformer module provided in an embodiment of the present application is shown;

[0065] Figure 5 A schematic structural diagram of a multi-scale target defect identification device for distribution network lines provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0066] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.

[0067] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used in the template description herein are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0069] Example 1

[0070] like Figure 1 FIG. 1 is a flow chart of a method for identifying multi-scale target defects in distribution network lines according to an embodiment of the present application. The method for identifying multi-scale target defects in distribution network lines according to an embodiment of the present application includes the following steps:

[0071] Step S110: Obtain a distribution network line inspection image, input the distribution network line inspection image into a large-scale recognition model and a small-scale recognition model respectively, obtain a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types through the large-scale recognition model, and obtain a plurality of small-scale defect rectangular frames and a plurality of small-scale defect types through the small-scale recognition model.

[0072] In this embodiment, a multi-scale target defect original sample library of distribution network lines is first obtained. To increase sample diversity, each sample image in the original multi-scale target defect sample library is augmented to obtain an augmented multi-scale target defect sample library. Augmentation methods include, but are not limited to, left-right flipping, angular rotation, Gaussian noise, and image mixing, which are not limited in this embodiment. The original multi-scale target defect sample library and the augmented multi-scale target defect sample library are then merged to obtain a multi-scale target defect sample library. The relative network width and height of each sample image in the multi-scale target defect sample library are then calculated (the calculation method for the relative network width and height will be described in detail later and is not discussed here). Sample images whose relative network width and height fall below a preset pixel threshold (e.g., 10 pixels) are deleted. This generates a large-scale recognition model training sample library. The large-scale recognition model training sample library is then used to train an improved YOLO11 detection algorithm to obtain a large-scale recognition model. This helps the model focus on learning the features of large-scale defects, improving the recognition accuracy of large-scale defects.

[0073] Furthermore, a sliding window is used to crop the sample images in the multi-scale target defect original sample library according to a first preset cropping resolution (e.g., 2500 pixels × 2500 pixels) to obtain multiple first cropped images. A target region analysis is then performed on each first cropped image. If the target area in the first cropped image exceeds a first preset threshold (e.g., 50%) or the target is segmented into an incomplete form by the boundary of the sliding window, the corresponding first excess portion or first incomplete portion is filled (using a solid color, such as black or white), thereby obtaining a multi-scale target defect original sub-image library. A sliding window is used to crop the sample images in the multi-scale target defect augmented sample library according to a second preset cropping resolution (e.g., 2500 pixels × 2500 pixels) to obtain multiple second cropped images. Each second cropped image is then analyzed for target regions. If the target's area in the second cropped image exceeds a second preset threshold (e.g., 50%) or the target is incompletely segmented by the sliding window boundary, the corresponding second excess or incomplete portion is filled (using a solid color, such as black or white), thereby generating a multi-scale target defect augmented sub-image library. Finally, the original multi-scale target defect sub-image library is merged with the augmented multi-scale target defect sub-image library to generate a small-scale recognition model training sample library. The small-scale recognition model training sample library is used to train the improved YOLO11 detection algorithm to obtain a small-scale recognition model.

[0074] It should be noted that the first preset cropping resolution and the second preset cropping resolution may be the same or different, and the first preset proportion threshold and the second preset proportion threshold may be the same or different, which is not limited in this embodiment.

[0075] The above method uses the large-scale recognition model training sample library and the small-scale recognition model training sample library to train the improved YOLO11 detection algorithm respectively. The obtained large-scale recognition model and small-scale recognition model can more accurately capture the characteristics of large-scale and small-scale defects, providing strong support for subsequent large-scale and small-scale defect recognition.

[0076] In this embodiment, in view of the high resolution of the distribution network line inspection images, the ever-changing background scenes, and the multi-scale target defects that not only show the characteristics of large targets being large and small targets being small, but also the characteristics of non-uniform shape texture and complex defect context information, in order to accurately detect multi-scale target defects, this application adopts an improved YOLO11 detection algorithm to build a large-scale recognition model and a small-scale recognition model, which not only effectively covers the scale range of multi-scale target defects, but also can effectively perceive the characteristics of the multi-scale target defects themselves.

[0077] In order to quickly and accurately obtain high-level semantic features, this application introduces a spatial attention module (SAM) into the feature pyramid network part of the YOLO11 algorithm, allowing the network to pay more attention to the defect area, and introduces the SwinTransformer module, allowing the network to capture more fine-grained features of the defect target. This not only enhances the high-level semantic feature expression of the defect target, but also effectively controls the efficiency of defect feature calculation, laying the foundation for the accuracy and speed of multi-scale target defect detection.

[0078] like Figure 2 Figure 2 shows the network structure of the improved YOLO11 detection algorithm, which includes a backbone network, a feature pyramid network, and a decoupling head. The feature pyramid network includes a first spatial attention module, a second spatial attention module, a first convolution module, a second convolution module, a first SwinTransformer module, a second SwinTransformer module, and a third SwinTransformer module, and the decoupling head includes a first classification regression module, a second classification regression module, and a third classification regression module.

[0079] It can be understood that after obtaining the distribution network line inspection image to be identified, it is simultaneously input into the large-scale recognition model and the small-scale recognition model based on the improved YOLO11 detection algorithm for defect identification, thereby obtaining multiple large-scale defect rectangular boxes and corresponding large-scale defect types, multiple small-scale defect rectangular boxes and multiple small-scale defect types.

[0080] It can be understood that multiple large-scale defect rectangular frames and multiple large-scale defect types are obtained through the large-scale recognition model. That is, the distribution network line inspection image is input into the large-scale recognition model, and the large-scale recognition model is used to perform target defect detection, thereby obtaining multiple large-scale defect rectangular frames and multiple large-scale defect types. The specific process is as follows:

[0081] First, if Figure 2As shown in the figure, the distribution network line inspection image passes through the backbone network (Conv3~Conv5) constructed by the C3K2 module to obtain the first layer feature map F3, the second layer feature map F4 and the third layer feature map F5; then, F3~F5 are input into the feature pyramid network PA-SACM-FPN, where the third layer feature map F5 and the second layer feature map F4 pass through the first spatial attention module to generate the first spatial attention feature map SAF4, and then the first spatial attention feature map SAF4 is cascaded with the second layer feature map F4 to generate the first fusion Figure ~P4; then, the first fusion image ~P4 and the first layer feature map F3 pass through the second spatial attention module to generate the second spatial attention feature map SAF3, and then the second spatial attention feature map SAF3 is cascaded with the first layer feature map F3 to generate the second fusion image P3; then, the second fusion image P3 passes through the first convolution module to generate the first feature map PAF4 with the same resolution as the first fusion image ~P4, and the first feature map PAF4 is further cascaded with the first fusion image ~P4 to generate the third fusion image P4; then, the third fusion image P4 passes through the second convolution module to generate the second feature map PAF5 with the same resolution as the third layer feature map F5, and the second feature map PAF5 is further cascaded with the third layer feature map F5 to generate the fourth fusion image P5; then, the second fusion image P3, the third fusion image P4, and the fourth fusion image P5 pass through the first SwinTransformer module, the second SwinTransformer module, and the third SwinTransformer module respectively to generate the first fine-grained feature map T3, the second fine-grained feature map T4, and the third fine-grained feature map T5. Finally, the first fine-grained feature map T3, the second fine-grained feature map T4, and the third fine-grained feature map T5 are classified and regressed by the first classification and regression module, the second classification and regression module, and the third classification and regression module in the decoupling head, respectively, to obtain multiple large-scale defect rectangular frames and corresponding large-scale defect types (for example, foreign objects on towers, bird nests on towers, foreign objects on conductors, broken conductors, etc.), thereby completing the detection and identification task of multi-scale target defects in distribution network lines.

[0082] It should be noted that in Figure 2 In

[15] , concat refers to the operation of splicing multiple images along a certain dimension to facilitate subsequent calculations.

[0083] Understandably, if Figure 3As shown, the working principle of the spatial attention module in the above process is as follows (taking the third-layer feature map F5 and the second-layer feature map F4 as an example to input the first spatial attention module to obtain the first self-spatial attention feature map SAF4): First, the low-level high-resolution feature map (the second-layer feature map F4) is subjected to channel maximum pooling and channel average pooling respectively to obtain the maximum value feature map and the mean feature map, respectively; then, the maximum value feature map and the mean feature map are channel-concatenated to obtain a two-channel feature map, and the two-channel feature map is subjected to a 1×1 convolution operation to obtain a single-channel feature map, and the single-channel feature map is subjected to an activation function to obtain a spatial weighted feature map; then, the high-level low-resolution feature map (the third-layer feature map F5) is sequentially subjected to 1×1 convolution and upsampling to obtain an upsampled feature map with the same resolution as the low-level high-resolution feature map; finally, the spatial weighted feature map is multiplied by the upsampled feature map to obtain the first spatial attention feature map SAF4.

[0084] It should be noted that, in the process of inputting the first fusion image ~P4 and the first layer feature map F3 into the second spatial attention module to obtain the second spatial attention feature map SAF3, the first fusion image ~P4 is a high-level low-resolution feature map, and the first layer feature map F3 is a low-level high-resolution feature map. The principle is consistent with the principle of the above-mentioned first spatial attention module, and this embodiment will not be repeated here.

[0085] The SwinTransformer (Sliding Window Hierarchical Transformer) module, proposed by the Microsoft Research team, is an innovative visual Transformer model designed to address the computational overhead and efficiency issues of the traditional Vision Transformer (ViT) in image processing tasks. It combines a local window attention mechanism with a more efficient computational strategy, maintaining the powerful modeling capabilities of the Transformer while optimizing computational performance and model expressiveness.

[0086] like Figure 4As shown, the working principle of the SwinTransformer module in the above process is as follows (taking the second fusion image P3 as an example to input the first SwinTransformer module to obtain the first fine-grained feature map T3): the first SwinTransformer module includes a first-layer normalization unit, a window multi-head self-attention unit, a second-layer normalization unit, a first multi-layer perceptron unit, a third-layer normalization unit, a moving window multi-head self-attention unit, a fourth-layer normalization unit and a second multi-layer perceptron unit; first, the second fusion image P3 is input into the first-layer normalization unit for normalization to obtain a first normalized image, and the first normalized image is input into the window multi-head self-attention unit. The window multi-head self-attention unit will first divide the first normalized image into multiple fixed-size windows, and then perform self-attention calculation in each window. At this time, the computational complexity is linearly related to the number of small blocks in the window, thereby reducing the overall computational complexity, and then obtaining multiple first self-attention feature maps; then, each first self-attention feature map is merged with the second fusion image P3 and input into the second-layer normalization unit for normalization to obtain the second normalized image. Image, and input the second normalized image into the first multi-layer perceptron unit for nonlinear transformation, thereby obtaining the first transformed image; then, the first transformed image, each first self-attention feature map and the second fusion map P3 are merged and input into the third layer normalization unit for normalization processing to obtain the third normalized image, and the third normalized image is input into the moving window multi-head self-attention unit. The moving window multi-head self-attention unit will first change the window division by moving the window so that adjacent windows can interact with each other, and perform self-attention calculation again under the new window division. , and then obtain multiple second self-attention feature maps; then, each second self-attention feature map, the first transformed image, each first self-attention feature map and the second fusion map P3 are merged and input into the fourth layer normalization unit for normalization processing to obtain a fourth normalized image, and the fourth normalized image is input into the second multi-layer perceptron unit for nonlinear transformation to obtain a second transformed image; finally, the second transformed image, each second self-attention feature map, the first transformed image, each first self-attention feature map and the second fusion map P3 are merged as the first fine-grained feature map T3.

[0087] It should be noted that the principle of inputting the third fusion image P4 into the second SwinTransformer module to obtain the second fine-grained feature map T4, and inputting the fourth fusion image P5 into the third SwinTransformer module to obtain the third fine-grained feature map T5 is consistent with the principle of the above-mentioned first SwinTransformer module, and will not be repeated here in this embodiment.

[0088] Understandably, the process of obtaining multiple small-scale defect rectangles and multiple small-scale defect types using the small-scale recognition model first requires cropping the distribution network line inspection image using a sliding window at a preset cropping resolution (e.g., 2500 pixels x 2500 pixels) to obtain a cropped image set. This cropped image set is then input into the small-scale recognition model to obtain the defect rectangles and defect types for the cropped image set. Finally, the coordinates of the defect rectangles in the cropped image set are mapped back to the coordinates of the original distribution network line inspection image, thereby obtaining multiple small-scale defect rectangles and corresponding small-scale defect types (e.g., including foreign objects on towers, bird nests on towers, foreign objects on conductors, and broken conductor strands). The preset cropping resolution can be the same as or different from the first and second preset cropping resolutions, and this is not limited in this embodiment.

[0089] It should be noted that the above process of inputting the cropped image set into the small-scale recognition model to obtain the defect rectangular frame and defect type of the cropped image set is consistent with the principle of obtaining multiple large-scale defect rectangular frames and multiple large-scale defect types through the large-scale recognition model. This embodiment will not be repeated here.

[0090] The large-scale recognition model described above can accurately and quickly detect large-scale defects in distribution network line inspection images, such as large foreign objects on towers and bird nests. The small-scale recognition model can accurately and quickly detect small-scale defects in distribution network line inspection images, such as tiny foreign objects and broken wires. By combining the large-scale and small-scale recognition models, distribution network line defects can be promptly discovered and addressed, preventing accidents.

[0091] In step S120, a preset target scale deletion rule is used to perform hierarchical filtering and fusion on the large-scale defect rectangular boxes and the large-scale defect types, and on the small-scale defect rectangular boxes and the small-scale defect types, to obtain a multi-scale target defect recognition result, wherein the multi-scale target defect recognition result includes the multi-scale target defect rectangular boxes and their corresponding multi-scale target defect types.

[0092] Specifically, for large-scale defect rectangular frames and large-scale defect types: (1) first, obtain the confidence of each large-scale defect rectangular frame, and delete the rectangular frames with confidence lower than a first preset confidence threshold (for example, 0.30) to obtain multiple first-scale defect rectangular frames; (2) then, use the non-maximum suppression processing algorithm (NMS) and the preset overlap rate calculation formula to calculate the overlap rate of each first-scale defect rectangular frame, and delete the rectangular frames with overlap rate greater than the preset overlap rate threshold (for example, 0.70) to obtain multiple second-scale defect rectangular frames; (3) finally, use the first target scale deletion rule to filter each second-scale defect rectangular frame to obtain multiple filtered third-scale defect rectangular frames.

[0093] Among them, the first target scale deletion rule is:

[0094]

[0095] Where, Indicates whether to delete the second largest scale defect rectangle. If it is 1, it means to delete it. If it is 0, it means not to delete it. Indicates the relative long side of the second largest scale defect rectangle, , represents the relative network width of the target, Indicates the relative network height of the target; Indicates the preset relative long edge threshold (for example, 10 pixels).

[0096] The preset overlap rate calculation formula is:

[0097]

[0098] Where, is the overlap ratio of rectangular frame ABCD and rectangular frame EFGH, is the intersection area of ​​rectangular box ABCD and rectangular box EFGH, is the area of ​​rectangular box ABCD, is the area of ​​the rectangular frame EFGH, is the horizontal coordinate of the upper left point A of the rectangular frame ABCD, is the ordinate of the upper left point A of the rectangular frame ABCD, is the horizontal coordinate of the lower right point C of the rectangular frame ABCD, is the ordinate of the lower right point C of the rectangular frame ABCD, is the horizontal coordinate of the upper left point E of the rectangular frame EFGH, is the ordinate of the upper left point E of the rectangular frame EFGH, is the horizontal coordinate of the lower right point G of the rectangular frame EFGH, It is the vertical coordinate of the lower right point G of the rectangular frame EFGH.

[0099] Furthermore, for small-scale defect rectangular frames and small-scale defect types: (1) first, obtain the confidence of each small-scale defect rectangular frame, and delete the rectangular frames with a confidence lower than a second preset confidence threshold (for example, 0.30) to obtain multiple first small-scale defect rectangular frames; (2) then, use the area non-maximum suppression processing algorithm (ANMS) to calculate the variation overlap rate of each first small-scale defect rectangular frame, and delete the rectangular frames with a variation overlap rate greater than a preset variation overlap rate threshold (for example, 0.80) to obtain multiple second small-scale defect rectangular frames; (3) finally, use the second target scale deletion rule to filter each second small-scale defect rectangular frame to obtain multiple filtered third small-scale defect rectangular frames.

[0100] Among them, the second target scale deletion rule is:

[0101]

[0102] Where, Indicates whether to delete the second smallest scale defect rectangle. If it is 1, it means to delete it. If it is 0, it means not to delete it. Represents the relatively short side of the second smallest scale defect rectangle, , represents the relative network width of the target, Indicates the relative network height of the target; Indicates the preset relative short edge threshold.

[0103] The calculation formulas for the target's relative network width and target's relative network height are as follows:

[0104]

[0105] Where, Indicates the width of the target, represents the width of the detection network, Indicates the width of the image, Indicates the height of the target, represents the height of the detection network, Represents the height of the image. For large-scale defect rectangles and large-scale defect types, the detection network is a large-scale recognition model. For small-scale defect rectangles and small-scale defect types, the detection network is a small-scale recognition model.

[0106] It should be noted that the first preset confidence threshold and the second preset confidence threshold may be the same or different, and the preset overlap rate threshold and the preset variation overlap rate threshold may be the same or different, which is not limited in this embodiment.

[0107] Preferably, in the above process, the step of calculating the variation overlap rate of each first small-scale defect rectangular frame using an area non-maximum suppression processing algorithm, and deleting rectangular frames having a variation overlap rate greater than a preset variation overlap rate threshold to obtain a plurality of second small-scale defect rectangular frames includes:

[0108] Step S1, sorting the areas of the first small-scale defect rectangular frames according to a preset order;

[0109] Step S2, determining the first small-scale defect rectangular frame with the largest area as the registration rectangular frame;

[0110] Step S3, using a preset variation overlap rate calculation formula to calculate the variation overlap rate of each remaining rectangular frame with the registration rectangular frame, so that each remaining rectangular frame corresponds to a variation overlap rate, and the rectangular frames with a variation overlap rate greater than a preset variation overlap rate threshold (e.g., 0.80) are deleted, and the rectangular frames with a variation overlap rate less than or equal to the preset variation overlap rate threshold are retained;

[0111] Step S4: Repeat steps S1-S3 in the remaining rectangular frames until the variation overlap ratios between all remaining rectangular frames and the current registration rectangular frame are less than or equal to a preset variation overlap ratio threshold. The registration rectangular frames determined in each iteration are used as the final plurality of second-small-scale defect rectangular frames.

[0112] Among them, the preset mutation overlap rate calculation formula is:

[0113]

[0114] Where, is the variation overlap rate of rectangular box ABCD and rectangular box EFGH, is the intersection area of ​​rectangular box ABCD and rectangular box EFGH, is the area of ​​rectangular box ABCD, is the area of ​​the rectangular frame EFGH, is the horizontal coordinate of the upper left point A of the rectangular frame ABCD, is the ordinate of the upper left point A of the rectangular frame ABCD, is the horizontal coordinate of the lower right point C of the rectangular frame ABCD, is the ordinate of the lower right point C of the rectangular frame ABCD, is the horizontal coordinate of the upper left point E of the rectangular frame EFGH, is the ordinate of the upper left point E of the rectangular frame EFGH, is the horizontal coordinate of the lower right point G of the rectangular frame EFGH, It is the vertical coordinate of the lower right point G of the rectangular frame EFGH.

[0115] Next, each third-largest-scale defect rectangle and its corresponding large-scale defect type, and each third-smallest-scale defect rectangle and its corresponding small-scale defect type are fused to obtain a fused defect rectangle and its corresponding defect type. The fused defect rectangle is then filtered using an area non-maximum suppression algorithm to obtain a multi-scale target defect rectangle and its corresponding multi-scale target defect type.

[0116] It is understandable that the principle of filtering the fused defect rectangular frame using the area non-maximum suppression processing algorithm is consistent with the principle of obtaining multiple second small-scale defect rectangular frames (steps S1-S4) using the area non-maximum suppression processing algorithm mentioned above, and this embodiment will not be repeated here.

[0117] Finally, a multi-scale target defect recognition result was obtained, which included a multi-scale target defect rectangular frame and its corresponding multi-scale target defect type (for example, it could include foreign objects on towers, bird nests on towers, foreign objects on conductors, broken conductors, etc.).

[0118] This method employs a pre-set target scale removal rule for hierarchical filtering and fusion. This not only effectively filters out a large number of defect detection frames with low confidence and high overlap, but also effectively eliminates incomplete targets resulting from defective objects being cropped by the sliding window, thereby achieving effective and complete multi-scale target defect recognition results. Finally, the fused defect rectangles are filtered using an area non-maximum suppression algorithm, further eliminating redundant detection frames and achieving more accurate defect location results. This helps improve the accuracy and efficiency of defect recognition, providing more accurate information for subsequent defect processing.

[0119] A large-scale recognition model is used to identify large-scale defect targets, and a small-scale recognition model is used to identify small-scale defect targets, which effectively solves the problem of identifying multi-scale target defects where the large targets are very large and the small targets are very small.

[0120] Step S130: Determine whether the multi-scale target defect recognition result is empty. If so, record the multi-scale target defect list of the distribution network line inspection image as empty and save it. Otherwise, record the multi-scale target defect rectangle and its corresponding multi-scale target defect type in the multi-scale target defect list of the distribution network line inspection image and save it.

[0121] Preferably, a final determination is made as to whether the multi-scale target defect recognition result is empty. If the multi-scale target defect recognition result is empty, it indicates that the multi-scale target defect rectangle and the multi-scale target defect type were not detected. In this case, the multi-scale target defect list for the distribution network line inspection image is recorded as empty, and the corresponding record is saved. If the multi-scale target defect recognition result is not empty, it indicates that the multi-scale target defect rectangle and the multi-scale target defect type (such as foreign objects on towers, bird nests on towers, foreign objects on conductors, broken conductors, etc.) were detected. In this case, the multi-scale target defect rectangle and the multi-scale target defect type are recorded in the multi-scale target defect list for the distribution network line inspection image, and the corresponding record is saved, completing the distribution network line inspection image detection process.

[0122] Regardless of whether the multi-scale target defects are detected or not, the above method will save the corresponding records in the multi-scale target defect list of the distribution network line inspection image. This helps to achieve complete tracking and management of defects, provides an important basis for subsequent defect analysis and processing, helps to promptly discover and correct missed detections or false detections, and improves the accuracy and reliability of defect identification.

[0123] The multi-scale target defect identification method for distribution network lines provided in the embodiment of the present application is based on a deep learning algorithm, uses a large-scale recognition model to identify large targets of multi-scale target defects, and uses a small-scale recognition model to identify small targets of multi-scale target defects. By hierarchical fusion of defect scales of large and small scale targets, the work efficiency of power inspection can be greatly improved, and missed detection and false detection can be effectively prevented.

[0124] Example 2

[0125] like Figure 5 FIG. 5 is a schematic diagram of a multi-scale target defect identification device 500 for a distribution network line according to an embodiment of the present application, wherein the device includes:

[0126] Recognition module 510 is used to obtain distribution network line inspection images, input the distribution network line inspection images into a large-scale recognition model and a small-scale recognition model respectively, obtain multiple large-scale defect rectangular boxes and multiple large-scale defect types through the large-scale recognition model, and obtain multiple small-scale defect rectangular boxes and multiple small-scale defect types through the small-scale recognition model;

[0127] Fusion module 520 is used to perform hierarchical filtering and fusion of the large-scale defect rectangular boxes and the large-scale defect types, and the small-scale defect rectangular boxes and the small-scale defect types using a preset target scale deletion rule to obtain a multi-scale target defect recognition result, wherein the multi-scale target defect recognition result includes the multi-scale target defect rectangular boxes and their corresponding multi-scale target defect types;

[0128] The recording module 530 is used to determine whether the multi-scale target defect recognition result is empty. If so, the multi-scale target defect list of the distribution network line inspection image is recorded as empty and saved. Otherwise, the multi-scale target defect rectangle and its corresponding multi-scale target defect type are recorded in the multi-scale target defect list of the distribution network line inspection image and saved.

[0129] The distribution network line multi-scale target defect identification device provided in the embodiment of the present application can implement each process of the distribution network line multi-scale target defect identification method corresponding to Example 1, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0130] The multi-scale target defect identification device for distribution network lines provided in the embodiment of the present application is based on a deep learning algorithm, uses a large-scale recognition model to identify large targets of multi-scale target defects, and uses a small-scale recognition model to identify small targets of multi-scale target defects. By hierarchical fusion of defect scales of large and small scale targets, the work efficiency of power inspection can be greatly improved, and missed detection and false detection can be effectively prevented.

[0131] A computer device is also provided in an embodiment of the present disclosure. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of the distribution network line multi-scale target defect identification method described in Example 1 are implemented.

[0132] A computer-readable storage medium is also provided in an embodiment of the present disclosure. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the distribution network line multi-scale target defect identification method described in Example 1 are implemented.

[0133] The above description is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for identifying multi-scale target defects in distribution network lines, characterized in that: The method comprises: Obtaining a distribution network line inspection image, inputting the distribution network line inspection image into a large-scale recognition model and a small-scale recognition model respectively, obtaining a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types through the large-scale recognition model, and obtaining a plurality of small-scale defect rectangular frames and a plurality of small-scale defect types through the small-scale recognition model; Using a preset target scale deletion rule, each large-scale defect rectangular box and each large-scale defect type, and each small-scale defect rectangular box and each small-scale defect type are hierarchically filtered and fused to obtain a multi-scale target defect recognition result, wherein the multi-scale target defect recognition result includes a multi-scale target defect rectangular box and its corresponding multi-scale target defect type; Determine whether the multi-scale target defect recognition result is empty. If so, record the multi-scale target defect list of the distribution network line inspection image as empty and save it. If not, record the multi-scale target defect rectangular box and its corresponding multi-scale target defect type in the multi-scale target defect list of the distribution network line inspection image and save it. The method of using a preset target scale deletion rule to perform hierarchical filtering and fusion on each of the large-scale defect rectangular boxes and each of the large-scale defect types, and each of the small-scale defect rectangular boxes and each of the small-scale defect types, to obtain a multi-scale target defect recognition result, includes: Obtaining the confidence of each of the large-scale defect rectangular frames, and deleting rectangular frames whose confidence is lower than a first preset confidence threshold, to obtain a plurality of first large-scale defect rectangular frames; Calculating the overlap rate of each of the first large-scale defect rectangular frames using a non-maximum suppression processing algorithm, and deleting rectangular frames with an overlap rate greater than a preset overlap rate threshold, to obtain a plurality of second large-scale defect rectangular frames; Filtering each of the second-largest-scale defect rectangular frames using the first target scale deletion rule to obtain a plurality of third-largest-scale defect rectangular frames; Obtaining the confidence of each of the small-scale defect rectangular frames, and deleting rectangular frames whose confidence is lower than a second preset confidence threshold, to obtain a plurality of first small-scale defect rectangular frames; Calculating the variation overlap rate of each of the first small-scale defect rectangular frames using an area non-maximum suppression processing algorithm, and deleting rectangular frames whose variation overlap rate is greater than a preset variation overlap rate threshold, to obtain a plurality of second small-scale defect rectangular frames; Filtering each of the second small-scale defect rectangular frames using a second target scale deletion rule to obtain a plurality of third small-scale defect rectangular frames; The first target scale deletion rule is: Where, Indicates whether to delete the second largest scale defect rectangle. If it is 1, it means to delete it. If it is 0, it means not to delete it. represents the relative long side of the second largest scale defect rectangle, , represents the relative network width of the target, Indicates the relative network height of the target; Indicates the preset relative long edge threshold; The second target scale deletion rule is: Where, Indicates whether to delete the second small-scale defect rectangle. If it is 1, it means to delete it. If it is 0, it means not to delete it. represents the relatively short side of the second small-scale defect rectangle, , represents the relative network width of the target, Indicates the relative network height of the target; Indicates the preset relative short edge threshold; The calculation formulas for the target's relative network width and target's relative network height are as follows: Where, Indicates the width of the target, represents the width of the detection network, Indicates the width of the image, Indicates the height of the target, represents the height of the detection network, Indicates the height of the image.

2. The method for identifying multi-scale target defects in distribution network lines according to claim 1, characterized in that: The method further comprises performing hierarchical filtering and fusing the large-scale defect rectangular frames and the large-scale defect types, and the small-scale defect rectangular frames and the small-scale defect types using a preset target scale deletion rule to obtain a multi-scale target defect recognition result. Merging the third large-scale defect rectangular frames and their corresponding large-scale defect types, and the third small-scale defect rectangular frames and their corresponding small-scale defect types, to obtain fused defect rectangular frames and their corresponding defect types; The fused defect rectangular frame is filtered using the area non-maximum suppression processing algorithm to obtain the multi-scale target defect rectangular frame and its corresponding multi-scale target defect type.

3. The method for identifying multi-scale target defects in distribution network lines according to claim 1, characterized in that: The method of calculating the variation overlap rate of each of the first small-scale defect rectangular frames by using the area non-maximum suppression processing algorithm and deleting the rectangular frames whose variation overlap rate is greater than a preset variation overlap rate threshold to obtain a plurality of second small-scale defect rectangular frames includes: Step S1, sorting the areas of the first small-scale defect rectangular frames according to a preset order; Step S2, determining the first small-scale defect rectangular frame with the largest area as the registration rectangular frame; Step S3, using a preset variation overlap rate calculation formula to calculate the variation overlap rate of each remaining rectangular frame with the registration rectangular frame, and deleting the rectangular frames whose variation overlap rate is greater than the preset variation overlap rate threshold, and retaining the rectangular frames whose variation overlap rate is less than or equal to the preset variation overlap rate threshold; Step S4: repeating steps S1-S3 in the remaining rectangular frames until the variation overlap ratios between all remaining rectangular frames and the current registration rectangular frame are less than or equal to the preset variation overlap ratio threshold, and using the registration rectangular frames determined in each iteration as multiple second small-scale defect rectangular frames; The preset mutation overlap rate calculation formula is: Where, is the variation overlap rate of rectangular box ABCD and rectangular box EFGH, is the intersection area of ​​rectangular box ABCD and rectangular box EFGH, is the area of ​​rectangular box ABCD, is the area of ​​the rectangular frame EFGH, is the horizontal coordinate of the upper left point A of the rectangular frame ABCD, is the ordinate of the upper left point A of the rectangular frame ABCD, is the horizontal coordinate of the lower right point C of the rectangular frame ABCD, is the ordinate of the lower right point C of the rectangular frame ABCD, is the horizontal coordinate of the upper left point E of the rectangular frame EFGH, is the ordinate of the upper left point E of the rectangular frame EFGH, is the horizontal coordinate of the lower right point G of the rectangular frame EFGH, It is the vertical coordinate of the lower right point G of the rectangular frame EFGH.

4. The method for identifying multi-scale target defects in distribution network lines according to claim 1, characterized in that: The large-scale recognition model and the small-scale recognition model are both based on an improved YOLO11 detection algorithm. The improved YOLO11 detection algorithm includes a backbone network, a feature pyramid network, and a decoupling head. The feature pyramid network includes a first spatial attention module, a second spatial attention module, a first convolution module, a second convolution module, a first SwinTransformer module, a second SwinTransformer module, and a third SwinTransformer module. The decoupling head includes a first classification regression module, a second classification regression module, and a third classification regression module. The large-scale recognition model is used to obtain a plurality of large-scale defect rectangular boxes and a plurality of large-scale defect types. The small-scale recognition model is used to obtain a plurality of small-scale defect rectangular boxes and a plurality of small-scale defect types, including: Inputting the distribution network line inspection image into the large-scale recognition model, using the large-scale recognition model to perform target defect detection, and obtaining a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types; The distribution network line inspection image is cropped according to a preset cropping resolution through a sliding window to obtain a cropped image set, the cropped image set is input into the small-scale recognition model, the small-scale recognition model is used to perform target defect detection, and the defect rectangular frame and defect type of the cropped image set are obtained. The coordinates of the defect rectangular frame of the cropped image set are mapped back to the coordinates of the distribution network line inspection image to obtain multiple small-scale defect rectangular frames and multiple small-scale defect types.

5. The method for identifying multi-scale target defects in distribution network lines according to claim 4, characterized in that: The inputting of the distribution network line inspection image into the large-scale recognition model, using the large-scale recognition model to perform target defect detection, and obtaining a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types, includes: Inputting the distribution network line inspection image into the backbone network to obtain a first-layer feature map, a second-layer feature map, and a third-layer feature map; Inputting the third layer feature map and the second layer feature map into the first spatial attention module to obtain a first spatial attention feature map, and cascading the first spatial attention feature map and the second layer feature map to obtain a first fusion map; Inputting the first fusion map and the first layer feature map into the second spatial attention module to obtain a second spatial attention feature map, and cascading the second spatial attention feature map with the first layer feature map to obtain a second fusion map; Inputting the second fusion map into the first convolution module to obtain a first feature map, and concatenating the first feature map with the first fusion map to obtain a third fusion map; Inputting the third fusion map into the second convolution module to obtain a second feature map, and concatenating the second feature map with the third layer feature map to obtain a fourth fusion map; Inputting the second fused image into the first SwinTransformer module to obtain a first fine-grained feature map, inputting the third fused image into the second SwinTransformer module to obtain a second fine-grained feature map, and inputting the fourth fused image into the third SwinTransformer module to obtain a third fine-grained feature map; The first fine-grained feature map, the second fine-grained feature map, and the third fine-grained feature map are respectively input into the first classification regression module, the second classification regression module, and the third classification regression module to obtain a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types.

6. The method for identifying multi-scale target defects in distribution network lines according to claim 5, characterized in that: Inputting the third layer feature map and the second layer feature map into the first spatial attention module to obtain a first spatial attention feature map includes: The second layer feature map is subjected to channel maximum pooling and channel average pooling respectively to obtain a maximum value feature map and a mean feature map, respectively, and the maximum value feature map and the mean feature map are channel-joined to obtain a two-channel feature map, and the two-channel feature map is subjected to 1×1 convolution to obtain a single-channel feature map, and the single-channel feature map is subjected to an activation function to obtain a spatially weighted feature map; Performing 1×1 convolution and upsampling on the third layer feature map in sequence to obtain an upsampled feature map; Multiplying the spatial weighted feature map by the upsampled feature map to obtain the first spatial attention feature map.

7. A multi-scale target defect identification device for distribution network lines, characterized in that: The device comprises: a recognition module, configured to obtain a distribution network line inspection image, input the distribution network line inspection image into a large-scale recognition model and a small-scale recognition model respectively, obtain a plurality of large-scale defect rectangular frames and a plurality of large-scale defect types through the large-scale recognition model, and obtain a plurality of small-scale defect rectangular frames and a plurality of small-scale defect types through the small-scale recognition model; a fusion module, configured to perform hierarchical filtering and fusion of each of the large-scale defect rectangular boxes and each of the large-scale defect types, and each of the small-scale defect rectangular boxes and each of the small-scale defect types, using a preset target scale deletion rule, to obtain a multi-scale target defect recognition result, wherein the multi-scale target defect recognition result includes the multi-scale target defect rectangular boxes and their corresponding multi-scale target defect types; a recording module, configured to determine whether the multi-scale target defect recognition result is empty; if so, record the multi-scale target defect list of the distribution network line inspection image as empty and save the result; if not, record the multi-scale target defect rectangle and its corresponding multi-scale target defect type in the multi-scale target defect list of the distribution network line inspection image and save the result; The method of using a preset target scale deletion rule to perform hierarchical filtering and fusion on each of the large-scale defect rectangular boxes and each of the large-scale defect types, and each of the small-scale defect rectangular boxes and each of the small-scale defect types, to obtain a multi-scale target defect recognition result, includes: Obtaining the confidence of each of the large-scale defect rectangular frames, and deleting rectangular frames whose confidence is lower than a first preset confidence threshold, to obtain a plurality of first large-scale defect rectangular frames; Calculating the overlap rate of each of the first large-scale defect rectangular frames using a non-maximum suppression processing algorithm, and deleting rectangular frames with an overlap rate greater than a preset overlap rate threshold, to obtain a plurality of second large-scale defect rectangular frames; Filtering each of the second-largest-scale defect rectangular frames using the first target scale deletion rule to obtain a plurality of third-largest-scale defect rectangular frames; Obtaining the confidence of each of the small-scale defect rectangular frames, and deleting rectangular frames whose confidence is lower than a second preset confidence threshold, to obtain a plurality of first small-scale defect rectangular frames; Calculating the variation overlap rate of each of the first small-scale defect rectangular frames using an area non-maximum suppression processing algorithm, and deleting rectangular frames whose variation overlap rate is greater than a preset variation overlap rate threshold, to obtain a plurality of second small-scale defect rectangular frames; Filtering each of the second small-scale defect rectangular frames using a second target scale deletion rule to obtain a plurality of third small-scale defect rectangular frames; The first target scale deletion rule is: Where, Indicates whether to delete the second largest scale defect rectangle. If it is 1, it means to delete it. If it is 0, it means not to delete it. represents the relative long side of the second largest scale defect rectangle, , represents the relative network width of the target, Indicates the relative network height of the target; Indicates the preset relative long edge threshold; The second target scale deletion rule is: Where, Indicates whether to delete the second small-scale defect rectangle. If it is 1, it means to delete it. If it is 0, it means not to delete it. represents the relatively short side of the second small-scale defect rectangle, , represents the relative network width of the target, Indicates the relative network height of the target; Indicates the preset relative short edge threshold; The calculation formulas for the target's relative network width and target's relative network height are as follows: Where, Indicates the width of the target, represents the width of the detection network, Indicates the width of the image, Indicates the height of the target, represents the height of the detection network, Indicates the height of the image.

8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the distribution network line multi-scale target defect identification method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the distribution network line multi-scale target defect identification method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Infrared small target detection model establishment method and detection method based on multi-scale attention feature superposition

    CN118968012A

  • Distribution network tower risk assessment method, device and equipment and storage medium

    CN119624142A