Method and device for detecting abnormality of main transformer based on improved generative adversarial network

CN123012895APending Publication Date: 2026-10-30CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611206356.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0008]本发明要解决的技术问题在于克服现有方法在多源信号关联建模能力不足、生成对抗网络训练稳定性差、固定阈值不适应工况变化以及检测结果缺乏可解释性等方面的问题,提供一种基于改进生成对抗网络的主变压器异常检测方法,以在异常样本稀缺场景下实现训练稳定、工况自适应且结果可解释的主变压器在线异常检测

Benefits of technology

[0050]本发明的有益效果是,

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012895A_ABST
    Figure CN123012895A_ABST
Patent Text Reader

Abstract

The application discloses a main transformer abnormality detection method and device based on an improved generative adversarial network, which collects oil dissolved gas, partial discharge and electrical parameter data, extracts time domain, frequency domain and time-frequency characteristics to form a multi-dimensional state characteristic vector, constructs an improved generative adversarial network, adopts a coding-decoding structure containing multi-head self-attention and cross-modal attention for the generator of the network and introduces orthogonal weight regularization, adopts a spectral normalization residual convolutional network for the discriminator of the network and uses a Wasserstein loss containing gradient penalty, and only uses normal samples for unsupervised training; during detection, two types of scores of reconstruction error and discriminator feature distance are dynamically fused according to working conditions, and are compared with a working condition self-adaptive threshold based on extreme value theory to determine abnormality and locate the source of abnormality. The application is suitable for online state monitoring and fault early warning of main transformers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power system equipment condition monitoring and intelligent fault diagnosis technology, specifically relating to a method and device for detecting anomalies in main transformers based on an improved generative adversarial network. Background Technology

[0002] Main transformers operate under high voltage and high current conditions for extended periods. If internal defects such as insulation aging, partial discharge, and winding deformation are not detected in time, they may develop into serious faults. Current main transformer fault diagnosis primarily relies on dissolved gas analysis (DGA), partial discharge (PD) detection, and electrical parameter monitoring. However, existing methods have the following shortcomings: (1) The usual detection methods use fixed scoring fusion strategies or manually set criteria (such as IEC three ratio method, Duval triangle method), which cannot adapt to the drift of monitoring data distribution caused by changes in operating conditions, resulting in high false alarm rate and missed alarm rate.

[0003] (2) Supervision methods such as support vector machine and random forest require a large number of labeled fault samples, but fault samples of main transformers are relatively scarce in actual engineering.

[0004] (3) Existing deep learning methods have limited ability to model long-range dependencies of multi-source heterogeneous signals, and schemes based on a single sensor are difficult to cover multi-modal fault types, resulting in a lack of interpretability of detection results.

[0005] Generative Adversarial Networks (GANs) anomaly detection methods can learn the data distribution using only normal samples and leverage the large reconstruction error of anomalous samples to achieve discrimination. However, their application to the main transformer scenario still faces the following problems: (1) Standard GAN training suffers from gradient vanishing and mode collapse problems, and its fully connected or simple convolutional networks have limited ability to express multi-source heterogeneous temporal features.

[0006] (2) The fixed threshold judgment method is not suitable for the distribution drift of monitoring data caused by changes in working conditions, and the model also lacks an interpretable mechanism, making it impossible to locate the source of the anomaly.

[0007] Therefore, there is an urgent need for a main transformer anomaly detection method that can be stably trained under conditions of scarce abnormal samples, adapt to changes in operating conditions, and whose detection results are interpretable. Summary of the Invention

[0008] The technical problem to be solved by this invention is to overcome the shortcomings of existing methods in terms of insufficient multi-source signal correlation modeling ability, poor training stability of generative adversarial networks, inability of fixed thresholds to adapt to changes in operating conditions, and lack of interpretability of detection results. This invention provides a main transformer anomaly detection method based on an improved generative adversarial network, which can achieve stable training, adaptability to operating conditions, and interpretable results for online main transformer anomaly detection in scenarios where abnormal samples are scarce.

[0009] To address the aforementioned technical problems, this invention provides a main transformer anomaly detection method based on an improved generative adversarial network, comprising the following steps: Step S1: Real-time acquisition of dissolved gas concentration data in oil, partial discharge detection signals, and electrical parameter data during the operation of the main transformer to form a multi-source raw monitoring dataset; Step S2: Extract time-domain statistical features, frequency-domain spectral features, and time-frequency joint features from the multi-source raw monitoring dataset, and fuse the extraction results to form a multi-dimensional state feature vector x; Step S3: Construct an improved generative adversarial network, which includes a generator and a discriminator D(·). The generator adopts an encoder-decoder architecture. The encoder of the generator includes a multi-head self-attention sublayer and a cross-modal attention sublayer. The encoder E(·) maps the multi-dimensional state feature vector x to a latent representation z, and the decoder G(·) maps the latent representation z to a reconstructed feature vector. The improved generative adversarial network is trained unsupervised using only the multidimensional state feature vectors of normally operating samples and a Wasserstein loss function with a gradient penalty term. Step S4: Input the multidimensional state feature vector of the sample to be detected into the trained improved generative adversarial network, and calculate the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) respectively; according to the current operating condition of the main transformer, dynamically adjust the fusion weight of the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) to obtain the comprehensive anomaly score S of operating condition perception. Step S5: Construct an adaptive threshold model for operating condition perception based on the generalized Pareto distribution (GPD) in extreme value theory, and compare the comprehensive abnormality score S of the operating condition perception with the adaptive threshold corresponding to the current operating condition; when the comprehensive abnormality score S exceeds the adaptive threshold corresponding to the current operating condition, it is determined that the main transformer has an abnormal state, and by analyzing the attention weights of the multi-head self-attention sublayer and the cross-modal attention sublayer, the abnormal signal source location result and graded warning information are output.

[0010] Preferably, the dissolved gas concentration data in the oil includes the concentration values ​​of H2, CH4, C2H2, C2H4, C2H6, CO, and CO2; the partial discharge detection signal includes electromagnetic wave signals collected by an ultra-high frequency sensor (installed on the end screen of the high-voltage bushing) and sound pressure signals collected by an ultrasonic sensor (installed on the outer wall of the transformer tank); the electrical parameter data includes winding temperature rise, load current, and effective values ​​of port voltage.

[0011] The data in the multi-source original monitoring dataset are preprocessed by uniform timestamp alignment, missing value interpolation and Z-score standardization to obtain a normalized multi-source monitoring dataset.

[0012] Preferably, the time-domain statistical features include mean, standard deviation, peak value, peak-to-peak value, kurtosis, skewness, and waveform factor; the frequency-domain spectral features include power spectral density energy of each frequency band, centroid frequency, and mean square frequency (obtained by performing a Fast Fourier Transform (FFT) on each signal); the time-frequency joint features are the node energy coefficients obtained by performing a Short-Time Fourier Transform and multi-scale wavelet packet decomposition on the original signal.

[0013] The three types of features mentioned above are concatenated and mapped to a feature space of fixed dimension d through a fully connected layer to obtain a multidimensional state feature vector x∈ d .

[0014] Preferably, the encoder of the generator is composed of multiple layers of multi-head self-attention modules and feedforward networks stacked alternately. The encoder also includes a cross-modal attention sub-layer. The cross-modal attention sub-layer uses the feature vector of dissolved gas in oil as the query and the feature vector of partial discharge as the key and value to perform cross-modal dependency modeling on multi-source heterogeneous signals. The decoder is composed of multiple layers of fully connected networks and layer normalization alternatingly.

[0015] Preferably, each convolutional layer of the discriminator undergoes spectral normalization on the weight matrix to constrain the Lipschitz constant of the discriminator to not exceed 1; the discriminator is a deep residual convolutional network containing no less than 4 residual blocks, each residual block consisting of two convolutional layers with spectral normalization and skip connections.

