Lightweight power transmission line foreign matter identification method based on improved yov8
By introducing GhostConv, C2f-ContextGuided modules and lightweight detection heads into the YOLO model, the YOLOv8-GCL model is formed, which solves the problem of insufficient real-time detection and complex scene perception capabilities of traditional models in resource-constrained environments, and achieves efficient and accurate foreign object recognition on transmission lines.
Patent Information
- Application Number
- CN202411584465.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-25
AI Technical Summary
The traditional YOLO model is difficult to achieve real-time detection in resource-constrained environments, and it lacks perception capabilities in complex scenarios, so it is impossible to efficiently and accurately identify foreign objects on the transmission line.
By introducing the GhostConv convolution module, the C2f-ContextGuided module and building a lightweight detection head Lighted-detect, the YOLOv8-GCL model is formed, which reduces the model's parameter quantity and calculation complexity, and enhances feature extraction and multi-scale feature learning capabilities.
It realizes efficient and accurate detection in resource-constrained environments, improves the model's perception ability in complex scenarios, and ensures the accuracy and real-timeness of foreign object recognition on transmission lines.
Smart Images

Figure CN119516415A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of power transmission lines, and in particular to a lightweight power transmission line foreign body identification method based on improved YOLO V8. Background Art
[0002] Transmission lines are an important part of the power system, and their safe and stable operation is directly related to the reliability of power transmission. However, since transmission lines are exposed to the outdoors for a long time, they are vulnerable to intrusion by foreign objects such as bird nests, kites, and balloons. The intrusion of these external foreign objects may cause serious faults such as short circuits and tripping, threatening the safe operation of the power grid. Therefore, timely and effective identification of foreign objects on transmission lines has become an important task to ensure the stable operation of the power system. At present, the inspection of transmission lines mainly relies on manual or semi-automatic equipment. Although the inspection efficiency has been improved to a certain extent, manual inspection has problems such as high labor costs, limited coverage, and unstable inspection quality. In addition, with the continuous expansion of transmission lines, traditional inspection methods have been unable to meet the growing inspection needs.
[0003] In order to solve the efficiency and accuracy problems in foreign object recognition on power transmission lines, automated technology based on image recognition has gradually become a research hotspot. As the mainstream algorithm currently widely used in target detection tasks, YOLO has been widely used in industrial scenarios due to its high speed and accuracy. However, the traditional YOLO model has problems such as large number of parameters and high computational complexity, which makes it difficult to achieve real-time detection on resource-constrained mobile devices (such as drone inspections). In order to meet this challenge, more and more researchers are constantly exploring improvements to lightweight models, striving to reduce model complexity and improve real-time detection performance while ensuring recognition accuracy. Summary of the invention
[0004] The purpose of the present invention is to provide a lightweight transmission line foreign object identification method based on improved YOLOv8. Through lightweight structural design and context perception module, the problems of high computational cost and insufficient perception ability of complex scenes in UAV foreign object detection are solved, and efficient and accurate detection is achieved in resource-constrained environments.
[0005] The present invention provides a lightweight transmission line foreign body identification method based on improved yolov8, comprising the following steps:
[0006] S1, data preprocessing;
[0007] Collect the same number of photos and YOLO format annotation files to integrate into a data set, convert the data set into a VOC format XML annotation file, and expand the data set by image atomization, image occlusion, and image flipping.
[0008] S2. Foreign object recognition in the data set uses yolov8n as the baseline model, and introduces the GhostConv convolution module, the C2f-ContextGuided module, and constructs a lightweight detection head Lighted-detect; the Conv convolution module is replaced by the GhostConv convolution module, the C2f module is replaced by the C2f-ContextGuided module, and the Detect detection head is replaced by the lightweight detection head Lighted-detect to form the YOLOv8-GCL model;
[0009] S3. Visualization of foreign object recognition and evaluation of the YOLOv8-GCL model; test the effectiveness of the YOLOv8-GCL model and evaluate the model using the precision P, recall R, and mean average precision (mAP) indicators.
[0010] Preferably, in step S1, the data set is randomly divided into a training set, a validation set, and a test set in a ratio of 8:1:1.
[0011] Preferably, in step S2, the GhostConv convolution module first uses the convolution kernel to extract features, then performs a linear transformation operation on the extracted features, and finally obtains a feature map through a splicing operation.
[0012] Preferably, in step S2, the C2f-ContextGuided module first uses Conv 1×1 Convolution reduces the number of channels through standard convolution Conv 3×3 Get the local feature information f of the model loc , and through the dilation rate 2 dilated convolution DIConv 3×3 Get context information f sur ; Then, by connecting the local information with the surrounding context information and using batch normalization BN and SiLU activation function to further improve the feature representation, the joint feature information f is obtained. joi The C2f-ContextGuided module uses global average pooling (GAP) to obtain global information, and then further refines it through two fully connected FC layers to obtain the global information f glo , and finally the input and output features are associated through residual connections.
[0013] Preferably, in step S2, the lightweight detection head Lighted-detect performs lightweight optimization based on the P3, P4 and P5 feature layers output by the feature pyramid network FPN for classification Cls and regression Reg tasks. After deep convolution, it is compressed and optimized through 1x1 convolution. At the same time, the classification task is processed using two 1x1 convolutions to further refine the feature representation required for classification.
[0014] Preferably, in step S3, the precision represents the ratio of the predicted correct positive samples to the actual positive samples in the prediction data, and the recall represents the probability that the correct category in the sample is predicted correctly, and the formula is as follows:
[0015]
[0016] Among them, TP represents the number of positive samples predicted as positive; FP represents the number of negative samples predicted as positive; and FN represents the number of positive samples predicted as negative.
[0017] Preferably, in step S3, a PR curve can be obtained by plotting with P as the ordinate and R as the abscissa. The average precision AP represents the area enclosed under the PR curve, as shown in the following formula. The larger the area, the better the effect of the model on data processing. At present, mAP is often used to measure the detection effect of the YOLOv8-GCL model, which represents the mean of the average precision of all categories.
[0018]
[0019] As shown in the following formula, where n class Indicates the number of categories. The larger the mAP value, the better the detection effect of the YOLOv8-GCL model.
[0020]
[0021] The loss value of each parameter gradually decreases with iterations and eventually converges, and the loss value change curve is drawn; the precision, recall rate and mAP value are calculated and the change curve is drawn.
[0022] Preferably, in step S3, a GradCAM heat map is introduced to visualize the YOLOv8-GCL model and the positioning effect of foreign objects. GradCAM uses a gradient weighted class activation mapping method to generate a heat map, and a transmission line foreign object image is selected for testing.
[0023] Therefore, the present invention adopts the above-mentioned lightweight transmission line foreign object identification method based on improved YOLOv8, and solves the problems of high computing cost and insufficient perception ability of complex scenes in drone foreign object detection through lightweight structural design and context perception module, and realizes efficient and accurate detection in resource-constrained environments.
[0024] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is an overall schematic diagram of a lightweight transmission line foreign body identification method based on improved yolov8 of the present invention;
[0026] Figure 2 It is a schematic diagram of the GhostConv convolution principle of a lightweight transmission line foreign body recognition method based on improved yolov8 of the present invention;
[0027] Figure 3 It is a schematic diagram of the structure of a C2f-ContextGuided module of a lightweight transmission line foreign body identification method based on improved yolov8 of the present invention;
[0028] Figure 4 This is a structural diagram of the improved lightweight detection head Lighted-detect based on the improved yolov8 lightweight transmission line foreign body identification method of the present invention;
[0029] Figure 5 A lightweight improved YOLOv8-GCL model structure of a lightweight transmission line foreign body identification method based on improved YOLOv8 of the present invention;
[0030] Figure 6 This is a label distribution diagram of various types of foreign objects in the training set and verification set of the data set of the lightweight transmission line foreign body identification method based on improved yolov8 of the present invention;
[0031] Figure 7 A normalized confusion matrix diagram of a lightweight transmission line foreign body identification method based on improved yolov8 according to the present invention;
[0032] Figure 8 This is a loss curve diagram of a lightweight transmission line foreign body identification method based on improved yolov8 of the present invention;
[0033] Fig. 9 This is a curve showing the change of evaluation indicators of a lightweight transmission line foreign body identification method based on improved yolov8 according to the present invention;
[0034] Fig.10 This is a heat map display of the detection effect of a lightweight transmission line foreign body identification method based on improved yolov8 of the present invention;
[0035] Fig.11 This is a validation set image evaluation training effect diagram of a lightweight transmission line foreign body recognition method based on improved yolov8 of the present invention;
[0036] Fig.12 This is an overall flow chart of a lightweight transmission line foreign body identification method based on improved yolov8 of the present invention. DETAILED DESCRIPTION
[0037] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0038] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0039] The words "first", "second" and similar terms used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "include" or "comprises" and similar terms mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connect" or "connected" and similar terms are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0040] Embodiment 1
[0041] like Figure 1-Figure 11 As shown, the present invention provides a lightweight transmission line foreign body identification method based on improved yolov8, comprising the following steps:
[0042] S1, data preprocessing;
[0043] Collect and integrate files into a data set; convert the data set into an XML annotation file, expand the data set by image atomization, image occlusion, and image flipping, and randomly divide the data set into a training set, a validation set, and a test set in proportion;
[0044] S2. The foreign object recognition in the dataset uses the yolov8n model as the baseline model, and forms the yolov8-GCL model by introducing the GhostConv convolution module, the C2f-ContextGuided module and building a lightweight detection head Lighted-detect;
[0045] Replace the Conv convolution module with the GhostConv convolution module, replace the C2f module with the C2f-ContextGuided module, and replace the Detect detection head with the lightweight detection head Lighted-detect;
[0046] First, the GhostConv convolution module is introduced to replace the original convolution Conv module to reduce the number of model parameters and computational cost. Secondly, the C2f module is replaced by the C2f-ContextGuided module, which enhances the effect of feature extraction by combining rich gradient flow information and context information. At the same time, the model uses multiple feature fusion operations Concat and Upsample in the Neck part, further improving the model's multi-scale feature learning ability.
[0047] In addition, the YOLOv8n-GCL model has designed a dedicated lightweight detection head Lighted-detect, which performs lightweight optimization on the classification Cls and regression Reg tasks based on the P3, P4, and P5 feature layers output by the feature pyramid network FPN, allowing the model to perform well in detection tasks. In the detection head, the feature map is compressed and optimized through 1x1 convolution to ensure high-precision prediction of the bounding box. At the same time, the classification task uses two 1x1 convolutions to further refine the classification features and improve the accuracy and precision of the classification. The structure of the YOLOv8n-GCL model is as follows: Figure 6 shown.
[0048] The GhostConv convolution module is introduced to replace the original Conv module in the backbone network Backbone structure and the neck network Head result. GhostConv is an important module in the lightweight network GhostNet and can be used to replace ordinary convolution.
[0049] It has the effect of reducing the number of parameters and the amount of calculation. In the working process, GhostConv first uses a small number of convolution kernels to extract features, then performs a linear transformation operation on the extracted features that is lighter than ordinary convolution operations, and finally obtains the feature map through splicing operations. The learning cost of non-critical features is reduced, and the number of parameters is reduced without affecting the performance of the model. Therefore, after replacing the Conv module with the GhostConv convolution module, the Backbone and Head structures are simplified, thereby reducing the overall complexity of the model.
[0050] The C2f_ContextGuided module is an innovative design that combines the C2f and ContextGuided modules, and is built specifically to improve the detection accuracy of the YOLOv8 model. The C2f module is characterized by dividing the feature map into two sub-feature maps through the channel dimension split operation, and removing the convolution operation in the branch to reduce the computational burden. In addition, the C2F module adds jump connections, which brings rich gradient flow information, enhancing the feature expression capability while maintaining lightweight.
[0051] The design of the ContextGuided module is inspired by the human visual system’s need to understand the scene. 1×1 Convolution reduces the number of channels, thereby reducing computational complexity. Next, through standard convolution Conv 3×3 Get the local feature information f of the model loc , and through the dilation rate 2 dilated convolution DIConv 3×3 Obtaining a wider range of contextual information sur This design helps the model better understand the feature information of different regions in complex scenes. Then, by connecting the local information with the surrounding context information and using batch normalization (BN) and SiLU activation function to further improve the feature representation, the joint feature information f is obtained. joi ; In order to enhance the feature expression at the overall image scale, the C2f-ContextGuided module uses global average pooling (GAP) to obtain global context information, which is then further refined through two fully connected (FC) layers to obtain the global information f glo Finally, the input and output features are associated through residual connections. The structural diagram of the C2f-ContextGuided module is shown in Figure 4 As shown, combined Figure 4 The principle expression is as follows:
[0052] z 1,o =f glo (f joi (f loc (Z 1,i )+f sur (Z 1,i )))+Z 1,i ;
[0053] Z 2,o =f glo (f joi (f loc (Z 1,o )+f sur (Z 1,o )))+z 2,i ;
[0054] X o =CBL(Concat(Z 1,o +Z 2,o +Split(CBL(X i )));
[0055] Among them, Split is the dimension splitting function, f loc represents the extraction operation of local features, f surrepresents the extraction operation of surrounding features, "+" represents the residual summation operation, and CBL is the conversion of convolution, normalization and activation functions. Xi and Xo are global input and output respectively, and Z 1,u , Z 2,i and Z 1,o , Z 2,o They are the input and output of CG in bottleneck. This modular design can not only enhance feature information based on the C2f module, but also improve its performance in detection tasks while making the model lightweight as a whole.
[0056] In order to achieve efficient deployment of the model, a lightweight improved lightweight detection head Lighted-detect is designed. The detection head is based on the P3, P4 and P5 feature layers output by the Feature Pyramid Network (FPN), and is lightweight and optimized for classification (Cls.) and regression (Reg) tasks, and is further adapted for resource-constrained deployment environments. In the detection head, the feature map after deep convolution is compressed and optimized by 1x1 convolution to ensure high-precision prediction of bounding box coordinates. At the same time, the classification task uses two 1x1 convolutions to process the feature map to further refine the feature representation required for classification.
[0057] The design of the detection head optimizes the data processing path, significantly reduces the model complexity and computing requirements, and improves the speed and accuracy of data processing, making it suitable for deployment in environments with limited computing resources. By optimizing the architecture, the lightweight detection head Lighted-detect significantly reduces the GFLOPs and number of parameters of the model while maintaining high detection accuracy. As shown in Table 1, the GFLOPs of the model is reduced from 2.98 to 0.60, and the number of parameters is reduced from 751702 to 130838, showing a significant optimization effect.
[0058] Table 1 Comparison of parameters of the improved detection head and those before improvement
[0059] Modules Time / ms GFLOPs Parameter quantity Detect 28.41 2.98 752092 Lighted-Detect 57.41 0.60 131228
[0060] Table 2 Model training parameter setting table
[0061] Model parameters Parameter settings Batch size 8 Iterations 200 Input image size 640×640 Optimizer SGD
[0062] S3. Visualization and model evaluation of foreign object recognition; test the effectiveness of the model and evaluate the model using the precision P, recall R, and mean average precision (mAP) indicators;
[0063] Precision indicates the proportion of correctly predicted positive samples to actual positive samples in the predicted data, and recall indicates the probability that the correct category in the sample is predicted correctly. The formula is as follows:
[0064]
[0065] Where TP represents the number of positive samples predicted as positive; FP represents the number of negative samples predicted as positive; FN represents the number of positive samples predicted as negative;
[0066] The PR curve can be obtained by plotting with P as the ordinate and R as the abscissa. The average precision AP represents the area under the PR curve, as shown in the following formula. The larger the area, the better the model's data processing effect. At present, mAP is often used to measure the model detection effect, which represents the mean of the average precision of all categories.
[0067]
[0068] As shown in the following formula, where n class Indicates the number of categories. The larger the mAP value, the better the model detection effect.
[0069]
[0070] During the training process, the loss value of each parameter gradually decreases with iterations and eventually converges, and the loss value change curve is plotted; in the figure, box_loss represents the loss of the Bounding box, cls_loss represents the classification loss, dfl_loss represents the loss of the feature difference between positive and negative samples, train represents the training set, and val represents the validation set. As can be seen from the figure, the loss curves of the training set and the validation set can effectively converge to a minimum value, indicating that this method can achieve the best effect after 200 iterations.
[0071] The precision, recall rate and mAP values were calculated and the change curves were drawn; after 200 iterations, the precision, recall rate and average precision mean curves were completely converged and approached 1, which could classify, locate and identify different types of foreign objects on power transmission lines and achieved excellent results.
[0072] The results of the YOLOv8n-GCL model are shown in Table 3. The YOLOv8n-GCL model has outstanding performance in the overall category, with P (precision) of 0.965, R (recall) of 0.938, mAP50 (average precision) of 0.973, mAP95 of 0.718, 1200107 parameters, 2.9 GFLOPs, and an inference speed of 220.3FPS. The optimal weight file size is only 2.6MB, showing an excellent lightweight effect. In addition, the detection results for different categories are also excellent. These results show that the YOLOv8n-GCL model not only has excellent detection performance overall, but also shows strong accuracy and stability when processing various types of targets. It is especially suitable for efficient target detection in resource-constrained application scenarios.
[0073] Table 3 Results of YOLOv8n-GCL
[0074]
[0075] On the basis of ensuring the consistency of model training parameters, multiple comparative experiments were conducted to evaluate the performance of the YOLOv8n-GCL model in terms of lightweight and performance. Table 4 shows the comparison of the effects of different methods in terms of mAP50, weight file size, parameter count, GFLOPs, and FPS.
[0076] In order to visually observe whether the recognition of foreign objects on the transmission line is accurate, the GradCAM heat map is introduced to visualize the model's positioning effect on foreign objects. GradCAM uses the gradient weighted class activation mapping method to generate a heat map, which can show the image area that the model pays attention to in the recognition decision, thereby helping to understand and explain the decision-making process of the convolutional neural network. In the heat map, the brighter the color, the higher the degree of attention, where the red part represents the key focus area and the blue part represents the less focused area.
[0077] Four types of transmission line foreign body images were selected for testing, and the generated thermal map visualization results are as follows: Fig.10 shown.
[0078] As can be seen from the figure, when detecting foreign objects on transmission lines, the model's focus area is accurately concentrated on the key parts of foreign objects, which are often the key features for distinguishing different types of foreign objects. This proves the effectiveness and reliability, and can achieve accurate identification of foreign objects on transmission lines in different scenarios, with broad application prospects.
[0079] In order to verify the advantages of the improved YOLOv8n-GCL model for foreign body recognition on power transmission lines, it is compared with mainstream methods in various fields and its own ablation comparison model. The results are shown in Table 4:
[0080] Table 4 Comparison of the effects of different methods
[0081]
[0082] As can be seen from the table, the YOLOv8n-GCL model (YOLOv8n-GCL) shows excellent lightweight advantages in weight file size, parameter amount and GFLOPs. The weight file is only 2.6M, the parameter amount is 1,200,107, and the GFLOPs is only 2.9. Compared with other models, it significantly reduces the computing resource requirements while maintaining a good mAP50 value (0.973). This shows that the YOLOv8n-GCL model has stronger practicality in resource-constrained environments.
[0083] In comparison, although other variants such as YOLOv8s and YOLOv8-GhostConv also show good performance, YOLOv8n-GCL further reduces the computational complexity on the basis of lightweight while still maintaining efficient detection capabilities. This makes it an ideal choice for tasks that require real-time processing, such as drone foreign object detection.
[0084] Furthermore, YOLOv8n-GCL not only performs well in scenarios with limited hardware resources, but also shows obvious advantages in inference speed and energy efficiency, effectively reducing redundant calculations, thereby improving detection speed while reducing power consumption requirements. Compared with other lightweight models, this architectural optimization of YOLOv8n-GCL enables it to have longer battery life and more stable performance on edge devices, making it particularly suitable for energy-sensitive scenarios such as drones and mobile devices.
[0085] At the same time, YOLOv8n-GCL still maintains a high detection accuracy, and its performance on mAP50 is only slightly different from that of larger models, which shows that it greatly improves the efficiency of the model while ensuring the detection quality, and is particularly suitable for real-time detection tasks that require efficient and fast reasoning. Therefore, the YOLOv8n-GCL model is undoubtedly an ideal solution for high-performance target detection in resource-constrained environments.
[0086] Therefore, the present invention adopts the above-mentioned lightweight transmission line foreign object identification method based on improved YOLOv8, and solves the problems of high computing cost and insufficient perception ability of complex scenes in drone foreign object detection through lightweight structural design and context perception module, and realizes efficient and accurate detection in resource-constrained environments.
[0087] The above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A lightweight transmission line foreign body identification method based on improved yolov8, characterized in that: The following steps are involved: S1, data preprocessing; Collect the same number of photos and YOLO format annotation files to integrate into a data set, convert the data set into a VOC format XML annotation file, and expand the data set by image atomization, image occlusion, and image flipping. S2. Foreign object recognition in the data set uses yolov8n as the baseline model, and introduces the GhostConv convolution module, the C2f-ContextGuided module, and constructs a lightweight detection head Lighted-detect; the Conv convolution module is replaced by the GhostConv convolution module, the C2f module is replaced by the C2f-ContextGuided module, and the Detect detection head is replaced by the lightweight detection head Lighted-detect to form the YOLOv8-GCL model; S3. Visualization of foreign object recognition and evaluation of the YOLOv8-GCL model; test the effectiveness of the YOLOv8-GCL model and evaluate the model using the precision P, recall R, and mean average precision (mAP) indicators.
2. According to claim 1, a method for identifying foreign objects in a lightweight power transmission line based on improved yolov8 is characterized in that: In step S1, the data set is randomly divided into a training set, a validation set, and a test set in a ratio of 8:1:
1.
3. According to claim 1, a method for identifying foreign objects in a lightweight power transmission line based on improved yolov8 is characterized in that: In step S2, the GhostConv convolution module first uses the convolution kernel to extract features, then performs linear transformation operations on the extracted features, and finally obtains the feature map through splicing operations.
4. According to claim 1, a method for identifying foreign objects in a lightweight power transmission line based on improved yolov8 is characterized in that: In step S2, the C2f-ContextGuided module first uses Conv 1×1 Convolution reduces the number of channels through standard convolution Conv 3×3 Get the local feature information f of the model loc , and through the dilation rate 2 dilated convolution DIConv 3×3 Get context information f sur ; Then, by connecting the local information with the surrounding context information and using batch normalization BN and SiLU activation function to further improve the feature representation, the joint feature information f is obtained. joi The C2f-ContextGuided module uses global average pooling (GAP) to obtain global information, and then further refines it through two fully connected FC layers to obtain the global information f glo , and finally the input and output features are associated through residual connections.
5. According to claim 1, a method for identifying foreign objects in a lightweight power transmission line based on improved yolov8 is characterized in that: In step S2, the lightweight detection head Lighted-detect performs lightweight optimization based on the P3, P4 and P5 feature layers output by the feature pyramid network FPN for classification Cls and regression Reg tasks. After deep convolution, it is compressed and optimized through 1x1 convolution. At the same time, the classification task is processed using two 1x1 convolutions to further refine the feature representation required for classification.
6. According to claim 1, a method for identifying foreign objects in a lightweight power transmission line based on improved yolov8 is characterized in that: In step S3, precision indicates the proportion of correctly predicted positive samples to actual positive samples in the predicted data, and recall indicates the probability that the correct category in the sample is predicted correctly, and its formula is as follows: Among them, TP represents the number of positive samples predicted as positive; FP represents the number of negative samples predicted as positive; and FN represents the number of positive samples predicted as negative.
7. According to claim 1, a method for identifying foreign objects in a lightweight power transmission line based on improved yolov8 is characterized in that: In step S3, the PR curve can be obtained by plotting with P as the ordinate and R as the abscissa. The average precision AP represents the area under the PR curve, as shown in the following formula. The larger the area, the better the model's data processing effect. At present, mAP is often used to measure the detection effect of the YOLOv8-GCL model, which represents the mean of the average precision of all categories. As shown in the following formula, where n class Indicates the number of categories. The larger the mAP value, the better the detection effect of the YOLOv8-GCL model. The loss value of each parameter gradually decreases with iterations and eventually converges, and the loss value change curve is plotted; the precision, recall rate, and mAP values are calculated and the change curve is plotted.
8. According to claim 1, a method for identifying foreign objects in a lightweight power transmission line based on improved yolov8 is characterized in that: In step S3, the GradCAM heat map is introduced to visualize the YOLOv8-GCL model and the localization effect of foreign objects. GradCAM uses the gradient weighted class activation mapping method to generate a heat map, and selects the transmission line foreign object image for testing.