Capacity Prediction Method of Multi-Health Factor Lithium-Ion Battery Based on Attention Mechanism

Accurately predicting the capacity of lithium-ion batteries is crucial for assessing their health status and ensuring the safety and reliability of systems where they are deployed. As the amount of input operational data increases, traditional neural network prediction methods often struggle to maintain accuracy. To address this challenge, this paper proposes a novel capacity prediction method for lithium-ion batteries that utilizes multiple health factors and is based on an attention mechanism. The core of our approach is a hybrid deep learning model that synergistically combines Convolutional Neural Networks (CNN), Long Short-Term Memory networks (LSTM), and an Attention mechanism.

The performance degradation of a lithium-ion battery, primarily manifested as capacity fade or internal resistance growth, is an inevitable process. This degradation can lead to system failures and, in severe cases, safety incidents. Therefore, precise capacity prediction is not just a maintenance task but a critical safety requirement. Traditional model-based prediction methods, which rely on empirical or electrochemical models, often face limitations due to a lack of physical interpretability or the complexity of quantifying internal degradation processes. In contrast, data-driven methods have gained prominence as they do not require precise modeling of internal electrochemical mechanisms. Instead, they learn the relationship between easily measurable operational parameters and capacity fade from historical data.

Among data-driven techniques, LSTM networks have shown significant promise due to their ability to capture long-term dependencies in time-series data. However, a standard LSTM can become prone to overfitting and increased computational cost when processing high-dimensional feature datasets. To mitigate this, a Convolutional Neural Network (CNN) can be employed upstream for effective and efficient feature extraction from the raw sequential data. The CNN’s strength in local feature capture complements the LSTM’s strength in modeling temporal dynamics, leading to a powerful CNN-LSTM hybrid model. Nevertheless, a challenge persists: as the model ingests a large volume of information from multiple health factors, not all features contribute equally to the capacity prediction at every time step. The model may fail to focus on the most salient features for a given prediction. To solve this, we integrate an Attention mechanism into the CNN-LSTM architecture. The attention mechanism allows the model to dynamically weigh the importance of different extracted features, focusing its “attention” on the most relevant information for predicting the current capacity, thereby enhancing both prediction accuracy and robustness.

Theoretical Foundation of the Proposed Model

Our proposed model is a composite architecture, CNN-LSTM-Attention, where each component plays a distinct and crucial role in processing the time-series data from the lithium-ion battery.

1. Convolutional Neural Network (CNN) for Feature Extraction

The CNN acts as the primary feature extractor from the raw, multi-dimensional input data (health factors). Its structure typically includes input, convolutional, pooling, and fully connected layers. The convolutional layer applies filters (kernels) to the input to detect local patterns and features. The operation at layer \(i\) can be represented as:

$$
H_i = f(H_{i-1} * W_i + b_i)
$$

where \(H_i\) is the feature map output, \(f\) is the activation function (e.g., ReLU), \(*\) denotes the convolution operation, \(W_i\) is the weight matrix of the kernel, and \(b_i\) is the bias term.

The subsequent pooling layer (e.g., max-pooling) performs down-sampling on the feature maps, reducing their dimensionality and computational complexity while retaining the most salient information, which also helps prevent overfitting:

$$
Z_i = \text{subsampling}(Z_{i-1})
$$

2. Long Short-Term Memory (LSTM) Network for Temporal Dynamics

The features extracted by the CNN are sequential. The LSTM network is designed to model these temporal dependencies. Its key innovation over simple RNNs is the memory cell and gating mechanisms, which regulate the flow of information. The LSTM unit consists of:

  • Forget Gate (\(f_t\)): Decides what information to discard from the previous cell state \(C_{t-1}\).
  • Input Gate (\(i_t\)): Decides what new information to store in the current cell state. It works in tandem with a candidate cell state \(\tilde{C}_t\).
  • Output Gate (\(o_t\)): Determines what part of the cell state to output as the hidden state \(h_t\).

The mathematical formulations are as follows:

$$
\begin{aligned}
f_t &= \sigma(W_f \cdot [h_{t-1}, x_t] + b_f) \\
i_t &= \sigma(W_i \cdot [h_{t-1}, x_t] + b_i) \\
\tilde{C}_t &= \tanh(W_C \cdot [h_{t-1}, x_t] + b_C) \\
C_t &= f_t \odot C_{t-1} + i_t \odot \tilde{C}_t \\
o_t &= \sigma(W_o \cdot [h_{t-1}, x_t] + b_o) \\
h_t &= o_t \odot \tanh(C_t)
\end{aligned}
$$