[0016] Preferably, the generator loss function of the improved generative adversarial network includes an orthogonal weight regularization term, the expression of which is:

[0017] in, For the original reconstruction loss, For potential consistency loss, For the generator adversarial loss term based on Wasserstein distance, For the orthogonal weight regularization term, α, β, γ, and δ are the reconstruction loss coefficient, latent consistency loss coefficient, generator adversarial loss coefficient, and orthogonal weight regularization coefficient, respectively, with values ​​ranging from α, β, γ ∈ (0, 10] to δ ∈ [0.001, 0.1].

[0018] Preferably, the total discriminant loss of the improved generative adversarial network introduces a gradient penalty term and a reconstruction constraint term on top of the Wasserstein adversarial loss, and its expression is as follows:

[0019] in, The Wasserstein adversarial loss term is used for the discriminator. Let E(·) represent the expected value (indicated by square brackets), E(·) represent the encoder mapping (indicated by parentheses), and G(·) represent the decoder mapping. λ is the random linear interpolation point between the real sample and the reconstructed sample, λ is the gradient penalty coefficient, λ∈[1,20], and ε is the reconstruction constraint coefficient in the discriminator loss, ε∈[0,1].

[0020] Specifically, in the construction and training of the improved generative adversarial network in step S3, the improved generative adversarial network includes a generator and a discriminator D(·), and is trained unsupervised using a multidimensional state feature vector containing only normal samples.

[0021] (1) Generator Construction: The generator adopts an encoder-decoder architecture. The structure of the encoder E(·) is as follows: Figure 4 As shown, it consists of L layers (L≥4) of Transformer modules stacked sequentially. Each Transformer module uses a serial structure with pre-level normalization and residual connections, and contains the following three sub-layers in sequence: a. Multi-head Self-Attention (MHSA) Sublayer: The input feature vector is first normalized by LayerNorm, and then passed through three sets of independent linear projection matrices. , , Generate query matrix Q, key matrix K, and value matrix V respectively; divide Q, K, and V into h heads (h=8) along the attention head dimension, with each head in... Independent scaling dot product attention computation is performed within the d / h dimensional subspace:

[0022] in, , , Let be the query matrix, key matrix, and value matrix of the i-th attention head, respectively. is the subspace dimension of each attention head. After concatenating the outputs of all heads, the result is passed through a linear projection matrix to map back to the original dimension, and the output of the MHSA sublayer is obtained through residual connection.

[0023] b. Cross-Modal Attention (CMA) sublayer: Based on the output of the MHSA sublayer, the subvectors corresponding to the 7 dimensions of DGA multi-component concentrations (H2, CH4, C2H2, C2H4, C2H6, CO, CO2) in the input feature vector are taken as the query matrix , the subvectors corresponding to the partial discharge ultrasonic signals and ultra-high frequency signals are taken as the key matrix and the value matrix , and cross-modal attention calculation is performed:

[0024] wherein, is the query matrix composed of the dissolved gas-in-oil feature subvectors, , are the key matrix and the value matrix composed of the partial discharge feature subvectors, respectively. The query vector of DGA features actively retrieves abnormal patterns with strong co-occurrence relationships from the partial discharge features, so as to realize cross-modal association modeling between DGA gas components and partial discharge pulses.

[0025] c. Position-wise Feed-Forward Network (PFFN): Two layers of linear transformation and ReLU activation are applied to the output of the CMA sublayer, the hidden layer dimension is 256 dimensions, and the forward propagation of the l-th layer Transformer module is completed through residual connection. The encoder organically combines the global self-correlation modeling of full dimensions by MHSA and the cross-modal specific association of DGA-PD by CMA, so that the model has the capabilities of capturing long-distance dependencies within modalities and reasoning causal associations between modalities at the same time.

[0026] It should be pointed out that when the input feature vector only contains single-modal data (such as only dissolved gas-in-oil concentration data), the cross-modal attention sublayer degenerates into an identity mapping because there are no cross-modal key-value pairs available for query, at this time the encoder degenerates into a structure in which multi-head self-attention sublayers and position-wise feed-forward networks are alternately stacked, and the rest of the components and training mechanism of the generator remain unchanged.

[0027] The output of the top layer of the encoder is the latent representation z∈ m (m<d, m is the dimension of the latent representation); the structure of the decoder G(·) is as shown in Figure 5 , which is composed of multi-layer Fully Connected Networks (MLP) and layer normalization alternately, and the latent representation z is upsampled layer by layer to map back to the original feature space dimension d, so as to obtain the reconstructed feature vector ∈ d .

[0028] (2) Construction of discriminator D(·): The structure of the discriminator is as follows Figure 6 As shown, a deep residual convolutional network is used to distinguish between the true feature vector and the feature vector reconstructed by the generator. The specific structure is as follows: Input 2D reconstruction: d-dimensional (d=128) feature vector x through a learnable linear projection Reconstructed into a two-dimensional feature map ( =16, =8), making explicit the implicit spatial arrangement relationship between feature dimensions, where The number of feature map channels. The length of the feature map; b. Residual Block Stacking: Four residual blocks are concatenated (the number of residual blocks is no less than four), with the number of channels in the order [64, 128, 256, 512], and the kernel size is 3×3. The structure of the residual blocks is as follows: Figure 3 As shown, each residual block uses a structure of convolution → LeakyReLU (negative slope of 0.2) → convolution, and the blocks are added together through skip connections; c. Spectral Normalization (SN): Apply spectral normalization constraints to the weight matrix W before the convolution operation of each residual block: ,in Let W be the maximum singular value (spectral norm), and v be any vector on the unit sphere. Spectral normalization efficiently calculates the maximum singular value through a power iteration method, limiting the Lipschitz constant of each layer of the discriminator mapping to within 1, preventing gradient explosion caused by the infinite growth of the spectral norm of the discriminator weight matrix, and working in conjunction with the gradient penalty term to stabilize the training process; d. Output layer: The output of the 4th residual block is global average pooled and then mapped to a scalar truth score D(x) by a fully connected layer; simultaneously, the intermediate feature maps of the convolutional layers before the 4th residual block are extracted. This serves as the basis for calculating the discriminator feature distance score.

[0029] (3) Training Objective Function: To overcome the gradient vanishing and mode collapse problems in standard GAN training, this invention constructs a comprehensive loss function within the Wasserstein GAN framework, including gradient penalty terms, reconstruction constraint terms, and orthogonal weight regularization terms. Total Generator Loss The expression is:

[0030] in, The original reconstruction loss measures the difference between the input feature vector x and the reconstructed feature vector. L1 difference between them; For potential consistency loss, the L2 distance between the original encoded latent representation and the reconstructed secondary encoded latent representation is measured to prevent the generator from memorizing training sample noise in the latent space. As the generator adversarial loss term, the reconstructed sample distribution is made to approximate the real sample distribution based on Wasserstein distance; The orthogonal weight regularization term is used to prevent the generator from overfitting; α, β, γ, and δ are the reconstruction loss coefficient, latent consistency loss coefficient, generator adversarial loss coefficient, and orthogonal weight regularization coefficient, respectively, with values ​​ranging from α, β, γ ∈ (0, 10], to δ ∈ [0.001, 0.1]. This represents the expected value of the training sample distribution (indicated by square brackets).

[0031] The total loss of the discriminator is based on the Wasserstein adversarial loss, with the addition of a gradient penalty term and a reconstruction constraint term. Its expression is as follows:

