Enhancing Lithium-ion Battery Capacity Prediction through Diffusion-based Data Augmentation and Attention Networks

Accurate prediction of the capacity and remaining useful life (RUL) of lithium-ion batteries is paramount for ensuring the economic viability and operational safety of systems ranging from electric vehicles to grid-scale energy storage. As these batteries degrade over charge-discharge cycles, their capacity diminishes non-linearly, making precise forecasting a critical challenge. Traditional model-based approaches often struggle with the complex electrochemical dynamics involved. Consequently, data-driven methods leveraging machine learning and deep learning have become the predominant paradigm for time series forecasting tasks like battery RUL prediction.

Models based on gated recurrent units (GRUs) and long short-term memory (LSTM) networks have shown significant promise by effectively capturing temporal dependencies. Further advancements were brought by the attention mechanism and Transformer architectures, which excel at modeling long-range context. However, the performance of these sophisticated data-driven models is intrinsically tied to the volume and quality of available training data. In practical lithium-ion battery research and development, acquiring extensive, high-fidelity cycle-life data is expensive and time-consuming, leading to data scarcity. This limitation hampers model generalization and increases the risk of overfitting. Data augmentation techniques offer a viable solution by artificially expanding the dataset, thereby improving model robustness. While methods like noise injection or geometric transformations have been applied, generative models, particularly Denoising Diffusion Probabilistic Models (DDPMs), present a powerful frontier for creating realistic, high-dimensional synthetic data.

Despite their strengths, existing methods face specific challenges when applied to lithium-ion battery capacity forecasting. Prediction models that rely on constructing periodic patches can suffer from local information loss. Furthermore, the gradual noise addition process in standard diffusion models can disrupt the independent components within a time series, and the data generation process itself often lacks interpretability, requiring additional steps for feature extraction.

Lithium-ion battery capacity data typically exhibits clear cyclical patterns corresponding to charge-discharge cycles and a long-term degradation trend. Seasonal-Trend decomposition using LOESS (STL) is a robust, non-parametric method that can smoothly and intuitively decompose a time series into trend, seasonal, and residual components. Its functionality aligns well with the inherent characteristics of battery data, offering potential for improved interpretability in both data generation and prediction tasks.

To address the aforementioned challenges, this work introduces a novel integrated framework. First, a conditional diffusion model (DMnet) is designed by embedding STL-derived features as prior conditions to guide and improve the data generation process. Second, an encoder-decoder attention model (STLnet) is developed by incorporating STL decomposition to better capture temporal feature dependencies for prediction. Finally, these components are synergistically combined into the SDMnet model, which uses STL-extracted features to dynamically regulate both the data augmentation and capacity prediction processes, aiming for high-precision lithium-ion battery capacity forecasting.

Foundational Concepts and Techniques

Denoising Diffusion Probabilistic Models (DDPMs)

Diffusion models are generative models that learn data distributions through a forward noising process and a reverse denoising process. The forward process gradually adds Gaussian noise to an original data sample \(X^{(0)} \sim q(X)\) over \(T\) steps until it becomes pure noise \(X^{(T)} \sim \mathcal{N}(0, I)\). This can be expressed directly at any step \(t\) using the notation \(\alpha_t = 1 – \beta_t\) and \(\bar{\alpha}_t = \prod_{i=1}^{t} \alpha_i\), where \(\beta_t\) is the noise schedule:
$$ X^{(t)} = \sqrt{\bar{\alpha}_t} X^{(0)} + \sqrt{1 – \bar{\alpha}_t} \epsilon $$
with \(\epsilon \sim \mathcal{N}(0, I)\).

The reverse process learns to denoise by training a neural network \(\Psi_{\theta}\) to predict the noise \(\epsilon\) added at step \(t\). Given a noisy sample \(X^{(t)}\), the network predicts \(\epsilon_{\theta} = \Psi_{\theta}(X^{(t)}, t)\). The denoising step to recover \(X^{(t-1)}\) is then approximated. The model is trained by minimizing a simple loss function:
$$ L = \mathbb{E}_{t, X^{(0)}, \epsilon} \left[ \| \epsilon – \epsilon_{\theta}(X^{(t)}, t) \|^2 \right] $$
After training, new data samples can be generated by iteratively denoising pure noise.