Here, \(\sigma\) is the sigmoid activation function, \(\tanh\) is the hyperbolic tangent function, \(\odot\) denotes element-wise multiplication, \(W\) terms are weight matrices, \(b\) terms are bias vectors, \(x_t\) is the input at time \(t\), and \([h_{t-1}, x_t]\) denotes concatenation.

3. Attention Mechanism for Feature Weighting

While the LSTM processes sequences, it may treat all time-steps and features equally. The Attention mechanism addresses this by allowing the model to assign different weights (or “attention”) to different parts of the input sequence when making a prediction. Given a sequence of LSTM hidden states \([h_1, h_2, …, h_n]\), the attention mechanism calculates a context vector \(c_t\) as a weighted sum:

$$
\begin{aligned}
e_{t,i} &= \text{score}(h_t, h_i) \\
\alpha_{t,i} &= \frac{\exp(e_{t,i})}{\sum_{j=1}^{n} \exp(e_{t,j})} \\
c_t &= \sum_{i=1}^{n} \alpha_{t,i} h_i
\end{aligned}
$$

where \(e_{t,i}\) is an alignment score (often a simple dot product or a learned function) between the current target state and the source state \(h_i\), and \(\alpha_{t,i}\) is the attention weight. The context vector \(c_t\), rich in the most relevant source information, is then used alongside \(h_t\) for the final prediction. This enables the model to focus on the health factor trends that are most indicative of capacity fade at a specific cycle, improving interpretability and accuracy.

Methodology: Health Factor Selection and Model Integration

Health Factor Extraction

The selection of informative health factors (HFs) is paramount. We analyze operational data from charge-discharge cycles and select five directly measurable HFs that exhibit strong correlation with the capacity of the lithium-ion battery:

  • HF I1: Maximum temperature during discharge (\(T_{max}\))
  • HF I2: Instantaneous voltage drop amplitude during discharge (\(\Delta u_{ohm}\))
  • HF I3: Voltage change rate between 3.8V and 3.7V during discharge (\(k_{(3.8-3.7)}\))
  • HF I4: Total discharge duration (\(t_{dis}\))
  • HF I5: Voltage change rate between 4.0V and 4.1V during charge (\(k_{(4.0-4.1)}\))

To validate the relevance of these HFs, we calculate their Pearson correlation coefficients with the actual capacity. The results for cells B0005, B0006, and B0007 from a public dataset are summarized below, confirming strong correlations (absolute values close to 1).

Health Factor Correlation with B0005 Capacity Correlation with B0006 Capacity Correlation with B0007 Capacity
I1 (T_max) -0.9063 -0.8432 -0.7226
I2 (Δu_ohm) -0.9728 -0.9900 -0.9550
I3 (k_discharge) -0.9693 -0.9357 -0.9540
I4 (t_dis) 0.9989 0.9896 0.9982
I5 (k_charge) -0.9897 -0.9043 -0.9902

Integrated CNN-LSTM-Attention Model Architecture

The workflow of our integrated model for lithium-ion battery capacity prediction is as follows:

  1. Input: A multivariate time-series matrix of the five selected health factors over multiple charge-discharge cycles.
  2. CNN Layer: The raw HF data is fed into 1D convolutional layers. These layers apply multiple filters across the temporal dimension of each HF and between HFs, automatically learning and extracting local temporal patterns and high-level features that are predictive of capacity degradation in the lithium-ion battery.
  3. LSTM Layer: The feature maps produced by the CNN are then fed into an LSTM layer. This layer models the long-term temporal dynamics and dependencies between the extracted features across cycles, capturing the sequential degradation trend of the lithium-ion battery.
  4. Attention Layer: The sequence of hidden states from the LSTM is passed to the Attention layer. This layer computes attention weights, determining which cycles’ feature information is most critical for the current capacity prediction. It outputs a weighted context vector.
  5. Output Layer: The context vector is passed through one or more fully connected (dense) layers to produce the final predicted capacity value for the lithium-ion battery.

This architecture ensures that the model not only extracts robust features and learns long-term trends but also intelligently focuses on the most relevant historical information when making each prediction.

Experimental Validation and Results Analysis