[0032] In the formula, This is the Wasserstein adversarial loss term for the discriminator (i.e., the expected difference between the true sample discrimination score and the reconstructed sample discrimination score). Let E(·) represent the expected value (indicated by square brackets), E(·) represent the encoder mapping (indicated by parentheses), and G(·) represent the decoder mapping. Let λ be the random linear interpolation point between the real sample and the reconstructed sample, λ be the gradient penalty coefficient (λ∈[1,20]), and ε be the reconstruction constraint coefficient in the discriminator loss (ε∈[0,1]). During training, the ratio of the discriminator update steps to the generator update steps is set to 5:1.

[0033] Orthogonal Weight Regularization (OWR): To prevent the generator from overfitting to the noise details of the training samples and losing its generalization ability in unsupervised training containing only normal samples, this invention introduces an Orthogonal Weight Regularization (OWR) term into the generator loss, applying it to all learnable weight matrices within the generator network. (l=1,2,…,L, where L is the number of layers in the weight matrix) Apply near-orthogonality constraints, and apply orthogonal weight regularization terms. The expression is:

[0034] in, Let the learnable weight matrix of the l-th layer of the generator be . Let I be the Frobenius norm and I be the identity matrix. This regularization term forces the column vectors of the weight matrix in each layer to tend towards orthogonality, thereby limiting the growth rate of the weight matrix's spectral norm, maintaining the stability of gradient propagation in deep networks, suppressing the generator's overfitting to the noise details of training samples, and forcing the generator to learn more generalizable feature representations. Orthogonal weight regularization and spectral normalization on the discriminator side form a bilateral constraint: spectral normalization constrains the discriminator from the perspective of input-output mapping, while orthogonal regularization constrains the generator from the perspective of parameter space. Together, they improve the overall stability and generalization of GAN training.

[0035] (4) Improve the training of generative adversarial network: Before formal training in step S3, the improved generative adversarial network is pre-trained using normal operating data of the same type of transformer to improve the convergence speed and generalization ability in small sample scenarios.

[0036] Preferably, the process of dynamically adjusting the fusion weights is as follows: Calculate the corresponding operating condition sensitivity coefficient based on the current operating condition status, and determine the fusion weights of the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) according to the following formula based on the operating condition sensitivity coefficient, thereby obtaining the comprehensive anomaly score:

[0037]

[0038] Where c represents the current operating condition; κ1(c) and κ2(c) are the corresponding operating condition sensitivity coefficients calculated based on the current operating condition, and satisfy κ1(c)≥0, κ2(c)≥0, κ1(c)+κ2(c)>0. At this time, the fusion weight satisfies w1(c)+w2(c)=1, w1(c)≥0, w2(c)≥0.

[0039] Specifically, in step S4, the dynamic anomaly score calculation for condition perception involves inputting the multidimensional state feature vector x of the sample to be detected into the trained improved generative adversarial network, and calculating the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) respectively:

[0040]

[0041] In the formula, =G(E(x)) is the reconstructed feature vector. This represents the feature map output of the k-th layer of the discriminator.

[0042] Considering the differences in the statistical distribution and anomaly sensitivity of various monitoring signals under different load rates, temperature rise levels, and voltage fluctuations of the main transformer, this invention introduces a dynamic weight allocation mechanism based on operating condition perception. The corresponding operating condition sensitivity coefficient is calculated based on the current operating condition state c, and the fusion weight of the reconstruction error score and the discriminator feature distance score is determined according to the following formula based on the operating condition sensitivity coefficient, thereby obtaining the comprehensive anomaly score:

[0043]

[0044] Where c represents the current operating condition; κ1(c) and κ2(c) are the corresponding operating condition sensitivity coefficients calculated based on the current operating condition, and satisfy the following: At this point, the fusion weights satisfy w1(c)+w2(c)=1, w1(c)≥0, and w2(c)≥0.

[0045] Under high-load fluctuating operating conditions, the weight of the discriminator feature distance score F(x) is increased to enhance the sensitivity to changes in local abnormal patterns. Under low-load stable operating conditions, the weight of the reconstruction error score R(x) is increased to enhance the detection capability of weak abnormal disturbances. The operating condition sensitivity coefficients κ1(c) and κ2(c) are determined through statistical modeling of historical normal operating data or optimization of the validation set, and are then normalized to obtain the fusion weights w1(c) and w2(c).

[0046] Preferably, the operating condition-aware adaptive threshold model is constructed using a combination of operating condition-aware hierarchical thresholding and extreme value theory: Based on the current load rate, the transformer operating conditions are divided into three levels: light load (<30% of rated load), normal (30%–80%), and heavy load (>80%). An independent historical normal sample (length T) anomaly score sliding window is maintained for each operating condition. Within each operating condition window, the high quantile (e.g., 90th quantile) of the anomaly score sequence within the window is selected as the initial threshold u. i For values ​​exceeding the initial threshold u i The excess sequence is fitted with a generalized Pareto distribution (GPD), and the dynamic threshold Th under the corresponding operating condition is determined by the GPD quantile function based on the target false alarm rate α0. i , i∈{light load, normal load, heavy load}; Th i The expression is:

[0047] Among them, u i Let α0 be the initial threshold for the i-th operating condition, and σ be the target false alarm rate. i With ξ i These are the scale and shape parameters of the GPD, respectively, N. i N represents the total number of samples within the window.u , i For exceeding the initial threshold u i The number of samples; the graded warning is based on the comprehensive abnormal score S exceeding the dynamic threshold Th of the corresponding working condition. i The degree of triggering is graded, specifically: when Th i <S≤1.2Th i A level 1 warning is triggered when 1.2Th i <S≤1.5Th i A level 2 warning is triggered when S > 1.5Th. i A level 3 warning is triggered.

[0048] When the overall abnormality score S of the sample to be tested > Th i When (where i corresponds to the current operating condition), it is determined that the transformer has an abnormal state, and the value exceeds Th according to S. i The degree of severity triggers a graded warning; at the same time, by parsing the multi-head self-attention weight matrix and cross-modal attention weight of each layer of the generator encoder, abnormal signal location results and graded warning information for each monitored signal are generated.

[0049] On the other hand, the present invention provides a main transformer anomaly detection device based on an improved generative adversarial network corresponding to the above method, comprising: The data acquisition module is used to collect data on dissolved gas concentration in oil, partial discharge detection signals, and electrical parameters in real time during the operation of the main transformer, forming a multi-source raw monitoring dataset. The feature extraction module is used to extract time-domain statistical features, frequency-domain spectral features, and time-frequency joint features from the multi-source raw monitoring dataset, and to fuse the extraction results to form a multi-dimensional state feature vector x. The model training module is used to construct an improved generative adversarial network (GAN). The improved GAN includes a generator and a discriminator D(·). The generator adopts an encoder-decoder architecture. The encoder of the generator includes a multi-head self-attention sublayer and a cross-modal attention sublayer. The encoder E(·) maps the multi-dimensional state feature vector x to a latent representation z, and the decoder G(·) maps the latent representation z to a reconstructed feature vector. The improved generative adversarial network is trained unsupervised using only the multidimensional state feature vectors of normally operating samples and the Wasserstein loss function with a gradient penalty term. The anomaly scoring module is used to input the multidimensional state feature vector of the sample to be detected into the trained improved generative adversarial network, and calculate the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) respectively; according to the current operating condition of the main transformer, the fusion weight of the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) is dynamically adjusted to obtain the comprehensive anomaly score S of operating condition perception. The threshold decision and location module is used to construct an adaptive threshold model for operating condition perception based on the generalized Pareto distribution (GPD) in extreme value theory, and compare the comprehensive abnormal score S of the operating condition perception with the adaptive threshold corresponding to the current operating condition; when the comprehensive abnormal score S exceeds the adaptive threshold corresponding to the current operating condition, it is determined that the main transformer has an abnormal state, and by analyzing the attention weights of the multi-head self-attention sublayer and the cross-modal attention sublayer, the abnormal signal source location result and graded warning information are output.

