Improved method and system for detecting foreign objects in power transmission lines using lightweight YOLOv8

By making lightweight improvements to the YOLOv8 network, using the GhostConv module, SPPELAN structure, and CBAM mechanism, the problems of high computational cost and insufficient accuracy of the lightweight YOLOv8 network in foreign object detection of transmission lines are solved, and efficient and stable foreign object detection is achieved.

CN118822942BActive Publication Date: 2026-11-17ELECTRIC POWER RES INST OF GUANGXI POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410632981.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2026-11-17
Estimated Expiration
2044-05-21

AI Technical Summary

Technical Problem

Existing lightweight YOLOv8 networks suffer from high computational costs and insufficient detection accuracy in foreign object detection on power transmission lines. How to reduce network computation while maintaining high detection accuracy is an urgent problem to be solved.

Method used

By replacing the convolutional modules of YOLOv8 with the GhostConv module, introducing the SPPELAN spatial pyramid pooling structure and CBAM attention mechanism, the YOLOv8 network is made lighter and improved. The model performance is further optimized through data augmentation and annotation.

Benefits of technology

While reducing the amount of computation and parameters, it improves the detection accuracy and the generalization ability of the model, adapts to foreign object detection under different environmental conditions, reduces the complexity of the system and the hardware resource requirements, and enhances the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118822942B_ABST
    Figure CN118822942B_ABST
Patent Text Reader

Abstract

This invention discloses an improved lightweight YOLOv8 method for foreign object detection on power transmission lines. Targeting foreign object detection in images captured by power transmission line monitoring, this method includes the following steps: First, a basic dataset is constructed by collecting images of bird nests, balloons, and kites captured by power transmission line monitoring. The dataset size is expanded by cropping, rotating, and adding noise. Images are labeled using `labelimg`. The dataset is divided into training, testing, and validation sets. Second, some Conv modules in the network are replaced with GhostConv, and the traditional spatial pyramid pooling structure is replaced with SPPELAN. Third, the accuracy of the detection model is improved using a CBAM attention module. The improved lightweight YOLOv8 detection model is trained on the expanded dataset for foreign object detection. Finally, the object to be detected is input into the trained detection model, and the corresponding foreign object detection result is output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of foreign object detection technology for power transmission lines, and in particular to an improved lightweight YOLOv8 method and system for detecting foreign objects in power transmission lines. Background Technology

[0002] With the development of my country's economy and society, the power grid has expanded accordingly, and related power facilities have been continuously improved. Electricity is a fundamental guarantee for people's lives, and also an important foundation for national defense, industrial production, and other fields. For these fields, the stability of electricity supply is a major factor affecting normal operation and production. Similarly, for people's lives, stable electricity supply is a necessary prerequisite for normal living. Therefore, inspecting power facilities that ensure power transmission plays a significant and positive role. Inspecting transmission lines through manual methods or video monitoring, and promptly identifying and addressing potential hazards such as foreign objects on the transmission lines that could affect the smooth and safe transmission, is of great importance for ensuring stable power transmission.

[0003] Object detection algorithms are an important method for identifying foreign objects on power transmission lines. Lightweighting the network can reduce computational costs and avoid wasting computing resources. At the same time, lightweight network models are more hardware-friendly. However, lightweighting the network comes at the cost of loss of accuracy. How to lightweight the network model while ensuring detection accuracy is an urgent problem to be solved. Summary of the Invention

[0004] In view of the problems existing in the prior art, the present invention is proposed.

[0005] Therefore, this invention proposes an improved lightweight YOLOv8 method for detecting foreign objects in transmission lines, which improves the performance of the detection network while reducing the amount of network computation and parameters.

[0006] To address the aforementioned technical problems, this invention provides the following technical solution: an improved lightweight YOLOv8 method for detecting foreign objects on power transmission lines, comprising: collecting images of foreign objects on power transmission lines captured by monitoring cameras, including bird nests, balloons, and kites; augmenting the collected images using cropping, rotation, and noise addition methods to construct a dataset; labeling the images containing foreign objects in the dataset using labelimg; dividing the labeled images into training, testing, and validation sets; lightweighting and improving the YOLOv8 network's Backbone, Neck, and Head detection modules using lightweight convolutional modules such as GhostConv, SPPELAN spatial pyramid pooling, and CBAM attention mechanisms; training and validating the improved lightweight YOLOv8 foreign object detection model on the divided dataset; and inputting the images or videos to be detected into the trained improved lightweight YOLOv8 model to obtain the detection results.

