Substation foreign matter intrusion detection method and system based on improved YOLOv11 model
By improving the YOLOv11 model, the multi-scale detection capability and feature extraction capability are enhanced, and the problems of missed detection, misjudgment and slow identification rates of small and medium-sized targets in substation equipment and line detection are solved, achieving higher detection accuracy and real-timeness.
Patent Information
- Application Number
- CN202510213834.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2045-02-26
AI Technical Summary
In the prior art, there are problems such as low recognition accuracy and slow recognition rate in substation equipment and line detection in the detection of small targets, misjudgment, and occlusion.
Using the improved YOLOv11 model, by adding C3k2-Dual module, non-local attention mechanism module, SPPF module and C2PSA-DHSA module to the backbone network, the multi-scale detection capability and feature extraction capability are enhanced, and the real-time performance and adaptability of the model are improved.
It improves the ability to extract substation equipment and line features, enhances the detection performance of small targets and occlusion targets, improves the low recognition rate and error recognition problems caused by occlusion, and improves the accuracy and real-timeness of the model.
Smart Images

Figure CN119722662A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing and substation foreign object detection, and specifically relates to a substation foreign object intrusion detection method and system based on an improved YOLOv11 model. Background Art
[0002] Substations are an important part of the power grid, and the safe operation of substations is related to the safety and stability of the entire power grid. Bird nests and wind-blown objects such as plastic bags, cardboard, woven bags, and kites often appear on the equipment and lines of outdoor substations. These intruding foreign objects can easily cause accidents such as short circuits, flashovers, and tripping of equipment and lines, seriously endangering the safe and reliable operation of the power grid. Compared with traditional methods of preventing foreign object intrusion such as manual inspections, bird spikes, and ultrasound, automatic image recognition and manual removal of intruding foreign objects is a very effective and economical method. Although some deep learning target detection models for foreign object detection in substations have appeared in the prior art, such as YOLOv4 and YOLOv5. However, these models have problems such as missed detection and misjudgment of small targets in the process of substation equipment and line detection. In addition, they will also cause problems such as low recognition accuracy due to occlusion and other reasons. In addition, when the above models are deployed on inspection equipment and real-time detection is performed, there are still problems such as slow recognition rate. Summary of the invention
[0003] The purpose of the present invention is to propose a substation foreign object intrusion detection method based on an improved YOLOv11 model to realize automatic image recognition of substation intrusion foreign objects, avoid missed detection and misjudgment of small targets, and help improve the accuracy and efficiency of intrusion foreign object detection, thereby ensuring the safe and reliable operation of the substation.
[0004] In order to achieve the above object, the present invention adopts the following technical scheme: The substation foreign body intrusion detection method based on the improved YOLOv11 model includes the following steps: Step 1. Obtain multiple images of equipment and lines of the substation, and perform image preprocessing and annotation on the acquired images of equipment and lines of the substation to obtain a training data set for the following substation foreign object intrusion detection model; Step 2. Build a substation foreign body intrusion detection model based on the YOLOv11 model architecture. The substation foreign body intrusion detection model includes a backbone network, a neck network, and a detection head network; The backbone network includes a convolutional block, four groups of convolutional blocks and C3k2-Dual modules, a non-local attention mechanism module, an SPPF module, and a C2PSA-DHSA module. Four groups of convolution blocks and C3k2-Dual modules are defined as the first group, the second group, the third group and the fourth group of convolution blocks and C3k2-Dual modules, and each group includes a convolution block and a C3k2-Dual module; The C3k2-Dual module replaces the Conv convolution in the traditional C3k2 module with Dual Conv convolution, which enables the model to process the same input feature map channels simultaneously and use group convolution technology to efficiently arrange convolution filters. The C2PSA-DHSA module is obtained by inserting the DHSA module into the C2PSA module; The DHSA module uses the parallel processing of BHR and FHR to enable the model to simultaneously capture the global and local features of the power grid image, and then fuses the global and local features through the self-attention mechanism to ultimately achieve high-quality image restoration; The image features input to the YOLOv11 model architecture first enter the backbone network and are processed as follows: The image features are first extracted through a convolutional block, and then through the first, second, third and fourth groups of convolutional blocks and C3k2-Dual modules, and then through a non-local attention mechanism module, so that the network can not only capture the local details of the equipment and line images of the input substation, but also obtain global context information; The output features of the non-local attention mechanism module are then passed through the SPPF module and finally output by the C2PSA-DHSA module; The neck network is used to achieve deep fusion of features at different levels, and the detection head network contains four detection heads; Step 3. Train the constructed substation foreign object intrusion detection model based on the training data set in step 1 to obtain a trained substation foreign object intrusion detection model, and use the trained model to perform intrusion detection on the transformer foreign object.
[0005] In addition, based on the above-mentioned substation foreign body intrusion detection method based on the improved YOLOv11 model, the present invention also proposes a substation foreign body intrusion detection system based on the improved YOLOv11 model, which adopts the following technical solutions: A substation foreign object intrusion detection system based on an improved YOLOv11 model includes a camera and a computer device, wherein the computer device includes a memory and at least one processor; the memory stores executable code; when the processor executes the executable code, it is used to implement the substation foreign object intrusion detection method based on the improved YOLOv11 model as described above.
[0006] The present invention has the following advantages: As described above, the present invention relates to a substation foreign body intrusion detection method and system based on an improved YOLOv11 model. The method of the present invention builds a substation foreign body intrusion detection model based on the improved YOLOv11 model architecture to enhance multi-scale detection capabilities and feature extraction capabilities, improve the real-time performance of the model, improve the adaptability of the model, and simultaneously improve the detection performance of small targets and occluded targets. Specifically, in terms of enhancing multi-scale detection capabilities and feature extraction capabilities, the present invention extracts features at a deep level by adding a C3k2-Dual module, which greatly improves the model's extraction of substation equipment and line features. Then, by adding a non-local attention mechanism module before the SPPF module, the input feature map of the substation equipment and line is subjected to feature extraction in the spatial dimension and channel dimension, thereby achieving the acquisition of global information. This method can achieve deep-level feature extraction while maintaining high detection performance on targets of different scales. In terms of improving the real-time performance of the model, the special structure of the C3k2-Dual module enables the model to process multiple input channels at the same time, and uses the group convolution technology to efficiently arrange the convolution filters, effectively reducing the computational cost and number of parameters of the recognition model, while also improving the accuracy of the model, providing technical support for unmanned substation equipment and line inspection robots to achieve fast and accurate inspections, and providing a solution to the problem of slow recognition rate of current unmanned inspection equipment. In terms of improving the adaptability of the model, the present invention adds a C2PSA-DHSA module after the SPPF module. The C2PSA-DHSA module is obtained by introducing the DHSA module on the basis of the structure of the traditional C2PSA module, and can selectively focus on the spatial characteristics of the dynamic range of substation lines and equipment. For long-distance images such as substation equipment and lines, similar degraded pixels in the feature map can be processed in parallel, so that the model performs well in common outdoor bad weather image restoration tasks such as image snow removal, rain fog removal, and raindrop removal, and the structure helps to maintain the correct relative position and structural relationship at the global level, so that the model no longer depends on high-pixel input images, but can be more widely used in low-performance recognition devices. In terms of improving the detectability of small targets and occluded targets, by adding an additional small target detection layer, the model can independently identify and extract features for images where the median ratio of the bounding box area to the image area is between 0.08% and 0.58%, solving the problems of missed detection and misjudgment of small targets during substation equipment and line inspection. Combined with the non-local attention mechanism module, the model can transfer the recognition attention from large occluded areas to ordinary areas through non-local attention, so that the model can not only detect small targets, but also improve the low recognition rate and misrecognition caused by occlusion, and enhance the model's adaptability to various target sizes. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 It is a flow chart of a substation foreign body intrusion detection method based on an improved YOLOv11 model in an embodiment of the present invention; Figure 2 It is a structural diagram of a substation foreign body intrusion detection model built in an embodiment of the present invention; Figure 3 This is a network structure diagram of the C2PSA-DHSA module in an embodiment of the present invention; Figure 4 This is a network structure diagram of the PSAB-DHSA module in an embodiment of the present invention; Figure 5 This is a network structure diagram of the DHSA module in an embodiment of the present invention; Figure 6 This is a network structure diagram of the C3k2-Dual module in an embodiment of the present invention; Figure 7 This is a network structure diagram of Dual Conv convolution in an embodiment of the present invention; Figure 8 2 is a network structure diagram of the non-local attention mechanism module in an embodiment of the present invention. DETAILED DESCRIPTION
[0008] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments: Example 1 This embodiment 1 describes a substation foreign body intrusion detection method based on an improved YOLOv11 model to solve the problems of missed detection, misjudgment, low recognition accuracy and slow rate in the process of substation equipment and line detection of traditional models.
[0009] Specifically, the present invention proposes a substation foreign body intrusion detection model based on the improved YOLOv11 model based on the YOLOv11 (You Only Look Once version 11) algorithm to realize automatic image recognition of foreign bodies intruding into the substation. The substation foreign body intrusion detection model adds a C2PSA-DHSA module after the SPPF module. The C2PSA-DHSA module is obtained by inserting a DHSA module (Dynamic-range Histogram Self-Attention) into the C2PSA module (Cross Channel Pyramid Saliency Attention), and at the same time cooperates with the use of the C3k2-Dual module, adds a new small target detection layer, and adds a non-local attention mechanism module before the SPPF module. Improvements such as the model can more effectively identify those targets with smaller areas, while reducing the computational cost and the number of parameters of the model, and also improves the problem of low recognition rate and false recognition caused by occlusion of the recognition device, improves the accuracy of the model, and enhances the adaptability of the model to targets of different sizes.
[0010] like Figure 1 As shown in FIG. 1 , the substation foreign body intrusion detection method based on the improved YOLOv11 model includes the following steps: Step 1. Obtain multiple images of substation equipment and lines, and perform image preprocessing and annotation on the acquired substation equipment and line images to obtain a training data set for the following substation foreign object intrusion detection model.
[0011] The training data set used by the model of the present invention comes from a self-collected database, and the characteristics of the data set are as follows: The data volume is large and diverse. The database contains more than 2,500 images from 12 sites, covering the period from September 2020 to June 2024, including equipment and line images of substations in multiple seasons and weather conditions.
[0012] The data in this dataset is accurately labeled. All images in the database have been manually labeled, and the labeling quality is high. For example, the labeling categories are: a for bird's nest, b for beehive, c for plastic and cloth foreign objects, d for kite, e for balloon, and f for branch.
[0013] Before using the substation foreign object intrusion detection model to detect foreign objects in the substation, the substation equipment and line images (i.e., the above-mentioned data set) obtained for model training are first preprocessed.
[0014] The preprocessing operation mainly includes reading the substation equipment and line image files into the memory, scaling the image to the 640×640 size supported by the model, and normalizing it using the Z score.
[0015] Z-score normalization was used to transform the data into a standard normal distribution with a mean of 0 and a standard deviation of 1.
[0016] Z-score normalization converts the original data into a new data set with zero mean and unit variance by calculating the deviation of each data point from the mean of the data set and dividing it by the standard deviation of the data set; the calculation formula is as follows: ; Z is the normalized value, x is the original data point, which refers to a pixel value in the equipment and line image data of the substation or a line feature value in the feature map (which may be normal or have foreign objects), μ is the mean of all image pixel values or feature values, is the standard deviation of the original data set.
[0017] Z-score normalization does not change the distribution shape of the data; if the original data is approximately normally distributed, then the normalized data will have a mean of 0 and a standard deviation of 1, but still maintain its original distribution shape, maintain data distribution, and scale invariance; the data is centered to a mean of 0, which is conducive to recognition by the improved YOLOv11 model.
[0018] Then perform color channel conversion to convert the image from RGB format to CHW format, that is, channel-height-width format.
[0019] Step 2. Build a substation foreign body intrusion detection model based on the YOLOv11 model architecture. Its network structure is as follows: Figure 2 As shown, the substation foreign body intrusion detection model includes a backbone network, a neck network and a detection head network.
[0020] Among them, the backbone network includes a convolution block, four groups of convolution blocks and C3k2-Dual modules, a non-local attention mechanism module (NonLocalBlockND module), an SPPF module and a C2PSA-DHSA module.
[0021] Four groups of convolution blocks and C3k2-Dual modules are defined as the first, second, third and fourth groups of convolution blocks and C3k2-Dual modules, and each group includes a convolution block and a C3k2-Dual module.
[0022] The C3k2-Dual module is based on the traditional C3k2 module. It replaces the Conv convolution in the traditional C3k2 module with Dual Conv convolution, so that the model can process the same input feature map channels at the same time, and use group convolution technology to efficiently arrange convolution filters, which is beneficial to reduce the computational cost and the number of parameters while improving the accuracy of the model.
[0023] The C2PSA-DHSA module is a new module introduced after the SPPF module. It is obtained by inserting the DHSA module into the C2PSA module. The C2PSA-DHSA module combines the convolution block of the DHSA block to enhance the feature extraction capability. The C2PSA-DHSA module enhances the feature extraction capability through a multi-head attention mechanism and a feedforward neural network, ultimately achieving high-quality image restoration.
[0024] The DHSA module enables the model to simultaneously capture the global and local features of the power grid image through the parallel processing of BHR and FHR, and then fuses the global and local features through the self-attention mechanism to ultimately achieve high-quality image restoration.
[0025] The image features input to the YOLOv11 model architecture first enter the backbone network and are processed as follows: The image features are first extracted through a convolution block, and then sequentially through the first, second, third and fourth groups of convolution blocks and the C3k2-Dual module, and then through a non-local attention mechanism module, so that the network can not only capture the local details of the equipment and line images of the input substation, but also obtain the global context information; the output features of the non-local attention mechanism module are then passed through the SPPF module and finally output through the C2PSA-DHSA module.
[0026] The neck network is used to achieve deep fusion of features at different levels, and the detection head network contains four detection heads.
[0027] The neck network includes C3k2-Dual modules, convolutional blocks, upsampling modules, and combination layers.
[0028] It is defined that there are six C3k2-Dual modules in the neck network, which are the first, second, third, fourth, fifth and sixth C3k2-Dual modules respectively; it is defined that there are two convolution blocks in the neck network, which are the first and second convolution blocks respectively.
[0029] It is defined that there are six combination layers in the neck network, which are the first, second, third, fourth, fifth and sixth combination layers respectively. It is defined that there are three upsampling modules in the neck network, which are the first, second and third upsampling modules respectively.
[0030] The output features of the C2PSA-DHSA module first pass through the first upsampling module and enter the first combination layer, where they are fused with the output features of the C3k2-Dual module in the fourth group of convolutional blocks and the C3k2-Dual module.
[0031] The output features of the first combination layer pass through the first C3k2-Dual module and the second upsampling module in sequence.
[0032] The output features of the second upsampling module enter the second combination layer and are fused with the output features of the C3k2-Dual module in the third group of convolutional blocks and the C3k2-Dual module in the second combination layer.
[0033] The output features of the second combination layer pass through the second C3k2-Dual module and the third upsampling module in sequence.
[0034] The output features of the third upsampling module enter the third combination layer and are fused with the output features of the C3k2-Dual module in the second group of convolutional blocks and the C3k2-Dual module within the third combination layer.
[0035] The output features of the third combination layer pass through the third C3k2-Dual module and the first convolution block in sequence; the output features of the first convolution block enter the fourth combination layer and are fused with the output features of the second combination layer in the fourth combination layer.
[0036] The output features of the fourth combination layer pass through the fourth C3k2-Dual module and the second convolution block in sequence; the output features of the second convolution block enter the fifth combination layer and are fused with the output features of the first combination layer in the fifth combination layer.
[0037] The output features of the fifth combination layer enter the sixth combination layer after passing through the fifth C3k2-Dual module, and are fused with the output features of the C2PSA-DHSA module in the sixth combination layer. The output of the sixth combination layer enters the sixth C3k2-Dual module.
[0038] The output ends of the third, fourth, fifth and sixth C3k2-Dual modules are respectively connected to a detection head.
[0039] The C2PSA-DHSA module inserts the DHSA module into the C2PSA module to replace the traditional attention. The DHSA module enables the detection model to capture the global and local features of the power grid image at the same time through the parallel processing of BHR and FHR, and then fuses these features through the self-attention mechanism to finally achieve high-quality image restoration. This enables the improved model to focus on areas with similar degradation patterns caused by rain, fog or snow, meeting the requirement of stable operation even in extreme weather conditions.
[0040] like Figure 3 The network structure of the C2PSA-DHSA module is shown, which includes a data segmentation layer, n PSAB-DHSA modules and two convolutional layers. Figure 4 As shown in the figure, the PSAB-DHSA module includes a DHSA module and a feedforward neural network composed of two convolutional layers. The image features input to the C2PSA-DHSA module are first extracted through a convolutional layer, and then two features are obtained through a data segmentation layer and input to a branch respectively; one branch feature is processed by n PSAB-DHSA modules, and the other branch feature is not processed; the output features of the above two branches are connected, and the connected features are output after passing through a convolutional layer.
[0041] like Figure 5 As shown, the processing flow of the DHSA module is as follows: define a substation equipment and line image feature tensor F∈R that is input to the DHSA module C×H×W ; where C is the number of channels, H is the height, and W is the width. The input feature map is subjected to dynamic-range convolution to split feature F into two branch features, namely feature F 1 and F 2 For feature F 1 Perform horizontal and vertical sorting to obtain sorted features, and compare the sorted features with feature F 2 Splicing to form a new feature F'. The feature F' is processed by 1×1 point convolution and 3×3 depth convolution to obtain the feature of dynamic range convolution. Then, the feature of dynamic range convolution is subjected to histogram reshaping operation, namely BHR and FHR operation, and the output of dynamic range convolution is divided into value feature V and query-key pair F Q,K ,Right now: ; ; ; in, represents the query feature, K represents the key feature, and V represents the value feature. represents the query feature matrix, represents the key feature matrix, represents the value feature matrix, and X represents the input image feature tensor F.
[0042] Sort V and reorder F according to the sort index Q,K , the sorted feature V is C×B× in the form of.
[0043] Where B is the number of histogram bins. The BHR operation makes each bin contain more pixels of substation equipment and line images to capture the global features of the entire line. The FHR operation makes each bin contain fewer pixels to capture the local features of the line. Then the self-attention map A is calculated for the features of the BHR and FHR paths respectively. B and A F ,Right now: ; .
[0044] where RB and RF represent the reshaping operations of BHR and FHR, respectively, and k is the scaling factor.
[0045] and Represents the query vector representing different channels, and Indicates the Key vector representing different channels. Subscript 1 is used to calculate self-attention in the global scope, and subscript 2 is used to calculate self-attention in the local scope.
[0046] , , Indicates the Q 1 , K 1 , V is reshaped so that the number and frequency of elements contained in each histogram bin are fixed, and the Value features are reorganized into a shape that can perform self-attention calculations.
[0047] , , Indicates the Q 2 , K 2 , V is reshaped so that the number and frequency of elements contained in each histogram bin are fixed, and the Value features are reorganized into a shape that can perform self-attention calculations.
[0048] Finally, the two self-attention maps A B and A F Perform element-wise multiplication to obtain the output feature A E, A E= A B ⊙A F .
[0049] The feature data output after horizontal and vertical sorting is projected after channel segmentation and compared with A EThe final self-attention output device and circuit feature map A is reorganized. Finally, the sorted features are reprojected back to the original spatial position through 1×1 point convolution to maintain spatial consistency.
[0050] like Figure 6 The network structure diagram of the C3k2-Dual module is shown.
[0051] Figure 6 (a) shows the case where C3k is False, in which case C3k degenerates to C2f for data processing; (b) shows the case where C3k is True, in which case C3k operates normally; (c) shows the C3k stacking situation in the C3k2-Dual module.
[0052] Compared with the traditional C3k2 module, the C3k2-Dual module replaces the traditional Conv convolution with Dual Conv convolution, so that the model can process the same input feature map channels at the same time, and uses group convolution technology to efficiently arrange convolution filters, thereby reducing the computational cost and the number of parameters while improving the accuracy of the model. Figure 7 The network structure diagram of Dual Conv convolution is shown. Dual Conv convolution divides N convolution kernels into G groups, and controls the ratio of convolution kernels by adjusting the number of G groups to reduce the number of floating point operations (FLOPs). Each group processes all the equipment and line characteristic diagrams input to the substation.
[0053] The line feature map that defines the M / G input retains all the information of the input feature map through parallel 3×3 and 1×1 convolution kernels to help deep convolution layers extract information more efficiently. The remaining (M - M / G) input channels are only processed by 1×1 convolution kernels to reduce the number of parameters of the model; finally, the results of the 3×3 and 1×1 convolution kernels are summed to obtain the output feature map.
[0054] In addition, the present invention also adds a non-local attention mechanism module, namely the NonLocalBlockND module, before the SPPF module. Compared with CNN, the NonLocalBlockND module is no longer limited to the features of the local neighborhood. By adding the NonLocalBlockND module, the network can not only capture the local details of the equipment and line images input to the substation, but also obtain global context information, so that the model's recognition ability of small objects (small birds, small flying objects, bird nests) and large obstructions (kites, large plastic products and other large flying objects and trees, lens obstructions) in line and equipment detection will be significantly enhanced.
[0055] The non-local attention mechanism module improves model performance by capturing the interrelationships of all locations in the feature map globally, namely: .
[0056] in is the response to get the feature map output position i, is the input signal, is a pairwise function that computes the relationship between positions i and j, is a univariate function used to compute the feature representation of position j, is the normalization factor; represents the input signal at position i, Represents the input signal at position j.
[0057] like Figure 8 As shown, the non-local attention mechanism module consists of three branches θ, , g generates the feature representation after dimensionality reduction, which is used to calculate the similarity between the transformer line and equipment features and perform weighting.
[0058] The θ branch is used to reduce the dimension of the input features to 512 channels to generate the query vector query; The branch is also reduced to 512 channels to generate the key vector key, which is used to calculate the similarity with the query vector; the g branch is reduced to 512 channels to generate the value vector value of the input feature for weighted aggregation, that is: ; ; .
[0059] Then, through θ and The similarity calculation generates the attention weight matrix , and compare it with the characteristics of the g branch Multiply them together to get the globally weighted feature representation , the formula is as follows: ; ; in, , q is the query vector, k is the key vector, is the dimension of the key vector.
[0060] Finally, the globally weighted feature representation The number of channels is restored through 1×1 convolution, and the residual structure is used to retain the original features and the globally weighted features, combining local and global information to improve the perception ability of the model.
[0061] In addition, the present invention also enhances the model's detection capability for small targets (the median ratio of the bounding box area to the image area is between 0.08% and 0.58%) by adding an additional detection layer. The network with the new detection layer can identify small targets separately during the recognition process, and to a certain extent improves the model's multi-scale detection capability and generalization capability.
[0062] Step 3. Train the constructed substation foreign object intrusion detection model based on the training data set in step 1 to obtain a trained substation foreign object intrusion detection model, and use the trained model to perform intrusion detection on the transformer foreign object.
[0063] When training the constructed substation foreign object intrusion detection model, the learning rate is set to 0.08; the model optimization algorithm adopts the AdamW optimization algorithm; the batch size is 32, and the number of model iterations is 400.
[0064] The learning rate is an important hyperparameter in deep learning, which controls the update speed of the model during the training process. Since this model is a small model used for image classification and recognition, this model adopts the training method of warm-up learning rate. By constructing a learning rate scheduler, the learning rate adjustment rate of each iteration is set to 0.001, and the cycle is set to 80 iterations. After 80 iterations, the basic learning rate is used. After many experiments, it was found that when the learning rate is higher than 0.1, the model often has the problem of model overfitting; when the learning rate is lower than 0.001, the model training takes a long time, so the learning rate of this model is set to 0.08.
[0065] The AdamW optimization algorithm is a variant of the Adam optimizer that can directly introduce weight decay into the optimization step to improve the generalization performance of the model. AdamW combines the advantages of adaptive learning rate and momentum. Unlike the original Adam optimizer, it can directly apply weight decay to the parameter update step, achieving better regularization and generalization performance.
[0066] AdamW optimizer, after initialization, defines the first-order matrix estimate m t and the second-order matrix estimate v t The initial values are m 0 =0,v 0 = 0, and estimate m by continuously updating the first-order matrix t and the second-order matrix estimate v t To calculate the bias-corrected first-order matrix estimate m t and the second-order matrix estimate v t , and finally update the optimization model parameter θ; its calculation formula is as follows: .
[0067] in Refers to the calculation of the gradient in the tth iteration, , refers to the first-order moment estimate and the second-order moment estimate of the t-th iteration, Refers to the decay rate of the first-order moment estimate, the value is 0.9, Refers to the decay rate of the second-order moment estimate, the value is 0.999, is a constant used to prevent the denominator from being zero; is the weight decay coefficient, which is used for regularization to prevent overfitting; Refers to the learning rate, which controls the size of each update step; , They represent the model parameters θ in the tth and t-1th iterations respectively.
[0068] After many debuggings, the number of iterations of the model was set to 400, at which time the model performance was better and no overfitting occurred.
[0069] After the model training is completed, for the input images of the equipment and lines of the substation to be detected, the image preprocessing operation is first performed according to step 1 in the above method, and then the preprocessed image features are input into the substation foreign object intrusion detection model for prediction. The substation foreign object intrusion detection model finally outputs the target category, location and confidence score.
[0070] Through the above-mentioned method steps, the method of the present invention can more effectively identify targets with smaller areas. While reducing the calculation cost and the number of parameters of the model, it also improves the problems of low recognition rate and false recognition caused by occlusion of the recognition device, improves the accuracy of the model, enhances the adaptability of the model to targets of different sizes, and significantly improves the real-time performance.
[0071] Example 2 This embodiment 2 describes a substation foreign object intrusion detection system based on an improved YOLOv11 model. The substation foreign object intrusion detection system includes a camera and a computer device. The camera is used to collect images of equipment and lines in the substation, and upload image pairs consisting of the collected images of equipment and lines in the substation to the computer device.
[0072] The computer device includes a memory and at least one processor. The memory stores executable code. When the processor executes the executable code, it is used to implement the substation foreign body intrusion detection method based on the improved YOLOv11 model in the above embodiment 1.
[0073] Of course, the above description is only a preferred embodiment of the present invention, and the present invention is not limited to the above embodiments. It should be noted that all equivalent substitutions and obvious deformation forms made by any technician familiar with the field under the guidance of this specification fall within the essential scope of this specification and should be protected by the present invention.
Claims
1. A substation foreign body intrusion detection method based on an improved YOLOv11 model, characterized in that: The steps include: Step 1. Obtain multiple images of equipment and lines of the substation, and perform image preprocessing and annotation on the acquired images of equipment and lines of the substation to obtain a training data set for the following substation foreign object intrusion detection model; Step 2. Build a substation foreign body intrusion detection model based on the YOLOv11 model architecture. The substation foreign body intrusion detection model includes a backbone network, a neck network, and a detection head network; The backbone network includes a convolutional block, four groups of convolutional blocks and C3k2-Dual modules, a non-local attention mechanism module, an SPPF module, and a C2PSA-DHSA module. Four groups of convolution blocks and C3k2-Dual modules are defined as the first group, the second group, the third group and the fourth group of convolution blocks and C3k2-Dual modules, and each group includes a convolution block and a C3k2-Dual module; The C3k2-Dual module replaces the Conv convolution in the traditional C3k2 module with Dual Conv convolution, which enables the model to process the same input feature map channels at the same time and use group convolution technology to efficiently arrange convolution filters. The C2PSA-DHSA module is obtained by inserting a DHSA module into the traditional C2PSA module; The DHSA module uses the parallel processing of BHR and FHR to enable the model to simultaneously capture the global and local features of the power grid image, and then fuses the global and local features through the self-attention mechanism to ultimately achieve high-quality image restoration; The image features input to the YOLOv11 model architecture first enter the backbone network and are processed as follows: The image features are first extracted through a convolution block, and then sequentially through the first, second, third and fourth groups of convolution blocks and C3k2-Dual modules, and then through a non-local attention mechanism module, so that the network can not only capture the local details of the equipment and line images of the input substation, but also obtain global context information; the output features of the non-local attention mechanism module are then passed through the SPPF module and finally output through the C2PSA-DHSA module; The neck network is used to achieve deep fusion of features at different levels, and the detection head network contains four detection heads; Step 3. Train the constructed substation foreign object intrusion detection model based on the training data set in step 1 to obtain a trained substation foreign object intrusion detection model, and use the trained model to perform intrusion detection on the transformer foreign object.
2. The substation foreign body intrusion detection method based on the improved YOLOv11 model according to claim 1 is characterized in that: The neck network includes a C3k2-Dual module, a convolutional block, an upsampling module, and a combination layer; It is defined that there are six C3k2-Dual modules in the neck network, which are the first, second, third, fourth, fifth and sixth C3k2-Dual modules respectively; it is defined that there are two convolutional blocks in the neck network, which are the first and second convolutional blocks respectively; It is defined that there are six combination layers in the neck network, which are the first, second, third, fourth, fifth and sixth combination layers respectively; it is defined that there are three upsampling modules in the neck network, which are the first, second and third upsampling modules respectively; The output features of the C2PSA-DHSA module first pass through the first upsampling module and enter the first combination layer, where they are fused with the output features of the C3k2-Dual module in the fourth group of convolutional blocks and the C3k2-Dual module; The output features of the first combination layer pass through the first C3k2-Dual module and the second upsampling module in sequence; The output features of the second upsampling module enter the second combination layer and are fused with the output features of the C3k2-Dual module in the third group of convolution blocks and the C3k2-Dual module in the second combination layer; The output features of the second combination layer pass through the second C3k2-Dual module and the third upsampling module in sequence; The output features of the third upsampling module enter the third combination layer and are fused with the output features of the C3k2-Dual module in the second group of convolution blocks and the C3k2-Dual module in the third combination layer; The output features of the third combination layer pass through the third C3k2-Dual module and the first convolution block in sequence; the output features of the first convolution block enter the fourth combination layer and are fused with the output features of the second combination layer in the fourth combination layer; The output features of the fourth combination layer pass through the fourth C3k2-Dual module and the second convolution block in sequence; the output features of the second convolution block enter the fifth combination layer and are fused with the output features of the first combination layer in the fifth combination layer; The output features of the fifth combination layer enter the sixth combination layer after passing through the fifth C3k2-Dual module, and are fused with the output features of the C2PSA-DHSA module in the sixth combination layer. The output of the sixth combination layer enters the sixth C3k2-Dual module; The output ends of the third, fourth, fifth and sixth C3k2-Dual modules are respectively connected to one of the detection heads.
3. The substation foreign body intrusion detection method based on the improved YOLOv11 model according to claim 1 is characterized in that: The C2PSA-DHSA module includes a data segmentation layer, n PSAB-DHSA modules and two convolutional layers; The processing flow of the C2PSA-DHSA module is as follows: the image features input to the C2PSA-DHSA module are first extracted through a convolutional layer, and then two features are obtained through a data segmentation layer and input into a branch respectively; one of the branch features is processed by n PSAB-DHSA modules, and the other branch features are not processed; The output features of the above two branches are connected, and the connected features are output after passing through a convolution layer; The PSAB-DHSA module includes a DHSA module and a feed-forward neural network consisting of two convolutional layers.
4. The substation foreign body intrusion detection method based on the improved YOLOv11 model according to claim 3 is characterized in that: The processing flow of the DHSA module is as follows: Define the equipment and line image feature tensor F∈R of a substation input to the DHSA module C×H×W ; Where C is the number of channels, H is the height, and W is the width; the input feature map is subjected to dynamic range convolution, and F is divided into two branch features, namely features F1 and F2; feature F1 is sorted horizontally and vertically to obtain the sorted features, and the sorted features are concatenated with feature F2 to form a new feature F′; feature F′ is processed by 1×1 point convolution and 3×3 depth convolution to obtain the features of dynamic range convolution; then, the features of dynamic range convolution are subjected to histogram reshaping operations, namely BHR and FHR operations, and the output of dynamic range convolution is divided into value features V and query-key pairs F Q,K ,Right now: ; ; ; in, represents the query feature, K represents the key feature, and V represents the value feature. represents the query feature matrix, represents the key feature matrix, represents the value feature matrix, X represents the input image feature tensor F; Sort V and reorder F according to the sort index Q,K , the sorted feature V is C×B× form; Where B is the number of histogram bins, the BHR operation is used to capture the global features of the entire line; the FHR operation is used to capture the local features of the line; Then, the self-attention maps A are calculated for the features of the BHR and FHR paths respectively. B and A F ,Right now: ; ; Where RB and RF represent the reshaping operations of BHR and FHR, respectively, and k is the scaling factor; and Represents the query vector representing different channels, and Indicates the Key vectors representing different channels; subscript 1 indicates that it is used to calculate self-attention in a global range, and subscript 2 indicates that it is used to calculate self-attention in a local range; , , Represents a reshaping operation on Q1, K1, and V in the BHR channel so that the number and frequency of elements contained in each histogram bin are fixed, and the Value feature is reorganized into a shape that can perform self-attention calculation; , , Represents a reshaping operation on Q2, K2, and V in the FHR channel so that the number and frequency of elements contained in each histogram bin are fixed, and the Value feature is reorganized into a shape that can perform self-attention calculation; Finally, the two self-attention maps A B and A F Perform element-wise multiplication to obtain the output feature A E, A E= A B ⊙A F ; The feature data output after horizontal and vertical sorting is projected after channel segmentation and compared with the output feature A. E The final feature map A of the self-attention output device and circuit is reorganized; finally, the sorted features are reprojected back to the original spatial position through 1×1 point convolution to maintain spatial consistency.
5. The substation foreign body intrusion detection method based on the improved YOLOv11 model according to claim 1 is characterized in that: The Dual Conv convolution divides N convolution kernels into G groups, and controls the ratio of convolution kernels by adjusting the number of G groups to reduce the number of floating point operations. Each group processes all equipment and line characteristic diagrams input to the substation; The line feature map that defines the M / G input retains all the information of the input feature map through parallel 3×3 and 1×1 convolution kernels to help deep convolution layers extract information more efficiently. The remaining (M - M / G) input channels are only processed by 1×1 convolution kernels to reduce the number of parameters of the model; finally, the results of the 3×3 and 1×1 convolution kernels are summed to obtain the output feature map.
6. The substation foreign body intrusion detection method based on the improved YOLOv11 model according to claim 1 is characterized in that: The non-local attention mechanism module captures the relationship between all positions in the feature map globally, namely: ; in is the response to get the feature map output position i, is the input signal, is a pairwise function that computes the relationship between positions i and j, is a univariate function used to compute the feature representation of position j, is the normalization factor; represents the input signal at position i, represents the input signal at position j; The non-local attention mechanism module consists of three branches θ, ,g generates the feature representation after dimensionality reduction, which is used to calculate the similarity between transformer lines and equipment features and perform weighting; The θ branch is used to reduce the dimension of the input features to 512 channels to generate the query vector query; The branch is also reduced to 512 channels to generate the key vector key, which is used to calculate the similarity with the query vector; the g branch is reduced to 512 channels to generate the value vector value of the input feature for weighted aggregation; Then, through θ and The similarity calculation generates the attention weight matrix , and compare it with the characteristics of the g branch Multiply them together to get the globally weighted feature representation , the formula is as follows: ; ; in, , q is the query vector, k is the key vector, is the dimension of the key vector; Finally, the globally weighted feature representation The number of channels is restored through 1×1 convolution, and the residual structure is used to retain the original features and the globally weighted features, combining local and global information to improve the perception ability of the model.
7. The substation foreign body intrusion detection method based on the improved YOLOv11 model according to claim 1 is characterized in that: In the step 1, before using the substation foreign object intrusion detection model to detect foreign objects in the substation, first obtain the equipment and line images of the substation for model training, and perform preprocessing operations, including reading the equipment and line image files of the substation into the memory, scaling the image to the 640×640 size supported by the model, and using Z-score normalization.
8. The substation foreign body intrusion detection method based on the improved YOLOv11 model according to claim 7 is characterized in that: In step 1, Z-score normalization converts the original data into a new data set with zero mean and unit variance by calculating the deviation of each data point from the mean of the data set and dividing it by the standard deviation of the data set; the calculation formula is as follows: ; Among them, Z is the normalized value; x is the original data point, i.e., a pixel value in the equipment and line image data of the substation or a line feature value in the feature map; μ is the mean of all image pixel values or feature values, is the standard deviation of the original data set.
9. The substation foreign body intrusion detection method based on the improved YOLOv11 model according to claim 1 is characterized in that: In step 3, when training the constructed substation foreign body intrusion detection model, the learning rate is set to 0.08; the model optimization algorithm adopts the AdamW optimization algorithm; the batch size is 32, and the number of iterations of the model is 400; In step 3, the AdamW optimizer, after initialization, defines a first-order matrix estimate m t and the second-order matrix estimate v t The initial values are m0=0, v0=0, and m is estimated by continuously updating the first-order matrix t and the second-order matrix estimate v t To calculate the bias-corrected first-order matrix estimate m t and the second-order matrix estimate v t , and finally update the optimization model parameter θ; its calculation formula is as follows: ; in Refers to the calculation of the gradient in the tth iteration, , refers to the first-order moment estimate and the second-order moment estimate of the t-th iteration, Refers to the decay rate of the first-order moment estimate, the value is 0.9, Refers to the decay rate of the second-order moment estimate, the value is 0.999, is a constant used to prevent the denominator from being zero; is the weight decay coefficient, which is used for regularization to prevent overfitting; Refers to the learning rate, which controls the size of each update step; , They represent the model parameters θ in the tth and t-1th iterations respectively.
10. Substation foreign body intrusion detection system based on improved YOLOv11 model, including camera and computer equipment, among which, The computer device comprises a memory and at least one processor; characterized in that, The memory stores executable code; when the processor executes the executable code, it is used to implement the substation foreign body intrusion detection method based on the improved YOLOv11 model as described in any one of claims 1 to 9 above.
Citation Information
Patent Citations
Human shape recognition system and method based on non-local attention mechanism
CN113449691A
Insect behavior identification method based on YOLO V7 and 2D convolutional network
CN117275084A
Vehicle target detection and identification method based on attention mechanism and dynamic convolution
CN118015595A
X-ray image contraband detection method based on multi-scale feature fusion
CN119295886A
Transformer fault detection method based on improved YOLOv8 model
CN119323565A
Cited By
Lightweight target detection method and device for unmanned aerial vehicle, equipment and medium
CN120047862A
Power scene water leakage and oil leakage monitoring method based on instance segmentation, medium and equipment
CN120472385A
Urban traffic rail invading foreign matter detection method based on improved YOLOv11
CN121746883A