[0050] The beneficial effects of this invention are: (1) The present invention uses an improved generative adversarial network, which can complete unsupervised training with only normal samples, thus solving the problem that supervised methods are difficult to train under the condition of scarce abnormal samples of main transformer operation status. (2) This invention introduces multi-head self-attention and cross-modal attention into the generator encoder, which effectively captures the long-range dependence and cross-modal correlation between different dimensions of multi-source heterogeneous signals, and overcomes the problem of insufficient ability to model the correlation of multi-source signals; at the same time, the source of abnormal signals can be located by analyzing the attention weights, making the detection results interpretable. (3) In this invention, the spectral normalization constraint is used in the discriminator and combined with the Wasserstein loss with gradient penalty term to limit the Lipschitz constant of each layer of the discriminator to within 1, which suppresses the gradient vanishing and mode collapse problem in GAN training and improves training stability; furthermore, an orthogonal weight regularization term is introduced in the generator loss to effectively prevent the generator from overfitting in unsupervised training and improve the model's generalization ability. (4) The present invention adopts a dynamic scoring fusion mechanism based on operating conditions, which adaptively adjusts the fusion weight of reconstruction error score and discriminator feature distance score according to operating conditions, and introduces an adaptive hierarchical threshold based on extreme value theory, so that the decision threshold is automatically adjusted with the load rate, thus overcoming the problem of high false alarm rate and missed alarm rate caused by fixed threshold not adapting to changes in operating conditions. (5) This invention makes systematic improvements in five dimensions: feature fusion (cross-modal attention), training stability (spectral normalization plus gradient penalty), overfitting suppression (orthogonal weight regularization), anomaly scoring (condition-aware dynamic fusion), and threshold decision (EVT hierarchical adaptive). The five mechanisms are interdependent rather than simply superimposed: cross-modal attention provides reliable multi-source feature representation for dual scoring, spectral normalization and orthogonal weight regularization ensure that the feature extraction process does not degenerate due to GAN training instability, condition-aware dynamic weighting ensures that the scoring maintains physical meaning under different operating conditions, and EVT hierarchical threshold converts the scoring into quantifiable false alarm rate control. Attached Figure Description

[0051] Figure 1 This is a flowchart illustrating the overall process of the main transformer anomaly detection method according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the overall structure of the improved generative adversarial network according to an embodiment of the present invention; Figure 3 This is a structural diagram of the residual block in the discriminator of an embodiment of the present invention; Figure 4 This is a structural diagram of the encoder E(·) in the generator of this embodiment of the invention; Figure 5 This is a structural diagram of the decoder G(·) in the generator of this embodiment of the invention; Figure 6 This is a structural diagram of the discriminator D(·) according to an embodiment of the present invention; Figure 7 This is a flowchart of the adaptive threshold decision and graded warning process for working condition perception, according to an embodiment of the present invention. Figure 8 This is a training loss curve diagram of the simulated working condition experiment in Embodiment 2 of the present invention; Figure 9 This is the ROC curve of the simulated working condition test set in Embodiment 2 of the present invention; Figure 10 This is a heatmap of the multi-head attention weights of the abnormal sample encoder in Embodiment 2 of the present invention; Figure 11 This is a training loss curve based on real DGA data from Embodiment 3 of the present invention. Figure 12 This is the ROC curve of the real DGA data experimental test set in Embodiment 3 of the present invention; Figure 13 This is a comparison chart of the training loss curves of the conventional GAN ​​and the improved GAN of the present invention in Embodiment 3 of the present invention; Figure 14 This is a comparison chart of the ROC curves of the conventional GAN ​​and the improved GAN of the present invention on the test set in Embodiment 3 of the present invention. Detailed Implementation

[0052] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.

[0053] Example 1 Step S1: Multi-source signal acquisition and preprocessing Using a three-phase main transformer in a 220kV substation as the detection target, the following sensing devices were installed: (a) One PGAs-220 online DGA sensor is deployed at the sampling valve of the oil tank, with a sampling cycle of 30 minutes, to detect the concentration of gases (H2, CH4, C2H2, C2H4, C2H6, CO, CO2) in the oil; (b) Eight ultrasonic partial discharge sensors are evenly installed on the outer wall of the transformer tank, with a sampling frequency of 5MHz; (c) Two UHF partial discharge sensors are installed on the end screen of the high-voltage bushing, with a bandwidth of 300MHz to 3GHz; (d) Four Pt100 platinum resistance temperature sensors are used to monitor the temperature rise of hot spots in the high and low voltage windings, respectively. (e) Three digital current transformers and three voltage transformers with a precision of 0.2 class are used to monitor the three-phase load current and port voltage.

[0054] The data preprocessing process is as follows: using the DGA sampling period (30 minutes) as the basic time unit, timestamp alignment and window aggregation are performed on all sensor data; missing values ​​are filled using linear interpolation; Z-score standardization is applied to the data in each dimension to obtain a normalized multi-source monitoring dataset with zero mean and unit variance.

[0055] Step S2: Multi-domain feature extraction The time window length is set to 48 sampling points (corresponding to 24 hours), and the sliding step size is 6 sampling points (3 hours). The following feature extraction operations are performed on the multi-source monitoring data within each sliding window: (1) Time-domain statistical features: Seven types of statistics (mean, standard deviation, peak value, peak-to-peak value, kurtosis, skewness, and waveform factor) were extracted, and a total of 84-dimensional time-domain features were extracted from the 12 channel signals; (2) Frequency domain spectral characteristics: Perform a 256-point FFT on each channel signal to extract 5 frequency bands ([0, ...). / 10]、[ / 10, / 5]、[ / 5, 3 / 10]、[3 / 10, 2 / 5]、[2 / 5, The frequency band energy, centroid frequency, and mean square frequency of the signal were extracted from the 12 channels. Each channel had seven spectral feature parameters, resulting in a total of 84-dimensional frequency domain features. The sampling frequency; (3) Time-frequency joint features: The energy coefficients of 8 leaf nodes are extracted by using 3-layer Daubechies-4 wavelet packet decomposition, resulting in a total of 8×12=96-dimensional time-frequency features.

[0056] The above three types of features are concatenated and then mapped to a 128-dimensional multidimensional state feature vector x∈ through a two-layer fully connected network (ReLU activation, output dimension d=128). ¹² 8 .

[0057] Step S3: Improve the construction and training of generative adversarial networks like Figure 2 As shown, the specific structural parameters of the improved generative adversarial network in this embodiment are as follows: (1) Generator: The encoder E(·) consists of L=6 layers of stacked Transformer modules. Each layer contains multi-head self-attention (number of heads h=8), cross-modal attention (DGA feature vector → Query, partial discharge feature vector → Key / Value, =16) and location feedforward network (hidden layer dimension) =256), latent representation dimension m=32; the decoder G(·) consists of 3 fully connected layers (dimensions are 32→64→128, ReLU activation) and layer normalization (LayerNorm) alternating, and the output dimension is consistent with the input (d=128). (2) Discriminator D(·): 4 residual blocks + global average pooling + fully connected output layer; each layer has a kernel size of 3 and the number of channels is [64, 128, 256, 512], and all are spectral normalized; (3) Training parameters: batch size =64, Adam optimizer (β1=0.0, β2=0.9), learning rate =0.0001、 =0.0004, gradient penalty coefficient λ=10, reconstruction constraint coefficient ε=0.1, training epochs 200, discriminator / generator update ratio=5:1; (4) Transfer learning pre-training: The encoder was pre-trained (50 epochs) using 3 years of historical normal operation data (approximately 140,000 samples) of 8 transformers of the same manufacturer and model, and then fine-tuned on 6 months of normal operation data (approximately 8,760 samples) of the target transformer.

