A method and device for constructing a transformer fault diagnosis model based on counterfactual analysis

By using a transformer fault diagnosis model based on counterfactual analysis, and extracting features of dissolved gas data in transformer oil using graph convolutional neural networks, combined with causal inference theory, and optimizing the structural causal model, the problem of misjudgment caused by class imbalance is solved, and high-precision and high-robust fault diagnosis is achieved.

CN118797477BActive Publication Date: 2026-08-25CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410803612.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2026-08-25
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

Existing deep learning-based transformer fault diagnosis methods have a high misclassification rate when faced with sample sets with extremely imbalanced class distributions. They are also prone to misreporting normal states as fault states, leading to additional inspection and maintenance costs. Unidentified or incorrect fault diagnoses can result in serious accidents.

Method used

A transformer fault diagnosis model based on counterfactual analysis is adopted. By acquiring dissolved gas data in transformer oil, a structural causal model is designed. Graph convolutional neural network (GCN) is used to extract factual and counterfactual features. Combined with causal inference theory, the structural causal model is optimized to construct a high-precision fault diagnosis model.

Benefits of technology

It achieves high-precision and robust fault diagnosis under unbalanced fault sample sets, effectively reducing false positives and false negatives, and improving the accuracy and reliability of transformer fault diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797477B_ABST
    Figure CN118797477B_ABST
Patent Text Reader

Abstract

The application relates to a transformer fault diagnosis model construction method and device based on counterfactual analysis, which comprises the following steps: acquiring dissolved gas data in transformer oil, and designing a structural causal model, wherein the structural causal model represents the relationship among transformer working states, dissolved gas data, model extraction features and fault prediction; creating a graph convolutional neural network (GCN), obtaining an adjacency matrix based on the dissolved gas data, and obtaining factual features and counterfactual features in the model extraction features according to the adjacency matrix and the GCN; and training the structural causal model by using the factual features, the counterfactual features and a counterfactual feature strategy, so as to obtain a transformer fault diagnosis model. The application realizes high-precision and high-robustness transformer fault diagnosis, and effectively solves the misjudgment and missed judgment problems of unbalanced fault samples. The application also relates to a transformer fault diagnosis method, a device and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system technology, and in particular to a method and apparatus for constructing a transformer fault diagnosis model based on counterfactual analysis. Background Technology

[0002] Power transformers are among the most critical pieces of equipment in substations and power plants, and their reliability plays a vital role in the operation of the entire system. Monitoring the operating status of transformers is an effective means of early fault detection, which can prevent significant socio-economic losses to the entire power system. Therefore, accurately identifying the fault types of power transformers is of great significance to their development. Due to the relatively low probability of transformer faults, and the existence of missing or incomplete fault case and anomaly sample information, the distribution of different categories in transformer oil chromatographic data is uneven. This factor significantly affects the model's analysis and prediction of fault detection tasks, causing it to favor the majority class in judgments, resulting in erroneous fault diagnosis results.

[0003] Existing deep learning-based transformer fault diagnosis methods are primarily trained and tested on fault samples. While they can accurately diagnose various fault types and achieve good diagnostic results, they lack high-quality data. Furthermore, these classifiers often exhibit poor diagnostic accuracy when diagnosing transformer faults on sample sets with extremely imbalanced class distributions. Moreover, since transformers actually spend far more time in normal conditions than in fault conditions, the model frequently misreports normal states as fault states, leading to additional inspection and maintenance costs. On the other hand, unidentified or incorrect fault diagnoses can result in serious accidents. Summary of the Invention

[0004] To address the technical problem of high misclassification rate in transformer fault diagnosis for sample sets with extremely unbalanced category distributions, this invention provides a method and apparatus for constructing a transformer fault diagnosis model based on counterfactual analysis.

[0005] In a first aspect, the present invention provides a method for constructing a transformer fault diagnosis model based on counterfactual analysis, the method comprising:

[0006] Data on dissolved gases in transformer oil are obtained, and a structural causal model is designed. The structural causal model represents the relationship between transformer operating status, dissolved gas data, model extracted features, and fault prediction.

[0007] A graph convolutional neural network (GCN) is created. An adjacency matrix is ​​obtained based on the dissolved gas data. Based on the adjacency matrix and the GCN, the factual features and counterfactual features in the features extracted by the model are obtained.

[0008] The structural causal model is trained using the factual features, the counterfactual features, and the counterfactual feature strategy to obtain a transformer fault diagnosis model.

[0009] Based on the above technical solution, the structural causal model further represents the relationship between the transformer operating state, dissolved gas data, model extracted features, and fault prediction, and is expressed as follows:

[0010] S→X→F→Y

[0011] S→X→Y

[0012] Where S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance case, i.e. the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance case, i.e. the counterfactual scenario.

[0013] Based on the above technical solution, further, the step of obtaining the adjacency matrix based on the dissolved gas data, and obtaining the factual and counterfactual features in the model's extracted features according to the adjacency matrix and the GCN, specifically includes:

[0014] The dissolved gas data is divided into dissolved gas combinations, and the dissolved gas data in each dissolved gas combination is standardized.

[0015] The standardized dissolved gas combinations are used to extract low-dimensional features from the dissolved gas combinations using the Siamese neural network. The Euclidean distance between each dissolved gas combination is calculated using the low-dimensional features. The k-nearest neighbor algorithm is used to find the other dissolved gas combinations with the smallest Euclidean distance to each of the dissolved gas combinations as training samples.

[0016] Link the sample data in the training samples that have the same fault type to construct an n×n adjacency matrix A, where n is the number of samples in the training samples.

[0017] By setting the adjacency matrix A to the identity matrix I, where A ~ I;

[0018] The training samples, the adjacency matrix A, and the identity matrix I are input into the GCN to obtain the factual features and counterfactual features extracted by the model.

[0019] Based on the above technical solution, further, the step of inputting the training samples, the adjacency matrix A, and the identity matrix I into the GCN to obtain the factual features and counterfactual features in the features extracted by the model specifically includes:

[0020] The training data and the adjacency matrix (X,A) are input into a nonlinear activation function to obtain the feature H extracted by the model. (l+1) The nonlinear activation function is yes The degree matrix, i.e. H represents the extracted features for each layer. For the input layer, H is X, W l and b l These are the weight matrix and bias terms of the network layer of the CGN, respectively;

[0021] The model extracts features H (l+1) The factual features and the counterfactual features are obtained from this.

[0022] Based on the above technical solution, further, the step of training the structural causal model using the factual features, the counterfactual features, and the counterfactual feature strategy to obtain the transformer fault diagnosis model specifically includes:

[0023] Obtain the model prediction results Y in the actual scenarios respectively x,f Model prediction results in counterfactual scenarios

[0024] Y x,f =Y(X=x,F=f)=P(Y|X=x,F=P(F|X=x))

[0025]

[0026] Among them, f * f is the counterfactual feature, and f is the factual feature;

[0027] Based on the theory of causal inference, the model prediction result Y in the factual scenario will be... x, Model prediction results in f and counterfactual scenarios By comparison, the total indirect causal effect (TIE) of the structural causal model is obtained.

[0028]

[0029] Among them, the model prediction results in counterfactual scenarios It utilizes a counterfactual feature strategy, based on the counterfactual feature f * The result is obtained from the fully connected layer in the GCN;

[0030] Model prediction result Y in real-world scenarios x,f It is obtained using the GCN and the factual features;

[0031] The structural causal model is optimized using the total indirect causal effect (TIE) to obtain the transformer fault diagnosis model.

[0032] Based on the above technical solution, further, the model prediction results in the counterfactual scenario... It utilizes a counterfactual feature strategy, based on the counterfactual feature f * The results obtained from the fully connected layers in the GCN specifically include:

[0033] The counterfactual feature f is represented by the learning parameter c. * ;

[0034] Using the PoE (Profession Product of Experts) calculation formula, the learned parameter c is multiplied by the output Y of the fully connected layer of the CGN. x By combining these methods, the model prediction results under the counterfactual scenario are obtained. Among them, the formula for calculating the product of integrated strategy experts (PoE) is as follows:

[0035] Secondly, the present invention also provides a transformer fault diagnosis model construction device based on counterfactual analysis, the device comprising:

[0036] The first construction module is used to acquire dissolved gas data in transformer oil and design a structural causal model, which represents the relationship between transformer operating status, dissolved gas data, model extracted features and fault prediction.

[0037] The second construction module is used to create a graph convolutional neural network (GCN), obtain an adjacency matrix based on the dissolved gas data, and obtain factual features and counterfactual features in the features extracted by the model according to the adjacency matrix and the GCN.

[0038] The third construction module is used to train the structural causal model using the factual features, the counterfactual features, and the counterfactual feature strategy to obtain the transformer fault diagnosis model.

[0039] Based on the above technical solution, the structural causal model further represents the relationship between the transformer operating state, dissolved gas data, model extracted features, and fault prediction, and is expressed as follows:

[0040] S→X→F→Y

[0041] S→X→Y

[0042] Where S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance case, i.e. the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance case, i.e. the counterfactual scenario.

[0043] Based on the above technical solution, the second construction module is further used to divide the dissolved gas data into dissolved gas combinations and to standardize the dissolved gas data in each dissolved gas combination.

[0044] The standardized dissolved gas combinations are used to extract low-dimensional features from the dissolved gas combinations using the Siamese neural network. The Euclidean distance between each dissolved gas combination is calculated using the low-dimensional features. The k-nearest neighbor algorithm is used to find the other dissolved gas combinations with the smallest Euclidean distance to each of the dissolved gas combinations as training samples.

[0045] Link the sample data in the training samples that have the same fault type to construct an n×n adjacency matrix A, where n is the number of samples in the training samples.

