Lightweight multi-scale insulator defect detection method based on RML-YOLOv8

By introducing RFCAConv and multi-scale aggregation network into the YOLOv8 model, combined with the LPSP detection head, the problem of insufficient feature extraction and information fusion in insulator defect detection is solved, and efficient and accurate insulator defect detection is achieved.

CN119131628APending Publication Date: 2024-12-13GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411195291.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing insulator defect detection methods are inefficient and susceptible to human factors, and the YOLOv8 model has shortcomings in feature extraction and information fusion, resulting in low detection accuracy.

Method used

Using a lightweight multi-scale insulator defect detection method based on YOLOv8 model, different receptive field features are extracted through RFCAConv combined with CA attention mechanism, and a multi-scale aggregation network is used to make up for the insufficient FPN information fusion, and an LPSP detection head is introduced into the detection head for sharing Parameters, reduce model size and calculation amount.

Benefits of technology

It improves the accuracy and efficiency of insulator defect detection, effectively extracts characteristics of different positions, enhances the processing capacity of multi-scale targets, reduces the amount of model parameters and calculations, and improves the detection ability of different scale targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131628A_ABST
    Figure CN119131628A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight multi-scale insulator defect detection method based on RML-YOLOv8. The method comprises the following steps: collecting an insulator and a defect data set; data enhancement and division; an RML-YOLOv8 model is constructed; an RML-YOLOv8 model is trained; and predicting a result. The method comprises the following steps: constructing an RML-YOLOv8 model, specifically, modifying a standard convolution Conv of each feature layer in a backbone network in YOLOv8 into an RFCACConv combined with a CA attention mechanism, and obtaining a feature map through RFA as receptive field spatial features which are not overlapped after shape adjustment; in a Neck layer of the YOLOv8, a multi-scale feature fusion pyramid network MSFFPN is used to make up for the defects of insufficient multi-scale target processing capability and insufficient information fusion of the FPN in the original YOLOv8 network; and an LPSP detection head is used on the Head layer of the YOLOv8. According to the detection method, a direction is provided for insulator detection, and the detection precision of the model is improved while the model is lightened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision and image detection, and relates to an insulator defect detection method, specifically a lightweight multi-scale insulator defect detection method based on RML-YOLOv8. Background Art

[0002] Insulators play an important role in insulation and support in power systems. Defect detection of insulators is a key link in ensuring the safe and stable operation of power systems.

[0003] Common defects of insulators include: cracks, breakage, dirtiness, aging, etc. These defects may cause the insulation performance of insulators to deteriorate and increase the risk of power system failure.

[0004] At present, there are many methods for insulator defect detection:

[0005] Manual inspection: The condition of the insulator is judged by visual observation and experience, but this method is inefficient and easily affected by human factors. For example, in some complex environments, it may be difficult for humans to accurately detect tiny cracks.

[0006] Drone inspection: Use drones equipped with high-definition cameras or other inspection equipment to take close-up photos and inspect insulators. For example, in areas with complex terrain such as mountainous areas, drones can easily reach locations that are difficult to reach manually.

[0007] Online monitoring system: The sensors installed on the insulators monitor the operating parameters of the insulators in real time. Abnormal changes in parameters such as temperature and humidity may indicate defects in the insulators.

[0008] Drone technology combined with existing communication technology can achieve automatic cruising. Compared with manual and helicopter inspection solutions, drone inspection has the advantages of low maintenance cost and high inspection efficiency. When drones inspect, they take a large number of photos, and then use detection software to identify whether there are targets that need to be detected in the photos.

[0009] With the popularization of deep learning technology and target detection technology, the intelligent inspection method of using drones to take aerial photos and then using target detection technology to detect them has become a research hotspot in order to improve the accuracy and efficiency of detection and ensure the reliable operation of the power system. Summary of the invention