[0058] Step S4: Anomaly Score Calculation The convolutional layer (layer 4) before the last residual block of the discriminator is taken as the feature extraction layer, according to the formula R(x)=‖x ‖2 and the formula F(x)=‖ (x) ( )‖2. Calculate two types of scores. On a validation set of 200 normal samples, the distribution of abnormal scores was statistically analyzed for light load, normal, and heavy load conditions. The sensitivity coefficients κ1(c) and κ2(c) for each condition were determined using a validation set optimization method, and then the dynamic fusion weights w1(c) and w2(c) were determined: under light load and stable conditions, the reconstruction error score had a higher weight; under heavy load and fluctuating conditions, the discriminator feature distance score had a higher weight.

[0059] Step S5: As Figure 7 As shown, adaptive threshold decision and result output The operating condition sliding window length T=720 (corresponding to 30 days × 24 points / day) is used to maintain independent historical scoring windows for light load, normal, and heavy load operating conditions. The 90th percentile of the abnormal score sequence within each window is taken as the initial threshold u. i For more than u i The excess sequence fits the GPD distribution (shape parameter ξ) i Scale parameter σ i (Determined by maximum likelihood estimation), and with a target false alarm rate α0 = 1%, the dynamic thresholds for each operating condition are determined by the GPD quantile function. In this embodiment, the following is obtained: Light load condition Th i =1.28, Th under normal operating conditions i =1.47, Heavy-load operating condition Th i =1.89. Compare the overall anomaly score S of the sample to be detected with the threshold of the corresponding working condition: when S≤Th i When Th is judged to be normal; when Th i <S≤1.2Th i A level 1 warning is triggered when 1.2Th... i <S≤1.5Th i A level 2 warning is triggered when S > 1.5Th. i A Level 3 warning is triggered. When a warning is triggered, the self-attention weight matrix and cross-modal attention weight of each layer of the encoder are extracted to generate a 12-channel × 128-dimensional anomaly attribution heatmap. The dimension of the monitoring signal source that contributes the most to the anomaly (such as C2H2 concentration or ultrasonic partial discharge amplitude) is highlighted, and the warning level and location results are pushed to the substation integrated automation system.

[0060] Example 2: Verification of full-process simulation operation in twelve channels Under the complete twelve-channel multimodal process of Example 1 (including DGA, partial discharge, three-modal electrical parameter analysis, and cross-modal attention and condition perception fusion), the entire process of the method was further verified with high-fidelity simulation data: multi-source monitoring data under three operating conditions (light load, normal, and heavy load) were simulated and generated, and typical fault modes such as arc discharge, partial discharge, overheating fault, and insulation damping were injected according to the fault mechanism. The loss curves of the generator and discriminator during the training process are shown in the figure. Figure 8 As shown, the convergence pattern is consistent with the actual data experiment.

[0061] On the test set (239 normal cases and 150 abnormal cases), the AUC was 1.0000 and the accuracy was 95.12%. Figure 9 The reason why the AUC reaches the ideal level is that the simulated fault is injected according to the fault mechanism, and the interface between abnormal features and normal mode is clear. This result verifies the upper limit of the discrimination capability of the method of the present invention in scenarios with significant features. The dynamic thresholds of the working condition perception EVT are: light load: Th1=1.2790, normal: Th2=1.3567, heavy load: Th3=1.4880. The threshold of the heavy load working condition is significantly higher than that of the light load, which reflects the ability of the threshold to adaptively adjust with the working condition drift. The threshold dimension is determined by the scoring scale and feature dimension. The data scale of different embodiments is different, and their values ​​cannot be directly compared across embodiments, but the relative size relationship of the three working condition thresholds (heavy load > normal > light load) remains consistent. The warning level trigger statistics are shown in Table 1.

[0062] Table 1. Statistics on Warning Level Triggering in Simulation Experiments (Test Set) Warning level Total number of triggers Among the real faults Among them, normal samples Not triggered (normal) 220 0 220 Level 1 Warning 18 0 18 Level 2 warning 1 0 1 Level 3 Warning 150 150 0 Anomaly signal source localization assessment shows that: the modal-level localization hit rate (the proportion of fault modes identified by the attention mechanism that are consistent with the actual injected modes) reaches 100.0%, and the channel-level localization hit rate is 100.0% for Top 1 and Top 3. Figure 10 A heatmap of the average self-attention weights of 8 heads in the last layer of the encoder for randomly selected partial discharge anomaly samples (under normal operating conditions) is presented. It is evident that the attention weights are significantly concentrated on the feature dimensions corresponding to the partial discharge signal channels and their correlation pairs with the time-frequency joint feature regions. This aligns with the fault mechanism of abnormal energy in the time-frequency domain of partial discharge pulse signals, demonstrating that the attention mechanism of this invention can provide an interpretable source localization basis for anomaly scoring. The complete model has a total of 6,126,433 parameters, and a single-window inference time of 2.2 milliseconds (456 windows / second, CPU).

[0063] Example 3: Detection Performance Experiment Verification (1) Experimental objective and data sources This embodiment is used to verify the fault detection capability, alarm reliability, and operational efficiency of the method of the present invention on dissolved gas analysis (DGA) data in oil. It should be noted that this embodiment is a simplified configuration verification embodiment under a single DGA mode, focusing on verifying the effectiveness of the core network structure and training mechanism of the present invention on real data; the verification of the complete twelve-channel multimodal process including cross-modal attention sublayer and condition perception fusion is shown in Embodiment 2. The experimental data uses the publicly available transformer oil DGA dataset (Transformer-Oil-DGA-Dataset-with-Gaussian-Copula-Augmentation, MIT license): This dataset is generated by enhancing the statistical characteristics of the IEC TC 10 standard fault case database using the Gaussian Copula method, with a total of 4244 oil sample test records. Each record contains the concentration (μL / L) of 7 dissolved gases (H2, CH4, C2H2, C2H4, C2H6, CO, CO2) and status labels. There are 5 categories of status labels: Normal (663 entries), Low-energy discharge (D1) (535 entries), High-energy discharge (D2) (1016 entries), Medium and low temperature overheating (T1 & T2) (982 entries), and High temperature overheating (T3) (1048 entries), covering the two major categories of typical latent faults of the main transformer: discharge and overheating.

[0064] (2) Feature engineering and data partitioning For each oil sample record, a 12-dimensional feature vector was constructed: the log1p transformation values ​​of the seven gas concentrations, the IEC 60599 three-ratio diagnostic features (CH4 / H2, C2H2 / C2H4, C2H4 / C2H6, CO2 / CO), and the log1p value of total hydrocarbons (CH4+C2H2+C2H4+C2H6). Feature scaling employed robust median / interquartile range (IQR) scaling, with scaling parameters fitted only to normal samples in the training set to avoid information leakage. The data was divided as follows: 663 normal samples were further divided into a training set (398 samples), a validation set (133 samples), and a test set (133 samples) at a ratio of 60% / 20% / 20%; 3581 faulty samples were divided into a validation set (716 samples) and a test set (2865 samples) at a ratio of 20% to 80%. During the training phase, only normal samples are used, corresponding to the unsupervised training paradigm of this invention; the validation set is used to fuse weight selection and balanced operating point calibration; the test set does not participate in any calibration throughout the process.

