Power transformer temperature prediction method based on unbalanced perception contrast learning
By introducing unbalanced perception learning and trends in the temperature prediction model of the power transformer-seasonal characteristic learning device, the problem of difficulty in identifying the existing models is difficult to identify the problem of minority samples, and the high-precision prediction and power system of the temperature transformer temperature data and the power system Increase stability.
Patent Information
- Application Number
- CN202411346427.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-24
AI Technical Summary
The existing power transformer temperature prediction model is difficult to identify a few types of samples and ignore key data, resulting in a degradation of prediction performance and affecting the stability of the power system.
Using the method of unbalanced perception comparison learning, through the combination of trend-seasonal characteristic learning device and MLP network, combined with multiple causal convolutional layers, average pooling technology, and learned discrete Fourier transformation, capture the temperature data of the power transformer The key internal features, and use unbalanced perception to compare the loss function to optimize the model parameters.
It significantly improves the high -precision prediction capabilities of the temperature data of the power transformer, enhances the predictive accuracy of a small number of samples, and at the same time ensures the accuracy of the prediction of most samples, and realizes the overall improvement of the temperature predictive performance of the power transformer.
Smart Images

Figure CN119357660A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a power transformer temperature prediction method based on unbalanced perception contrast learning, and belongs to the field of power system monitoring. Background Art
[0002] With the rapid development of society, electric energy has gradually become an indispensable resource in life. Its portability and easy-to-convert energy form make it unique among many energy sources, which further increases the requirements for the overall power supply and reliability of the power system. At present, how to balance the growing demand for electricity with a robust, real-time and sufficient power supply has become a key issue that the power system needs to solve urgently. As a vital component of power transmission, transformers are not only used to increase voltage to transmit electricity to the power supply area, but also to reduce voltage to meet the power demand at all levels. Therefore, proper protection and effective control of transformers are particularly important. The thermal performance of transformers is an important indicator to ensure their safe operation, which is usually evaluated by oil temperature. The study of oil temperature is the key to mastering the important characteristics of transformers, and its easy access makes it one of the important parameters affecting the performance of power transformers. Compared with other parameters, oil temperature monitoring is more accurate. Therefore, by establishing a model based on historical oil temperature time series data, accurate prediction of future oil temperature changes can help avoid local overheating and make reasonable inferences about the operating status of transformers. These predictions can provide appropriate planning suggestions for future power distribution and transformer use, which is of great significance for the protection and effective use of electric energy.
[0003] At present, the prediction research on power transformer temperature data has been very extensive. Traditional methods such as the autoregressive integrated moving average model can provide relatively accurate predictions under certain conditions. However, this method is often based on strict mathematical assumptions and has limited ability to capture the nonlinear characteristics and complex patterns of power transformer temperature data. With the rise of deep learning technology, neural network-based models, such as long short-term memory networks and gated recurrent units, have gradually become the mainstream methods for solving power transformer temperature prediction problems due to their cyclic chain structure and the presence of some special structures in the gate unit content for memorizing historical information. In addition, the Transformer architecture, with its multi-head self-attention mechanism, performs well in dealing with long-distance dependency problems, further promoting the development of prediction technology.
[0004] In the existing technology, power transformer temperature prediction faces several key challenges, which put higher requirements on the accuracy and reliability of prediction methods. First, the temperature data of power transformers show significant dynamic characteristics over time, including trends and seasonal fluctuations. These complex time series patterns require prediction methods to not only capture the trend characteristics of the data, but also understand and adapt to the impact of seasonal changes. Second, the temperature data of power transformers may suddenly change dramatically, which is beyond the normal fluctuation range and is usually triggered by emergencies or other unknown factors. Although these changes do not occur often, they pose a potential negative impact on the stability of the power system. Existing prediction methods often fail to pay enough attention to these rare but critical data, resulting in a decline in prediction performance in these cases, which in turn affects the overall prediction accuracy. Summary of the invention
[0005] The purpose of the present invention is to provide a method for predicting the temperature of a power transformer based on unbalanced perception contrast learning, which can solve the problem that the existing model is difficult to identify minority class samples and ignores key data, improve the generalization ability of model data and realize high-precision prediction of the temperature data of the power transformer, and provide real-time and effective reference for handling transformer emergencies and faults.
[0006] In order to solve the above technical problems, the present invention is implemented by adopting the following technical solutions.
[0007] A method for predicting power transformer temperature based on unbalance-aware contrastive learning, comprising:
[0008] Get power transformer temperature data;
[0009] Performing z-score normalization processing on the power transformer temperature data to obtain normalized power transformer temperature data;
[0010] The normalized power transformer temperature data is segmented based on the sliding window strategy to obtain time series data of fixed length;
[0011] Divide the time series data of fixed length into training sample set and test sample set;
[0012] The training sample set is imported into the power transformer temperature prediction model based on trend-seasonal feature learning and MLP network for feature learning and prediction, and the learned trend feature representation, seasonal feature representation and power transformer temperature prediction results are obtained;
[0013] The learned trend feature representation and seasonal feature representation are calculated according to the imbalance-aware contrastive learning algorithm to obtain the imbalance-aware contrastive loss of the trend feature and the seasonal feature;
[0014] The predicted results of the power transformer temperature are calculated based on the actual data of the power transformer temperature, and the mean square error loss of the difference between the predicted results and the actual data is obtained;
[0015] The total loss value is obtained by weighted summing the mean square error loss of the difference between the predicted result and the true data and the imbalanced perceptual contrast loss of the trend feature and seasonal feature;
[0016] Back propagation and parameter optimization are performed according to the total loss value to obtain an updated power transformer temperature prediction model;
[0017] The updated power transformer temperature prediction model is evaluated using the test set to obtain the power transformer temperature prediction model with the best performance;
[0018] Based on the power transformer temperature prediction model with the best performance, the power transformer temperature is predicted in real time to obtain the future prediction results of the power transformer temperature, which is used to identify abnormal or sudden events of the power transformer temperature.
[0019] Optionally, the expression for z-score normalization of the power transformer temperature data is:
[0020] (1)
[0021] In the formula, is the normalized power transformer temperature data, is the power transformer temperature data, is the mean function, is the standard deviation function.
[0022] Optionally, the method of segmenting the normalized power transformer temperature data based on the sliding window strategy to obtain time series data of fixed length includes:
[0023] Initialize the extraction window, where the historical time series length of the power transformer temperature data is preset , predict the length of the time series and sliding step length , and the length of the extraction window is ;
[0024] Based on the initialized extraction window, the normalized power transformer temperature data is extracted to obtain the data sequence that satisfies the first extraction window; wherein, the first extraction window contains Historical time series and A forecast time series;
[0025] Extract the front The historical time series is used as the input sequence, and then The predicted time series are used as the output sequence to form a single time series sample, and the step size is Slide backward to gradually generate a fixed-length time series dataset.
[0026] Optionally, the time series data of fixed length is divided to obtain a training sample set and a test sample set;
[0027] The fixed-length time series data set is divided into 80% and 20% ratios to obtain the training sample set and the test sample set.
[0028] Optionally, the training sample set is imported into a power transformer temperature prediction model based on trend-seasonal feature learning and MLP network for feature learning and prediction, and a method for obtaining learned trend feature representation, seasonal feature representation and power transformer temperature prediction results includes:
[0029] Based on the trend-seasonal feature learner, feature representation learning is performed on the training sample set to obtain the learned trend feature representation and seasonal feature representation;
[0030] Based on the multi-layer perceptron MLP network, the trend feature representation and seasonal feature representation are spliced to obtain the power transformer temperature prediction result.
[0031] Optionally, a method of performing feature representation learning on a training sample set based on a trend-seasonal feature learner to obtain learned trend feature representation and seasonal feature representation includes:
[0032] The Transformer encoder is used to linearly transform the training sample set and embed the position encoding information to obtain the potential representation of the corresponding Transformer encoder latent space;
[0033] According to the Transformer encoder, the potential representation is transferred and fused to obtain the intermediate feature representation;
[0034] Inputting the intermediate feature representation into the trend feature extractor and the seasonal feature extractor respectively to obtain the learned trend feature representation and seasonal feature representation;
[0035] Among them, the calculation expression for obtaining the potential representation of the corresponding Transformer encoder latent space is:
[0036] (2)
[0037] In the formula, For potential representation, is the input sequence of training samples, is the weight matrix of the linear transformation, Indicates position encoding information.
[0038] Optionally, the Transformer encoder is provided with three layers, each layer is composed of a multi-head attention sublayer and a feedforward neural network sublayer, and after each sublayer, residual connection and layer normalization processing are applied to ensure the effectiveness and feature extraction capability of the deep network during the training process;
[0039] Among them, the calculation expression of the multi-head attention sub-layer is:
[0040] (3)
[0041] (4)
[0042] (5)
[0043] (6)
[0044] (7)
[0045] In the formula, are all learnable parameter matrices, matrices representing queries, keys, and values, respectively, For the matrix The transpose of represents the dimension of the key, It is The output of an attention head is is the total number of heads, is another learnable parameter matrix used to merge the outputs of multiple heads;
[0046] The calculation expression of the feedforward neural network sublayer is:
[0047] (8)
[0048] In the formula, is the weight matrix, is the bias term, Represents the output of the previous layer.
[0049] Optionally, the method of inputting the intermediate feature representation into the trend feature extractor to obtain the learned trend feature representation includes:
[0050] Use multi-layer causal convolution operations on the intermediate feature representation to obtain the results of multi-layer causal convolution;
[0051] Perform average pooling on the results of multi-layer causal convolution to obtain the learned trend feature representation;
[0052] Among them, the expression for obtaining the result of multi-layer causal convolution is:
[0053] (9)
[0054] In the formula, is the intermediate feature representation, is the causal convolution operation, Indicates The result of the convolution is The maximum exponent representing the convolution filter size;
[0055] The expression for obtaining the learned trend feature representation is:
[0056] (10)
[0057] In the formula, is the average pooling operation, It is a trend feature.
[0058] Optionally, the intermediate feature representation is input into a seasonal feature extractor to obtain a learned seasonal feature representation, including:
[0059] The intermediate feature representation is converted from the time domain to the frequency domain based on the discrete Fourier transform function to obtain the frequency domain data of the intermediate feature representation;
[0060] Performing an affine transformation on each frequency component of the frequency domain data represented by the intermediate feature to obtain an intermediate feature representation that independently applies the frequency domain interaction;
[0061] The intermediate feature representation of the frequency domain interaction is transformed into the time domain according to the inverse discrete Fourier transform to obtain the seasonal feature representation;
[0062] Among them, the expression for obtaining seasonal characteristics is:
[0063] (11)
[0064] In the formula, is the seasonal characteristic. and are the parameters of the learnable Fourier transform layer, is a learnable discrete Fourier transform function, is the inverse discrete Fourier transform function.
[0065] Optionally, the method of obtaining the power transformer temperature prediction result by splicing the trend feature representation and the seasonal feature representation based on the multi-layer perceptron MLP network includes:
[0066] Based on the time axis, the trend feature representation and the seasonal feature representation are aligned to obtain the aligned trend feature representation and the seasonal feature representation;
[0067] The aligned trend feature representation and seasonal feature representation are concatenated along the feature dimension in the form of a feature matrix to obtain a concatenated feature matrix;
[0068] Extract the feature vector at the last time step from the concatenated feature matrix;
[0069] The feature vector at the last time step is input into the multi-layer perceptron MLP network for prediction to generate the power transformer temperature prediction result.
[0070] Optionally, a method of calculating the learned trend feature representation and seasonal feature representation according to the imbalance-aware contrastive learning algorithm to obtain the imbalance-aware contrastive loss of the trend feature and the seasonal feature includes:
[0071] Calculate the index difference of the training sample set to obtain the input-output difference index of each sample;
[0072] The learned trend feature representation and input-output difference index are calculated according to the imbalance-aware contrast loss function to obtain the time-domain imbalance-aware contrast loss;
[0073] Perform discrete Fourier transform on the learned seasonal feature representation to obtain the phase and amplitude in the frequency domain;
[0074] The phase and amplitude in the frequency domain and the input-output difference index are calculated according to the imbalanced perception contrast loss function to obtain the frequency domain imbalanced perception contrast loss;
[0075] The time domain imbalanced perceptual contrast loss and the frequency domain imbalanced perceptual contrast loss are accumulated and summed to obtain the final imbalanced perceptual contrast loss;
[0076] Among them, the expression for obtaining the input-output difference index of each sample is:
[0077] (12)
[0078] In the formula, The input-output difference index IOD value for each sample, For the The input sequence of training samples is For the The output sequence of training samples is is the input sequence length, is the output sequence length, is the average value, is the variance;
[0079] The expression for obtaining the temporal imbalance perceptual contrast loss is:
[0080] (13)
[0081] In the formula, is the temporal imbalance perceptual contrast loss, , and Respectively , and The trend characteristics of training samples are expressed as follows: , and Respectively , and The input-output difference index IOD value of the training sample, is the temperature parameter, is the indicator function, is the cosine similarity of two features, represents the size of the training sample set, represents the exponential function;
[0082] The expression for obtaining the frequency domain imbalance perceptual contrast loss is:
[0083] (14)
[0084] (15)
[0085] (16)
[0086] In the formula, , and Respectively represent , and The seasonal feature representation of training samples is Represents discrete Fourier transform, and the resulting frequency domain features are expressed in complex form, including two attributes: amplitude and phase. is the amplitude represented by the frequency domain feature, is the phase represented by the frequency domain feature, and Represent the contrast loss based on amplitude and phase respectively, It is the frequency domain imbalance perceptual contrast loss;
[0087] The expression of the final imbalanced perceptual contrast loss is obtained as:
[0088] (17)
[0089] In the formula, is the final imbalance-aware contrast loss.
[0090] Optionally, the mean square error loss of the difference between the predicted result and the true data and the imbalance-aware contrast loss of the trend feature and the seasonal feature are weighted summed to obtain the total loss value:
[0091] (18)
[0092] In the formula, is the total loss, is the mean square error loss, is the imbalanced perceptual contrast loss, To balance the hyperparameters.
[0093] Optionally, the method of performing back propagation and parameter optimization according to the total loss value to obtain an updated power transformer temperature prediction model includes:
[0094] The Adam optimizer is used to back-propagate the total loss value until the total loss value tends to be stable or reaches the preset number of training times, and the weight gradient of the power transformer temperature prediction model is output;
[0095] The model parameters of the power transformer temperature prediction model are updated according to the weight gradient of the power transformer temperature prediction model to obtain an updated power transformer temperature prediction model.
[0096] Compared with the prior art, the present invention has the following beneficial effects:
[0097] 1. The present invention adopts trend-seasonal feature learner and MLP network to construct a power transformer temperature prediction model, and combines the power transformer temperature historical data to perform deep learning of trend season and other potential factors of the power transformer temperature; then uses the imbalance-aware contrast loss function and optimizer to optimize the model parameters to avoid the model's difficulty in identifying minority class samples and improve data generalization ability, thereby achieving high-precision prediction of the temperature data of the power transformer and providing real-time and effective reference for handling transformer emergencies and failures.
[0098] 2. The present invention adopts a trend-seasonal feature learner, combined with multiple causal convolutional layers, average pooling technology and learnable discrete Fourier transform, to effectively capture the key intrinsic characteristics of power transformer temperature data. This method can adaptively identify trends and seasonal changes in data, providing a more accurate data feature representation for power transformer temperature prediction.
[0099] 3. The present invention uses an imbalance-aware contrastive learning algorithm to further optimize the trend feature representation and seasonal feature representation. The algorithm promotes knowledge information sharing between samples with similar prediction difficulty by bringing them closer in the feature space. This allows the minority class samples affected by the mutation to learn more prediction features, thereby significantly improving the prediction accuracy of these samples.
[0100] 4. The method of the present invention not only enhances the prediction accuracy for minority class samples, but also ensures that the prediction accuracy for majority class samples is maintained at a high level, thereby achieving an overall improvement in the prediction performance of power transformer temperature. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] Figure 1 It is a flow chart of the power transformer temperature prediction method based on unbalanced perception comparative learning of the present invention;
[0102] Figure 2 It is a structural block diagram of a power transformer temperature prediction method based on unbalanced perception comparative learning of the present invention;
[0103] Figure 3 Schematic diagram of temperature data distribution of four types of power transformers in an embodiment of the present invention;
[0104] Figure 4 A comparison chart of power transformer temperature prediction results in an embodiment of the present invention;
[0105] Figure 5 Graph showing power transformer temperature prediction results on samples of different difficulty levels according to an embodiment of the present invention. DETAILED DESCRIPTION
[0106] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0107] Example 1
[0108] This embodiment provides a method for predicting the temperature of a power transformer based on unbalanced perception contrast learning. Figure 1 and Figure 2 include:
[0109] S1: Obtain power transformer temperature data;
[0110] S2: performing z-score normalization processing on the power transformer temperature data to obtain normalized power transformer temperature data;
[0111] S3: Segment the normalized power transformer temperature data based on the sliding window strategy to obtain time series data of fixed length;
[0112] S4: Divide the time series data of fixed length into training sample sets and test sample sets;
[0113] S5: importing the training sample set into the power transformer temperature prediction model based on trend-seasonal feature learning and MLP network for feature learning and prediction, and obtaining the learned trend feature representation, seasonal feature representation and power transformer temperature prediction results;
[0114] S6: Calculate the learned trend feature representation and seasonal feature representation according to the imbalance-aware contrastive learning algorithm to obtain the imbalance-aware contrastive loss of the trend feature and the seasonal feature;
[0115] S7: Calculate the predicted result of the power transformer temperature based on the real data of the power transformer temperature to obtain the mean square error loss of the difference between the predicted result and the real data;
[0116] S8: Perform weighted summation of the mean square error loss of the difference between the predicted result and the true data and the imbalance-aware contrast loss of the trend feature and the seasonal feature to obtain the total loss value;
[0117] S9: Perform back propagation and parameter optimization according to the total loss value to obtain an updated power transformer temperature prediction model;
[0118] S10: using the test set to evaluate the updated power transformer temperature prediction model, and obtaining the power transformer temperature prediction model with the best performance;
[0119] S11: Based on the power transformer temperature prediction model with the best performance, the power transformer temperature is predicted in real time to obtain the future prediction result of the power transformer temperature, which is used to identify abnormal or sudden events of the power transformer temperature.
[0120] Optionally, the expression for z-score normalization of the power transformer temperature data in S2 is:
[0121] (1)
[0122] In the formula, is the normalized power transformer temperature data, is the power transformer temperature data, is the mean function, is the standard deviation function.
[0123] Optionally, in S3, the method of segmenting the normalized power transformer temperature data based on the sliding window strategy to obtain time series data of fixed length includes:
[0124] S3.1: Initialize the extraction window, where the historical time series length of the power transformer temperature data is preset , predict the length of the time series and sliding step length , and the length of the extraction window is ;
[0125] S3.2: Extract the normalized power transformer temperature data based on the initialized extraction window to obtain a data sequence that satisfies the first extraction window; wherein the first extraction window contains Historical time series and A forecast time series;
[0126] S3.3: Extract the front part of the window The historical time series is used as the input sequence, and then The predicted time series are used as the output sequence to form a single time series sample, and the step size is Slide backward to gradually generate a fixed-length time series dataset.
[0127] Optionally, the method of dividing the time series data of fixed length in S4 to obtain the training sample set and the test sample set is further as follows:
[0128] The fixed-length time series data set is divided into 80% and 20% ratios to obtain the training sample set and the test sample set.
[0129] Optionally, in S5, the training sample set is imported into a power transformer temperature prediction model based on trend-seasonal feature learning and MLP network for feature learning and prediction, and the method for obtaining the learned trend feature representation, seasonal feature representation and power transformer temperature prediction result includes:
[0130] S5.1: Perform feature representation learning on the training sample set based on the trend-seasonality feature learner to obtain the learned trend feature representation and seasonality feature representation;
[0131] S5.2: Based on the multi-layer perceptron MLP network, the trend feature representation and seasonal feature representation are spliced to obtain the power transformer temperature prediction result.
[0132] Optionally, in S5.1, the method of performing feature representation learning on the training sample set based on the trend-seasonality feature learner to obtain the learned trend feature representation and seasonality feature representation includes:
[0133] S5.11: Use the Transformer encoder to perform linear transformation on the training sample set and embed the position encoding information to obtain the latent representation of the corresponding Transformer encoder latent space;
[0134] S5.12: Perform feature transfer and fusion on the latent representation according to the Transformer encoder to obtain an intermediate feature representation;
[0135] S5.13: inputting the intermediate feature representation into the trend feature extractor and the seasonal feature extractor respectively to obtain the learned trend feature representation and seasonal feature representation;
[0136] Among them, the calculation expression for obtaining the potential representation of the corresponding Transformer encoder latent space is:
[0137] (2)
[0138] In the formula, For potential representation, is the input sequence of training samples, is the weight matrix of the linear transformation, Indicates position encoding information.
[0139] Optionally, the Transformer encoder is provided with three layers, each layer is composed of a multi-head attention sublayer and a feedforward neural network sublayer, and after each sublayer, residual connection and layer normalization processing are applied to ensure the effectiveness and feature extraction capability of the deep network during the training process;
[0140] Among them, the calculation expression of the multi-head attention sub-layer is:
[0141] (3)
[0142] (4)
[0143] (5)
[0144] (6)
[0145] (7)
[0146] In the formula, are all learnable parameter matrices, matrices representing queries, keys, and values, respectively, For the matrix The transpose of represents the dimension of the key, It is The output of an attention head is is the total number of heads, is another learnable parameter matrix used to merge the outputs of multiple heads;
[0147] The calculation expression of the feedforward neural network sublayer is:
[0148] (8)
[0149] In the formula, is the weight matrix, is the bias term, Represents the output of the previous layer.
[0150] Optionally, in S5.13, the method of inputting the intermediate feature representation into the trend feature extractor to obtain the learned trend feature representation includes:
[0151] Use multi-layer causal convolution operations on the intermediate feature representation to obtain the results of multi-layer causal convolution;
[0152] Perform average pooling on the results of multi-layer causal convolution to obtain the learned trend feature representation;
[0153] Among them, the expression for obtaining the result of multi-layer causal convolution is:
[0154] (9)
[0155] In the formula, is the intermediate feature representation, is the causal convolution operation, Indicates The result of the convolution is The maximum exponent representing the convolution filter size;
[0156] The expression for obtaining the learned trend feature representation is:
[0157] (10)
[0158] In the formula, is the average pooling operation, It is a trend feature.
[0159] Optionally, in S5.13, the method of inputting the intermediate feature representation into the seasonal feature extractor to obtain the learned seasonal feature representation includes:
[0160] The intermediate feature representation is converted from the time domain to the frequency domain based on the discrete Fourier transform function to obtain the frequency domain data of the intermediate feature representation;
[0161] Performing an affine transformation on each frequency component of the frequency domain data represented by the intermediate feature to obtain an intermediate feature representation that independently applies the frequency domain interaction;
[0162] The intermediate feature representation of the frequency domain interaction is transformed into the time domain according to the inverse discrete Fourier transform to obtain the seasonal feature representation;
[0163] Among them, the expression for obtaining seasonal characteristics is:
[0164] (11)
[0165] In the formula, is the seasonal characteristic. and are the parameters of the learnable Fourier transform layer, is a learnable discrete Fourier transform function, is the inverse discrete Fourier transform function.
[0166] Optionally, in S5.2, the method of combining the trend feature representation and the seasonal feature representation based on the multi-layer perceptron MLP network to obtain the power transformer temperature prediction result includes:
[0167] S5.21: Align the trend feature representation and the seasonal feature representation based on the time axis to obtain the aligned trend feature representation and the seasonal feature representation;
[0168] S5.22: The aligned trend feature representation and seasonal feature representation are concatenated along the feature dimension in the form of a feature matrix to obtain a concatenated feature matrix;
[0169] S5.23: Extract the feature vector at the last time step from the concatenated feature matrix;
[0170] S5.24: Input the feature vector at the last time step into the multi-layer perceptron MLP network for prediction to generate the power transformer temperature prediction result.
[0171] Optionally, in S6, the method of calculating the learned trend feature representation and seasonal feature representation according to the imbalance-aware contrast learning algorithm to obtain the imbalance-aware contrast loss of the trend feature and the seasonal feature includes:
[0172] S6.1: Calculate the index difference of the training sample set to obtain the input-output difference index of each sample;
[0173] S6.2: Calculate the learned trend feature representation and input-output difference index according to the imbalance-aware contrast loss function to obtain the time-domain imbalance-aware contrast loss;
[0174] S6.3: Perform discrete Fourier transform on the learned seasonal feature representation to obtain the phase and amplitude in the frequency domain;
[0175] S6.4: Calculate the phase and amplitude in the frequency domain and the input-output difference index according to the imbalanced perception contrast loss function to obtain the frequency domain imbalanced perception contrast loss;
[0176] S6.5: Accumulate and sum the time domain imbalance perceptual contrast loss and the frequency domain imbalance perceptual contrast loss to obtain a final imbalance perceptual contrast loss;
[0177] Among them, the expression for obtaining the input-output difference index of each sample is:
[0178] (12)
[0179] In the formula, The input-output difference index IOD value for each sample, For the The input sequence of training samples is For the The output sequence of training samples is is the input sequence length, is the output sequence length, is the average value, is the variance;
[0180] The expression for obtaining the temporal imbalance perceptual contrast loss is:
[0181] (13)
[0182] In the formula, is the temporal imbalance perceptual contrast loss, , and Respectively , and The trend characteristics of training samples are expressed as follows: , and Respectively , and The input-output difference index IOD value of the training sample, is the temperature parameter, is the indicator function, is the cosine similarity of two features, represents the size of the training sample set, represents the exponential function;
[0183] The expression for obtaining the frequency domain imbalance perceptual contrast loss is:
[0184] (14)
[0185] (15)
[0186] (16)
[0187] In the formula, , and Respectively represent , and The seasonal feature representation of training samples is Represents discrete Fourier transform, and the resulting frequency domain features are expressed in complex form, including two attributes: amplitude and phase. is the amplitude represented by the frequency domain feature, is the phase represented by the frequency domain feature, and Represent the contrast loss based on amplitude and phase respectively, It is the frequency domain imbalance perceptual contrast loss;
[0188] The expression of the final imbalanced perceptual contrast loss is obtained as:
[0189] (17)
[0190] In the formula, is the final imbalance-aware contrast loss.
[0191] Optionally, in S8, a weighted sum is performed on the mean square error loss of the difference between the prediction result and the true data and the imbalance-aware contrast loss of the trend feature and the seasonal feature to obtain an expression for the total loss value:
[0192] (18)
[0193] In the formula, is the total loss, is the mean square error loss, is the imbalanced perceptual contrast loss, To balance the hyperparameters.
[0194] Optionally, the method of performing back propagation and parameter optimization according to the total loss value in S9 to obtain an updated power transformer temperature prediction model includes:
[0195] S9.1: Use the Adam optimizer to back-propagate the total loss value until the total loss value tends to be stable or reaches the preset number of training times, and then output the weight gradient of the power transformer temperature prediction model;
[0196] S9.2: Update the model parameters of the power transformer temperature prediction model according to the weight gradient of the power transformer temperature prediction model to obtain an updated power transformer temperature prediction model.
[0197] Combination Figure 3To further illustrate the present invention, an embodiment of the present invention adopts a widely used power transformer temperature dataset (ETT), which is collected from power transformers in two different regions, marked as region 1 and region 1, respectively. The data of each region is recorded at two different time granularities, namely, hourly (h) and 15-minute (m), thereby forming four transformer temperature datasets with different time granularities and regional characteristics, respectively named ETTh1, ETTh2, ETTm1 and ETTm2; Figure 3 As shown in the figure, a distribution diagram of the temperature data of the four power transformers is shown. The horizontal axis is the sample prediction difficulty of the power transformer temperature data approximated by the IOD value, the vertical axis corresponding to the histogram is the number of samples, and the vertical axis corresponding to the curve is the prediction error of the autoregressive model in different prediction difficulty intervals. Figure 3 The imbalance of data distribution is revealed: as the difficulty of the sample increases, the number of samples decreases, while the prediction error increases significantly. Although the autoregressive model can give relatively accurate predictions when processing most transformer temperature data samples, it does not work well when faced with a few more challenging samples that require more complex modeling. These samples usually have significant temporal pattern changes, so that the periodicity or trend of the input sequence is no longer continued in the output sequence, thereby increasing the complexity of the prediction.
[0198] The embodiment of the present invention adopts python software, version number is: python3.8, pytorch2.2, running software environment: windows10, hardware configuration: processor Intel(R) Core(TM) i7-14700KF, 3.40GHz, memory 32G RAM, graphics card NVIDIA RTX 4070 Ti Super.
[0199] The parameter configuration of the embodiment of the present invention is as follows:
[0200] Batch size: 128; Learning rate: 0.01; Optimizer: trained using ADAM optimizer; Number of Transformer encoder layers: ; Number of Transformer encoder heads: ; Transformer latent space dimensions: ; Dimensions for representing trend and seasonal characteristics: ; Historical sequence length of power transformer temperature data: ; Sliding step length: ; Prediction sequence length: Adjust according to different experimental conditions, see the experimental results for details; Weighing hyperparameters: Select from {1, 5E-01, 1E-01, 5E-02, 1E-02, 5E-03}; Number of training iterations: 100 times.
[0201] The present invention and MICN, CoST, TS2Vec, FEDformer, Autoformer, and Informer are respectively used to predict the temperature data of the four power transformers (ETTh1, ETTh2, ETTm1, and ETTm2) in the embodiment. The mean square error (MSE) and mean absolute error (MAE) of the prediction results are shown as follows: Figure 4 As shown in Table 1.
[0202] from Figure 4 As shown in Table 1, the method of the present invention performs well on four power transformer temperature data sets for different prediction sequence lengths, and is significantly better than all other control methods.
[0203] In order to comprehensively evaluate the prediction performance of the method of the present invention when dealing with minority class samples with higher prediction difficulty, the present invention specifically compares the average prediction performance under different prediction lengths for the top 3%, top 2% and top 1% power transformer temperature data samples with the highest prediction difficulty in each data set. At the same time, in order to provide a comprehensive perspective, the experimental results also include the average prediction performance evaluation of all samples. These detailed experimental results are recorded below Figure 5 Table 2 intuitively shows the prediction effect of the method of the present invention on samples of different difficulty levels, as well as its application performance on the overall data set.
[0204] From these data, it can be seen that the method of the present invention performs well in all comparisons on the four power transformer temperature data sets, and its performance advantage is obvious compared to other control methods. This proves that the method of the present invention can not only significantly improve the performance of a few samples with high prediction difficulty, but also maintain a high level of consistency performance as a whole. This phenomenon is due to the advantages of the trend-seasonal feature learner in learning the feature representation of power transformer temperature data, and is also attributed to the imbalance-aware contrast learning algorithm. This algorithmic process enables rare and difficult-to-predict power transformer temperature data samples to learn richer prediction features from each other, thereby improving their prediction performance and further improving the overall performance on all power transformer temperature data samples.
[0205] In summary, the present invention adopts a trend-seasonal feature learner and an MLP network to construct a power transformer temperature prediction model, and combines the power transformer temperature historical data to perform deep learning of trend seasons and other potential factors on the power transformer temperature; then the imbalance-aware contrast loss function and the optimizer are used to optimize the model parameters, so as to avoid the difficulty of the model in identifying minority class samples and improve the data generalization ability, so as to achieve high-precision prediction of the temperature data of the power transformer, and provide real-time and effective reference for handling transformer emergencies and failures. The present invention adopts a trend-seasonal feature learner, combined with multiple causal convolutional layers, average pooling technology and learnable discrete Fourier transform, to effectively capture the key intrinsic features of the power transformer temperature data. This method can adaptively identify trends and seasonal changes in data, and provide a more accurate data feature representation for the temperature prediction of power transformers. The present invention uses an imbalance-aware contrast learning algorithm to deeply optimize the trend feature representation and the seasonal feature representation. The algorithm promotes the sharing of knowledge information between these samples by bringing samples with similar prediction difficulty closer in the feature space. This enables the minority class samples affected by the mutation to learn more prediction features, thereby significantly improving the prediction accuracy of these samples. The method of the present invention not only enhances the prediction accuracy for minority class samples, but also ensures that the prediction accuracy for majority class samples is maintained at a high level, thereby achieving an overall improvement in the prediction performance of power transformer temperature.
[0206] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0207] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0208] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0209] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0210] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
Claims
1. A method for predicting power transformer temperature based on unbalanced perception contrastive learning, characterized in that: include: Get power transformer temperature data; Performing z-score normalization processing on the power transformer temperature data to obtain normalized power transformer temperature data; The normalized power transformer temperature data is segmented based on the sliding window strategy to obtain time series data of fixed length; Divide the time series data of fixed length into training sample set and test sample set; The training sample set is imported into the power transformer temperature prediction model based on trend-seasonal feature learning and MLP network for feature learning and prediction, and the learned trend feature representation, seasonal feature representation and power transformer temperature prediction results are obtained; The learned trend feature representation and seasonal feature representation are calculated according to the imbalance-aware contrastive learning algorithm to obtain the imbalance-aware contrastive loss of the trend feature and the seasonal feature; The predicted results of the power transformer temperature are calculated based on the actual data of the power transformer temperature, and the mean square error loss of the difference between the predicted results and the actual data is obtained; The total loss value is obtained by weighted summing the mean square error loss of the difference between the predicted result and the true data and the imbalanced perceptual contrast loss of the trend feature and seasonal feature; Back propagation and parameter optimization are performed according to the total loss value to obtain an updated power transformer temperature prediction model; The updated power transformer temperature prediction model is evaluated using the test set to obtain the power transformer temperature prediction model with the best performance; Based on the power transformer temperature prediction model with the best performance, the power transformer temperature is predicted in real time to obtain the future prediction results of the power transformer temperature.
2. The power transformer temperature prediction method based on unbalanced perception contrast learning according to claim 1 is characterized in that: The method of segmenting the normalized power transformer temperature data based on the sliding window strategy to obtain time series data of fixed length includes: Initialize the extraction window, where the historical time series length of the power transformer temperature data is preset , predict the length of the time series and sliding step length , and the length of the extraction window is ; Based on the initialized extraction window, the normalized power transformer temperature data is extracted to obtain the data sequence that satisfies the first extraction window; wherein, the first extraction window contains Historical time series and A forecast time series; Extract the front The historical time series is used as the input sequence, and then The predicted time series are used as the output sequence to form a single time series sample, and the step size is Slide backward to gradually generate a fixed-length time series dataset.
3. The power transformer temperature prediction method based on unbalanced perception contrast learning according to claim 1 is characterized in that: The training sample set is imported into the power transformer temperature prediction model based on trend-seasonal feature learning and MLP network for feature learning and prediction, and the method of obtaining the learned trend feature representation, seasonal feature representation and power transformer temperature prediction result includes: Based on the trend-seasonal feature learner, feature representation learning is performed on the training sample set to obtain the learned trend feature representation and seasonal feature representation; Based on the multi-layer perceptron MLP network, the trend feature representation and seasonal feature representation are spliced to obtain the power transformer temperature prediction result.
4. The method for predicting power transformer temperature based on unbalanced perception contrast learning according to claim 3 is characterized in that: Methods for learning feature representation of a training sample set based on a trend-seasonal feature learner to obtain learned trend feature representation and seasonal feature representation include: The Transformer encoder is used to linearly transform the training sample set and embed the position encoding information to obtain the potential representation of the corresponding Transformer encoder latent space; According to the Transformer encoder, the potential representation is transferred and fused to obtain the intermediate feature representation; Inputting the intermediate feature representation into the trend feature extractor and the seasonal feature extractor respectively to obtain the learned trend feature representation and seasonal feature representation; Among them, the calculation expression for obtaining the potential representation of the corresponding Transformer encoder latent space is: (1) In the formula, For potential representation, is the input sequence of training samples, is the weight matrix of the linear transformation, Indicates position encoding information.
5. The method for predicting power transformer temperature based on unbalanced perception contrast learning according to claim 4 is characterized in that: The method of inputting the intermediate feature representation into the trend feature extractor to obtain the learned trend feature representation includes: Use multi-layer causal convolution operations on the intermediate feature representation to obtain the results of multi-layer causal convolution; Perform average pooling on the results of multi-layer causal convolution to obtain the learned trend feature representation; Among them, the expression for obtaining the result of multi-layer causal convolution is: (2) In the formula, is the intermediate feature representation, is the causal convolution operation, Indicates The result of the convolution is The maximum exponent representing the convolution filter size; The expression for obtaining the learned trend feature representation is: (3) In the formula, is the average pooling operation, It is a trend feature.
6. The method for predicting power transformer temperature based on unbalanced perception contrast learning according to claim 4 is characterized in that: The method of inputting the intermediate feature representation into the seasonal feature extractor to obtain the learned seasonal feature representation includes: The intermediate feature representation is converted from the time domain to the frequency domain based on the discrete Fourier transform function to obtain the frequency domain data of the intermediate feature representation; Performing an affine transformation on each frequency component of the frequency domain data represented by the intermediate feature to obtain an intermediate feature representation that independently applies the frequency domain interaction; The intermediate feature representation of the frequency domain interaction is transformed into the time domain according to the inverse discrete Fourier transform to obtain the seasonal feature representation; Among them, the expression for obtaining seasonal characteristics is: (4) In the formula, is the seasonal characteristic. and are the parameters of the learnable Fourier transform layer, is a learnable discrete Fourier transform function, is the inverse discrete Fourier transform function.
7. The method for predicting power transformer temperature based on unbalanced perception contrast learning according to claim 3 is characterized in that: The method for obtaining the power transformer temperature prediction result by splicing the trend feature representation and the seasonal feature representation based on the multi-layer perceptron MLP network includes: Based on the time axis, the trend feature representation and the seasonal feature representation are aligned to obtain the aligned trend feature representation and the seasonal feature representation; The aligned trend feature representation and seasonal feature representation are concatenated along the feature dimension in the form of a feature matrix to obtain a concatenated feature matrix; Extract the feature vector at the last time step from the concatenated feature matrix; The feature vector at the last time step is input into the multi-layer perceptron MLP network for prediction to generate the power transformer temperature prediction result.
8. The method for predicting power transformer temperature based on unbalanced perception contrast learning according to claim 1 is characterized in that: The method of calculating the learned trend feature representation and seasonal feature representation according to the imbalance-aware contrastive learning algorithm to obtain the imbalance-aware contrastive loss of the trend feature and the seasonal feature includes: Calculate the index difference of the training sample set to obtain the input-output difference index of each sample; The learned trend feature representation and input-output difference index are calculated according to the imbalance-aware contrast loss function to obtain the time-domain imbalance-aware contrast loss; Perform discrete Fourier transform on the learned seasonal feature representation to obtain the phase and amplitude in the frequency domain; The phase and amplitude in the frequency domain and the input-output difference index are calculated according to the imbalanced perception contrast loss function to obtain the frequency domain imbalanced perception contrast loss; The time domain imbalanced perceptual contrast loss and the frequency domain imbalanced perceptual contrast loss are accumulated and summed to obtain the final imbalanced perceptual contrast loss; Among them, the expression for obtaining the input-output difference index of each sample is: (5) In the formula, The input-output difference index IOD value for each sample, For the The input sequence of training samples is For the The output sequence of training samples is is the input sequence length, is the output sequence length, is the average value, is the variance; The expression for obtaining the temporal imbalance perceptual contrast loss is: (6) In the formula, is the temporal imbalance perceptual contrast loss, , and Respectively , and The trend characteristics of training samples are expressed as follows: , and Respectively , and The input-output difference index IOD value of the training sample, is the temperature parameter, is the indicator function, is the cosine similarity of two features, represents the size of the training sample set, represents the exponential function; The expression for obtaining the frequency domain imbalance perceptual contrast loss is: (7) (8) (9) In the formula, , and Respectively represent , and The seasonal feature representation of training samples is Represents discrete Fourier transform, and the resulting frequency domain features are expressed in complex form, including two attributes: amplitude and phase. is the amplitude represented by the frequency domain feature, is the phase represented by the frequency domain feature, and Represent the contrast loss based on amplitude and phase respectively, It is the frequency domain imbalance perceptual contrast loss; The expression of the final imbalanced perceptual contrast loss is obtained as: (10) In the formula, is the final imbalance-aware contrast loss.
9. The method for predicting power transformer temperature based on unbalanced perception contrast learning according to claim 1, characterized in that: The mean square error loss of the difference between the predicted result and the true data and the imbalance-aware contrast loss of the trend feature and seasonal feature are weighted summed to obtain the total loss value: (11) In the formula, is the total loss, is the mean square error loss, is the imbalanced perceptual contrast loss, To balance the hyperparameters.
10. The power transformer temperature prediction method based on unbalanced perception contrast learning according to claim 1 is characterized in that: The method of performing back propagation and parameter optimization according to the total loss value to obtain an updated power transformer temperature prediction model includes: The Adam optimizer is used to back-propagate the total loss value until the total loss value tends to be stable or reaches the preset number of training times, and the weight gradient of the power transformer temperature prediction model is output; The model parameters of the power transformer temperature prediction model are updated according to the weight gradient of the power transformer temperature prediction model to obtain an updated power transformer temperature prediction model.
Citation Information
Cited By
Potential data component extraction time series prediction method based on multi-scale features
CN119622320A