Foreign object detection method and device for power transmission line, and medium
By introducing deformable convolutional residual modules, lightweight feature fusion networks, and parameter-free attention mechanisms into the YOLOv8n model, the problems of insufficient accuracy and excessive computation in foreign object detection of transmission lines are solved, achieving high-precision and low-computation foreign object target detection.
Patent Information
- Application Number
- CN202410972943.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2026-01-20
AI Technical Summary
Existing foreign object detection methods for power transmission lines lack sufficient accuracy in complex environments, and the increased number of model parameters or computational load makes it difficult to meet the requirements of real-time performance and high accuracy. In particular, there are false detections and missed detections for foreign objects with large deformation.
The DLS-YOLOv8n model is adopted. By replacing the Bottleneck structure of the backbone network with deformable convolutional residual modules, and combining the lightweight feature fusion network LBiFPN and the parameterless attention mechanism SimAM, the model's feature extraction capability and detection accuracy for deformable targets are improved, while reducing the computational cost.
It improves the detection accuracy of foreign objects in complex scenarios of power transmission lines, reduces the computational load and number of parameters of the model, making it suitable for deployment in resource-constrained terminal equipment, and demonstrates excellent detection performance in images captured by drones in actual field.
Smart Images

Figure CN121366337A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of foreign object detection of power transmission lines, and in particular to a foreign object detection method and device for power transmission lines based on a DLS-YOLOv8n model and a medium. BACKGROUND
[0002] With the rapid development of the power system and the acceleration of urbanization, power transmission lines, as a key component of the power system, bear the important task of power transmission from power plants to users. However, to maintain the stable operation of the power system, it is essential to ensure the safety of the power transmission line. Due to human and bird activities, bird nests, kites, balloons, garbage bags and other foreign objects may be suspended on the power transmission line or the tower. These objects may cause short circuits, fires, damage to power equipment and even power system collapse, which seriously affects the safety and reliable operation of the power system. Therefore, timely detection and accurate identification of foreign objects on the power transmission line are crucial to maintaining the safety and reliability of the power system. At present, although the traditional manual inspection method can monitor the power transmission line to a certain extent, it has the limitations of low work efficiency, high missed detection rate and dependence on manpower. Therefore, the automatic detection of foreign objects on the power transmission line has attracted widespread attention.
[0003] There are two types of foreign matter detection methods based on machine vision at present. One type is the traditional machine learning method, which needs image preprocessing and complex feature definition, extraction, and screening processes. Although these methods can achieve satisfactory detection results for images with simple backgrounds, the detection accuracy of the model is poor for foreign matters in complex environments, which cannot meet the requirements of actual situations. The second type of method is based on deep learning, including one-stage detection algorithm and two-stage detection algorithm. The two-stage detection algorithm mainly includes RCNN, Fast-RCNN, and Faster-RCNN, which first needs to generate a large number of candidate regions and then identifies the candidate regions, so there is a slow detection speed, and the algorithm is too complex to meet the real-time requirements of power line foreign matter detection. The one-stage detection algorithm is more efficient and faster than the two-stage algorithm, mainly including SSD algorithm, RetinaNet algorithm, and YOLO series algorithm. In the aspect of power line foreign matter detection, some documents first expand the data set through Poisson fusion and some data enhancement methods based on YOLOv4, and then add CBAM attention mechanism to improve the recognition accuracy of the model. Some other documents introduce CBAM based on YOLOv5s and construct a C3TR layer based on the Transformer architecture to improve the detection accuracy of the model, but this improvement will increase the complexity of the model and increase the parameter quantity. Some other documents increase the branch in the feature fusion network of YOLOv7 to improve the detection accuracy of small targets and increase two different attention mechanisms to improve the attention ability to foreign matter targets, but at the same time, the calculation complexity of the model is increased. Based on the above improvement strategies, it can be concluded that the power line foreign matter detection mainly has the following problems. First, in order to improve the detection accuracy, some improvements will lead to an increase in model parameter quantity or calculation quantity. Second, the above methods rarely consider the case that the foreign matter will be deformed, and there are still false detection and missed detection phenomena for the foreign matter with large deformation. SUMMARY
[0004] The purpose of the present application is to provide a power line foreign matter target detection method, device and medium based on DLS-YOLOv8n model, which adds deformable convolution residual module, lightweight feature fusion network and parameter-free attention mechanism on the basis of the original YOLOv8n, improves the detection accuracy of foreign matter targets in complex scenes of power lines, and reduces the model calculation amount.
[0005] The purpose of the present application can be realized by the following technical solutions:
[0006] A power line foreign matter target detection method based on DLS-YOLOv8n model, comprising the following steps:
[0007] S1, a DLS-YOLOv8n model is constructed, the DLS-YOLOv8n model is based on a YOLOv8n model, a deformable convolution residual module is used to replace a Bottleneck structure in a C2f module of a backbone network of the YOLOv8n model, a lightweight feature fusion network LBiFPN is used to replace a neck network of the YOLOv8n model, and a parameter-free attention mechanism SimAM is added before a model detection head;
[0008] S2, an image of a foreign object on a power transmission line is acquired and labeled, and a data set is constructed;
[0009] S3, a deep learning environment is configured, and parameters of the DLS-YOLOv8n model are set;
[0010] S4, a data set of foreign object detection on a power transmission line is input into the DLS-YOLOv8n model for training and testing;
[0011] S5, the DLS-YOLOv8n model trained is used to identify images of foreign objects on a power transmission line.
[0012] The deformable convolution residual module uses a DCNv2 to replace a standard convolution in a C2f module Bottleneck in an original YOLOv8n model backbone. DCN is a kind of variant convolution operation in a convolutional neural network, which adaptively learns an offset of each sampling point on the basis of a standard convolution, and can dynamically adjust the position of the sampling point in the convolution process, so that the shape of the convolution kernel is closer to the target foreign object, and the adaptive feature extraction capability of the model on the deformable target is enhanced.
[0013] The output feature of the standard 3*3 convolution is as follows:
[0014]
[0015] Wherein, x and y are input and output feature maps of C*H*W dimensions respectively, R is a 3*3 convolution kernel, p0 represents a center sampling point of the output feature map, p n represents an offset of p0 within the range of the convolution kernel, and w(p n ) represents a weight value at p n .
[0016] DCN introduces a learnable offset {Δp n |n=1,...,N} for each point on the basis of the standard convolution, N represents the area of the convolution kernel, and the output feature of the DCN is as follows:
[0017]
[0018] DCNv2 is to solve the problem of introducing too much irrelevant information in DCN, and adds the weight modulation parameter of each point Δm in DCN n , so as to reduce irrelevant interference information, and the output characteristics of DCNv2 are as follows:
[0019]
[0020] Bi-directional Feature Pyramid Network (BiFPN) adopts cross-scale connection and feature weighting, which can fuse more target features without increasing too much computing cost. When fusing feature maps from different scales of the backbone network, the common method is to adjust the resolution to the same resolution and then add (Sum) or stack channels (Concat). These methods treat different scale features equally, but the contribution of input features of different scales to output features is usually different. To solve this problem, BiFPN fuses features of different scales by using fast normalization, which is defined as follows:
[0021]
[0022] where W i represents the learned weight, and is guaranteed to be W i > 0 through the ReLU activation function, I i represents features of different scales, and ε is a constant with a value of 1e-4 to prevent numerical instability.
[0023] LBiFPN (Light Bi-directional Feature Pyramid Network, LBiFPN) is a new feature fusion network designed based on the idea of Bi-FPN. First, the feature maps of each scale of the backbone network are adjusted to the same number of channels through convolution operation to facilitate subsequent feature fusion and reduce the parameter amount of the model. At the same time, in order to enhance the detection performance of small target foreign objects, the feature map with a size of 160x160 pixels in the backbone network is fused into the LBiFPN neck network after downsampling, and the multi-scale features are fused by using fast normalization, which effectively improves the recognition accuracy of small target foreign objects in the power transmission line scene while reducing the parameter amount of the model.
[0024] The SimAM calculates the minimum energy of each neuron through a self-defined minimum energy function. The lower the minimum energy, the greater the gap between the current neuron and the surrounding neurons, and the more important the neuron is. Therefore, each neuron can be assigned its own attention weight, which can more accurately distinguish foreground and background features. The minimum energy function of each neuron in SimAM is defined as:
[0025]
[0026] where H and W represent the height and width of the input feature map, M is the number of neurons on each channel, X represents the input feature map, and t represents the target neuron for which the minimum energy is to be calculated (t e X), and represent the mean and variance of the neurons in a single channel, λ represents the regularization term (with a value of 1e-4), and E represents the minimum energy of the target neuron. The lower the energy of neuron t, the greater the difference between t and the surrounding neurons, i.e., the greater the importance of the current neuron. Therefore, the importance of each neuron can be represented by 1 / E. The output features of the SimAM attention mechanism can be represented as follows:
[0027]
[0028] where X and Y represent the input and output feature maps, respectively, represents the dot product operation, and the Sigmoid activation function converts the value of 1 / E into an attention weight value between 0 and 1. Finally, the input feature map is multiplied by the weight of each neuron to obtain the output feature map after attention correction.
[0029] By adding three SimAM modules before the detection head of the YOLOv8n model, the background features are effectively suppressed without increasing the parameter quantity, the importance of the target features is improved, and the detection accuracy of the model is improved.
[0030] The step S2 specifically comprises: selecting bird nests, kites, balloons and garbage bags as four types of foreign matters from the foreign matter images of the power transmission line, and performing data labeling to construct a foreign matter detection data set of the power transmission line.
[0031] The step S3 specifically comprises: configuring a deep learning environment and setting parameters of the DLS-YOLOv8n model. The operating system is Windows 10 64-bit, the processor is Intel(R) Core(TM) i5-13600KF, the graphics card is NVIDIA GeForce RTX4070, the RAM size is 32G, the experimental Python version is 3.9, the CUDA version is 11.7, the deep learning framework is PyTorch 2.0.1, the training period (epochs) is set to 100, the batch size is 32, the stochastic gradient descent (SGD) optimizer is used, and the initial learning rate is 0.01.
[0032] In the step S4, the average precision mean and the computational complexity and parameter quantity of the model are used as evaluation indexes when the DLS-YOLOv8n model is tested.
[0033] The calculation method of the average precision mean value is:
[0034]
[0035] Wherein R is the recall rate, P is the precision, TP is the number of predicted correct positive samples, FN is the number of predicted incorrect negative samples, FP is the number of predicted incorrect positive samples, AP is the area of the precision-recall curve, and N is the number of detection categories.
[0036] A power transmission line foreign object target detection device based on a DLS-YOLOv8n model, comprising a memory, a processor, and a program stored in the memory, and the processor executes the program to realize the method as described above.
[0037] A storage medium having a program stored thereon, the program being executed to realize the method as described above.
[0038] Compared with the prior art, the present application has the following beneficial effects:
[0039] (1) The present application uses DCNv2 to replace the standard convolution in the bottleneck, which enhances the feature extraction capability of the model for shape-changing foreign object targets, thereby improving the detection accuracy of the model.
[0040] (2) The present application uses LBiFPN network, which uses 1x1 convolution to reduce the channel number of different scale feature maps and increases the small target branch based on BiFPN. Experiments show that LBiFPN adopts the fast normalization fusion mode to achieve the best detection performance, which not only significantly reduces the model parameter quantity, but also improves the detection accuracy of foreign objects.
[0041] (3) The present application uses SimAM attention, which can calculate three-dimensional attention weight without introducing any additional parameters, and is suitable for adding in lightweight detection models to improve the attention to targets.
[0042] (4) Compared with other classic one-stage target detection algorithms, the model parameter quantity and calculation quantity of the present application are the lowest, which is beneficial to deployment in resource-limited terminal devices. At the same time, the detection accuracy of the present application for complex environment and shape-changing foreign object targets is higher, and the detection effect of the present application for pictures taken by unmanned aerial vehicles in actual field is also better than that of the original algorithm. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 The flowchart of the method of the present application is shown in the figure;
[0044] Figure 2 The deformable convolution principle diagram in one embodiment of the present application is shown in the figure;
[0045] Figure 3A Bottleneck module and a DCN-Bottleneck module structural schematic diagram in an embodiment of the present application;
[0046] Figure 4 A different feature fusion network structural diagram in an embodiment of the present application;
[0047] Figure 5 A comparison diagram of different attention mechanisms in an embodiment of the present application;
[0048] Figure 6 A DLS-YOLOv8n network structural diagram in an embodiment of the present application;
[0049] Figure 7 A foreign matter identification result diagram of a power transmission line in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present application, and gives a detailed implementation manner and specific operation process, but the protection scope of the present application is not limited to the following embodiments.
[0051] Embodiment 1
[0052] As shown in the following Figure 1 , the present embodiment provides a power transmission line foreign matter target detection method based on a DLS-YOLOv8n model, which comprises the following steps:
[0053] S1, constructing a DLS-YOLOv8n model.
[0054] The DLS-YOLOv8n model constructed by the present application is based on a YOLOv8n model, uses a deformable convolution residual module to replace the Bottleneck structure in the C2f module of the main network of the YOLOv8n model, and proposes a lightweight feature fusion network LBiFPN to replace the original model neck network, in addition, a parameter-free attention mechanism SimAM is added before the model detection head, which improves the recognition accuracy of the model and reduces the calculation amount of the model.
[0055] DCN is a kind of variant convolution operation in convolutional neural network, which can dynamically adjust the position of sampling points in the convolution process by adaptively learning the offset of each sampling point on the basis of standard convolution, so that the shape of the convolution kernel is closer to the target foreign matter, and the adaptive feature extraction ability of the model to the deformable target is enhanced, and its structure is as shown in Figure 2 .
[0056] The output features of the standard 3x3 convolution are as follows:
[0057]
[0058] where x and y are the input and output feature maps of CxHxW dimensions, R is a 3x3 convolution kernel, p0 represents the center sampling point of the output feature map, p n represents the offset of p0 within the convolution kernel, w(p n ) represents the weight value at p n .
[0059] DCN introduces a learnable offset {Ap n |n=1,...,N} for each point on the basis of standard convolution, N represents the area of the convolution kernel, and the DCN output feature is as follows:
[0060]
[0061] DCNv2 adds a weight modulation parameter Am n to each point on the basis of DCN to reduce irrelevant interference information, and the DCNv2 output feature is as follows:
[0062]
[0063] The application uses DCNv2 to replace the C2f module in the original YOLOv8n model backbone. Specifically, the standard convolution in the Bottleneck is replaced by DCNv2, and the comparison before and after the replacement is as shown in Figure 3 .
[0064] Bi-directional Feature Pyramid Network (BiFPN) adopts cross-scale connection and feature weighting, as shown in Figure 4 (a), which can fuse more target features without increasing too much computing cost. Figure 4 The structure in (b) is a common use of the BiFPN algorithm in the YOLO series model, that is, a skip connection is added in the P4 layer. When fusing feature maps from different scales of the backbone network, the common practice is to adjust to the same resolution and then add (Sum) or channel stack (Concat). These methods treat different scale features equally, but the contributions of different scale input features to the output features are usually different. To solve this problem, BiFPN fuses features of different scales in a fast normalization manner, which is defined as follows:
[0065]
[0066] where W iW represents the learned weights, and is passed through a ReLU activation function to ensure W i > 0, I i represents the features of different scales, and ε is a constant with a value of 1e-4 to prevent numerical instability.
[0067] LBiFPN (Light Bi-directional Feature Pyramid Network, LBiFPN) is a new feature fusion network designed based on the Bi-FPN idea, and the structure is as shown in Figure 4 (c). First, the feature maps of each scale of the backbone network are adjusted to the same number of channels through convolution operation, which facilitates subsequent feature fusion and reduces the parameter amount of the model. At the same time, in order to enhance the detection performance of small target foreign objects, the feature map with a size of 160x160 pixels in the backbone network is fused into the LBiFPN neck network after downsampling, and the multi-scale features are fused in a fast normalization manner, which effectively improves the recognition accuracy of small target foreign objects in the power transmission line scene under the premise of reducing the parameter amount of the model.
[0068] In order to better accurately capture the foreign object target from the complex background of the power transmission line, the present application increases the attention mechanism before the detection head of the YOLOv8n model to improve the attention of the model to the target. The attention mechanism in the convolutional neural network learns from the attention thinking way of human visual vision, and highlights the more important area by giving different weights to the input features, and suppresses the interference of complex background to the foreign object detection. The traditional attention mechanism includes channel, spatial and mixed attention mechanisms. As shown in Figure 5 (a), a typical channel attention mechanism such as ECA compresses a feature map of one channel into a weight coefficient through global average pooling operation. Channel attention treats different channels differently and treats all spatial positions equally, which is a one-dimensional attention mechanism. Spatial attention mechanism is a two-dimensional attention, as shown in Figure 5 (b), that is, differentiating different spatial positions and treating all channels equally. The mixed attention mechanism is to combine the channel and spatial attention through series or parallel connection, for example, CBAM is a spatial attention mechanism composed of a large kernel convolution after the channel attention mechanism, which focuses on the channel and spatial information in turn.
[0069] However, the traditional attention mechanism has two shortcomings. On the one hand, the attention mechanism mainly weights the channels or spaces of the features, but these two mechanisms should work together to select information in the visual processing process, rather than simply calculating in turn or independently, so the above attention mechanisms are difficult to effectively calculate the three-dimensional attention weight. On the other hand, the algorithm for calculating the three-dimensional attention weight is mostly hand-designed, which consumes a lot of computing power and has certain limitations when added to a lightweight model.
[0070] According to the summary and thinking described above, in the lightweight foreign matter detection model, the calculation of three-dimensional attention should be simple and direct, and the model should continue to be lightweight, therefore, the attention mechanism selected by the present application is a parameter-free attention SimAM, and the structure thereof is as shown in Figure 5 (c). Classical visual neuroscience theory believes that active neurons with rich information usually exhibit different discharge patterns from surrounding neurons, and will inhibit the activity of surrounding neurons, and should be given higher importance.
[0071] SimAM calculates the minimum energy of each neuron through a self-defined minimum energy function. The lower the minimum energy, the greater the difference between the current neuron and the surrounding neurons, and the higher the importance. Therefore, each neuron can be assigned its own attention weight, which can more accurately distinguish foreground and background features. The minimum energy function of each neuron in SimAM is defined as:
[0072]
[0073] wherein H and W represent the height and width of the input feature map, M represents the number of neurons on each channel, X represents the input feature map, t represents the target neuron to be calculated (t e X), and represent the mean and variance of the neurons on a single channel, λ represents a regularization term (value is 1e-4), and E represents the minimum energy of the target neuron. When the energy of neuron t is lower, the difference between t and the surrounding neurons is greater, that is, the importance of the current neuron is greater, and therefore the importance of each neuron can be represented by 1 / E. The output feature of the SimAM attention mechanism can be represented as follows:
[0074]
[0075] wherein X and Y represent the input and output feature maps respectively, represents dot product operation, and the Sigmoid activation function converts the value of 1 / E into an attention weight between [0, 1]. Finally, the input feature map is multiplied by the weight of each neuron to obtain the output feature map after attention correction.
[0076] Figure 6 Fig. 1 is a schematic diagram of the overall structure of the DLS-YOLOv8n model of the present application.
[0077] S2, acquire the foreign matter image of the power transmission line and label it, construct a data set, and divide the data set into a training set, a validation set and a test set according to a ratio of 8:1:1.
[0078] Specifically, four types of foreign objects, i.e., bird nests, kites, balloons and garbage bags, are screened out from the foreign object images of the power transmission line, and data labeling is performed, so as to finally obtain 3613 training sets, 452 verification sets and 452 test sets.
[0079] S3, configure a deep learning environment and set the DLS-YOLOv8n model parameters.
[0080] In this embodiment, the operating system used in the experiment is Windows 10 64-bit, the processor is Intel(R) Core(TM) i5-13600KF, the graphics card is NVIDIA GeForce RTX 4070, the RAM size is 32G, the Python version used in the experiment is 3.9, the CUDA version is 11.7, the deep learning framework is PyTorch 2.0.1, the training period (epochs) is set to 100, the batch size is 32, the stochastic gradient descent (SGD) optimizer is used, and the initial learning rate is 0.01.
[0081] S4, input the foreign object image training set of the power transmission line into the DLS-YOLOv8n model for training, verify the training process by using the verification set, and test the trained model by using the test set.
[0082] In this embodiment, the average precision mean value and the calculation amount and parameter amount of the model are used as evaluation indexes.
[0083] The calculation method of the average precision mean value is as follows:
[0084]
[0085] Wherein, R is the recall rate, P is the precision, TP is the number of correctly predicted positive samples, FN is the number of incorrectly predicted negative samples, FP is the number of incorrectly predicted positive samples, AP is the area of the precision-recall curve, and N is the number of detection categories.
[0086] S5, the trained DLS-YOLOv8n model is used to identify the foreign object images of the power transmission line.
[0087] The deformable convolution residual module, the lightweight feature fusion network and the parameter-free attention mechanism are added on the basis of the original YOLOv8n, so as to improve the detection accuracy of the foreign object target in the complex scene of the power transmission line, and the calculation amount of the DLS-YOLOv8n model is also lower than that of the YOLOv8n.
[0088] Figure 7It is a detection result diagram obtained by using the method of the application in an embodiment. In this embodiment, the trained DLS-YOLOv8n model is evaluated, and it is found that the mAP of the application on the power line foreign object detection dataset reaches 97.1%, the calculation amount is 6.9 GFLOPs, and the model size is 2.07 MB, which meets the requirements of high precision and low calculation amount for power line foreign object detection.
[0089] Embodiment 2
[0090] The embodiment provides a power line foreign object target detection method and device based on a DLS-YOLOv8n model and a medium, which include a memory, a processor, and a program stored in the memory, and the processor implements the method of the above-mentioned embodiment 1 when executing the program.
[0091] In a preferred embodiment, the device comprises:
[0092] The model construction module is configured to construct a DLS-YOLOv8n model, wherein the DLS-YOLOv8n model uses DCNv2 to replace standard convolution in a Bottleneck for a C2f module in a YOLOv8n model backbone network, and enhances the feature extraction capability for foreign objects prone to deformation. The number of repeated residual structures in the four C2f-DCN modules in the backbone network is consistent with that of YOLOv8n, and is 1, 2, 2, and 1 respectively. Secondly, the neck network of the DLS-YOLOv8n model is an LBiFPN module proposed by the application, which uses standard convolution to unify the channel number, facilitates subsequent feature fusion, and at the same time can reduce the parameter amount and calculation amount of the model, which is conducive to better deployment of the model on resource-limited terminal devices. On the other hand, the LBiFPN module puts the feature map with a scale of 160x160 pixels in the backbone network into the neck network for fusion, improving the detection performance of the model on small targets. Finally, a SimAM attention mechanism is added before each detection head of the YOLOv8n network to improve the attention of the model to foreign object targets in a complex background.
[0093] The dataset construction module is configured to construct a dataset, which is a power line foreign object detection dataset, and the dataset includes 4517 images, including four types of foreign objects, i.e., bird nests, kites, balloons, and garbage bags, and is divided into a training set, a validation set, and a test set according to a ratio of 8:1:1.
[0094] The environment and parameter configuration module is configured to configure a deep learning environment and set parameters of the DLS-YOLOv8n model.
[0095] The model training and testing module is configured to input the power line foreign object detection dataset into the DLS-YOLOv8n model for training and testing.
[0096] The recognition module is configured to recognize the foreign matter image of the power transmission line by using the trained DLS-YOLOv8n model.
[0097] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described modules can refer to the corresponding process in the foregoing method embodiments, and will not be described here.
[0098] Embodiment 3
[0099] The embodiment provides a storage medium, which has a program stored thereon, and the program is executed to implement the method in the foregoing embodiment 1.
[0100] The storage medium includes permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition in the present application, the computer readable medium does not include transitory computer readable media, such as modulated data signals and carriers.
[0101] The preferred embodiments of the present application are described in detail above. It should be understood that those skilled in the art can make many modifications and changes to the present application without creative labor, according to the concept of the present application. Therefore, any technical solution obtained by logical analysis, reasoning or limited experiment on the basis of the prior art according to the concept of the present application shall be within the protection scope determined by the claims.
Claims
1. A power transmission line foreign object target detection method based on a DLS-YOLOv8n model, characterized in that, The method comprises the following steps: S1, constructing a DLS-YOLOv8n model, wherein the DLS-YOLOv8n model is based on a YOLOv8n model, uses a deformable convolution residual module to replace a Bottleneck structure in a C2f module of a backbone network of the YOLOv8n model, and uses a lightweight feature fusion network LBiFPN to replace a neck network of the YOLOv8n model, and adds a parameter-free attention mechanism SimAM before a model detection head; S2, acquiring a foreign matter image of a power transmission line and labeling, and constructing a data set; S3, configuring a deep learning environment, and setting parameters of the DLS-YOLOv8n model; S4, inputting a foreign matter detection data set of the power transmission line into the DLS-YOLOv8n model for training and testing; S5, using the trained DLS-YOLOv8n model to recognize the foreign matter image of the power transmission line.
2. The method according to claim 1, wherein the method is characterized in that, The deformable convolution residual module C2f-DCN uses a DCNv2 to replace a standard convolution in a C2f module Bottleneck in an original YOLOv8n model backbone.
3. The method according to claim 2, wherein the method is characterized in that, The DCNv2 adds a weight modulation parameter Am of each point on the basis of the DCN n , reduces irrelevant interference information, and the output feature of the DCNv2 is shown in the following formula: where x and y are input and output feature maps of CxHxW dimensions, R is a 3x3 convolution kernel, p0 represents the center sampling point of the output feature map, p n represents the offset of p0 within the range of the convolution kernel, w(p n ) represents the weight value at p n , and {Ap n | n = 1,..., N} is a learnable offset, and N represents the area of the convolution kernel.
4. The method according to claim 1, wherein the method is characterized in that, The lightweight feature fusion network LBiFPN adjusts each scale feature map of the backbone network to the same channel number through convolution operation, and in order to enhance the detection performance of small target foreign matters, a feature map with a size of 160*160 pixels in the backbone network is fused into the LBiFPN neck network after down sampling, and a fast normalization method is used to fuse multi-scale features, and the definition is as shown in the formula: where W i represents the learned weights and is guaranteed to be non-negative by the ReLU activation function i > 0, I i denotes features of different scales, and ε is a constant.
5. The method of claim 1, wherein the method is based on a DLS-YOLOv8n model. The parameter-free attention mechanism SimAM calculates the minimum energy of each neuron through a self-defined minimum energy function, and the lower the minimum energy, the greater the gap between the current neuron and the surrounding neurons, and the higher the importance, and based on this, each neuron is allocated with its own attention weight.
6. The method according to claim 5, wherein the method is characterized in that, The minimum energy function is defined as: where M is the number of neurons on each channel, X represents the input feature map, t represents the target neuron (t∈X) for which the minimum energy is to be calculated, With represents the mean and variance of neurons on a single channel, λ represents the regularization term, and E represents the minimum energy of the target neuron.
7. The method according to claim 6, wherein the method is characterized in that, 1 / E represents the importance of each neuron, and the output feature of the SimAM attention mechanism is represented as: Wherein, X and Y represent input and output feature maps respectively, and the point product operation is represented by ⊙, the Sigmoid activation function converts the value of 1 / E into an attention weight between 0 and 1; the input feature map is multiplied by the weight of each neuron to obtain the output feature map after attention correction.
8. The method according to claim 1, wherein the method is characterized in that, In the step S4, the DLS-YOLOv8n model uses the mean value of the average precision, the calculation amount and the parameter amount of the model as evaluation indexes when testing.
9. A power transmission line foreign object target detection device based on a DLS-YOLOv8n model, comprising a memory, a processor, and a program stored in the memory, characterized in that, The processor implements the method of any one of claims 1-8 when executing the program.
10. A storage medium having stored thereon a program, characterized by The program is executed to implement the method of any one of claims 1-8.