In the realm of modern energy systems, such as electric vehicles, portable electronics, and grid storage, the li-ion battery stands as a cornerstone technology. Its performance, safety, and longevity are paramount, with the accurate monitoring of the State of Charge (SOC) being a critical determinant. SOC reflects the remaining usable capacity of a li-ion battery, analogous to a fuel gauge, and its precise estimation is essential for efficient battery management, preventing overcharge or deep discharge, and optimizing operational lifespan. Traditionally, methods for SOC estimation have included coulomb counting, model-based approaches like Kalman filters, and various machine learning techniques. However, these often struggle with the inherent non-linearities, dynamic operating conditions, and long-term dependencies present in li-ion battery data. Challenges such as capacity fade, temperature sensitivity, and varying load profiles can severely degrade estimation accuracy. This necessitates the development of more robust, adaptive, and high-fidelity estimation strategies.
Recent advances in deep learning, particularly in sequence modeling, offer promising avenues. Among these, Temporal Convolutional Networks (TCNs) have emerged as a powerful architecture for processing time-series data. Unlike recurrent neural networks (RNNs) that process sequences sequentially and can suffer from vanishing gradients, TCNs employ convolutional operations that allow for parallel computation and inherently capture long-range dependencies through dilated convolutions. This makes them exceptionally suitable for modeling the temporal evolution of a li-ion battery’s parameters—voltage, current, and temperature—which are crucial for inferring SOC. In this work, I propose and detail a comprehensive framework for SOC estimation in li-ion batteries based solely on TCNs. The core hypothesis is that by leveraging the TCN’s ability to model complex temporal patterns across multiple scales, we can achieve superior estimation accuracy and robustness compared to conventional methods, even under varying environmental temperatures.