Seasonal-Trend Decomposition using LOESS (STL)

STL is a robust time series decomposition method that breaks down a series \(Y_v\) into three additive components: trend (\(T_v\)), seasonal (\(S_v\)), and residual (\(R_v\)), such that \(Y_v = T_v + S_v + R_v\) for \(v = 1, \ldots, N\). Its core strength lies in the use of locally weighted regression (LOESS) for smoothing. The algorithm operates through an inner loop and an outer loop. The inner loop iteratively applies LOESS smoothing to separate and refine the trend and seasonal components. The outer loop assigns robustness weights to each data point based on the residual magnitude, reducing the influence of outliers and making the decomposition resistant to anomalous observations. This makes STL particularly effective for time series with pronounced seasonal patterns and evolving trends, much like the cyclical degradation data from lithium-ion batteries.

Encoder-Decoder Attention Network (EDAnet)

The EDAnet model is a sequence-to-sequence architecture designed for long-term time series forecasting. It employs an encoder-decoder structure where both the encoder and decoder are built using LSTM networks to capture long-range dependencies. The key innovation is the use of a temporal attention mechanism within the decoder. Instead of compressing the entire input sequence into a single fixed context vector, the attention mechanism allows the decoder to dynamically focus on different parts of the encoded input sequence at each decoding step. This enables the model to selectively attend to the most relevant historical information when making a prediction, improving accuracy for complex, long-horizon forecasts common in lithium-ion battery capacity trajectories.

Methodology: The SDMnet Integrated Framework

The SDMnet framework is designed to tackle lithium-ion battery capacity prediction by synergistically combining data augmentation with an enhanced prediction model, both guided by STL decomposition. The problem is formalized as learning a mapping \(M(\cdot)\) from observed feature sequences \(X\) to future capacity values \(Y\), augmented by generated data \(X’ = \mathcal{H}(X)\) to improve generalization.

Overall Architecture and Workflow

The SDMnet workflow consists of two major phases: data augmentation using DMnet and capacity prediction using STLnet, coordinated by STL features.

  1. Data Preprocessing: Raw lithium-ion battery cycling data (e.g., current, voltage, temperature, charge capacity, discharge capacity) is normalized, down-sampled, and segmented. The dataset is split into training (80%) and testing (20%) sets.
  2. DMnet Training: The conditional diffusion model (DMnet) is trained on the training set. The discharge capacity (QD) sequence from the training data is decomposed via STL, and the resulting trend (\(f_T\)) and/or seasonal (\(f_S\)) components are used as conditioning features \(f\) for the noise prediction network \(\Psi_{\theta}\).
  3. Augmented Dataset Generation: The trained DMnet is used to generate synthetic samples \(X’_{\text{train}}\) from the original training set \(X_{\text{train}}\). It is also applied to the test set to create \(X’_{\text{test}}\), ensuring the prediction model encounters a consistent data distribution.
  4. STLnet Training & Prediction: The enhanced prediction model, STLnet, is trained on a combined dataset of original and augmented samples (\(X_{\text{train}}\) and \(X’_{\text{train}}\)). During both training and inference, the QD sequence of each sample is decomposed by STL, and these features are embedded into the encoder-decoder attention mechanism. Finally, STLnet performs capacity prediction on the processed test data (\(X_{\text{test}}\) and \(X’_{\text{test}}\)).

The DMnet Diffusion Model for Data Augmentation

The DMnet is a conditional diffusion model where the noise prediction network \(\Psi_{\theta}\) is guided by STL-derived features. A U-Net inspired architecture is used for \(\Psi_{\theta}\). Its inputs are the noisy sample \(X^{(t)}\), the diffusion step \(t\) (position-encoded), and the conditioning feature vector \(f\). The conditioning features are integrated via addition and layer normalization at multiple stages within the network, steering the denoising process to preserve or learn the underlying trend and seasonal patterns of lithium-ion battery data.

The training loss for DMnet is composed of three KL-divergence terms, weighted to balance sample reconstruction, noise prediction, and feature alignment:
$$ L_{\text{DM}} = w_1 D_{KL}(X^{(t-1)} \| X^{\prime(t-1)}) + w_2 D_{KL}(\epsilon \| \epsilon^{\prime(t)}) + w_3 D_{KL}(f \| f’) $$
where \(f’\) are the STL features extracted from the generated sample’s QD sequence. This multi-term loss ensures the generated data is realistic, follows the correct denoising trajectory, and adheres to the desired temporal structure.

