Transformer fault diagnosis method and device based on parallel heterogeneous convolution and reparameterization network

By using parallel heterogeneous convolution and recalibration networks, the problems of insufficient utilization of feature information and difficulty in heterogeneous data fusion in transformer fault diagnosis are solved, achieving high accuracy and strong generalization of fault diagnosis and improving the stability of power systems.

CN123049359APending Publication Date: 2026-11-06SHENYANG HAOCHENG FEICHI ELECTRIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611485895.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-23
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing transformer fault diagnosis technologies suffer from insufficient utilization of feature information, inadequate feature extraction capabilities, feature redundancy interference, prominent issues of sample imbalance, weak model generalization ability, and difficulty in fusion of heterogeneous data, resulting in insufficient diagnostic accuracy and reliability.

Method used

By employing parallel heterogeneous convolutional and recalibrated networks, and through multi-source data acquisition and preprocessing, a multi-dimensional feature set is constructed. Combined with composite loss functions and data augmentation strategies, the feature information is fully utilized and adapted to improve diagnostic accuracy and generalization ability.

Benefits of technology

It improves the accuracy and reliability of transformer fault diagnosis, can automatically accommodate multi-source heterogeneous data, enhances the model's anti-interference ability and the ability to identify a minority of faults, and improves the stability and generalization ability of diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123049359A_ABST
    Figure CN123049359A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of transformer fault diagnosis technology, and provides a method and apparatus for transformer fault diagnosis using a parallel heterogeneous convolutional and recalibration network. The method includes the following steps: S1, multi-source data acquisition and preprocessing; S2, constructing a multi-dimensional feature set; S3, dataset partitioning and standardization; S4, constructing a fault diagnosis model, including a parallel heterogeneous one-dimensional convolutional and feature recalibration module, a cross-dimensional feature fusion module, a global pooling layer, a feature concatenation layer, and a classifier; S5, training the fault diagnosis model; and S6, fault diagnosis. This invention fully integrates manually generated features from the DGA domain with multi-granularity deep features extracted by deep convolution. It strengthens the weights of key features through independent branch recalibration and mitigates class imbalance and overfitting problems by combining a composite loss function, achieving high accuracy and strong generalization in transformer fault diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power equipment condition monitoring and intelligent fault diagnosis technology, specifically to a transformer fault diagnosis method and device based on parallel heterogeneous convolution and recalibration networks. Background Technology

[0002] Power transformers are core equipment in power systems, and their operating status directly determines the reliability of power supply. During long-term operation, defects such as internal insulation aging, localized overheating, partial discharge, and arc discharge can lead to the cracking of insulating oil, producing characteristic gases such as hydrogen (H2), methane (CH4), ethane (C2H6), ethylene (C2H4), and acetylene (C2H2). Dissolved gas analysis (DGA) is currently the most mainstream and effective offline and online monitoring method for transformer fault diagnosis.

[0003] Traditional DGA fault diagnosis mainly employs manual judgment methods such as the three-ratio method, the modified three-ratio method, and the Rogers method. These methods rely on the experience of maintenance personnel, have fixed thresholds, poor generalization ability, and low accuracy in identifying marginal samples and complex faults. With the development of artificial intelligence technology, machine learning and deep learning are gradually being applied to DGA fault diagnosis, but existing technologies still have the following shortcomings: (1) Insufficient utilization of feature information: Existing technologies attempt to introduce artificial features such as gas component ratio and hydrocarbon ratio, but they are often directly mixed with the original concentration features and input into the network, which destroys the physical meaning of the artificial features. Moreover, the existing feature construction process only supports complete 7 gas data in a fixed format. For multi-source heterogeneous data such as 5 gases lacking CO and CO2, the utilization rate of feature information is low. (2) Insufficient feature extraction capability: Although existing technologies use multi-scale convolutional structures to extract multi-granularity features, they mostly use a uniform global channel weight for all convolutional branches, do not independently recalibrate different receptive field branches, and only use single-path average pooling to compress features, which cannot capture extreme information reflecting severe faults such as sudden increases in acetylene concentration, and have poor adaptability to the differentiated gas change patterns corresponding to different faults such as partial discharge and high-energy discharge. (3) Feature redundancy interference: Although existing technologies introduce channel attention mechanisms to filter features, they mostly use single-path global average pooling to generate attention weights, which can only capture the statistical mean information of features and cannot distinguish the feature importance of different receptive field branches. The gas feature dimensions are mixed, some features have low contribution to fault discrimination, and no branch-independent adaptive filtering and strengthening mechanism is designed for DGA scenarios, resulting in weak anti-interference ability of the model. (4) Imbalanced sample problem is prominent: Although existing technologies use weighted cross-entropy and oversampling to alleviate the imbalance of samples, weighted cross-entropy can only adjust the weights for the overall class and cannot make adaptive modulation for the difficult-to-classify edge samples. Oversampling is prone to model overfitting. In actual scenarios, the number of normal transformer samples is usually more than 10 times that of fault samples. The proportion of minority high-energy discharge and partial discharge samples is less than 5%, which can easily lead to the model biased towards the majority class and low fault identification accuracy. (5) Weak generalization ability of the model: For DGA fault diagnosis scenarios with small sample size and class imbalance, existing technologies mostly use basic cross-entropy loss to train the model, which cannot effectively reduce the weight ratio of hard-to-classify samples and lacks modulation mechanism for class imbalance. The model tends to favor large sample class and has low recognition accuracy for small sample fault class. At the same time, conventional data augmentation strategies in the image field (such as rotation and cropping) are not applicable to discrete DGA features. Existing methods that only use Dropout and L2 regularization are difficult to effectively constrain the model fitting process and have insufficient generalization ability.

[0004] (6) Difficulty in fusion of heterogeneous data: The number of columns, naming rules and labeling systems of DGA data provided by transformers from different manufacturers and at different voltage levels vary. Existing methods often require data to strictly follow fixed column names and formats, and can only process single-source standardized data. They cannot automatically match Chinese and English column names, or be compatible with labels from different coding systems, making it difficult to directly integrate and utilize multi-source data, resulting in poor model applicability.

[0005] Therefore, there is an urgent need for a transformer fault diagnosis method and device that can fully mine DGA feature information, adapt to multi-source heterogeneous data, and have stronger generalization ability, in order to make up for the above-mentioned defects of existing technologies, improve the accuracy and reliability of power transformer fault diagnosis, and ensure the stable operation of the power system. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention proposes a transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks. This method can fully integrate artificial features from the DGA domain with multi-granularity deep features extracted by deep convolution. It strengthens the weight of key features through an independent branch recalibration mechanism and alleviates class imbalance and overfitting problems by combining a composite loss function, thereby achieving high accuracy and strong generalization in transformer fault diagnosis.

[0007] To achieve the above objectives, the present invention adopts the following technical solution: A transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks includes the following steps: S1. Multi-source data acquisition and preprocessing: Obtain the DAG dataset for dissolved gas analysis in transformer oil, extract the concentration data of seven characteristic gases (H2, CH4, C2H6, C2H4, C2H2, CO, and CO2) and fault category label data, and perform preprocessing. S2. Constructing a multidimensional feature set: A single-sample 27-dimensional feature set is constructed, including 7-dimensional logarithmic gas features and 20-dimensional artificially derived features; the 27-dimensional feature sets of N samples and their corresponding fault category labels constitute the complete dataset; S3. Dataset Partitioning and Standardization: A stratified sampling strategy is adopted to divide the dataset into training, validation, and test sets, and then standardization is performed. S4. Construct a fault diagnosis model: The fault diagnosis model includes a parallel heterogeneous one-dimensional convolution and feature recalibration module, a cross-dimensional feature fusion module, a global pooling layer, a feature concatenation layer, and a classifier. The standardized 7-dimensional logarithmic gas feature tensor is converted into a one-dimensional convolutional input feature tensor. Multiple convolutional kernels of different sizes are used to perform parallel convolution and feature recalibration to obtain a 48-channel branch feature map. These are then concatenated to generate a 192-channel multi-granularity feature map. Cross-dimensional feature fusion, regularization, and adaptive global average pooling are then performed sequentially to obtain a 128-dimensional deep feature. The 128-dimensional deep feature is concatenated with a 20-dimensional artificially derived feature to obtain a 148-dimensional joint feature, which is input into the classifier to output the predicted probability distribution of the fault category. S5. Use the standardized training set and combine Mixup data augmentation and label smoothing strategies to train the fault diagnosis model. S6. Fault Diagnosis: Input the test set into the trained fault diagnosis model to diagnose the fault type.