[0046] By setting the adjacency matrix A to the identity matrix I, where A ~ I;

[0047] The training samples, the adjacency matrix A, and the identity matrix I are input into the GCN to obtain the factual features and counterfactual features extracted by the model.

[0048] Based on the above technical solution, the second construction module is further configured to input the training data and the adjacency matrix (X,A) into a nonlinear activation function to obtain the model-extracted features H. (l+1) The nonlinear activation function is yes The degree matrix, i.e.

[0049] H represents the extracted features for each layer. For the input layer, H is X, W l and b l These are the weight matrix and bias terms of the network layer of the CGN, respectively;

[0050] The model extracts features H (l+1) The factual features and the counterfactual features are obtained from this.

[0051] Based on the above technical solution, the third construction module is further used to obtain the model prediction result Y in the actual scenario. x,f Model prediction results in counterfactual scenarios

[0052] Y x,f =Y(X=x,F=f)=P(Y|X=x,F=P(F|X=x))

[0053]

[0054] Among them, f* f is the counterfactual feature, and f is the factual feature;

[0055] Based on the theory of causal inference, the model prediction result Y in the factual scenario will be... x,f Model prediction results in counterfactual scenarios By comparison, the total indirect causal effect (TIE) of the structural causal model is obtained.

[0056]

[0057] Among them, the model prediction results in counterfactual scenarios It utilizes a counterfactual feature strategy, based on the counterfactual feature f * The result is obtained from the fully connected layer in the GCN;

[0058] Model prediction result Y in real-world scenarios x,f It is obtained using the GCN and the factual features;

[0059] The structural causal model is optimized using the total indirect causal effect (TIE) to obtain the transformer fault diagnosis model.

[0060] Based on the above technical solution, further, the third construction module is specifically used to represent the counterfactual feature f using the learning parameter c. * ;

[0061] Using the PoE (Profession Product of Experts) calculation formula, the learned parameter c is multiplied by the output Y of the fully connected layer of the CGN. x By combining these methods, the model prediction results under the counterfactual scenario are obtained. Among them, the formula for calculating the product of integrated strategy experts (PoE) is as follows:

[0062] Thirdly, the present invention also provides a transformer fault diagnosis method, based on a transformer fault diagnosis model constructed according to the above technical solution, the method comprising:

[0063] Acquire real-time dissolved gas data in transformer oil;

[0064] The real-time dissolved gas data is input into the transformer fault diagnosis model to obtain the transformer fault prediction results.

[0065] Fourthly, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the transformer fault diagnosis model construction method based on counterfactual analysis as described in any of the above technical solutions.

[0066] Fifthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the transformer fault diagnosis model construction method based on counterfactual analysis as described in any of the above technical solutions.

[0067] This invention provides a method for constructing a transformer fault diagnosis model based on counterfactual analysis. The method includes acquiring dissolved gas data in transformer oil and designing a structural causal model, which represents the relationship between the transformer's operating state, dissolved gas data, model-extracted features, and fault prediction. A graph convolutional neural network (GCN) is created, and an adjacency matrix is ​​obtained based on the dissolved gas data. Based on the adjacency matrix and the GCN, factual and counterfactual features from the model-extracted features are obtained. The structural causal model is trained using the factual features, the counterfactual features, and a counterfactual feature strategy to obtain a transformer fault diagnosis model. This invention achieves high-precision and robust transformer fault diagnosis, effectively solving the problems of misjudgment and missed judgment of unbalanced fault samples. Attached Figure Description

[0068] The accompanying drawings, which form part of this specification, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0069] Figure 1 This is a flowchart illustrating a method for constructing a transformer fault diagnosis model based on counterfactual analysis, provided in an embodiment of the present invention.

[0070] Figure 2 This is a schematic diagram of a structural causal model in transformer fault diagnosis provided in an embodiment of the present invention;

[0071] Figure 3 This is a schematic diagram of a graph convolutional neural network structure provided in an embodiment of the present invention;

[0072] Figure 4 A schematic diagram of a transformer fault diagnosis model based on graph convolution and counterfactual analysis provided in an embodiment of the present invention;

[0073] Figure 5 A flowchart of a transformer fault diagnosis model based on graph convolution and counterfactual analysis provided in an embodiment of the present invention;

[0074] Figure 6 A schematic diagram of a transformer fault diagnosis model construction device based on counterfactual analysis provided in an embodiment of the present invention;

[0075] Figure 7 This is a schematic diagram of a transformer fault diagnosis method based on counterfactual analysis provided in another embodiment of the present invention. Detailed Implementation

[0076] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0077] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this invention is for describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.

[0078] The following will be combined with the appendix Figure 1 The present invention provides a method for constructing a transformer fault diagnosis model based on counterfactual analysis, comprising the following steps:

[0079] 110. Obtain dissolved gas data in transformer oil and design a structural causal model, wherein the structural causal model represents the relationship between transformer operating state, dissolved gas data, model extracted features and fault prediction;