We validate our proposed method using the publicly available NASA battery aging dataset, specifically cells B0005, B0006, and B0007. Data from cycles 35 to 165 is used to avoid initial conditioning and focus on the degradation phase.

Evaluation Metrics

To quantitatively assess the prediction performance for the lithium-ion battery capacity, we employ three standard metrics:

$$
\begin{aligned}
\text{MAE} &= \frac{1}{N} \sum_{i=1}^{N} |\hat{y}_i – y_i| \\
\text{MAPE} &= \frac{1}{N} \sum_{i=1}^{N} \left| \frac{\hat{y}_i – y_i}{y_i} \right| \times 100\% \\
\text{RMSE} &= \sqrt{ \frac{1}{N} \sum_{i=1}^{N} (\hat{y}_i – y_i)^2 }
\end{aligned}
$$

where \(N\) is the number of test samples, \(y_i\) is the actual capacity, and \(\hat{y}_i\) is the predicted capacity of the lithium-ion battery.

Prediction Under Different Data Proportions

We first test the robustness of our CNN-LSTM-Attention model with different training-testing data splits (different prediction starting points). The results demonstrate the model’s consistent performance.

Battery Data Ratio (Train:Test) MAE (Ah) RMSE (Ah) MAPE (%)
B0005 70:65 0.0105 0.0114 0.77
90:45 0.0053 0.0062 0.39
B0006 70:65 0.0210 0.0298 1.69
90:45 0.0171 0.0226 1.39
B0007 70:65 0.0085 0.0093 0.57
90:45 0.0050 0.0058 0.35

The table shows that for all three lithium-ion batteries, the prediction errors (MAE, RMSE, MAPE) are consistently low across different data splits. Furthermore, as expected, errors generally decrease when more training data (90 cycles) is used, confirming the model’s ability to learn effectively from historical data.

Comparative Analysis with Other Methods

To highlight the superiority of our proposed method, we compare it against two other neural network models: a standalone CNN and a CNN-LSTM hybrid (without attention). We use a fixed split of 80 cycles for training and the remainder for testing.

Model Battery MAE (Ah) RMSE (Ah) MAPE (%)
CNN B0005 0.0195 0.0218 1.46
B0006 0.0235 0.0336 1.92
B0007 0.0260 0.0297 1.80
CNN-LSTM B0005 0.0178 0.0193 1.33
B0006 0.0233 0.0327 1.90
B0007 0.0124 0.0130 0.84
CNN-LSTM-Attention (Ours) B0005 0.0060 0.0070 0.44
B0006 0.0224 0.0241 1.73
B0007 0.0033 0.0041 0.23

The comparative results are clear. Our proposed CNN-LSTM-Attention model achieves the lowest prediction errors across almost all metrics and for all lithium-ion battery cells. For instance, for cell B0005, our model reduces the MAE by approximately 66% compared to the standard CNN-LSTM and 69% compared to the standalone CNN. This significant improvement underscores the value of the attention mechanism in identifying and weighting the most critical features for accurate capacity prediction in a lithium-ion battery. The model demonstrates high accuracy and strong robustness across different battery samples.

Conclusion

In this work, we have presented a novel data-driven method for accurately predicting the capacity of lithium-ion batteries. The method addresses key limitations of existing approaches by: 1) selecting a robust set of five directly measurable and highly correlated health factors; 2) constructing a powerful hybrid deep learning model that integrates CNN for spatial feature extraction, LSTM for temporal sequence modeling, and an Attention mechanism for dynamic feature weighting. The Attention mechanism is particularly crucial as it enables the model to focus on the most relevant historical health factor information when making each prediction, mitigating information overload from multi-cycle, multi-factor data.

Comprehensive validation on a public lithium-ion battery aging dataset demonstrates that our proposed CNN-LSTM-Attention model consistently outperforms traditional CNN and CNN-LSTM models. It achieves superior prediction accuracy, as evidenced by lower MAE, RMSE, and MAPE values, and shows robust performance under different data availability scenarios. This confirms the effectiveness of the integrated architecture for capturing the complex, nonlinear degradation dynamics of lithium-ion batteries.

Future work will focus on further enhancing this predictive framework for the lithium-ion battery. This includes extending the model to perform joint estimation of multiple state parameters, such as capacity and internal temperature, and developing multi-time-scale prediction models to improve both the precision and long-term stability of state-of-health forecasting for lithium-ion battery systems in real-world applications.

Scroll to Top