[0008] Furthermore, the preprocessing in step S1 includes the following operations: Non-positive value correction: After merging all data, all gas concentration values ​​are cropped to a value no lower than the minimum positive constant ε. The value of ε is... All concentration values ​​less than the minimum normal number ε are uniformly replaced with ε to ensure the stability of logarithm and ratio calculations. Values ​​that cannot be converted are denoted as NaN. Missing sample removal: Remove missing samples where gas concentration data or fault category labels cannot be converted, and obtain seven characteristic gas concentration values, generating seven characteristic gas concentration vectors. The concentration vectors of the seven characteristic gases are: ; Where g is the concentration vector of the seven characteristic gases; H2, CH4, C2H6, C2H4, C2H2, CO, CO2 represent the gas concentration values ​​of hydrogen, methane, ethane, ethylene, acetylene, carbon monoxide, and carbon dioxide, respectively; T indicates transposition. Gas Presence Mask Generation: Generate 7-dimensional gas presence mask features based on the original gas concentration data before correction; The 7-dimensional gas presence mask feature is as follows: ; Where m is the gas presence mask feature; These are the presence masks for H2, CH4, C2H6, C2H4, C2H2, CO, and CO2, respectively, with values ​​of 0 or 1. 0 indicates that the gas is missing from the gas concentration data, and 1 indicates that the gas is actually present in the gas concentration data. Unified label coding: Fault category labels are uniformly coded as 0, 1, 2, 3, 4, 5, corresponding to six states: normal, medium and low temperature overheating, high temperature overheating, partial discharge, low energy discharge, and high energy discharge, respectively.

[0009] Furthermore, the specific steps for constructing the multidimensional feature set and dataset in step S2 are as follows: S201. Perform a logarithmic transformation on the concentration vectors of the seven characteristic gases to obtain a 7-dimensional logarithmic gas feature. Specifically, the 7-dimensional logarithmic gas feature is: g log =log(1+clip(g,ε,+∞)); Among them, g log It exhibits 7-dimensional logarithmic gas characteristics; clip(·) represents the truncation function; clip(g,ε,+∞) truncates the gas concentration values ​​in the seven characteristic gas concentration vector g to the range [ε,+∞), ensuring that the input logarithm is positive; ε is a very small positive integer, taking values... ; S202. Based on the concentration values ​​of seven characteristic gases, a 7-dimensional gas ratio feature is calculated, and a logarithmic transformation is performed on the obtained 7-dimensional gas ratio feature to generate a 7-dimensional logarithmic ratio feature. The specific 7-dimensional gas ratio feature is as follows: ; Where r is a 7-dimensional gas ratio characteristic; This is the presence mask for CO2, taking a value of 0 or 1; m CO This is the existence mask for CO, and its value is 0 or 1. The specific features of the 7-dimensional logarithmic ratio are as follows: ( ) Where, r log It is a 7-dimensional logarithmic ratio feature; clip(r,0,ε) means truncating each component of the seven-dimensional gas ratio feature r to {0,ε}; S203, Calculate the total hydrocarbon THC and the total gas content T respectively. all This leads to the calculation of a 6-dimensional proportion characteristic; where total hydrocarbon THC is the sum of the gas concentrations of CH4, C2H6, C2H4, and C2H2, with ε added to ensure it is positive; the total gas volume T all This is the sum of the gaseous concentrations of total hydrocarbons (THC), CO, and CO2, with ε added to ensure it is positive; The formula for calculating total hydrocarbon THC is: THC = CH4 + C2H6 + C2H4 + C2H2 + ε; Total gas volume T all The calculation formula is: T all =THC+CO+CO2+ε; The specific six-dimensional proportion features are as follows: ; Wherein, P represents the 6-dimensional proportion feature; m CO , These are the existence masks for CO and CO2, respectively; S204. The 7-dimensional logarithmic ratio feature, the 6-dimensional proportion feature, and the 7-dimensional gas existence mask feature are concatenated to obtain the 20-dimensional artificially derived feature. The 20-dimensional artificially derived feature is then concatenated with the 7-dimensional logarithmic gas feature to obtain the 27-dimensional feature set. S205. Perform steps S201-S204 on all N samples to obtain a 27-dimensional feature set of N samples. Combine this with the corresponding fault category label to form a complete dataset.

[0010] Furthermore, in step S204, the 20-dimensional artificially derived feature specifically includes: ; Where 'a' represents a 20-dimensional artificially derived feature; The 27-dimensional feature set is as follows: ; Where x represents a 27-dimensional feature set.

[0011] Furthermore, the stratified sampling strategy in step S3 is specifically as follows: First, a test set is extracted from the dataset in proportion α, and the remaining samples are used as the training and validation sets. Then, stratified sampling is performed again from the training and validation sets. For each fault category, a validation set is extracted in proportion β, and the remaining samples are used as the training set to ensure that the distribution ratio of each fault category in each set is consistent. The standardization process involves fitting only to the training set, calculating the mean and standard deviation of each feature based on the training set, and performing Z-score standardization on the features of the training set, validation set, and test set respectively. In the standardized training set, validation set, and test set, the 7-dimensional logarithmic gas features and 20-dimensional artificially derived features of each sample are converted into 7-dimensional logarithmic gas feature tensors and 20-dimensional artificially derived feature tensors respectively, and the fault category labels are converted into PyTorch long integer tensors.

[0012] Furthermore, the calculation of the mean and standard deviation of each feature based on the training set specifically involves: Let the number of samples in the training set be N. train Each sample has j = 1, 2, 3…27 feature dimensions. The mean and standard deviation of the j-th feature in the training set are calculated using the following formula: ; Where, μ j Let be the mean of the j-th feature in the training set; σ j Let the standard deviation be the j-th feature in the training set; N train The number of samples in the training set; x ij Let be the j-th dimension feature value of the i-th sample in the training set; The features of the training set are normalized using the Z-score normalization formula: ; in, For x ij Eigenvalues ​​after standardization transformation; If a certain feature takes the same value in all samples in the training set, then the standard deviation σ j =0, in this case, directly set To avoid division by zero errors; Similarly, Z-score standardization is performed on the features in the validation and test sets using a standardization formula.

[0013] Furthermore, in step S4, the parallel heterogeneous one-dimensional convolution and feature recalibration module specifically operates as follows: The standardized 7-dimensional logarithmic gas feature tensor is expanded with additional channels and converted into a 1-dimensional convolutional input feature tensor as the input feature. Multiple convolutional kernels of different sizes are used to perform parallel convolution and feature recalibration on the input feature. The kernel sizes are 2, 4, 6, and 8, respectively. Each kernel performs unbiased same 1-dimensional convolution, batch normalization, ReLU activation, and feature recalibration on the input feature in sequence to obtain a 48-channel branch feature map. The feature recalibration operation specifically includes: First, a dual-path compression operation is performed on the feature map activated by the ReLU function. One path performs global average pooling on the feature map to obtain the mean descriptor; the other path performs global max pooling on the feature map to obtain the extremum descriptor. The mean and extremum descriptors are input into a shared activation network, which includes a first fully connected layer, a ReLU activation layer, and a second fully connected layer connected in sequence. After processing by the activation network, the mean and extremum descriptors are obtained as mean activation signals and extremum activation signals. The mean and extremum activation signals are added element-wise and then activated by the Sigmoid function to obtain channel attention weights. The channel attention weights are used to multiply the ReLU-activated feature map channel by channel to complete the recalibration, and the recalibrated feature map, i.e., the branch feature map, is output. Then, the branch feature maps are concatenated along the channel dimension to generate a 192-channel multi-granularity feature map containing different receptive fields. The cross-dimensional feature fusion module operates as follows: multi-granularity feature maps are fused across granularity information through 1×1 convolution and mapped to 128 channels, and then batch normalization, ReLU activation and Dropout operations are performed sequentially to obtain the regularized fused feature map. The specific operation of the global pooling layer is as follows: adaptive global average pooling is performed on the fused feature map along the length dimension to obtain 128-dimensional deep features; The specific operation of the feature splicing layer is as follows: it is used to splice 128-dimensional deep features with 20-dimensional artificially derived features to obtain 148-dimensional joint features; The specific operation of the classifier is as follows: The classifier is a three-layer fully connected classifier. After the 148-dimensional joint features are input into the three-layer fully connected classifier, the predicted probability distribution of six fault categories is output.

[0014] Furthermore, in step S5, Mixup data augmentation is triggered according to the random probability of the training batch, and a random number in the range [0,1] is randomly generated for each training batch; (1) If the random number is less than 0.2, then execute the Mixup branch, which includes the following steps: Sample mixing: Randomly mix two different samples from the current training batch, and generate mixed samples for inputting the fault diagnosis model according to the mixing strength λ. The mixing strength λ follows a beta distribution, i.e., λ Beta(0.2,0.2), with a range of (0,1); A single forward propagation yields the predicted probability distribution: By inputting the mixed samples into the fault diagnosis model, the predicted probability distribution of the fault category is obtained; Label smoothing and focus loss calculation for mixed samples: Based on the fault category probability distribution, smoothing coefficient, and total number of categories, calculate the smoothed soft labels of the original fault category labels for the two samples respectively, and calculate the focus loss of the two samples. The focus loss of the two samples is then weighted and summed according to the mixing intensity λ to obtain the focus loss of the current mixed sample. Mixup Branch Batch Total Focus Loss L focal,1 Calculation: The average focal loss of all mixed samples within the current training batch is taken, with NaN and infinity values ​​protected, and used as the total focal loss L of the Mixup branch batch. focal,1 ; Update model parameters by minimizing the total focus loss of the Mixup branch batches; (2) If the random number is ≥0.2, then execute the non-Mixup branch. The specific steps are as follows: A single sample in each training batch is input into the fault diagnosis model, and two independent forward propagations are performed to obtain two fault category prediction probability distributions and two corresponding 128-dimensional deep features. ① Label smoothing and focus loss calculation for two forward propagations of a single sample: Based on the fault category probability distribution, smoothing coefficient and total number of categories obtained from the two forward propagations, the focus loss of a single sample for the two forward propagations is calculated, and the average value is taken as the final focus loss of the sample. Non-Mixup branch batch total focus loss L focal,2 Calculation: The average of the final focal loss for each sample is taken, with NaN and infinity values ​​protected numerically, as the total focal loss L for the non-Mixup branch batch. focal,2 ; ② Non-Mixup branch batch center loss L center Calculation: The average of the deep features obtained from two forward propagations for a single sample is taken, and the batch center loss L for the non-Mixup branch is calculated based on the class feature center vector. center ; ③ Non-Mixup branch batch consistency regularization loss L cons Calculation: Based on the predicted probability distribution of two forward outputs for a single sample, the symmetric KL divergence of a single sample is calculated, and the average of the symmetric KL divergences of all samples in the batch is taken. ④ Total loss of non-Mixup branch composites L total Calculation: The total loss of non-Mixup branch composites is calculated according to formula L. total =Lfocal,2 +0.03L center +0.01L cons Calculated; By minimizing the total composite loss L of non-Mixup branches total Update the model parameters.