[0065] (3) Model configuration and training process Given that the publicly available dataset only contains DGA single-modal test records and lacks partial discharge and electrical parameter monitoring channels, the generator in this embodiment omits the cross-modal attention sublayer, representing a degenerate form of the generator structure described in step S3 of this invention under single-modal input: the generator employs a feature fusion layer (12→64 dimensions) and a 4-layer multi-head self-attention (8-head) Transformer encoder with a latent representation dimension of 16; the decoder is a multi-layer fully connected network with layer normalization; the discriminator consists of 4 residual convolutional blocks with applied spectral normalization (channel count 32 / 64 / 128 / 256). The training objective is: L1 reconstruction loss + 0.5 times latent consistency loss. 0.2x Wasserstein resistance loss + 1×10 - ³ times the orthogonal weight regularization term; the discriminator side uses WGAN-GP loss with gradient penalty coefficient λ=10, the discriminator to generator update step ratio is 5:1, and the Adam optimizer is used (generator learning rate 1×10). -4 Discriminator learning rate 4×10 -4 The model has β=(0,0.9) and a batch size of 64, with 80 training rounds. The total number of model parameters is 1,366,737 (147,120 generator parameters + 1,219,617 discriminator parameters). The loss function, spectral normalization, gradient penalty, and orthogonal weight regularization mechanism are all completely consistent with those described in step S3 of this invention.

[0066] Training loss curve as shown Figure 11 As shown: Generator loss The discriminant loss decreases monotonically from an initial value of +0.58 and then enters a stable fluctuation zone. Throughout The narrow fluctuations around 1.5, without divergence or mode collapse, indicate that spectral normalization and gradient penalty together ensure the stability of adversarial training. This experiment completed all 80 training rounds on a regular CPU (without GPU acceleration), taking 775.5 seconds (approximately 12.9 minutes).

[0067] (4) Anomaly scoring and adaptive threshold According to step S4 of this invention, a reconstruction error score R(x) and a discriminator intermediate layer feature distance score F(x) are calculated for each test sample. A latent space Mahalanobis distance score M(x) (based on the mean and covariance of the latent distribution of normal training samples) is added as a redundant verification channel. This additional channel does not change the dual-score fusion framework of this invention. Since the oil sample test records in this dataset do not contain operating condition labels such as load rate, the operating condition degenerates to a single operating condition c0. Therefore, the operating condition sensitivity coefficients κ1(c0) and κ2(c0) described in this invention degenerate to constants, and their values ​​are determined according to the validation set optimization method described in this invention, that is, the fusion weights are calibrated using a grid search with AUC as the objective on the validation set. The calibration results on this dataset are w(R)=1.00, w(F)=0.00, and w(M)=0.00, indicating that the reconstruction error score independently provides the strongest discriminative ability on this dataset, and the feature distance and Mahalanobis distance scores are retained as redundant verification channels. Step S5 uses extreme value theory to fit a generalized Pareto distribution (GPD) to the historical scores of normal samples: An initial threshold u = 90th percentile of historical scores = 1.4033 is taken, and a conservative decision threshold Th = 5.0483 is extrapolated at a target false alarm rate α0 = 1%. Simultaneously, the equilibrium operating point threshold Th* = 1.4322 is determined on the validation set using the Youden index (this calibration only uses the validation set, without test set labels, and therefore has no information leakage). Th corresponds to the "high-accuracy alarm" operating mode, and Th* corresponds to the "high-detection screening" operating mode; the two constitute a dual-operating-point strategy.

[0068] (5) Test results and performance analysis On a test set containing 2998 samples (133 normal cases and 2865 faulty cases), the anomaly score of the method of this invention achieved an AUC of 0.9417. The ROC curve of the test set is shown below. Figure 12 As shown in Table 2, the detection performance at the two operating points is as follows.

[0069] Table 2. Dual-operating-point detection performance (test set)

[0070] It should be noted that the goal of the conservative operating point is to reduce the false alarm rate to the order of 1% (the measured normal false alarm rate is 2.26%). The cost is that only extremely significant fault samples with extremely high scores are detected. Therefore, the "accuracy" index at this point is lower due to the high proportion of fault samples in the test set (95.6%), but it does not mean that the model's discrimination ability is insufficient. The model's ranking discrimination ability is objectively reflected by AUC=0.9417, while the reliability of graded alarms is reflected by the following warning statistics.

[0071] According to the hierarchical warning rules in step S5 (Th<S≤1.2Th triggers level 1, 1.2Th<S≤1.5Th triggers level 2, and S>1.5Th triggers level 3), the statistics of warning level triggers in the test set are shown in Table 3.

[0072] Table 3 Warning Level Trigger Statistics (Test Set) Warning level Total number of triggers Among the real faults Among them, normal samples Level of accuracy Level 1 Warning 160 158 2 98.8% Level 2 warning 151 151 0 100.0% Level 3 Warning 544 543 1 99.8% Statistics show that among the total of 695 cases of level 2 and level 3 warnings, real faults account for 99.86%, among which there are 543 real faults in 544 cases of level 3 warnings, with a precision rate as high as 99.82%. That is, the high-level alarms triggered by the method of the present invention almost have no false positives, and can directly drive the operation and maintenance handling process; the effectiveness of the hierarchical design that "the more extreme the score, the higher the fault confidence" is verified.

[0073] (6) Fault Type Detection and Cause Localization Analysis The detection rate and classification AUC of each fault type at two operating points are shown in Table 4.

[0074] Table 4 Detection Rate and Classification AUC of Each Fault Type (Test Set) Fault type Fault meaning Sample size Conservative detection rate Equilibrium point detection rate Classification AUC D1 Low-energy discharge (partial discharge, etc.) 428 9.3% 61.7% 0.8679 D2 High-energy discharge (such as electric arc discharge) 813 14.6% 92.0% 0.9338 T1 & T2 Overheating at medium and low temperatures (<700℃) 786 40.2% 99.1% 0.9661 T3 High temperature overheating (>700℃) 838 45.0% 96.1% 0.9641 The results are consistent with the DGA diagnosis mechanism: overheating faults (T1&T2, T3) are accompanied by a significant increase in the concentrations of total hydrocarbons and C2H4, with obvious gas characteristics, and the equilibrium point detection rates reach 99.1% and 96.1% respectively; high-energy discharge faults (D2) generate the characteristic C2H2 gas, with a detection rate of 92.0%; low-energy discharge faults (D1, including partial discharge) have a low gas production rate and weak features, and have essential overlap with normal samples in the feature space, which is a recognized difficulty in the field of DGA diagnosis. The present method still achieves an equilibrium point detection rate of 61.7% and a classification AUC of 0.868. The comprehensive anomaly score also provides a fault source indication: the samples with the highest scores among the detected samples are concentrated in the high-temperature overheating and high-energy discharge types, which is consistent with the feature deviation degree reflected by the scores, realizing the preliminary localization of the fault cause. It should be noted that this embodiment is a single-modal configuration, there is no cross-modal attention weight available for parsing, and the fault source indication is given by the comprehensive anomaly score ranking and the feature contribution of gas components; the verification of abnormal signal source localization based on multi-head self-attention weights and cross-modal attention weights is shown in Embodiment 2 and Figure 10 .

[0075] (7) Efficiency and Engineering Deployability The model in this embodiment has a total of 1,366,737 parameters. It took 775.5 seconds to complete all 80 rounds of training on a regular CPU. The single-sample inference time was 0.148 milliseconds (average forward timing of all 2,998 test cases). Compared with the 30-minute sampling period of online DGA monitoring, the inference overhead is negligible and can meet the real-time requirements of online monitoring at substations. The model size also supports local deployment on edge computing devices.

[0076] (8) Comparison and verification with conventional generative adversarial networks To verify the necessity of improving the standard generative adversarial network in this invention, a standard GAN baseline was constructed (the standard structure proposed by Goodfellow et al. in 2014: both the generator and discriminator are fully connected networks, standard binary classification cross-entropy adversarial loss, Adam optimizer β=(0.5,0.999), the discriminator and generator are updated alternately at a 1:1 ratio, and the total number of parameters is 114,189). Training and evaluation were completed under the exact same dataset, feature vectors, data partitioning, random seeds, scoring system and threshold caliber as this invention to ensure the fairness of the comparison.

