I propose a hybrid deep-learning framework for estimating the remaining useful life and state of health of a lithium-ion cell. The central motivation is that a lithium-ion cell does not degrade according to a single smooth law. Its aging behavior changes across early, middle, and late life, and the degradation mechanisms include electrolyte decomposition, solid-electrolyte interphase growth, active-material loss, and nonlinear internal-resistance rise. Because these mechanisms interact with cycling, temperature, load, and charge protocol, a single recurrent or convolutional model often captures only part of the aging dynamics. I therefore combine long short-term memory, multi-head attention, and a Mamba selective state-space module to create a unified estimator for both remaining useful life and state of health of a lithium-ion cell.
The framework is first-person in the sense that I describe my own design choices, training procedure, and experimental interpretation. I treat the lithium-ion cell as a dynamic system whose observable features are generated by hidden electrochemical and thermal states. The goal is not merely to fit historical capacity fade, but to learn a representation that transfers across different lithium-ion cell trajectories, operating temperatures, and load conditions. I use z-score normalization, sequential feature extraction, dynamic attention weighting, selective state-space modeling, and a combined weighted loss. The result is a model that remains accurate when the lithium-ion cell enters accelerated degradation, and that provides stable estimates for both remaining useful life and state of health.
Problem formulation. For a lithium-ion cell observed at cycle index t, the remaining useful life is the number of future cycles before the capacity reaches an end-of-life threshold. If the end-of-life cycle is denoted by t_EOL, then the remaining useful life can be written as:
$$RUL_t = t_{EOL} – t$$
The state of health of a lithium-ion cell is the ratio of its current capacity to its initial capacity. If C_t is the capacity at cycle t and C_0 is the initial capacity, then:
$$SOH_t = \frac{C_t}{C_0} \times 100\%$$
I also define the end-of-life condition using a threshold lambda. In many battery-management studies, the end-of-life threshold is set to eighty percent of the initial capacity, so the lithium-ion cell is considered failed when:
$$C_{EOL} = \lambda C_0, \quad \lambda = 0.80$$
For a lithium-ion cell, remaining useful life is a future-oriented quantity, while state of health is a present-state quantity. Estimating both jointly is difficult because the two targets have different scales and different sensitivities. A small error in state of health near the end of life can correspond to a large error in remaining useful life. I therefore design the model to learn shared temporal features while allowing the output head to specialize for each target.
Input features and data preprocessing. I use a public nickel-manganese-cobalt lithium-ion cell degradation dataset. The trajectories include complete cycling histories, and the observable features reflect both electrical and thermal aging. The input features include cycle number, average temperature, internal resistance, charge time, and several differential-capacity statistics. The cycle number directly represents time accumulation. Average temperature influences reaction rates and solid-electrolyte interphase growth. Internal resistance reflects active-material loss and contact degradation. Charge time is correlated with active lithium loss and polarization. The differential-capacity features, including maximum, minimum, and variance, describe phase-transition behavior and electrode structural degradation.
| Feature | Physical interpretation for a lithium-ion cell | Expected aging relation |
|---|---|---|
| Cycle number | Accumulated charge-discharge history | Monotonic aging indicator |
| Average temperature | Thermal stress during cycling | Higher temperature can accelerate degradation |
| Internal resistance | Ohmic and polarization resistance | Increases as the lithium-ion cell ages |
| Charge time | Time required to reach charge termination | Often increases with polarization and active lithium loss |
| Maximum dQ/dV | Peak differential capacity | Shifts and shrinks with electrode degradation |
| Minimum dQ/dV | Valley differential capacity | Reflects phase-transition imbalance |
| Variance of dQ/dV | Dispersion of differential capacity | Broadens with heterogeneous aging |
Before training, I apply z-score normalization to every feature. This step is important because the lithium-ion cell data contain variables with different physical units and dynamic ranges. Voltage, current, temperature, resistance, and differential-capacity statistics cannot be compared directly. If I feed them to a neural network without scaling, the optimization becomes biased toward features with large numerical magnitude. The z-score transformation maps each feature to zero mean and unit variance:
$$z_i = \frac{x_i – \mu}{\sigma}$$
Here, x_i is the raw feature value, mu is the mean of that feature over the training set, and sigma is its standard deviation. After normalization, the lithium-ion cell features have consistent scale and the gradient-based optimizer can update all weights more uniformly. I compute the mean and standard deviation only from the training portion to avoid information leakage from the test set. This detail is essential when evaluating a lithium-ion cell estimator, because leakage can create an artificially optimistic state-of-health or remaining-useful-life score.

