Power transformation equipment structure defect identification method, system, equipment, medium and product
By employing the Transformer model's self-attention mechanism and multi-scale feature fusion technology, the problem of insufficient accuracy and generalization ability in identifying global and local defects in substation equipment in traditional methods is solved, achieving more efficient defect identification.
Patent Information
- Application Number
- CN202511681161.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-10
AI Technical Summary
Traditional manual inspection and machine vision methods are difficult to accurately identify the global structure and local defects of substation equipment in complex scenarios, and their generalization ability is poor in scenarios with multiple devices and multiple defects.
The Transformer model is used to capture global structural features and local key region features in the image data of substation equipment through a self-attention mechanism. Attention weights are determined by combining the joint embedding vector of equipment type and defect type, multi-scale feature fusion is performed, and the true defect type is determined based on the preset mapping rules between defect type and equipment type.
It improves the accuracy of defect identification in power equipment and its generalization ability in multi-equipment, multi-defect scenarios, and avoids invalid predictions due to mismatch between defect types and equipment.
Smart Images

Figure CN121504869A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power equipment technology, and in particular to a method, system, device, medium and product for identifying structural defects in power equipment. Background Technology
[0002] In the field of power equipment operation and maintenance, equipment structure identification and defect judgment are core links to ensure the stable operation of the power grid. With the increasing demand for intelligent operation and maintenance, traditional methods that rely on manual inspection or simple machine vision are no longer able to meet the needs of accurate identification in complex scenarios. At present, manual inspection is not only inefficient and highly subjective, but also prone to missing hidden defects such as micro-cracks in insulators and leakage in capacitor joints. Meanwhile, traditional machine vision methods lack the correlation modeling of the global structure of equipment and local defects, making it difficult to focus on defect-prone areas, and their generalization ability is poor in scenarios with multiple devices and multiple defects. Summary of the Invention
[0003] In view of this, in order to solve the above-mentioned technical problems, the present invention provides a method, system, device, medium and product for identifying structural defects in power equipment.
[0004] The first aspect of this invention provides a method for identifying structural defects in power equipment, comprising:
[0005] Real-time acquisition of image data of the target substation equipment;
[0006] The image data is input into a pre-trained Transformer model, which captures global structural features and local key region features in the image data through a self-attention mechanism; wherein, the attention weight parameters of the Transformer model are determined by the joint embedding vector of the equipment type and defect type of the target substation.
[0007] Multi-scale feature fusion is performed on the global structural features and the local key region features to obtain a fused feature vector;
[0008] The defect type of the target substation is predicted by the fused feature vector, and the actual defect type of the target substation is determined by combining the fused feature vector and the predicted defect type based on the preset mapping rules between defect type and equipment type.
[0009] Preferably, the step of inputting the image data into a pre-trained Transformer model and capturing global structural features and local key region features in the image data through a self-attention mechanism further includes:
[0010] The image data is preprocessed; wherein the preprocessing includes image denoising, image enhancement, and normalization.
[0011] Preferably, the attention weight parameters include an attention weight matrix;
[0012] The process of generating the attention weight matrix includes:
[0013] The equipment type labels and defect type labels of the target substation are mapped to equipment type label vectors and defect type label vectors, respectively.
[0014] The device type label vector and the defect type label vector are transformed using a multilayer perceptron to obtain a joint embedding vector;
[0015] The joint embedding vector is conditionally injected, and the conditionally injected joint embedding vector is used as the initial attention weight parameter; wherein, the conditional injection includes at least one or more of the following: Attention-logits bias injection, Query conditional injection, and conditional token injection.
[0016] The initial attention weight parameters are scaled and adjusted using a preset scaling factor, and the attention weight matrix is determined based on the scaled and adjusted attention weight parameters and the preset initial attention weight matrix.
[0017] Preferably, the step of inputting the image data into a pre-trained Transformer model and capturing global structural features and local key region features in the image data through a self-attention mechanism includes:
[0018] By utilizing the multi-head self-attention mechanism in the Transformer model, multiple attention heads are computed in parallel to simultaneously capture global structural sub-features and local key region sub-features in different subspaces.
[0019] The global structural sub-features captured by each attention head are concatenated and integrated into the global structural features through a linear transformation;
[0020] The sub-features of the local key regions captured by each attention head are concatenated and integrated into the local key region features through linear transformation.
[0021] Preferably, the step of performing multi-scale feature fusion on the global structural features and the local key region features to obtain a fused feature vector includes:
[0022] The global structural features and the local key region features are extracted by two-level feature extraction layers to obtain global feature vectors and local feature vectors.
[0023] The global feature vector and the local feature vector are weighted and integrated using cross-layer attention weights to obtain the fused feature vector.
[0024] Preferably, the step of predicting the defect type of the target substation using the fused feature vector, and determining the true defect type of the target substation based on a preset mapping rule between defect types and equipment types, combined with the fused feature vector and the predicted defect type, includes:
[0025] The fused feature vector is input into a pre-trained defect classifier, which outputs a probability distribution of defect types. Based on the probability distribution of defect types, the defect type with the highest probability is selected as the predicted defect type. The pre-trained defect classifier is obtained by training an initial classifier based on a preset defect type sample set. The preset defect type sample set includes label samples of multiple defect types and fused feature vector samples of the substation.
[0026] Determine whether the device type and the predicted defect type satisfy the preset mapping rule between defect type and device type. If the device type and the predicted defect type do not satisfy the preset mapping rule between defect type and device type, then determine that the predicted defect type prediction has failed.
[0027] If it is determined that the device type and the predicted defect type satisfy the preset mapping rule between defect type and device type, then for the suspected defect type, the feature matching degree is determined based on the local feature vector corresponding to the preset defect type and the preset defect feature vector of the device type.
[0028] If the feature matching degree is greater than the preset feature matching degree threshold, then the predicted defect type is determined to be the real defect type.
[0029] If the feature matching degree is not greater than the preset feature matching degree threshold, then the predicted defect type prediction is determined to be invalid.
[0030] Secondly, the present invention also provides a system for identifying structural defects in power equipment, comprising:
[0031] Image data acquisition module, used to acquire image data of target substation equipment in real time;
[0032] The feature extraction module is used to input the image data into a pre-trained Transformer model and capture global structural features and local key region features in the image data through a self-attention mechanism; wherein, the attention weight parameters of the Transformer model are determined by the joint embedding vector of the equipment type and defect type of the target substation equipment;
[0033] The feature fusion module is used to perform multi-scale feature fusion on the global structural features and the local key region features to obtain a fused feature vector.
[0034] The defect identification module is used to predict the defect type of the target substation by means of the fused feature vector, and to determine the actual defect type of the target substation by means of the fused feature vector and the predicted defect type based on the preset mapping rules between defect type and equipment type.
[0035] Thirdly, the present invention also provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, the computer program being executed by the processor causing the processor to perform the steps of the substation structural defect identification method as described in the first aspect.
[0036] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the steps of the substation structural defect identification method as described in the first aspect.
[0037] Fifthly, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the substation structural defect identification method as described in the first aspect.
[0038] As can be seen from the above technical solutions, this invention inputs real-time acquired image data of the target substation into a pre-trained Transformer model. It captures global structural features and local key region features in the image data through a self-attention mechanism. The attention weight parameters of the Transformer model are determined by the joint embedding vector of the target substation's equipment type and defect type, thus focusing on the global features of the equipment and capturing local features. Furthermore, it performs multi-scale feature fusion on global structural features and local key region features, preserving the equipment structural context while focusing on details of defect-prone areas. The fused feature vector obtained after multi-scale feature fusion predicts the defect type of the target substation. Based on a preset mapping rule between defect type and equipment type, and combining the fused feature vector and the predicted defect type, the true defect type of the target substation is determined, thus avoiding invalid predictions due to mismatch between defect type and equipment. This improves the accuracy of defect identification of the target substation and enhances its generalization ability in multi-equipment, multi-defect scenarios. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is an application environment diagram of a method for identifying structural defects in power equipment provided in an embodiment of the present invention;
[0041] Figure 2 A flowchart of a method for identifying structural defects in power equipment provided in an embodiment of the present invention;
[0042] Figure 3 This is a schematic diagram of a substation structural defect identification system provided in an embodiment of the present invention;
[0043] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0044] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0045] The method for identifying structural defects in power equipment provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 101 communicates with server 102 via a network. A data storage system can store the data that server 102 needs to process. The data storage system can be integrated onto server 102 or placed on a cloud or other network server. Terminal 101 or server 102 acquires image data of the target substation in real time; the image data is input into a pre-trained Transformer model, which captures global structural features and local key region features in the image data through a self-attention mechanism; the attention weight parameters of the Transformer model are determined by the joint embedding vector of the equipment type and defect type of the target substation; multi-scale feature fusion is performed on the global structural features and local key region features to obtain a fused feature vector; the defect type of the target substation is predicted using the fused feature vector, and based on a preset mapping rule between defect type and equipment type, combined with the fused feature vector and the predicted defect type, the true defect type of the target substation is determined.
[0046] Terminal 101 can be, but is not limited to, various personal computers, laptops, smartphones, and tablets.
[0047] Server 102 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0048] like Figure 2 As shown in the embodiments of this application, a method for identifying structural defects in power equipment is provided, which is then applied to... Figure 1 Taking terminal 101 or server 102 as an example, the explanation includes the following steps S1 to S4. Wherein:
[0049] Step S1: Real-time acquisition of image data of the target substation equipment.
[0050] High-resolution cameras or drones deployed at the substation site can collect real-time image data of the target substation equipment, which includes various key equipment such as insulators, capacitors, circuit breakers, and transformers.
[0051] Meanwhile, to ensure the accuracy of the image data, preprocessing is also performed on the image data; the preprocessing includes image denoising, image enhancement and normalization, so as to eliminate the impact of uneven lighting, occlusion or blurring on subsequent analysis.
[0052] Step S2: Input the image data into the pre-trained Transformer model and capture the global structural features and local key region features in the image data through the self-attention mechanism; wherein, the attention weight parameters of the Transformer model are determined by the joint embedding vector of the equipment type and defect type of the target substation.
[0053] The image data is input into a pre-trained Transformer model, which uses a self-attention mechanism to capture global structural features (such as the shape of the metal shell of a capacitor and the distribution pattern of the porcelain skirts of an insulator) and local key region features (such as the joint position of a capacitor and the surface texture of an insulator).
[0054] The Transformer model employs an improved VisionTransformer architecture, where the input image is divided into fixed-size image blocks, and spatial information of the image is preserved through positional encoding.
[0055] The attention weight parameters include the attention weight matrix;
[0056] The process of generating the attention weight matrix includes:
[0057] Step S21: Map the equipment type label and defect type label of the target substation equipment to equipment type label vector and defect type label vector, respectively.
[0058] The equipment type label for the target substation is obtained by marking known equipment types, while the defect type label is based on historical defect records or real-time defect detection results.
[0059] Specifically, the labels for device types and defects are mapped to device type label vectors and defect type label vectors, respectively, denoted as [examples of vectors]. , .
[0060] Step S22: Transform the device type label vector and the defect type label vector using a multilayer perceptron to obtain a joint embedding vector.
[0061] Specifically, a Multi-Layer Perceptron (MLP) is used to perform a non-linear transformation on the device type label vector and the defect type label vector to capture deeper-level correlation features between device types and defect types, resulting in a joint embedding vector, denoted as . .
[0062] Step S23: Perform conditional injection on the joint embedding vector, and use the joint embedding vector after conditional injection as the initial attention weight parameter; wherein, the conditional injection includes at least one or more of the following: Attention-logits bias injection, Query conditional injection, and conditional token injection.
[0063] Among them, conditional injection is based on different modes of joint embedding to conditionally adjust the attention calculation of Transformer. Specifically, conditional injection includes at least one or more of the following: Attention-logits bias injection, Query conditional injection, and conditional token injection.
[0064] Among them, Attention-logits bias injection is the joint embedding vector The bias term for each attention head is linearly mapped. ,in, The linear mapping matrix is then superimposed in a broadcast manner on the attention scores to obtain the adjusted attention weight matrix. Where Q is the query vector and K is the key vector. Let be the dimension of the key vector. Let b be the bias matrix consisting of the bias terms b of all attention heads. is the activation function used to convert the attention score into a probability distribution, ensuring that the sum of the weights is 1.
[0065] Query conditional injection is the process of adding conditional mappings to the query vector. This forms a query representation with equipment defect semantics. It is a vector of all 1s with dimension N, where N is the sequence length (i.e. the number of image patches).
[0066] Conditional token injection, which involves appending conditional tokens generated by joint embedding to the input token sequence, enables the Transformer self-attention layer to explicitly model the interaction information between the device and the defect.
[0067] In implementation, if the dimensions of Query and Key are... Joint Embedding Dimension It can be set to 128, through a linear mapping matrix. or Perform dimensional alignment, where For the number of attention heads,
[0068] To prevent conditional information from overly dominating model training, Dropout and LayerNorm regularization are incorporated into the joint embedding pathway, along with weight decay constraints. To improve robustness, conditional inputs are randomly discarded with a certain probability during training, ensuring the model maintains good recognition performance even in unconditional situations. A smaller learning rate is used in the joint embedding branch at the beginning of training to gradually guide the model from basic attention to conditional attention.
[0069] Step S24: Scale the initial attention weight parameters using a preset scaling factor, and determine the attention weight matrix based on the scaled attention weight parameters and the preset initial attention weight matrix.
[0070] Specifically, the influence of conditional weights is dynamically controlled by a preset scaling factor γ, and γ is initialized to a value close to zero in the early stages of training to ensure model convergence stability. Based on the scaled attention weight parameters and the preset initial attention weight matrix, the attention weight matrix is determined. for:
[0071]
[0072] In the formula, This is the initial attention weight matrix.
[0073] Step S3: Perform multi-scale feature fusion on global structural features and local key region features to obtain a fused feature vector.
[0074] This process involves multi-scale feature fusion of global structural features and local key region features. A multi-scale fusion strategy integrates feature information from different levels to obtain a fused feature vector. Specifically, global structural features are downsampled, and local key region features are upsampled. The fused feature vector is generated through feature concatenation or weighted fusion. The fusion weight parameters are dynamically calculated based on the correlation between device type and defect type, using the following formula: ,in and For learnable fusion coefficients, and These represent global structural features and local key region features, respectively.
[0075] Step S4: Predict the defect type of the target substation by fusing feature vectors, and determine the actual defect type of the target substation by combining the fusing feature vectors and the predicted defect type based on the preset mapping rules between defect type and equipment type.
[0076] Specifically, by mapping the fused feature vectors to the prediction space of defect types, a predicted probability distribution for each defect type is generated. The prediction results are normalized using the Softmax activation function to obtain the probability values of the target substation equipment belonging to each defect type. Simultaneously, based on a pre-defined mapping rule base between defect types and equipment types—constructed using historical data and expert knowledge—the rule base clarifies the defect types and associated defect features of different equipment types under operation. The predicted defect types are matched and verified against the mapping relationships in the rule base. When the prediction results match typical defect patterns in the rule base, the final defect type is directly confirmed; when conflicts or ambiguities exist, a secondary discrimination is performed using key features from the fused feature vectors to determine the true defect type of the target substation equipment. The final output defect type includes a defect category label.
[0077] In some examples, the system will also output the equipment type, defect type, and actual defect judgment result of the target substation equipment, and can synchronize the results to a remote server or local display terminal to assist maintenance personnel in making decisions.
[0078] It should be noted that, in this embodiment, image data of the target substation acquired in real time is input into a pre-trained Transformer model. A self-attention mechanism is used to capture global structural features and local key region features in the image data. The attention weight parameters of the Transformer model are determined by the joint embedding vector of the target substation's equipment type and defect type, thereby focusing on the global features of the equipment and capturing local features. Furthermore, multi-scale feature fusion is performed on the global structural features and local key region features, preserving the equipment structural context while focusing on details of defect-prone areas. The fused feature vector obtained after multi-scale feature fusion is used to predict the defect type of the target substation. Based on a preset mapping rule between defect type and equipment type, the true defect type of the target substation is determined by combining the fused feature vector and the predicted defect type, thus avoiding invalid predictions due to mismatch between defect type and equipment. This improves the accuracy of defect identification of the target substation and enhances its generalization ability in multi-equipment, multi-defect scenarios.
[0079] In some embodiments, image data is input into a pre-trained Transformer model, and a self-attention mechanism is used to capture global structural features and local key region features in the image data, including:
[0080] Step S201: Utilize the multi-head self-attention mechanism in the Transformer model to compute multiple attention heads in parallel, so as to simultaneously capture global structural sub-features and local key region sub-features in different subspaces.
[0081] In this approach, a multi-head self-attention mechanism is used to set up multiple independent attention heads in the Transformer model. Each attention head has unique weight parameters and can extract features from the input image data from different perspectives. For example, some attention heads may focus more on the overall shape and outline of the capacitor, capturing its global structural features, such as the shape of the capacitor shell and its overall size ratio; while other attention heads may focus on local key areas such as the capacitor's seams and pins, extracting local key area features.
[0082] These attention heads compute in parallel without interfering with each other, enabling them to capture feature information from different subspaces simultaneously. During computation, each attention head allocates attention weights to the input image data according to its own weight parameters, focusing more attention on important feature regions related to it.
[0083] Step S202: Concatenate the global structural sub-features captured by each attention head, and integrate them into a global structural feature through linear transformation.
[0084] When concatenating the global structural sub-features captured by each attention head, these sub-feature vectors are linked end-to-end in a specific order to form a longer feature vector. Specifically, semantic embedding is performed on component names, geometric feature encoding is performed on shapes, topological relationship modeling is performed on connection methods, task relevance analysis is performed on functions, and device type feature vectors are generated through multimodal feature fusion. for:
[0085]
[0086] In the formula, , , , These represent the encoding results for the four features, respectively.
[0087] Step S203: The sub-features of the local key regions captured by each attention head are spliced together and integrated into local key region features through linear transformation.
[0088] In some embodiments, multi-scale feature fusion is performed on global structural features and local key region features to obtain a fused feature vector, including:
[0089] Step S301: Extract features from global structural features and local key region features through a two-level feature extraction layer to obtain global feature vectors and local feature vectors.
[0090] The first level is the GlobalFeatureExtractionLayer, which outputs a global feature vector through the Transformer's encoder to represent the overall structural features of the device. The second level is the LocalFeatureExtractionLayer, which extracts local feature vectors through the Transformer's decoder or local attention mechanism to represent the features of key areas of the device.
[0091] Step S302: Use cross-layer attention weights to weight and integrate the global feature vector and the local feature vector to obtain the fused feature vector.
[0092] In the fusion process, cross-layer attention weights are used to weight and integrate global and local features:
[0093]
[0094] In the formula, and These represent the number of channels for global and local features, respectively. This is the final fused feature vector, ensuring that the contribution of features at different scales to defect identification matches the correlation between device type and defect type. , These are the weights of the global feature vector and the local feature vector, respectively. , These are the global feature vector and the local feature vector, respectively.
[0095] In some embodiments, the defect type of the target substation is predicted by fusing feature vectors, and the true defect type of the target substation is determined based on a preset mapping rule between defect type and equipment type, combined with the fusing feature vectors and the predicted defect type, including:
[0096] Step S401: Input the fused feature vector into the pre-trained defect classifier, output the probability distribution of defect types, and select the defect type with the highest probability as the predicted defect type according to the probability distribution of defect types; wherein, the pre-trained defect classifier is obtained by training the initial classifier based on the preset defect type sample set, and the preset defect type sample set contains label samples of multiple defect types and fused feature vector samples of substation equipment.
[0097] The defect classifier is a neural network model built using deep learning algorithms. During the training phase, the model learns the feature patterns corresponding to different defect types by continuously adjusting its internal weight parameters. Specifically, the classifier takes a fused feature vector as input, passes it through multiple nonlinear transformations (such as fully connected layers and activation function layers), and finally outputs the probability value of each defect type. These probability values are normalized by the Softmax function to form a probability distribution, and the category with the highest probability is determined as the predicted defect type.
[0098] To ensure the accuracy of the classifier, the cross-entropy loss function is used during training to measure the difference between the predicted results and the true labels, and the model parameters are optimized using the backpropagation algorithm. Furthermore, to prevent overfitting, the training dataset typically contains a large number of diverse samples, covering image data from different equipment types, defect severity levels, and environmental conditions. Data augmentation techniques (such as random cropping, rotation, and brightness adjustment) are also used to further expand the sample diversity. The resulting defect classifier can efficiently distinguish common substation equipment defect types, such as insulator damage, wire breakage, and equipment corrosion.
[0099] Step S402: Determine whether the equipment type and the predicted defect type meet the preset mapping rules between defect types and equipment types. If the equipment type and the predicted defect type do not meet the preset mapping rules between defect types and equipment types, then the predicted defect type prediction is deemed to have failed.
[0100] The pre-defined mapping rules between defect types and equipment types are based on a knowledge base built from historical maintenance data and expert experience. This rule base clearly defines the unique defect types for different equipment types. For example, bulge defects only occur in capacitors, while cracks and contamination only occur in insulators. These features are then mapped to the equipment type. If the target equipment is a capacitor, only the areas in its structural features related to bulge defects are identified; if the target equipment is an insulator, only the areas in its structural features related to cracks or contamination are identified.
[0101] Mapping rules between equipment type and defect type The predicted defect type is validated; if the predicted defect type does not match the mapping rule... If the defect type is within the mapping range, the defect type prediction is determined to be invalid, and the invalid defect type is re-identified or marked as pending confirmation.
[0102] Step S403: If the determined equipment type and the predicted defect type satisfy the preset mapping rule between defect type and equipment type, then for the suspected defect type, determine the feature matching degree based on the local feature vector corresponding to the preset defect type and the preset defect feature vector of the equipment type.
[0103] Among them, the preset defect feature vectors for equipment types are standardized feature libraries pre-built based on historical data and expert experience. These libraries store the corresponding feature vector sets for each equipment type and its common defect types.
[0104] Once the predicted defect type and device type are verified through mapping rules, the standard feature vector corresponding to the defect type under that device type is extracted from the rule base, and its similarity is calculated with the local feature vector generated in step S302. Specifically, cosine similarity or Euclidean distance is used to quantify the degree of matching between the local feature vector and the standard feature vector. For example, for a capacitor bulge defect, a preset bulge defect feature vector is extracted and compared with the feature vector of the local area of the capacitor in the current detection image. If the feature matching degree exceeds a preset threshold, the defect type is confirmed as a real defect. Through this feature matching mechanism, the system can further eliminate false detections caused by factors such as changes in lighting and shooting angle, improving the robustness of defect identification.
[0105] Step S404: If the feature matching degree is greater than the preset feature matching degree threshold, then the predicted defect type is determined to be the real defect type.
[0106] The feature matching threshold is dynamically adjusted during the training phase. Positive sample pairs are constructed for each device type and defect type. Compared with negative sample pairs The matching degree function is optimized using contrastive learning, and its loss is defined as follows:
[0107]
[0108] in, To compare loss functions, and These are the matching scores for positive and negative samples, respectively. For temperature parameters. By minimizing... The model can enhance the distinguishability between equipment features and defect features, and improve the accuracy and robustness of defect identification.
[0109] Step S405: If the feature matching degree is not greater than the preset feature matching degree threshold, then the predicted defect type prediction is determined to be invalid.
[0110] It is understood that the embodiments of this application, through a multi-layered feature processing mechanism, not only utilize the global and local feature capture capabilities of the Transformer model, but also achieve feature fusion through cross-layer attention weights, effectively solving the problem of global and local feature separation in traditional methods. Simultaneously, by combining the mapping rules between device type and defect type with feature matching degree verification, the accuracy and reliability of defect identification are significantly improved.
[0111] Based on the same inventive concept, this application also provides a substation structural defect identification system for implementing the above-mentioned substation structural defect identification method.
[0112] The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the substation structural defect identification system provided below can be found in the limitations of the substation structural defect identification method described above, and will not be repeated here.
[0113] like Figure 3 As shown in the figure, this application embodiment also provides a substation equipment structural defect identification system, including:
[0114] Image data acquisition module 100 is used to acquire image data of the target substation equipment in real time;
[0115] The feature extraction module 200 is used to input image data into a pre-trained Transformer model and capture global structural features and local key region features in the image data through a self-attention mechanism. The attention weight parameters of the Transformer model are determined by the joint embedding vector of the equipment type and defect type of the target substation.
[0116] The feature fusion module 300 is used to perform multi-scale feature fusion on global structural features and local key region features to obtain a fused feature vector.
[0117] The defect identification module 400 is used to predict the defect type of the target substation by fusing feature vectors, and to determine the actual defect type of the target substation by combining the fusing feature vectors and the predicted defect type based on the preset mapping rules between defect type and equipment type.
[0118] In some embodiments, the system further includes:
[0119] The preprocessing module is used to preprocess image data; the preprocessing includes image denoising, image enhancement, and normalization.
[0120] In some embodiments, the attention weight parameter includes an attention weight matrix;
[0121] The process of generating the attention weight matrix includes:
[0122] Map the equipment type labels and defect type labels of the target substation equipment to equipment type label vectors and defect type label vectors, respectively;
[0123] The device type label vector and defect type label vector are transformed using a multilayer perceptron to obtain a joint embedding vector;
[0124] Conditional injection is performed on the joint embedding vector, and the joint embedding vector after conditional injection is used as the initial attention weight parameter; wherein, the conditional injection includes at least one or more of the following: Attention-logits bias injection, Query conditional injection, and conditional token injection.
[0125] The initial attention weight parameters are scaled and adjusted using a preset scaling factor, and the attention weight matrix is determined based on the scaled and adjusted attention weight parameters and the preset initial attention weight matrix.
[0126] In some embodiments, the feature extraction module 200 is used for:
[0127] By utilizing the multi-head self-attention mechanism in the Transformer model, multiple attention heads are computed in parallel to simultaneously capture global structural sub-features and local key region sub-features in different subspaces.
[0128] The global structural sub-features captured by each attention head are concatenated and integrated into a global structural feature through a linear transformation;
[0129] The sub-features of local key regions captured by each attention head are concatenated and integrated into local key region features through linear transformation.
[0130] In some embodiments, the feature fusion module 300 is used for:
[0131] The global structural features and local key region features are extracted by two-level feature extraction layers to obtain global feature vectors and local feature vectors.
[0132] Cross-layer attention weights are used to weight and integrate the global and local feature vectors to obtain a fused feature vector.
[0133] In some embodiments, the defect identification module 400 is used for:
[0134] The fused feature vector is input into a pre-trained defect classifier, which outputs the probability distribution of defect types. Based on the probability distribution of defect types, the defect type with the highest probability is selected as the predicted defect type. The pre-trained defect classifier is obtained by training an initial classifier based on a preset defect type sample set, which contains label samples of various defect types and fused feature vector samples of substation equipment.
[0135] Determine whether the equipment type and the predicted defect type meet the preset mapping rules between defect types and equipment types. If the equipment type and the predicted defect type do not meet the preset mapping rules, then the predicted defect type prediction is deemed to have failed.
[0136] If the equipment type and the predicted defect type satisfy the preset mapping rule between defect type and equipment type, then for the suspected defect type, the feature matching degree is determined based on the local feature vector corresponding to the preset defect type and the preset defect feature vector of the equipment type.
[0137] If the feature matching degree is greater than the preset feature matching degree threshold, the predicted defect type is determined to be the real defect type.
[0138] If the feature matching degree is not greater than the preset feature matching degree threshold, the predicted defect type is determined to be unpredictable.
[0139] like Figure 4 As shown, this application provides an electronic device. The electronic device 10 includes a memory 20 and a processor 30. The memory 20 stores a computer program. When the computer program is executed by the processor 30, the processor 30 performs the steps of the substation structural defect identification method as described in the above embodiment.
[0140] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed, implements the steps of the substation structural defect identification method as described in the above embodiments.
[0141] This application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the substation structural defect identification method as described in the above embodiments.
[0142] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, electronic devices, computer storage media, and computer program products described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0143] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.
[0144] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0145] In the several embodiments provided by this invention, it should be understood that the disclosed systems, electronic devices, computer storage media, computer program products, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0146] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0147] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0148] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for executing all or part of the steps of the methods described in the various embodiments of the present invention through a computer device (which may be a personal computer, a server, or a network device, etc.). The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0149] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying structural defects in power equipment, characterized in that, include: Real-time acquisition of image data of the target substation equipment; The image data is input into a pre-trained Transformer model, which captures global structural features and local key region features in the image data through a self-attention mechanism; wherein, the attention weight parameters of the Transformer model are determined by the joint embedding vector of the equipment type and defect type of the target substation. Multi-scale feature fusion is performed on the global structural features and the local key region features to obtain a fused feature vector; The defect type of the target substation is predicted by the fused feature vector, and the actual defect type of the target substation is determined by combining the fused feature vector and the predicted defect type based on the preset mapping rules between defect type and equipment type.
2. The method for identifying structural defects in power equipment according to claim 1, characterized in that, The step of inputting the image data into a pre-trained Transformer model and capturing global structural features and local key region features in the image data through a self-attention mechanism, before that step also includes: The image data is preprocessed; wherein the preprocessing includes image denoising, image enhancement, and normalization.
3. The method for identifying structural defects in power equipment according to claim 1, characterized in that, The attention weight parameters include the attention weight matrix; The process of generating the attention weight matrix includes: The equipment type labels and defect type labels of the target substation are mapped to equipment type label vectors and defect type label vectors, respectively. The device type label vector and the defect type label vector are transformed using a multilayer perceptron to obtain a joint embedding vector; The joint embedding vector is conditionally injected, and the conditionally injected joint embedding vector is used as the initial attention weight parameter; wherein, the conditional injection includes at least one or more of the following: Attention-logits bias injection, Query conditional injection, and conditional token injection. The initial attention weight parameters are scaled and adjusted using a preset scaling factor, and the attention weight matrix is determined based on the scaled and adjusted attention weight parameters and the preset initial attention weight matrix.
4. The method for identifying structural defects in power equipment according to claim 1 or 3, characterized in that, The step of inputting the image data into a pre-trained Transformer model and capturing global structural features and local key region features in the image data through a self-attention mechanism includes: By utilizing the multi-head self-attention mechanism in the Transformer model, multiple attention heads are computed in parallel to simultaneously capture global structural sub-features and local key region sub-features in different subspaces. The global structural sub-features captured by each attention head are concatenated and integrated into the global structural features through a linear transformation; The sub-features of the local key regions captured by each attention head are concatenated and integrated into the local key region features through linear transformation.
5. The method for identifying structural defects in power equipment according to claim 1, characterized in that, The multi-scale feature fusion of the global structural features and the local key region features to obtain a fused feature vector includes: The global structural features and the local key region features are extracted by two-level feature extraction layers to obtain global feature vectors and local feature vectors. The global feature vector and the local feature vector are weighted and integrated using cross-layer attention weights to obtain the fused feature vector.
6. The method for identifying structural defects in power equipment according to claim 1 or 5, characterized in that, The step of predicting the defect type of the target substation using the fused feature vector, and determining the true defect type of the target substation based on a preset mapping rule between defect type and equipment type, combined with the fused feature vector and the predicted defect type, includes: The fused feature vector is input into a pre-trained defect classifier, which outputs a probability distribution of defect types. Based on the probability distribution of defect types, the defect type with the highest probability is selected as the predicted defect type. The pre-trained defect classifier is obtained by training an initial classifier based on a preset defect type sample set. The preset defect type sample set includes label samples of multiple defect types and fused feature vector samples of the substation. Determine whether the device type and the predicted defect type satisfy the preset mapping rule between defect type and device type. If the device type and the predicted defect type do not satisfy the preset mapping rule between defect type and device type, then determine that the predicted defect type prediction has failed. If it is determined that the device type and the predicted defect type satisfy the preset mapping rule between defect type and device type, then for the suspected defect type, the feature matching degree is determined based on the local feature vector corresponding to the preset defect type and the preset defect feature vector of the device type. If the feature matching degree is greater than the preset feature matching degree threshold, then the predicted defect type is determined to be the real defect type. If the feature matching degree is not greater than the preset feature matching degree threshold, then the predicted defect type prediction is determined to be invalid.
7. A system for identifying structural defects in power equipment, characterized in that, include: Image data acquisition module, used to acquire image data of target substation equipment in real time; The feature extraction module is used to input the image data into a pre-trained Transformer model and capture global structural features and local key region features in the image data through a self-attention mechanism; wherein, the attention weight parameters of the Transformer model are determined by the joint embedding vector of the equipment type and defect type of the target substation equipment; The feature fusion module is used to perform multi-scale feature fusion on the global structural features and the local key region features to obtain a fused feature vector. The defect identification module is used to predict the defect type of the target substation by means of the fused feature vector, and to determine the actual defect type of the target substation by means of the fused feature vector and the predicted defect type based on the preset mapping rules between defect type and equipment type.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor performs the steps of the substation structural defect identification method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the steps of the substation structural defect identification method as described in any one of claims 1-6.
10. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the substation structural defect identification method as described in any one of claims 1-6.