[0015] This invention also provides a transformer fault diagnosis device based on parallel heterogeneous convolution and recalibration networks, comprising: The data acquisition and preprocessing module is used to acquire the DAG dataset of dissolved gas analysis in transformer oil, extract the concentration data of seven characteristic gases (H2, CH4, C2H6, C2H4, C2H2, CO, and CO2) and fault category label data, and perform preprocessing. The multidimensional feature set construction module is used to construct a 27-dimensional feature set for a single sample, including 7-dimensional logarithmic gas features and 20-dimensional artificially derived features; the 27-dimensional feature sets of N samples and their corresponding fault category labels constitute the complete dataset; The dataset partitioning and standardization module is used to divide the dataset into training, validation and test sets using a stratified sampling strategy, and then perform standardization. The fault diagnosis model construction module is used to build a fault diagnosis model. The fault diagnosis model includes a parallel heterogeneous one-dimensional convolution and feature recalibration module, a cross-dimensional feature fusion module, a global pooling layer, a feature concatenation layer, and a classifier. The standardized 7-dimensional logarithmic gas feature tensor is converted into a one-dimensional convolutional input feature tensor. Multiple convolution kernels of different sizes are used to perform parallel convolution and feature recalibration to obtain a 48-channel branch feature map. Then, it is concatenated to generate a 192-channel multi-granularity feature map. Then, cross-dimensional feature fusion, regularization processing, and adaptive global average pooling are performed in sequence to obtain a 128-dimensional deep feature. The 128-dimensional deep feature is concatenated with a 20-dimensional artificially derived feature to obtain a 148-dimensional joint feature, which is input into the classifier to output the predicted probability distribution of the fault category. The model training module is used to train the fault diagnosis model using the standardized training set and in conjunction with Mixup data augmentation and label smoothing strategies. The fault diagnosis module is used to input the test set into the trained fault diagnosis model and diagnose the fault type.

[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. The multi-source heterogeneous DGA data feature of this invention can automatically be compatible with incomplete DGA data from different manufacturers and monitoring systems. Through matching Chinese and English column names, zero-padding for missing gases, and existence masking, it can be compatible with complete 7-gas data and 5-gas data lacking CO and CO2. At the same time, by introducing a gas existence mask to integrate three types of information—original logarithmic gas features, logarithmic ratio features, and proportion features—it not only retains the physical meaning of human experience features but also fully integrates multi-dimensional complementary features, thereby improving the utilization rate of feature information.

[0017] 2. This invention employs a parallel heterogeneous one-dimensional convolutional structure to extract local correlation features at multiple receptive field granularities from the original logarithmic gas features, each outputting 48 channels. Furthermore, it independently performs channel recalibration operations on each convolutional branch, adaptively filtering channel information. Simultaneously, it combines a dual-path compression mechanism of global average pooling and global max pooling to generate channel attention weights. This not only preserves statistical mean information but also captures key features corresponding to extreme faults. Compared to traditional single-path recalibration mechanisms, it is more suitable for DGA fault diagnosis scenarios, adaptively strengthening the weights of key fault channels and suppressing redundant interference, effectively improving the quality of multi-scale feature extraction.

[0018] 3. This invention directly splices and fuses deep features extracted by parallel heterogeneous and recalibrated methods with features derived from human experience. This not only leverages the advantages of deep learning in automatically mining nonlinear features, but also retains the reliability of human features verified by industrial practice. This achieves complementary advantages between the two types of features and further improves diagnostic accuracy.

[0019] 4. This invention employs a composite loss function combining focus loss, center loss, and consistency regularization to constrain the training process. Combined with randomly triggered Mixup data augmentation and label smoothing strategies, along with batch normalization, Dropout, consistency regularization, AdamW weight decay, learning rate warm-up, gradient pruning, and early stopping, these measures work together to improve model convergence stability and perturbation resistance. This effectively alleviates the problem of sample class imbalance, enhances the model's ability to identify minority class faults, improves model generalization, reduces overfitting risk, and demonstrates better stability in field testing.

[0020] 5. The method of the present invention can be embedded in the online monitoring system of transformers. The diagnostic results can be automatically output by inputting the original DGA data without manual intervention. The process has a high degree of automation and good scalability.

[0021] In summary, this invention addresses the problems of low feature utilization, insufficient feature extraction capability, sample imbalance, weak generalization ability, and difficulty in adapting to multi-source heterogeneous data in existing fault diagnosis technologies for dissolved gas analysis in transformer oil. It improves upon these technologies from multiple dimensions, including feature construction, network structure design, and training strategy optimization. This effectively enhances the accuracy and reliability of transformer fault diagnosis, strengthens the model's adaptability to complex real-world scenarios, and provides strong technical support for the condition assessment and fault maintenance of power transformers. It possesses high engineering practical value and promising prospects for widespread application. Attached Figure Description

[0022] Figure 1 This is a flowchart of the transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration network of the present invention.

[0023] Figure 2 This is a flowchart of the fault diagnosis model of the present invention; Figure 3 This is a flowchart illustrating the parallel heterogeneous convolution and feature recalibration operations of the fault diagnosis model of the present invention. Figure 4 This is a flowchart illustrating the training process of the fault diagnosis model of the present invention. Figure 5 This is a schematic diagram of the confusion matrix results for the test set of the present invention; Figure 6 This is a training loss curve of the fault diagnosis model of the present invention; Figure 7 This is an accuracy curve of the fault diagnosis model of the present invention; Figure 8 The figure shows the ablation experiment results of this invention. Detailed Implementation

[0024] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0025] Example: This embodiment is implemented using Python in the PyTorch framework. The hardware environment is an industrial computer or server equipped with an NVIDIA discrete graphics card, and the software environment includes data processing libraries such as Pandas, NumPy, and Scikit-learn.

[0026] Reference Figure 1 A transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks includes the following steps: S1. Multi-source data acquisition and preprocessing: Obtain the DAG dataset for dissolved gas analysis in transformer oil, specifically one or more transformer DGA data files in Excel or CSV format. Extract the concentration data of seven characteristic gases (H2, CH4, C2H6, C2H4, C2H2, CO, and CO2) and fault category label data by matching the column name patterns in Chinese and English. Fill missing gas columns with 0. Perform preprocessing after merging the data. During extraction, the system identifies seven gases—hydrogen (H2), methane (CH4), ethane (C2H6), ethylene (C2H4), acetylene (C2H2), carbon monoxide (CO), and carbon dioxide (CO2)—as well as label columns such as "fault code," "label," "fault," and "fault type" by matching the column names in Chinese and English. Preprocessing includes the following operations: Non-positive value correction: After merging all data, all gas concentration values ​​are cropped to a value no lower than the minimum positive constant ε. The value of ε is... All concentration values ​​less than the minimum normal number ε are uniformly replaced with ε to ensure the stability of logarithm and ratio calculations. Values ​​that cannot be converted are denoted as NaN. Missing sample removal: Remove missing samples where gas concentration data or fault category labels cannot be converted, and obtain seven characteristic gas concentration values, generating seven characteristic gas concentration vectors. The concentration vectors of the seven characteristic gases are: ; Where g is the concentration vector of the seven characteristic gases; H 2, CH 4, C2H 6, C2H 4, C2H 2, CO and CO2 represent the gas concentrations of hydrogen, methane, ethane, ethylene, acetylene, carbon monoxide, and carbon dioxide, respectively; T indicates transposition. Gas Presence Mask Generation: Generate 7-dimensional gas presence mask features based on the original gas concentration data before correction; The 7-dimensional gas presence mask feature is as follows: ; Where m is the gas presence mask feature; H respectively 2, CH 4, C2H 6, C2H 4, C2H 2, The presence mask for CO and CO2, with a value of 0 or 1. 0 indicates that the gas is missing in the gas concentration data, and 1 indicates that the gas is actually present in the gas concentration data. Uniform Label Encoding: The tags support standard Chinese categories, 0-5 or 1-6 numeric codes, and other string tags that contain exactly six categories, all uniformly encoded as 0-5, corresponding to the six states of normal, medium-low temperature overheating, high temperature overheating, partial discharge, low energy discharge, and high energy discharge, respectively.