[0010] The purpose of the present invention is to provide a lightweight multi-scale insulator defect detection method based on an improved YOLOv8 model. Aiming at the problem of insufficient feature extraction capability of standard convolution due to the use of shared parameter convolution kernels, RFCAConv that summarizes features of different receptive fields is used. The convolution adds the extraction of features of different receptive fields on the basis of combining CA attention mechanism, so that the model can effectively extract features at different positions; in view of the problem that FPN is not sufficiently integrated in information fusion, a multi-scale aggregation network is proposed; in view of the large number of parameters and unbalanced samples in each layer caused by the use of independent detection heads at different feature levels of YOLOv8, a lightweight multi-scale shared parameter detection head LPSP is proposed. The improved model name is RML-YOLOv8, which improves the detection accuracy while reducing the model size and calculating the number of parameters.

[0011] The technical solution for achieving the purpose of the present invention is:

[0012] A lightweight multi-scale insulator defect detection method based on RML-YOLOv8, comprising the following steps:

[0013] 1) Insulator defect data collection:

[0014] Use drones to inspect and take photos of the power line insulators that need to be inspected to obtain an insulator image dataset. Then use image annotation tools to annotate the insulators and insulator defect locations in the dataset to obtain the original dataset.

[0015] 2) Dataset enhancement and division:

[0016] The original data set marked in step 1) is randomly rotated, randomized in brightness, and natural environmental factors are added for data enhancement. The data set after data enhancement is divided into a training set and a test set in a ratio of 8:2;

[0017] 3) Build the RML-YOLOv8 model:

[0018] Combine RFCAConv convolution, pyramid network MSFFPN and LPSP detection head into the original YOLOv8 model to build the RML-YOLOv8 model;

[0019] 4) Train the RML-YOLOv8 model:

[0020] Input the training set images in step 2) into the RML-YOLOv8 model, train the model, and save the optimal training results as a weight file after training;

[0021] 5) Result prediction:

[0022] Input the test set images in step 2) into the RML-YOLOv8 model, and call the optimal weight file in step 4) to predict the results. The Anchor-free mechanism is used to mark potential targets during prediction. Finally, the results of multiple prediction boxes are screened through NMS, and the one with the highest score is retained as the prediction box. The prediction box is the location of the insulator and the defective insulator.

[0023] Furthermore, in the insulator defect data collection in step 1), the resolution of the drone camera is not less than 8000x6000 pixels, and the data set is labeled using Labelme, with normal insulators labeled as Normal insulators and defective insulators labeled as Faulty insulators.

[0024] Furthermore, step 3) constructs the RML-YOLOv8 model, specifically:

[0025] The standard convolution Conv of each feature layer in the backbone network of YOLOv8 is modified to RFCAConv combined with the CA attention mechanism. The feature map obtained by RFA is the non-overlapping receptive field spatial feature after "adjusting the shape";

[0026] In the Neck layer of YOLOv8, the multi-scale feature fusion pyramid network MSFFPN is used to make up for the shortcomings of the original YOLOv8 network FPN in terms of insufficient processing capability for multi-scale targets and insufficient information fusion;

[0027] In the Head layer of YOLOv8, the LPSP detection head is used.

[0028] Further, in step 4), the RML-YOLOv8 model is trained, and the training set images obtained in step 2) are input into RML-YOLOv8. The training set is learned for epochs in RML-YOLOv8. When there is no better result after learning the set epoch round or nearly 50 epochs, the training is stopped, and the weight of the best training result and the training weight of the last round are saved in the specified folder;

[0029] The training steps include:

[0030] 4.1) The training set images are input into the RML-YOLOv8 model. RFCAConv is obtained by multiplying a convolution kernel with attention information and the processed feature map. AvgPool is first used to aggregate the global information of each receptive field feature.

[0031] Then, a 1×1 group convolution operation is used for information interaction, and a softmax operation is used to emphasize the importance of each feature in the receptive field feature. A convolution kernel with an attention mechanism is obtained. The feature map part first uses a k×k group convolution and then uses Norm, i.e. batch normalization.

