Transformer fault diagnosis model construction method and device based on anti-fact analysis

Through a transformer fault diagnosis model based on counterfactual analysis, structural causality model and graph convolutional neural network are used to extract the characteristics of transformer faults, solve the misjudgment problem caused by unbalanced category distribution, and achieve high accuracy and high robustness. Troubleshooting.

CN118797477AActive Publication Date: 2024-10-18CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +2

Patent Information

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

Smart Images

  • Figure CN118797477A_ABST
    Figure CN118797477A_ABST
Patent Text Reader

Abstract

The invention relates to a transformer fault diagnosis model construction method and device based on anti-fact analysis, and the method comprises the steps: obtaining the data of dissolved gas in transformer oil, and designing a structural causal model which represents the relation among the working state of a transformer, the data of the dissolved gas, model extraction features and fault prediction; creating a graph convolutional neural network GCN, obtaining an adjacent matrix based on the dissolved gas data, and obtaining factual features and anti-factual features in the model extraction features according to the adjacent matrix and the GCN; and training the structural causal model by using the fact features, the anti-fact features and an anti-fact feature strategy to obtain a transformer fault diagnosis model. According to the method, high-precision and high-robustness transformer fault diagnosis is realized, and the problems of misjudgment and missed judgment of unbalanced fault samples are effectively solved. The invention further relates to a transformer fault diagnosis method, equipment and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power systems, and in particular to a method and device for constructing a transformer fault diagnosis model based on counterfactual analysis. Background Art

[0002] The power transformer is one of the most critical equipment in substations and power plants, and its reliability plays a vital role in the operation of the entire system. Monitoring the operating status of the transformer is an effective means to detect faults early, which can avoid major social and economic losses to the entire power system. Therefore, accurately identifying the fault type of the power transformer is of great significance to the development of the power transformer. Since the probability of transformer failure is relatively small, and there are problems such as missing and incomplete information on fault cases and abnormal samples, the number distribution of each category in the transformer oil chromatographic data is uneven. This factor greatly affects the model's analysis and prediction of fault detection tasks, making it tend to judge the majority class, resulting in incorrect fault diagnosis results.

[0003] Existing transformer fault diagnosis methods based on deep learning are mainly trained and tested on fault samples. They can diagnose various types of faults relatively accurately and achieve good diagnostic results, but lack high-quality data. However, for transformer fault diagnosis with extremely unbalanced sample sets, the diagnostic accuracy of these classifiers is often poor. In addition, since the transformer is actually in normal state much more than in fault state, the model will frequently misreport the normal state as a fault state, resulting in additional inspection and maintenance costs. On the other hand, unidentified or incorrect fault diagnosis can lead to serious accidents. Summary of the invention

[0004] In order to solve the technical problem of high misjudgment rate in transformer fault diagnosis for extremely unbalanced sample sets in category distribution, the present invention provides a method and device 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] Obtaining data on dissolved gas in transformer oil and designing a structural causal model, wherein the structural causal model represents the relationship between transformer operating status, dissolved gas data, model extraction features, and fault prediction;

[0007] 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;

