Power field operation specification detection method based on improved YOLOv8 algorithm
By improving the YOLOv8 algorithm, combining the EMA attention mechanism and BiFPN feature fusion, optimizing feature extraction and image processing, the problem of low detection accuracy of power field operation specifications is solved, achieving higher detection accuracy and efficiency, and meeting the safety of the power system. Risk management and control needs.
Patent Information
- Application Number
- CN202410865750.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-01
AI Technical Summary
The accuracy of power on-site work specification detection is not high, making it difficult to detect and deal with potential safety hazards in a timely manner, and there is a risk of negligent operation and equipment damage.
Using the improved YOLOv8 algorithm, through technical means such as EMA attention mechanism, partial convolution PConv and channel prior convolution attention, we build a new C2F module and BiFPN feature fusion method, optimize feature extraction and image processing, and improve detection accuracy and efficiency. .
It effectively improves the accuracy of power field operation specification detection, realizes the lightweight and performance balance of the detection model, and meets the management and control needs of power system on-site safety risks.
Smart Images

Figure CN118736307A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power field operation specification detection, and specifically is a power field operation specification detection method based on an improved YOLOv8 algorithm. Background Art
[0002] The power production operation environment is extremely complex. A large number of live equipment threatens the personal safety of workers in the power industry. Improper operation by workers can also cause great losses to expensive power equipment or even damage power equipment. Therefore, workers must strictly abide by operational safety regulations.
[0003] During the power production operation, the movement trajectory and work behavior of the operators are difficult to control. Many operators forget to wear safety helmets, insulating clothing or safety belts due to negligence, or have some wrong postures and movements during work. If these problems are not supervised and handled in time, they will cause serious safety accidents. Therefore, it is very important to track the movement of operators, monitor safety, detect the movement of the operation process, especially the abnormal behavior identification, wear safety items and track the trajectory. Identify the work actions of operators, detect and track operators, realize the detection of the wearing of safety items, tracking of operation trajectories, and identification of dangerous work behaviors of workers in the operation scene, which can better regulate the work attitude of operators, timely discover and eliminate safety hazards in the power operation scene, and further develop intelligent management in the power operation scene. Summary of the invention
[0004] The purpose of the present invention is to provide a method for detecting power field operation specifications based on an improved YOLOv8 algorithm to solve the problem of low accuracy in detecting power field operation specifications.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is: a method for detecting power field operation specifications based on an improved YOLOv8 algorithm, comprising:
[0006] Step 1: Obtain a public dataset, pre-process the power site images, and use the same data to set and adjust the parameters of the YOLOv8 network;
[0007] Step 2: In the backbone network of the YOLOv8 network, a new C2F module is constructed through the EMA attention mechanism and partial convolution PConv to optimize the efficiency of feature extraction and image processing;
[0008] Step 3: In the backbone network of the YOLOv8 network, the performance of the SPPF (Spatial Pyramid Pooling-Fast) module is further improved and optimized by introducing channel prior convolutional attention;
[0009] Step 4: Apply the BiFPN feature fusion method to the neck network of the YOLOv8 network to obtain the improved YOLOv8 model;
[0010] Step 5: Scale the power field dataset to a preset size, apply an enhanced version of the YOLOv8 network standard to the dataset to train and obtain an optimal target detection model;
[0011] Step 6: Using the optimal model generated in step 5, perform target detection on the power site, obtain detection results, and evaluate and optimize the detection results.
[0012] In a possible embodiment, step 1 includes:
[0013] Step 11: Obtain a public dataset, which contains multiple power site images;
[0014] Step 12: pre-processing the acquired power site images;
[0015] Step 13: Use the preprocessed power site image to set and adjust the architecture of the YOLOv8 network. In the setting of the YOLOv8 network, three parts are clearly included: the backbone feature extraction network, the neck feature fusion network, and the feature detection output layer;
[0016] Step 14: Use the backbone feature extraction network of the YOLOv8 network to extract features, use the neck feature fusion network to perform multi-scale fusion processing on the extracted features through top-down and bottom-up connections, and finally output the results through the feature detection output layer.
[0017] In a possible embodiment, step 2 includes:
[0018] Step 21: In the backbone network of the YOLOv8 network, introduce partial convolution PConv to improve the original Bottleneck structure;
[0019] Step 22: Use the EMA attention mechanism to encode global information and aggregate cross-spatial information to establish short-term and long-term dependencies.
[0020] Step 23: Replace the original Bottleneck in the C2F module with the improved Bottleneck to optimize the efficiency of feature extraction and image processing.
[0021] In a possible embodiment, step 3 includes:
[0022] Step 31: In the YOLOv8 backbone network, by introducing the channel prior convolutional attention (CPCA) module, the channel attention (CA) and spatial attention (SA) are sequentially placed into an overall structure to improve the performance of the SPPF module;
[0023] Step 32: In the channel attention module, the spatial information of the feature map is aggregated by average pooling and maximum pooling operations;
[0024] Step 33: Process the spatial information through a shared multi-layer perceptron (MLP) and add it to the channel attention map;
[0025] Step 34: Obtain channel priors by performing element-wise multiplication of the input features and the channel attention map;
[0026] Step 35: Input the channel prior into the deep convolution module to generate a spatial attention map;
[0027] Step 36: The deep convolution module receives the spatial attention map for channel mixing;
[0028] Step 37: Output the refined features by performing element-by-element multiplication of the channel mixing result and the channel prior.
[0029] In a possible embodiment, step 4 includes:
[0030] Apply the BiFPN feature fusion method to the neck network of the YOLOv8 network. BiFPN adjusts the contribution of each scale feature by adding weights. The formula is:
[0031]
[0032] in, is an intermediate function at level 2 of the top-down path, is the output feature at level 6 of the bottom-up path Represents three input feature maps of different scales. ω1 and ω2 are weight parameters used to adjust the importance of the two input feature maps in the fusion process. Resize represents a downsampling or upsampling operation. ω'1, ω'2, and ω'3 are weight parameters for adjusting the importance of the three input feature maps, which are used to distinguish the importance of different features in the feature fusion process. ε represents a very small number.
[0033] In a possible embodiment, in step 6, evaluating and optimizing the detection results includes: selecting an average precision mean M AP, precision P and recall R are used to measure the effect of the algorithm. The calculation formulas for each evaluation index are as follows:
[0034]
[0035] Among them, the subscript i represents the category number; A pi represents the average precision of the i-th category; N represents the total number of categories in the data set; T P Indicates the number of samples predicted to be positive and actually positive; F P Indicates the number of samples predicted to be positive but actually negative; F N Indicates the number of samples predicted to be negative but actually positive.
[0036] Beneficial effects of the present invention: The present invention effectively improves the accuracy of power on-site operation specification detection, further achieves a balance between lightweight detection models and performance, and can meet the needs of on-site safety risk management and control of power systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a flow chart of the power field operation standard detection method provided by the present invention.
[0038] Figure 2 It is a YOLOv8 network structure diagram in the power field operation standard detection method provided by the present invention.
[0039] Figure 3 This is the working principle of PConv in the power field operation standard detection method provided by the present invention.
[0040] Figure 4 It is the EMA attention module structure in the power field operation standard detection method provided by the present invention.
[0041] Figure 5 1 is a structural diagram of the Bottleneck of the present invention, wherein (a) is the original Bottleneck; and (b) is the improved Bottleneck.
[0042] Figure 6 This is the CPCA overall structure in the power field operation standard detection method provided by the present invention.
[0043] Figure 7 It is a network structure diagram of the improved YOLOv8 model in the power field operation specification detection method provided by the present invention.
[0044] Figure 8 It is the actual detection effect diagram of the improved algorithm verified by the present invention, where (a) is the detection diagram of YOLOv8s; (b) is the detection diagram of IYOLOv8. DETAILED DESCRIPTION
[0045] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings. The description in this part is only exemplary and explanatory and should not have any limiting effect on the protection scope of the present invention.
[0046] refer to Figure 1 The present invention discloses a method for detecting power field operation specifications based on an improved YOLOv8 algorithm, comprising the following steps:
[0047] S100: Obtain a public data set, then pre-process the power site images and establish a YOLOv8 network.
[0048] In step S100, the YOLOv8 network includes three parts: the backbone feature extraction network (Backbone), the neck feature fusion network (Neck), and the feature detection output layer (Head). The backbone network is mainly used for feature extraction, and the neck network uses a top-down and bottom-up connection method (FPN+PAN) to perform multi-scale fusion processing on the features extracted from the backbone, and then send them to the feature detection output layer.
[0049] YOLOv8 is built on the basis of YOLOv5 and introduces new features and improvements to further improve performance and flexibility. The algorithm framework mainly includes three parts: backbone feature extraction network (Backbone), neck feature fusion network (Neck) and feature detection output layer (Head). Figure 2 shown.
[0050] When performing detection tasks, Backbone first extracts features from the input image and uses CSP (Cross Stage Partial) connections to strengthen feature transfer. The backbone network consists of multiple CBS, C2F modules and a tail SPPF module. Among them, the CBS module is a composite module composed of components such as Conv2d (two-dimensional convolution), BN (batch normalization) and SiLU (Sigmoid-Linear Unit). The convolution layer extracts feature information by applying a set of learnable filters (also called convolution kernels or convolution matrices) to the input data for convolution operations. These filters have different feature extraction capabilities and can effectively capture features such as edges and shapes of the input data. In order to enhance the expressiveness of the network, the output is activated by the nonlinear activation function SiLU.
[0051] Secondly, YOLOv8 combines the C3 module of YOLOv5 and the ELAN module of YOLOv7 to design the C2F module to replace the C3 module. The C2F module uses a gradient shunt connection to enrich the information flow of the feature extraction network while maintaining lightweight. It consists of components such as CBS, Split, and Bottleneck. SPPF is a spatial pyramid pooling method based on SPP. It is implemented by serializing multiple 5*5 maximum pooling layers, thereby reducing the number of parameters and greatly reducing the amount of calculation. The SPPF module accepts the feature map as input, which is then processed by the CBS module and performs a maximum pooling downsampling operation. Finally, the different downsampling results are spliced to form an output feature map. By using SPPF, the receptive field can be effectively expanded, global context information can be extracted, features of different scales can be integrated, and it has a low parameter amount and computational load.
[0052] S200: In the backbone network of the YOLOv8 network, a new C2F module is constructed through the EMA attention mechanism and partial convolution PConv to optimize the efficiency of feature extraction and image processing.
[0053] The specific steps of step S200 are:
[0054] S210: First, partial convolution PConv is introduced to improve the original Bottleneck structure. The working principle of PConv is as follows: Figure 3 shown.
[0055] exist Figure 3 For consecutive or regular memory accesses, the first or last consecutive c p The channel is considered as a representative of the entire feature map for calculation. Without loss of generality, the input and output feature maps are assumed to have the same number of channels. Therefore, the FLOPs of PConv is only For a typical r = 1 / 4, PConv has only 1 / 16 of the FLOPs of regular Conv. In addition, PConv has less memory access, i.e. For r=1 / 4, it is only 1 / 4 of the regular Conv.
[0056] S220: Then the EMA attention mechanism is introduced to encode global information, realize the aggregation of cross-spatial information, and establish short-term and long-term dependencies. The structure of the EMA attention module is as follows: Figure 4 shown.
[0057] The EMA (Efficient Multi-Scale Attention Module) module aims to retain information on each channel and reduce computational overhead. It reshapes some channels into batch dimensions and groups the channel dimensions into multiple sub-features so that spatial semantic features are evenly distributed in each feature group. In addition to encoding global information to recalibrate the channel weights in each parallel branch, the output features of the two parallel branches are further aggregated through cross-dimensional interactions to improve multi-dimensional perception and multi-scale feature extraction capabilities.
[0058] Figure 4 The main components in include Residual: residual connection, used to retain input information. XAvg Pool and YAvgPool: average pooling operations along the X-axis and Y-axis to extract global average information. Conv(3x3): 3x3 convolution layer, used to extract local features. Concat: concatenate the results of XAvg Pool and YAvg Pool with the convolution results. Sigmoid: use the Sigmoid function for activation. Re-weight: weight redistribution, weighting the output of the attention mechanism with the input features. GroupNorm: group normalization, normalizing the output features. AvgPool: average pooling, further extracting global information. Softmax: Softmax function, used to calculate weight distribution. Matmul: matrix multiplication, used for feature fusion.
[0059] For any given input feature map EMA divides the input into G sub-features in the channel dimension direction, namely Used to learn different feature information. In order to capture the dependencies between all channels and reduce the amount of computation, EMA models the cross-channel feature interactions in the channel direction. At the same time, a cross-spatial information aggregation method in different spatial dimensions is applied to achieve richer feature aggregation. Branch 1 is the original feature map that is compressed in terms of the number of channels and fused with other branch information. Branch 2 draws on the CA attention mechanism to perform global average pooling on the feature map in both height and width directions. To improve computational efficiency, the EMA attention mechanism uses a two-dimensional average pooling method, as shown in the following formula.
[0060]
[0061] Among them, H and W represent the height and width of the feature map; x c Feature tensors representing different channels.
[0062] Branch 3 uses 3×3 convolution operations to process feature maps, effectively capturing cross-dimensional interactions and establishing connections between different dimensions with other branches. The three branches of the EMA attention mechanism integrate the advantages of channel attention and spatial attention, while capturing global channel dependencies and local spatial features, and obtaining more comprehensive feature information between channel and spatial dimensions.
[0063] S230: Finally use the improved Bottleneck to replace the original Bottleneck in the C2F module.
[0064] This embodiment proposes to introduce PConv and EMA attention mechanism to improve Bottleneck, replace the original Bottleneck structure of C2F, and build a new C2F_Faster_EMA module, which reduces the number of model parameters and computational complexity while maintaining the detection accuracy of targets in complex environments. The specific improved Bottleneck structure is as follows: Figure 5 shown.
[0065] The input passes through PConv, and conventional Conv is applied to a part of the input channel for spatial feature extraction, while keeping the remaining channels unchanged. The convolution result is then concat-connected with the above-mentioned unconvolved channels to reduce redundant information. Then, it passes through the CBS module to double the number of channels of the upper-layer output feature map to maintain the diversity of features and achieve lower latency. After 1×1 convolution dimensionality reduction, the number of channels remains the same as the input, and then the EMA attention module is connected to encode global information to recalibrate the channel weights in each parallel branch, realize cross-dimensional aggregation of output features, and improve multi-dimensional perception and multi-scale feature extraction capabilities.
[0066] S300: Introduce channel prior convolutional attention (CPCA) into the backbone network of the YOLOv8 network to improve the SPPF module. The overall structure of CPCA is as follows: Figure 6 shown.
[0067] In step S300, as shown in Figure 6As shown in the figure, channel prior convolutional attention (CPCA) is an overall structure with sequential placement of channel attention and spatial attention, which performs channel attention (CA) and spatial attention (SA) in sequence. Channel attention aggregates the spatial information of feature maps through operations such as average pooling and max pooling. The spatial information is then processed through a shared multi-layer perceptron (MLP) and added to the channel attention map. The channel prior is obtained by element-wise multiplication of the input features and the channel attention map. Subsequently, the prior channel is input into the deep convolution module to generate the spatial attention map. The convolution module receives the spatial attention map for channel mixing. Finally, the refined features are obtained as output by element-wise multiplication of the channel mixing result and the channel prior.
[0068] S400: Introduce BiFPN feature fusion method into the neck network of YOLOv8 network to achieve multi-scale fusion, and obtain the improved YOLOv8 model as shown below Figure 7 shown.
[0069] In step S400, BiFPN adjusts the contribution of each scale feature by adding weights to it. Taking the features of the middle layer as an example, the two fusion features of BiFPN are described in the 6th layer, and the formula is:
[0070]
[0071] in, is an intermediate function at level 2 of the top-down path, is the output feature at level 6 of the bottom-up path Represents three input feature maps of different scales. ω1 and ω2 are weight parameters used to adjust the importance of the two input feature maps in the fusion process. Resize represents a downsampling or upsampling operation. ω'1, ω'2, and ω'3 are weight parameters for adjusting the importance of the three input feature maps, which are used to distinguish the importance of different features in the feature fusion process. ε represents a very small number.
[0072] S500: Scale the power site data set to a preset size and send it to the improved YOLOv8 network model for training to obtain the optimal model for target detection.
[0073] S600: Utilize the optimal model of step S500 to perform target detection, output the target detection result, and evaluate the detection result.
[0074] In S600, select the average precision mean M AP , precision P and recall R are used to measure the effect of the algorithm. The calculation formulas for each evaluation index are as follows:
[0075]
[0076] Among them, the subscript i represents the category number; A pi represents the average precision of the i-th category; N represents the total number of categories in the data set; T P Indicates the number of samples predicted to be positive and actually positive; F P Indicates the number of samples predicted to be positive but actually negative; F N Indicates the number of samples predicted to be negative but actually positive.
[0077] The present embodiment provides a method for detecting power field operation specifications based on an improved YOLOv8 algorithm, which aims to improve the automatic monitoring capability of power field operation specifications through deep learning technology. This method greatly improves the accuracy and efficiency of target detection by making innovative improvements to multiple aspects of the YOLOv8 network model (preprocessing and network establishment, introduction of EMA attention mechanism and PConv, improvement of SPPF module by introducing CPCA, data set training and model optimization, target detection and evaluation). Through the above innovative methods, the present invention successfully constructs a high-performance automatic detection system for power field operation specifications. Compared with the traditional target detection model, the improved YOLOv8 model shows higher accuracy and efficiency in the detection of power field operation specifications, which can effectively improve the safety management level and operation standardization level of the power industry.
[0078] This paper compares the existing target detection algorithms to verify their excellent performance in power field detection. The compared methods include one-stage methods (YOLOv5s, YOLOv7, YOLOv8s, SSD, CenterNet) and two-stage methods (Faster R-CNN). In this experiment, the training was carried out on the training set according to the recommended training parameters of the comparison method under the same experimental environment. The experimental results are shown in Table 1. By comparing the data in the table, it can be seen that the IYOLOv8 in this paper has further improved the performance of the original YOLOv8 network, and the recall rate, mAP@.5 and mAP@.5:.95 have been improved by 4.9%, 2.7% and 1.1% respectively, and the detection accuracy has been improved to a certain extent. At the same time, the detection speed of the improved IYOLOv8 algorithm model has increased by nearly 400 frames, and the network parameter volume has decreased by 42.59%, which is more suitable for mobile terminal deployment. The above proves the superiority and effectiveness of the improved method based on YOLOv8 proposed in this paper in the power field. Compared with other methods, IYOLOv8 also performs better, mainly due to the good design of the YOLOv8 model and the special improvements proposed in this paper for the power field environment.
[0079] Table 1 Comparative experimental results
[0080]
[0081] Figure 8 The test results of the algorithm before and after the improvement are given as examples. In a typical complex background, the fusion improved model can reduce the false detection in the lower left corner. At the same time, the detection accuracy of the seat belt wearing is improved from 0.49 to 0.87, and the detection accuracy of the off-the-ground state is improved from 0.40 to 0.93. The improved IYOLOv8 can detect the status of power field workers more accurately.
[0082] It should be noted that, in this article, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus.
[0083] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core ideas of the present invention. The above is only a preferred implementation of the present invention. It should be pointed out that due to the limitations of textual expression and the objective existence of infinite specific structures, ordinary technicians in this technical field can make several improvements, modifications or changes without departing from the principles of the present invention, and can also combine the above technical features in an appropriate manner; these improvements, modifications, changes or combinations, or the direct application of the inventive concept and technical solution to other occasions without improvement, should be regarded as the protection scope of the present invention.
Claims
1. A method for detecting power field operation specifications based on an improved YOLOv8 algorithm, characterized in that: include, Step 1: Obtain the power site dataset, preprocess the power site images, and use the same data to set and adjust the parameters of the YOLOv8 network; Step 2: In the backbone network of the YOLOv8 network, a new C2F module is constructed through the EMA attention mechanism and partial convolution PConv to optimize the efficiency of feature extraction and image processing; Step 3: Further improve and optimize the performance of the SPPF module by introducing channel prior convolutional attention in the backbone network of the YOLOv8 network; Step 4: Apply the BiFPN feature fusion method to the neck network of the YOLOv8 network to obtain the improved YOLOv8 model; Step 5: Scale the power field dataset to a preset size, apply an enhanced version of the YOLOv8 network standard to the dataset to train and obtain an optimal target detection model; Step 6: Using the optimal model generated in step 5, perform target detection on the power site, obtain detection results, and evaluate and optimize the detection results.
2. The method for detecting operation specifications according to claim 1, characterized in that: The step 1 comprises: Step 11: Acquire a power field dataset including multiple power field images; Step 12: pre-processing the acquired power site images; Step 13: Use the pre-processed power field images to set up and adjust the architecture of the YOLOv8 network; Step 14: Use the backbone feature extraction network of the YOLOv8 network to extract features, use the neck feature fusion network to perform multi-scale fusion processing on the extracted features through top-down and bottom-up connections, and finally output the results through the feature detection output layer.
3. The method for detecting operation specifications according to claim 1, characterized in that: Step 2 includes: Step 21: In the backbone network of the YOLOv8 network, introduce partial convolution PConv to improve the original Bottleneck structure; Step 22: Use the EMA attention mechanism to encode global information and aggregate cross-spatial information to establish short-term and long-term dependencies. Step 23: Replace the original Bottleneck in the C2F module with the improved Bottleneck to optimize the efficiency of feature extraction and image processing.
4. The method for detecting operation specifications according to claim 1, characterized in that: The step 3 comprises: Step 31: In the YOLOv8 backbone network, by introducing the channel prior convolutional attention module, the channel attention and spatial attention sequence are placed into an overall structure to improve the performance of the SPPF module; Step 32: In the channel attention module, the spatial information of the feature map is aggregated by operations such as average pooling and maximum pooling; Step 33: Process the spatial information through a shared multi-layer perceptron and add it to the channel attention map; Step 34: Obtain channel priors by performing element-wise multiplication of the input features and the channel attention map; Step 35: Input the channel prior into the deep convolution module to generate a spatial attention map; Step 36: The deep convolution module receives the spatial attention map for channel mixing; Step 37: Output the refined features by performing element-by-element multiplication of the channel mixing result and the channel prior.
5. The method for detecting operation specifications according to claim 1, characterized in that: The step 4 comprises: Apply the BiFPN feature fusion method to the neck network of the YOLOv8 network. BiFPN adjusts the contribution of each scale feature by adding weights. The formula is: in, is an intermediate function at level 2 of the top-down path, is the output feature at level 6 of the bottom-up path Represents three input feature maps of different scales. ω1 and ω2 are weight parameters used to adjust the importance of the two input feature maps in the fusion process. Resize represents a downsampling or upsampling operation. ω'1, ω'2, and ω'3 are weight parameters for adjusting the importance of the three input feature maps, which are used to distinguish the importance of different features in the feature fusion process. ε represents a very small number.
6. The method for detecting operation specifications according to claim 1, characterized in that: In step 6, evaluating and optimizing the detection results includes: Select the mean precision M AP , precision P and recall R are used to measure the algorithm effect. The calculation formulas for each evaluation index are as follows: Among them, the subscript i represents the category number; A pi represents the average precision of the i-th category, N represents the total number of categories in the data set; T P Indicates the number of samples predicted to be positive and actually positive; F P Indicates the number of samples predicted to be positive but actually negative; F N Indicates the number of samples predicted to be negative but actually positive.
Citation Information
Cited By
Training method of acid-base leakage monitoring model and acid-base leakage monitoring method and device
CN119721134A
PCB small target defect detection method based on improved YOLOv8x
CN119722669A
Transformer substation defect detection model optimization and detection method based on YOLOv11
CN120031861A
Method and system for detecting miniature focus of pulmonary tuberculosis based on multi-scale convolution
CN120107251A
Real-time pig health monitoring method for complex environment
CN120299066A