[0027] S2. Constructing a multidimensional feature set and dataset: A 27-dimensional feature set for each single sample is constructed, including 7-dimensional logarithmic gas features and 20-dimensional artificially derived features; the 27-dimensional feature sets of N samples and their corresponding fault category labels constitute the complete dataset; the specific construction steps are as follows: S201. Perform a logarithmic transformation on the concentration vectors of the seven characteristic gases to obtain a 7-dimensional logarithmic gas feature. Specifically, the 7-dimensional logarithmic gas feature is: g log =log(1+clip(g,ε,+∞)); Among them, g log It exhibits 7-dimensional logarithmic gas characteristics; clip(·) represents the truncation function; clip(g,ε,+∞) truncates the gas concentration values ​​in the seven characteristic gas concentration vector g to the range [ε,+∞), ensuring that the input logarithm is positive; ε is a very small positive integer, taking values... ; S202. Based on the concentration values ​​of seven characteristic gases, a 7-dimensional gas ratio feature is calculated, and a logarithmic transformation is performed on the obtained 7-dimensional gas ratio feature to generate a 7-dimensional logarithmic ratio feature. The specific 7-dimensional gas ratio feature is as follows: ; Where r is a 7-dimensional gas ratio characteristic; This is the presence mask for CO2, taking a value of 0 or 1; m CO This is the existence mask for CO, and its value is 0 or 1. The specific features of the 7-dimensional logarithmic ratio are as follows: ; Where, r log It is a 7-dimensional logarithmic ratio feature; clip(r,0,ε) means truncating each component of the seven-dimensional gas ratio feature r to {0,ε}; S203, Calculate the total hydrocarbon THC and the total gas content T respectively. all This leads to the calculation of a 6-dimensional proportion characteristic; where total hydrocarbon THC is the sum of the gas concentrations of CH4, C2H6, C2H4, and C2H2, with ε added to ensure it is positive; the total gas volume T allThis is the sum of the gaseous concentrations of total hydrocarbons (THC), CO, and CO2, with ε added to ensure it is positive; The formula for calculating total hydrocarbon THC is: THC = CH4 + C2H6 + C2H4 + C2H2 + ε; Total gas volume T all The calculation formula is: T all =THC+CO+CO2+ε; The specific six-dimensional proportion features are as follows: ; Wherein, P represents the 6-dimensional proportion feature; m CO , These are the existence masks for CO and CO2, respectively; S204. The 7-dimensional logarithmic ratio feature, the 6-dimensional proportion feature, and the 7-dimensional gas existence mask feature are concatenated to obtain the 20-dimensional artificially derived feature. The 20-dimensional artificially derived feature is then concatenated with the 7-dimensional logarithmic gas feature to obtain the 27-dimensional feature set. In step S204, the 20-dimensional artificially derived features are specifically: ; Where 'a' represents a 20-dimensional artificially derived feature; The 27-dimensional feature set is as follows: ; Where x represents a 27-dimensional feature set; S205. Perform steps S201-S204 on all N samples to obtain a 27-dimensional feature set of N samples. Combine this with the corresponding fault category label to form a complete dataset.

[0028] S3. Dataset Partitioning and Standardization: A stratified sampling strategy is adopted to divide the dataset into training, validation, and test sets, and then standardization is performed. The stratified sampling strategy is as follows: First, a test set is extracted from the dataset at a ratio of α (in this embodiment, α is 0.2), and the remaining samples are used as the training and validation sets. Then, stratified sampling is performed again from the training and validation sets. For each fault category, a validation set is extracted at a ratio of β (in this embodiment, β is 0.15), and the remaining samples are used as the training set, ensuring that the distribution ratio of each fault category in each set is consistent. Standardization specifically involves: to eliminate the dimensional differences between different feature dimensions and avoid information leakage, fitting is performed only on the training set, the mean and standard deviation of each feature are calculated based on the training set, and Z-score standardization is applied to the features of the training set, validation set, and test set respectively. Furthermore, in the standardized training set, validation set, and test set, the 7-dimensional logarithmic gas features and 20-dimensional artificially derived features of each sample are converted into 7-dimensional logarithmic gas feature tensors and 20-dimensional artificially derived feature tensors, and the fault category labels are converted into PyTorch long integer tensors.

[0029] Specifically, the calculation of the mean and standard deviation of each feature based on the training set is as follows: Let the number of samples in the training set be N. train Each sample has j = 1, 2, 3…27 feature dimensions. The mean and standard deviation of the j-th feature in the training set are calculated using the following formula: ; Where, μ j Let be the mean of the j-th feature in the training set; σ j Let the standard deviation be the j-th feature in the training set; N train The number of samples in the training set; x ij Let be the j-th dimension feature value of the i-th sample in the training set; Z-score standardization is performed on the features of the training set, validation set, and test set separately as follows: The features of the training set are normalized using the Z-score normalization formula: ; in, Let x be the j-th dimension feature value of the i-th sample in the training set. ij Eigenvalues ​​after standardization transformation; If a certain feature takes the same value in all samples in the training set, then the standard deviation σ j =0, in this case, directly set To avoid division by zero errors; Similarly, by replacing the training set feature values ​​in the above standardization formula with the corresponding feature values ​​of the validation and test sets, the Z-score standardization of the validation and test set features can be completed.