[0080] 120. Create a graph convolutional neural network (GCN), obtain an adjacency matrix based on the dissolved gas data, and obtain the factual features and counterfactual features in the features extracted by the model according to the adjacency matrix and the GCN.

[0081] 130. The structural causal model is trained using the factual features, the counterfactual features, and the counterfactual feature strategy to obtain the transformer fault diagnosis model.

[0082] Based on the above embodiments, the structural causal model further represents the relationship between transformer operating state, dissolved gas data, model extracted features, and fault prediction, and is expressed as follows:

[0083] S→X→F→Y

[0084] S→X→Y

[0085] Where S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance case, i.e. the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance case, i.e. the counterfactual scenario.

[0086] Based on the above embodiments, step 120 further includes:

[0087] 121. Divide the dissolved gas data into dissolved gas combinations, and standardize the dissolved gas data in each dissolved gas combination;

[0088] 122. The standardized dissolved gas combinations are processed using Siamese neural network to extract low-dimensional features from the dissolved gas combinations. The Euclidean distance between each dissolved gas combination is calculated using the low-dimensional features. The k-nearest neighbor algorithm is used to find the other dissolved gas combinations with the smallest Euclidean distance to each of the dissolved gas combinations as training samples.

[0089] 123. Link the sample data in the training samples that have the same fault type to construct an n×n adjacency matrix A, where n is the number of samples in the training samples;

[0090] 124. By setting the adjacency matrix A as the identity matrix I, where A ~ I;

[0091] 125. Input the training samples, the adjacency matrix A, and the identity matrix I into the GCN to obtain the factual features and counterfactual features in the features extracted by the model.

[0092] Based on the above technical solution, step 125 further includes:

[0093] The training data and the adjacency matrix (X,A) are input into a nonlinear activation function to obtain the feature H extracted by the model. (l+1) The nonlinear activation function is yes The degree matrix, i.e. H represents the extracted features for each layer. For the input layer, H is X, W l and b l These are the weight matrix and bias terms of the network layer of the CGN, respectively;

[0094] The model extracts features H (l+1) The factual features and the counterfactual features are obtained from this.

[0095] Based on the above embodiments, step 130 further includes:

[0096] Obtain the model prediction results Y in the actual scenarios respectively x,f Model prediction results in counterfactual scenarios

[0097] Y x,f =Y(X=x,F=f)=P(Y|X=x,F=P(F|X=x))

[0098]

[0099] Among them, f * f is the counterfactual feature, and f is the factual feature;

[0100] Based on the theory of causal inference, the model prediction result Y in the factual scenario will be... x,f Model prediction results in counterfactual scenarios By comparison, the total indirect causal effect (TIE) of the structural causal model is obtained.

[0101]

[0102] Among them, the model prediction results in counterfactual scenarios It utilizes a counterfactual feature strategy, based on the counterfactual feature f * The result is obtained from the fully connected layer in the GCN;

[0103] Model prediction result Y in real-world scenarios x,f It is obtained using the GCN and the factual features;

[0104] The structural causal model is optimized using the total indirect causal effect (TIE) to obtain the transformer fault diagnosis model.

[0105] Based on the above embodiments, further, the model prediction results in the counterfactual scenario in step 130... It utilizes a counterfactual feature strategy, based on the counterfactual feature f * The results obtained from the fully connected layers in the GCN specifically include:

[0106] The counterfactual feature f is represented by the learning parameter c. * ;

[0107] Using the PoE (Profession Product of Experts) calculation formula, the learned parameter c is multiplied by the output Y of the fully connected layer of the CGN. x By combining these methods, the model prediction results under the counterfactual scenario are obtained. Among them, the formula for calculating the product of integrated strategy experts (PoE) is as follows:

[0108] Furthermore, to maximize the calculated causal effects and improve the robustness of the model, it is necessary to control the probability distribution. The impact. The impact should be related to Y x,f Similarly, otherwise, c that is too large or too small will cause TIE to change from Y. x,f or Therefore, the Kullback-Leibler divergence is used to estimate c:

[0109]

[0110] Where p(y|x,f) represents softmax(Y) x,f ), p(y|x,f * )express |Y| represents the number of categories in the prediction. Furthermore, the model is optimized by minimizing the cross-entropy loss function, so the total loss function is:

[0111]

[0112] Where S represents the actual transformer state, L ce This represents the cross-entropy loss function. After the training phase, the model uses TIE to diagnose the transformer state during the testing phase. Performance metrics include accuracy, macro F1 score, and geometric mean recall (G-mean) to evaluate the model's performance in imbalanced data scenarios.