[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, further, the structural causal model represents the relationship between the transformer working state, dissolved gas data, model extraction features and fault prediction, which is expressed as:

[0010] S→X→F→Y

[0011] S→X→Y

[0012] Among them, S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, the intermediary F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance situation, that is, the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance situation, that is, the counterfactual scenario.

[0013] Based on the above technical solution, further, the adjacency matrix is ​​obtained based on the dissolved gas data, and the factual features and counterfactual features in the model extraction features are obtained according to the adjacency matrix and the GCN, which specifically includes:

[0014] dividing the dissolved gas data into dissolved gas combinations, and performing standardization processing on the dissolved gas data in each dissolved gas combination;

[0015] The dissolved gas combination after the standardization is extracted with a Siamese neural network, and the Euclidean distance between each dissolved gas combination is calculated using the low-dimensional features, and the other dissolved gas combinations with the smallest Euclidean distance to each dissolved gas combination are found as training samples through a k-nearest neighbor algorithm;

[0016] Linking sample data in the training samples with 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 factual features and counterfactual features in the model extraction features.

[0019] Based on the above technical solution, further, the training sample, the adjacency matrix A and the identity matrix I are input into the GCN to obtain the factual features and counterfactual features in the model extraction features, specifically including:

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

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

[0022] Based on the above technical solution, further, the structural causal model is trained using the factual feature, the counterfactual feature and the counterfactual feature strategy to obtain a transformer fault diagnosis model, which specifically includes:

[0023] Get the model prediction results Y under the fact scenario respectively x,f And the model prediction results under the counterfactual scenario

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

[0025]

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

[0027] According to the causal inference theory, the model prediction result Y under the factual scenario x, f and the model prediction results under the counterfactual scenario By comparison, the total indirect causal effect TIE of the structural causal model is obtained.

[0028]

[0029] Among them, the model prediction results under the counterfactual scenario is to use the counterfactual feature strategy, according to the counterfactual feature f * and the fully connected layer in the GCN;

[0030] Model prediction result Y in the actual scenario x,f is obtained by using the GCN and the fact 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 under the counterfactual scenario is to use the counterfactual feature strategy, according to the counterfactual feature f * And the fully connected layer in the GCN, specifically including:

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

[0034] The learning parameter c is combined with the output Y of the fully connected layer of the CGN using the integrated strategy expert product PoE calculation formula. x Combined, we get the model prediction results under the counterfactual scenario Among them, the integrated strategy expert product PoE calculation formula

[0035] In a second aspect, the present invention further provides a device for constructing a transformer fault diagnosis model based on counterfactual analysis, the device comprising:

[0036] The first building block is used to obtain the dissolved gas data in the transformer oil and design a structural causal model, wherein the structural causal model represents the relationship between the transformer working state, the dissolved gas data, the model extraction features and the fault prediction;

[0037] The second building 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 model extraction features according to the adjacency matrix and the GCN;

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

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

[0040] S→X→F→Y

[0041] S→X→Y

[0042] Among them, S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, the intermediary F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance situation, that is, the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance situation, that is, the counterfactual scenario.

[0043] Based on the above technical solution, further, the second building module is specifically used to divide the dissolved gas data into dissolved gas combinations, and perform standardization processing on the dissolved gas data in each dissolved gas combination;

[0044] The dissolved gas combination after the standardization is extracted with a Siamese neural network, and the Euclidean distance between each dissolved gas combination is calculated using the low-dimensional features, and the other dissolved gas combinations with the smallest Euclidean distance to each dissolved gas combination are found as training samples through a k-nearest neighbor algorithm;

[0045] Linking sample data in the training samples with 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 factual features and counterfactual features in the model extraction features.

[0048] Based on the above technical solution, further, the second construction module is specifically used to input the training data and the adjacency matrix (X, A) into a nonlinear activation function to obtain the model extraction feature H (l+1) , the nonlinear activation function is yes The degree matrix of

[0049] H is the extracted feature of each layer. For the input layer, H is X, W l and b l are the weight matrix and bias term of the network layer of the CGN respectively;

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

[0051] Based on the above technical solution, further, the third building module is specifically used to obtain the model prediction results Y under the fact scene respectively. x,f And the model prediction results under the counterfactual scenario

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

[0053]

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

[0055] According to the causal inference theory, the model prediction result Y under the factual scenario x,f And the model prediction results under the counterfactual scenario By comparison, the total indirect causal effect TIE of the structural causal model is obtained.

[0056]

[0057] Among them, the model prediction results under the counterfactual scenario is to use the counterfactual feature strategy, according to the counterfactual feature f * and the fully connected layer in the GCN;

[0058] Model prediction result Y in the actual scenario x,f is obtained by using the GCN and the fact 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 building block is specifically used to use the learning parameter c to represent the counterfactual feature f * ;

[0061] The learning parameter c is combined with the output Y of the fully connected layer of the CGN using the integrated strategy expert product PoE calculation formula. x Combined, we get the model prediction results under the counterfactual scenario Among them, the integrated strategy expert product PoE calculation formula

[0062] In a third aspect, the present invention further provides a transformer fault diagnosis method, based on the transformer fault diagnosis model constructed based on the above technical solution, the method comprises:

[0063] Get 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 a transformer fault prediction result.

[0065] In a fourth aspect, the present invention further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for constructing a transformer fault diagnosis model based on counterfactual analysis as described in any one of the above technical solutions is implemented.

[0066] In a fifth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for constructing a transformer fault diagnosis model based on counterfactual analysis as described in any one of the above technical solutions is implemented.

[0067] The present invention provides a method for constructing a transformer fault diagnosis model based on counterfactual analysis, including obtaining dissolved gas data in transformer oil, and designing a structural causal model, wherein the structural causal model represents the relationship between transformer working state, 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 using the factual features, the counterfactual features and the counterfactual feature strategy to obtain a transformer fault diagnosis model. The present invention realizes high-precision and high-robustness transformer fault diagnosis, and effectively solves the problems of misjudgment and missed judgment of unbalanced fault samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0069] Figure 1 It is a flow chart of a method for constructing a transformer fault diagnosis model based on counterfactual analysis provided by an embodiment of the present invention;

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