[0030] S4. Construct a fault diagnosis model: Reference Figure 2The fault diagnosis model includes a parallel heterogeneous one-dimensional convolution and feature recalibration module, a cross-dimensional feature fusion module, a global pooling layer, a feature concatenation layer, and a classifier. The standardized 7-dimensional logarithmic gas feature tensor is converted into a one-dimensional convolutional input feature tensor. Multiple convolution kernels of different sizes are used to perform parallel convolution and feature recalibration to obtain a 48-channel branch feature map. Then, the branches are concatenated to generate a 192-channel multi-granularity feature map. Cross-dimensional feature fusion, regularization, and adaptive global average pooling are then performed sequentially to obtain a 128-dimensional deep feature. The 128-dimensional deep feature is concatenated with a 20-dimensional artificially derived feature to obtain a 148-dimensional joint feature, which is input into the classifier to output the predicted probability distribution of the fault category. Specifically, the standardized 7-dimensional logarithmic gas feature tensor is converted into a 1-dimensional convolutional input feature tensor, as follows: Let the 7-dimensional logarithmic gas feature tensor of the input training batch be... B represents the batch size. After expanding the channel dimension, a one-dimensional convolutional input feature tensor V is obtained. ; Where unsqueeze(1) means that in X gas Insert a dimension of size 1 into the first dimension, resulting in B×1×7; The transformed one-dimensional convolutional input feature tensor V can be viewed as a single-channel, one-dimensional sequence signal of length 7. Reference Figure 3 Specifically, in the fault diagnosis model, the parallel heterogeneous one-dimensional convolution and feature recalibration module operates as follows: Multiple convolutional kernels of different sizes are used to perform parallel convolution and feature relabeling on the input features. The kernel sizes are 2, 4, 6, and 8, respectively. Each kernel sequentially performs unbiased same one-dimensional convolution, batch normalization, ReLU activation, and feature relabeling on the input features. Specifically: ; in, The branch feature map of the k-th convolutional kernel has dimensions B×48×7; k is the kernel size, which can be 2, 4, 6, or 8 respectively; Conv1D k This represents an unbiased same convolution with kernel size k, 1 input channel, and 48 output channels. BN(·) represents batch normalization; ReLU(·) represents the activation function; Recalibrate(·) represents the feature recalibration operation; The feature recalibration operation specifically includes: firstly, performing a dual-path compression operation on the feature map activated by the ReLU function; one path performs global average pooling on the feature map to obtain a mean descriptor; the other path performs global max pooling on the feature map to obtain an extremum descriptor; the mean descriptor and the extremum descriptor are input into a shared activation network, which includes a first fully connected layer, a ReLU activation layer, and a second fully connected layer connected in sequence; after processing by the activation network, the mean descriptor and the extremum descriptor are obtained as a mean activation signal and an extremum activation signal, respectively; the mean activation signal and the extremum activation signal are added element-wise, and then activated by the Sigmoid function to obtain channel attention weights; the channel attention weights are used to multiply the feature map activated by the ReLU function channel by channel to complete the recalibration, and the recalibrated feature map, i.e., the branch feature map (48 channels), is output. The specific formula for calculating the feature recalibration operation is as follows: (1) Let the feature map of the input feature recalibration module (i.e., the feature map after activation by the ReLU function) be... Where B is the batch size, D is the number of channels, and L is the sequence length. Dual compression operations (global average pooling and global max pooling) are performed on U. ① Perform global average pooling on the feature map U to obtain the mean descriptor: ; d=1,…,D,D=48; Among them, z avg,d This represents the mean descriptor for the d-th channel; u d,l Represents the d-th channel and the d-th channel in feature map U. l The feature values ​​at each position; l = 1, 2, 3...L; L is the sequence length, L=7; ② Another approach performs global max pooling on the feature map U to obtain the extreme value descriptor: d=1,…,D, l=1,2,3...L; Among them, z max,d Let be the extremum descriptor for the d-th channel; For u d,l Take the maximum value of channel d along its length; (2) The mean descriptor and the extreme value descriptor are input into a shared activation network, which includes a first fully connected layer, a ReLU activation layer, and a second fully connected layer connected in sequence. After the mean descriptor and the extreme value descriptor are processed by the activation network (dimensionality reduction by the first fully connected layer, ReLU activation, and dimensionality increase by the second fully connected layer), the mean activation signal and the extreme value activation signal are obtained, specifically: If the reduction ratio δ=8, the intermediate dimension is max(1,D / δ), and D=48, then: e avg,d =W2·ReLU(W1z avg,d ), e max,d =W2·ReLU(W1z max,d ); Among them, e avg,d e max,d These are the mean descriptors z avg,d and extreme value descriptor z max,d The excitation signals all have a dimension of D×1=48; W1 is the weight matrix of the first fully connected layer, with a dimension of (D / δ)×D=6×48; W2 is the weight matrix of the second fully connected layer, with dimension D×(D / δ))=48×6; ReLU(·) is the ReLU activation function; (3) The mean excitation signal and the extreme value excitation signal are added element by element, and then activated by the Sigmoid function to obtain the channel attention weights, specifically: ; Among them, e avg,c ⊕e max,c This indicates that the mean excitation signal and the extreme value excitation signal are added element by element; Sigmoid: The Sigmoid function, which converts e to... avg,c ⊕e max,c Map to the interval (0,1); s d Attention weight for the d-th channel, dimension B×D; (4) The feature map activated by the ReLU function is multiplied channel by channel using the channel attention weights to complete the recalibration, and the recalibrated feature map, i.e., the branch feature map (48 channels), is output as follows: ; d=1,…,D,l=1,2,3...L; For u d,l Features after recalibration; Output the recalibrated feature map That is, branch feature map k=2,4,6,8 (48 channels); The feature maps from each branch are then concatenated along the channel dimension to generate a 192-channel multi-granularity feature map containing different receptive fields, as shown in the formula: ; Among them, H multi It is a multi-granularity feature map, which contains features extracted from different receptive fields; Concat(·) indicates concatenation along the channel dimension; The branch feature maps represent the outputs of convolutional branches with kernel sizes of 2, 4, 6, and 8, respectively, and each branch feature map has a size of B×48×7. Multi-granularity feature map H after splicing multi The number of channels is 48 × 4 = 192; The cross-dimensional feature fusion module operates as follows: It fuses multi-granularity feature maps using a 1×1 convolution and maps the information to 128 channels. The formula is: ; Among them, F conv The fused feature map has dimensions B×128×7; W fuse The weight tensor for a 1×1 convolution has dimensions of 128×192×1 (128 output channels, 192 input channels, and a kernel size of 1). This represents the convolution operation; The fused feature map W fuse After batch normalization, ReLU activation, and Dropout operations, the regularized fused feature map is obtained, as shown in the formula: F drop =Dropout 0.25 (ReLU(BN(F conv ))); Among them, F drop This represents the fused feature map after regularization; BN(·) represents batch normalization; ReLU(·) represents the ReLU activation function; Dropout 0.25 (·) indicates that neurons are randomly discarded with a probability of 0.25 to prevent overfitting; The global pooling layer operates as follows: adaptive global average pooling is performed along the length dimension of the fused feature map to obtain 128-dimensional deep features, as shown in the formula: ; Among them, f deep Represents 128-dimensional depth features; AdaptiveAvgPool(·) represents adaptive global average pooling, which outputs a fixed-length mean value of 1 regardless of the input length. The specific operation of the feature concatenation layer is as follows: it concatenates 128-dimensional depth features with 20-dimensional artificially derived features to obtain 148-dimensional joint features, as shown in the formula: ; Among them, f joint It represents 148-dimensional joint features, which integrate deep learning features and prior physical knowledge; 'a' represents a 20-dimensional artificially derived feature; The specific operation of the classifier is as follows: The classifier is a three-layer fully connected classifier. After the 148-dimensional joint features are input into the three-layer fully connected classifier, the predicted probability distribution of six fault categories is output.

[0031] The classifier specifically includes a third fully connected layer, a fourth fully connected layer, and an output layer. After the joint feature vector is input into the three fully connected classifier layers, the third fully connected layer takes the input 148-dimensional joint feature vector and performs Linear, ReLU, and Dropout operations to increase the dimension to 256 dimensions, outputting feature h1. The fourth fully connected layer takes h1 and performs Linear, ReLU, and Dropout operations to reduce the dimension to 128 dimensions, outputting feature h2. Finally, h2 passes through the output layer to obtain the unnormalized class score z. Softmax normalization is used to map z to the probability distribution of six types of fault states. Specifically, the formula for the third fully connected layer is: h1 = Dropout 0.35 (ReLU(W c1 f joint +b c1 )); Where h1 is the output feature of the third fully connected layer, which has 256 dimensions; W c1 The weights for the third fully connected layer have a dimension of 256×148. b c1 This is the bias vector for the third fully connected layer, with a length of 256; ReLU(·) represents the ReLU activation function; Dropout 0.35 (·) indicates that a neuron is randomly discarded with a probability of 0.35; The formula for the fourth fully connected layer is: h2 = Dropout 0.25 (ReLU(W c2 h1+b c2 )); Among them, W c2 The weights for the fourth fully connected layer have a dimension of 128×256. b c2 This is the bias vector for the fourth fully connected layer, with a length of 128; Dropout 0.25 (·) indicates that a neuron is randomly discarded with a probability of 0.25; h2 is the output feature of the fourth fully connected layer, with 128 dimensions; The formula for the output layer is: ; Where z is the unnormalized fault category score, with 6 scores corresponding to 6 types of faults; W c3 The output layer weights are 6×128. b c3 This is the bias vector for the output layer, with a length of 6.

[0032] The z is mapped to a probability distribution of six types of fault states by Softmax normalization; ; Where, p i,c The predicted probability that the i-th sample output by the fault diagnosis model belongs to the c-th type of fault; z i,c The unnormalized category score of the i-th sample on the c-th type of fault; exp(·) is an exponential function that converts z to a positive number.

