A power transmission line fastener defect detection method based on image processing
By improving the target detection model and combining the text enhancement module and multi-scale balanced pyramid convolution, the problem of low detection accuracy of power transmission line fasteners is solved, and high-precision detection is achieved in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN UNIV
- Filing Date
- 2022-12-13
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies based on deep learning for detecting defects in power transmission line fasteners suffer from low accuracy, especially in complex environments where background, lighting, and environmental factors have a significant impact. Furthermore, the small size of the fastener targets contributes to the low detection accuracy.
An improved target detection model is adopted, including a backbone network, an improved feature pyramid network, and a detection head. Combined with a text enhancement module and multi-scale balanced pyramid convolution, the model training process is optimized through data augmentation and adaptive training sample selection strategies to improve detection accuracy.
It significantly improves the accuracy of defect detection in transmission line fasteners under complex environments, provides efficient and accurate detection results, and offers technical support to maintenance personnel.
Smart Images

Figure CN117333425B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power transmission line inspection technology, and in particular to a method for detecting defects in power transmission line fasteners based on image processing. Background Technology
[0002] Transmission lines are the carriers of electrical energy in the power system, and their normal condition is a prerequisite for ensuring the normal operation of people's lives and social production. Fasteners are an indispensable part of transmission lines, playing a role in positioning, connecting, and reinforcing multiple components. However, since most transmission lines are distributed in complex environments such as mountains, forests, and rivers, they may face severe weather such as blizzards, rain, snow, and intense sunlight. Furthermore, with the increase in their service life, fasteners may corrode, wear, fall off, or even be lost. These situations can seriously threaten power supply safety and disrupt people's lives. Therefore, staff need to regularly inspect the fasteners in transmission lines and promptly repair faulty components to ensure the normal supply of electricity.
[0003] Generally, there are three methods for detecting defects in power transmission line fasteners: manual inspection, helicopter inspection, and drone inspection. Manual inspection has drawbacks such as high subjectivity, low efficiency, and low safety. Helicopter inspection has drawbacks such as high cost and low accuracy. However, using drones in conjunction with deep learning can achieve high-precision and high-efficiency defect detection in power transmission line fasteners.
[0004] Currently, deep learning-based defect detection of power transmission line fasteners has made some progress, but some challenges still exist:
[0005] (1) The fastener target size is small. As the depth of the neural network increases, each downsampling step will cause the target object to become blurred or even lost.
[0006] (2) Transmission lines are built in complex environments, and factors such as background, lighting and environment seriously affect the accuracy of fastener defect detection. Summary of the Invention
[0007] This invention provides a method for detecting defects in power transmission line fasteners based on image processing, in order to solve the technical problem of low accuracy in the detection of power transmission line fastener defects based on deep learning in the prior art.
[0008] To achieve the above objectives, the technical solution of the present invention is implemented as follows:
[0009] This invention provides a method for detecting defects in power transmission line fasteners based on image processing, comprising the following steps:
[0010] Step S1: Collect multiple images of power transmission line fasteners and use these images to construct a power transmission line fastener dataset.
[0011] Step S2: Label the power transmission line fastener dataset to obtain the labeled power transmission line fastener dataset; and divide the labeled power transmission line fastener dataset into training set, validation set and test set according to the specified ratio;
[0012] Step S3: Build an improved target detection model;
[0013] Step S4: Train the improved target detection model using the training set to obtain the trained target detection model, and then validate it using the validation set.
[0014] Step S5: Test the trained object detection model using the test set.
[0015] Furthermore, step S1 specifically includes the following steps:
[0016] Step S11: Use an image acquisition device to acquire multiple images of power transmission line fasteners;
[0017] Step S12: Perform data augmentation on multiple images of transmission line fasteners to obtain multiple data-enhanced images of transmission line fasteners;
[0018] Step S13: Construct a power transmission line fastener dataset using multiple data-enhanced images of power transmission line fasteners.
[0019] Furthermore, step S2 specifically includes the following steps:
[0020] Step S21: Use an image annotation tool to annotate the power transmission line fastener dataset to obtain the true label for each power transmission line fastener image. The true label includes the fastener defect category and location.
[0021] Step S22: Divide the labeled power transmission line fastener dataset into training set, validation set and test set according to the specified ratio.
[0022] Furthermore, the improved target detection model in step S3 includes a backbone network, an improved feature pyramid network, and an improved detection head connected in sequence.
[0023] Furthermore, the backbone network includes a first processing unit, a second processing unit, a third processing unit, a fourth processing unit, and a fifth processing unit connected in sequence;
[0024] The first processing unit includes a first convolutional layer, a first normalization layer, a first activation layer, and a first pooling layer connected in sequence;
[0025] The second, third, fourth, and fifth processing units are all multiple stacks of the first and second sub-modules. The first sub-module includes a first branch and a second branch. The first branch includes a third stack of a second convolutional layer, a second normalization layer, and a second activation layer. The second branch includes a third convolutional layer, a third normalization layer, a third pooling layer, and a third activation layer connected in sequence. The second sub-module includes a third branch and a fourth branch. The third branch includes a third stack of a fourth convolutional layer, a fourth normalization layer, and a fourth activation layer. The fourth branch outputs directly without any operation.
[0026] The outputs of the third, fourth, and fifth processing units are all connected to the improved feature pyramid network.
[0027] Furthermore, the improved feature pyramid network includes a fifth convolutional layer, a sixth convolutional layer, and a text enhancement module;
[0028] The fifth and sixth convolutional layers are connected to the outputs of the third and fourth processing units, respectively.
[0029] The text enhancement module includes a fifth branch, a sixth branch, a second splicing layer, and a ninth convolutional layer; both the fifth and sixth branches are connected to the output of the fifth processing unit, and the outputs of the fifth and sixth branches are connected to the ninth convolutional layer through the second splicing layer.
[0030] The fifth branch includes a seventh convolutional layer, a dilated convolutional layer, and a first splicing layer. The input of the seventh convolutional layer is connected to the output of the fifth processing unit. The dilated convolutional layer has two output branches. The output of the seventh convolutional layer is connected to the first splicing layer through one of the output branches of the dilated convolutional layer. The output of the first splicing layer is connected to the seventh convolutional layer. The other output branch of the dilated convolutional layer is connected to the second splicing layer.
[0031] The sixth branch consists of a global average pooling layer, an eighth convolutional layer, and a linear interpolation layer connected in sequence.
[0032] Furthermore, the improved detection head includes a multi-scale balanced pyramid convolution, a classification detection head, and a regression detection head;
[0033] The output of the multi-scale balanced pyramid convolution is connected to the output of the improved feature pyramid network, and the output of the multi-scale balanced pyramid convolution is connected to the classification detection head and the regression detection head respectively.
[0034] Furthermore, step S4 specifically includes the following steps:
[0035] Step S41: Preprocess the training set to obtain the preprocessed training set;
[0036] Step S42: Set the pre-training weight parameters for the improved target detection model to obtain the target detection model after parameter setting;
[0037] Step S43: Input the preprocessed training set into the improved object detection model to obtain multiple prior boxes, the classification scores of the prior boxes, and their localization coordinates;
[0038] Step S44: Assign positive and negative samples to multiple prior boxes;
[0039] Step S45: Based on the positive samples, the classification scores of multiple prior boxes, and the localization coordinates, establish the Focal Loss classification loss function and the Smooth L1 regression loss function, minimize the Focal Loss classification loss function and the Smooth L1 regression loss function, optimize the parameters of the object detection model using the backpropagation method, and input the validation set into the trained object detection model for validation.
[0040] Step S46: Repeat steps S43 to S45 until the loss is less than the set value, and obtain the trained object detection model.
[0041] Furthermore, step S44 specifically includes the following steps:
[0042] Step S441: Calculate the intersection-union ratio of all prior boxes and the ground truth labels, and the distance between the center of all prior boxes and the center of the ground truth labels;
[0043] Step S442: Select the k nearest prior boxes and query the intersection-union ratio of these k prior boxes;
[0044] Step S443: Calculate the mean and variance of the crossover ratio (CUR) of these k prior boxes. If the CUR is less than or equal to the sum of the mean and variance, it is determined to be a negative sample; if the CUR is greater than the sum of the mean and variance, it is determined to be a candidate positive sample and proceeds to step S444.
[0045] Step S444: If the center of the prior box is not within the true label, it is determined to be a negative sample; if the center of the prior box is within the true label, it is determined to be a true positive sample.
[0046] Furthermore, step S5 specifically includes the following steps:
[0047] Step S51: Preprocess the test set to obtain the preprocessed test set;
[0048] Step S52: Input the preprocessed test set into the trained object detection model to obtain multiple prior boxes, and use the classification detection head and regression detection head to predict the classification score and localization coordinates of the multiple prior boxes respectively.
[0049] Step S53: Set a classification score threshold, remove prior boxes with low classification scores based on the classification score threshold, and use the non-maximum suppression algorithm to remove redundant prior boxes.
[0050] Step S54: Display the retained prior bounding boxes in the original image and label the defect categories and their scores.
[0051] The beneficial effects of this invention are:
[0052] To address the challenges of small target size, complex environmental background, large differences in aerial light contrast, and diverse angles associated with power transmission line fasteners, this invention alleviates these issues by introducing a text enhancement module and multi-scale balanced pyramid convolution, thereby improving the accuracy of power transmission line fastener defect detection and providing technical reference for maintenance personnel to carry out power transmission line fastener defect detection work. Attached Figure Description
[0053] Figure 1 This is a flowchart of the present invention;
[0054] Figure 2 Here is a structural diagram of the text enhancement module;
[0055] Figure 3 A diagram of a multi-scale balanced pyramid convolutional structure;
[0056] Figure 4 Flowchart for selecting a strategy for adaptive training samples;
[0057] Figure 5 A structural diagram of the improved target detection model;
[0058] Figure 6 This is a diagram showing the detection results on a portion of the test set in an example of the present invention. Detailed Implementation
[0059] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0060] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium, or they can refer to the internal connection of two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0061] Furthermore, the terms "first," "second," etc., used in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number or order of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0062] Reference Figure 1 This application provides a method for detecting defects in power transmission line fasteners based on image processing, comprising the following steps:
[0063] Step S1: Collect multiple images of power transmission line fasteners and use these images to construct a power transmission line fastener dataset.
[0064] In this embodiment, step S1 specifically includes the following steps:
[0065] Step S11: Use an image acquisition device to acquire multiple images of power transmission line fasteners; the image acquisition device can be a drone or other equipment.
[0066] Step S12: Perform data augmentation on multiple images of transmission line fasteners to obtain multiple data-enhanced images of transmission line fasteners;
[0067] Specifically, data augmentation was performed on the image data of power transmission line fasteners collected by drones. This included operations such as image flipping, cropping, and contrast adjustment. The data augmented dataset consisted of 9,027 images, divided into 5 categories: pins in good condition, pins missing, pins detached, nuts missing, and both pins and nuts missing. The number of instances included were 9,052, 6,029, 1,271, 1,121, and 347, respectively.
[0068] Step S13: Construct a power transmission line fastener dataset using multiple data-enhanced images of power transmission line fasteners.
[0069] Step S2: Label the power transmission line fastener dataset to obtain the labeled power transmission line fastener dataset; and divide the labeled power transmission line fastener dataset into training set, validation set and test set according to the specified ratio;
[0070] In this embodiment, step S2 specifically includes the following steps:
[0071] Step S21: Use an image annotation tool to annotate the power transmission line fastener dataset to obtain the true label for each power transmission line fastener image. The true label includes the fastener defect category and location.
[0072] Specifically, the Labelme image annotation tool was used to manually annotate the power transmission line fastener dataset. The main annotation content was the fastener defect category and location, generating a total of 9027 annotation files.
[0073] Step S22: Divide the labeled power transmission line fastener dataset into training set, validation set and test set according to the specified ratio.
[0074] Specifically, the labeled power transmission line fastener dataset was divided according to the principle of 18:1:1, namely 8146 training images, 429 validation images, and 452 test images.
[0075] Step S3: Build an improved target detection model;
[0076] Specifically, when constructing the improved object detection model, the backbone network of the original Retina Net model is first retained, and then a text enhancement module is introduced into the feature pyramid network. In the classification and regression branches, multi-scale balanced pyramid convolutions are used to replace the original convolutions. The last two convolutional layers of the classification and regression branches of the original Retina Net model are retained. Finally, when calculating the loss, an adaptive training sample selection strategy is used to replace the original positive and negative sample allocation strategy.
[0077] Reference Figure 5 In this embodiment, the improved target detection model in step S3 includes a backbone network, an improved feature pyramid network, and an improved detection head connected in sequence.
[0078] In this embodiment, the backbone network includes a first processing unit, a second processing unit, a third processing unit, a fourth processing unit, and a fifth processing unit connected in sequence.
[0079] The first processing unit includes a first convolutional layer, a first normalization layer, a first activation layer, and a first pooling layer connected in sequence;
[0080] The second, third, fourth, and fifth processing units are all multiple stacks of the first and second sub-modules. The first sub-module includes a first branch and a second branch. The first branch includes a third stack of a second convolutional layer, a second normalization layer, and a second activation layer. The second branch includes a third convolutional layer, a third normalization layer, a third pooling layer, and a third activation layer connected in sequence. The second sub-module includes a third branch and a fourth branch. The third branch includes a third stack of a fourth convolutional layer, a fourth normalization layer, and a fourth activation layer. The fourth branch outputs directly without any operation.
[0081] The outputs of the third, fourth, and fifth processing units are all connected to the improved feature pyramid network.
[0082] Reference Figure 5 In this embodiment, the improved feature pyramid network includes a fifth convolutional layer, a sixth convolutional layer, and a text enhancement module;
[0083] The fifth and sixth convolutional layers are connected to the outputs of the third and fourth processing units, respectively.
[0084] Reference Figure 2 and Figure 5 The text enhancement module includes a fifth branch, a sixth branch, a second splicing layer, and a ninth convolutional layer; both the fifth and sixth branches are connected to the output of the fifth processing unit, and the outputs of the fifth and sixth branches are connected to the ninth convolutional layer through the second splicing layer.
[0085] The fifth branch includes a seventh convolutional layer, a dilated convolutional layer, and a first concatenation layer. The input of the seventh convolutional layer is connected to the output of the fifth processing unit. The dilated convolutional layer has two output branches. The output of the seventh convolutional layer is connected to the first concatenation layer through one of the output branches of the dilated convolutional layer. The output of the first concatenation layer is connected to the seventh convolutional layer. The other output branch of the dilated convolutional layer is connected to the second concatenation layer. Each operation uses a different dilation rate to generate a feature map, and then uses this feature map as the input for the next operation. This branch loops multiple times and generates multiple feature maps.
[0086] The sixth branch consists of a globally average pooling layer, an eighth convolutional layer, and a linear interpolation layer connected in sequence; the sixth branch generates only one feature map.
[0087] The second concatenation layer concatenates all feature maps from the fifth and sixth branches. The outputs of the fifth and sixth branches are then connected to the ninth convolutional layer via this second concatenation layer. This connection is used to generate features through the ninth convolutional layer after the concatenation is complete. Figure 5 , will feature Figure 5 Feature fusion is performed by connecting the feature maps of the third and fourth processing units from top to bottom and laterally to generate features. Figure 3 ,feature Figure 4 and features Figure 5 Perform bottom-up operations to generate features Figure 6 Feature diagram 7;
[0088] In this embodiment, the improved detection head includes a multi-scale balanced pyramid convolution, a classification detection head, and a regression detection head;
[0089] The output of the multi-scale balanced pyramid convolution is connected to the output of the improved feature pyramid network, and the output of the multi-scale balanced pyramid convolution is connected to the classification detection head and the regression detection head respectively.
[0090] Specifically, Figure 3This is a structural diagram of the multi-scale balanced pyramid convolution model used in this invention, which includes features. Figure 3 ,feature Figure 4 ,feature Figure 5 ,feature Figure 6 Feature map 7 is used as input. The three adjacent feature maps are treated as a whole. A convolution with a stride of 2 is performed on the lower-level feature map, a convolution is performed on the middle-level feature map, and the higher-level feature map is first upsampled and then convolved. The three are added together, and the result is used as the new intermediate feature map. The formula is expressed as follows:
[0091] y = w L-1 P L-1 +w L P L +w L+1 P L+1
[0092] Where w represents the convolution kernel, P represents the feature layer, and L represents the level; W L-1 P represents the convolution kernel at level L-1; L-1 W represents the feature layer at level L-1; L P represents the convolution kernel at level L; L W represents the feature layer at level L; L+1 P represents the convolution kernel at level L+1; L+1 This represents the feature layer at level L+1. Repeat the above steps multiple times to obtain feature maps a, b, c, d, and e after multi-scale fusion, while retaining the last two convolutional layers of the original Retina Net model's classification and regression branches.
[0093] Step S4: Train the improved target detection model using the training set to obtain the trained target detection model;
[0094] In this embodiment, step S4 specifically includes the following steps:
[0095] Step S41: Preprocess the training set by scaling the size of each transmission line fastener image in the training set to 600×600 to obtain the preprocessed training set.
[0096] Step S42: Set the pre-training weight parameters for the improved target detection model to obtain the target detection model after parameter setting;
[0097] Specifically, during initial training, the improved object detection model was set with an initial learning rate of 0.0001, a learning rate descent strategy of cosine descent, an optimizer of Adam, an optimizer parameter of 0.9, and a batch size of 4.
[0098] Step S43: Input the preprocessed training set into the improved object detection model to obtain multiple prior boxes, the classification scores of the prior boxes, and their localization coordinates;
[0099] Step S44: Assign positive and negative samples to multiple prior boxes;
[0100] Reference Figure 4 In this embodiment, step S44 specifically includes the following steps:
[0101] Step S441: Calculate the intersection-union ratio of all prior boxes and the ground truth labels, and the distance between the center of all prior boxes and the center of the ground truth labels;
[0102] Step S442: Select the k nearest prior boxes and query the intersection-union ratio of these k prior boxes;
[0103] Step S443: Calculate the mean and variance of the crossover ratio (CUR) of these k prior boxes. If the CUR is less than or equal to the sum of the mean and variance, it is determined to be a negative sample; if the CUR is greater than the sum of the mean and variance, it is determined to be a candidate positive sample and proceeds to step S444.
[0104] Step S444: If the center of the prior box is not within the true label, it is determined to be a negative sample; if the center of the prior box is within the true label, it is determined to be a positive sample.
[0105] Step S45: Based on the positive samples, the classification scores of multiple prior boxes, and the localization coordinates, establish the Focal Loss classification loss function and the Smooth L1 regression loss function, minimize the Focal Loss classification loss function and the Smooth L1 regression loss function, optimize the parameters of the object detection model using the backpropagation method, and input the validation set into the trained object detection model for validation.
[0106] Step S46: Repeat steps S43 to S45 until the loss is less than the set value, and obtain the trained object detection model.
[0107] Step S5: Test the trained object detection model using the test set.
[0108] In this embodiment, step S5 specifically includes the following steps:
[0109] Step S51: Preprocess the test set to obtain the preprocessed test set;
[0110] Step S52: Input the preprocessed test set into the trained object detection model to obtain multiple prior boxes, and use the classification detection head and regression detection head to predict the classification score and localization coordinates of the multiple prior boxes respectively.
[0111] Step S53: Set a classification score threshold, remove prior boxes with low classification scores based on the classification score threshold, and use the non-maximum suppression algorithm to remove redundant prior boxes.
[0112] Step S54: Display the retained prior bounding boxes in the original image and label the defect categories and their scores, where the scores refer to probabilities.
[0113] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting defects in power transmission line fasteners based on image processing, characterized in that: It includes the following steps: Step S1: Collect multiple images of power transmission line fasteners and use these images to construct a power transmission line fastener dataset. Step S2: Label the power transmission line fastener dataset to obtain the labeled power transmission line fastener dataset; and divide the labeled power transmission line fastener dataset into training set, validation set and test set according to the specified ratio; Step S3: Build an improved target detection model; Step S4: Train the improved target detection model using the training set to obtain the trained target detection model, and then validate it using the validation set. Step S5: Test the trained object detection model using the test set; The improved target detection model in step S3 includes a backbone network, an improved feature pyramid network, and an improved detection head connected in sequence. The improved feature pyramid network includes a fifth convolutional layer, a sixth convolutional layer, and a text enhancement module; The fifth and sixth convolutional layers are connected to the outputs of the third and fourth processing units, respectively. The text enhancement module includes a fifth branch, a sixth branch, a second splicing layer, and a ninth convolutional layer; both the fifth and sixth branches are connected to the output of the fifth processing unit, and the outputs of the fifth and sixth branches are connected to the ninth convolutional layer through the second splicing layer. The fifth branch includes a seventh convolutional layer, a dilated convolutional layer, and a first splicing layer. The input of the seventh convolutional layer is connected to the output of the fifth processing unit. The dilated convolutional layer has two output branches. The output of the seventh convolutional layer is connected to the first splicing layer through one of the output branches of the dilated convolutional layer. The output of the first splicing layer is connected to the seventh convolutional layer. The other output branch of the dilated convolutional layer is connected to the second splicing layer. The sixth branch consists of a global average pooling layer, an eighth convolutional layer, and a linear interpolation layer connected in sequence; The improved detection head includes a multi-scale balanced pyramid convolution, a classification detection head, and a regression detection head; The output of the multi-scale balanced pyramid convolution is connected to the output of the improved feature pyramid network, and the output of the multi-scale balanced pyramid convolution is connected to the classification detection head and the regression detection head respectively.
2. The method for detecting defects in transmission line fasteners according to claim 1, characterized in that, Step S1 specifically includes the following steps: Step S11: Use an image acquisition device to acquire multiple images of power transmission line fasteners; Step S12: Perform data augmentation on multiple images of transmission line fasteners to obtain multiple data-enhanced images of transmission line fasteners; Step S13: Construct a power transmission line fastener dataset using multiple data-enhanced images of power transmission line fasteners.
3. The method for detecting defects in transmission line fasteners according to claim 1 or 2, characterized in that, Step S2 specifically includes the following steps: Step S21: Use an image annotation tool to annotate the power transmission line fastener dataset to obtain the true label for each power transmission line fastener image. The true label includes the fastener defect category and location. Step S22: Divide the labeled power transmission line fastener dataset into training set, validation set and test set according to the specified ratio.
4. The method for detecting defects in transmission line fasteners according to claim 1, characterized in that, The backbone network includes a first processing unit, a second processing unit, a third processing unit, a fourth processing unit, and a fifth processing unit connected in sequence. The first processing unit includes a first convolutional layer, a first normalization layer, a first activation layer, and a first pooling layer connected in sequence; The second, third, fourth, and fifth processing units are all multiple stacks of the first and second sub-modules. The first sub-module includes a first branch and a second branch. The first branch includes a third stack of a second convolutional layer, a second normalization layer, and a second activation layer. The second branch includes a third convolutional layer, a third normalization layer, a third pooling layer, and a third activation layer connected in sequence. The second sub-module includes a third branch and a fourth branch. The third branch includes a third stack of a fourth convolutional layer, a fourth normalization layer, and a fourth activation layer. The fourth branch outputs directly without any operation. The outputs of the third, fourth, and fifth processing units are all connected to the improved feature pyramid network.
5. The method for detecting defects in transmission line fasteners according to claim 4, characterized in that, Step S4 specifically includes the following steps: Step S41: Preprocess the training set to obtain the preprocessed training set; Step S42: Set the pre-training weight parameters for the improved target detection model to obtain the target detection model after parameter setting; Step S43: Input the preprocessed training set into the improved object detection model to obtain multiple prior boxes, the classification scores of the prior boxes, and their localization coordinates; Step S44: Assign positive and negative samples to multiple prior boxes; Step S45: Based on the positive samples, the classification scores of multiple prior boxes, and the localization coordinates, establish the Focal Loss classification loss function and the Smooth L1 regression loss function, minimize the Focal Loss classification loss function and the Smooth L1 regression loss function, optimize the parameters of the object detection model using the backpropagation method, and input the validation set into the trained object detection model for validation. Step S46: Repeat steps S43 to S45 until the loss is less than the set value, and obtain the trained object detection model.
6. The method for detecting defects in transmission line fasteners according to claim 5, characterized in that, Step S44 specifically includes the following steps: Step S441: Calculate the intersection-union ratio of all prior boxes and the ground truth labels, and the distance between the center of all prior boxes and the center of the ground truth labels; Step S442: Select the k nearest prior boxes and query the intersection-union ratio of these k prior boxes; Step S443: Calculate the mean and variance of the crossover ratio (CUR) of these k prior boxes. If the CUR is less than or equal to the sum of the mean and variance, it is determined to be a negative sample; if the CUR is greater than the sum of the mean and variance, it is determined to be a candidate positive sample and proceeds to step S444. Step S444: If the center of the prior box is not within the true label, it is determined to be a negative sample; if the center of the prior box is within the true label, it is determined to be a positive sample.
7. The method for detecting defects in transmission line fasteners according to claim 5 or 6, characterized in that, Step S5 specifically includes the following steps: Step S51: Preprocess the test set to obtain the preprocessed test set; Step S52: Input the preprocessed test set into the trained object detection model to obtain multiple prior boxes, and use the classification detection head and regression detection head to predict the classification score and localization coordinates of the multiple prior boxes respectively. Step S53: Set a classification score threshold, remove prior boxes with low classification scores based on the classification score threshold, and use the non-maximum suppression algorithm to remove redundant prior boxes. Step S54: Display the retained prior bounding boxes in the original image and label the defect categories and their scores.