[0071] Figure 3 A schematic diagram of the graph convolutional neural network structure provided by 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 by an embodiment of the present invention;

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

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

[0075] Figure 7 It is a schematic diagram of a transformer fault diagnosis method based on counterfactual analysis provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0076] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.

[0077] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present invention belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present invention.

[0078] The following will be combined with the attached Figure 1 , a transformer fault diagnosis model construction method based on counterfactual analysis provided by an embodiment of the present invention is described, comprising the following steps:

[0079] 110. Obtaining dissolved gas data in transformer oil and designing a structural causal model, wherein the structural causal model represents the relationship between the transformer working state, dissolved gas data, model extraction 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 factual features and counterfactual features in the model extraction features according to the adjacency matrix and the GCN;

[0081] 130. Train the structural causal model using the factual feature, the counterfactual feature and the counterfactual feature strategy to obtain a transformer fault diagnosis model.

[0082] Based on the above embodiment, further, the structural causal model represents the relationship between the transformer working state, dissolved gas data, model extraction features and fault prediction, which is expressed as:

[0083] S→X→F→Y

[0084] S→X→Y

[0085] Among them, S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, the intermediary F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance situation, that is, the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance situation, that is, the counterfactual scenario.

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

[0087] 121. Divide the dissolved gas data into dissolved gas combinations, and perform standardization processing on the dissolved gas data in each dissolved gas combination;

[0088] 122. Using the Siamese neural network to extract low-dimensional features from the dissolved gas combinations after the standardized processing, using the low-dimensional features to calculate the Euclidean distance between each dissolved gas combination, and using the k-nearest neighbor algorithm to find other dissolved gas combinations with the smallest Euclidean distance to each dissolved gas combination as training samples;

[0089] 123. Linking sample data in the training samples with 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 to 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 factual features and counterfactual features in the model extraction features.

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

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

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

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

[0096] Get the model prediction results Y under the fact scenario respectively x,f And the model prediction results under the counterfactual scenario

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

[0098]

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

[0100] According to the causal inference theory, the model prediction result Y under the factual scenario x,f And the model prediction results under the counterfactual scenario By comparison, the total indirect causal effect TIE of the structural causal model is obtained.

[0101]

[0102] Among them, the model prediction results under the counterfactual scenario is to use the counterfactual feature strategy, according to the counterfactual feature f * and the fully connected layer in the GCN;

[0103] Model prediction result Y in the actual scenario x,f is obtained by using the GCN and the fact 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 embodiment, further, the model prediction result under the counterfactual scenario in step 130 is to use the counterfactual feature strategy, according to the counterfactual feature f * And the fully connected layer in the GCN, specifically including:

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

[0107] The learning parameter c is combined with the output Y of the fully connected layer of the CGN using the integrated strategy expert product PoE calculation formula. x Combined, we get the model prediction results under the counterfactual scenario Among them, the integrated strategy expert product PoE calculation formula

[0108] In addition, in order to maximize the calculated causal effect and improve the robustness of the model, it is necessary to control the probability distribution. impact. The impact should be related to Y x,f Otherwise, too large or too small c will cause TIE to be x,f or dominates, so we use the Kullback-Leibler divergence to estimate c:

[0109]

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

[0111]

[0112] Among them, S represents the actual transformer state, L ce Denotes the cross entropy loss function. After the training phase, the model uses TIE to diagnose the transformer status in the test phase. The performance metrics include accuracy, macro F1 score, and geometric mean recall (G-mean) to evaluate the performance of the model in the imbalanced data scenario.