[0077] a. Following the standard GAN anomaly detection approach, the discriminator output is directly used as the anomaly score: Under five different random seeds, the mean AUC on the test set is only 0.24, fluctuating wildly between 0.06 and 0.59, with multiple instances of AUC less than 0.5, meaning the discriminator classifies faulty samples as more "real" than normal samples. This indicates that the standard GAN discriminator only learns to distinguish membership in the training set and its output on out-of-distribution samples has no anomaly discrimination significance; simultaneously, its generator loss oscillates continuously throughout training without convergence. Figure 13 (Left) After 50 rounds with 5 seeds, the peak-to-peak loss reached 0.62~0.94. This result experimentally confirms the shortcomings of standard GAN training instability and unreliable scoring described in the background art, and proves the necessity of improving its network structure and loss function.

[0078] b. After further introducing the standard latent vector inversion remediation measures from other literature into conventional GANs (performing 500 steps of gradient optimization for each sample to obtain the optimal latent vector, using the reconstruction error as the anomaly score), its detection performance was improved to AUC = 0.9455 ± 0.0028 (mean of 5 seeds) on the test set, while the method of this invention (AUC = 0.9417) was significantly better. Figure 14The current method is roughly equivalent; however, the inversion optimization makes its single-sample scoring time reach 1.656 milliseconds, which is about 11 times that of the method in this invention (0.148 milliseconds, with the encoder directly outputting the potential representation in a single forward pass), making it difficult to meet the real-time requirements of online monitoring; moreover, conventional GANs do not contain an encoder, cannot parse attention weights, and do not have the ability to locate anomaly sources. A comprehensive comparison of the two methods is shown in Table 5.

[0079] Table 5. Comprehensive comparison between the improved GAN of this invention and conventional GAN ​​(same real DGA dataset, same evaluation protocol) Comparison Dimensions Standard GAN baseline (original version) This invention improves GAN Network structure and training loss Fully connected generator / discriminator, standard cross-entropy adversarial loss, non-spectral normalization, gradient penalty and orthogonal regularization Self-attention encoder-decoder generator + spectral normalized residual discriminator, Wasserstein gradient penalty + orthogonal weight regularization Methods for obtaining anomaly scores The discriminator outputs a direct score that fails (AUC = 0.24 ± 0.20); a reconstructed score must be obtained through sample-by-sample latent vector inversion (500 optimization steps). The encoder outputs the latent representation directly in a single forward pass, and the score is a fusion of reconstruction, feature distance, and Mahalanobis distance. Test set AUC 0.9455±0.0028 (5 random seeds) 0.9417 (deterministic reproduction) Equilibrium point detection rate / false alarm rate 92.6% / 15.8% 90.6% / 14.3% Time taken to score a single sample (CPU) 1.656 milliseconds 0.148 milliseconds (approximately 11 times faster) Training stability The generator loss oscillates throughout and shows no convergence trend (peak-to-peak value of the 5-seed tail segment is 0.62~0.94). The discriminator loss fluctuates within a narrow range and converges smoothly. Figure 13 ) Anomaly source location Not supported Support (attention weight parsing, Figure 10 ) Model parameter count 114,189 1,366,737 As can be seen from Table 5, conventional GANs either become unusable due to discriminator scoring failure or require approximately 11 times the inference overhead and abandon anomaly localization capabilities to achieve detection accuracy comparable to that of this invention. This invention, through structural and loss improvements using a self-attention encoder, spectral normalization and gradient penalty, and orthogonal weight regularization, achieves deterministic convergence, millisecond-level single forward scoring, and interpretable anomaly source localization while maintaining detection accuracy. This demonstrates the necessity and engineering value of the improvements compared to currently used conventional generative adversarial networks.

[0080] Example 4: Implementation of the main transformer anomaly detection device This embodiment provides a main transformer anomaly detection device based on an improved generative adversarial network, corresponding to the method described in Embodiment 1. Its overall process is also as follows. Figure 1 As shown. The device includes a data acquisition module, a feature extraction module, a model training module, an anomaly scoring module, and a threshold determination and localization module.

[0081] The data acquisition module is used to execute step S1, and is connected to the sensing device (online DGA sensor, ultrasonic partial discharge sensor, UHF partial discharge sensor, platinum resistance temperature sensor, current transformer and voltage transformer) described in Example 1. It collects dissolved gas concentration data, partial discharge detection signal and electrical parameter data in oil in real time, and completes timestamp alignment, missing value interpolation and Z-score standardization preprocessing to form a multi-source original monitoring dataset. The feature extraction module is used to perform step S2, extracting time-domain statistical features, frequency-domain spectral features, and time-frequency joint features in the manner described in Example 1, and then fusing and mapping them to form a 128-dimensional multi-dimensional state feature vector. The model training module is used to execute step S3, construct an improved generative adversarial network with the structural parameters described in Example 1 (the encoder of the generator includes a multi-head self-attention sublayer and a cross-modal attention sublayer, and the discriminator is a deep residual convolutional network with spectral normalization applied), and complete unsupervised training (including transfer learning pre-training) using only normal operating samples according to the Wasserstein loss function with gradient penalty term. The anomaly scoring module is used to execute step S4, inputting the multidimensional state feature vector of the sample to be detected into the trained improved generative adversarial network, calculating the reconstruction error score and the discriminator intermediate layer feature distance score, and dynamically fusing them according to the current operating condition to obtain the comprehensive anomaly score S of the operating condition perception. The threshold judgment and location module is used to execute step S5, which constructs an adaptive threshold model for working condition perception based on the generalized Pareto distribution in extreme value theory, compares the comprehensive anomaly score S with the adaptive threshold corresponding to the current working condition, determines the abnormal state and triggers a graded warning, and at the same time analyzes the attention weights of the multi-head self-attention sublayer and the cross-modal attention sublayer to generate an anomaly attribution heatmap, and outputs the anomaly signal source location result and graded warning information to the substation integrated automation system.

[0082] The device described in this embodiment can be deployed in an online monitoring device or edge computing device at the substation end. As described in Embodiment 3, the model of this invention is small in size and the single-sample inference time is 0.148 milliseconds, which can meet the real-time requirements of online monitoring at the substation end. The specific workflow, parameter configuration and technical effect of each module in the device are completely consistent with the methods described in Embodiments 1 to 3, and will not be repeated here.

[0083] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of the present invention is limited to these examples; within the framework of the present invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present invention as described above, which are not provided in detail for the sake of brevity.

[0084] One or more embodiments of this invention are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this invention. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this invention should be included within the protection scope of this invention.

Claims

1. A method for detecting anomalies in a main transformer based on an improved generative adversarial network, characterized in that, Includes the following steps: Step S1: Real-time acquisition of dissolved gas concentration data in oil, partial discharge detection signals, and electrical parameter data during the operation of the main transformer to form a multi-source raw monitoring dataset; Step S2: Extract time-domain statistical features, frequency-domain spectral features, and time-frequency joint features from the multi-source raw monitoring dataset, and fuse the extraction results to form a multi-dimensional state feature vector x; Step S3: Construct an improved generative adversarial network, which includes a generator and a discriminator D(·). The generator adopts an encoder-decoder architecture. The encoder of the generator includes a multi-head self-attention sublayer and a cross-modal attention sublayer. The encoder E(·) maps the multi-dimensional state feature vector x to a latent representation z, and the decoder G(·) maps the latent representation z to a reconstructed feature vector. The improved generative adversarial network is trained unsupervised using only the multidimensional state feature vectors of normally operating samples and a Wasserstein loss function with a gradient penalty term. Step S4: Input the multidimensional state feature vector of the sample to be detected into the trained improved generative adversarial network, and calculate the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) respectively; according to the current operating condition of the main transformer, dynamically adjust the fusion weight of the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) to obtain the comprehensive anomaly score S of operating condition perception. Step S5: Construct an adaptive threshold model for operating condition perception based on the generalized Pareto distribution (GPD) in extreme value theory, and compare the comprehensive abnormality score S of the operating condition perception with the adaptive threshold corresponding to the current operating condition; when the comprehensive abnormality score S exceeds the adaptive threshold corresponding to the current operating condition, it is determined that the main transformer has an abnormal state, and by analyzing the attention weights of the multi-head self-attention sublayer and the cross-modal attention sublayer, the abnormal signal source location result and graded warning information are output.

