Infrared image defect identification method for power switch cabinet equipment
By improving the YOLOv10 detection model, adding the SPAN attention module and the c2f feature extraction module, the problem of insufficient detection accuracy in infrared image defect detection in power switch cabinet is solved, and high-precision and real-time infrared image defect detection is achieved.
Patent Information
- Application Number
- CN202411799885.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The existing image detection method lacks detection accuracy in infrared image defect detection of power switch cabinets, especially under low contrast conditions, the leakage detection rate is high, the calculation complexity is high, the model parameters are large, making it difficult to achieve real-time detection.
Improve the YOLOv10 detection model, add the SPAN attention module and the c2f feature extraction module, enhance the infrared image defect detection model's ability to extract infrared image features and detection accuracy, and control the calculation burden to ensure the running speed of the model on infrared detection hardware.
It significantly improves the detection accuracy of infrared image defect detection, reduces the leakage detection rate, and realizes real-time application on resource-constrained power switch cabinet detection hardware.
Smart Images

Figure CN119649050A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image recognition, and in particular to a method for identifying infrared image defects of power switch cabinet equipment. Background Art
[0002] With the continuous development of infrared imaging technology, infrared images are increasingly used in various fields. In the power environment, infrared images are often used to analyze the use of power equipment. For power switchgear, which is located at a high position and in a complex environment, long-distance infrared imaging for defect detection is currently a common detection method.
[0003] However, due to the low resolution, high noise and low contrast of infrared images, it is difficult for traditional image recognition algorithms to achieve ideal results. For example, support vector machine (SVM) and K nearest neighbor (KNN) mainly rely on manually extracted features, and they perform poorly when processing high-noise and low-contrast infrared images, and it is difficult to achieve real-time detection.
[0004] In recent years, the YOLO series of algorithms have been tried to be applied to infrared image detection with their end-to-end, real-time, and efficient target detection capabilities. Through end-to-end feature learning, these methods have improved the detection performance to a certain extent and have achieved great success in the field of visible light images. The latest YOLOv10 algorithm has further optimized the detection accuracy and speed of the model. However, when the YOLOv10 algorithm is applied to the low-contrast characteristics of infrared images, it is not sensitive enough to the low-contrast target features unique to infrared images, and cannot fully utilize the spectral information of infrared images for target detection, resulting in a high missed detection rate; secondly, although the YOLOv10 algorithm improves detection accuracy, its computational complexity is high and the number of model parameters is too large, which makes it difficult to apply it in real time on resource-constrained infrared imaging equipment for power switch cabinet detection.
[0005] Therefore, it is necessary to study and optimize the problem of infrared image defect recognition of power switchgear equipment. Summary of the invention
[0006] The present invention aims to solve the technical problem that the existing image detection method has insufficient accuracy in detecting infrared image defects of power switch cabinets.
[0007] In order to solve the above technical problems, the present invention provides a method for identifying defects of infrared images of power switch cabinet equipment, comprising the following steps:
[0008] Acquire infrared images of the power switch cabinet equipment to be inspected;
[0009] Based on the YOLOv10 detection model, an infrared image defect detection model including the SPAN attention module and the c2f feature extraction module is constructed;
[0010] Based on the infrared image defect detection model, defect detection is performed on the infrared image of the power switch cabinet equipment to obtain an infrared image defect detection result.
[0011] Furthermore, the infrared image defect detection model includes an input network, a backbone network, a neck network and a head network, wherein:
[0012] The input network is used to pre-process the image data sent to the infrared image defect detection model;
[0013] The backbone network is used to extract a first image feature from the image data;
[0014] The neck network is used to process and fuse the first image features to obtain second image features;
[0015] The head network is used to perform target detection based on the second image feature and output a target detection result of a specific target in the image data.
[0016] Furthermore, the SPAN attention module is arranged in the neck network, and the neck network includes, in sequence according to the input and output logic order of the infrared image defect detection model:
[0017] A path aggregation layer, the path aggregation layer includes a plurality of processing units composed of an upsampling module, a feature concatenation module and a first c2f module connected in sequence;
[0018] A feature fusion layer, wherein the feature fusion layer sequentially comprises a convolution module, a first feature splicing module, a second c2f module, a downsampling module, a second feature splicing module and a c2fcib feature fusion module;
[0019] The SPAN attention modules include three modules, which are respectively arranged between the path aggregation layer and the feature fusion layer, after the second c2f module, and after the c2fcib feature fusion module;
[0020] The neck network comprises three output ends, wherein the first output end is located at the output end of the path aggregation layer, and is used to output the large-size image features extracted by the path aggregation layer;
[0021] The second output end is located at the output end of the second c2f module, and is used to output the medium-sized image features extracted by the second c2f module;
[0022] The third output terminal is located after the feature fusion layer, and is used to output the small-size image features extracted by the feature fusion layer;
[0023] The large-size image features, the medium-size image features, and the small-size image features are collectively used as the second image features output by the neck network and input into the head network.
[0024] Furthermore, the SPAN attention module performs pooling operations on the height and width of the input image feature tensor to aggregate them, and obtains the first feature enhancement signals in the height and width directions through 1*1 convolution and regularization processing;
[0025] The SPAN attention module also includes a multi-scale convolution unit composed of a plurality of convolution kernels of different sizes. After the first feature enhancement signal is aggregated with the input image feature, multi-scale feature extraction is performed through the multi-scale convolution unit to obtain a second feature enhancement signal;
[0026] The SPAN attention module also includes a soft attention mechanism unit, which is used to extract similarity weights between features in the input image features, and the second feature enhancement signal and the similarity weight are jointly used as the output of the SPAN attention module.
[0027] Furthermore, the c2f feature extraction module replaces the c2f module in the original backbone network of the YOLOv10 detection model and constitutes the backbone network of the infrared image defect detection model.
[0028] Furthermore, the c2f feature extraction module processes the input image features through local average pooling and global average pooling connected in sequence to obtain local features and global features, and then obtains the global attention weight through 1*1 convolution and adaptive average pooling.
[0029] The c2f feature extraction module also processes the output of the local average pooling through a 1*1 convolution and then activates it through a sigmoid activation function to obtain a local attention weight;
[0030] The c2f feature extraction module also includes a soft attention mechanism unit, which is used to extract similarity weights between features in the input image features. After the global attention weight and the local attention weight are combined, they are used together with the similarity weight as the output of the c2f feature extraction module.
[0031] Furthermore, when the global attention weight and the local attention weight are combined, a preset local weight parameter is used to control the combination ratio of the global attention weight and the local attention weight.
[0032] The beneficial effect achieved by the present invention is that a method for identifying infrared image defects of power switch cabinet equipment based on an improved YOLOv10 detection model is proposed. The method improves the existing YOLOv10 detection model by adding a SPAN attention module and a c2f feature extraction module to the network structure. These two modules effectively enhance the feature extraction capability and detection accuracy of the infrared image defect detection model for infrared images. At the same time, compared with the existing structure, the computational burden is not increased too much, the running speed of the detection model on the infrared detection hardware is guaranteed, and the problem of insufficient detection accuracy of infrared image defects of power switch cabinets by the existing methods is effectively solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic diagram of the steps of the infrared image defect recognition method for power switch cabinet equipment provided by an embodiment of the present invention;
[0034] Figure 2 Schematic diagram of the model structure of the original YOLOv10 detection model provided by an embodiment of the present invention;
[0035] Figure 3 Schematic diagram of the neck network structure of the infrared image defect detection model provided by an embodiment of the present invention;
[0036] Figure 4 is a structural diagram of a SPAN attention module of an infrared image defect detection model provided by an embodiment of the present invention;
[0037] Figure 5 It is a schematic diagram of the backbone network structure of the infrared image defect detection model provided by an embodiment of the present invention;
[0038] Figure 6 It is a schematic diagram of the structure of a C2F feature extraction module of an infrared image defect detection model provided by an embodiment of the present invention;
[0039] Figure 7 It is a schematic diagram of the test and comparison results of the infrared image defect detection model provided by an embodiment of the present invention and related detection methods on different data sets. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0041] For details, please refer to Figure 1 , Figure 1The present invention provides a method for identifying defects in an infrared image of a power switch cabinet device. The method comprises the following steps:
[0042] S101, obtaining an infrared image of a power switch cabinet device to be detected;
[0043] S102. Based on the YOLOv10 detection model, an infrared image defect detection model including a SPAN attention module and a c2f feature extraction module is constructed;
[0044] S103: Based on the infrared image defect detection model, perform defect detection on the infrared image of the power switch cabinet equipment to obtain an infrared image defect detection result.
[0045] In step S101, the infrared image of the power switch cabinet equipment can be obtained by photographing and collecting the power switch cabinet equipment through a specific infrared image acquisition device.
[0046] In the embodiment of the present invention, the infrared image defect detection model is obtained by improving the structure of the original YOLOv10 detection model. The model structure of the original YOLOv10 detection model is as follows: Figure 2 As shown, the infrared image defect detection model in the embodiment of the present invention is consistent with the original YOLOv10 detection model in terms of model structure. Specifically, the infrared image defect detection model includes an input network (Input), a backbone network (Backbone), a neck network (Neck) and a head network (Head), wherein:
[0047] The input network is used to pre-process the image data sent to the infrared image defect detection model;
[0048] The backbone network is used to extract a first image feature from the image data;
[0049] The neck network is used to process and fuse the first image features to obtain second image features;
[0050] The head network is used to perform target detection based on the second image feature and output a target detection result of a specific target in the image data.
[0051] Compared with the original YOLOv10 detection model, the embodiment of the present invention adds a SPAN attention module (Spectral Precision Augmented Attention Network) and a c2f feature extraction module (C2fPrecision Augmented Module). Please refer to Figure 3 , Figure 3: is a schematic diagram of the neck network structure of the infrared image defect detection model provided by an embodiment of the present invention, wherein the SPAN attention module is arranged in the neck network, and the neck network includes, in sequence, according to the input and output logic order of the infrared image defect detection model:
[0052] A path aggregation layer, wherein the path aggregation layer includes a plurality of processing units consisting of an upsampling module (Upsample), a feature concatenation module (Concat) and a first c2f module (c2f) connected in sequence;
[0053] A feature fusion layer, wherein the feature fusion layer sequentially includes a convolution module (Conv), a first feature splicing module, a second c2f module, a downsampling module, a second feature splicing module and a c2fcib feature fusion module;
[0054] The SPAN attention modules include three modules, which are respectively arranged between the path aggregation layer and the feature fusion layer, after the second c2f module, and after the c2fcib feature fusion module;
[0055] The neck network comprises three output ends, wherein the first output end is located at the output end of the path aggregation layer, and is used to output the large-size image features extracted by the path aggregation layer;
[0056] The second output end is located at the output end of the second c2f module, and is used to output the medium-sized image features extracted by the second c2f module;
[0057] The third output terminal is located after the feature fusion layer, and is used to output the small-size image features extracted by the feature fusion layer;
[0058] The large-size image features, the medium-size image features, and the small-size image features are collectively used as the second image features output by the neck network and input into the head network.
[0059] For details, please refer to Figure 4 , Figure 4 1 is a structural schematic diagram of a SPAN attention module of an infrared image defect detection model provided by an embodiment of the present invention. The SPAN attention module performs pooling operations on the height and width of the input image feature tensor to aggregate the input image feature, and obtains first feature enhancement signals in the height and width directions through 1*1 convolution and regularization processing (GroupNorm). This global information extraction method helps the SPAN attention module to better capture the overall structure and global texture of the image, thereby improving the model's ability to capture long-distance dependencies. When faced with complex visual tasks, this enhancement of the global field of view enables the model to have higher expressiveness when processing large scenes or large objects.
[0060] The SPAN attention module also includes a multi-scale convolution unit composed of multiple convolution kernels of different sizes. After the first feature enhancement signal is aggregated with the input image feature, the multi-scale feature extraction is performed through the multi-scale convolution unit to obtain the second feature enhancement signal; in the embodiment of the present invention, the multi-scale convolution unit is set to include 1*7, 7*1, 1*11, 11*1 convolution to process features, extract information from multiple receptive fields, and process the input image with convolution kernels of the same scale, which can effectively capture the multi-scale feature information in the image. This multi-scale convolution operation is particularly suitable for processing image features containing different levels of detail, and can better extract small local features and large-scale global features. Compared with the traditional single convolution kernel, the SPAN attention module in the embodiment of the present invention can capture information from different receptive fields, so that the model can more comprehensively understand the object structure and texture information in the image, thereby improving the accuracy of feature extraction.
[0061] The SPAN attention module also includes a soft attention mechanism unit (Softmax), which is used to extract the similarity weights between features in the input image features, and the second feature enhancement signal and the similarity weight are used together as the output of the SPAN attention module. The soft attention mechanism is implemented through the qkv (query, key, value) operation. This mechanism can dynamically adjust the importance of each image area, and by calculating the similarity weights between features, it can focus attention on more significant feature areas and improve the accuracy of feature selection. Through the above structure, the SPAN attention module in the embodiment of the present invention can more accurately extract the key features of the target object in complex scenes, and weaken the interference of background or irrelevant areas, so that the module shows strong robustness in tasks such as target detection and image classification, and can improve the recognition accuracy of the model for the target object.
[0062] Please refer to Figure 5 , Figure 5 It is a schematic diagram of the backbone network structure of the infrared image defect detection model provided by an embodiment of the present invention. The c2f feature extraction module replaces the c2f module in the backbone network of the original YOLOv10 detection model and constitutes the backbone network of the infrared image defect detection model.
[0063] For details, please refer to Figure 6 , Figure 61 is a schematic diagram of the structure of a C2F feature extraction module of an infrared image defect detection model provided by an embodiment of the present invention. The C2F feature extraction module processes input image features through local average pooling (local_arv_pool) and global average pooling (global_arv_pool) connected in sequence to obtain local features and global features, and then obtains global attention weights through 1*1 convolution and adaptive average pooling (Adaptive mean pooling);
[0064] The c2f feature extraction module also processes the output of the local average pooling through a 1*1 convolution, and then activates it through a sigmoid activation function to obtain a local attention weight; wherein, the global features input into the c2f feature extraction module are processed through local pooling and global pooling, and then further processed by global convolution. The local features are directly processed by local convolution after local pooling. Local convolution focuses on capturing local details of the image, while global convolution is good at processing the overall structure of the image and capturing full-text information. The combination of local convolution and global convolution can effectively adjust the number of channels of the feature map and perform multi-scale fusion, and can perform adaptive convolution kernel adjustment, that is, dynamically select the convolution kernel size according to the input size or the type of feature, so that the model can flexibly adjust the receptive field to adapt to different input features. In addition, the combination of local and global feature attention can integrate detailed information and global background, providing richer and more comprehensive features for the attention mechanism;
[0065] The c2f feature extraction module also includes a soft attention mechanism unit (Softmax Attention), which is used to extract the similarity weights between features in the input image features. After the global attention weight and the local attention weight are combined, they are used together with the similarity weight as the output of the c2f feature extraction module. The soft attention mechanism unit directly receives a branch from the input feature (X) for processing, performs self-attention calculation on the feature, and through matrix multiplication between q, k, and v, the c2f feature extraction module can adaptively select important feature information. This method helps to improve the network's response to important areas and reduce attention to redundant information, thereby improving the accuracy of image feature extraction.
[0066] Furthermore, when the global attention weight and the local attention weight are combined, a preset local weight parameter is used to control the combined ratio of the global attention weight and the local attention weight. During implementation, the parameter can be adjusted artificially to flexibly adapt to different image feature extraction tasks. For example, in tasks that need to emphasize local details, increasing the local weight will be more conducive to extracting more refined features, and when global information is needed, the increase in global weight can make the network pay more attention to the overall information and optimize feature expression.
[0067] The SPAN attention module proposed in the embodiment of the present invention extracts global information through adaptive pooling, captures details and global features through multi-scale convolution, uses a soft attention mechanism to accurately focus on important areas, and adopts a learnable weighted fusion of multi-scale features. Compared with traditional single convolution or fixed attention mechanisms, the SPAN attention module can flexibly handle complex scenes, more comprehensively understand image content, and dynamically optimize feature expression, significantly improving the accuracy and robustness of the model;
[0068] The c2f feature extraction module has a powerful image feature extraction capability through the combination of local and global feature extraction, and the integration of convolutional attention and soft attention. This module design not only improves the model's comprehensive understanding of local and global information, but also can flexibly adapt to different image features and contextual information, and has significant application prospects in computer vision tasks.
[0069] The results of the test comparison between the infrared image defect detection model proposed in the embodiment of the present invention and related detection methods on different data sets are as follows: Figure 7 As shown, it can be seen that the detection model ( Figure 7 Compared with other existing detection methods, the detection accuracy of the proposed method is higher, and it also has a good detection effect when it is actually applied to the scene of infrared image defect detection of power switch cabinets.
[0070] The beneficial effect achieved by the present invention is that a method for identifying infrared image defects of power switch cabinet equipment based on an improved YOLOv10 detection model is proposed. The method improves the existing YOLOv10 detection model by adding a SPAN attention module and a c2f feature extraction module to the network structure. These two modules effectively enhance the feature extraction capability and detection accuracy of the infrared image defect detection model for infrared images. At the same time, compared with the existing structure, the computational burden is not increased too much, the running speed of the detection model on the infrared detection hardware is guaranteed, and the problem of insufficient detection accuracy of infrared image defects of power switch cabinets by the existing methods is effectively solved.
[0071] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0072] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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 device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0073] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0074] The embodiments of the present invention are described above in conjunction with the accompanying drawings. What is disclosed is only the preferred embodiment of the present invention. However, the present invention is not limited to the above-mentioned specific implementation manner. The above-mentioned specific implementation manner is only illustrative rather than restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms and equivalent changes without departing from the scope of protection of the purpose of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A method for identifying defects in infrared images of power switch cabinet equipment, characterized in that: The following steps are involved: Acquire infrared images of the power switch cabinet equipment to be inspected; Based on the YOLOv10 detection model, an infrared image defect detection model including the SPAN attention module and the c2f feature extraction module is constructed; Based on the infrared image defect detection model, defect detection is performed on the infrared image of the power switch cabinet equipment to obtain an infrared image defect detection result.
2. The method for identifying defects in infrared images of power switch cabinet equipment according to claim 1, characterized in that: The infrared image defect detection model includes an input network, a backbone network, a neck network and a head network, wherein: The input network is used to pre-process the image data sent to the infrared image defect detection model; The backbone network is used to extract a first image feature from the image data; The neck network is used to process and fuse the first image features to obtain second image features; The head network is used to perform target detection based on the second image feature and output a target detection result of a specific target in the image data.
3. The method for identifying defects in infrared images of power switch cabinet equipment according to claim 2, characterized in that: The SPAN attention module is arranged in the neck network, and the neck network includes, in sequence according to the input and output logic order of the infrared image defect detection model: A path aggregation layer, the path aggregation layer includes a plurality of processing units composed of an upsampling module, a feature concatenation module and a first c2f module connected in sequence; A feature fusion layer, wherein the feature fusion layer sequentially comprises a convolution module, a first feature splicing module, a second c2f module, a downsampling module, a second feature splicing module and a c2fcib feature fusion module; The SPAN attention modules include three modules, which are respectively arranged between the path aggregation layer and the feature fusion layer, after the second c2f module, and after the c2fcib feature fusion module; The neck network comprises three output ends, wherein the first output end is located at the output end of the path aggregation layer, and is used to output the large-size image features extracted by the path aggregation layer; The second output end is located at the output end of the second c2f module, and is used to output the medium-sized image features extracted by the second c2f module; The third output terminal is located after the feature fusion layer, and is used to output the small-size image features extracted by the feature fusion layer; The large-size image features, the medium-size image features, and the small-size image features are collectively used as the second image features output by the neck network and input into the head network.
4. The method for identifying defects in infrared images of power switch cabinet equipment according to claim 3 is characterized in that: The SPAN attention module performs pooling operations on the height and width of the input image feature tensor to aggregate them, and obtains the first feature enhancement signal in the height and width directions through 1*1 convolution and regularization processing; The SPAN attention module also includes a multi-scale convolution unit composed of a plurality of convolution kernels of different sizes. After the first feature enhancement signal is aggregated with the input image feature, multi-scale feature extraction is performed through the multi-scale convolution unit to obtain a second feature enhancement signal; The SPAN attention module also includes a soft attention mechanism unit, which is used to extract similarity weights between features in the input image features, and the second feature enhancement signal and the similarity weight are jointly used as the output of the SPAN attention module.
5. The method for identifying defects in infrared images of power switch cabinet equipment according to claim 2, characterized in that: The c2f feature extraction module replaces the c2f module in the original backbone network of the YOLOv10 detection model and constitutes the backbone network of the infrared image defect detection model.
6. The method for identifying defects in infrared images of power switch cabinet equipment according to claim 5, characterized in that: The c2f feature extraction module processes the input image features through local average pooling and global average pooling connected in sequence to obtain local features and global features, and then obtains the global attention weight through 1*1 convolution and adaptive average pooling. The c2f feature extraction module also processes the output of the local average pooling through a 1*1 convolution and then activates it through a sigmoid activation function to obtain a local attention weight; The c2f feature extraction module also includes a soft attention mechanism unit, which is used to extract similarity weights between features in the input image features. After the global attention weight and the local attention weight are combined, they are used together with the similarity weight as the output of the c2f feature extraction module.
7. The method for identifying defects in infrared images of power switch cabinet equipment according to claim 5, characterized in that: When the global attention weight and the local attention weight are combined, a preset local weight parameter is used to control the combination ratio of the global attention weight and the local attention weight.
Citation Information
Patent Citations
Power equipment infrared image defect detection method based on improved YOLOv5 algorithm
CN116091424A
Industrial part surface defect detection method and device based on YOLOv8
CN118333940A
Tube plate defect identification and detection method based on machine vision
CN118864430A
Image processing method, image processing apparatus, electronic device and computer-readable storage medium
WO2022154471A1