[0113] The above embodiments propose a method for constructing a transformer fault diagnosis model based on counterfactual analysis. This method includes acquiring dissolved gas data in transformer oil and designing a structural causal model, which represents the relationship between the transformer's operating state, dissolved gas data, model-extracted features, and fault prediction. A graph convolutional neural network (GCN) is created, and an adjacency matrix is ​​obtained based on the dissolved gas data. Based on the adjacency matrix and the GCN, factual and counterfactual features in the model-extracted features are obtained. The structural causal model is trained using the factual features, the counterfactual features, and a counterfactual feature strategy to obtain a transformer fault diagnosis model. This invention achieves high-precision and robust transformer fault diagnosis, effectively solving the problems of misjudgment and missed judgment of unbalanced fault samples.

[0114] It should be understood that the main methods for processing imbalanced data include sampling and model ensemble techniques. Sampling methods can cause data to deviate from the true distribution or lose useful data information. Model ensemble methods also perform sampling or weighting operations on the data, making it impossible for the model to learn the complete data distribution, resulting in low accuracy in fault diagnosis. This invention proposes a transformer fault diagnosis method combining causal inference techniques with graph convolution and counterfactual analysis, which can achieve high-precision and robust transformer fault diagnosis, effectively solving the problems of misjudgment and missed judgment of imbalanced fault samples.

[0115] This invention improves the level of transformer fault diagnosis in the following two aspects:

[0116] 1. Achieving a counterfactual explanation for transformer fault analysis. This invention constructs a causal structure model between fault types and dissolved gas data, proposes corresponding counterfactual scenarios for unbalanced data, and obtains the causal relationship between faults and gas data through causal inference techniques. It then utilizes the total indirect causal effect to mitigate the adverse effects of unbalanced data without causing the model to lose information.

[0117] 2. Implementing a counterfactual graph convolutional model for transformer fault diagnosis. This invention applies graph convolutional networks to a structural causal model to extract features of dissolved gases. For the aforementioned counterfactual scenarios, it proposes two specific implementations of counterfactual conditions for these features, enabling quantitative research on the causal relationship between faults and data, thereby improving the model's predictive adaptability to imbalanced datasets.

[0118] like Figures 2 to 5 As shown, another embodiment of the present invention includes the following steps:

[0119] Step 1: Counterfactual Analysis of the Structural Causal Model. For the transformer condition, dissolved gas data, model-extracted features, and fault predictions, a structural causal model is constructed to reflect the causal relationships between variables. Figure 2 As shown, the model has two paths. The first is the typical inference path S→X→F→Y under equilibrium conditions, where S represents the transformer state, X represents dissolved gas data, Y represents the output variable, and the intermediate F represents the extracted feature variable. The second is the biased path S→X→Y under imbalance conditions, where the model directly predicts P without extracting feature F. A counterfactual scenario is defined: given a gas data point X, if feature F is not an observed value, what would the model predict Y? Based on the model and the counterfactual scenario, the calculation results of the model's prediction Y under the factual and counterfactual scenarios are obtained respectively.

[0120] Y x,f =Y(X=x,F=f)=P(Y|X=x,F=P(F|X=x))

[0121]

[0122] Among them, f * When X is set to x * The values ​​of the characteristic variables at that time are the counterfactual characteristic values. Based on causal inference theory, the potential outcomes under the two conditions are compared to obtain the total indirect effect (TIE) of the gas data on the model prediction. This allows the model to fully utilize the characteristics and eliminate the direct influence of imbalanced data.

[0123]

[0124] Step 2 as follows Figure 3 As shown, the graph convolutional network design is illustrated. For the feature extraction step in step 1, a graph convolutional neural network (GCN) is used. First, dissolved gas data in transformer oil is collected, using nine sets of dissolved gas data as model inputs (H2, C2H6, CH4, C2H2, C2H4, CH4 / H2, C2H2 / C2H4, C2H4 / C2H6, and C2H6 / CH4), followed by standardization.

[0125]

[0126] Where x and x new x represents the gas data before and after standardization, respectively. max and x min Let x and n represent the maximum and minimum values ​​in the gas data, respectively. Besides x, GCN also requires an n×n adjacency matrix A, where n is the number of samples in the dataset. The adjacency matrix is ​​constructed by linking samples to samples with the same label. For example, if the i-th sample and the j-th sample belong to partial discharge, then A(i,j) = A(j,i) = 1. For samples in the test set (unknown samples), a Siamese network is used to extract low-dimensional features of the input variables to calculate the Euclidean distance between samples. Then, the k-nearest neighbor algorithm is used to find the k closest samples to the unknown sample and consider them connected. The size of k determines the number of samples in the training set connected to each unknown sample, which directly affects the adjacency matrix A. When k is small, the unknown sample is only connected to the nearest sample, making it difficult to fully utilize the similarity measure between samples, resulting in limited accuracy. When k is very large, the unknown sample is connected to many samples, which may lead to the unknown sample being connected to samples of different types, thus generating noise and limiting model performance. Therefore, setting the value of k to 10 optimizes the model's performance in fault diagnosis.

[0127] like Figure 4-5 As shown, GCN takes (X,A) as input data and uses the inherent topology to generate intermediate features. The calculation formula is as follows:

[0128]