[0007] As a preferred embodiment of the improved lightweight YOLOv8 transmission line foreign object detection method of the present invention, the images in the basic dataset are expanded using cropping, rotation, and noise addition methods to obtain a dataset of 1190 images including three types of transmission line foreign objects: bird nests, balloons, and kites. These images are divided into a training set, a validation set, and a test set in a ratio of 8:1.5:0.5. The training set contains 952 images, the validation set contains 178 images, and the test set contains 60 images.

[0008] As a preferred embodiment of the improved lightweight YOLOv8 method for detecting foreign objects in transmission lines according to the present invention, the lightweighting of the YOLOv8 detection model includes:

[0009] The convolutional modules in YOLOv8 are improved with a lightweight approach. The YOLOv8 network consists of three modules: the Backbone feature extraction backbone network module, the Neck feature fusion module, and the Head detection head. Each module contains numerous convolutional and pooling modules. The lightweight GhostConv convolutional module replaces the convolutional modules in the Backbone feature extraction backbone network module.

[0010] The SPPELAN spatial pyramid pooling structure is used to replace the traditional spatial pyramid pooling structure to improve network feature fusion performance.

[0011] In the Neck feature fusion module of the YOLOv8 detection model, the CBAM module is added to further improve the network feature fusion performance.

[0012] As a preferred embodiment of the improved lightweight YOLOv8 method for foreign object detection in transmission lines according to the present invention, the lightweight improvement of the convolutional modules in YOLOv8 includes improving the YOLOv8 backbone network module using the GhostConv module. The ordinary convolutional Conv modules in modules 2, 4, 6, and 8 of the backbone feature extraction network module are replaced with GhostConv modules. The improved network module includes a Conv module, a GhostConv module, a C2f module, and a SPPELAN module, with the following structural order: CBS module, GhostConv module, C2f module, GhostConv module, C2f module. The image passes through the CBS module, GhostConv module, C2f module, GhostConv module, and SPPF module. The resulting features of the first size are then fed into the Neck feature fusion module. Features of the first size in the Backbone network module are extracted, and after passing through the GhostConv and C2f modules, features of the second size are generated and fed into the Neck feature fusion module. Features of the second size in the Backbone network module are extracted, and after passing through the GhostConv, C2f, and SPPF modules, features of the third size are generated for Neck feature fusion.

[0013] As a preferred embodiment of the improved lightweight YOLOv8 transmission line foreign object detection method of the present invention, the method of replacing the traditional spatial pyramid pooling structure with the SPPELAN spatial pyramid pooling structure includes: the feature information of the front-layer C2f module enters the SPPELAN spatial pyramid pooling structure module, passes through a CBS module containing Conv, BN, and SILU to obtain the first output feature, passes through Maxpool2d to generate the second feature information, the second feature passes through Maxpool2d to generate the third feature information, the third feature passes through Maxpool2d to generate the fourth feature information, and the four feature information generated are spliced ​​and then passed through a CBS module to output the fused feature information.

[0014] As a preferred embodiment of the improved lightweight YOLOv8 transmission line foreign object detection method of the present invention, the addition of the CBAM module includes adding a CBAM attention mechanism to the Neck feature fusion module of YOLOv8. The feature information obtained by the SPPELAN module in the Backbone network is upsampled by the Upsample module and has the same size as the second type of feature. The two are concatenated and passed through the first C2f module in the Neck network. The resulting feature is upsampled to make its size consistent with the first set of features. The two are concatenated and passed through the second C2f module in the Neck network to obtain the input feature for entering the first Head detection head module. At the same time, after passing through the CBS module, it is concatenated with the feature generated by the first C2f module in the Neck network. After passing through another C2f module, it obtains the input feature for entering the second Head detection head module. The feature is also concatenated and combined with the third type of feature obtained by the Backbone network after passing through the CBS module. After passing through the C2f module, the detection feature is obtained. The CBAM attention module is placed between the third detection head to improve the feature extraction capability.

[0015] The lightweight convolution module GhostConv is used to perform ordinary convolutions, generating simple features with a low number of convolutions. A second set of features is generated using depthwise separable convolutions. The two sets of features are then concatenated to obtain the final convolution result.