The operational data from a li-ion battery constitutes a multivariate time series. Let the input vector at any discrete time step \( k \) be denoted as \( \mathbf{x}(k) \in \mathbb{R}^3 \), comprising the measured terminal voltage \( U(k) \), current \( I(k) \) (where positive indicates charging, negative discharging), and surface temperature \( T(k) \). The target output is the corresponding SOC value, \( \text{SOC}(k) \in [0, 1] \). The primary challenge is to learn a mapping function \( \mathcal{F} \) such that \( \hat{\text{SOC}}(k) = \mathcal{F}(\mathbf{x}(1), \mathbf{x}(2), …, \mathbf{x}(k)) \), where \( \hat{\text{SOC}}(k) \) is the estimated value. A TCN is uniquely positioned to learn this function due to its architectural principles.
The foundational element of a TCN is the one-dimensional causal convolution. Causality ensures that the output at time \( t \) is convolved only with elements from time \( t \) and earlier in the previous layer, preventing information leakage from the future. For an input sequence \( \mathbf{X} = (x_0, x_1, …, x_T) \) and a filter \( \mathbf{f} = (f_0, f_1, …, f_{K-1}) \) of length \( K \), the causal convolution operation \( F \) at element \( s \) is defined as:
$$ F(s) = \sum_{i=0}^{K-1} f(i) \cdot x_{s – i} $$
To efficiently capture dependencies over extended histories without a prohibitive increase in parameters or network depth, TCNs employ dilated causal convolutions. The dilation factor \( d \) introduces a fixed step between filter taps. The dilated causal convolution is expressed as:
$$ F(s) = \sum_{i=0}^{K-1} f(i) \cdot x_{s – d \cdot i} $$
Here, \( d \) is typically increased exponentially with the network depth (e.g., \( d = 1, 2, 4, 8, … \)). This exponentially expands the receptive field, allowing a neuron in a deep layer to consider a wide context of the input sequence. For a li-ion battery, this means the model can integrate information from distant past states—such as a charging event hours ago—to better inform the current SOC, which is vital given the hysteresis and relaxation effects in li-ion battery electrochemistry.
A complete TCN block often incorporates residual connections to facilitate the training of very deep networks. Let the input to a residual block be \( \mathbf{x}_L \). The block’s transformation, which includes multiple dilated causal convolutional layers with non-linear activations (e.g., ReLU) and weight normalization, is denoted as \( \mathcal{T}(\mathbf{x}_L, \mathbf{W}_L) \). The output \( \mathbf{x}_{L+1} \) is then:
$$ \mathbf{x}_{L+1} = \mathbf{x}_L + \mathcal{T}(\mathbf{x}_L, \mathbf{W}_L) $$
If the dimensionality of \( \mathbf{x}_L \) and \( \mathcal{T}(\mathbf{x}_L, \mathbf{W}_L) \) differ, a 1×1 convolution is applied to \( \mathbf{x}_L \) to match dimensions:
$$ \mathbf{x}_{L+1} = \mathbf{W}’ \mathbf{x}_L + \mathcal{T}(\mathbf{x}_L, \mathbf{W}_L) $$
This residual learning framework helps mitigate gradient vanishing and enables the construction of very deep networks capable of extracting hierarchical features from the li-ion battery time-series data.
The specific TCN model I designed for li-ion battery SOC estimation consists of an input layer followed by a series of stacked residual blocks. The input layer receives the normalized sequence of \( [U(k), I(k), T(k)] \). Normalization is critical and is performed per feature using min-max scaling to the range \([-1, 1]\):
$$ \mathbf{x}_{\text{norm}}(k) = \frac{2(\mathbf{x}(k) – \mathbf{x}_{\text{min}})}{\mathbf{x}_{\text{max}} – \mathbf{x}_{\text{min}}} – 1 $$
where \( \mathbf{x}_{\text{max}} \) and \( \mathbf{x}_{\text{min}} \) are the maximum and minimum values computed from the training dataset for each feature. This stabilizes training and accelerates convergence.
The core network comprises 6 stacks, each containing 4 temporal convolutional layers. Each layer uses a kernel size of \( K=6 \), 64 filters, and a dilation rate that doubles at each layer within a stack, starting from 1. This design yields an expansive receptive field sufficient to capture long-term dynamics in li-ion battery discharge/charge cycles. The activation function is ReLU. Dropout with a rate of 0.1 is applied after each convolutional layer for regularization. The final layer is a fully connected layer that maps the high-level temporal features to a single scalar output, the estimated SOC. The overall architecture ensures that the model only uses past and present observations to make its prediction, adhering to the causal requirement for real-time estimation.
The training objective is to minimize the difference between the estimated SOC and the reference SOC. The reference SOC is typically obtained through precise laboratory-grade coulomb counting with initial capacity calibration. The loss function \( \mathcal{L} \) used for training is the Mean Squared Error (MSE):
$$ \mathcal{L} = \frac{1}{N} \sum_{i=1}^{N} (\text{SOC}_{\text{ref}}(i) – \hat{\text{SOC}}(i))^2 $$
where \( N \) is the number of samples in a training batch. The model is trained using the Adam optimizer, which adapts the learning rate for each parameter. The initial learning rate is set to \( 10^{-3} \). A dynamic learning rate scheduler (ReduceLROnPlateau) is employed, which reduces the learning rate by a factor of 0.5 if the validation loss does not improve for 5 consecutive epochs. Early stopping is also implemented to halt training if no improvement is observed for 10 epochs, preventing overfitting. The batch size is set to 32, and training runs for a maximum of 100 epochs.
To rigorously evaluate the proposed TCN model for li-ion battery SOC estimation, extensive experiments were conducted. The test subject was a commercial 18650 cylindrical li-ion battery with a nominal capacity of 3.2 Ah and a nominal voltage of 3.7 V. The experiment was designed to capture the influence of temperature, a critical factor affecting li-ion battery performance and SOC accuracy. Tests were performed under five controlled ambient temperatures: 5°C, 10°C, 15°C, 20°C, and 25°C. At each temperature, the li-ion battery underwent a complete charge-discharge cycle after a 5-hour rest period for thermal and electrochemical stabilization.
The charging protocol followed the standard Constant Current-Constant Voltage (CC-CV) method: first, a constant current of 1.0C (3.2 A) was applied until the voltage reached 4.2 V; then, the voltage was held at 4.2 V until the current tapered down to 0.05C (0.16 A). Discharge was conducted at a constant current of 1.0C (3.2 A) until the voltage cut-off of 2.5 V was reached. Voltage, current, and temperature were sampled at a 1-second interval throughout the cycles, generating rich, high-resolution time-series datasets. For each temperature, 70% of the data was used for training, 15% for validation, and the remaining 15% for testing.
The performance of the TCN model was benchmarked against three other widely-used neural network models: a standard Backpropagation Neural Network (BPNN), a basic Recurrent Neural Network (RNN) with tanh activation, and a Long Short-Term Memory network (LSTM). All models were trained and tested on the identical datasets under the same conditions to ensure a fair comparison. The primary evaluation metrics were Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE), defined as:
$$ \text{MAE} = \frac{1}{M} \sum_{j=1}^{M} | \text{SOC}_{\text{ref}}(j) – \hat{\text{SOC}}(j) | \times 100\% $$
$$ \text{MSE} = \frac{1}{M} \sum_{j=1}^{M} (\text{SOC}_{\text{ref}}(j) – \hat{\text{SOC}}(j))^2 \times 100\% $$
$$ \text{RMSE} = \sqrt{\frac{1}{M} \sum_{j=1}^{M} (\text{SOC}_{\text{ref}}(j) – \hat{\text{SOC}}(j))^2} \times 100\% $$
Here, \( M \) is the total number of test samples. These metrics provide a comprehensive view of the estimation error, with MAE representing the average absolute deviation, MSE emphasizing larger errors, and RMSE providing an error measure in the same units as SOC (percentage).
The performance of the TCN model across the five temperature conditions is summarized in Table 1. The results clearly demonstrate the model’s capability and the significant impact of temperature on estimation fidelity for a li-ion battery.
| Temperature (°C) | MAE (%) | MSE (%) | RMSE (%) |
|---|---|---|---|
| 5 | 0.39 | 0.25 | 0.50 |
| 10 | 0.32 | 0.16 | 0.40 |
| 15 | 0.48 | 0.36 | 0.60 |
| 20 | 0.22 | 0.08 | 0.27 |
| 25 | 0.16 | 0.04 | 0.20 |
The data reveals a general trend of improving accuracy with increasing temperature for the li-ion battery. The lowest errors are achieved at 25°C, with an MAE of merely 0.16%. This can be attributed to the more favorable electrochemical kinetics at higher temperatures within this range. In a li-ion battery, increased temperature reduces internal resistance, enhances ionic conductivity in the electrolyte, and promotes more complete electrode reactions. This leads to more stable and predictable voltage and current profiles, which the TCN model can learn more effectively. The slight anomaly at 15°C, where errors peak, might be associated with a transitional region in the li-ion battery’s electrolyte viscosity or solid-electrolyte interphase (SEI) dynamics, causing slightly noisier or less linear characteristics that are momentarily more challenging for the model to capture.
The superiority of the TCN architecture becomes even more evident when compared to other neural network models. Table 2 presents the average performance metrics across all temperatures for each model, providing a holistic view of their estimation capabilities for the li-ion battery SOC task.
| Model | MAE (%) | MSE (%) | RMSE (%) |
|---|---|---|---|
| BPNN | 1.62 | 9.05 | 2.98 |
| RNN | 1.11 | 1.77 | 1.31 |
| LSTM | 0.76 | 1.15 | 1.06 |
| TCN (Proposed) | 0.53 | 0.41 | 0.64 |
The BPNN, lacking any inherent temporal modeling capacity, performs the worst. It treats each time step independently, failing to capture the essential stateful nature of the li-ion battery system, resulting in high error and instability. The RNN shows improvement by modeling sequences but is hampered by its difficulty in learning long-range dependencies due to vanishing gradients. The LSTM, with its gated memory cells, significantly outperforms the RNN, demonstrating its design is better suited for capturing temporal patterns in li-ion battery data. However, the proposed TCN model surpasses all, achieving the lowest MAE, MSE, and RMSE. This underscores the advantage of TCN’s dilated convolutional structure: it provides a stable gradient flow, allows for very deep networks with large receptive fields, and enables highly efficient parallel computation during training. The TCN’s ability to explicitly model multi-scale temporal dependencies is particularly beneficial for the li-ion battery, where SOC depends on both immediate current integration and long-term historical state effects.
To further illustrate the operational characteristics of the li-ion battery under test, key electrical parameters are worth noting. During a constant current discharge, the relationship between voltage, capacity, and state is fundamental. The delivered capacity \( Q_{\text{dis}}(t) \) up to time \( t \) is given by:
$$ Q_{\text{dis}}(t) = \int_{0}^{t} |I(\tau)| \, d\tau \quad \text{for} \quad I(\tau) < 0 $$
The theoretical SOC at time \( t \), assuming perfect initial conditions, is:
$$ \text{SOC}(t) = 1 – \frac{Q_{\text{dis}}(t)}{C_{\text{nominal}}} $$
where \( C_{\text{nominal}} \) is the nominal capacity. However, in practice, the available capacity \( C_{\text{available}}(T) \) of a li-ion battery is strongly temperature-dependent, often modeled empirically. A simple linear approximation in the tested range could be:
$$ C_{\text{available}}(T) \approx C_{\text{nominal}} \cdot [1 + \alpha (T – T_{\text{ref}})] $$
where \( \alpha \) is a temperature coefficient and \( T_{\text{ref}} \) is a reference temperature (e.g., 25°C). This dependency is implicitly learned by the TCN from the input temperature signal, allowing it to adjust its estimation accordingly without an explicit physical model.
The robustness of the TCN model can also be analyzed through its error distribution. For a well-trained model on li-ion battery data, the estimation errors \( e(j) = \text{SOC}_{\text{ref}}(j) – \hat{\text{SOC}}(j) \) should ideally have a mean close to zero and a small variance. The variance of the error is directly related to the MSE:
$$ \text{Var}(e) = \text{MSE} – (\text{Mean}(e))^2 $$
In our results, the low MSE values across temperatures, especially at 20°C and 25°C, indicate not only low bias but also low variance, signifying consistent and reliable estimates for the li-ion battery SOC.
In conclusion, this work has presented a novel and effective data-driven approach for estimating the State of Charge in li-ion batteries using Temporal Convolutional Networks. The proposed TCN model directly consumes raw operational time-series data—voltage, current, and temperature—and learns to map these to accurate SOC values. Through rigorous experimentation under multiple temperature conditions, the model demonstrated high accuracy, with performance improving in milder temperatures that are typical for many li-ion battery applications. A comparative study against BPNN, RNN, and LSTM models confirmed the superior performance of the TCN architecture, attributable to its large receptive field, stable training dynamics, and powerful temporal feature extraction capabilities. The method is inherently causal and suitable for real-time implementation.
Future work will focus on enhancing the model’s practicality and robustness for real-world li-ion battery management systems. Key directions include: 1) Integrating adaptive or online learning mechanisms to allow the model to continuously update and compensate for li-ion battery aging effects and capacity fade over its lifetime. 2) Expanding the input feature set to include parameters like internal resistance or electrochemical impedance spectroscopy (EIS) derived features, if available, to further improve estimation under extreme conditions. 3) Deploying the trained TCN model on embedded hardware to evaluate its computational efficiency and real-time performance in actual li-ion battery packs. The promising results shown here firmly establish TCNs as a compelling tool for advanced battery state estimation, paving the way for smarter, safer, and more efficient energy storage systems centered on the ubiquitous li-ion battery.