[0032] Finally, ReLU is used for activation to obtain a new feature map, which is multiplied by the convolution kernel with attention mechanism. The formula is as follows:

[0033] F = Softmax(g 1×1 (AvgPool(X)))×ReLU(Norm(g k×k (X)));

[0034] In the formula, AvgPool represents the average pooling operation, Softmax represents the Softmax normalization operation, and g i×i represents a grouped convolution of size i×i, k represents the size of the convolution kernel, Norm represents normalization, ReLU represents the use of the ReLU activation function, and X represents the input feature map;

[0035] 4.2) After the feature map extracted in step 4.1) is processed by the C2f module, the features of each level will be input into the Neck part for processing. When input into the MSFFPN network, the specific steps of processing are as follows;

[0036] 4.2.1) The MSFFPN network first splits the input large, medium and small features, setting the large-size feature map size to 2H, 2W, the medium-size feature map size to H, W, and the small-size feature map size to H / 2, W / 2;

[0037] The large-size feature map is processed by a downsampling module, which first performs an AvgPool operation, and then uses the Split operation to divide the feature map into two parts by channel. One part performs the MaxPool2d operation and the convolution operation, and the other part only performs the convolution operation. After the operation, the size of the two parts of the feature map is reduced by half to become a feature map of size H and W. Finally, the two parts are spliced. This not only reduces the spatial size, but also performs effective feature fusion on the channel, reducing the amount of calculation while ensuring the diversity of feature extraction. The process is expressed by the formula:

[0038] [X1,X2]=Split(AvgPool(Fl),C / 2);

[0039] Fl=Concat(Conv(X1),Conv(MaxPool2d(X2));

[0040] In the formula, Fl Represents the large-scale features of the input, AvgPool represents the average pooling operation, MaxPool2d represents the maximum pooling operation, Conv represents the standard convolution operation, Concat represents the connection of features, C represents the number of channels, and Split represents the division of features into two according to the number of channels;

[0041] 4.2.2) For small-scale features, an Upsample operation is first used to convert the feature map of size H / 2, W / 2 into a feature map of size H, W. This operation can enrich the low-level detail information on the feature map and help improve the model's ability to capture fine features. Subsequently, a standard convolution operation is used to reduce the number of channels to 1 / 4 of the original number.

[0042] 4.2.3) Finally, after downsampling and upsampling the large-scale and small-scale features respectively, the three feature maps will be adjusted to the same size, that is, the medium size, and the feature maps of the three scales will be fused. The process is expressed by the formula:

[0043] Xsf = Concat(Fl, Fm, Fs);

[0044] In the formula, F l Represents the large-scale features of the input, F m represents the mesoscale feature, F s Represents small-scale features;

[0045] 4.2.4) After the features of multiple scales are fused, they are input into the second half of MSFFPN for processing. The second half consists of a set of parallel deep convolutions. The process is expressed as follows:

[0046]

[0047] In the formula, k (m) =(m+1)×2+1, where m represents the size of the convolution kernel and n represents the nth convolution;

[0048] 4.2.5) After being processed by this set of parallel deep convolutions, a 1×1 standard convolution is used to integrate features of different receptive field sizes. In this way, wider and more scaled context information can be captured without affecting the integrity of local texture features. The process is expressed as follows:

[0049]

[0050] 4.2.6) Finally, the features after scale fusion in 4.2.3) and the features after multi-scale extraction in 4.2.5) are residually connected. Through this residual connection, the network retains the original feature information while learning the convolutional features, so that it can better capture and represent the details and high-level semantic information of the input data. The process is expressed by the formula:

[0051] P = Xsf + Zdw_sum;

[0052] 4.3) The feature map that has been fused with multi-scale features and other hierarchical feature maps are input into the LPSP detection head. The detection head first uses PConv to further extract the features of each level, and the extracted features are input into Share Conv. This convolution can share features from different levels to solve the problem of uneven distribution of targets at different scales and expand the amount of data. The shared features are multiplied by a scale factor and used to perform regression tasks on targets of different scales. The process is expressed by the formula:

[0053] Zi = Si × cv2 (yi);

[0054] In the formula, S i is the scale factor of different levels, i represents different levels, y i Represents shared features.

[0055] Compared with the existing methods, the insulator defect detection method of the present invention has the following advantages:

[0056] 1. The RML-YOLOV8 model in the detection method of the present invention can detect insulators and their defects efficiently and quickly.

[0057] 2. The RFCAConv used in the detection method of the present invention combines the attention mechanism to summarize the features of each receptive field, effectively solving the shortcoming of the standard convolution parameter sharing that cannot capture the differences in information at different positions, and effectively improving the feature extraction capability.

[0058] 3. The multi-scale feature fusion pyramid network of the detection method of the present invention effectively makes up for the shortcomings of insufficient FPN information fusion and insufficient multi-scale target processing capability through the two modules of multi-scale feature fusion and multi-scale feature extraction.

[0059] 4. The LPSP detection head of the detection method of the present invention uses a convolution with a shared parameter for features at different levels, which reduces the number of model parameters and the amount of calculation while solving the problem of uneven distribution of targets at different scales, expands the amount of data, and improves the model's ability to detect targets of different scales. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1It is a schematic diagram of the process of the insulator defect detection method of the present invention;

[0061] Figure 2 This is a schematic diagram of the network structure of RML-YOLOv8 in the embodiment;

[0062] Figure 3 It is a schematic diagram of the structure of RFCAConv in the embodiment;

[0063] Figure 4 Schematic diagram of the MSFFPN structure in the embodiment;

[0064] Figure 5 Schematic diagram of the structure of the LPSP detection head in the embodiment;

[0065] Figure 6 Actual detection effect diagram;

[0066] Figure 7 Schematic diagram of the convergence of the RML-YOLOv8 network model in the embodiment. DETAILED DESCRIPTION

[0067] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments, but the present invention is not limited thereto.

[0068] Example:

[0069] A lightweight multi-scale insulator defect detection method based on RML-YOLOv8, such as Figure 1 As shown, the following steps are included:

[0070] 1) Collect insulator and defect data sets:

[0071] The power lines of the China Southern Power Grid in Guangxi Zhuang Autonomous Region were inspected and photographed by drones carrying high-definition cameras to obtain an insulator image dataset. The camera resolution was set to 8000x6000 pixels. Labelme was used to annotate the dataset, with normal insulators labeled as Normal insulators and defective insulators as Fault insulators.

[0072] 2) Data enhancement and division:

[0073] The original data set marked in step 1) is randomly rotated, the brightness is randomized, and natural environmental factors such as cloud, rain, snow, fog, ice, hail, dew, and frost are added to enhance the data. The enhanced data set is then randomly divided into a training set and a test set in a ratio of 8:2.

[0074] 3) Build the RML-YOLOv8 model:

[0075] The standard convolution Conv of each feature layer in the backbone network of YOLOv8 is modified to RFCAConv combined with the CA attention mechanism. The feature map obtained by RFA is the non-overlapping receptive field spatial feature after "adjusting the shape";

[0076] In the Neck layer of YOLOv8, the multi-scale feature fusion pyramid network MSFFPN is used to make up for the shortcomings of the original YOLOv8 network FPN in terms of insufficient processing capability for multi-scale targets and insufficient information fusion;

[0077] In the Head layer of YOLOv8, the LPSP detection head is used.

[0078] 4) Train the RML-YOLOv8 model:

[0079] Input the training set images obtained in step 2) into the constructed RML-YOLOv8 model, as follows: Figure 2 As shown in the figure, the training set will be learned for epochs in RML-YOLOv8. In the training and learning, the detection performance is continuously improved. When there is no better result in the set epoch round or nearly 50 epochs, the training will stop and save the weight of the best training result and the last round of training weight in the specified folder. The weight file is saved as best.p;