[0016] The input feature image has dimensions c, h, and w, representing the number of input channels, the height of the feature, and the width of the feature, respectively. The output feature has height and width h' and w'. The size of the simple convolution kernel is k×k, and the size of the linear convolution kernel is d×d. After s transformations, the computational complexity of the simple convolution and the GhostConv module is compared as follows:

[0017]

[0018] Where, r s This represents the computational cost ratio between the GhostConv module and a regular convolution, where n represents the number of output channels after the first convolution. This represents the number of output channels during the first linear transformation.

[0019] The computational cost of a GhostConv module is the same as that of a regular convolution. There are many convolutional modules in YOLOv8. To reduce the computational cost of the YOLOv8 network and make it lightweight, the GhostConv module is used to replace the ordinary convolutional modules.

[0020] The CBAM attention module used is a lightweight convolutional attention module that combines channel attention and spatial attention. It includes a channel attention module (CAM) and a spatial attention module (SAM). In the channel attention module, global max pooling and global average pooling are performed on each channel. The resulting feature vectors are trained through a shared fully connected layer to obtain the final attention weight vector. After passing through an activation function layer, attention weighting is performed to obtain the final feature result. The spatial attention module performs max pooling and average pooling along the channel dimension. After convolution and connection, spatial attention weights are generated. After passing through an activation function and attention weighting, the final feature information is obtained. The CBAM attention module multiplies the output features of the two modules element-wise to obtain the final enhanced feature information.

[0021] As a preferred embodiment of the improved lightweight YOLOv8 foreign object detection method for power transmission lines described in this invention, the training and verification of the improved lightweight YOLOv8 foreign object detection model includes training using a GPU with 24GB of memory and an RTX3090, setting 500 training rounds, setting the batch size to 16, and setting the initial learning rate to 0.01.

[0022] When evaluating the performance and lightweight design of the improved lightweight YOLOv8 foreign object detection model, the following metrics were used: number of parameters, number of floating-point operations, precision, recall, and mean accuracy.

[0023] The number of parameters includes the total number of parameters in the improved lightweight YOLOv8 foreign object detection model network;

[0024] The number of floating-point operations includes a measure of the algorithmic complexity of the improved lightweight YOLOv8 foreign object detection model network, with GFLOPs representing one billion floating-point operations.

[0025] The precision rate includes the proportion of correctly predicted targets out of all targets predicted by the improved lightweight YOLOv8 foreign object detection model;

[0026] The recall rate includes the proportion of targets correctly predicted by the model out of all real targets when the improved lightweight YOLOv8 foreign object detection model makes predictions.

[0027] The mean accuracy includes a measure of the detection accuracy of the improved lightweight YOLOv8 foreign object detection model.

[0028] Another objective of this invention is to provide a system for improving the lightweight YOLOv8 algorithm for foreign object detection in power transmission lines. The data acquisition and framing module can acquire data from monitoring cameras in real time and perform frame-segmentation processing on the video stream. The system can capture key moments on the power transmission line, providing timely image input for foreign object detection. The lightweight YOLOv8 module, combined with the data augmentation and annotation module, introduces structures such as GhostConv, SPPELAN, and CBAM, which not only reduces the weight of the model but also improves its performance, enabling it to run efficiently on resource-constrained devices while maintaining high detection accuracy. The performance optimization and training module automatically optimizes model parameters using evolutionary programming algorithms, reducing the need for manual parameter tuning, improving model training efficiency and practical application performance, and ensuring that the model can maintain optimal detection results under different conditions. The detection result output module can quickly process the images or videos to be detected and output the detection results, realizing real-time monitoring and early warning of foreign objects such as bird nests, balloons, and kites in transmission lines, providing a timely response mechanism for the safe operation of the power grid. The modular design of the system makes it easy to integrate into existing transmission line monitoring systems, while the lightweight model also reduces the difficulty of system maintenance and upgrades, improving the overall reliability and stability of the system.

[0029] The system of the improved lightweight YOLOv8 transmission line foreign object detection method described in this invention includes a data acquisition and framing module, which acquires images or videos captured by a transmission line monitoring camera and performs frame-segmentation processing on the video to obtain images.

[0030] The data augmentation and annotation module uses cropping, rotation, and noise addition methods to augment the images in the basic dataset, uses labelimg to annotate images containing foreign objects in the dataset, and divides the annotated images into training, testing, and validation sets.

[0031] The YOLOv8 lightweight module uses the GhostConv module to lightweight the YOLOv8 detection model, and introduces the SPPELAN spatial pyramid pooling structure and the CBAM module to optimize network performance.