[0113] The above embodiment proposes a method for constructing a transformer fault diagnosis model based on counterfactual analysis, including obtaining dissolved gas data in transformer oil and designing a structural causal model, wherein the structural causal model represents the relationship between the transformer working state, 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 using the factual features, the counterfactual features and the counterfactual feature strategy to obtain a transformer fault diagnosis model. The present invention realizes high-precision and high-robustness transformer fault diagnosis, and effectively solves the problems of misjudgment and missed judgment of unbalanced fault samples.

[0114] It should be understood that the main methods for processing unbalanced data are sampling and model integration technology. The sampling method will cause the data to deviate from the true distribution or lose useful data information. The model integration method also performs operations such as sampling or weighting on the data, so that the model cannot learn the complete data distribution, and the accuracy of fault diagnosis is not high. The present invention combines causal inference technology to propose a transformer fault diagnosis method based on graph convolution and counterfactual analysis, which can achieve high-precision and high-robustness transformer fault diagnosis, and effectively solve the problems of misjudgment and missed judgment of unbalanced fault samples.

[0115] The present invention improves the transformer fault diagnosis level from the following two aspects:

[0116] 1. Realize counterfactual explanation for transformer fault analysis. The present invention proposes corresponding counterfactual scenarios for unbalanced data by constructing a causal structure model between fault type and dissolved gas data, and obtains the causal relationship between fault and gas data through causal inference technology, and then uses the total indirect causal effect to alleviate the adverse effects of unbalanced data without causing the model to lose information.

[0117] 2. Implement transformer fault diagnosis with counterfactual graph convolution model. The present invention applies graph convolution network to structural causal model to extract dissolved gas features, and proposes two specific implementations of counterfactual conditions of the features for the above counterfactual scenarios, so as to quantitatively study the causal relationship between faults and data, thereby improving the adaptability of the model prediction to unbalanced data sets.

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

[0119] Step 1: Counterfactual analysis of structural causal model. For transformer status, dissolved gas data, model-extracted features and fault prediction, a structural causal model is constructed to reflect the causal relationship between variables. Figure 2 As shown, the model has two paths. One is the typical reasoning path S→X→F→Y under balanced conditions, where S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, and the intermediary F represents the extracted characteristic variable. The second is the deviation path S→X→Y generated under unbalanced conditions, that is, the model will directly predict P without extracting feature F. Define the counterfactual scenario: Given a certain gas data X, if feature F is not an observed value, what will the resulting model predict Y to be? According to the model and counterfactual scenario, the calculation results of the model prediction Y under the factual scenario and the counterfactual scenario 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 value of the characteristic variable at the time of the counterfactual characteristic value. According to the causal inference theory, the potential results under the two conditions are compared to obtain the total indirect causal effect (Total Indirect Effect, TIE) of the gas data on the model prediction, so as to make full use of the model to exclude the direct impact of unbalanced data:

[0123]

[0124] Step 2 Figure 3 As shown in the figure, the graph convolutional network is designed. For the step of extracting features from the data in step 1, a graph convolutional neural network (GCN) is used. First, the dissolved gas data in the transformer oil are collected, and nine groups of dissolved gas data are used as the input of the model (H2, C2H6, CH4, C2H2, C2H4, CH4 / H2, C2H2 / C2H4, C2H4 / C2H6 and C2H6 / CH4), followed by standardization:

[0125]

[0126] Among them, x and x new are the values ​​of gas data before and after standardization, x max and x min Represent the corresponding maximum and minimum values ​​in the gas data respectively. In addition to x, GCN also requires an n×n adjacency matrix A, where n is the number of samples in the data set. 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 the samples in the test set (unknown samples), the Siamese network is used to extract the 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 samples closest to the unknown sample and consider them to be connected. Among them, the size of k determines the number of samples in the training set connected to each unknown sample, which will directly affect the adjacency matrix A. When k is very 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 cause the unknown sample to be connected to samples of different types, thereby generating noise and limiting the performance of the model. Therefore, the k value is set to 10 to achieve the best performance of the model in fault diagnosis.

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

[0128]

[0129] in, I is the identity matrix; yes The degree matrix of H is the feature of each layer. For the input layer, H is X; ReLU is the nonlinear activation function; W l and b l is the weight matrix and bias term of the graph convolution network layer. The present invention adopts a two-layer graph convolution network as the structure, and its output is H(3) , then the final model prediction Y is:

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