Hybrid network architecture. The architecture contains four main stages. First, the normalized features enter an LSTM layer, which learns temporal dependencies across charge-discharge cycles. Second, a multi-head attention module dynamically weights the LSTM outputs so that the most informative aging indicators dominate the representation. Third, a Mamba module performs selective state-space sequence modeling to capture long-range nonlinear dependencies. Fourth, task-specific output layers produce remaining useful life and state of health estimates. I use the same shared trunk for both tasks, but I allow the final regression heads to adapt to the different numerical ranges of the two targets.
The LSTM module is suitable for a lithium-ion cell because the degradation process is sequential and history-dependent. The internal resistance at cycle t depends on prior cycling, temperature exposure, and charge protocol. A standard feed-forward network would ignore this ordering. An LSTM maintains a cell state and hidden state that carry information across time. The forget gate controls how much old information is retained. The input gate controls how much new information enters the cell state. The output gate controls how much of the internal state is exposed to the next layer. I use the following standard LSTM equations:
$$f_t = \sigma(W_f [h_{t-1}, x_t] + b_f)$$
$$i_t = \sigma(W_i [h_{t-1}, x_t] + b_i)$$
$$\tilde{C}_t = \tanh(W_C [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 [h_{t-1}, x_t] + b_o)$$
$$h_t = o_t \odot \tanh(C_t)$$
In these equations, f_t is the forget gate, i_t is the input gate, o_t is the output gate, C_t is the cell state, h_t is the hidden state, x_t is the normalized input at cycle t, W terms are weight matrices, b terms are bias vectors, sigma is the sigmoid function, and the symbol odot denotes element-wise multiplication. For a lithium-ion cell, the cell state can be interpreted as a latent aging memory. It accumulates slow degradation effects while the gates filter short-term fluctuations such as measurement noise or temporary load changes.
After the LSTM layer, I apply multi-head attention. A single attention head can only compute one set of similarity weights. However, a lithium-ion cell has multiple interacting aging dimensions. Voltage behavior, temperature, internal resistance, and differential capacity can have correlated but not identical effects. Multi-head attention projects the sequence into several subspaces and computes attention independently in each subspace. I use four heads, because four heads provide a good balance between representation capacity and computational cost. The queries, keys, and values are obtained by linear projections:
$$Q = X W_q, \quad K = X W_k, \quad V = X W_v$$
The scaled attention score for each head is:
$$A = \frac{Q K^T}{\sqrt{d_k}}$$
The attention weights are produced by a softmax operation:
$$\alpha = \text{softmax}(A)$$
For each head, the output is a weighted combination of values:
$$\text{head}_j = \alpha_j V_j$$
Finally, the heads are concatenated and linearly transformed:
$$\text{MHA}(Q,K,V) = \text{Concat}(\text{head}_1, \text{head}_2, \ldots, \text{head}_h) W_o$$
In my model, h equals four. This module allows the network to emphasize different aging signatures at different cycles. For example, one head may focus on internal-resistance growth, another on charge-time elongation, another on differential-capacity variance, and another on thermal stress. The attention weights are not fixed; they are recomputed for each input sequence. Therefore, the model can adapt to a lithium-ion cell that ages primarily through lithium inventory loss, and also to a lithium-ion cell that ages primarily through impedance rise.
The Mamba module is the most distinctive component. Mamba is a selective state-space model that processes sequences with linear-time complexity. Its state-space formulation originates from continuous-time linear dynamical systems. For a continuous state h(t), input x(t), and output y(t), the system can be written as:
$$\frac{dh(t)}{dt} = A h(t) + B x(t)$$
$$y(t) = C h(t) + D x(t)$$
Here, A is the state transition matrix, B is the input matrix, C is the output matrix, and D is the direct feedthrough matrix. To use this model on discrete battery cycles, I discretize the continuous system. With a step size Delta, the discrete state transition is approximated by:
$$\bar{A} = \exp(\Delta A)$$
$$\bar{B} = (\Delta A)^{-1} (\exp(\Delta A) – I) \Delta B$$
The discrete recurrence then becomes:
$$h_t = \bar{A} h_{t-1} + \bar{B} x_t$$
$$y_t = C h_t + D x_t$$
In Mamba, the matrices B, C, and Delta are not fixed constants. They are generated from the input through learned linear projections. This selective mechanism allows the model to decide which information should be stored, updated, or ignored. For a lithium-ion cell, this is valuable because not every cycle carries equal aging information. Some cycles are close to nominal operation, while others contain accelerated degradation or recovery-like fluctuations. The selective state-space model can modulate its memory update according to the input. I express the input-dependent parameters as:
$$B_t = \text{Linear}_B(x_t)$$
$$C_t = \text{Linear}_C(x_t)$$
$$\Delta_t = \text{softplus}(\text{Linear}_\Delta(x_t))$$
The resulting selective recurrence is:
$$h_t = \bar{A}_t h_{t-1} + \bar{B}_t x_t$$
$$y_t = C_t h_t + D x_t$$
The scan module then computes this recurrence efficiently across the sequence. For a lithium-ion cell, the scan module acts like a learned sliding analysis over the degradation trajectory. It can connect information from early cycles to late-life behavior without the quadratic cost of full self-attention. This property is important because battery aging data can contain thousands of cycles, and a lithium-ion cell estimator must remain practical for online or near-online deployment.
| Component | Function in the lithium-ion cell estimator | Key advantage |
|---|---|---|
| LSTM layer | Extracts local temporal dependencies from charge-discharge cycles | Strong short-term and medium-term memory |
| Multi-head attention | Weights important aging features across multiple subspaces | Dynamic feature selection and noise suppression |
| Mamba module | Models long-range nonlinear dependencies with selective state updates | Linear-time sequence modeling and adaptive memory |
| Regression heads | Produces remaining useful life and state of health outputs | Task-specific output calibration |
| Combined loss | Balances robustness and late-life sensitivity | Better handling of outliers and accelerated degradation |
Why the hybrid design matters for a lithium-ion cell. A pure LSTM can model temporal order, but it may struggle when the sequence is long and the degradation signal is weak. A pure attention model can relate distant cycles, but it may overfit noise and lacks an explicit recurrent memory. A pure Mamba model can process long sequences efficiently, but its selective state may not extract local gate-like patterns as naturally as an LSTM. By combining the three, I create a representation that contains local temporal features, globally weighted features, and selectively propagated long-range features. This is particularly relevant for a lithium-ion cell because degradation is both local and global: local cycling events influence immediate state, while cumulative exposure determines the long-term trajectory.
Combined weighted loss function. I train the network with a composite loss that combines smooth L1 loss and weighted mean squared error. The smooth L1 component reduces sensitivity to outliers. The weighted mean squared error component increases the penalty on errors in late-life cycles, where the lithium-ion cell may enter accelerated degradation. I define smooth L1 loss as:
$$L_{SL1}(y,\hat{y}) = \begin{cases} 0.5 (y-\hat{y})^2, & |y-\hat{y}| \le 1 \\ |y-\hat{y}| – 0.5, & |y-\hat{y}| \gt 1 \end{cases}$$
Here, y is the true value and y_hat is the predicted value. When the absolute error is at most one, the loss behaves quadratically and provides smooth gradients. When the absolute error is larger than one, the loss behaves linearly and limits the influence of extreme deviations. In battery data, outliers can arise from sensor drift, unusual load pulses, or temporary thermal events. A purely quadratic loss would allow these outliers to dominate the gradient. The smooth L1 component makes the lithium-ion cell estimator more robust.
The weighted mean squared error is:
$$L_{WMSE} = \frac{1}{n} \sum_{i=1}^{n} \omega_i (y_i – \hat{y}_i)^2$$
The sample weight omega_i increases for cycles beyond a threshold. I use a piecewise weight function based on cycle index c_i, maximum cycle count C_max, threshold eta, and scaling factor tau. The weight is:
$$\omega_i = \begin{cases} 1, & c_i \lt \eta C_{\max} \\ 1 + \tau \frac{c_i – \eta C_{\max}}{(1-\eta) C_{\max}}, & c_i \ge \eta C_{\max} \end{cases}$$
I set eta to 0.70 and tau to 0.50. This means that before seventy percent of the total life, every cycle has unit weight. After that point, the weight increases linearly with cycle index. The purpose is not to ignore early-life behavior, but to prevent the model from underfitting the late-life region. For a lithium-ion cell, the late-life region contains the most safety-critical information because capacity fade and resistance rise accelerate. A model that predicts early cycles well but misses the knee point is not sufficient for remaining-useful-life estimation. The combined loss is:
$$L_C = \alpha L_{SL1} + \beta L_{WMSE}$$
I require alpha plus beta to equal one. In my main experiments, alpha is 0.70 and beta is 0.30. This weighting preserves the robustness of smooth L1 while still emphasizing late-life squared error. I also test other combinations, as described later. The combined loss is a key reason why my model handles both stable degradation and accelerated degradation within the same lithium-ion cell trajectory.
| Loss component | Role for a lithium-ion cell | Behavior under outliers | Behavior in late life |
|---|---|---|---|
| Smooth L1 | Stable optimization and robust fitting | Linear penalty limits outlier influence | Moderate sensitivity |
| Weighted MSE | Emphasis on critical late-life degradation | Quadratic penalty can be sensitive | Strong sensitivity |
| Combined weighted loss | Robustness plus late-life focus | Balanced by smooth L1 | Enhanced by adaptive weights |
Training configuration. I train the model for two thousand epochs. I use the Adam optimizer with a learning rate of 0.0001 and a weight decay of 0.00001. The hidden dimension is sixteen, and the number of attention heads is four. I randomly select seventy percent of the trajectories for training and reserve thirty percent for testing. I repeat the experiment four times with different random splits to assess stability. The training environment uses Python 3.11, PyCharm 2023, and an NVIDIA GeForce GTX 4060 Ti GPU. These details matter because a lithium-ion cell estimator must be reproducible, and the split protocol determines whether the reported metrics reflect generalization or memorization.
| Hyperparameter | Value | Reason for selection |
|---|---|---|
| Epochs | 2000 | Enough iterations for convergence on battery degradation data |
| Optimizer | Adam | Adaptive learning rates for mixed feature scales |
| Learning rate | 0.0001 | Stable update for a lithium-ion cell sequence model |
| Weight decay | 0.00001 | Mild regularization |
| Hidden dimension | 16 | Compact representation and reduced overfitting |
| Attention heads | 4 | Balance between multi-view attention and cost |
| Training split | 70% | Standard held-out evaluation |
| Testing split | 30% | Assess generalization to unseen lithium-ion cell cycles |
| Alpha | 0.70 | Favor robustness while retaining late-life weighting |
| Beta | 0.30 | Complement smooth L1 with weighted squared error |
Evaluation metrics. I evaluate remaining useful life and state of health with mean squared error, root mean squared error, mean absolute error, and the coefficient of determination. For a lithium-ion cell, these metrics provide complementary information. Mean squared error and root mean squared error emphasize large deviations, which are critical when the model underestimates imminent failure. Mean absolute error describes typical error magnitude and is less sensitive to outliers. The coefficient of determination measures how much variance the model explains. I define mean squared error as:
$$E_{MSE} = \frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)^2$$
Root mean squared error is the square root of mean squared error:
$$E_{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)^2}$$
Mean absolute error is:
$$E_{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_i – \hat{y}_i|$$
The coefficient of determination is:
$$R^2 = 1 – \frac{\sum_{i=1}^{n} (y_i – \hat{y}_i)^2}{\sum_{i=1}^{n} (y_i – \bar{y})^2}$$
Here, y_i is the true value, y_hat_i is the predicted value, y_bar is the mean of the true values, and n is the number of samples. For a lithium-ion cell, a high R-squared value indicates that the model follows the overall degradation trend. A low root mean squared error indicates that the pointwise estimates are close to the measured values. I report all four metrics because no single metric is sufficient for battery health management.
Remaining useful life estimation results. I first evaluate remaining useful life. The model captures the monotonic decline of the lithium-ion cell and follows the curvature of the degradation trajectory. In the early and middle stages, the predictions are close to the measured values. In the late stage, the model remains accurate even when the capacity fade accelerates. This is important because many models fail near the knee point, where the lithium-ion cell transitions from gradual aging to rapid aging. The four random experiments produce the following metrics:
| Experiment | MSE | RMSE | MAE | R-squared |
|---|---|---|---|---|
| 1 | 324.4839 | 18.0134 | 12.4354 | 0.9988 |
| 2 | 236.3104 | 15.3724 | 11.7613 | 0.9979 |
| 3 | 162.4385 | 12.7451 | 9.5713 | 0.9985 |
| 4 | 288.5141 | 16.9857 | 14.0929 | 0.9990 |
The mean squared error ranges from 162.4385 to 324.4839. This variation indicates that some lithium-ion cell trajectories are more difficult than others. The root mean squared error ranges from 12.7451 to 18.0134 cycles, and the mean absolute error ranges from 9.5713 to 14.0929 cycles. The R-squared values are all above 0.9979, which means the model explains almost all variance in remaining useful life. The slight increase in error near the end of life is expected because the lithium-ion cell can exhibit a nonlinear knee. My Mamba module improves this region compared with recurrent-only baselines, but some local underestimation remains. Even so, the overall accuracy is high and stable.
State of health estimation results. I then evaluate state of health. The target is a normalized capacity ratio, so the numerical scale is much smaller than remaining useful life. The model predicts state of health with very low error. The early and middle stages are almost indistinguishable from the true trajectory. In the late stage, there is a small deviation in some experiments, especially when the capacity drops sharply. This is consistent with the fact that state of health is directly tied to capacity measurement, and capacity fade can be noisy near end of life. The four experiments produce the following metrics:
| Experiment | MSE (times 10^-2) | RMSE | MAE | R-squared |
|---|---|---|---|---|
| 1 | 0.0012 | 0.0034 | 0.0025 | 0.9932 |
| 2 | 0.0036 | 0.0060 | 0.0054 | 0.9769 |
| 3 | 0.0040 | 0.0063 | 0.0040 | 0.9742 |
| 4 | 0.0013 | 0.0036 | 0.0025 | 0.9923 |
The root mean squared error for state of health ranges from 0.0034 to 0.0063, and the mean absolute error ranges from 0.0025 to 0.0054. These values are extremely small, which means the model estimates the health of the lithium-ion cell with high precision. The R-squared values range from 0.9742 to 0.9932. The small drop in the third experiment suggests that one split contains a more complex degradation pattern. Even in that case, the model explains more than ninety-seven percent of the variance. This strongly supports the use of the hybrid architecture for lithium-ion cell health estimation.
Uncertainty behavior. I also examine predictive uncertainty using Monte Carlo dropout. During inference, I randomly drop ten percent of neurons and repeat the forward pass one hundred times. The predictive variance is estimated as:
$$\sigma^2 = \frac{1}{N} \sum_{i=1}^{N} (\hat{y}_i – \mu)^2$$
Here, N is the number of Monte Carlo samples, y_hat_i is the prediction from sample i, and mu is the mean prediction. The resulting confidence intervals are narrow for most trajectories, which indicates stable estimation. Some lithium-ion cell trajectories show wider intervals in the late-life region, where degradation is more variable. This behavior is acceptable because uncertainty should increase when the system approaches failure. A battery management system can use this uncertainty signal to trigger maintenance or reduce load before the lithium-ion cell reaches a critical state.
| Trajectory type | Uncertainty pattern | Interpretation for a lithium-ion cell |
|---|---|---|
| Stable early-life trajectory | Narrow interval | Low degradation ambiguity |
| Moderate middle-life trajectory | Moderately narrow interval | Model confidence remains high |
| Accelerated late-life trajectory | Wider interval | Knee-point variability and aging heterogeneity |
| Noisy measurement trajectory | Increased interval | Sensor noise or unusual operating condition |
Loss function comparison. I compare smooth L1 loss, weighted mean squared error, and the combined weighted loss. The goal is to verify that the combined loss improves late-life fitting without sacrificing robustness. Smooth L1 alone is stable but does not emphasize the critical end-of-life region enough. Weighted mean squared error alone emphasizes late life but can be disturbed by outliers. The combined loss gives the best trade-off. It follows the nonlinear capacity fade more closely, and its prediction curve is smoother when the lithium-ion cell data contain abrupt fluctuations.
| Loss function | RUL behavior | SOH behavior | Overall assessment |
|---|---|---|---|
| Smooth L1 only | Stable but weaker near late-life knee | Good early and middle accuracy | Robust but not late-life focused |
| Weighted MSE only | Better late-life focus | Can be sensitive to outliers | Accurate but less robust |
| Combined weighted loss | Strong late-life tracking | Smooth and accurate | Best balance for a lithium-ion cell |
Weight coefficient analysis. I test four combinations of alpha and beta. The alpha coefficient controls smooth L1 loss, and beta controls weighted mean squared error loss. When alpha is too low, the model becomes too sensitive to late-life squared errors and may overreact to noisy cycles. When alpha is too high, the model becomes too robust and underweights the accelerated degradation region. The best result occurs at alpha equal to 0.70 and beta equal to 0.30. This combination gives the lowest remaining-useful-life MSE and the lowest state-of-health MSE in my experiments.
| Experiment | Alpha | Beta | RUL MSE | SOH MSE (times 10^-2) |
|---|---|---|---|---|
| 1 | 0.4 | 0.6 | 298.6 | 0.0042 |
| 2 | 0.5 | 0.5 | 310.2 | 0.0024 |
| 3 | 0.7 | 0.3 | 288.5 | 0.0013 |
| 4 | 0.9 | 0.1 | 342.7 | 0.0056 |
The third configuration is the most balanced. It does not ignore smooth L1 robustness, and it still applies enough weighted MSE to focus on late-life behavior. For a lithium-ion cell, this is important because the model must be reliable in both normal cycling and accelerated aging. A loss that is too aggressive may reduce average error but create unstable predictions at the knee. A loss that is too conservative may produce smooth but biased late-life estimates. The selected weights avoid both extremes.
Ablation study. I remove individual components to quantify their contribution. I test LSTM alone, multi-head attention alone, LSTM plus attention, LSTM plus Mamba, attention plus Mamba, and the full hybrid. The full model achieves the best metrics. LSTM alone captures temporal structure but misses long-range selective memory. Attention alone can weight features but lacks recurrence and state propagation. LSTM plus attention improves over either alone, but it still lacks the Mamba module’s selective long-range processing. The combinations with Mamba are consistently stronger. The full LSTM plus attention plus Mamba model gives the lowest RMSE and MAE and the highest R-squared.
| LSTM | Attention | Mamba | MSE (times 10^-2) | RMSE | MAE | R-squared |
|---|---|---|---|---|---|---|
| Yes | No | No | 0.0106 | 0.0103 | 0.0083 | 0.9381 |
| No | Yes | No | 0.0190 | 0.0138 | 0.0100 | 0.8886 |
| Yes | Yes | No | 0.0027 | 0.0052 | 0.0038 | 0.9840 |
| Yes | No | Yes | 0.0014 | 0.0038 | 0.0030 | 0.9912 |
| No | Yes | Yes | 0.0018 | 0.0043 | 0.0032 | 0.9895 |
| Yes | Yes | Yes | 0.0012 | 0.0034 | 0.0025 | 0.9932 |
The ablation results show that each module contributes uniquely. LSTM provides temporal memory for the lithium-ion cell. Attention provides dynamic feature weighting. Mamba provides selective long-range state propagation. When I combine all three, the errors decrease and the R-squared value increases. The improvement is not merely additive; the modules complement one another. LSTM creates a clean local representation, attention reweights it, and Mamba propagates the most relevant information across the full cycle history. This is why the hybrid model is more robust than any single-module baseline.
| Model configuration | Main strength | Main limitation | Best use case for a lithium-ion cell |
|---|---|---|---|
| LSTM only | Local temporal memory | Weak long-range selective memory | Short trajectories with mild aging |
| Attention only | Global feature weighting | No recurrent state propagation | Feature-rich but shorter sequences |
| LSTM plus attention | Local memory and feature weighting | Still limited at very long horizons | Moderate-length battery cycling data |
| LSTM plus Mamba | Local memory and selective state space | Less explicit multi-view weighting | Long sequences with nonlinear aging |
| Attention plus Mamba | Global weighting and selective state space | Weaker local gate-like memory | Irregular cycling and noisy data |
| Full hybrid | All three complementary mechanisms | Higher computational cost than a single module | Accurate RUL and SOH for a lithium-ion cell |
Performance comparison and interpretation. The root mean squared error and mean absolute error comparisons confirm the ablation results. LSTM alone and attention alone have the highest errors. Adding attention to LSTM reduces the error substantially. Adding Mamba produces a further reduction. The full model has the smallest error and the highest stability across random splits. For a lithium-ion cell, this means the estimator can be trusted across different aging stages. The model does not simply fit the average trajectory; it captures the local changes that matter for maintenance decisions.
| Metric | Best single module | Best two-module combination | Full hybrid | Improvement |
|---|---|---|---|---|
| RMSE | 0.0103 with LSTM | 0.0038 with LSTM plus Mamba | 0.0034 | About 67 percent lower than LSTM alone |
| MAE | 0.0083 with LSTM | 0.0030 with LSTM plus Mamba | 0.0025 | About 70 percent lower than LSTM alone |
| MSE | 0.0106 with LSTM | 0.0014 with LSTM plus Mamba | 0.0012 | About 89 percent lower than LSTM alone |
| R-squared | 0.9381 with LSTM | 0.9912 with LSTM plus Mamba | 0.9932 | Higher explained variance |
Computational considerations. The full hybrid model is larger than a single LSTM, but its sequence modeling cost remains acceptable because Mamba uses linear-time recurrence. Multi-head attention with four heads adds cost, but the hidden dimension is only sixteen, so the parameter count is modest. For a lithium-ion cell management system, this is a useful trade-off. The model is expressive enough to capture nonlinear aging, yet compact enough for embedded or edge deployment after optimization. If I needed further reduction, I could prune attention heads, quantize weights, or distill the hybrid into a smaller student model.
| Aspect | LSTM only | Attention only | Mamba only | Full hybrid |
|---|---|---|---|---|
| Sequence memory | Strong local | Global but no recurrence | Selective long-range | Local, global, and selective |
| Computational scaling | Linear | Quadratic | Linear | Linear recurrence with attention overhead |
| Noise robustness | Moderate | Can overfit noise | Good | High with combined loss |
| Late-life accuracy | Moderate | Variable | Good | Best |
| Suitability for lithium-ion cell | Basic | Feature-rich but limited | Strong for long sequences | Comprehensive |
Discussion. The experiments support several conclusions. First, a lithium-ion cell estimator benefits from multiple temporal inductive biases. LSTM gates capture local charge-discharge dependencies. Attention captures global feature relevance. Mamba captures selective long-range state evolution. Second, the combined weighted loss is important for late-life accuracy. The lithium-ion cell degradation curve often contains a knee, and a model trained only with ordinary mean squared error may smooth over this knee. Third, the hybrid model generalizes across random splits. The R-squared values for both remaining useful life and state of health remain high, which indicates that the model is not relying on a single trajectory-specific artifact. Fourth, uncertainty estimates from Monte Carlo dropout provide an additional safety signal. When the lithium-ion cell approaches end of life, the confidence interval widens, which can be used to trigger caution.
The model also has limitations. The experiments use one public nickel-manganese-cobalt lithium-ion cell dataset. Different chemistries, such as lithium iron phosphate or solid-state lithium-ion cells, may exhibit different degradation patterns. The model must be retrained or adapted before deployment on a new lithium-ion cell chemistry. The temperature and load ranges in the dataset are finite, so extrapolation to extreme conditions is uncertain. The attention and Mamba modules increase complexity compared with a simple recurrent network. Finally, the current work estimates remaining useful life and state of health from historical cycling features; it does not directly incorporate electrochemical impedance spectroscopy or full voltage-relaxation measurements. Adding such features could improve early prediction of lithium-ion cell aging.
| Challenge | Current response | Future direction |
|---|---|---|
| Chemistry shift | Retrain on target lithium-ion cell data | Use transfer learning and domain adaptation |
| Extreme temperature | Limited by dataset range | Add thermal stress tests and physics-informed priors |
| Long-horizon uncertainty | Monte Carlo dropout intervals | Use Bayesian uncertainty quantification |
| Embedded deployment | Compact hidden dimension | Prune, quantize, and distill the hybrid model |
| Data scarcity | Random split evaluation | Transfer learning from laboratory to field lithium-ion cell data |
Practical implications for battery management. For a battery management system, the output of this model can be used in several ways. Remaining useful life supports maintenance scheduling and warranty decisions. State of health supports charge-discharge limit adjustment and thermal management. The uncertainty estimate supports risk-aware control. If the predicted state of health of a lithium-ion cell drops below a threshold, the system can reduce the maximum charge current or shift the operating window to reduce stress. If the remaining useful life prediction indicates an approaching end-of-life condition, the system can issue a replacement warning. Because the model processes cycle-level features, it can be updated incrementally as new data arrive. The Mamba scan module is especially suitable for streaming or long-sequence updates because its recurrence is linear in sequence length.
Reproducibility and evaluation protocol. I use a fixed training and testing split for each experiment, but I repeat the split four times to avoid drawing conclusions from a single lucky partition. I standardize features using training statistics only. I report mean squared error, root mean squared error, mean absolute error, and R-squared for both targets. I compare against ablation variants and loss variants. I also examine uncertainty. This protocol is important for a lithium-ion cell study because battery datasets are often small, and a model can appear excellent if the test set is too similar to the training set. The high R-squared values in my experiments are supported by consistent error reductions across splits.
| Protocol element | Implementation | Purpose |
|---|---|---|
| Normalization | Training-set z-score | Prevent leakage and stabilize optimization |
| Random splits | Four experiments | Assess stability of lithium-ion cell prediction |
| Metrics | MSE, RMSE, MAE, R-squared | Evaluate large errors, typical errors, and variance |
| Ablation | Remove LSTM, attention, or Mamba | Quantify module contribution |
| Loss comparison | Smooth L1, weighted MSE, combined | Verify late-life and outlier behavior |
| Uncertainty | Monte Carlo dropout | Provide risk-aware confidence intervals |
Mathematical summary of the complete forward pass. For completeness, I summarize the forward computation for a lithium-ion cell sequence. Let the normalized input sequence be X. The LSTM produces hidden states H_LSTM. The attention module produces H_ATT. The Mamba module produces H_MAMBA. The regression heads produce the two outputs. I can write the pipeline as:
$$X = \{z_1, z_2, \ldots, z_T\}$$
$$H_{LSTM} = \text{LSTM}(X)$$
$$H_{ATT} = \text{MHA}(H_{LSTM}, H_{LSTM}, H_{LSTM})$$
$$H_{MAMBA} = \text{Mamba}(H_{ATT})$$
$$\hat{y}_{RUL} = f_{RUL}(H_{MAMBA})$$
$$\hat{y}_{SOH} = f_{SOH}(H_{MAMBA})$$
Here, T is the sequence length, z_t is the normalized feature vector at cycle t, and f_RUL and f_SOH are task-specific regression heads. The training objective is:
$$\min_{\theta} \frac{1}{N} \sum_{i=1}^{N} \left[ \alpha L_{SL1}(y_i, \hat{y}_i) + \beta L_{WMSE}(y_i, \hat{y}_i) \right]$$
In this expression, theta represents all trainable parameters. The optimization is performed with Adam. The model is trained jointly for remaining useful life and state of health. Joint training encourages the shared trunk to learn features that are useful for both tasks. In some cases, task-specific weighting could be used, but in my experiments the two targets benefit from the shared representation. The remaining useful life target emphasizes long-term trajectory shape, while the state of health target emphasizes current capacity level. Together, they regularize each other.
Key observations about lithium-ion cell degradation. The degradation of a lithium-ion cell is not a simple linear process. The early stage often shows slow capacity fade. The middle stage may appear nearly linear. The late stage can accelerate because of lithium inventory loss, impedance rise, and electrode structure damage. A model that uses only a global trend will miss the transition. My architecture addresses this by combining local recurrent features with selective long-range memory. The LSTM captures the immediate response to cycling. The attention module reweights features when the degradation mechanism changes. The Mamba module propagates state information across long horizons and adjusts its memory based on the input. The combined loss further focuses training on the late-life region. This design is directly motivated by the physical behavior of a lithium-ion cell.
| Degradation stage | Typical lithium-ion cell behavior | Model requirement | Hybrid response |
|---|---|---|---|
| Early life | Slow capacity fade and stable resistance | Accurate baseline and noise suppression | LSTM and smooth L1 provide stability |
| Middle life | Gradual trend with small fluctuations | Feature weighting and trend tracking | Attention highlights relevant aging features |
| Late life | Accelerated fade and nonlinear knee | Long-range memory and late-life focus | Mamba and weighted MSE emphasize critical changes |
| Near end of life | High uncertainty and rapid change | Risk-aware estimation | Monte Carlo dropout provides uncertainty intervals |
Comparative advantage over single-model approaches. A single LSTM can memorize short-term patterns, but its hidden state may saturate over very long sequences. A single attention model can compare distant cycles, but it may not preserve a compact recurrent state. A single Mamba model can handle long sequences, but it may not extract local gating patterns as effectively as an LSTM. My hybrid model avoids these limitations. The ablation table shows that removing any module increases error. The full model has the lowest mean squared error and the highest R-squared. For a lithium-ion cell, this means the estimator can simultaneously capture short-term dynamics, global feature relevance, and long-range selective memory.
Scalability and deployment. The hidden dimension of sixteen is deliberately compact. In a real battery management system, memory and computation are limited. A compact hybrid model can be deployed on an embedded controller after quantization. The linear-time Mamba recurrence is attractive for long lithium-ion cell histories. Multi-head attention with four heads is small enough for real-time inference when the sequence length is moderate. If the sequence length becomes very large, I can process the data in overlapping windows or use a streaming Mamba update. The regression heads are simple fully connected layers, so the additional cost is minimal. This design makes the method practical for online state-of-health and remaining-useful-life monitoring of a lithium-ion cell.
| Deployment factor | Design choice | Benefit for a lithium-ion cell |
|---|---|---|
| Hidden dimension | 16 | Low memory footprint |
| Attention heads | 4 | Multi-view feature weighting without excessive cost |
| Mamba recurrence | Linear scan | Efficient long-sequence processing |
| Loss function | Combined weighted loss | Robust and late-life sensitive |
| Uncertainty | Monte Carlo dropout | Risk-aware battery management |
Final conclusions. I have presented a hybrid LSTM plus Mamba network for estimating the remaining useful life and state of health of a lithium-ion cell. The model uses z-score normalization, an LSTM layer for temporal dependency extraction, a multi-head attention module for dynamic feature weighting, and a Mamba selective state-space module for long-range nonlinear modeling. I train it with a combined weighted loss that includes smooth L1 and weighted mean squared error. The experimental results show high accuracy and robustness for both remaining useful life and state of health. The ablation study confirms that each component contributes. The loss comparison confirms that the combined loss improves late-life behavior. The weight analysis confirms that alpha equal to 0.70 and beta equal to 0.30 is a strong configuration. The uncertainty analysis provides an additional risk signal. Overall, the proposed hybrid framework offers a practical and accurate approach for lithium-ion cell health management.
Future work can extend the method in several directions. I can evaluate the framework on lithium iron phosphate lithium-ion cells, solid-state lithium-ion cells, and different form factors. I can use transfer learning to adapt a model trained on laboratory lithium-ion cell data to field data. I can incorporate electrochemical impedance features and thermal imaging features. I can replace Monte Carlo dropout with a fully Bayesian treatment for more principled uncertainty quantification. I can also explore pruning and quantization for embedded implementation. These extensions would strengthen the method and broaden its applicability to lithium-ion cell management across electric vehicles, grid storage, and portable electronics.
| Future direction | Expected improvement | Relevance to lithium-ion cell management |
|---|---|---|
| Transfer learning | Cross-chemistry and cross-scenario adaptation | Reduces data collection burden for a new lithium-ion cell |
| Bayesian uncertainty | More reliable risk estimates | Supports safety-critical decisions |
| Impedance features | Earlier detection of internal aging | Improves remaining-useful-life prediction |
| Model compression | Lower latency and memory | Enables embedded lithium-ion cell monitoring |
| Physics-informed constraints | Better extrapolation beyond observed conditions | Constrains predictions with degradation principles |
In summary, my first-person design and evaluation show that a hybrid LSTM plus Mamba model is well suited to the nonlinear, multi-stage degradation of a lithium-ion cell. The model combines the strengths of recurrent memory, attention-based feature weighting, and selective state-space sequence modeling. It produces accurate remaining useful life and state of health estimates across multiple random experiments. It is robust to outliers through smooth L1 loss, sensitive to late-life changes through weighted mean squared error, and capable of long-range sequence modeling through Mamba. For a lithium-ion cell, these properties translate into better maintenance planning, safer operation, and more reliable health management.