[0032] The performance optimization and training module uses the partitioned dataset to train and validate the improved lightweight YOLOv8 foreign object detection model.

[0033] The detection result output module takes the image or video to be detected and inputs it into the trained, improved lightweight YOLOv8 model to obtain the detection result.

[0034] A computer device includes a memory and a processor, the memory storing a computer program, characterized in that, when the processor executes the computer program, it implements the steps of any one of the methods in the improved lightweight YOLOv8 transmission line foreign object detection method.

[0035] A computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of any one of the methods in the Improved Lightweight YOLOv8 Transmission Line Foreign Object Detection Method.

[0036] The beneficial effects of this invention are as follows: The modular design of the method system ensures seamless integration into existing power transmission line monitoring systems without requiring large-scale modifications to existing infrastructure, thus lowering the threshold and cost of system upgrades. The lightweight model reduces system complexity and hardware resource requirements, making system maintenance and upgrades easier, extending system lifespan, and reducing long-term operating costs. Through optimized network structure and automated parameter optimization, the system's detection model maintains high accuracy while enhancing its adaptability to changes in the external environment, improving system stability and reliability. The system design emphasizes real-time data processing and rapid response, enabling rapid detection and early warning when foreign objects appear on the transmission line, providing crucial protection for the safe operation of the power grid. The lightweight model has higher computational efficiency, enabling rapid completion of detection tasks with limited computing resources, which is particularly important for resource-constrained field equipment. By expanding and labeling training data, the system improves the model's generalization ability, accurately detecting foreign objects under different weather and lighting conditions, enhancing the system's environmental adaptability. Attached Figure Description

[0037] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a schematic flowchart of an improved lightweight YOLOv8 method for detecting foreign objects in power transmission lines, provided as an embodiment of the present invention.

[0039] Figure 2 This is a network structure diagram of an improved lightweight YOLOv8 method for detecting foreign objects in power transmission lines, provided in an embodiment of the present invention.

[0040] Figure 3 The GhostConv module structure diagram is provided for an embodiment of the improved lightweight YOLOv8 algorithm according to one embodiment of the present invention.

[0041] Figure 4 This is a structural diagram of the SPPELAN spatial pyramid pooling module of the improved lightweight YOLOv8 algorithm provided in one embodiment of the present invention.

[0042] Figure 5 The graph shows the performance metrics of the improved lightweight YOLOv8 algorithm network as a function of iteration, provided in an embodiment of the present invention.

[0043] Figure 6 The image shows the training results of the improved lightweight YOLOv8 algorithm F1_curve, provided in an embodiment of the present invention.

[0044] Figure 7 The image shows the foreign object detection result of the improved lightweight YOLOv8 transmission line foreign object detection method provided in an embodiment of the present invention. Detailed Implementation

[0045] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0046] Example 1

[0047] Reference Figures 1-7 This is the first embodiment of the present invention, which provides an improved lightweight YOLOv8 method for detecting foreign objects in transmission lines, such as... Figure 1 As shown, it includes:

[0048] S1: Collect images or videos of bird nests, balloons, and kites in the power transmission line from the monitoring cameras on the power transmission line, and process the video into frames to obtain images.

[0049] S2: Use cropping, rotation and noise addition methods to augment the images in the base dataset, use labelimg to label the images in the dataset that contain foreign objects, and divide the labeled images into training set, test set and validation set;

[0050] Furthermore, the images in the basic dataset are expanded;

[0051] It should be noted that the image dataset of three types of foreign objects on power transmission lines—bird's nests, balloons, and kites—contains a total of 1190 images, which are divided into training, validation, and test sets in a ratio of 8:1.5:0.5. The training set contains 952 images, the validation set contains 178 images, and the test set contains 60 images.

[0052] S3: Use the GhostConv module to lightweight the YOLOv8 detection model, and introduce the SPPELAN spatial pyramid pooling structure and the CBAM module to optimize network performance.

[0053] It should be noted that a lightweight improvement has been made to the convolutional modules in YOLOv8. The YOLOv8 network consists of three modules: the Backbone feature extraction backbone network module, the Neck feature fusion module, and the Head detection head. Each of these modules contains numerous convolutional and pooling modules. The lightweight convolutional module GhostConv replaces the convolutional modules in the Backbone feature extraction backbone network module. The structure of the GhostConv module is as follows: Figure 3 As shown; the SPPELAN spatial pyramid pooling structure is used to replace the traditional spatial pyramid pooling structure to improve network feature fusion performance. Its structure is as follows: Figure 4 As shown, the CBAM module is added to the Neck feature fusion module in the YOLOv8 detection model to further improve the network feature fusion performance.