[0131] Among them, Softmax is the normalization function, W3 and b3 are the weight matrix and bias term of the fully connected layer. The model predicts seven main transformer states, namely normal state (Normal), low-temperature overheating (Low-temperature overheating), medium-temperature overheating (Medium-temperature overheating), high-temperature overheating (High-temperature overheating), low-energy discharge (Low-energy discharge), high-energy discharge (High-energy discharge) and partial discharge (Partial discharge).

[0132] Step 3: Counterfactual feature strategy. Since the counterfactual condition is defined as the effect of the feature variable f, the counterfactual feature value defined in step 1 should be represented as an empty set According to the characteristic that the model cannot handle invalid input, two heuristic counterfactual feature strategies are further proposed to realize the counterfactual conditions of features.

[0133] Step 3.1 For the adjacency matrix A described in step 2, use the identity matrix to generate counterfactual features so that the model only focuses on the self-node instead of the neighbors. Specifically, set the adjacency matrix A to the identity matrix I to help generate counterfactuals:

[0134] A~I

[0135] Step 3.2 Use a learnable parameter c to represent the counterfactual feature f * There are two reasons for assuming uniform distribution. First, when the specific state is completely unknown, i.e., the cause or type of the failure, random guessing is usually used. Second, using f * To estimate Uniform distribution can guarantee a safe estimate. According to the condition that the feature is blocked in the counterfactual state, the entire GCN structure is abandoned and only the fully connected layer is used for prediction. The output of the fully connected layer is represented as Y x In order to combine the parameter c with Y x Combined, an integrated strategy, Product of Experts (PoE), is adopted, which is calculated as follows:

[0136]

[0137] In addition, in order to maximize the calculated causal effect and improve the robustness of the model, it is necessary to control the probability distribution. impact. The impact should be related to Y x,f Otherwise, too large or too small c will cause TIE to be x,f or dominates, so we use the Kullback-Leibler divergence to estimate c:

[0138]

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

[0140]

[0141] Among them, S represents the actual transformer state, L ce Denotes the cross entropy loss function. After the training phase, the model uses TIE to diagnose the transformer status in the test phase. The performance metrics include accuracy, macro F1 score, and geometric mean recall (G-mean) to evaluate the performance of the model in the imbalanced data scenario.

[0142] The present invention introduces counterfactual analysis into transformer fault diagnosis research, proposes a transformer fault diagnosis method based on graph convolution and counterfactual analysis, effectively analyzes the causal relationship of transformer fault evolution, quantitatively describes the causal effect between the fault cause and dissolved gas data, and solves the problems of misjudgment and missed judgment of 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] Aiming at the research field of transformer fault diagnosis technology, the present invention introduces counterfactual analysis and causal structure model to describe the causal effect of unbalanced data in fault diagnosis, and by separating it from the overall causal effect, enables the model to alleviate the adverse effects of data category imbalance without losing information.

[0144] The present invention designs a graph convolutional network to extract dissolved gas data features, mines the complex nonlinear relationship between fault type and dissolved gas, and the similarity between unknown samples and labeled samples; proposes a counterfactual feature strategy to quantitatively estimate the causal effect after separation to enhance the accuracy of the model and solve the problem of insufficient robustness of traditional methods.

[0145] The present invention relates to a causal structure model between fault types and dissolved gas data. Through counterfactual analysis, the total indirect causal effect is separated from the overall causal effect of gas data on model prediction, and used for fault diagnosis, so that the model can alleviate the adverse effects of data category imbalance without losing information. Corresponding to the causal structure model, the graph convolutional network is used for feature extraction, and the counterfactual feature strategy is used to estimate the causal effect.

[0146] The present invention can realize the efficient utilization of the causal effect between gas data and transformer status in transformer fault diagnosis, analyze the causal relationship of various variables in fault diagnosis through the causal structure model, and quantitatively describe the causal influence between the fault cause and gas data, thereby improving the robustness and accuracy of transformer fault diagnosis, and providing a new technical idea for transformer fault diagnosis research.

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

[0148] The first building block is used to obtain the dissolved gas data in the transformer oil and design a structural causal model, wherein the structural causal model represents the relationship between the transformer working state, the dissolved gas data, the model extraction features and the fault prediction;