[0129] in, I is the identity matrix; yes The degree matrix, i.e. H represents the features of each layer; for the input layer, H is X; ReLU is the non-linear activation function; W l and b l Here are the weight matrix and bias terms for the graph convolutional network layers. This invention employs a two-layer graph convolutional network as its structure, and its output is H.(3) Then the final model prediction Y is:

[0130] Y = Softmax(H) (3) W3+b3)

[0131] Here, Softmax is the normalization function, and W3 and b3 are the weight matrix and bias term of the fully connected layer. The model predicts seven transformer states: normal, low-temperature overheating, medium-temperature overheating, high-temperature overheating, low-energy discharge, high-energy discharge, and partial discharge.

[0132] Step 3: Counterfactual Feature Strategy. Since counterfactual conditions are defined as hindering the influence of feature variable f, the counterfactual feature values ​​defined in Step 1 should be represented as an empty set. Based on the fact that the model cannot handle invalid inputs, two heuristic counterfactual feature strategies are proposed to achieve counterfactual conditions for features.

[0133] Step 3.1 For the adjacency matrix A described in Step 2, an identity matrix is ​​used to generate counterfactual features, causing the model to focus only on self-nodes rather than neighbors. Specifically, the adjacency matrix A is set to the identity matrix I to help generate counterfactual features:

[0134] A~I

[0135] Step 3.2 Use a learnable parameter c to represent the counterfactual feature f. * The uniform distribution assumption has two reasons. First, when the specific state—that is, the cause or type of the failure—is completely unknown, random guessing is usually employed. Second, using f... * To estimate Uniform distribution guarantees a safe estimate. Based on the condition that features are blocked in a counterfactual state, the entire GCN structure is abandoned, and only fully connected layers are used for prediction. The output of this fully connected layer is represented as Y. x In order to connect parameter c with Y x In combination, an integrated strategy was adopted: the Product of Experts (PoE), calculated as follows:

[0136]

[0137] Furthermore, to maximize the calculated causal effects and improve the robustness of the model, it is necessary to control the probability distribution. The impact. The impact should be related to Y x,f Similarly, otherwise, c that is too large or too small will cause TIE to change from Y. x,f or Therefore, the Kullback-Leibler divergence is used to estimate c:

[0138]

[0139] Where p(y|x,f) represents softmax(Y) x,f ), p(y|x,f * )express Y| represents the number of categories in the prediction. Furthermore, the model is optimized by minimizing the cross-entropy loss function, so the total loss function is:

[0140]

[0141] Where S represents the actual transformer state, L ce This represents the cross-entropy loss function. After the training phase, the model uses TIE to diagnose the transformer state during the testing phase. Performance metrics include accuracy, macro F1 score, and geometric mean recall (G-mean) to evaluate the model's performance in imbalanced data scenarios.

[0142] This invention introduces counterfactual analysis into transformer fault diagnosis research, proposing a transformer fault diagnosis method based on graph convolution and counterfactual analysis. This method effectively analyzes the causal relationship of transformer fault evolution, quantitatively describes the causal effect between fault causes and dissolved gas data, and solves the problems of misjudgment and omission in existing fault diagnosis models when facing unbalanced data. It effectively improves the accuracy and robustness of the model in the field of transformer fault diagnosis, and provides a new technical support for transformer fault diagnosis research.

[0143] This invention addresses the field of transformer fault diagnosis technology by introducing counterfactual analysis and causal structure models to describe the causal effects of unbalanced data in fault diagnosis. By separating these unbalanced data from the overall causal effects, the model mitigates the adverse effects of data class imbalance without losing information.

[0144] This invention designs a graphical convolutional network to extract features from dissolved gas data, uncovering the complex nonlinear relationship between fault types and dissolved gases, as well as the similarity between unknown samples and labeled samples. It proposes a counterfactual feature strategy to quantitatively estimate the causal effects after separation, thereby enhancing the accuracy of the model and addressing the problem of insufficient robustness in traditional methods.

[0145] This invention relates to a causal structure model based on the relationship between fault type and dissolved gas data. Through counterfactual analysis, it separates the total indirect causal effect from the overall causal effect of gas data on the model's predictions and uses this information for fault diagnosis. This allows the model to mitigate the adverse effects of data class imbalance without losing information. Corresponding to the causal structure model, a graph convolutional network is used for feature extraction, and a counterfactual feature strategy is used to estimate the causal effect.

[0146] This invention enables the efficient utilization of the causal effect between gas data and transformer status in transformer fault diagnosis. By analyzing the causal relationship of each variable in fault diagnosis through a causal structure model, it quantitatively describes the causal influence between fault causes and gas data, thereby improving the robustness and accuracy of transformer fault diagnosis and providing a new technical approach for transformer fault diagnosis research.

[0147] like Figure 6 As shown, another embodiment of the present invention also provides a transformer fault diagnosis model construction device based on counterfactual analysis, the device comprising:

[0148] The first construction module is used to acquire dissolved gas data in transformer oil and design a structural causal model, which represents the relationship between transformer operating status, dissolved gas data, model extracted features and fault prediction.

[0149] The second construction module is used to create a graph convolutional neural network (GCN), obtain an adjacency matrix based on the dissolved gas data, and obtain factual features and counterfactual features in the features extracted by the model according to the adjacency matrix and the GCN.

[0150] The third construction module is used to train the structural causal model using the factual features, the counterfactual features, and the counterfactual feature strategy to obtain the transformer fault diagnosis model.

[0151] Based on the above embodiments, the structural causal model further represents the relationship between transformer operating state, dissolved gas data, model extracted features, and fault prediction, and is expressed as follows:

[0152] S→X→F→Y

[0153] S→X→Y

[0154] Where S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance case, i.e. the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance case, i.e. the counterfactual scenario.

[0155] Based on the above embodiments, the second construction module is further configured to divide the dissolved gas data into dissolved gas combinations and standardize the dissolved gas data in each dissolved gas combination.

[0156] The standardized dissolved gas combinations are used to extract low-dimensional features from the dissolved gas combinations using the Siamese neural network. The Euclidean distance between each dissolved gas combination is calculated using the low-dimensional features. The k-nearest neighbor algorithm is used to find the other dissolved gas combinations with the smallest Euclidean distance to each of the dissolved gas combinations as training samples.

[0157] Link the sample data in the training samples that have the same fault type to construct an n×n adjacency matrix A, where n is the number of samples in the training samples.

[0158] By setting the adjacency matrix A to the identity matrix I, where A ~ I;

[0159] The training samples, the adjacency matrix A, and the identity matrix I are input into the GCN to obtain the factual features and counterfactual features extracted by the model.

[0160] Based on the above embodiments, the second construction module is further configured to input the training data and the adjacency matrix (X,A) into a nonlinear activation function to obtain the model-extracted features H. (l+1) The nonlinear activation function is yes The degree matrix, i.e. H represents the extracted features for each layer. For the input layer, H is X, W l and b l These are the weight matrix and bias terms of the network layer of the CGN, respectively;

[0161] The model extracts features H (l+1) The factual features and the counterfactual features are obtained from this.

[0162] Based on the above embodiments, the third construction module is further configured to obtain the model prediction result Y in the actual scenario. x,f Model prediction results in counterfactual scenarios

[0163] Y x,f =Y(X=x,F=f)=P(Y|X=x,F=P(F|X=x))

[0164]

[0165] Among them, f * f is the counterfactual feature, and f is the factual feature;

[0166] Based on the theory of causal inference, the model prediction result Y in the factual scenario will be... x, Model prediction results in f and counterfactual scenarios By comparison, the total indirect causal effect (TIE) of the structural causal model is obtained.

[0167]

[0168] Among them, the model prediction results in counterfactual scenarios It utilizes a counterfactual feature strategy, based on the counterfactual feature f * The result is obtained from the fully connected layer in the GCN;

[0169] Model prediction result Y in real-world scenarios x,f It is obtained using the GCN and the factual features;

[0170] The structural causal model is optimized using the total indirect causal effect (TIE) to obtain the transformer fault diagnosis model.

[0171] Based on the above embodiments, the third construction module is further configured to use the learning parameter c to represent the counterfactual feature f. * ;

[0172] Using the PoE (Profession Product of Experts) calculation formula, the learned parameter c is multiplied by the output Y of the fully connected layer of the CGN. x By combining these methods, the model prediction results under the counterfactual scenario are obtained. Among them, the formula for calculating the product of integrated strategy experts (PoE) is as follows:

[0173] The above embodiment proposes a transformer fault diagnosis model construction device based on counterfactual analysis, which includes acquiring dissolved gas data in transformer oil and designing a structural causal model. The structural causal model represents the relationship between the transformer's operating state, dissolved gas data, model-extracted features, and fault prediction. A graph convolutional neural network (GCN) is created, and an adjacency matrix is ​​obtained based on the dissolved gas data. Based on the adjacency matrix and the GCN, factual features and counterfactual features in the model-extracted features are obtained. The structural causal model is trained using the factual features, the counterfactual features, and a counterfactual feature strategy to obtain a transformer fault diagnosis model. This invention achieves high-precision and highly robust transformer fault diagnosis, effectively solving the problems of misjudgment and missed judgment of unbalanced fault samples.

[0174] like Figure 7As shown, another embodiment of the present invention also provides a transformer fault diagnosis method, which, based on the transformer fault diagnosis model constructed in the above embodiments, includes the following steps:

[0175] S1. Obtain real-time dissolved gas data in transformer oil;

[0176] S2. Input the real-time dissolved gas data into the transformer fault diagnosis model to obtain the transformer fault prediction results.

[0177] The transformer fault diagnosis method proposed in the above embodiments achieves high-precision and high-robustness transformer fault diagnosis, effectively solving the problems of misjudgment and missed judgment of unbalanced fault samples.