[0054] Depend on Figure 2As shown, the YOLOv8 network comprises three modules: a backbone feature extraction module, a neck feature fusion module, and a head detection head. The backbone feature extraction module extracts feature information from the image. Feature information of different sizes is fused in the neck feature fusion module, and then the detection head is used to detect targets of different sizes. The optimized network includes a CBS module, a GhostConv module, a C2f module, and a SPPELAN spatial pyramid pooling structure Concat module. After the image of the transmission line foreign object enters the improved lightweight YOLOv8 network, it sequentially passes through the CBS module. The process involves several modules: GhostConv, C2f, GhostConv, C2f, GhostConv, C2f, and SPPF. After passing through the fifth module, C2f, features of the first size of foreign object are generated and enter the Neck feature fusion module. These features are then further extracted from the Backbone network module. After passing through the GhostConv and C2f modules, features of the second size are generated and enter the Neck feature fusion module. These features are then further extracted from the Backbone network module and processed by the GhostConv and C2f modules. The stConv, C2f, and SPPF modules generate a third type of feature for Neck feature fusion. The lightweight convolutional module, GhostConv, combines traditional neural networks with linear operations, reducing computation through two-step convolution. The SPPELAN spatial pyramid pooling structure improves network feature fusion performance. When foreign object image features enter this module, they first pass through a CBS module containing Conv, BN, and SILU to obtain the first output feature. This feature is then processed by Maxpool2d to generate the second feature. The second feature is then processed by Maxpool2d... A third feature is generated, which is then processed by Maxpool2d to generate a fourth feature. These four features are concatenated and then processed by a CBS module to output fused feature information. After the image passes through the Neck network, three sets of feature information of different sizes are obtained for feature detection. Before the third set of feature information of different sizes generated by the Neck feature fusion module enters the detection process, a CBAM attention mechanism is added. The CBAM attention module used is a lightweight convolutional attention module that combines channel attention and spatial attention. It includes two modules: the channel attention module CAM and the spatial attention module SAM, which can enhance the feature information used for detection.

[0055] S4: Train and validate the improved lightweight YOLOv8 foreign object detection model using the partitioned dataset;

[0056] It should be noted that when training and validating the improved lightweight YOLOv8 foreign object detection model using the pre-divided dataset, the dataset contained 1190 images of three types of objects: bird nests, balloons, and kites. These images were randomly divided into training, validation, and test sets in a ratio of 8:1.5:0.5. The training set contained 952 images, the validation set contained 178 images, and the test set contained 60 images. Training was performed using an RTX 3090 with 24GB of RAM, with 500 training epochs, a batch size of 16, and an initial learning rate of 0.01. The error and other parameter changes during model training iterations are shown in the figure below. Figure 5 As shown, the training results of the improved lightweight YOLOv8 foreign object detection model F1_curve are as follows: Figure 6 As shown; after obtaining the trained improved lightweight YOLOv8 foreign object detection model, a picture to be detected is selected and input into the model. The detection results are as follows. Figure 7 As shown, a bird's nest on a power transmission line was successfully detected. When evaluating the performance and lightweighting of the improved lightweight YOLOv8 foreign object detection model, the following metrics were used: number of parameters, number of floating-point operations (GFLOPs), precision, recall, and mean average precision. After the model was improved and lightweighted, the model file size decreased from 6.3MB to 5.6MB. Table 1 shows a comparison of the metrics between the improved lightweight YOLOv8 foreign object detection model and the original network before optimization. The improved lightweight YOLOv8 foreign object detection model showed a decrease in parameters and GFLOPs, and a reduction in file size from 6.3MB to 5.6MB. Precision and mean average precision were improved, while only recall decreased. Overall, the model's detection performance was improved while reducing the number of network parameters and complexity.

[0057] Table 1 Comparison of indicators before and after YOLOv8 network optimization

[0058]

[0059] S5: Input the image or video to be detected into the trained, improved lightweight YOLOv8 model to obtain the detection results.

[0060] Example 2

[0061] The second embodiment of the present invention differs from the first embodiment in that:

[0062] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0063] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0064] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0065] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0066] Example 3