[0149] The second building 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 model extraction features according to the adjacency matrix and the GCN;

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

[0151] Based on the above embodiment, further, the structural causal model represents the relationship between the transformer working state, dissolved gas data, model extraction features and fault prediction, which is expressed as:

[0152] S→X→F→Y

[0153] S→X→Y

[0154] Among them, S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, the intermediary F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance situation, that is, the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance situation, that is, the counterfactual scenario.

[0155] Based on the above embodiment, further, the second building module is specifically used to divide the dissolved gas data into dissolved gas combinations, and perform standardization processing on the dissolved gas data in each dissolved gas combination;

[0156] The dissolved gas combination after the standardization is extracted with a Siamese neural network, and the Euclidean distance between each dissolved gas combination is calculated using the low-dimensional features, and the other dissolved gas combinations with the smallest Euclidean distance to each dissolved gas combination are found as training samples through a k-nearest neighbor algorithm;

[0157] Linking sample data in the training samples with 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 factual features and counterfactual features in the model extraction features.

[0160] Based on the above embodiment, further, the second construction module is specifically used to input the training data and the adjacency matrix (X, A) into a nonlinear activation function to obtain the model extraction feature H (l+1) , the nonlinear activation function is yes The degree matrix of H is the extracted feature of each layer. For the input layer, H is X, W l and b l are the weight matrix and bias term of the network layer of the CGN respectively;

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

[0162] Based on the above embodiment, further, the third building module is specifically used to obtain the model prediction results Y under the fact scene respectively. x,f And the model prediction results under the counterfactual scenario

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

[0164]

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

[0166] According to the causal inference theory, the model prediction result Y under the factual scenario x, f and the model prediction results under the counterfactual scenario By comparison, the total indirect causal effect TIE of the structural causal model is obtained.

[0167]

[0168] Among them, the model prediction results under the counterfactual scenario is to use the counterfactual feature strategy, according to the counterfactual feature f * and the fully connected layer in the GCN;

[0169] Model prediction result Y in the actual scenario x,f is obtained by using the GCN and the fact 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 embodiment, further, the third building block is specifically used to use the learning parameter c to represent the counterfactual feature f * ;

[0172] The learning parameter c is combined with the output Y of the fully connected layer of the CGN using the integrated strategy expert product PoE calculation formula. x Combined, we get the model prediction results under the counterfactual scenario Among them, the integrated strategy expert product PoE calculation formula

[0173] The above embodiment proposes a device for constructing a transformer fault diagnosis model based on counterfactual analysis, including obtaining dissolved gas data in transformer oil and designing a structural causal model, wherein the structural causal model represents the relationship between the transformer working state, 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 using the factual features, the counterfactual features and the counterfactual feature strategy to obtain a transformer fault diagnosis model. The present invention realizes high-precision and high-robustness transformer fault diagnosis, and effectively solves the problems of misjudgment and missed judgment of unbalanced fault samples.

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

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

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

[0177] The transformer fault diagnosis method proposed in the above embodiment realizes high-precision and high-robustness transformer fault diagnosis and effectively solves 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 when the processor executes the computer program, it implements the method for constructing a transformer fault diagnosis model based on counterfactual analysis described in any one of the above technical solutions.

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

[0180] The above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the specific implementation modes of the present invention can still be modified or replaced by equivalents, and any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be included in the scope of protection 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 comprises: Obtaining data on dissolved gas in transformer oil and designing a structural causal model, wherein the structural causal model represents the relationship between transformer operating status, 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; 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.

2. The method according to claim 1, characterized in that: The structural causal model represents the relationship between transformer operating status, dissolved gas data, model extraction features and fault prediction, which is expressed as: S→X→F→Y S→X→Y Among them, S represents the transformer state, X represents the dissolved gas data, Y represents the output variable, the intermediary F represents the extracted feature variable, S→X→F→Y represents the reasoning path of the sample balance situation, that is, the factual scenario, and S→X→Y represents the reasoning path of the sample imbalance situation, that is, the counterfactual scenario.