[0080] 4.1) During training, the training set will be input into Figure 2 The RML-YOLOv8 model is used for training, where Figure 3 In the RFCAConv structure, AvgPool is first used to aggregate the global information of each receptive field feature;

[0081] Then, a 1×1 group convolution operation is used for information interaction, and softmax is used to emphasize the importance of each feature in the receptive field feature. In this way, a convolution kernel with an attention mechanism is obtained. The feature map part first uses a k×k group convolution and then uses Norm, i.e. batch normalization.

[0082] Finally, ReLU is used for activation to obtain a new feature map, which is multiplied by the convolution kernel with attention mechanism. The formula is as follows:

[0083] F = Softmax(g 1×1 (AvgPool(X)))×ReLU(Norm(g k×k (X)));

[0084] In the formula, AvgPool represents the average pooling operation, Softmax represents the Softmax normalization operation, and g i×irepresents a grouped convolution of size i×i, k represents the size of the convolution kernel, Norm represents normalization, ReLU represents the use of the ReLU activation function, and X represents the input feature map;

[0085] 4.2) After Figure 2 After the feature extraction of Backbone, the features of each level will be input into the Neck part for processing, where the input is as follows Figure 4 When the MSFFPN network is used, the specific processing steps are as follows:

[0086] 4.2.1) The MSFFPN network first splits the input features into large, medium and small features. The size of the medium-sized feature map is H, W; the large-sized feature map is 2H, 2W; and the small-sized feature map is H / 2, W / 2;

[0087] The large-size feature map is processed by a downsampling module, which first performs an AvgPool operation, and then uses the Split operation to divide the feature map into two parts by channel. One part performs the MaxPool2d operation and the convolution operation, and the other part only performs the convolution operation. After the operation, the size of the two parts of the feature map is reduced by half to become a feature map of size H and W. Finally, the two parts are spliced. This reduces the spatial size and performs effective feature fusion on the channel, reducing the amount of calculation while ensuring the diversity of feature extraction. The process is expressed by the formula:

[0088] [X1,X2]=Split(AvgPool(Fl),C / 2);

[0089] Fl=Concat(Conv(X1),Conv(MaxPool2d(X2));

[0090] In the formula, F l Represents the large-scale features of the input, AvgPool represents the average pooling operation, MaxPool2d represents the maximum pooling operation, Conv represents the standard convolution operation, Concat represents the connection of features, C represents the number of channels, and Split represents the division of features into two according to the number of channels;

[0091] 4.2.2) For small-scale features, an Upsample operation is first used to convert the feature map of size H / 2, W / 2 into a feature map of size H, W. This operation can enrich the low-level detail information on the feature map and help improve the model's ability to capture fine features. Subsequently, a standard convolution operation is used to reduce the number of channels to 1 / 4 of the original number.

[0092] 4.2.3) Finally, after downsampling and upsampling the large-scale and small-scale features respectively, the three feature maps will be adjusted to the same size, that is, the medium size, and the feature maps of the three scales will be fused. The process is expressed by the formula:

[0093] X sf =Concat(F l ,F m ,F s );

[0094] In the formula, Fl represents the large-scale features of the input, Fm represents the medium-scale features, and Fs represents the small-scale features;

[0095] 4.2.4) After the features of multiple scales are fused, they are input into the second half of the multi-scale feature fusion pyramid network for processing. The second half consists of a set of parallel deep convolutions. The process is expressed by the formula:

[0096]

[0097] In the formula, k (m) =(m+1)×2+1, where m represents the size of the convolution kernel and n represents the nth convolution;

[0098] 4.2.5) After being processed by this set of parallel deep convolutions, a 1×1 standard convolution is used to integrate features of different receptive field sizes. In this way, wider and more scaled context information can be captured without affecting the integrity of local texture features. The process is expressed as follows:

[0099]

[0100] 4.2.6) Finally, the features after mid-scale fusion and the features after multi-scale extraction are residually connected. Through this residual connection, the network retains the original feature information while learning the convolutional features, so that it can better capture and represent the details and high-level semantic information of the input data. The process is expressed by the formula:

[0101] P = Xsf + Zdw_sum;

[0102] 4.3) After Figure 2 After the Neck layer is processed, the features of each level will be input into Figure 5The LPSP detection head designed by the LPSP detection head uses PConv to further extract features from each level of the Neck layer to balance the accuracy loss that may be caused by lightweighting, and then inputs the features extracted from each level into Share Conv. This convolution can share features from different levels to solve the problem of uneven distribution of targets at different scales and expand the amount of data. The shared features are multiplied by a scale factor and used to perform regression tasks on targets of different scales. The process is expressed by the formula:

[0103] Z i =S i ×cv2(y i );

[0104] Where Si is the scale factor of different levels, i represents different levels, and yi represents shared features.

[0105] 5) The specific process of result prediction is:

[0106] Input the test set image in step 2) into the RML-YOLOv8 model, and call the optimal weight file in step 4) to predict the result. The Anchor-free mechanism is used to mark the potential target during prediction. Finally, the results of multiple prediction boxes are screened by NMS (non-maximum suppression), and the one with the highest score is retained as the prediction box. The prediction box is the location of the predicted target. Some of the effects after prediction are shown below. Figure 6 shown.

[0107] RML-YOLOV8 network model convergence verification:

[0108] Use the RML-YOLOV8 network model to train the training set in step 2) and iterate the training 300 times on the GPU. During the training process, collect the log information of each iteration training of the RML-YOLOV8 network model. Through the visualization of the information, the RML-YOLOV8 network model continues to converge during the training process. In the 300 iterations, the loss function gradually converges. The convergence is shown in the figure below. Figure 7 As shown, the results show that the RML-YOLOV8 network model can reach a stable state quickly during the training process.

[0109] Performance evaluation:

[0110] Taking mAP50 and mAP50-95 as evaluation indicators, the method of the present invention is compared with different improvement strategies using the same data set under the same experimental environment. The results of the insulator and defect data sets are shown in Table 1, where R refers to RFCAConv, M refers to MSFFPN, and L refers to LPSP detection head.

[0111] Table 1 Ablation experiment

[0112]

[0113] As can be seen from the above table, after adding RFCAConv alone, due to the enhanced feature extraction capability, mAP50 increased by 2.5 percentage points, mAP50-95 increased by 2.8 percentage points, and the number of parameters, calculation amount and model size increased slightly. After adding MSFFPN alone, due to the shortcomings of insufficient FPN information fusion and insufficient multi-scale target processing capability, mAP50 increased by 1.8 percentage points, mAP50-95 increased by 2.9 percentage points, but the number of parameters, calculation amount and model size increased. After adding LPSP detection head alone, due to the use of a The convolution of shared parameters solves the problem of uneven distribution of targets at different scales while reducing the number of model parameters and computational complexity, expands the amount of data, and improves the model's ability to detect targets of different scales. Therefore, while the number of parameters, computational complexity, and model size are reduced, mAP50 is increased by 2.4 percentage points, and mAP50-95 is increased by 3.6 percentage points. When the three improved modules are added at the same time, the number of model parameters is reduced by about 500,000, the computational complexity is reduced by about 0.2G, and the model size is reduced by about 1M. At the same time, mAP50 is increased by 4.3 percentage points, and mAP50-95 is increased by 5.5 percentage points.

[0114] Taking mAP50 and mAP50-95 as evaluation indicators, the method of the present invention is compared with the currently popular target detection algorithms using the same data set under the same experimental environment. The results of the insulator and defect data sets are shown in Table 2:

[0115] Table 2 Comparative experiments of different models

[0116]