[0067] This is a third embodiment of the present invention, which provides an improved lightweight YOLOv8 foreign object detection system for power transmission lines, characterized in that it includes a data acquisition and framing module, a data expansion and annotation module, a lightweight YOLOv8 module, a performance optimization and training module, and a detection result output module.

[0068] Data acquisition and framing module: Acquires images or videos of bird nests, balloons and kites in the power transmission line captured by the power transmission line monitoring camera, and performs frame segmentation processing on the video to obtain images;

[0069] Data augmentation and annotation module: The GhostConv module is used to lighten the YOLOv8 detection model, and the SPPELAN spatial pyramid pooling structure and CBAM module are introduced to optimize network performance.

[0070] YOLOv8 Lightweight Module: Trains and validates the improved lightweight YOLOv8 foreign object detection model using a partitioned dataset;

[0071] Performance optimization and training module: The evolutionary programming algorithm is used to optimize the parameters to be identified, and the optimal parameters to be identified are obtained.

[0072] Detection result output module: Input the image or video to be detected into the trained improved lightweight YOLOv8 model to obtain the detection result.

[0073] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. The method for power line foreign matter detection of improved lightweight YOLOv8, characterized in that: include, Collect images or videos captured by monitoring cameras on power transmission lines, and process the videos frame by frame to obtain images; The images in the base dataset are augmented using cropping, rotation, and noise addition methods. The images containing foreign objects in the dataset are labeled using labelimg. The labeled images are then divided into training, testing, and validation sets. The GhostConv module is used to lightweight the YOLOv8 detection model, and the SPPELAN spatial pyramid pooling structure and CBAM module are introduced to optimize network performance. The lightweighting of the YOLOv8 detection model includes lightweighting and improving the convolution module in YOLOv8. The YOLOv8 network includes three modules: the backbone feature extraction module, the Neck feature fusion module, and the Head detection head. Each module contains convolution and pooling modules respectively. Replace the convolutional modules contained in the Backbone feature extraction backbone network module with the lightweight convolutional module GhostConv; Replace the traditional spatial pyramid pooling structure with the SPPELAN spatial pyramid pooling structure; The process of replacing the traditional spatial pyramid pooling structure with the SPPELAN spatial pyramid pooling structure involves the following steps: the feature information from the front-end C2f module enters the SPPELAN spatial pyramid pooling structure module, passes through a CBS module containing Conv, BN, and SILU to obtain the first output feature, passes through Maxpool2d to generate the second feature information, passes through Maxpool2d to generate the third feature information, passes through Maxpool2d to generate the fourth feature information, and the four feature information are concatenated and then passed through a CBS module to output the fused feature information. In the Neck feature fusion module of the YOLOv8 detection model, the CBAM module is added to further improve the network feature fusion performance; The addition of the CBAM module includes adding a CBAM attention mechanism to the Neck feature fusion module of YOLOv8. The feature information obtained by the SPPELAN module in the backbone network is upsampled by the Upsample module and has the same size as the second type of feature. After concatenation, it is passed through the first C2f module in the Neck network. The resulting feature is upsampled to make its size consistent with the first set of features. After concatenation, it is passed through the second C2f module in the Neck network to obtain the input feature for entering the first Head detection module. At the same time, after passing through the CBS module, it is concatenated with the feature generated by the first C2f module in the Neck network. After passing through another C2f module, it obtains the input feature for entering the second Head detection module. The features are simultaneously processed by the CBS module and combined with the third feature obtained from the Backbone network. The combined features are then processed by the C2f module to obtain the detection features. The CBAM attention module is placed between the third detection head to improve the feature extraction capability. The lightweight convolution module GhostConv is used to perform ordinary convolutions, generating simple features with a low number of convolutions. A second set of features is generated using depthwise separable convolutions. The two sets of features are then concatenated to obtain the final convolution result. Input feature image size , , , where are the number of input channels, the height of the feature, and the width of the feature, respectively; and the height and width of the output feature are . , The size of a simple convolution kernel is The kernel size for linear convolution is ,go through The computational complexity comparison between ordinary convolution and the GhostConv module after the transformation is shown as follows: ; in, This represents the ratio of computational cost between the GhostConv module and ordinary convolution, where n represents the number of output channels after the first convolution. This represents the output channel during the first linear transformation. The computational cost of the GhostConv module is comparable to that of a regular volume. Replace the regular convolution module with the GhostConv module; The CBAM attention module used is a lightweight convolutional attention module that combines channel attention and spatial attention. It includes a channel attention module (CAM) and a spatial attention module (SAM). In the channel attention module, global max pooling and global average pooling are performed on each channel. The resulting feature vectors are trained through a shared fully connected layer to obtain the final attention weight vector. After passing through an activation function layer, attention weighting is performed to obtain the final feature result. The spatial attention module performs max pooling and average pooling operations along the channel dimension, generates spatial attention weights through convolution and connection, and obtains the final feature information after activation function and attention weighting. The CBAM attention module multiplies the output features of the two modules element by element to obtain the final enhanced feature information. The improved lightweight YOLOv8 foreign object detection model was trained and validated using the partitioned dataset. The detection results are obtained by inputting the image or video to be detected into the trained, improved, lightweight YOLOv8 model.