3. The method according to claim 1, characterized in that: The step of 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 specifically includes: dividing the dissolved gas data into dissolved gas combinations, and performing standardization processing on the dissolved gas data in each dissolved gas combination; The dissolved gas combination after the standardization is extracted with a Siamese neural network, and the Euclidean distance between each dissolved gas combination is calculated using the low-dimensional features, and the other dissolved gas combinations with the smallest Euclidean distance to each dissolved gas combination are found as training samples through a k-nearest neighbor algorithm; Linking sample data in the training samples with the same fault type to construct an n×n adjacency matrix A, where n is the number of samples in the training samples; By setting the adjacency matrix A to the identity matrix I, where A~I; The training samples, the adjacency matrix A and the identity matrix I are input into the GCN to obtain factual features and counterfactual features in the model extraction features.

4. The method according to claim 3, characterized in that The step of inputting the training sample, the adjacency matrix A and the identity matrix I into the GCN to obtain factual features and counterfactual features in the model extraction features specifically includes: The training data and the adjacency matrix (X, A) are input into a nonlinear activation function to obtain the model extraction feature H (l+1) , the nonlinear activation function is yes The degree matrix of H is the extracted feature of each layer. For the input layer, H is X, W l and b l are the weight matrix and bias term of the network layer of the CGN respectively; The model extracts features H (l+1) The factual feature and the counterfactual feature are obtained.

5. The method according to claim 4, characterized in that The method of using the factual feature, the counterfactual feature and the counterfactual feature strategy to train the structural causal model to obtain a transformer fault diagnosis model specifically includes: Obtain the model prediction results under the factual scenario and the model prediction results under the counterfactual scenario respectively; Y x,f =Y(X=x,F=f)=P(Y|X=x,F=P(F|X=x)) Y x,f* =Y(X=x,F=f * )=P(Y|X=x,F=P(F|X=x * )) Among them, f * is the counterfactual feature, and f is the factual feature; According to the causal inference theory, the model prediction result Y under the factual scenario x,f And the model prediction results under the counterfactual scenario By comparison, the total indirect causal effect TIE of the structural causal model is obtained. Among them, the model prediction results under the counterfactual scenario is to use the counterfactual feature strategy, according to the counterfactual feature f * and the fully connected layer in the GCN; Model prediction result Y in the actual scenario x,f is obtained by using the GCN and the fact features; The structural causal model is optimized using the total indirect causal effect (TIE) to obtain the transformer fault diagnosis model.

6. The method according to claim 5, characterized in that Model prediction results under the counterfactual scenario is to use the counterfactual feature strategy, according to the counterfactual feature f * And the fully connected layer in the GCN, specifically including: The counterfactual feature f is represented by the learning parameter c * ; The learning parameter c is combined with the output Y of the fully connected layer of the CGN using the integrated strategy expert product PoE calculation formula. x Combined, we get the model prediction results under the counterfactual scenario Among them, the integrated strategy expert product PoE calculation formula 7. A device for constructing a transformer fault diagnosis model based on counterfactual analysis, characterized in that: The device comprises: The first building block is used to obtain the dissolved gas data in the transformer oil and design a structural causal model, wherein the structural causal model represents the relationship between the transformer working state, the dissolved gas data, the model extraction features and the fault prediction; The second building 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 model extraction features according to the adjacency matrix and the GCN; The third building module is used to train the structural causal model using the factual features, the counterfactual features and the counterfactual feature strategy to obtain a transformer fault diagnosis model.

8. A transformer fault diagnosis method, characterized in that: Based on the transformer fault diagnosis model constructed in any one of claims 1 to 6, the method comprises: Get real-time dissolved gas data in transformer oil; The real-time dissolved gas data is input into the transformer fault diagnosis model to obtain a transformer fault prediction result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method for constructing a transformer fault diagnosis model based on counterfactual analysis according to any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for constructing a transformer fault diagnosis model based on counterfactual analysis according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Fault root cause positioning method and system based on causal reinforcement learning

    CN114666204A

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

    CN116108755A

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

    CN117520905A

  • Method for diagnosing transformer fault based on deep coupled dense convolutional neural network

    US20230393219A1

Cited By

  • Credit card fraud detection method based on anti-fact graph convolutional neural network

    CN119338470A

  • A Credit Card Fraud Detection Method Based on Counterfactual Graph Convolutional Neural Network

    CN119338470B

  • Service system fault prediction method based on causal analysis

    CN121173652A

  • Power grid equipment fault prediction and health management method based on digital twinning

    CN122779828A