2. The main transformer anomaly detection method based on improved generative adversarial networks according to claim 1, characterized in that, The dissolved gas concentration data in the oil includes the concentration values ​​of H2, CH4, C2H2, C2H4, C2H6, CO, and CO2; the partial discharge detection signal includes electromagnetic wave signals collected by an ultra-high frequency sensor and sound pressure signals collected by an ultrasonic sensor; the electrical parameter data includes winding temperature rise, load current, and effective values ​​of port voltage.

3. The main transformer anomaly detection method based on improved generative adversarial networks according to claim 1, characterized in that, The time-domain statistical features include mean, standard deviation, peak value, peak-to-peak value, kurtosis, skewness, and waveform factor; the frequency-domain spectral features include power spectral density energy in each frequency band, centroid frequency, and mean square frequency; the time-frequency joint features are the node energy coefficients obtained by performing short-time Fourier transform and multi-scale wavelet packet decomposition on the original signal.

4. The main transformer anomaly detection method based on improved generative adversarial networks according to claim 1, characterized in that, The encoder of the generator is composed of multiple layers of multi-head self-attention modules and feedforward networks stacked alternately. The encoder also includes a cross-modal attention sub-layer. The cross-modal attention sub-layer uses the feature vector of dissolved gas in oil as the query and the feature vector of partial discharge as the key and value to perform cross-modal dependency modeling on multi-source heterogeneous signals. The decoder is composed of multiple layers of fully connected networks and layer normalization alternatingly.

5. The main transformer anomaly detection method based on improved generative adversarial networks according to claim 1, characterized in that, Each convolutional layer of the discriminator undergoes spectral normalization on its weight matrix to constrain the discriminator's Lipschitz constant to not exceed 1. The discriminator is a deep residual convolutional network containing no fewer than four residual blocks, each consisting of two convolutional layers with spectral normalization and skip connections.

6. The main transformer anomaly detection method based on improved generative adversarial networks according to claim 1, characterized in that, The generator loss function of the improved generative adversarial network includes an orthogonal weight regularization term, and its expression is as follows: in, For the original reconstruction loss, For potential consistency loss, For the generator adversarial loss term based on Wasserstein distance, For the orthogonal weight regularization term, α, β, γ, and δ are the reconstruction loss coefficient, latent consistency loss coefficient, generator adversarial loss coefficient, and orthogonal weight regularization coefficient, respectively, with values ​​ranging from α, β, γ ∈ (0, 10] to δ ∈ [0.001, 0.1].

7. The main transformer anomaly detection method based on improved generative adversarial networks according to claim 1, characterized in that, The improved generative adversarial network's discriminator total loss introduces a gradient penalty term and a reconstruction constraint term on top of the Wasserstein adversarial loss, and its expression is as follows: in, The Wasserstein adversarial loss term is used for the discriminator. Let E(·) represent the expected value, and G(·) represent the encoder mapping and G(·) represent the decoder mapping. λ is the random linear interpolation point between the real sample and the reconstructed sample, λ is the gradient penalty coefficient, λ∈[1,20], and ε is the reconstruction constraint coefficient in the discriminator loss, ε∈[0,1].

8. The main transformer anomaly detection method based on improved generative adversarial networks according to claim 1, characterized in that, The process of dynamically adjusting the fusion weights is as follows: Calculate the corresponding operating condition sensitivity coefficient based on the current operating condition status, and determine the fusion weights of the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) according to the following formula based on the operating condition sensitivity coefficient, thereby obtaining the comprehensive anomaly score: Where c represents the current operating condition; κ1(c) and κ2(c) are the corresponding operating condition sensitivity coefficients calculated based on the current operating condition, and satisfy κ1(c)≥0, κ2(c)≥0, κ1(c)+κ2(c)>0. At this time, the fusion weight satisfies w1(c)+w2(c)=1, w1(c)≥0, w2(c)≥0.

9. The main transformer anomaly detection method based on improved generative adversarial networks according to claim 1, characterized in that, The operating condition-aware adaptive threshold model is constructed using a combination of operating condition-aware hierarchical thresholding and extreme value theory: Based on the current load rate, the transformer operating conditions are divided into three levels: light load, normal, and heavy load. An independent historical normal sample anomaly score sliding window is maintained for each operating condition. Within each operating condition window, the high quantile of the anomaly score sequence within the window is selected as the initial threshold u. i For values ​​exceeding the initial threshold u i The excess sequence is fitted with a generalized Pareto distribution (GPD), and the dynamic threshold Th under the corresponding operating condition is determined by the GPD quantile function based on the target false alarm rate α0. i , i∈{light load, normal load, heavy load}; Th i The expression is: Among them, u i Let α0 be the initial threshold for the i-th operating condition, and σ be the target false alarm rate. i With ξ i These are the scale and shape parameters of the GPD, respectively, N. i N represents the total number of samples within the window. u , i For exceeding the initial threshold u i The number of samples; the graded warning is based on the comprehensive abnormal score S exceeding the dynamic threshold Th of the corresponding working condition. i The degree of triggering is graded, specifically: when Th i <S≤1.2Th i A level 1 warning is triggered when 1.2Th i <S≤1.5Th i A level 2 warning is triggered when S > 1.5Th. i A level 3 warning is triggered.

10. A main transformer anomaly detection device based on an improved generative adversarial network, characterized in that, include: The data acquisition module is used to collect data on dissolved gas concentration in oil, partial discharge detection signals, and electrical parameters in real time during the operation of the main transformer, forming a multi-source raw monitoring dataset. The feature extraction module is used to extract time-domain statistical features, frequency-domain spectral features, and time-frequency joint features from the multi-source raw monitoring dataset, and to fuse the extraction results to form a multi-dimensional state feature vector x. The model training module is used to construct an improved generative adversarial network (GAN). The improved GAN includes a generator and a discriminator D(·). The generator adopts an encoder-decoder architecture. The encoder of the generator includes a multi-head self-attention sublayer and a cross-modal attention sublayer. The encoder E(·) maps the multi-dimensional state feature vector x to a latent representation z, and the decoder G(·) maps the latent representation z to a reconstructed feature vector. ; The improved generative adversarial network is trained unsupervised using only the multidimensional state feature vectors of normally operating samples and the Wasserstein loss function with a gradient penalty term. The anomaly scoring module is used to input the multidimensional state feature vector of the sample to be detected into the trained improved generative adversarial network, and calculate the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) respectively; according to the current operating condition of the main transformer, the fusion weight of the reconstruction error score R(x) and the discriminator intermediate layer feature distance score F(x) is dynamically adjusted to obtain the comprehensive anomaly score S of operating condition perception. The threshold decision and location module is used to construct an adaptive threshold model for operating condition perception based on the generalized Pareto distribution (GPD) in extreme value theory, and compare the comprehensive abnormal score S of the operating condition perception with the adaptive threshold corresponding to the current operating condition; when the comprehensive abnormal score S exceeds the adaptive threshold corresponding to the current operating condition, it is determined that the main transformer has an abnormal state, and by analyzing the attention weights of the multi-head self-attention sublayer and the cross-modal attention sublayer, the abnormal signal source location result and graded warning information are output.