During the generation phase, synthetic samples are created by iteratively denoising an initial noisy vector over \(K\) steps, using the trained \(\Psi_{\theta}\) conditioned on the STL features of a seed sample. This process produces new lithium-ion battery feature sequences that maintain realistic cyclical and degenerative characteristics.

The STLnet Prediction Model

STLnet enhances the EDAnet architecture by directly incorporating STL decomposition into the encoding process. The model takes the multi-variate input sequence \(X_t\) and its corresponding QD sequence. The QD sequence is decomposed offline using STL into trend (\(f_T\)), seasonal (\(f_S\)), and residual (\(f_R\)) components, which are concatenated into a feature tensor \(\bar{f}\).

Two separate LSTM encoders process the raw input \(X_t\) and the STL features \(\bar{f}\), producing hidden state sequences \(H_t\) and \(h_t\), respectively:
$$ H_t = E_1(X_t), \quad h_t = E_2(\bar{f}) $$
The decoder employs a temporal attention mechanism over both sets of hidden states. Context vectors \(c_t^1\) and \(c_t^2\) are computed by attending to \(H_t\) and \(h_t\):
$$ e_{t,i} = \text{tanh}(W_d [H_i; s_{t-1}] + b_d), \quad \gamma_{t,i} = \frac{\exp(e_{t,i})}{\sum_{j=1}^N \exp(e_{t,j})}, \quad c_t^1 = \sum_{i=1}^N \gamma_{t,i} H_i $$
A similar process yields \(c_t^2\) from \(h_t\). These context vectors are combined and fed into the decoder LSTM to produce the final capacity prediction. This dual-path attention allows STLnet to explicitly and dynamically weigh both the raw temporal dynamics and the fundamental trend/seasonal patterns extracted by STL, leading to more accurate and robust predictions for lithium-ion battery capacity.

Experimental Results and Analysis

Experiments were conducted on a publicly available lithium-ion battery dataset from the Toyota Research Institute, focusing on fast-charge cycling data. Key features included current (I), voltage (V), temperature (TD), charge capacity (QC), and discharge capacity (QD), with QD as the prediction target. Additional tests were performed on NASA PCoE and CALCE datasets for generalizability. Models were evaluated using R² score, Root Mean Square Error (RMSE), and Mean Absolute Error (MAE).

Effectiveness of Conditional Data Augmentation

Ablation studies on DMnet’s conditioning strategy showed that using STL-derived features, particularly the trend component, significantly improved the training of both the diffusion model and the downstream predictor. The loss curves for DMnet and STLnet were lower when using conditional augmentation compared to unconditional (standard) diffusion. A Bayesian Wilcoxon signed-rank test (IDP) confirmed that conditioning with trend features yielded a higher probability of superior model performance compared to unconditional generation or conditioning with seasonal features. This indicates that guiding the diffusion process with the degradation trend is crucial for generating useful lithium-ion battery data.

Analysis of the Augmentation Process

The denoising process within DMnet effectively regularizes the generated data. As the number of denoising steps increased from 0 (simple noise addition) to 3, the variance of the generated QD sequences decreased, leading to more stable and realistic synthetic samples. Table 1 summarizes the statistics of the prediction noise and generated samples across steps, demonstrating this stabilizing effect.

Table 1: Statistics of Prediction Noise and Generated QD Sequences Across Denoising Steps
Statistic Raw Step 0 Step 1 Step 2 Step 3
ϵ’ (Max) 2.1266 1.9953 1.9924 1.4622
ϵ’ (Min) -3.1482 -0.2785 -0.2784 -0.2768
ϵ’ (Variance) 1.1060 0.4388 0.3577 0.1716
QD (Max) 0.9093 16.7606 3.5483 2.0365 1.5923
QD (Min) 0.0000 -31.0733 -2.7834 -0.6713 -0.3822
QD (Variance) 0.1067 77.0690 1.0764 0.4618 0.1819

