4.1. Algorithm Architecture
During long-term operation of transformers, oil temperature and pressure are jointly influenced by load variations, heat dissipation conditions, environmental factors, and equipment aging. As a result, their time-series data typically exhibit pronounced nonstationarity, multi-scale fluctuations, and abrupt changes. Such complex evolutionary characteristics make it difficult for traditional prediction methods based on physical mechanisms or statistical assumptions to simultaneously ensure high accuracy and adequate dynamic responsiveness. In this section, a deep learning-based data-driven model for transformer oil temperature and pressure prediction is developed. By integrating signal decomposition with deep neural network modeling, the proposed approach enables high-precision characterization of multi-scale temporal evolution patterns.
- (1)
Variational Mode Decomposition
Variational Mode Decomposition (VMD) is an adaptive signal decomposition method grounded in variational theory, whose core idea is to decompose a complex nonstationary signal into a set of mode components with finite bandwidths and well-defined center frequencies. Compared with traditional empirical mode decomposition methods, VMD imposes global constraints on modal bandwidths in the frequency domain, thereby effectively avoiding endpoint effects and mode mixing. As a result, it exhibits superior decomposition stability and stronger mathematical interpretability.
Let the original time-series signal be denoted as
f(
t). The objective of VMD is to decompose
f(
t) into
K mode components
, where each mode is compactly distributed around its corresponding center frequency
ωk. To this end, VMD applies the Hilbert transform to each mode to construct its analytic signal and performs frequency shifting in the frequency domain to translate the spectrum of each mode to the baseband, leading to the following variational optimization model:
where
δ(
t) denotes the Dirac delta function, ∗ represents the convolution operator, and ∂
t(·) is the temporal differentiation operator. The constraint in the above formulation ensures that the sum of all mode components can exactly reconstruct the original signal. To solve the above constrained variational problem, a quadratic penalty term and a Lagrange multiplier
λ(
t) are typically introduced to transform it into an unconstrained optimization problem. The corresponding augmented Lagrangian function can be expressed as:
where
α is the penalty factor, which is used to balance the trade-off between the reconstruction error and the modal bandwidth constraint. Through iterative optimization, the modal center frequencies can be adaptively updated in the frequency domain using an energy-weighted averaging scheme:
where
denotes the Fourier transform of the K mode component
.
- (2)
Adaptive Parameter Selection Method for VMD-Based Swarm Intelligence
The decomposition performance of VMD is highly sensitive to the selection of the mode number K and the penalty factor α. If K is chosen too small, different frequency components are prone to mode mixing. Conversely, an excessively large K introduces redundant modes and amplifies noise. Meanwhile, the penalty factor α directly determines the strength of the bandwidth constraint imposed on each mode. An inappropriate value of α may lead to excessive spectral spreading or over-concentration of modal components, thereby degrading subsequent feature extraction and predictive modeling performance. Therefore, to address the limitations of conventional VMD that relies on empirical parameter selection and exhibits poor generalization, this study introduces a swarm intelligence-based optimization strategy to adaptively determine the key VMD parameters K and α.
(1) The VMD parameter selection problem is formulated as a continuous–discrete mixed optimization problem, in which the optimization variables are defined as:
where
denotes the number of decomposition modes and
is the penalty factor. Considering engineering experience and computational complexity constraints, the search space is defined as:
(2) Considering that VMD serves as the front-end decomposition module of the prediction model in this study, the quality of its parameters is ultimately reflected in the predictive performance. Therefore, the prediction error on the validation set is adopted as the optimization objective, and the following fitness function is constructed:
where
and
denote the ground-truth value and the predicted value obtained under a given parameter combination (
K,
α) through VMD, sub-sequence prediction, and reconstruction, respectively, and
N is the number of validation samples. This objective function can directly reflect the influence of different parameter configurations on the overall prediction accuracy.
(3) Swarm intelligence optimization algorithms achieve a dynamic balance between global exploration and local exploitation by mimicking cooperative behaviors observed in natural swarms. The algorithm first randomly initializes the positions of the population individuals as follows:
where
M denotes the population size. Subsequently, during each iteration, the parameter vectors are updated according to the current state of each individual, the global best solution of the population, and a random perturbation term, as follows:
where the
is adaptively generated by the internal behavioral rules of the algorithm and is used to guide the search process toward potential optimal regions.
For the discrete variable K, rounding or boundary-mapping strategies are applied after each update to ensure the integer constraint is satisfied; for the continuous variable α, it directly participates in the continuous search process. After each parameter update, the VMD and the training of the prediction model are re-executed, and the corresponding fitness value is computed.
(4) When the maximum number of iterations is reached, or the convergence criterion of the fitness function is satisfied, the global optimal parameter combination is obtained.
Based on this optimal parameter combination, the original signal is finally decomposed using VMD, and the resulting multi-scale mode components are obtained as input features for the subsequent prediction model.
- (3)
Modeling Method Based On Temporal Convolutional Network
After applying swarm intelligence–optimized parameter selection, VMD can decompose the original nonstationary signal into multiple mode components with well-defined frequency-band characteristics, effectively alleviating multi-scale coupling and noise interference in the signal. However, each mode component still exhibits pronounced nonlinear temporal evolution and long-term dependency characteristics along the time dimension. Relying solely on linear modeling or conventional convolutional structures is insufficient to fully capture such temporal correlations. Therefore, on the basis of the optimally decomposed VMD modes, this study introduces a Temporal Convolutional Network (TCN) to further model each mode component, thereby enhancing the model’s capability to represent complex temporal dynamics.
Let the optimal VMD obtain
modes
, and combine them into multi-channel inputs at the same time:
Then, the TCN-based modeling of the VMD-optimized data and the corresponding output prediction can be directly expressed as:
where
denotes a historical window of length
L,
represents the feature extractor composed of stacked causal dilated convolutions, and
denotes the linear mapping layer.
- (4)
High-Order Time-Series Prediction Modeling Based on Inverted-Transformer
The feature sequences processed by the TCN have effectively captured the nonlinear dynamic characteristics of each VMD mode at local temporal scales. However, this modeling paradigm primarily relies on convolutional operations within a fixed receptive field, which limits its ability to represent global temporal dependencies across multiple scales and periods. In particular, in power equipment operating data, state variables such as pressure and temperature are often influenced by daily load cycles, environmental variations, and operating condition transitions, resulting in pronounced long-term dependencies and global correlations. To further capture long-range temporal dependencies that are difficult for TCNs to model explicitly, this study introduces an inverted-structure Transformer (iTransformer) for predictive modeling on top of the TCN-based feature extraction.
Let the high-order temporal feature representation output by the TCN be denoted as:
where
d denotes the feature dimension. Unlike conventional Transformers that model attention relationships along the temporal dimension, iTransformer performs self-attention computation in the feature dimension, thereby efficiently modeling global dependencies among different modal features and their cross-scale representations.
In iTransformer, after transposing the dimensions of the TCN output feature matrix
, the Query, Key, and Value representations are constructed as follows:
where
are learnable parameter matrices. Through the above mechanism, the iTransformer can explicitly model the global dependencies among the multimodal features extracted by the TCN while keeping the computational complexity manageable. After passing through multiple iTransformer encoder layers, a feature representation that integrates global correlations is obtained, and the final prediction is produced via a linear mapping. The flow chart of the proposed prediction algorithm is shown in
Figure 11.
4.2. Algorithm Validation
Particle Swarm Optimization (PSO) is a widely used swarm intelligence algorithm for continuous optimization problems, which simulates the behavior of bird flocks foraging to search for the optimal solution. This article uses PSO as an optimization algorithm. In this study, online monitoring data from a transformer were selected to validate the proposed algorithm. The dataset consists of physical measurements collected over three consecutive days, comprising six groups in total, with each group containing 295,200 data points. The prediction model was implemented using the PyTorch 2.1.0 framework.
During the model training stage, to ensure predictive performance and model stability, the input data were standardized by removing the mean and scaling to unit variance, thereby eliminating the influence of dimensional differences among different physical quantities on the training process. The oil temperature and oil pressure data collected over the three-day period were divided into training and testing sets in chronological order. Data from the first 2.5 days were used for model training, while data from the remaining 0.5 day were reserved for model evaluation, ensuring a reliable assessment of prediction performance on unseen data.
Figure 12 presents the validation dataset.
In the network architecture, the TCN component employs dilated convolutional structures to expand the receptive field, with the convolution kernel size set to 4 and the number of hidden layers set to 4. For the Transformer component, the feature embedding dimension D is set to 128, the number of heads in the multi-head self-attention mechanism is set to 4, and the dropout rate is set to 0.1.
During training, the Adam optimizer is used to update the model parameters, with an initial learning rate of 0.001. The batch size is set to 64, and the number of training epochs is set to 200. To prevent model overfitting, an early stopping strategy is introduced during training. Specifically, training is terminated when the validation error shows no improvement for 20 consecutive epochs.
Set the initial population size of the Swarm Intelligence to 8 and the number of iterations to 50, thereby obtaining the optimal
K value of the temperature signal as 4 and the α value as 4179, the optimal
K value of the pressure signal as 6 and the α value as 3150. The iterative curves of the decomposition parameters, their center frequencies, and the optimal
K values after Swarm Intelligence-VMD are shown in
Figure 13. The original content sequence is decomposed into smooth low-frequency high-amplitude components and regular high-frequency low-amplitude components, and the spectra of each IMF component do not overlap.
The normalized data after modal decomposition is input into the TCN-iTransformer and trained and predicted based on the optimal model. To further verify the effectiveness of the prediction model proposed in this paper, it was compared with the TCN-iTransformer, VMD-TCN-iTransformer, and Swarm Intelligence-VMD-TCN-iTransformer models. The temperature and pressure prediction results at each point are shown in
Figure 14.
From the overall prediction results, the three models show significant differences in the fitting accuracy and dynamic response capability of the transformer oil temperature and oil conservator pressure signals.
As can be seen from
Figure 15, the TCN-iTransformer model predicts the original signal directly. The prediction value cannot follow the fluctuation of the real value, and the prediction error MAPE and RMSE are 19.61 and 0.23, respectively. If the VMD of the original signal is used and then the prediction is made, the prediction results show significant improvement, and the prediction error decreases by 12.13 and 0.1, indicating that VMD can effectively reduce the non-stationarity of the original data to further improve the prediction accuracy. Compared with the VMD-TCN-iTransformer model, the model in this paper adopts Swarm Intelligence to optimize the modal decomposition results of the VMD, which further improves the order of the modal decomposition parameters and helps to further improve the prediction accuracy. The MAPE and RMSE of this paper’s model are 3.48 and 0.04, respectively, which are the lowest among these prediction results.
In addition to the aggregate performance metrics, the statistical dispersion of the prediction residuals was analyzed to evaluate the model’s reliability under varying conditions. Based on the calculation of 100 consecutive test groups, the proposed model achieved a Coefficient of Determination (R2) of approximately 0.995, with residuals centered closely around zero.
As shown in
Figure 16, the Proposed Swarm Intelligence-VMD-TCN-iTransformer model exhibits a significantly narrower error distribution, with a Residual Standard Deviation (STD) of 0.0028, compared to the baseline VMD-TCN-iTransformer (STD = 0.0145) and TCN-iTransformer (STD = 0.0291). This reduced variance indicates superior robustness against signal fluctuations. Furthermore, a comparative assessment with the field data provided in
Section 5.2 confirms that this tight error distribution is consistent across both the validation dataset and the real-world 220 kV transformer deployment, proving that the model’s stability does not degrade during the transition from validation to practical engineering scenarios.