[0117] It can be seen from the above table that the detection method of the present invention has the smallest number of parameters and model size, and its performance is higher than other models. Although the computational complexity is 0.8G higher than that of YOLOv5, its mAP50 is 4.1 percentage points higher than that of YOLOv5, and its mAP50-95 is 5.8 percentage points higher than that of YOLOv5. Compared with other models, its mAP50 is 7.3 percentage points higher than the latest YOLOv10 algorithm, 4.6 percentage points higher than Gold YOLO, and 1.8 percentage points higher than the highest YOLOv7. Its mAP50-95 is 8.6 percentage points higher than the latest YOLOv10, and 5.5 percentage points higher than the highest YOLOv8.

[0118] From the above comparative experiments, it can be seen that the lightweight multi-scale insulator defect detection method based on RML-YOLOv8 proposed in the present invention, when detecting insulators and insulator defects, reduces the amount of parameter calculation and model volume while maintaining a high level of detection performance compared with the current mainstream target detection algorithm.

Claims

1. A lightweight multi-scale insulator defect detection method based on RML-YOLOv8, characterized in that: The steps include: 1) Insulator defect data collection: Use drones to inspect and take photos of the power line insulators that need to be inspected to obtain an insulator image dataset. Then use image annotation tools to annotate the insulators and insulator defect locations in the dataset to obtain the original dataset. 2) Data enhancement and division: The original data set marked in step 1) is randomly rotated, randomized in brightness, and natural environmental factors are added for data enhancement. The data set after data enhancement is divided into a training set and a test set in a ratio of 8:2; 3) Build the RML-YOLOv8 model: The RFCAConv convolution, CA attention mechanism, pyramid network MSFFPN and LPSP detection head are combined into the original YOLOv8 model to build the RML-YOLOv8 model. 4) Train the RML-YOLOv8 model: Input the training set images in step 2) into the RML-YOLOv8 model, train the model, and save the optimal training results as a weight file after training; 5) Result prediction: Input the test set images in step 2) into the RML-YOLOv8 model, and call the optimal weight file in step 4) to predict the results. The Anchor-free mechanism is used to mark potential targets during prediction. Finally, the results of multiple prediction boxes are screened through NMS, and the one with the highest score is retained as the prediction box. The prediction box is the location of the insulator and the defective insulator.

2. The lightweight multi-scale insulator defect detection method based on RML-YOLOv8 according to claim 1 is characterized in that: In step 1), in the insulator defect data collection, the resolution of the drone camera is not less than 8000x6000 pixels, and Labelme is used to annotate the data set, with normal insulators annotated as Normal insulators and defective insulators annotated as Faulty insulators.

3. The lightweight multi-scale insulator defect detection method based on RML-YOLOv8 according to claim 1 is characterized in that: Step 3) constructs the RML-YOLOv8 model, specifically: The standard convolution Conv of each feature layer in the backbone network of YOLOv8 is modified to RFCAConv combined with the CA attention mechanism. The feature map obtained by RFA is the non-overlapping receptive field spatial feature after "adjusting the shape"; In the Neck layer of YOLOv8, the multi-scale feature fusion pyramid network MSFFPN is used to make up for the shortcomings of FPN in the original YOLOv8 network in terms of insufficient processing capability for multi-scale targets and insufficient information fusion; in the Head layer of YOLOv8, the LPSP detection head is used.