Furthermore, mixing original and augmented samples for training STLnet proved optimal. Prediction performance peaked when the training mix contained approximately 50% original and 50% DMnet-generated data, outperforming models trained on either pure original or pure synthetic data. This demonstrates that the augmented data provides complementary information that enhances the lithium-ion battery predictor’s generalization.

Comparative Prediction Performance

The proposed SDMnet was compared against a comprehensive set of baseline models, including STL-GRU variants, Transformer-based models (Transformer, Informer, ETSformer, SGEformer), LSTM networks, and the original EDAnet. Table 2 presents the average prediction metrics (RMSE) across multiple lithium-ion battery datasets, highlighting SDMnet’s consistent superiority.

Table 2: Comparison of Model Prediction RMSE Across Multiple Lithium-ion Battery Datasets
Method bic4 bic5 bic10 NASA_B0005 CALCE_CS2_35
STL-GRU-T 0.3011 0.2451 0.2085 0.0621 0.1719
Transformer 0.1101 0.1724 0.1545 0.0043 0.2700
Informer 0.1213 0.1189 0.0942 0.0176 2.1014
ETSformer 0.3357 0.3030 0.3026 0.2074 0.1870
LSTMnet 0.1172 0.1644 0.1624 0.0298 0.0571
EDAnet 0.0570 0.0476 0.0402 0.0181 0.1084
STLnet (Ours) 0.0475 0.0479 0.0398 0.0203 0.0945
DM_EDAnet 0.0421 0.0477 0.0391 0.0311 0.0766
SDMnet (Ours) 0.0342 0.0350 0.0365 0.0157 0.0475

The key findings are:

  1. STLnet vs. EDAnet: STLnet consistently outperformed the original EDAnet, validating that explicit modeling of trend and seasonal components via STL decomposition enhances the attention mechanism’s ability to capture temporal dependencies in lithium-ion battery data.
  2. DM_EDAnet vs. EDAnet: The model using diffusion-based augmentation (DM_EDAnet) outperformed the standard EDAnet, confirming the value of the proposed data augmentation method.
  3. SDMnet Superiority: The full SDMnet model, integrating both conditional diffusion augmentation (DMnet) and the STL-enhanced predictor (STLnet), achieved the best overall performance across almost all datasets and metrics (R², RMSE, MAE). This demonstrates the synergistic effect of using STL features to guide both data generation and prediction.

Visualizations of prediction curves and scatter plots further confirmed that SDMnet’s forecasts most closely align with the true lithium-ion battery capacity degradation trajectory, with minimal outliers.

Spatiotemporal Efficiency

An analysis of the full SDMnet pipeline was conducted. The model completed training and inference in approximately 1983 seconds with a peak memory usage of 3456 MB. While the DMnet training phase is computationally intensive (accounting for ~71.5% of the time), it generates data efficiently at 0.74 MB/sec. The final model size is 9.62 MB with 2.52 million parameters. This profile confirms that SDMnet, while more complex than simple predictors, operates within practical computational constraints for modern hardware and delivers significant gains in prediction accuracy for lithium-ion battery applications.

Conclusion and Future Work

This work presented SDMnet, an integrated framework for lithium-ion battery capacity prediction that addresses data scarcity and modeling challenges through innovative use of diffusion models and signal decomposition. The core contributions are threefold: 1) DMnet, a conditional diffusion model that uses STL-derived features as prior conditions to generate high-quality, realistic battery data; 2) STLnet, an enhanced encoder-decoder attention model that incorporates STL decomposition to better capture temporal dependencies; and 3) the synergistic integration of these components into SDMnet, where STL features dynamically regulate both augmentation and prediction. Extensive experiments on multiple lithium-ion battery datasets demonstrated that the proposed data augmentation method effectively improves predictor generalization, and the STLnet model achieves higher prediction accuracy. Consequently, SDMnet exhibited state-of-the-art performance and robust generalization capabilities.

Future research will focus on two main areas. First, reducing the computational overhead of the diffusion-based sampling process is crucial for practical deployment. Second, effectively leveraging the seasonal component within the multi-step diffusion framework remains a challenging but promising direction. Improving the handling of cyclical features in generative models could lead to more interpretable and disentangled representations, benefiting not only lithium-ion battery prognostics but also a wider range of time-series generation and forecasting applications.

Scroll to Top