Transformer oil dissolved gas content prediction method based on improved GRU
By adding Conv1D and Bi-GRU layers to the GRU model and optimizing hyperparameters using the tuna algorithm, the problems of traditional GRU's inability to extract deep features and reliance on human experience are solved, achieving higher accuracy in predicting dissolved gas content in transformer oil and improving the model's robustness and prediction accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEBEI UNIV OF TECH
- Filing Date
- 2023-06-14
- Publication Date
- 2026-04-17
AI Technical Summary
Existing shallow machine learning methods cannot handle the massive dissolved gas content data in transformer oil, while deep learning methods such as LSTM and GRU have problems such as being unable to effectively extract deep features between data and relying on human experience to select parameters, resulting in insufficient prediction accuracy.
An improved GRU model is adopted, which adds a Conv1D layer for deep feature extraction and improves it to a Bi-GRU layer that combines forward and backward information. At the same time, the Tuna algorithm is used to optimize key hyperparameters, and an improved GRU optimization model is constructed.
The model's robustness and prediction accuracy were improved, prediction errors were significantly reduced, and more accurate gas content predictions were provided, offering important technical support for online monitoring and fault early warning of transformers.
Smart Images

Figure CN116705187B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power transformer condition monitoring and fault early warning technology, specifically a method for predicting dissolved gas content in transformer oil based on an improved GRU. Background Technology
[0002] As one of the most critical hub devices in the power grid, power transformers play a vital role in power generation, transmission, and distribution. Their operational reliability directly affects the safe and stable operation of the power grid. Therefore, timely and accurate assessment of transformer operating status is crucial for the reliable operation of the power grid. Among various methods for evaluating transformer operating status, Dissolved Gas Analysis (DGA) technology has been recommended by the International Electrotechnical Commission (IEC) as the primary method for assessing the operating status of power transformers due to its relatively complete data preservation and wider applicability.
[0003] The dissolved gases in transformer oil mainly include seven gases: hydrogen (H2), methane (CH4), ethane (C2H6), ethylene (C2H4), acetylene (C2H2), carbon monoxide (CO), and carbon dioxide (CO2). The content of these gases and the proportion of different gases are closely related to the operating status of the transformer. Therefore, by using historical monitoring data of dissolved gas content in the oil to predict the operating status of the transformer in advance, anticipate its fault conditions, and guide operation and maintenance personnel to formulate corresponding maintenance strategies in a timely manner, it is possible to effectively prevent major accidents and avoid significant losses to the power grid, the social economy, and people's lives.
[0004] Predicting the dissolved gas content in transformer oil is essentially a time series prediction problem. Current research methods for this problem can be broadly categorized into two types: machine learning prediction methods and deep learning prediction methods. Early data on dissolved gas content in transformer oil was small and contained limited information. Therefore, shallow machine learning methods, such as Support Vector Machines (SVM), were widely used in this field. However, with the application of online monitoring systems for dissolved gases in transformer oil, the amount of data has increased significantly. Shallow machine learning methods cannot handle such large datasets and suffer from error accumulation and an inability to accurately mine temporal correlations, limiting their further application in this area.
[0005] With the continuous development of artificial intelligence and the increasing number of data samples on dissolved gas content in transformer oil, deep learning prediction methods such as recurrent neural networks (RNNs) have strong memory capabilities and can more effectively capture the correlation information in time series data. Therefore, they have shown stronger adaptability in the field of predicting dissolved gas content in transformer oil. The literature "Dai Jiejie, Song Hui, Sheng Gehao, et al. Research on prediction method of power transformer operation status using LSTM network [J]. High Voltage Engineering, 2018, 44(04):1099-1106." uses the most mature RNN architecture—Long Short Term Memory (LSTM) neural network—to predict the dissolved gas content in transformer oil and obtains relatively accurate prediction results. LSTM introduces a gating mechanism on the basis of RNN, which effectively solves the gradient vanishing and gradient explosion problems during RNN network training. However, LSTM still has problems such as complex internal calculations and inability to effectively extract deep features between data. In addition, the hyperparameters of LSTM are generally set by human experience, which has strong randomness and uncertainty, resulting in a decrease in the prediction accuracy of the model. To address the problems of LSTM, the paper "Zhu Wei. Research on Prediction of Power Transformer Operation Status Based on GRU and SVM Model [D]. Jiangsu University, 2021" uses a gated recurrent unit (GRU) to predict the dissolved gas content in transformer oil. GRU is an improved form of LSTM, which integrates the forget gate and input gate of LSTM into a single update gate, effectively reducing the number of parameters of LSTM, shortening the training time of the model, and improving the prediction accuracy of the model. However, it still has problems such as the inability to effectively extract deep features between data and the reliance on manual experience to select parameters, which limits the further improvement of its prediction accuracy. Summary of the Invention
[0006] To address the shortcomings of existing technologies, the technical problem this invention aims to solve is to provide a method for predicting dissolved gas content in transformer oil based on an improved GRU.
[0007] The technical solution of this invention to solve the aforementioned technical problem is to provide a method for predicting the dissolved gas content in transformer oil based on an improved GRU, characterized in that the method includes the following steps:
[0008] Step 1: Normalize the dissolved gas content data in transformer oil, and divide the normalized gas content data into training set and test set;
[0009] Step 2: Construct the improved GRU model; the improved GRU model includes an Input layer, a Conv1D layer, a Bi-GRU layer, a Dense layer, and an Output layer;
[0010] The output of the Input layer is connected to the input of the Conv1D layer, the output of the Conv1D layer is connected to the input of the Bi-GRU layer, the output of the Bi-GRU layer is connected to the input of the Dense layer, and the output of the Dense layer is connected to the input of the Output layer.
[0011] The Input layer is used to input the training and test sets from step 1; the Conv1D layer extracts features from the training and test sets through convolution calculations; the Bi-GRU layer is used to learn the changing patterns of the training and test sets and make predictions; the Dense layer is used to compress the training and test set data and simplify the network parameters; the Output layer is used to output the prediction results.
[0012] Step 3: Input the training set into the improved GRU model for network training, and use the tuna algorithm to iteratively search the key hyperparameters of the improved GRU model to obtain the improved GRU optimized model.
[0013] Step 4: Input the test set into the improved GRU optimization model to obtain the predicted value of the gas content data at the next time step.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0015] (1) The present invention adds a convolutional layer, namely the Conv1D layer, between the input layer and the neural network layer of the traditional GRU, which is used to extract deep features of dissolved gas content data in transformer oil. This effectively solves the problem that the traditional GRU cannot extract deep features between data, and enhances the robustness and stability of the model.
[0016] (2) The present invention improves the traditional GRU layer into a Bi-GRU layer. Compared with the GRU layer, which can only learn historical information, the Bi-GRU layer combines two unidirectional GRU layers, one forward and one backward, so it can combine forward and backward information and obtain more data change patterns from the future, thereby improving the prediction accuracy of the model.
[0017] (3) The present invention uses the tuna algorithm to iteratively search the three most critical hyperparameters that affect the prediction accuracy of GRU. By setting the model parameters through intelligent algorithms, it can be ensured that the setting of model parameters is not affected by human subjective factors, thereby further improving the prediction accuracy of the model and making the prediction results more objective.
[0018] (4) In this invention, simulation results show that when the improved GRU optimization model predicts the dissolved gas content in oil, the prediction error is significantly lower than that of the traditional GRU and the traditional long short-term memory neural network. This proves that the improved GRU optimization model has higher prediction accuracy and can obtain more accurate gas content prediction values, providing important technical support for transformer online monitoring and fault early warning. Attached Figure Description
[0019] Figure 1 This is an overall flowchart of the present invention;
[0020] Figure 2 The network structure and network training flowchart of the improved GRU model of this invention are shown below. Detailed Implementation
[0021] Specific embodiments of the present invention are given below. These specific embodiments are only used to further illustrate the present invention in detail and do not limit the scope of protection of the claims of the present invention.
[0022] This invention provides a method for predicting dissolved gas content in transformer oil based on an improved GRU (hereinafter referred to as the method), characterized by the following steps:
[0023] Step 1: To prevent large data from overwhelming small data due to different units of measurement, the dissolved gas content data in transformer oil (hereinafter referred to as gas content data) needs to be normalized, and the normalized gas content data is divided into training set and test set.
[0024] Preferably, in step 1, the normalization process uses Min-Max normalization, specifically: the content data of n gases of length l are denoted as... The normalized gas content data obtained after normalization is The calculation formula is as follows:
[0025]
[0026] In equation (1), y represents the normalized gas content data; x represents the original gas content data; x max The maximum value in the original gas content data; x min This is the minimum value in the original gas content data.
[0027] Preferably, in step 1, in order to ensure that the model is trained sufficiently and to more accurately reflect the model's performance, the training set and the test set are divided in a 4:1 ratio.
[0028] Step 2: Construct an improved GRU model (e.g.) Figure 2(As shown); The improved GRU model includes an Input layer, a Conv1D layer, a Bi-GRU layer, a Dense layer, and an Output layer;
[0029] The output of the Input layer is connected to the input of the Conv1D layer, the output of the Conv1D layer is connected to the input of the Bi-GRU layer, the output of the Bi-GRU layer is connected to the input of the Dense layer, and the output of the Dense layer is connected to the input of the Output layer.
[0030] The Input layer is used to input the training and test sets from step 1; the Conv1D layer extracts features from the training and test sets through convolution calculations; the Bi-GRU layer is used to learn the changing patterns of the training and test sets and make predictions; the Dense layer is used to compress the training and test set data and simplify the network parameters; the Output layer is used to output the prediction results.
[0031] Preferably, in step 2, the calculation formula for the Conv1D layer is as follows:
[0032] H i =f(H i-1 *W i +b i (2)
[0033] In equation (2), H i The feature vector; "*" represents the convolution operation; W i b is the weight vector; i This is the bias parameter.
[0034] Preferably, in step 2, the specific steps of the Bi-GRU layer are as follows:
[0035] S2.1. Using a pair of forward and backward GRUs, the forward and backward information of the training and test sets are learned respectively, and the prediction results r are output respectively. t and z t The calculation formula is shown in equation (3):
[0036]
[0037] In equation (3), r t The state of the gate is updated at time t; σ is the sigmoid activation function; W r To update the weight matrix of the gate; h t-1 Let x be the candidate hidden state at time t-1; t b is the input value at time t; r To update the gate bias; z t The state of the door is reset at time t; W z b is the weight matrix for resetting the gate;z To reset the door offset;
[0038] S2.2. Combine the prediction results output by the two GRUs to obtain the final result y. t The calculation formula is shown in equation (4):
[0039]
[0040] In equation (4), Let W be the candidate state at time t; tanh is the hyperbolic tangent activation function; W h h is the weight matrix for the candidate states. t Let be the hidden state at time t; I is the identity matrix; y t W is the output value at time t. o This is the weight matrix of the output gate.
[0041] Step 3: Input the training set into the improved GRU model for network training, and use the tuna algorithm to iteratively search for the key hyperparameters of the improved GRU model (e.g., ...). Figure 2 As shown), the improved GRU optimization model is obtained;
[0042] Preferably, in step 3, the key hyperparameters of the improved GRU model are the maximum number of iterations, the initial learning rate, and the number of hidden layer neurons.
[0043] Preferably, in step 3, the specific steps for iteratively searching for the key hyperparameters of the improved GRU model using the tuna algorithm are as follows:
[0044] Step 3.1: Randomly initialize the tuna population;
[0045] Preferably, in step 3.1, the optimization process begins by randomly and uniformly generating an initial tuna population in the search space, using the following calculation formula:
[0046]
[0047] In equation (5), Let be the i-th initial individual; rand is a random vector uniformly distributed from 0 to 1; ub and Ib are the upper and lower bounds of the search space; NP is the population size of tuna.
[0048] Step 3.2: Calculate the fitness of individual tuna;
[0049] Preferably, in step 3.2, the formula for calculating the fitness of individual tuna is as follows:
[0050]
[0051] In equation (6), Fitness(X)t ) represents the fitness value of an individual tuna; N represents the number of training samples; The output value is the predicted value of dissolved gas content in transformer oil; X t This represents the actual value of dissolved gas content in transformer oil.
[0052] In this embodiment, the root mean square error of the GRU network is used as the fitness function of the tuna algorithm.
[0053] Step 3.3: The tuna population carrying optimization variable information updates its position by selecting a foraging strategy, thereby achieving iterative search for the key hyperparameters of the improved GRU model;
[0054] Preferably, step 3.3 specifically involves:
[0055] S3.3.1. Generate a random number rand between [0,1].
[0056] S3.3.2 If rand < 0.5, select the spiral foraging strategy. The calculation formula is as follows:
[0057]
[0058] In equation (7), Let be the position of the i-th individual after the (t+1)-th iteration; t is the current iteration number; t max The maximum number of iterations is N; the population size is N. and α1 and α2 are the current optimal individual position and the random individual position, respectively; α1 and α2 are the weighting coefficients that control the random individual to move towards the optimal individual and the previous individual; β is the development parameter associated with the optimal individual or the random individual.
[0059] If rand ≥ 0.5, choose the parabolic foraging strategy, calculated as follows:
[0060]
[0061] In equation (8), TF is a random number of -1 or 1, which determines the development direction of the population; p 2 The key parameter that adapts to the number of iterations determines the extent of population development.
[0062] Step 3.4: Check if the current iteration number t is less than the maximum iteration number t. max If the current iteration number t is less than the maximum iteration number t max If the current iteration number t equals the maximum iteration number t, return to step 3.2 to continue iterative updates; max At that time, the optimal combination of key hyperparameters of the improved GRU model is output to the Bi-GRU layer to obtain the improved GRU optimization model.
[0063] Step 4: Input the test set into the improved GRU optimization model to obtain the predicted value of the gas content data at the next time step.
[0064] To verify the predictive performance of the improved GRU optimization model of the present invention, this embodiment uses the model of the present invention, GRU, and long short-term memory neural network to predict seven characteristic gases dissolved in transformer oil. By comparison, the predictive accuracy and reliability of the model of the present invention are verified.
[0065] To ensure the validity of the experiment, this embodiment uses actual monitoring data obtained from an online transformer monitoring device. The data collection period was from November 7, 2013 to October 25, 2014, with an 8-hour collection period, totaling 1050 sets of data. The gas volume fraction unit is 10. -6 The data was collected from November 7, 2013 to August 16, 2014, and used as training samples. The data collected from August 17, 2014 to October 25, 2014 was used as test samples. The experimental conditions for the comparative model were consistent with those for the model of this invention.
[0066] To accurately evaluate the model's predictive performance, this embodiment uses the Mean Absolute Percentage Error (MAPE) to assess its predictive performance. MAPE characterizes the accuracy of the model's predictions; the smaller the value, the more accurate the prediction. The calculation formula is as follows:
[0067]
[0068] In equation (9), y MAPE The mean absolute percentage error of the data; n is the number of data samples; and y i These are the predicted and actual values of the dissolved gas content in the oil at time i, respectively.
[0069] The three models—the model of this invention, GRU, and long short-term memory neural network—were used to predict the content of seven characteristic gases dissolved in transformer oil. The MAPE obtained by predicting the test samples after the three models were trained is shown in Table 1. The results are retained to three decimal places.
[0070] Table 1
[0071]
[0072] As shown in Table 1, the prediction errors of GRU for all seven characteristic gases are smaller than those of the Long Short-Term Memory Neural Network (LSTM), which fully demonstrates the effectiveness of the improvement of GRU compared to LSTM. The prediction errors of the model in this invention for all seven characteristic gases are also smaller than those of GRU, fully demonstrating that the improvements to GRU in this invention can effectively improve the model's prediction performance. A comparison of the three models shows that the model in this invention has the lowest prediction errors for all seven characteristic gases. The prediction error for CO is the smallest, with a MAPE of only 0.642%; the prediction error for C2H2 is the largest, with a MAPE of 8.209%. This fully demonstrates that the improvements to GRU in the model in this invention are beneficial for better tracking the changing trends of gas content, thus obtaining more accurate prediction results.
[0073] In this embodiment, the above three prediction models were also used to predict the content of seven characteristic gases dissolved in the transformer oil of a transformer at 3:00 on October 25, 2014. The prediction results and the actual monitoring values are shown in Table 2. The results are retained to one decimal place.
[0074] Table 2
[0075]
[0076]
[0077] As can be seen from Table 2, compared with GRU and Long Short-Term Memory Neural Network, the predicted value of the model of the present invention is closest to the true value in the next time step. The predicted value of C2H2 is even consistent with the true value, achieving good prediction results and further proving the prediction accuracy and reliability of the model of the present invention.
[0078] Any aspects not covered in this invention are applicable to existing technologies.
Claims
1. A method for predicting dissolved gas content in transformer oil based on improved GRU, characterized in that, The method includes the following steps: Step 1: Normalize the dissolved gas content data in transformer oil, and divide the normalized gas content data into training set and test set; Step 2: Construct the improved GRU model; the improved GRU model includes an Input layer, a Conv1D layer, a Bi-GRU layer, a Dense layer, and an Output layer; The output of the Input layer is connected to the input of the Conv1D layer, the output of the Conv1D layer is connected to the input of the Bi-GRU layer, the output of the Bi-GRU layer is connected to the input of the Dense layer, and the output of the Dense layer is connected to the input of the Output layer. The Input layer is used to input the training and test sets from step 1; the Conv1D layer extracts features from the training and test sets through convolution calculations; the Bi-GRU layer is used to learn the changing patterns of the training and test sets and make predictions; the Dense layer is used to compress the training and test set data and simplify the network parameters; the Output layer is used to output the prediction results. Step 3: Input the training set into the improved GRU model for network training, and use the tuna algorithm to iteratively search the key hyperparameters of the improved GRU model to obtain the improved GRU optimized model. Step 4: Input the test set into the improved GRU optimization model to obtain the predicted value of the gas content data at the next time step.
2. The improved GRU-based transformer dissolved gas-in-oil content prediction method of claim 1, wherein, In step 1, the normalization process uses Min-Max normalization. Specifically, the content data of n gases of length l are denoted as follows: The normalized gas content data obtained after normalization is The calculation formula is as follows: In formula (1), y is the normalized gas content data; x is the original gas content data; x max is the maximum data in the original gas content data; x min is the minimum data in the original gas content data.
3. The improved GRU-based transformer dissolved gas-in-oil content prediction method of claim 1, wherein, In step 1, the ratio of the training set to the test set is 4:
1.
4. The improved GRU-based transformer dissolved gas-in-oil content prediction method of claim 1, wherein, In step 2, the calculation formula for the Conv1D layer is as follows: H i = f(H i-1 * W i + b i ) (2) In formula (2), H i is an eigenvector; " *” is a convolution operation; W i is a weight vector; b i is a bias parameter.
5. The improved GRU-based transformer dissolved gas-in-oil content prediction method of claim 1, wherein, In step 2, the specific steps of the Bi-GRU layer are as follows: S2.1, learn forward information and backward information of the training set and the test set respectively by a pair of forward and backward GRUs and output prediction results r respectively t and z t , the calculation formula is shown in formula (3): In equation (3), r t The state of the gate is updated at time t; σ is the sigmoid activation function; W r To update the weight matrix of the gate; h t-1 Let x be the candidate hidden state at time t-1; t b is the input value at time t; r To update the gate bias; z t The state of the door is reset at time t; W z b is the weight matrix for resetting the gate; z To reset the door offset; S2.2, fuse the prediction results of the two GRUs respectively to obtain the final result y t The calculation formula is shown as formula (4): In formula (4), is the candidate state at time t; tanh is the hyperbolic tangent activation function; W h is a weight matrix for the candidate state; h t is the hidden state at time t; I is the identity matrix; y t W is the output value at time t. o This is the weight matrix of the output gate.
6. The improved GRU-based transformer dissolved gas-in-oil content prediction method of claim 1, wherein, In step 3, the key hyperparameters of the improved GRU model are the maximum number of iterations, the initial learning rate, and the number of hidden layer neurons.
7. The method for predicting dissolved gas content in transformer oil based on an improved GRU according to claim 1, characterized in that, In step 3, the specific steps for iteratively searching for the key hyperparameters of the improved GRU model using the tuna algorithm are as follows: Step 3.1: Randomly initialize the tuna population; Step 3.2: Calculate the fitness of individual tuna; Step 3.3: The tuna population carrying optimization variable information updates its position by selecting a foraging strategy, thereby achieving iterative search for the key hyperparameters of the improved GRU model; Step 3.4, check if the current iteration number t is less than the maximum iteration number t max ; If the current iteration number t is less than the maximum iteration number t max , return to step 3.2 to continue iteration update. If the current iteration number t is equal to the maximum iteration number t max When the current iteration number t is equal to the maximum iteration number t max When the current iteration number t is equal to the maximum iteration number t 8. The improved GRU-based transformer dissolved gas-in-oil content prediction method of claim 7, wherein, In step 3.1, the optimization process begins by randomly and uniformly generating an initial tuna population in the search space, calculated using the following formula: In formula (5), is the ith initial individual; rand is a random vector uniformly distributed from 0 to 1; ub and Ib are the upper and lower limits of the search space; and NP is the number of tuna populations.
9. The improved GRU-based transformer dissolved gas-in-oil content prediction method of claim 7, wherein, In step 3.2, the formula for calculating the fitness of individual tuna is as follows: In equation (6), Fitness(X) t () represents the fitness value of an individual tuna; N is the number of training samples; is the predicted output value of dissolved gas content in transformer oil; X t is the actual value of dissolved gas content in transformer oil.
10. The method for predicting dissolved gas content in transformer oil based on an improved GRU according to claim 7, characterized in that, Step 3.3 specifically involves: S3.3.
1. Generate a random number rand between [0,1]. S3.3.2 If rand < 0.5, select the spiral foraging strategy. The calculation formula is as follows: In formula (7), is the position of the i-th individual after the (t+1)-th iteration; t is the current iteration number; t max is the maximum number of iterations; N is the population size; and are the current best individual position and random individual position, respectively; a1and a2are weight coefficients that control the movement of the random individual towards the best individual and the previous individual; and β is a development parameter related to the best individual or the random individual. If rand ≥ 0.5, choose the parabolic foraging strategy, calculated as follows: In formula (8), TF is a random number of -1 or 1, which determines the development direction of the population; p 2 is a key parameter that changes adaptively with the iteration number, and determines the development amplitude of the population.
Citation Information
Patent Citations
Transformer fault diagnosis method based on analysis of dissolved gas in oil in GRU network
CN115169438A
Deep parallel fault diagnosis method and system for dissolved gas in transformer oil
US20210278478A1