4. The lightweight multi-scale insulator defect detection method based on RML-YOLOv8 according to claim 1 is characterized in that, in step 4), the RML-YOLOv8 model is trained, and the training set image obtained in step 2) is input into RML-YOLOv8, and the training set is learned for epoch times in RML-YOLOv8. When there is no better result in the set epoch round or nearly 50 epoch learning, the training is stopped, and the weight of the optimal training result and the training weight of the last round are saved in a specified folder; The training steps include: 4.1) The training set images are input into the RML-YOLOv8 model. RFCAConv is obtained by multiplying a convolution kernel with attention information and a processed feature map. AvgPool is first used to aggregate the global information of each receptive field feature. Then, a 1×1 group convolution operation is used for information interaction. Finally, a softmax operation is used to emphasize the importance of each feature in the receptive field feature. A convolution kernel with an attention mechanism is obtained. The feature map part first uses a k×k group convolution, then uses Norm, i.e., batch normalization, and uses ReLU for activation to obtain a new feature map. Finally, the feature map is multiplied by the convolution kernel with an attention mechanism. The formula is as follows: F = Softmax(g 1×1 (AvgPool(X)))×ReLU(Norm(g k×k (X))); where AvgPool represents the average pooling operation, Softmax represents the Softmax normalization operation, and g i×i represents a grouped convolution of size i×i, k represents the size of the convolution kernel, Norm represents normalization, ReLU represents the use of the ReLU activation function, and X represents the input feature map; 4.2) After the feature map extracted in step 4.1) is processed by the C2f module, the features of each level will be input into the Neck part for processing. When input into the MSFFPN network, the specific steps of processing are as follows; 4.2.1) The MSFFPN network first splits the input large, medium and small features, assuming that the large-size feature map is 2H, 2W, the medium-size feature map is H, W, and the small-size feature map is H / 2, W / 2; the large-size feature map is processed by a downsampling module, which first performs an AvgPool operation, and then uses the Split operation to divide the feature map into two parts by channel, one part performs the MaxPool2d operation and the convolution operation, and the other part only performs the convolution operation. After the operation, the size of the feature maps of the two parts is reduced by half to become a feature map of size H, W. Finally, the two parts are spliced, which not only reduces the spatial size, but also performs effective feature fusion on the channel, while reducing the amount of calculation and ensuring the diversity of feature extraction. The process is expressed by the formula: [X1,X2]=Split(AvgPool(F l ),C / 2); F l =Concat(Conv(X1),Conv(MaxPool2d(X2)); In the formula, F l Represents the large-scale features of the input, AvgPool represents the average pooling operation, MaxPool2d represents the maximum pooling operation, Conv represents the standard convolution operation, Concat represents the connection of features, C represents the number of channels, and Split represents the division of features into two according to the number of channels; 4.2.2) For small-scale features, an Upsample operation is first used to convert the feature map of size H / 2, W / 2 into a feature map of size H, W. This operation can enrich the low-level detail information on the feature map and help improve the model's ability to capture fine features. Subsequently, a standard convolution operation is used to reduce the number of channels to 1 / 4 of the original number. 4.2.3) Finally, after downsampling and upsampling the large-scale and small-scale features respectively, the three feature maps will be adjusted to the same size, that is, the medium size, and the feature maps of the three scales will be fused. The process is expressed by the formula: X sf =Concat(F l ,F m ,F s ); In the formula, F l Represents the large-scale features of the input, F m represents the mesoscale feature, D s Represents small-scale features; 4.2.4) After the features of multiple scales are fused, they are input into the second half of MSFFPN for processing. The second half consists of a set of parallel deep convolutions. The process is expressed as follows: In the formula, k(m)=(m+1)×2+1, m represents the size of the convolution kernel, and n represents the nth convolution; 4.2.5) After being processed by this set of parallel deep convolutions, a 1×1 standard convolution is used to integrate features of different receptive field sizes. In this way, wider and more scaled context information can be captured without affecting the integrity of local texture features. The process is expressed as follows: 4.2.6) Finally, the features after scale fusion in 4.2.3) and the features after multi-scale extraction in 4.2.5) are residually connected. Through this residual connection, the network retains the original feature information while learning the convolutional features, so that it can better capture and represent the details and high-level semantic information of the input data. The process is expressed by the formula: P = X sf +Z dw_sum ; 4.3) The feature map that has been fused with multi-scale features and other hierarchical feature maps are input into the LPSP detection head. The detection head first uses PConv to further extract the features of each level, and the extracted features are input into Share Conv. This convolution can share features from different levels to solve the problem of uneven distribution of targets at different scales and expand the amount of data. The shared features are multiplied by a scale factor and used to perform regression tasks on targets of different scales. The process is expressed by the formula: Z i =S i ×Cv2(y i ); In the formula, S i is the scale factor of different levels, i represents different levels, y i Represents shared features.