[0178] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the transformer fault diagnosis model construction method based on counterfactual analysis as described in any of the above technical solutions.

[0179] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the transformer fault diagnosis model construction method based on counterfactual analysis as described in any of the above technical solutions.

[0180] The above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. A method for constructing a transformer fault diagnosis model based on counterfactual analysis, characterized in that, The method includes: Data on dissolved gases in transformer oil are obtained, and a structural causal model is designed. The structural causal model represents the relationship between transformer operating status, dissolved gas data, model extracted features, and fault prediction. A graph convolutional neural network (GCN) is created. An adjacency matrix is ​​obtained based on the dissolved gas data. Factual features in the model's extracted features are obtained based on the adjacency matrix and the GCN. Counterfactual features are obtained using a counterfactual feature strategy. The structural causal model is trained using the factual features, the counterfactual features, and the counterfactual feature strategy to obtain a transformer fault diagnosis model. Based on the adjacency matrix and the GCN, the factual features extracted by the model are obtained, including: dividing the dissolved gas data into dissolved gas combinations and standardizing the dissolved gas data in each dissolved gas combination; extracting low-dimensional features from the standardized dissolved gas combinations using a Siamese neural network, calculating the Euclidean distance between each dissolved gas combination using the low-dimensional features, and finding the other dissolved gas combinations with the smallest Euclidean distance to each other using the k-nearest neighbor algorithm as training samples; linking the sample data in the training samples with the same fault type to construct... adjacency matrix A , This is the number of training samples; the training samples and the adjacency matrix are... A Inputting into the GCN yields factual features from the features extracted by the model; The step of training the structural causal model using the factual features, the counterfactual features, and the counterfactual feature strategy to obtain the transformer fault diagnosis model includes: based on causal inference theory, the model prediction results under the factual scenario... Model prediction results in counterfactual scenarios By comparison, the total indirect causal effect (TIE) of the structural causal model is obtained. Among them, the model prediction results in counterfactual scenarios It utilizes a counterfactual feature strategy, based on the counterfactual features... And obtained from fully connected layers; As a counterfactual feature, f For factual features; model prediction results in factual scenarios. It is obtained by using the GCN and the factual features; the structural causal model is optimized using the total indirect causal effect TIE to obtain the transformer fault diagnosis model; The model prediction results in the counterfactual scenario It utilizes a counterfactual feature strategy, based on the counterfactual features... The results obtained from fully connected layers include: based on the uniform distribution assumption, utilizing learned parameters This indicates the counterfactual feature. Using the integrated policy expert product (PoE) calculation formula, the learned parameters are... With the output of the fully connected layer By combining these methods, the model prediction results under the counterfactual scenario are obtained. The formula for calculating the PoE (Power over Estimate) of the Integrated Strategy Expert Product is as follows: The Kullback-Leibler divergence is used to estimate the learning parameters. : in, Indicates the number of categories in the prediction. express , express .

2. The method according to claim 1, characterized in that, The structural causal model represents the relationship between transformer operating state, dissolved gas data, model extracted features, and fault prediction, expressed as follows: in, Indicates the transformer status. Represents dissolved gas data. Indicates output variable, intermediary Indicates the extracted feature variables, This represents the reasoning path for a sample balance situation, i.e., a factual scenario. This represents the reasoning path for imbalanced samples, i.e., counterfactual scenarios.

3. The method according to claim 1, characterized in that, The model prediction results for the factual scenario and the model prediction results for the counterfactual scenario are obtained respectively; 。 4. A transformer fault diagnosis model construction device based on counterfactual analysis, used to implement the transformer fault diagnosis model construction method according to any one of claims 1-3, characterized in that, The device includes: The first construction module is used to acquire dissolved gas data in transformer oil and design a structural causal model, which represents the relationship between transformer operating status, dissolved gas data, model extracted features and fault prediction. The second construction module is used to create a graph convolutional neural network (GCN), obtain an adjacency matrix based on the dissolved gas data, obtain factual features in the model's extracted features according to the adjacency matrix and the GCN, and obtain counterfactual features using a counterfactual feature strategy. The third construction module is used to train the structural causal model using the factual features, the counterfactual features, and the counterfactual feature strategy to obtain the transformer fault diagnosis model.

5. A method for diagnosing transformer faults, characterized in that, A transformer fault diagnosis model constructed based on any one of the transformer fault diagnosis model construction methods in claims 1-3 above, wherein the method includes: Acquire real-time dissolved gas data in transformer oil; The real-time dissolved gas data is input into the transformer fault diagnosis model to obtain the transformer fault prediction results.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the transformer fault diagnosis model construction method based on counterfactual analysis as described in any one of claims 1 to 3.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the transformer fault diagnosis model construction method based on counterfactual analysis as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Anti-fact confidence data generation method based on fault dictionary

    CN116108755A

  • Anti-fact fault data generation method based on causal intervention

    CN117520905A