2. The improved lightweight YOLOv8 method for detecting foreign objects in transmission lines according to claim 1, characterized in that: The photos or videos mentioned include bird nests, balloons, and kites in power transmission lines.

3. The improved lightweight YOLOv8 method for detecting foreign objects in transmission lines as described in claim 2, characterized in that: The lightweight improvement of convolutional modules in YOLOv8 includes improving the YOLOv8 backbone network module using GhostConv modules. The ordinary convolutional Conv modules in modules 2, 4, 6, and 8 of the backbone feature extraction network module are replaced with GhostConv modules. The improved network module includes Conv modules, GhostConv modules, C2f modules, and SPPELAN modules, with the following structural order: CBS module, GhostConv module, C2f module, GhostConv module, C2f module, GhostConv module, C2f module, GhostConv module, C2f module, GhostConv module, C2f module, GhostConv module, C2f module, GhostConv module. The image passes through the CBS module, GhostConv module, C2f module, and SPPF module. After passing through these modules, the first size of features is generated and enters the Neck feature fusion module. The Backbone network module then further extracts these first-sized features. After passing through the GhostConv and C2f modules, the second-sized features are generated and enter the Neck feature fusion module. The Backbone network module further extracts these second-sized features. After passing through the GhostConv, C2f, and SPPF modules, a third-sized feature is generated for Neck feature fusion.

4. The improved lightweight YOLOv8 method for detecting foreign objects in transmission lines as described in claim 3, characterized in that: The training and validation of the improved lightweight YOLOv8 foreign object detection model includes using the number of parameters, number of floating-point operations, precision, recall, and average accuracy as metrics when evaluating the performance and lightweight nature of the improved lightweight YOLOv8 foreign object detection model. The number of parameters includes the number of parameters in the improved lightweight YOLOv8 foreign object detection model network; The number of floating-point operations includes the algorithmic complexity of the improved lightweight YOLOv8 foreign object detection model network, with GFLOPs being one billion floating-point operations. The precision rate includes the percentage of correctly predicted targets out of all targets predicted by the improved lightweight YOLOv8 foreign object detection model; The recall rate includes the proportion of targets correctly predicted by the model out of all real targets when the improved lightweight YOLOv8 foreign object detection model makes predictions. The mean accuracy includes a measure of the detection accuracy of the improved lightweight YOLOv8 foreign object detection model.

5. A system for detecting foreign objects in transmission lines based on the improved lightweight YOLOv8 according to any one of claims 1-4, characterized in that: It includes a data acquisition and framing module, a data augmentation and annotation module, a YOLOv8 lightweight module, a performance optimization and training module, and a detection result output module; The data acquisition and framing module acquires images or videos captured by the power transmission line monitoring camera, and performs frame-segmentation processing on the video to obtain images. The data augmentation and annotation module uses cropping, rotation, and noise addition methods to augment the images in the basic dataset, uses labelimg to annotate the images in the dataset that contain foreign objects, and divides the annotated images into training set, test set, and validation set. The YOLOv8 lightweight module uses the GhostConv module to lightweight the YOLOv8 detection model, and introduces the SPPELAN spatial pyramid pooling structure and the CBAM module to optimize network performance. The performance optimization and training module uses the partitioned dataset to train and validate the improved lightweight YOLOv8 foreign object detection model. The detection result output module inputs the image or video to be detected into the trained, improved lightweight YOLOv8 model to obtain the detection result.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Power transmission line nest detection method in complex environment based on improved yolox algorithm

    CN115861853A

  • Lightweight vehicle and pedestrian detection method based on improved YOLOv8n

    CN117746385A