[0033] c is the fault category index; S5. Use the standardized training set and combine Mixup data augmentation and label smoothing strategies to train the fault diagnosis model. Specifically, the Mixup data augmentation is triggered based on the random probability of the training batch, and a random number in the range [0,1] is randomly generated for each training batch; (1) If the random number is less than 0.2, then execute the Mixup branch, which includes the following steps: Sample mixing: Randomly mix two different samples from the current training batch, and generate mixed samples for inputting the fault diagnosis model according to the mixing strength λ. The mixing strength λ follows a beta distribution, i.e., λ Beta(0.2,0.2), with a range of (0,1); x mix =λx+(1-λ)x π The label pair is (y, y π ); Beta(·): Beta distribution. In Beta(0.2,0.2), 0.2 is the mixing intensity parameter. At this time, the sampled values ​​tend to be close to 0 or 1, producing a strong mixing effect. x、x π Two distinct samples in a training batch; where π represents the random permutation within the batch; x mix Mixed samples; A single forward propagation yields the predicted probability distribution: By inputting the mixed samples into the fault diagnosis model, the predicted probability distribution of the fault category is obtained; Label smoothing and focus loss calculation for mixed samples: Based on the fault category probability distribution, smoothing coefficient, and total number of categories, calculate the smoothed soft labels of the original fault category labels for the two samples respectively, and calculate the focus loss of the two samples. The focus loss of the two samples is then weighted and summed according to the mixing intensity λ to obtain the focus loss of the current mixed sample. Focus loss of the i-th sample focal,i calculate: ; Where, α c The normalized weight of category c, with a mean of 1, is used to calculate the contribution of various modulation losses in the focus loss. ; In the formula, w clip,c The weights of the original fault categories after pruning; w raw,c The original, unpruned fault category weights; n max n is the number of samples for the fault category with the most samples in the training set. c Let w be the number of samples in class c of the training set; raw,c After cropping to the interval [0.75, 1.75], we get w. clip,c , represented as: w clip,c =clip(w raw,c (0.75, 1.75), clip(·) is the clipping function; C is the total number of categories, C=6; p i,c The predicted probability that the i-th sample output by the fault diagnosis model belongs to the c-th type of fault; γ is the polymerization parameter; in this invention, γ = 1.5. The label smooth cross-entropy of the i-th sample is calculated using the following formula: ; in, Let i be the smoothed soft label of the i-th sample. The label smoothing formula is: ; in, The smoothed soft label for the i-th sample is used for cross-entropy calculation; i The original fault category label for the i-th sample; c is the fault category index, c=0,1,2,3,4,5; The smoothing coefficient is set to 0.05 in this invention; C represents the total number of categories; in this invention, C=6. The focus loss of the mixed samples is , focal,x The focal loss of the original sample x in the mixed sample is... For the original sample x in the mixed sample π The focal loss is respectively caused by Calculated; Mixup Branch Batch Total Focus Loss L focal,1 Calculation: The average focal loss of all mixed samples within the current training batch is taken, with NaN and infinity values ​​protected, and used as the total focal loss L of the Mixup branch batch. focal,1 : ;in, focal,xmix,i Let B be the focus loss of the i-th mixed sample in the batch, and B be the batch size. Because mixed samples violate the original class center and consistency assumptions, the Mixup branch batch only calculates the focus loss and updates the model parameters by minimizing the total focus loss of the Mixup branch batch; (2) If the random number is ≥0.2, then execute the non-Mixup branch. The specific steps are as follows: A single sample in each training batch is input into the fault diagnosis model, and two independent forward propagations are performed to obtain two fault category prediction probability distributions and two corresponding 128-dimensional deep features. ① Label smoothing and focus loss calculation for two forward propagations of a single sample: Based on the fault category probability distribution, smoothing coefficient, and total number of categories obtained from the two forward propagations, the focus loss for a single sample during the two forward propagations is calculated, and the average value is taken as the final focus loss for that sample. focal,pj ; focal,pj =( focal,1 + focal,2 ) / 2; focal,1 , focal,2 These are the focal losses for two forward propagations of a single sample, respectively. The calculation formula and process are the same as those for the focal loss of the i-th sample. Non-Mixup branch batch total focus loss L focal,2 Calculation: The average of the final focal loss for each sample is taken, with NaN and infinity values ​​protected numerically, as the total focal loss L for the non-Mixup branch batch. focal,2 ; ; focal,pj,i Let B be the final focus loss for the i-th sample in the batch, and B be the batch size. ② Non-Mixup branch batch center loss L center Calculation: The center loss is applied to the 128-dimensional deep features. The deep features obtained from two forward propagations of a single sample are averaged, and the batch center loss L for the non-Mixup branch is calculated based on the class feature center vector. center ; The central loss L center The specific calculation formula is as follows: ; In the formula, B is the batch size; The average of the 128-dimensional depth features obtained from two forward propagations of the i-th sample; c yi Let y be the original fault category label for the i-th sample. i The feature center vectors can be learned but do not participate in gradient backpropagation; ③ Non-Mixup branch batch consistency regularization loss L cons Calculation: Based on the predicted probability distribution of two forward outputs for a single sample, the symmetric KL divergence of the single sample is calculated. The average of the symmetric KL divergences of all samples in the batch is then used to obtain the batch consistency regularization loss L for the non-Mixup branch. cons ; ; cons,i This represents the symmetric KL divergence (consistency loss) of the i-th sample. KL(·) represents the Kullback-Leibler divergence, which measures the difference between two probability distributions; 0.5 indicates a symmetrical average to ensure bidirectional consistency; This represents the predicted probability distribution of the model output during the first forward propagation of the i-th sample; This represents the predicted probability distribution output by the second forward propagation model for the i-th sample; Stop gradient: When calculating, the probability of one side is used as the target, and the gradient is not propagated; Non-Mixup branch batch consistency regularization loss L cons The calculation formula is: ; Where B is the batch size; ④ Total loss of non-Mixup branch composites L total Calculation: The total loss of non-Mixup branch composites is calculated according to formula L.total =L focal,2 +0.03L center +0.01L cons Calculated; By minimizing the total composite loss L of non-Mixup branches total Update model parameters; after each batch of training in a non-Mixup branch is completed, the class center c is adjusted. yi Updated by sliding as follows: ; In the formula, c yi Let y be the original fault category label for the i-th sample. i The center vector; μ yi,batch For the original fault category label y in the current batch i The mean vector of 128-dimensional deep features of all samples.

[0034] In this invention, the composite loss function jointly optimizes the model from three dimensions: classification boundary, intra-class compactness, and output consistency. The model is fully constrained in non-Mixup branch batches, while in Mixup branch batches, since the sample labels are mixed, only the focus loss is retained to avoid logical conflicts between the center loss and consistency loss on the mixed samples, thereby ensuring the stability and effectiveness of the training process.

[0035] Optimizer and Learning Rate Scheduling: Model parameter updates use the AdamW optimizer, with the base learning rate η0 set to 2 × 10⁻⁶. -4 The weight decay coefficient is 1×10 -4 The batch size B is 64, and the maximum number of training rounds is 400.

[0036] All trainable parameters of the model are passed into AdamW, so the convolution, fully connected, bias, and batch normalization parameters are all updated by the same parameter group.

[0037] Gradient clipping is performed after each backpropagation: ; In the formula, The gradient of the model parameter θ; After each full iteration of the training set, perform the following verification steps: Validation set forward propagation: Input the complete validation set into the model in the current training state, perform only forward propagation, do not update the model parameters, and calculate the validation set loss L. val The formula is: L val =L focal,yz +0.03L center,yz Among them, the verification set focal loss L focal,yz The calculation method is the same as the focus loss L of the non-Mixup branch during training. focal,2Calculate and verify the set center loss L. center,yz The calculation method is the same as the calculation of the center loss of the non-Mixup branch during training, except that the training set samples are replaced with the validation set samples; For the first 5 epochs, a linear learning rate warm-up is performed, gradually increasing the learning rate from η0 / 10 to η0. After the warm-up, ReduceLROnPlateau (adaptive learning rate adjustment strategy) is enabled, monitoring the loss value on a clean validation set without data augmentation. If the validation set loss does not decrease for 20 consecutive epochs, the learning rate is halved (multiplied by 0.5), with a minimum of η0 / 10. .

[0038] Early stopping and optimal model selection: Validation accuracy is the primary improvement metric; when validation accuracy is equal, lower validation loss is also considered an improvement. Early stopping occurs if there is no improvement after 80 consecutive epochs.

[0039] Optimal model saving: If the accuracy of the validation set in the current round is the highest value since the start of training, the model parameters of the current round are saved as the optimal model weights; after training terminates (reaching the upper limit of 400 rounds or triggering early stop), the saved optimal model is used as the final diagnostic model.

[0040] Comparative Experiment and Result Analysis of Transformer DGA Fault Diagnosis: I. Verification of the Fault Diagnosis Accuracy of the Invention To verify the effectiveness of the proposed transformer fault diagnosis method (PHyReC-Net) based on parallel heterogeneous convolution and recalibration networks in dissolved gas analysis (DGA) fault diagnosis of transformer oil, this invention selected three representative traditional machine learning and shallow neural network methods for comparison: K-Nearest Neighbors (KNN), Support Vector Machine (SVM), and shallow Multilayer Perceptron (MLP). All methods used the same seven characteristic gases (H2, CH4, C2H6, C2H4, C2H2, CO, CO2) and a constructed non-redundant feature set. The data was standardized after logarithmic transformation, ratio augmentation, and masking, and the training / validation sets were divided at a ratio of 0.85:0.15. The test set (accounting for 20% of the original samples) was fixed to unify the evaluation benchmark. The experimental results used accuracy as the main evaluation index. The accuracy results of each method on the test set are shown in Table 1.

[0041]

[0042] As shown in Table 1, PHyReC-Net achieves a diagnostic accuracy of 94.06%, significantly outperforming the other three models. Compared to the distance-based lazy learner KNN, PHyReC-Net improves accuracy by 1.82 percentage points; compared to SVM with Gaussian kernels and a simple two-layer MLP structure, the improvements are 3.65 and 4.56 percentage points, respectively. This demonstrates that the method of this invention exhibits stronger generalization ability and robustness when processing DGA data with nonlinearity, high-dimensional features, and small inter-class differences.

[0043] After training, load the saved optimal model weights, perform a single forward propagation on all samples in the test set, and take the Softmax probability p. i,c The largest category is the predicted label; plot the confusion matrix. Figure 5 Training loss curve () Figure 6 The training and validation losses are the variations of the training and validation set losses with the number of epochs. The training loss is the average of the losses of all batches within each epoch (including mixed-up and non-mixed-up batches), and the validation loss is calculated independently after each epoch using the validation set loss formula described above. Accuracy curves ( Figure 7 ) represents the overall classification accuracy at the end of each Epoch for both the training and validation sets.

[0044] from Figure 5 The confusion matrix results shown in the test set graph demonstrate that the PHyReC-Net model of this invention achieves ideal classification results for each fault category, maintaining high recognition accuracy for almost all categories, with only a few fault categories showing minor misclassifications. The recognition accuracy for small-sample discharge faults (partial discharge and high-energy discharge) exceeds 92%, verifying the effectiveness of the composite loss function and sample equalization strategy of this invention.

[0045] Figure 6The training loss curve of the fault diagnosis model of this invention shows that both the training loss and validation loss rapidly decrease to below 0.2 after about 20 iterations. This indicates that the designed parallel heterogeneous convolution and feature recalibration structure can efficiently learn the mapping relationship between DGA features and fault categories, with high parameter update efficiency and rapid model fitting of fault feature patterns. The training loss and validation loss show no obvious divergence trend, verifying the effectiveness of generalization optimization strategies such as Mixup data augmentation, Dropout regularization, and AdamW weight decay. The model has strong adaptability to new, unseen samples. Both curves show no significant oscillations in the later stages of training (after 100 epochs), and after a continuous and stable decrease, they tend to flatten out. This proves that the composite loss function combining focus loss, center loss, and consistency regularization has a significant constraint effect, and the model parameter optimization process is highly robust, effectively avoiding performance degradation caused by training fluctuations. The loss curve shows no gradient explosion or vanishing phenomenon throughout, and converges quickly to a low loss value. This indicates that the training strategies used, such as learning rate warm-up, AdamW optimizer, and gradient pruning, are highly compatible with the DGA fault diagnosis scenario and can effectively guide the model to update towards the optimal parameters.

[0046] Figure 7 The graph shows the accuracy curve of the fault diagnosis model of this invention. It can be seen that the training accuracy quickly stabilizes after about 20 iterations, indicating that the parallel heterogeneous convolution and feature recalibration structure of this invention can efficiently capture multi-granularity fault features in DGA data. The verification accuracy increases synchronously with the training accuracy, eventually stabilizing at around 0.95, only lower than the training accuracy, without significant overfitting. This verifies the effectiveness of training strategies such as Mixup data augmentation, composite loss function, and Dropout, demonstrating the model's strong diagnostic capability. Both curves show no significant oscillations in the later stages of training, converging steadily and demonstrating high robustness during model training and stable parameter optimization, effectively avoiding a decrease in diagnostic accuracy caused by training fluctuations.

[0047] II. Ablation Experiment

[0048] To verify the rationality and reliability of the transformer DGA fault diagnosis model structure proposed in this invention, four sets of model structure ablation experiments were conducted under the same dataset, the same data preprocessing and feature engineering, the same data partitioning strategy, and completely consistent training configuration. In each experiment, only one key module was removed from the complete model, while the rest of the structure remained unchanged. The evaluation metrics used were test set accuracy and macro-average F1 score, which were used to examine the model's actual diagnostic capability in gas data scenarios. Experimental results are as follows: Figure 8 As shown.

[0049] from Figure 8As can be seen, among all the models compared (B1: no feature recalibration; B2: no parallel multi-scale convolution; B3: no cross-granularity fusion; B4: simplified classifier), the complete model achieved the highest test set accuracy (94.06%) and macro-average F1 score (93.47%), indicating that the complete architecture proposed in this invention has the best overall performance in the transformer DGA fault diagnosis task. Under the test data conditions, the accuracy of 94.06% fully demonstrates that the model has good robustness and can effectively utilize the masking information in artificial features to achieve reliable fault identification.

[0050] Experimental data from the four sets of models compared show that the test set accuracy and macro-average F1 score of each model decreased compared to the complete model. Removing the feature recalibration module decreased accuracy by 0.45 percentage points; removing parallel multi-scale convolution decreased accuracy by 1.37 percentage points; removing cross-granularity fusion decreased accuracy by 1.82 percentage points; and simplifying the classification head decreased accuracy by 1.37 percentage points. Ablation experiments demonstrate that removing any module leads to a decrease in model performance and makes a real contribution to the final diagnostic performance; none of the modules are redundant. The performance of the models after module removal did not exceed that of the complete model, and the magnitude of the performance decrease is consistent with the functional importance of the modules.

[0051] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks, characterized in that, Includes the following steps: S1. Multi-source data acquisition and preprocessing: Obtain the DAG dataset for dissolved gas analysis in transformer oil, extract the concentration data of seven characteristic gases (H2, CH4, C2H6, C2H4, C2H2, CO, and CO2) and fault category label data, and perform preprocessing. S2. Constructing a multidimensional feature set: A single-sample 27-dimensional feature set is constructed, including 7-dimensional logarithmic gas features and 20-dimensional artificially derived features; the 27-dimensional feature sets of N samples and their corresponding fault category labels constitute the complete dataset; S3. Dataset Partitioning and Standardization: A stratified sampling strategy is adopted to divide the dataset into training, validation, and test sets, and then standardization is performed. S4. Construct a fault diagnosis model: The fault diagnosis model includes a parallel heterogeneous one-dimensional convolution and feature recalibration module, a cross-dimensional feature fusion module, a global pooling layer, a feature concatenation layer, and a classifier. The standardized 7-dimensional logarithmic gas feature tensor is converted into a one-dimensional convolutional input feature tensor. Multiple convolutional kernels of different sizes are used to perform parallel convolution and feature recalibration to obtain a 48-channel branch feature map. These are then concatenated to generate a 192-channel multi-granularity feature map. Cross-dimensional feature fusion, regularization, and adaptive global average pooling are then performed sequentially to obtain a 128-dimensional deep feature. The 128-dimensional deep feature is concatenated with a 20-dimensional artificially derived feature to obtain a 148-dimensional joint feature, which is input into the classifier to output the predicted probability distribution of the fault category. S5. Use the standardized training set and combine Mixup data augmentation and label smoothing strategies to train the fault diagnosis model. S6. Fault Diagnosis: Input the test set into the trained fault diagnosis model to diagnose the fault type.

2. The transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks as described in claim 1, characterized in that, The preprocessing in step S1 includes the following operations: Non-positive value correction: After merging all data, all gas concentration values ​​are cropped to a value no lower than the minimum positive constant ε. The value of ε is... All concentration values ​​less than the minimum normal number ε are uniformly replaced with ε to ensure the stability of logarithm and ratio calculations. Values ​​that cannot be converted are denoted as NaN. Missing sample removal: Remove missing samples where gas concentration data or fault category labels cannot be converted, and obtain seven characteristic gas concentration values, generating seven characteristic gas concentration vectors. The concentration vectors of the seven characteristic gases are: ; Where g is the concentration vector of the seven characteristic gases; H2, CH4, C2H6, C2H4, C2H2, CO, CO2 represent the gas concentration values ​​of hydrogen, methane, ethane, ethylene, acetylene, carbon monoxide, and carbon dioxide, respectively; T indicates transposition. Gas Presence Mask Generation: Generate 7-dimensional gas presence mask features based on the original gas concentration data before correction; The 7-dimensional gas presence mask feature is as follows: ; Where m is the gas presence mask feature; These are the presence masks for H2, CH4, C2H6, C2H4, C2H2, CO, and CO2, respectively, with values ​​of 0 or 1. 0 indicates that the gas is missing from the gas concentration data, and 1 indicates that the gas is actually present in the gas concentration data. Unified label coding: Fault category labels are uniformly coded as 0, 1, 2, 3, 4, 5, corresponding to six states: normal, medium and low temperature overheating, high temperature overheating, partial discharge, low energy discharge, and high energy discharge, respectively.

3. The transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks as described in claim 1, characterized in that, The specific steps for constructing the multidimensional feature set and dataset in step S2 are as follows: S201. Perform a logarithmic transformation on the concentration vectors of the seven characteristic gases to obtain a 7-dimensional logarithmic gas feature. Specifically, the 7-dimensional logarithmic gas feature is: g log =log(1+clip(g,ε,+∞)); Among them, g log It exhibits 7-dimensional logarithmic gas characteristics; clip(·) represents the truncation function; clip(g,ε,+∞) truncates the gas concentration values ​​in the seven characteristic gas concentration vector g to the range [ε,+∞), ensuring that the input logarithm is positive; ε is a very small positive integer, taking values... ; S202. Based on the concentration values ​​of seven characteristic gases, a 7-dimensional gas ratio feature is calculated, and a logarithmic transformation is performed on the obtained 7-dimensional gas ratio feature to generate a 7-dimensional logarithmic ratio feature. The specific 7-dimensional gas ratio feature is as follows: ; Where r is a 7-dimensional gas ratio characteristic; This is the presence mask for CO2, taking a value of 0 or 1; m CO This is the existence mask for CO, and its value is 0 or 1. The specific features of the 7-dimensional logarithmic ratio are as follows: ( ) Where, r log It is a 7-dimensional logarithmic ratio feature; clip(r,0,ε) means truncating each component of the seven-dimensional gas ratio feature r to {0,ε}; S203, Calculate the total hydrocarbon THC and the total gas content T respectively. all This leads to the calculation of a 6-dimensional proportion characteristic; where total hydrocarbon THC is the sum of the gas concentrations of CH4, C2H6, C2H4, and C2H2, with ε added to ensure it is positive; the total gas volume T all This is the sum of the gaseous concentrations of total hydrocarbons (THC), CO, and CO2, with ε added to ensure it is positive; The formula for calculating total hydrocarbon THC is: THC = CH4 + C2H6 + C2H4 + C2H2 + ε; Total gas volume T all The calculation formula is: T all =THC+CO+CO2+ε; The specific six-dimensional proportion features are as follows: ; Wherein, P represents the 6-dimensional proportion feature; m CO , These are the existence masks for CO and CO2, respectively; S204. The 7-dimensional logarithmic ratio feature, the 6-dimensional proportion feature, and the 7-dimensional gas existence mask feature are concatenated to obtain the 20-dimensional artificially derived feature. The 20-dimensional artificially derived feature is then concatenated with the 7-dimensional logarithmic gas feature to obtain the 27-dimensional feature set. S205. Perform steps S201-S204 on all N samples to obtain a 27-dimensional feature set of N samples. Combine this with the corresponding fault category label to form a complete dataset.

4. The transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks as described in claim 3, characterized in that, In step S204, the 20-dimensional artificially derived features are specifically: ; Where 'a' represents a 20-dimensional artificially derived feature; The 27-dimensional feature set is as follows: ; Where x represents a 27-dimensional feature set.

5. The transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks as described in claim 1, characterized in that, The stratified sampling strategy in step S3 is specifically as follows: First, a test set is extracted from the dataset in proportion α, and the remaining samples are used as the training and validation sets. Then, stratified sampling is performed again from the training and validation sets. For each fault category, a validation set is extracted in proportion β, and the remaining samples are used as the training set to ensure that the distribution ratio of each fault category in each set is consistent. The standardization process involves fitting only to the training set, calculating the mean and standard deviation of each feature based on the training set, and performing Z-score standardization on the features of the training set, validation set, and test set respectively. In the standardized training set, validation set, and test set, the 7-dimensional logarithmic gas features and 20-dimensional artificially derived features of each sample are converted into 7-dimensional logarithmic gas feature tensors and 20-dimensional artificially derived feature tensors respectively, and the fault category labels are converted into PyTorch long integer tensors.

6. The transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks as described in claim 5, characterized in that, The calculation of the mean and standard deviation of each feature based on the training set is specifically as follows: Let the number of samples in the training set be N. train Each sample has j = 1, 2, 3…27 feature dimensions. The mean and standard deviation of the j-th feature in the training set are calculated using the following formula: ; Where, μ j Let be the mean of the j-th feature in the training set; σ j Let the standard deviation be the j-th feature in the training set; N train The number of samples in the training set; x ij Let be the j-th dimension feature value of the i-th sample in the training set; The features of the training set are normalized using the Z-score normalization formula: ; in, For x ij Eigenvalues ​​after standardization transformation; If a certain feature takes the same value in all samples in the training set, then the standard deviation σ j =0, in this case, directly set To avoid division by zero errors; Similarly, Z-score standardization is performed on the features in the validation and test sets using a standardization formula.

7. The transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks as described in claim 5, characterized in that, In step S4, the parallel heterogeneous one-dimensional convolution and feature recalibration module specifically operates as follows: The standardized 7-dimensional logarithmic gas feature tensor is expanded with additional channels and converted into a 1-dimensional convolutional input feature tensor as the input feature. Multiple convolutional kernels of different sizes are used to perform parallel convolution and feature recalibration on the input feature. The kernel sizes are 2, 4, 6, and 8, respectively. Each kernel performs unbiased same 1-dimensional convolution, batch normalization, ReLU activation, and feature recalibration on the input feature in sequence to obtain a 48-channel branch feature map. The feature recalibration operation specifically includes: First, a dual-path compression operation is performed on the feature map activated by the ReLU function. One path performs global average pooling on the feature map to obtain the mean descriptor; the other path performs global max pooling on the feature map to obtain the extremum descriptor. The mean and extremum descriptors are input into a shared activation network, which includes a first fully connected layer, a ReLU activation layer, and a second fully connected layer connected in sequence. After processing by the activation network, the mean and extremum descriptors are obtained as mean activation signals and extremum activation signals. The mean and extremum activation signals are added element-wise and then activated by the Sigmoid function to obtain channel attention weights. The channel attention weights are used to multiply the ReLU-activated feature map channel by channel to complete the recalibration, and the recalibrated feature map, i.e., the branch feature map, is output. Then, the branch feature maps are concatenated along the channel dimension to generate a 192-channel multi-granularity feature map containing different receptive fields. The cross-dimensional feature fusion module operates as follows: multi-granularity feature maps are fused across granularity information through 1×1 convolution and mapped to 128 channels, and then batch normalization, ReLU activation and Dropout operations are performed sequentially to obtain the regularized fused feature map. The specific operation of the global pooling layer is as follows: adaptive global average pooling is performed on the fused feature map along the length dimension to obtain 128-dimensional deep features; The specific operation of the feature splicing layer is as follows: it is used to splice 128-dimensional deep features with 20-dimensional artificially derived features to obtain 148-dimensional joint features; The specific operation of the classifier is as follows: The classifier is a three-layer fully connected classifier. After the 148-dimensional joint features are input into the three-layer fully connected classifier, the predicted probability distribution of six fault categories is output.

8. The transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks as described in claim 1, characterized in that, In step S5, Mixup data augmentation is triggered according to the random probability of the training batch, and a random number in the range [0,1] is randomly generated for each training batch. (1) If the random number is less than 0.2, then execute the Mixup branch, which includes the following steps: Sample mixing: Randomly mix two different samples from the current training batch, and generate mixed samples for inputting the fault diagnosis model according to the mixing strength λ. The mixing strength λ follows a beta distribution, i.e., λ Beta(0.2,0.2), with a range of (0,1); A single forward propagation yields the predicted probability distribution: By inputting the mixed samples into the fault diagnosis model, the predicted probability distribution of the fault category is obtained; Label smoothing and focus loss calculation for mixed samples: Based on the fault category probability distribution, smoothing coefficient, and total number of categories, calculate the smoothed soft labels of the original fault category labels for the two samples respectively, and calculate the focus loss of the two samples. The focus loss of the two samples is then weighted and summed according to the mixing intensity λ to obtain the focus loss of the current mixed sample. Mixup Branch Batch Total Focus Loss L focal,1 Calculation: The average focal loss of all mixed samples within the current training batch is taken, with NaN and infinity values ​​protected, and used as the total focal loss L of the Mixup branch batch. focal,1 ; Update model parameters by minimizing the total focus loss of the Mixup branch batches; (2) If the random number is ≥0.2, then execute the non-Mixup branch. The specific steps are as follows: A single sample in each training batch is input into the fault diagnosis model, and two independent forward propagations are performed to obtain two fault category prediction probability distributions and two corresponding 128-dimensional deep features. ① Label smoothing and focus loss calculation for two forward propagations of a single sample: Based on the fault category probability distribution, smoothing coefficient and total number of categories obtained from the two forward propagations, the focus loss of a single sample for the two forward propagations is calculated, and the average value is taken as the final focus loss of the sample. Non-Mixup branch batch total focus loss L focal,2 Calculation: The average of the final focal loss for each sample is taken, with NaN and infinity values ​​protected numerically, as the total focal loss L for the non-Mixup branch batch. focal,2 ; ② Non-Mixup branch batch center loss L center Calculation: The average of the deep features obtained from two forward propagations for a single sample is taken, and the batch center loss L for the non-Mixup branch is calculated based on the class feature center vector. center ; ③ Non-Mixup branch batch consistency regularization loss L cons Calculation: Based on the predicted probability distribution of two forward outputs for a single sample, the symmetric KL divergence of a single sample is calculated, and the average of the symmetric KL divergences of all samples in the batch is taken. ④ Total loss of non-Mixup branch composites L total Calculation: The total loss of non-Mixup branch composites is calculated according to formula L. total =L focal,2 +0.03L center +0.01L cons Calculated; By minimizing the total composite loss L of non-Mixup branches total Update the model parameters.

9. A transformer fault diagnosis device based on parallel heterogeneous convolution and recalibration networks, used to implement the transformer fault diagnosis method based on parallel heterogeneous convolution and recalibration networks as described in any one of claims 1 to 8, characterized in that, include: The data acquisition and preprocessing module is used to acquire the DAG dataset of dissolved gas analysis in transformer oil, extract the concentration data of seven characteristic gases (H2, CH4, C2H6, C2H4, C2H2, CO, and CO2) and fault category label data, and perform preprocessing. The multidimensional feature set construction module is used to construct a 27-dimensional feature set for a single sample, including 7-dimensional logarithmic gas features and 20-dimensional artificially derived features; the 27-dimensional feature sets of N samples and their corresponding fault category labels constitute the complete dataset; The dataset partitioning and standardization module is used to divide the dataset into training, validation and test sets using a stratified sampling strategy, and then perform standardization. The fault diagnosis model construction module is used to build a fault diagnosis model. The fault diagnosis model includes a parallel heterogeneous one-dimensional convolution and feature recalibration module, a cross-dimensional feature fusion module, a global pooling layer, a feature concatenation layer, and a classifier. The standardized 7-dimensional logarithmic gas feature tensor is converted into a one-dimensional convolutional input feature tensor. Multiple convolution kernels of different sizes are used to perform parallel convolution and feature recalibration to obtain a 48-channel branch feature map. Then, it is concatenated to generate a 192-channel multi-granularity feature map. Then, cross-dimensional feature fusion, regularization processing, and adaptive global average pooling are performed in sequence to obtain a 128-dimensional deep feature. The 128-dimensional deep feature is concatenated with a 20-dimensional artificially derived feature to obtain a 148-dimensional joint feature, which is input into the classifier to output the predicted probability distribution of the fault category. The model training module is used to train the fault diagnosis model using the standardized training set and in conjunction with Mixup data augmentation and label smoothing strategies. The fault diagnosis module is used to input the test set into the trained fault diagnosis model and diagnose the fault type.