Method, device, equipment and medium for detecting internal defects of power equipment
By employing feature map classification and fusion methods, and utilizing attention mechanisms and prediction models, the problems of noise interference and complex background in the detection of internal defects in power equipment are solved, enabling efficient identification and accurate detection of minute defects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2026-03-20
AI Technical Summary
Existing technologies for detecting internal defects in power equipment suffer from problems such as noise interference, complex backgrounds, and difficulty in identifying minute defect targets, which increases the difficulty of detection.
A feature map classification and fusion method based on attention mechanism is adopted. By classifying the number of channels in the feature map, extracting attention weight features, and training the prediction model, the fusion capability of the feature map is improved, and internal defects of power equipment can be identified.
It improves the accuracy of internal defect detection in power equipment, reduces the false detection rate, and enhances the ability to identify minute defects.
Smart Images

Figure CN119540607B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power equipment detection, in particular to a power equipment internal defect detection method, device, equipment and medium. BACKGROUND
[0002] In the process of power system maintenance, the detection of power equipment is crucial. The detection of internal defects in power equipment usually adopts X-ray image detection, a non-destructive detection method. However, in actual application, this detection method faces many challenges. On the one hand, various noises often inevitably exist in X-ray images, which may come from the detection equipment itself, interference from the surrounding environment, and many other factors. On the other hand, the background of the image is often complex and may contain many elements unrelated to the defect target, making it difficult for the defect target to stand out clearly in such a background. In addition, some defect targets of power equipment are very small, which may only be a tiny crack or a local change in material, further increasing the difficulty of defect detection. When detecting these small defects, not only high-resolution detection equipment is needed, but also advanced image processing algorithms are needed to accurately identify and locate these small defect targets. SUMMARY
[0003] The present application provides a power equipment internal defect detection method, device, equipment and medium, which can improve the accuracy and reduce the false detection rate when detecting defects in power equipment.
[0004] The present application provides a power equipment internal defect detection method, which comprises:
[0005] Obtaining an internal image of a power equipment and generating a plurality of feature maps based on the internal image of the power equipment;
[0006] Classifying each feature map based on the number of channels of each feature map to obtain a plurality of feature image groups;
[0007] Performing feature extraction processing on the feature image groups based on attention weights, and generating output feature maps corresponding to the feature image groups according to the image features obtained after the feature extraction processing;
[0008] Fusing the output feature maps corresponding to each feature image group to obtain a fused feature map;
[0009] Determining a target object in the fused feature map and taking the target object as a defect in the internal image of the power equipment.
[0010] Optionally, the method comprises:
[0011] classify each of the feature maps into a first image group or a second image group based on a resolution of each of the feature maps, wherein a resolution of each feature map in the first image group is lower than a resolution of each feature map in the second image group;
[0012] convert each feature map in the first image group into a feature map of a preset number of channels;
[0013] arrange each feature map of the preset number of channels in a preset order to generate an optimized feature map, wherein each feature map of the preset number of channels serves as a pixel of the optimized feature map.
[0014] Optionally, the feature extraction processing of the feature image group based on the attention weights and the generation of the output feature map corresponding to the feature image group according to the image features obtained after the feature extraction processing include:
[0015] the feature extraction processing of the feature image group through a plurality of parallel paths of preset attention weights, wherein the feature extraction processing of the feature image group is performed through a first parallel path and a second parallel path to obtain a first feature corresponding to the first parallel path and a second feature corresponding to the second parallel path;
[0016] the aggregation processing of the first feature and the second feature, and the generation of the output feature map corresponding to the feature image group according to the image features obtained after the aggregation processing.
[0017] Optionally, the feature extraction processing of the feature image group through a plurality of parallel paths of preset attention weights includes:
[0018] the pooling processing of the feature maps of the feature image group according to a first direction and a second direction to obtain a first image feature corresponding to the first direction and a second image feature corresponding to the second direction;
[0019] the weighting processing of the first image feature and the second image feature;
[0020] the convolution processing of the weighted first image feature and the weighted second image feature to obtain a weighted image feature as the first feature.
[0021] Optionally, the aggregation processing of the first feature and the second feature and the generation of the output feature map corresponding to the feature image group according to the image features obtained after the aggregation processing include:
[0022] the generation of a first feature map corresponding to the first feature and a second feature map corresponding to the second feature;
[0023] performing a global average pooling operation on the first feature map and the second feature map respectively to obtain a weight vector corresponding to the first feature map and a weight vector corresponding to the second feature map;
[0024] performing a matrix dot product operation on the weight vector corresponding to the first feature map and the weight vector corresponding to the second feature map to obtain a relationship strength value between the first feature map and the second feature map;
[0025] determining an attention weight ratio value between the first feature map and the second feature map based on a preset binary classification function;
[0026] performing a weighted sum operation on each feature pair between the first feature map and the second feature map according to the relationship strength value and the attention weight ratio value to generate a weighted feature map as the output feature map.
[0027] Optionally, the determining the target object in the fusion feature map and taking the target object as a defect in the internal power equipment in the internal power equipment image comprises:
[0028] generating a prediction box in the fusion feature map using a preset prediction model;
[0029] obtaining the target object through the prediction box, wherein the target object is an identifier in the prediction box;
[0030] taking the target object as a defect in the internal power equipment in the internal power equipment image.
[0031] Optionally, the determining the target object in the fusion feature map and taking the target object as a defect in the internal power equipment in the internal power equipment image comprises:
[0032] determining an overlap degree value between the prediction box and the real box;
[0033] generating a soft label based on the overlap degree value;
[0034] constructing a loss function between the soft label and a classification score, wherein the classification score is used to evaluate the ability of the preset prediction model to identify and classify the identifier in the fusion feature map;
[0035] training the prediction model based on the loss function between the soft label and the classification score, and generating the prediction box in the fusion feature map using the trained prediction model.
[0036] Optionally, the determining the target object in the fusion feature map and taking the target object as a defect in the internal power equipment in the internal power equipment image comprises:
[0037] When the prediction box is generated, a center point coordinate of the prediction box and a width and a height of the prediction box are determined;
[0038] Based on the center point coordinate, the height, the width and the overlap degree value, a loss function between the prediction box and the real box is constructed;
[0039] Based on the loss function between the prediction box and the real box, the prediction model is trained, and the trained prediction model is used to generate the prediction box in the fusion feature map.
[0040] The application also provides an internal defect detection device for power equipment, which comprises:
[0041] An input module is configured to acquire an internal image of power equipment and generate a plurality of feature maps based on the internal image of power equipment;
[0042] A grouping module is configured to classify each feature map based on the number of channels of each feature map to obtain a plurality of feature image groups;
[0043] A feature enhancement module is configured to perform feature extraction processing on the feature image groups based on attention weights and generate output feature maps corresponding to the feature image groups according to image features obtained after the feature extraction processing;
[0044] A feature fusion module is configured to perform fusion processing on the output feature maps corresponding to each feature image group to obtain a fusion feature map;
[0045] An output module is configured to determine a target object in the fusion feature map and take the target object as an internal defect of power equipment in the internal image of power equipment.
[0046] The application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the above internal defect detection methods for power equipment when executing the computer program.
[0047] The application also provides a computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement any of the above internal defect detection methods for power equipment.
[0048] The application has at least the following beneficial effects:
[0049] This scheme classifies feature maps and extracts features from the classified feature maps according to attention weights. By using an attention mechanism, each feature is enhanced, thereby improving the feature extraction capability. Then, the enhanced features are fused to obtain a fused feature map, which facilitates the identification of target objects from the fused feature map. This allows for more accurate identification of internal defects in power equipment images, improving accuracy and reducing false detection rates when detecting defects in power equipment. Attached Figure Description
[0050] The accompanying drawings are provided to further understand the technical solutions of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the technical solutions of the present invention, and do not constitute a limitation on the technical solutions of the present invention.
[0051] Figure 1 This is a flowchart illustrating the steps of a method for detecting internal defects in power equipment.
[0052] Figure 2 This is a schematic diagram of the RTMdet target detection algorithm model architecture in a method for detecting internal defects in power equipment;
[0053] Figure 3 This is a schematic diagram of the neck network architecture in a method for detecting internal defects in power equipment;
[0054] Figure 4 This is a flowchart of step S103 in a method for detecting internal defects in power equipment.
[0055] Figure 5 This is a flowchart of step S202 in a method for detecting internal defects in power equipment.
[0056] Figure 6 This is a schematic diagram of an attention mechanism network architecture used in a method for detecting internal defects in power equipment.
[0057] Figure 7 This is a flowchart of step S104 in a method for detecting internal defects in power equipment.
[0058] Figure 8 This is a flowchart of the first step in training a prediction model in a method for detecting internal defects in power equipment.
[0059] Figure 9 This is a flowchart of the second step in training a prediction model in a method for detecting internal defects in power equipment.
[0060] Figure 10 This is a schematic diagram of a device for detecting internal defects in power equipment.
[0061] Figure 11It is a structural schematic diagram of a power equipment. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.
[0063] It should be noted that, as the use of power equipment becomes more widespread, the detection of internal defects thereof becomes particularly important. Traditional defect detection methods often rely on manual inspection or simple image processing techniques, which are low in efficiency and limited in accuracy.
[0064] In order to solve these problems, the prior art scheme proposes a power equipment internal defect detection method based on X-ray images. As a non-destructive testing technology, X-ray images can provide clear images of the internal structure of power equipment, helping to identify potential defects. However, there are often noises and complex backgrounds in X-ray images, and some defect targets are very small, which increases the difficulty of defect detection.
[0065] Reference is made to Figure 1 , Figure 1 It is a step flow chart of a power equipment internal defect detection method.
[0066] In a first aspect, the present embodiment provides a power equipment internal defect detection method, which comprises:
[0067] S101, obtaining an internal image of a power equipment, and generating a plurality of feature maps based on the internal image of the power equipment.
[0068] S102, classifying each feature map based on the number of channels of each feature map to obtain a plurality of feature image groups.
[0069] S103, performing feature extraction processing on the feature image groups based on attention weights, and generating an output feature map corresponding to the feature image groups according to the image features obtained after the feature extraction processing.
[0070] S104, performing fusion processing on the output feature map corresponding to each feature image group to obtain a fusion feature map.
[0071] S105, determining a target object in the fusion feature map, and taking the target object as a defect body in the internal image of the power equipment.
[0072] In one specific embodiment, the internal image of the power equipment is an X-ray image.
[0073] Reference is made to Figure 2In some embodiments, the internal defect detection method of the power equipment of some embodiments can be implemented through an RTMdet target detection algorithm model. The macroscopic architecture of the algorithm model can be divided into a backbone part, a neck part, and a head part. After the internal image of the power equipment passes through the backbone part (Backbone), the neck part (Neck), and the head part (Heads) in turn, the defects in the internal image of the power equipment are labeled.
[0074] In step S101 of some embodiments, after the input internal image of the power equipment is processed by multiple convolutional layers in the backbone network, a series of feature maps with different scales and depths are generated. Each convolutional operation gradually abstracts and extracts features from the image, resulting in multiple scale feature maps that effectively encode different image information.
[0075] In step S101 of some embodiments, when the internal image of the power equipment is input to the backbone part of the algorithm model, the resolution of the feature maps is higher in the first few layers of the backbone part. These shallow feature maps can capture detailed information in the image, such as edges, textures, and small shape features. Because these feature maps have a higher spatial resolution, they retain more local information and fine structural details, which are important for identifying small objects and precise boundaries in the image.
[0076] As the network depth increases, the number and complexity of convolutional layers gradually increase, and the resolution of these deep feature maps gradually decreases. Deep feature maps reduce spatial dimensions through pooling operations or stride convolution during processing, but they can capture higher-level semantic information. They integrate a large amount of local information in the global context of the image, forming more abstract and semantic feature representations. Such feature maps are very helpful for identifying large-scale structures, overall shapes, and complex scene understanding.
[0077] It can be understood that different levels of feature maps provide information from details to semantics through multi-level abstraction of deep convolution, enabling the target detection and image analysis tasks to more accurately understand and process the input image.
[0078] It can be understood that in the neck part of the algorithm model, the PAFPN is composed of the Feature Pyramid Network (FPN) and the Path Aggregation Network (PAN), i.e., the “neck network” of the algorithm, which is used to perform deep fusion and processing on the feature maps extracted by the backbone part.
[0079] Feature Pyramid Network (FPN) is a network structure for multi-scale feature fusion. It generates a feature pyramid from bottom to top, preserving the semantic information of the image at different scales. FPN enhances the network's ability to detect targets at different scales by fusing low-level and high-level features of the backbone network. In FPN, low-level feature maps (high resolution) are upsampled and fused with high-level feature maps (low resolution), which can restore image details while preserving semantic information.
[0080] Please refer to Figure 3 Path Aggregation Network (PAN) further improves the flow and fusion of feature information. PAN connects feature maps of different levels through a path aggregation mechanism, enhancing the flow of information between feature maps. It uses horizontal and vertical connections of feature maps to optimize the propagation and fusion of features, improving the expression ability and detection performance of feature maps. The design of PAN enables the network to better integrate feature information from different levels, improving the accuracy and robustness of target detection. Two path aggregation modules cooperate with each other to form the core structure of the Neck network.
[0081] It can be understood that the head of the algorithm model mainly performs final classification and bounding box regression on the image features passed from Backbone and Neck.
[0082] In step S102 of some embodiments, the feature maps are grouped by channels, and horizontal and vertical adaptive average pooling is used to capture feature information in different directions. Let the original input tensor X ∈ R C×H×W is the intermediate feature map, where C represents the number of input channels, H and W represent the height and width of the input feature, respectively. Therefore, the one-dimensional global average pool that encodes global information along the horizontal dimension of C at height H can be represented as:
[0083]
[0084] where xc represents the input feature of the cth channel. Similarly, the pooling output with width W in C can be represented as:
[0085]
[0086] It can be understood that in deep learning and computer vision, the number of channels of a feature map refers to the depth of the feature map in a given spatial dimension (i.e., height and width). More specifically, when we process an image through a convolutional neural network (CNN), each layer of convolution will output one or more feature maps, each of which is a representation of the input image in a certain feature space.
[0087] In image processing, each pixel point has only one color value (for grayscale images) or three color values (for RGB color images) in the original image. In a feature map, each pixel point can correspond to multiple feature values, and the set of these feature values constitutes the representation of the pixel point in the feature space. The number of feature values is the number of channels of the feature map. The more channels, the richer the feature information contained in the feature map. For example, in an image classification task, different channels may capture different visual features, such as edges, textures, colors, etc.
[0088] The embodiment classifies the feature map and extracts features from the classified feature map according to the attention weight, thereby enhancing each feature through the attention mechanism, improving the feature extraction capability, and then fusing the enhanced features to obtain a fused feature map, which facilitates determining the target object from the fused feature map to more accurately determine the defects in the power equipment, which is beneficial to improving the accuracy and reducing the false detection rate when detecting defects in power equipment.
[0089] Please refer to Figure 4 , Figure 4 is a step flowchart of step S103 in the power equipment internal defect detection method.
[0090] In some embodiments, step S103 comprises:
[0091] S201, performing feature extraction processing on the feature image group through multiple parallel paths of preset attention weights, wherein the feature image group is processed through a first parallel path and a second parallel path to obtain a first feature corresponding to the first parallel path and a second feature corresponding to the second parallel path.
[0092] S202, performing aggregation processing on the first feature and the second feature, and generating an output feature map corresponding to the feature image group according to the aggregated image features.
[0093] In step S201 of some embodiments, after being divided into multiple feature image groups, for each feature image group, multiple parallel paths are used to perform feature extraction processing on the feature image group to extract attention weight descriptors of the feature image group, wherein the first parallel path includes a 1x1 convolution branch, and the second parallel path includes a 3x3 convolution branch, which are responsible for extracting features of different scales, respectively.
[0094] In some embodiments, the specific implementation of the step of performing feature extraction processing on the feature image group through multiple parallel paths of preset attention weights comprises:
[0095] According to the first direction and the second direction, the feature maps of the feature image group are subjected to pooling processing to obtain first image features corresponding to the first direction and second image features corresponding to the second direction; the first image features and the second image features are subjected to weighting processing; and the first image features after the weighting processing and the second image features after the weighting processing are subjected to convolution processing to obtain weighted image features and take the weighted image features as the first features.
[0096] In the embodiment, after the feature maps of the feature image group are subjected to the pooling processing, the feature maps after the pooling are spliced in the channel dimension, subjected to 1x1 convolution processing, and weighted horizontal features and weighted vertical features are obtained, the weighted horizontal features are taken as the first image features, and the weighted vertical features are taken as the second image features.
[0097] In step S202 of some embodiments, feature aggregation is enriched by providing a cross-space information aggregation method in different spatial dimension directions. The output of the 1x1 branch encodes the global spatial information through two-dimensional global average pooling, while the output of the 3x3 branch is directly converted into the corresponding dimension shape, and then the outputs are aggregated through a matrix dot product operation to generate the first spatial attention map. The output feature maps within each group are aggregated through the Sigmoid function of the two generated spatial attention weight values, capturing pixel-level pairing relationships and highlighting the global context of all pixels. The final output is a feature map with the same size as the input, effectively normalizing the feature map and applying the calculated attention weight to the feature map using a sigmoid activation function, enhancing feature representation.
[0098] Please refer to Figure 5 , Figure 5 A step flowchart of step S202 in a power equipment internal defect detection method.
[0099] In some embodiments, step S202 includes:
[0100] S301, generating a first feature map corresponding to first features and a second feature map corresponding to second features.
[0101] S302, respectively performing global average pooling operations on the first feature map and the second feature map to obtain a weight vector corresponding to the first feature map and a weight vector corresponding to the second feature map.
[0102] S303, performing a matrix dot product operation on the weight vector corresponding to the first feature map and the weight vector corresponding to the second feature map to obtain a relationship strength value between the first feature map and the second feature map.
[0103] S304, determining an attention weight ratio value between the first feature map and the second feature map based on a preset binary classification function.
[0104] S305, according to the relationship strength value and the attention weight ratio value, each feature pair between the first feature map and the second feature map is weighted and summed to generate a weighted feature map as an output feature map.
[0105] It can be understood that in step S302, the global average pooling is a kind of pooling operation, which averages all elements of the entire feature map (or a group of feature maps) to obtain a single numerical value. For a given feature map, if its size is CxHxWCxHxW (where C is the number of channels, H is the height, and W is the width), the global average pooling outputs a tensor with a size of Cx1x1Cx1x1, and the output of each channel is the average of all elements in the corresponding channel.
[0106] In step S303, in the attention mechanism, the global average pooling is usually used to generate an attention descriptor or a weight vector. These descriptors can interact with other features through matrix multiplication to calculate the final attention weight. For example, if the global average pooling is applied to two feature maps respectively, two descriptor vectors are obtained. By calculating the dot product of the two descriptor vectors through matrix multiplication, a scalar value can be obtained, which can be interpreted as the similarity or the strength of the corresponding relationship between the two feature maps, i.e. the relationship strength value.
[0107] In step S304, after obtaining the relationship strength value, the attention weight value of each feature map is calculated by the softmax function or the sigmoid function, and the ratio between the attention weight value of the first feature map and the attention weight value of the second feature map is the attention weight ratio value. The attention weight value represents the importance of each feature map in feature fusion or weighted summation. For example, in the self-attention mechanism, the attention weight of each feature map is calculated by the softmax function, ensuring that the weight sum of all feature maps is 1.
[0108] In step S305, the attention weight is calculated by global average pooling and matrix multiplication, and the final weighted feature map is generated by combining the attention information in the horizontal and vertical directions.
[0109] Please refer to Figure 6 In this embodiment, an attention mechanism is used to realize an internal defect detection method of power equipment to generate an output feature map corresponding to a feature image group. Specifically, the feature image group is processed by a first parallel path with two 1x1 convolution branches, a second parallel path with a 3x3 convolution branch, and aggregated by a cross-space learning method after pooling, convolution and other processing, and an output feature map corresponding to the feature image group is generated.
[0110] It can be understood that the embodiment effectively fuses multi-scale and cross-space feature information, improves the expression ability of the feature map, and reduces the calculation complexity through an efficient calculation method.
[0111] Please refer to Figure 7 , Figure 7 It is a step flow chart of step S104 in the power equipment internal defect detection method.
[0112] In some embodiments, step S104 comprises:
[0113] S401, generating a prediction box in the fusion feature map by using a preset prediction model.
[0114] S402, obtaining a target object through the prediction box, wherein the target object is an identifier in the prediction box.
[0115] S403, taking the target object as a defect body in the power equipment internal image.
[0116] Please refer to Figure 8 , Figure 8 It is a first step flow chart of training the prediction model in the power equipment internal defect detection method.
[0117] In some embodiments, on the basis of the above-mentioned embodiments, the power equipment internal defect detection method further comprises training the prediction model, and the specific way of training the prediction model comprises:
[0118] S501, determining the overlap degree value between the prediction box and the real box.
[0119] S502, generating a soft label based on the overlap degree value.
[0120] S503, constructing a loss function between the soft label and the classification score, wherein the classification score is used to evaluate the ability of the preset prediction model to identify and classify the identifier in the fusion feature map.
[0121] S504, training the prediction model based on the loss function between the soft label and the classification score, and generating a prediction box in the fusion feature map by using the trained prediction model.
[0122] In one specific embodiment, for each prediction box, the Intersection over Union (IoU) between the prediction box and the ground truth box is calculated as the overlap degree value. The IoU is a value between 0 and 1, representing the degree of overlap between the prediction box and the ground truth box. For example, if the IoU is 0.7, it means that the prediction box has 70% of the area overlapping with the ground truth box. In this embodiment, the loss function between the soft label and the classification score is a classification loss function Loss cls, which adopts Quality Focal Loss (QFL) that combines the classification score with the detection box IoU, proposes a soft label associated with the IoU, and changes the actual label of the target to a continuous value. The Loss calculation formula is as follows:
[0123]
[0124] wherein y is a quality label of 0-1, and sigma is a predicted value.
[0125] Please refer to Figure 9 , Figure 9 is a second step flowchart of training a prediction model in a power equipment internal defect detection method.
[0126] In some embodiments, on the basis of the above-mentioned embodiments, the power equipment internal defect detection method further comprises training the prediction model, and the specific manner of training the prediction model comprises:
[0127] S601, when a prediction box is generated, determining the center point coordinates of the prediction box and the width and height of the prediction box.
[0128] S602, based on the center point coordinates, the height, the width, and the overlap degree value, constructing a loss function between the prediction box and the ground truth box.
[0129] S603, based on the loss function between the prediction box and the ground truth box, training the prediction model, and generating a prediction box in the fused feature map using the trained prediction model.
[0130] In one specific embodiment, the center point coordinates of the prediction box are (cx, cy), the width is w, and the height is h. In this embodiment, the loss function between the prediction box and the ground truth box is CIoU Loss, and CIoU Loss is defined as:
[0131]
[0132] wherein b, b gt represent the center points of the prediction box and the ground truth box respectively, and p represents the Euclidean distance between the two center points. c represents the diagonal length of the smallest circumscribed rectangle that can contain both the prediction box and the ground truth box, alpha is a weight function, and v is used to measure the consistency of the width-height ratio.
[0133] In some embodiments, on the basis of the above-mentioned embodiments, the power equipment internal defect detection method further comprises:
[0134] Based on the resolution of each feature map, each feature map is classified into a first image group or a second image group, wherein the resolution of each feature map in the first image group is lower than the resolution of each feature map in the second image group; each feature map in the first image group is converted into a feature map of a preset channel number; and each feature map of the preset channel number is arranged in a preset order to generate an optimized feature map, wherein each feature map of the preset channel number serves as a pixel of the optimized feature map.
[0135] In one specific embodiment of the present embodiment, efficient image up-sampling is achieved by combining convolution operation and pixel shuffling technology. First, the convolution layer converts the low-resolution image into a feature map with a high number of channels, and then the pixel shuffling operation rearranges these high-channel feature maps into a higher-resolution space. Pixel shuffling is a pixel rearrangement operation, which rearranges each feature map of a preset channel number in a preset order to generate an optimized feature map, thereby increasing the size and resolution of the feature map. The present embodiment enhances the feature extraction capability while strengthening the network up-sampling process, thereby improving the high-quality feature map for subsequent network operations. Finally, efficient and high-quality feature extraction and fusion are achieved.
[0136] It can be understood that the present embodiment implements an improved version of the RTMdet algorithm, which enhances the detection capability of internal defects of power equipment by optimizing the feature fusion processing step, and replaces the original loss function with a more advanced loss function to improve the detection classification capability. The improved RTMdet algorithm uses deep convolutional networks and multi-scale feature fusion technology, which can effectively improve the detection accuracy and robustness. The results show that this method has high detection accuracy and low false detection rate in processing X-ray images of power equipment defects, providing strong support for the maintenance and safe operation of power equipment.
[0137] The present application also provides an embodiment of the application of a power equipment internal defect detection method in a specific scenario. In the present embodiment, Python is used as the programming language, the experimental equipment uses a server Ubantu 18.04 system, the server performance is i9-10900X CPU, the GPU is 3090, and the running memory is 24 GB.
[0138] The detected power equipment is a GIS (gas insulated switch) internal disc insulator. The data set of the basin insulator used in the experiment is obtained by an X-ray machine. The detailed classification of the basin insulator defect types is shown in Table 1. The data set division is as follows: training set 60%, validation set 25%, and test set 15%.
[0139] Table 1 - Detailed classification table for detecting defect types
[0140]
[0141] In order to show the advanced performance of the improved algorithm of the present application, a comparative experiment is carried out with the mainstream algorithm YOLOv8, and the following performance evaluation indicators are used to evaluate the model performance:
[0142]
[0143]
[0144]
[0145] Among them, precision represents the accuracy of the classifier in correctly identifying the defect position, recall represents the ability of the classifier to cover the position. TP represents the positive sample classified as correct, FP represents the positive sample classified as incorrect, and FN represents the negative sample classified as incorrect. AP is the area surrounded by the horizontal and vertical axes in the Precision-Recall curve. The performance index evaluation comparison is shown in the following Table 2.
[0146] Table 2 - Experimental result evaluation index comparison data table
[0147]
[0148] From the above results, it can be seen that the improved RTMdet proposed in this scheme has a great improvement in detection accuracy compared with the mainstream YOLOv8 algorithm, proving the advanced nature of the algorithm improvement, and at the same time, it is proved that the improved algorithm of the present application is very suitable for internal defect detection of power equipment in X-ray images, effectively solving the problem that the difficulty of defect detection is increased due to the existence of noise, complex background and small defect targets in X-ray images.
[0149] Reference Figure 10 , Figure 10 is a structural schematic diagram of a power equipment internal defect detection device.
[0150] In a second aspect, the embodiment provides a power equipment internal defect detection device, which comprises:
[0151] The input module 701 is configured to acquire an internal image of the power equipment and generate a plurality of feature maps based on the internal image of the power equipment.
[0152] The grouping module 702 is configured to classify each feature map based on the number of channels of each feature map to obtain a plurality of feature image groups.
[0153] The feature enhancement module 703 is configured to perform feature extraction processing on the feature image group based on the attention weight, and generate an output feature map corresponding to the feature image group according to image features obtained after the feature extraction processing.
[0154] The feature fusion module 704 is configured to perform fusion processing on the output feature map corresponding to each feature image group to obtain a fusion feature map.
[0155] The output module 705 is configured to determine a target object in the fusion feature map, and take the target object as a defect in the internal image of the power equipment.
[0156] Those skilled in the art can understand that all or some of the steps in the above disclosed method can be implemented as software, firmware, hardware and their appropriate combinations. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. As known to those skilled in the art, communication media generally includes computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery medium
[0157] It can be understood that the contents in the above method embodiments are applicable to the device embodiments, the device embodiments specifically implement the functions of the above method embodiments, and achieve the same beneficial effects as the above method embodiments.
[0158] In a third aspect, the embodiments of the present application provide an electronic device, which comprises a memory and a processor. The memory stores a computer program, and the processor implements any of the above power equipment internal defect detection methods when executing the computer program.
[0159] Reference Figure 11 , Figure 11The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device comprises:
[0160] The processor 801 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is configured to execute related programs to implement the technical solutions provided by the embodiments of the present application.
[0161] The memory 802 can be implemented by a ROM (ReadOnly Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory), and the like. The memory 802 can store operation devices and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 802 and are called and executed by the processor 801 to implement the power equipment internal defect detection method of the embodiments of the present application.
[0162] The input / output interface 803 is configured to realize information input and output.
[0163] The communication interface 804 is configured to realize the communication interaction between the device and other devices. The communication can be realized by a wired manner (for example, a USB, a network cable, and the like) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, and the like).
[0164] The bus 805 is configured to transmit information between various components (for example, the processor 801, the memory 802, the input / output interface 803, and the communication interface 804) of the device.
[0165] The processor 801, the memory 802, the input / output interface 803, and the communication interface 804 are connected to each other through the bus 805.
[0166] It can be understood that the contents in the above method embodiments are all applicable to the electronic device embodiments, the electronic device embodiments specifically implement the same functions as the above method embodiments, and achieve the same beneficial effects as the above method embodiments.
[0167] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, wherein a processor executable program is stored, and the processor executable program is executed by a processor to implement the power equipment internal defect detection method according to any one of the above embodiments.
[0168] The embodiment of the present application further discloses a computer program product, including a computer program or computer instructions, the computer program or computer instructions are stored in a computer readable storage medium, a processor of a computer device reads the computer program or computer instructions from the computer readable storage medium, and the processor executes the computer program or computer instructions, so that the computer device executes the power equipment internal defect detection method as described in any of the preceding embodiments.
[0169] It can be understood that the contents in the method embodiments are applicable to the storage medium embodiments, the storage medium embodiments specifically implement the functions of the method embodiments, and achieve the same beneficial effects as the method embodiments.
[0170] The terms "first", "second", "third", "fourth" and the like in the description of the application and in the claims, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of accomplishing bodily the same aspects except where explicitly contextually dictated herein. Moreover, the terms "include", "have" and their derivatives, wherein any of these terms are used, are intended to be curative in the sense of permitting singular inclusion of elements or steps just as they are in the sense of "comprising", "containing" or "having" elements or steps. It is to be understood that the terminology only is selected and dropped in a sense as the detailed description of the application progresses. In this regard, no requirement exists for any of the appended claims to include in their recitation elements in order to implement the application.
[0171] In several embodiments provided by the present application, it should be understood that the disclosed device, device and method can be implemented by other ways. For example, the device embodiments described above are only schematic, and the division of the units is only a logical function division, and there can be another division way in actual implementation, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0172] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0173] In addition, each of the function units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0174] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0175] Although the description of the present application has been quite detailed and particularly described with respect to several described embodiments, it is not intended to be limited to any of these details or embodiments or any special embodiment, but should be considered to effectively cover the intended scope of the present application by referring to the appended claims, taking into account the broadest possible interpretation of these claims in view of the prior art. In addition, the present application is described above in embodiments that the inventors can foresee, and the purpose is to provide a useful description, and non-essential modifications to the present application that have not yet been foreseen can still represent equivalent modifications of the present application.
Claims
1. A method for detecting internal defects in power equipment, characterized in that, The method includes: Acquire internal images of power equipment and generate multiple feature maps based on the internal images of the power equipment; Based on the number of channels in each feature map, each feature map is classified to obtain multiple feature image groups; The feature image group is processed by multiple parallel paths with preset attention weights to extract features. Specifically, the feature image group is processed by a first parallel path and a second parallel path to obtain a first feature corresponding to the first parallel path and a second feature corresponding to the second parallel path. Generate a first feature map corresponding to the first feature and a second feature map corresponding to the second feature; Global average pooling is performed on the first feature map and the second feature map respectively to obtain the weight vector corresponding to the first feature map and the weight vector corresponding to the second feature map. Perform a matrix dot product operation on the weight vector corresponding to the first feature map and the weight vector corresponding to the second feature map to obtain the relationship strength value between the first feature map and the second feature map; Based on the sigmoid function, the attention weight ratio between the first feature map and the second feature map is determined. Based on the relationship strength value and the attention weight ratio, a weighted summation operation is performed on each corresponding feature pair between the first feature map and the second feature map to generate a weighted feature map as the output feature map; The output feature maps corresponding to each of the feature image groups are fused to obtain a fused feature map; The target object in the fused feature map is identified, and the target object is used as a defect inside the power equipment in the internal image of the power equipment.
2. The method for detecting internal defects in power equipment according to claim 1, characterized in that, The method includes: Based on the resolution of each feature map, each feature map is classified into a first image group or a second image group, wherein the resolution of each feature map in the first image group is lower than the resolution of each feature map in the second image group; Each feature map in the first image group is converted into a feature map with a preset number of channels; The feature maps of each preset number of channels are arranged in a preset order to generate an optimized feature map, wherein each feature map of the preset number of channels is used as a pixel of the optimized feature map.
3. The method for detecting internal defects in power equipment according to claim 1, characterized in that, The step of extracting features from the feature image group through the first parallel path to obtain the first feature corresponding to the first parallel path includes: Based on the first direction and the second direction, the feature map of the feature image group is subjected to pooling processing to obtain the first image feature corresponding to the first direction and the second image feature corresponding to the second direction; The first image features and the second image features are weighted; The weighted first image feature and the weighted second image feature are convolved to obtain a weighted image feature, which is then used as the first feature.
4. A method for detecting internal defects in power equipment according to claim 1 or 2, characterized in that, The step of determining the target object in the fused feature map and using the target object as a defect body inside the power equipment in the internal image of the power equipment includes: A prediction box is generated in the fused feature map using a preset prediction model; The target object is obtained through the prediction box, wherein the target object is the marker within the prediction box; The target object is considered as a defect inside the power equipment in the internal image of the power equipment.
5. The method for detecting internal defects in power equipment according to claim 4, characterized in that, The step of determining the target object in the fused feature map and using the target object as a defect body inside the power equipment in the internal image of the power equipment includes: Determine the degree of overlap between the predicted bounding box and the ground truth bounding box; Based on the overlap value, generate soft tags; Construct a loss function between soft labels and classification scores, wherein the classification scores are used to evaluate the ability of the preset prediction model to identify and classify the markers in the fused feature map; The prediction model is trained based on the loss function between the soft label and the classification score, and the trained prediction model is used to generate the prediction box in the fused feature map.
6. The method for detecting internal defects in power equipment according to claim 5, characterized in that, The step of determining the target object in the fused feature map and using the target object as a defect body inside the power equipment in the internal image of the power equipment includes: When the prediction box is generated, the coordinates of the center point of the prediction box, as well as the width and height of the prediction box, are determined. Based on the center point coordinates, the height, the width, and the overlap value, a loss function is constructed between the predicted bounding box and the ground truth bounding box; The prediction model is trained based on the loss function between the predicted bounding box and the ground truth bounding box, and the trained prediction model is used to generate the predicted bounding box in the fused feature map.
7. A device for detecting internal defects in power equipment, characterized in that, The device includes: The input module is used to acquire images of the interior of the power equipment and generate multiple feature maps based on the images of the interior of the power equipment. A grouping module is used to classify each feature map based on the number of channels of each feature map to obtain multiple feature image groups; The feature enhancement module is used to perform feature extraction processing on the feature image group through multiple parallel paths with preset attention weights. The feature image group is processed by a first parallel path and a second parallel path respectively to obtain a first feature corresponding to the first parallel path and a second feature corresponding to the second parallel path. Generate a first feature map corresponding to the first feature and a second feature map corresponding to the second feature; Global average pooling is performed on the first feature map and the second feature map respectively to obtain the weight vector corresponding to the first feature map and the weight vector corresponding to the second feature map. Perform a matrix dot product operation on the weight vector corresponding to the first feature map and the weight vector corresponding to the second feature map to obtain the relationship strength value between the first feature map and the second feature map; Based on the sigmoid function, the attention weight ratio between the first feature map and the second feature map is determined. Based on the relationship strength value and the attention weight ratio, a weighted summation operation is performed on each corresponding feature pair between the first feature map and the second feature map to generate a weighted feature map as the output feature map; The feature fusion module is used to fuse the output feature maps corresponding to each feature image group to obtain a fused feature map. The output module is used to determine the target object in the fused feature map and use the target object as a defect inside the power equipment in the internal image of the power equipment.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the method for detecting internal defects in power equipment as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for detecting internal defects in power equipment as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Detection method, device and equipment for PCB defect detection and medium
CN117094967A
Insulator defect detection method, device and equipment based on artificial intelligence and medium
CN117576454A