scieee AI-readable full text Open interactive document viewer

Comprehensive Machine Learning Approaches for Modelling the State of Charge of Lithium-ion Batteries

Hálová, Hana; Rae, Mitchell; Capkova, Dominika; Kazda, Tomáš; Bouzek, Karel; Paušová, Šárka

Abstract

This paper evaluates three ML approaches for SOC modeling in LIBs: the multilayer perceptron (MLP), long short-term memory (LSTM), and the nonlinear autoregressive with exogenous input (NARX) neural network architectures. These models were tested using an experimental dataset with multiple input variables, including electrochemical impedance spectroscopy (EIS) data, voltage, and capacity readings for commercial LIB cells. Results indicate that MLP and LSTM are more adaptable with a smaller training dataset (14 samples), while the NARX model required more than 34 out of 67 samples to achieve reasonable accuracy. Additionally, the NARX model is more sensitive to changes in the learning rate (α) and exhibits larger output error deviations. The MLP and LSTM models consistently performed well across various hidden layer sizes, showing no upper bound constraints, whereas the NARX model's performance deteriorated with certain hidden layer configurations.

Full text

Contents lists available at ScienceDirect Journal of Power Sources journal homepage: www.elsevier.com/locate/jpowsour Comprehensive machine learning approaches for modelling the state of charge of lithium-ion batteries Mitchell Raea, Michela Ottavianib,c, Dominika Capkovac,d, Tomáš Kazdad, Luigi Jacopo Santa Mariac, Kevin M. Ryanc, Stefano Passerinie, Mehakpreet Singha,∗ aMathematics Applications Consortium for Science and Industry (MACSI), Department of Mathematics and Statistics, University of Limerick, Limerick V94 T9PX, Ireland bDepartment of Applied Sciences, Technological University of the Shannon, Moylish Campus, Limerick V94EC5T, Ireland cDepartment of Chemical Sciences and Bernal Institute, University of Limerick, Limerick V94 T9PX, Ireland dDepartment of Electrical and Electronic Technology, Faculty of Electrical Engineering and Communication, Brno University of Technology, Brno, Czech Republic eHelmholtz Institute Ulm (HIU) für Elektrochemische Energiespeicherung, Helmholtzstraße 11, 89081 Ulm, Germany H I G H L I G H T S •MLP, LSTM and NARX are used to model SOC in LiBs with coarse datasets. •MLP and LSTM are more adaptable with a smaller training dataset. •Higher correlation between SOC and EIS data is found for EIS measured at 0% SOC. •Strengths and weaknesses of the MLP, LSTM and NARX are discussed. •Effects of training size, hidden layers and learning rates of ANNs are discussed. G R A P H I C A L A B S T R A C T A R T I C L E I N F O Dataset link:https://zenodo.org/records/1336 1914 Keywords: Machine learning Deep artificial neural network Li-ion batteries State of charge Mathematical modelling Coarse dataset A B S T R A C T The advancement of lithium-ion batteries (LIBs) is vital for achieving net-zero emissions because it enables renewable energy integration, supports electric vehicle (EV) adoption, and promotes cost-effective and sustainable solutions. The growing demand for EVs and portable electronics has amplified the need for reliable battery management systems to ensure safety and performance. Machine learning (ML) methods for modelling the state of charge (SOC) in batteries are gaining traction owing to their adaptability to diverse datasets and lower computational demands. However, the challenge lies in selecting the most suitable ML architecture for a specific application. This study evaluates three ML approaches for SOC modelling in LIBs: multilayer perceptron (MLP), long short-term memory (LSTM), and nonlinear autoregressive with exogenous input (NARX) neural networks. The models were tested using an experimental dataset with multiple input variables, including electrochemical impedance spectroscopy data, voltage, and capacity from commercial LIB cells. The results show that MLP and LSTM perform effectively with smaller training datasets (14 samples), whereas the NARX model requires more extensive data (34 out of 67 samples) for accuracy. Additionally, the NARX model showed greater sensitivity to learning rate adjustments and hidden layer configurations, whereas MLP and LSTM maintained robust performance across varying parameters. ∗Corresponding author. E-mail addresses: [email protected] (M. Rae), [email protected] (M. Ottaviani), [email protected] (D. Capkova), [email protected] (T. Kazda), [email protected] (L.J.S. Maria), [email protected] (K.M. Ryan), [email protected] (S. Passerini), [email protected] (M. Singh). https://doi.org/10.1016/j.jpowsour.2025.236929 Received 15 January 2025; Received in revised form 14 March 2025; Accepted 29 March 2025 Journal of Power Sources 646 (2025) 236929 Available online 8 May 2025 0378-7753/© 2025 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license ( http://creativecommons.org/licenses/by/4.0/ ). M. Rae et al. 1. Introduction [1] The adoption of electric vehicles (EVs), including e-scooters, ebikes, e-trucks, and other forms of e-mobility, has experienced rapid growth worldwide over the past decade. By 2022, the number of electric cars alone on the road exceeded 26 million, marking a 60% increase compared to 2021 and surpassing more than five times the stock recorded in 2018 (Trends in electric light-duty vehicles -- Global EV Outlook 2023 -- Analysis - IEA). This growth is in line with the targets outlined in the Paris Action Agenda on Electro-Mobility and Climate Change (The Paris Agreement | UNFCCC). Upon comparing the technological readiness of batteries available in the market, it is evident that LIBs continue to dominate [2,3]. Comparative analysis of diverse battery chemistries is rooted in critical factors, including energy density, power density, cycle life, calendar life, and cost per kWh. An assessment based on these parameters underscores the preeminence of LIBs as a leading technology in the foreseeable future, boasting superior energy density, efficiency, and an extended lifespan. In addition, LIBs display the potential for noteworthy short-term enhancement [2,4,5]. Nevertheless, the effective performance of the battery can be significantly compromised by sudden temperature changes, and incidents such as fire and battery destruction are common consequences of overcharging [1,2,4,6]. These aspects raise serious safety concerns, particularly when considering the use of LIBs in EVs. Moreover, meeting the increased demand for LIBs and the enlarged complexity of the LIBs architecture requires the development of highly accurate estimation of and reliable battery management systems (BMSs). The BMS plays a vital role in estimating the state of charge (SOC) and state of health (SOH) of the battery, respectively; the ability of the battery to deliver its specific output, and the remaining useful life [2]. Moreover, it can accurately assess battery ageing and degradation [7]. The SOC for a battery in use is estimated using highly correlated external variables, such as voltage, current, charge, and impedance [7,8]. Advanced mathematical models can estimate the battery SOC based on the aforementioned externally measured variables. The benefit of taking external measurements is that the battery performance is not affected by the measurements, and variables can be observed without disabling the battery [9]. Recent applications of LIBs present new circumstances that may require unique or revised models. Therefore, a plethora of SOC models are now available to the public and industry. Most types of modelling techniques fall under the following umbrella terms: direct methods, adaptive methods, bookkeeping methods, and hybrid methods. Existing SOC estimation techniques, such as Coulomb counting, open-circuit voltage, and Kalman filter methods, present significant drawbacks in real-life applications. The limitations of these example methods include the following: Coulomb counting is susceptible to cumulative errors due to inaccuracies in current measurement and initial SOC estimation; open-circuit voltage requires the battery to be at rest for accurate measurement, which is impractical for in-use BMS applications; and Kalman filter methods, while accurate, are computationally intensive and heavily reliant on precise battery models, making them sensitive to parameter variations and uncertainties [10]. Advancements continue to be made in Kalman filter models [11] to reduce computational cost and noise reduction to improve modelling capabilities. The methods used in research on existing techniques can also be applied to improve ML approaches [12,13]. Artificial neural networks (ANN) and ML approaches effectively address these challenges by modelling nonlinear battery behaviour, reducing susceptibility to noise, and adapting to diverse operating conditions. In addition, ANNs facilitate real-time SOC estimation without requiring battery rest. Several advanced ANN models developed in [12–14] address the challenges of real-life applications, such as noise reduction, improved feature extraction, and reduced computational cost. While ANNs often exhibit limitations in modelling with coarse datasets, this paper presents improvements on ANN applications to coarse data for SOC prediction using the most basic ANNs to highlight the impact of their unique architectural differences. ANN and ML methods appeal to the scientific community because of their ability to adapt and detect underlying patterns using simple computations. ML models require no physical understanding of the system and work effectively with a much lower computational cost than alternative models such as the Kalman filter method. These two factors have attracted the attention of many scientific researchers [15,16]. In recent studies [17–19], it has been demonstrated that there is potential to implement physics-informed ANNs for modelling various internal components of the battery, such as long-term changes [17,18] or SOC, as in [19]. For accurate predictions, the latter used a large dataset, as opposed to the coarse dataset used in this study. Further uses for machine learning in the field of batteries and greener energy include the development and improvement of energy storage materials via ML methods [20,21]. The ML methods discussed in this study use an ANN approach within the ML family. The aim of an ANN model is to mimic the natural structure and process, that is, the processing of information by the brain’s network of neural pathways and synapses. ANNs are designed to train themselves by implementing a learning algorithm that essentially uses the error between the predicted output (initially the result of random neuron activation) and the true output of a training dataset [22]. This validation between the predicted and true values guides the hidden layer to form a bias, or weight, on each synapse that reduces the output error. If the structure and initial conditions of the ANN are relatively appropriate, extensive repetition will cause the ANN output to converge to a minimum error, thereby providing an accurate model for the desired output. This is tested against the reserved test data to judge the model’s predictive ability fairly. ANNs face limitations such as being trapped in local minima that are far from the global minimum, overfitting the model to the training data, and thus failing to make predictions with new data [23]. A plethora of available neural network (NN) architectures can render the selection of an appropriate design challenging. It is also common to struggle to fix the correct layer sizes and learning algorithms [16]. This is true for individuals that are educated in the field, let alone individuals who are not familiar with the needs and functions of NN modelling [24]. While initial judgement can narrow down the selection of NN architectures, the validation of the remaining selection and choice is often accomplished by trial and error [24]. The aim of this study was to investigate three different neural networks: multilayer perceptron (MLP), long short-term memory (LSTM), and nonlinear auto-regressive with exogenous input (NARX). These three models were selected for investigation based on their key differences: The MLP was chosen as an indicator for the existing modified MLP designs and serves as a stepping stone for the investigation of more advanced MLP based ANN models. LSTM possesses the ability to detect both longand short-term trends; this characteristic is used to provide a basis for informing the reader of the potential for further investigation of subtle patterns between the input parameters and SOC. NARX was selected to investigate the temporal dependency of the dataset used in the ANN for SOC prediction. The NARX feedback loop, as discussed later, uniquely preserves the temporal relationship between the input and output values for making the next prediction. While numerous alternative ANN models exist in the literature, the authors determined the basic MLP, NARX, and LSTM models to be a suitable indication and stepping stone for future research into more advanced techniques, specifically for applications with coarse datasets. The adaptability and flexibility of the models were assessed, and the performances when predicting the SOC were analysed and compared. Similar to a previous study [25], the flexibility of different ML methods is expanded by addressing different aspects. The sensitivity and flexibility of the learning rate, layer sizes, Journal of Power Sources 646 (2025) 236929 2 M. Rae et al. training percentages, and overall performance were compared for each NN design. The EIS and voltage measurements of a Samsung INR1865035E LIB were used for training and validating the models. The outcomes of this paper will inform the reader of the behaviour of these three NN architectures and will guide towards an enlightened decision about which model to use when fitting the data. Furthermore, this paper attempts to outline the possibility of reducing experimental labour, materials, expenses, and waste. 2. Machine learning (ML) This section provides a brief overview of ML concepts to prepare the reader for elaborations and justifications made in the Results and Discussions section. The section introduces basic concepts using an example of a feedforward NN, including the activation function, optimisation algorithms, and weights. We then introduce the three ML approaches applied in this study, that is, MLP, LSTM, and NARX NNs, and the details of each network-specific layer process. ML approaches use mathematical algorithms to train a particular model such that it can predict the output of a certain process given specified input variables [15,22,26–29]. The NN field of ML is inspired by the natural processes of organic brains [22]. That is, an NN comprises several layers that contain a collection of synapses or nodes linked together via neural paths or connections. Hence, NNs in ML are often called ANNs to distinguish them from biological ones. External information is processed as it flows from the initial input layer ⟶ hidden layers ⟶ output or decision layer. An ANN uses technology to construct an information processing system that mimics this structure and uses mathematical functions to interpret and assign data throughout the evolving ANN. An ANN can be structured with various architectures and functions that uniquely process the input data to provide an output. Their differences in design are useful for the specific characteristic behaviours of the dataset. Selecting the appropriate architecture will help the model perform within reasonable error bounds. However, similar to the human brain, any ANN requires training to function appropriately. Training an ANN involves reducing or increasing the weight or bias of each synapse within the network such that the output approaches a minimum error. The weight represents the importance or correlation strength between the node and output, and it is adjusted after every iteration. Unlike the weights, the bias is more rigid and portrays a firmly implemented relation between nodes and outputs; it is not adjusted as freely as the weights. Not all NNs include bias. For most NNs, the initial distribution of node weights within the hidden layer is random, and they are adjusted when the error is propagated back through the network. The output accuracy is a matter of assigning the correct weights to each individual synapse, thus identifying the true underlying patterns in the dataset. Many mathematical algorithms have been developed to determine the optimal weight distribution; these are called training algorithms [30,31]. The most suitable training algorithm depends on the behaviour of the dataset and the NN architecture and is often determined after exploring many possibilities [30]. 2.1. Basic architecture: Feedforward neural network (FNN) The FNN is the most basic NN structure, as shown in Fig. 1(a). It consists of an input layer, a hidden layer, and an output layer. The hidden layer does not need to be ‘‘fully connected’’ to be classified as an FNN; a fully connected layer will have all synapses connected to every synapse of the subsequent layer. Any NN input layer must connect to the hidden layer via activation functions and assign weights to each node. The final hidden layer of any NN must be fully connected to the output layer, in this case a single node that presents the predicted SOC. Furthermore, the hidden layer can consist of any number of nodes; however, fewer nodes will desirably reduce the number of computations. An error term is found by comparing the predicted and experimental outputs, and then the error is fed through the network to adjust the weights using the training algorithm. 2.2. Pattern recognition and data extraction ANNs are famous for their ability to process data and evolve into models that can accurately predict an outcome beyond the comprehension of alternative physics-informed models. The hidden layer of an ANN is labelled as such for its unobservable nature. The specific patterns, trends, and relationships that the ANN detects during the training process are hidden within the hidden layers of the ANN and cannot be extracted. Much research is underway to uncover knowledge in ANNs [32–34]. The recognition of new patterns by an ANN is most obvious during the fine-tuning of the ANN parameters. As one begins to optimise the model, the error curve (difference between the predicted and known data points) will smooth. The smoothing of the error curve is indicative of an ANN learning new and subtle trends within a dataset. A key parameter affecting the detection of subtle patterns is the learning rate. As the learning rate decreases, an ANN is able to navigate into small local error minima, whereas a larger learning rate would cause the ANN to oscillate around the minimum or skip over it entirely. Despite difficulties in extracting the inner workings of ANNs, the ability to form these subtle patterns that exceed the comprehension of physical and mathematical theories is extremely valuable and marks a cornerstone to the success of ANN modelling performances. 2.3. Activation functions An activation function maps the values from the respective nodes to a specific domain. Its purpose is to manipulate the data such that it fits a desired distribution to improve the functionality of the model-training algorithm. Popular activation functions applied in NNs include the sigmoid (𝜎), tan-sigmoid (tansig), rectified linear (ReLU), and hyperbolic tan (tanh) functions [35,36]. The sigmoid function converts the input data to 𝑥∈ [0,1] along the sigmoid curve given by 𝜎(𝑥) = 1 1 + 𝑒𝑥. Alternatively, the tansig function maps 𝑥∈ [−1,1] using a combination of the tan and sigmoid functions: tansig(𝑥) = 2 1 + 𝑒−2𝑥− 1. Both are good for taking any input value. However, the ReLU function is stricter because it maps all negative input values to 0 and all other values remain the same. Finally, the tanh function is the familiar function tanh(𝑥) = 𝑒𝑥−𝑒−𝑥 𝑒𝑥+𝑒−𝑥, which also maps any input 𝑥∈ [−1,1] along the alternative tanh(𝑥) curve. During this study, the tansig activation function was identified as the common function with a high accuracy output between all models. Using consistent activation functions where possible helped streamline the comparison of architectural impacts between the models. 2.4. Adam optimiser Learning algorithms in NNs are an essential component of ML. The purpose of the learning algorithm is to guide the network towards minimal error by comparing the network output and the true output and using statistical error measurements to adjust the network accordingly [37]. The common stochastic gradient descent (SGD) is the basis from which the Adam algorithm was constructed [38]. It is a gradient-based optimisation method with simple computations that can be labelled as an adaptive moment estimation algorithm – ‘‘Adam’’ [38]. The Adam optimiser updates the weights of the NN with Eq. (1) [39]: 𝑤𝑡=𝑤𝑡−1 −𝛼𝑚𝑡 √𝑣𝑡+𝜖 ,(1) Journal of Power Sources 646 (2025) 236929 3 M. Rae et al. Fig. 1. Schematic representation of (a), the basic feedforward NN architecture showing the nodes and weights of each layer connected by straight line neural paths; and (b), the architecture of a general multilayer perceptron NN. where 𝑤 is the weight vector of the hidden layer and 𝛼 is the initial learning rate, which is constant in this application. 𝑚 and 𝑣 are moving averages and 𝜖 is a small positive constant, typically 10−8, to avoid any division by zero (exploding gradient). The moving averages 𝑚𝑡 and 𝑣𝑡 are the exponential averages of the gradient along 𝑤𝑡 and the exponential averages of the squares of gradients along 𝑤𝑡 (otherwise known as aggregate - the exponential average of the previous gradient 𝑔𝑡−1 and present gradient 𝑔𝑡). 𝑚𝑡 and 𝑣𝑡 are then given as 𝑚𝑡=𝛼𝑚𝑡−1 + (1 − 𝛼)𝑔𝑡, 𝑚𝑡=𝑚𝑡 (1 − 𝛼𝑡),(2) 𝑣𝑡=𝜇𝑚𝑡−1 + (1 − 𝜇)𝑔𝑡2, 𝑣𝑡=𝑣𝑡 (1 − 𝜇𝑡).(3) where 𝛼 and 𝜇 are the hyperparameters of the Adam optimiser. The learning rate 𝛼 and gradient decay rate 𝜇 for the selected NNs in this study are displayed in Table 1. The training of the models in this study used the Adam optimiser and the remaining training parameters were identified through trial and error as described in Section 2.6. 2.5. Approach 1: Long short term memory (LSTM) A long short-term memory (LSTM) NN follows the simple recurrent neural network (RNN) architecture with an additional memory component. That is, the LSTM NN includes the input, LSTM, hidden, and output layers. The purpose of the LSTM layer is to hold data in storage for thousands of time steps to allow long-term trends to be acknowledged. This helps the model avoid vanishing and exploding gradients and considers the sources of long-term trends. 2.5.1. LSTM layer process The LSTM process is essentially a feedback loop with a few additional components that enable long-term memory storage. Each iteration creates a ‘‘cell state’’ which is used to inform the LSTM layer in the following iteration. The cell state is a function of four gates that interact with the input data: forget gate (f), retain gate (i), cell candidate gate (g), and output gate (o). Fig. 2 presents the flow of information through the LSTM layer. The input is copied four times and plugged into each gate, where it is combined with the previous hidden state. Using 𝐱𝑡 as the current input vector, 𝐖 and 𝐑 as the input and recurrent weight vectors, respectively, and the bias 𝑏 of each node, the following symbolic expressions describe the data processing through the LSTM layer: i gate ⟶𝑖𝑡=𝜎(𝑊𝑖𝐱𝑡+ R𝑖𝐡𝑡−1 +𝑏𝑖),(4) f gate ⟶𝑓𝑡=𝜎(𝑊𝑓𝐱𝑡+ R𝑓𝐡𝑡−1 +𝑏𝑓),(5) g gate ⟶𝑔𝑡= tanh (𝑊𝑔𝐱𝑡+ R𝑔𝐡𝑡−1 +𝑏𝑔),(6) o gate ⟶𝑜𝑡=𝜎(𝑊𝑜𝐱𝑡+ R𝑜𝐡𝑡−1 +𝑏𝑜).(7) Feeding the previous hidden state ℎ𝑡−1 and current inputs 𝐱𝑡 through these gates as in Fig. 2, the current hidden state ℎ𝑡 is calculated by element-wise multiplication and matrix addition: 𝐡𝑡=𝑜𝑡⋅tanh (𝐜𝑡).(8) Similarly, the current cell state (𝐜𝑡) is determined by element-wise multiplication: 𝐜𝑡=𝑓𝑡⋅𝐜𝑡−1 +𝑖𝑡⋅𝑔𝑡.(9) The forget gate yields a vector 𝑓𝑡 with values between 1 (retain) and 0 (forget), which correspond to each node of the input vector 𝐱𝑡. This is done using 𝐡𝑡−1 from the previous iteration, hence the ‘‘shortterm memory’’ from the LSTM model. However, the output gate simply passes the concatenation of 𝑥𝑡 and 𝐡𝑡−1 to yield the 𝑜𝑡 vector which is fed into the current 𝐡𝑡 and passed on to the next iteration; hence there is also ‘‘long-term memory’’ in the LSTM model. 2.6. Approach 2: Multilayer perceptron (MLP) The MLP has several hidden layers with fully connected synapses (nodes). In this study, the MLP has one input layer, two fully connected hidden layers, and one output layer (see Fig. 1(b)). The network utilises the ‘‘Adam’’ training optimiser in MATLAB (see Section 2.4) for its Journal of Power Sources 646 (2025) 236929 4 M. Rae et al. Fig. 2. Information flow through LSTM layer. 𝑐𝑡 is cell state at iteration t, ℎ𝑡 is the hidden state output at iteration t, t-1 denotes information from the previous iteration, 𝑥𝑡 is the current input variables for iteration t. The gates are denoted as follows: forget gate (f), retain gate (i), cell candidate gate (g), and output gate (o). Table 1 Adjusted training parameters for each model from the Adam optimiser algorithm. Where 𝛼 is the learning rate (constant), 𝜇 is the gradient decay factor (constant), and N is the number of iterations during training. Optimised Model Parameters MLP LSTM NARX 𝛼0.05 0.012 0.081 𝜇0.9 0.9 0.9 Shuffle none none none N700 1,000 10,000 flexibility so that the comparison between MLP and LSTM networks could be made more obvious. The Adam optimiser is often used because of its ability to implement an adaptive learning rate. However, for simplicity of analysis, the learning rate was kept constant. The complete training parameters are displayed in Table 1. The effective implementation of any NN requires experimentation with key components, or hyperparameters, of the architecture. For the MLP, the key components were the hidden layer (HL) size, number of nodes within each HL, learning rate 𝛼, and number of iterations (N). This experimental phase can be difficult because the parameters may be sensitive. Generally, a model that works well with low sensitivity to these parameters is much easier to fit. The selection of values for the parameters was conducted under trial and error. Each parameter was determined based on a balance between the model performance metrics and computational cost. The models were assessed as potential BMSs; therefore, the model should be highly efficient — suitable for scaling up for real-life applications. The same process was applied to the determine the parameters of the LSTM and NARX seen in Table 1 2.7. Approach 3: Nonlinear autoregressive with exogenous input (NARX) The NARX model predicts the output data using delayed input data. In this case, NARX uses a 1:2 time-step delay. That is, the NN uses the inputs from sample 𝑠−1 to predict the sample 𝑠 output. The NARX NN in this study was constructed using the MATLAB Deep Learning Toolbox. The parameters of the NARX model were adjusted according to Table 1. Excluding the time-delay component, the NARX model in this case works like the FNN model with one HL. 3. Electrochemical impedance spectroscopy (EIS) EIS is a powerful and non-destructive technique for investigating the battery lifetime, electrochemical mechanisms, material transport properties, reaction kinetics, behaviour of porous electrodes, and SOC/SOH estimation. The response of the system to a periodic AC signal at a specified range of frequencies with a small amplitude was investigated. In Table 2 Specifications of the investigated Samsung INR18650-35E cells. Parameter Value Nominal Capacity 3.40 Ah Nominal Voltage 3.60 V Maximum Voltage 4.20 V Minimum Voltage 2.65 V Nominal Charging Current 1.70 A Nominal Discharging Current 8.00 A the galvanostatic mode, the current is measured at the applied potential in the frequency domain. The impedance (𝛺) can be derived from the ratio of the voltage-to-current amplitude and the phase lag of the output and input. The impedance can be split into the real part (Re(𝛺)) and imaginary part (Im(𝛺)), which can be represented in Nyquist plots ( Fig. 3(a)), from which great insight can be gained [40–44]. The 𝑥-axis represents the real part of the impedance, while the 𝑦-axis illustrates the negative value of the imaginary part of the impedance. The highfrequency region indicates the Ohmic resistance of the battery, the mid-frequency semicircle signifies the double-layer capacitance effect, and the low-frequency tail is attributed to the diffusion processes within the active material of the battery. 4. Experimental design In this section, the details of the experimental procedure are outlined systematically, including the specifications of the equipment and items used throughout. The section also describes the manipulation of data in preparation for its use in NN models. 4.1. Experimental methodology The Li-ion batteries considered in this study were commercial cylindrical cells INR18650-35E produced by Samsung. The anode material is based on graphite and the cathode material is based on lithium-nickelmanganese-cobalt-oxides (NMC). The specifications of the Samsung INR18650-35E cells are listed in Table 2. The measurement methodology was set up as follows: 1. Two cycles using a charging and discharging current of 0.1C; 2. Measurement of EIS every 25% of SOC in a range of 0–100% SOC during charging and discharging at 0.1C; 3. Cycling of the cell using a charging and discharging current of 0.5C for 50 cycles using 80% of the voltage range; 4. Repeat every 50 cycles: two cycles using a current of 0.1C and measurement of EIS every 25% SOC during charging and discharging at 0.1C. Journal of Power Sources 646 (2025) 236929 5 M. Rae et al. Fig. 3. (a): Typical Nyquist plot the Li-ion battery at 25 % SOC. (b): Degradation of Samsung INR18650-35E Battery Cell Over Period of 100 Cycles charged and discharged at 0.5 C. (c): Changes in charging and discharging curves for Samsung INR18650-35E cell for a capacity check before EIS measurement at 0.1 C before cycling, after 50 cycles, and after 100 cycles. (d): Comparison of Samsung INR18650-35E cell EIS curves measured at 0% SOC before cycling, after 50 cycles, and after 100 cycles. A ZKETECH EBC-X battery tester was used for battery cycling. The EIS measurements during 0.1C cycling were performed at the Biologic VMP3 measurement station in the frequency range from 100 kHz to 30 mHz with a voltage amplitude of 10 mV. It is helpful to note here that the above procedure yielded measurements made before cycling, after 50 cycles, and after 100 cycles; thus, three cycles worth of EIS, voltage, and capacitance data were used for the modelling of the LIB SOC (as seen in all the figures of the supplementary data). The temperature was held constant at 22 ◦C. throughout the entirety of the experimental procedure. Therefore, the results obtained from the experiment are valid for 22 ◦C. There was no validation of the results at different temperatures. 4.2. Experimental data Experimental data from Samsung INR18650-35E cells with NMC chemistry, as described above, were used in this study. The degradation of the cell charged at 0.1 C and discharged at 0.5 C during 100 cycles is shown in Fig. 3(b). The initial discharge capacity was 2.66 Ah, and after 100 cycles, the capacity decreased to 2.41 Ah, representing a capacity retention of 90%. At the end of cycling, the battery cell did not reach its end-of-life. Two cycles at 0.1 C for charge and discharge were performed before cycling, after 50, and 100 cycles. The first cycle was a pre-conditioning cycle to reset the ‘cumulative history’ of the cell, and the second cycle was a measurement of the actual charge and discharge capacity prior to the EIS measurement at different SOCs. The second charge and discharge cycles with regard to battery degradation are illustrated in Fig. 3(c). The discharge capacity at 0.1 C before cycling was 3.38 Ah, and in a capacity check after 100 cycles, the capacity decreased to 3.29 Ah. A comparison of the EIS curves measured during battery ageing at 0% SOC is depicted in Fig. 3(d). The curve shape is consistent during degradation; however, the main difference is the increase in the ohmic resistance with battery degradation. Note also that an increase in ohmic resistance is observed before cycling and after 50 cycles, but demonstrates stability between 50 and 100 cycles, as seen in Fig. 3(d). 4.3. Data processing The size of the experimental data used for this study is coarse compared to many NN research papers related to SOC estimation [45–50]. Typical research papers have published comparisons and performances of LIB models using datasets with hundreds or thousands of battery cycles. The dataset in this study includes 69 samples sourced from three battery charge/discharge cycles. A ‘‘sample’’ refers to an observation at a specific instant, otherwise interpreted as a row in the total dataset where each column represents a variable (thus, a 69 × 7 matrix is the dataset for this study). This study provides a comparison of three NNs designed to model the SOC of a commercialised LIB. The results of this study provide a good reference for each model’s ability to effectively learn underlying patterns with a small dataset. The measured input variables in this study include the charge and discharge voltage (𝑉+ and 𝑉−, respectively), and the real and imaginary parts of the impedance (Re(𝛺) and Im(𝛺), respectively). EIS was not measured in near-continuous discretised steps, such as the voltage and charge. Rather, it was measured at specific SOC intervals throughout the cycle: 0%, 25%, 50%, 75%, and 100% SOC. Each EIS measurement yielded an array of Re(𝛺) and Im(𝛺) values corresponding to an array of spectroscopy measurement frequencies. NNs require an equal number of samples for the input and output by design; therefore, the EIS data were organised such that three samples of 0% SOC EIS data were Journal of Power Sources 646 (2025) 236929 6 M. Rae et al. Table 3 The architecture and network parameters that gave optimal output accuracy when using 50% data for training. LSTM Hidden Layer LSTM Layer Iterations Learn rate (𝛼) 50 4 1000 0.012 MLP Hidden Layer 1 Hidden Layer 2 Iterations Learn rate (𝛼) 3 2 700 0.05 NARX Time Step Delay Hidden Layer 1 Iterations Learn Rate 1:2 10 10000 0.081 stacked forming a total of 69 readings (∼ 23 measurements at each 0% SOC cycle), and concatenating this with 69 samples of the voltage and charge readings taken at even intervals throughout the full three cycles. The reason for using only EIS measured at 0% SOC is explained in Section 5.2. Furthermore, normalisation by max-scaling is performed on each feature of the dataset individually. The purpose of this is to map all variables to the set 𝑆∈ [−1,1] in which the sigmoid function can be successfully applied. The max-scaling technique had greater success in increasing the output accuracy compared to other normalisation techniques such as linear scaling. 5. Results and discussion In this section, the three proposed ML approaches will be compared with experimental data to evaluate their accuracy and efficiency. It is worth mentioning that the accuracy of each technique depends heavily on the percentage of data considered for training and validating the models. Therefore, the accuracy and adaptability of all techniques will be tested by considering different ratios of datasets. In addition, the sensitivity analysis for each model involves varying the value of the learning rate 𝛼 and the hidden layer sizes. Furthermore, there are deviations from the parameter specifications in Table 1. 5.1. General performance The different architectures of MLP, LSTM, and NARX NNs present various limitations and advantages. The three NN architectures work effectively and within typical error bounds when operating with a training size ≥70% (≈ 49 samples or more). However, reducing the training size to 50% affects the performance of every technique to different extents. The quantitative SOC output obtained for each model is shown in Fig. 4(a). One can observe that it is difficult to visualise the accuracy of different approaches. Therefore, the relative errors (absolute difference between the experimental and model values, all divided by the experimental values) obtained using different approaches were estimated and are shown in Fig. 4(b). The results reveal that the MLP shows more accurate results than the LSTM and NARX techniques. In addition, the training parameters and architectural designs (quantitatively) with optimal parameters for each model are displayed in Tables 1and 3; with the respective performance statistics displayed in Table 4. Again, the quantitative analysis demonstrates that the MLP approach outperforms both LSTM and NARX techniques. This is likely due to the more simplistic nature of the MLP applied to a simple dataset and the ability of LSTM to detect more subtle underlying patterns. However, the nonlinear autoregressive with exogenous input (NARX) NN shows less accuracy than both MLP and LSTM in terms of predicting the SOC (see Fig. 4). 5.2. Electrochemical impedance spectroscopy (EIS) data relevance NN architectures typically require data to have inputs and outputs of the same length. In this study, the total data length was 69. The voltage and capacitance observations were made far more frequently Table 4 Comparison of performance metrics between MLP, LSTM, and NARX models using the mean absolute error (MAE), adjusted coefficient of determination (Adj. 𝑅2 or Adj. R-squared), and standard deviation of error (SD) for each model. Statistic LSTM MLP NARX SD 0.0328 0.0318 0.0595 Adj. 𝑅20.990 0.999 0.947 MAE 0.0328 0.0098 0.0357 than the impedance spectroscopy, but the data were compressed to align with the fewer impedance values. Impedance spectroscopy was only observed under five conditions: when the state of charge was equal to 100%, 75%, 50%, 25%, and 0%; hence, EIS was recorded five times during charging and four times during discharge. EIS was measured across a spectrum of 23 different frequencies (100 kHz to 30 mHz) and repeated at the aforementioned SOC values. However, the EIS observations showed a deviation between the different SOC values owing to the lithiation/delithiation of the electrode materials. Therefore, a correlation matrix was used to determine which SOC yielded the highest correlation between EIS and SOC. The EIS analysis outlined the significance of the SOC value when EIS is measured. Table 5 shows that the EIS measured when SOC = 0% has the greatest correlation to the SOC prediction and yields the highest accuracy when implemented into the MLP model. This is a result of the specific internal properties observed at 0% SOC. Therefore, only the 0% SOC EIS data seen in Fig. 3(d) are used in the model; all other EIS data can be found in the supplementary material. The purpose of selecting fewer EIS measurements is to reduce the number of input features, simplify the model, and improve performance. Furthermore, other studies have shown that the specific frequencies in EIS are related to specific internal components of the battery. Generally, the EIS Nyquist plot displays the three key internal components of the battery. Fig. 3(a) shows the characteristic curve that relates to the following components: The intercept along the horizontal axis by the semicircle relates to the Ohmic resistance of the battery and corresponds to high-frequencies; the semicircle, itself, is representative of the double-layer capacitance effect and corresponds to mid-frequencies; and the diffusion process of the battery cell material is indicated by the straight tail to the right of the semicircle and corresponds to the low-frequency EIS [51]. However, in this case, to arrange the data such that all variables had the same length, the 23 EIS values recorded at 0% SOC before cycling, after 50 cycles, and after 100 cycles were ordered sequentially and yielded 69 samples. Therefore, the voltage and capacitance were compressed to fit the 69 samples. This shows that the EIS measured once per cycle at 0% SOC can produce highly accurate SOC predictions. A recent study by Buchicchio et al. [52] measured EIS at multiple intermittent periods within the battery SOC cycle, making the experimental process very time-consuming. However, the results stipulated above reject the necessity of requiring more than one EIS measurement per cycle. This result is similar to that observed in Babaeiyazdi et al. [51] and further suggests that EIS measured at mid-high frequencies is more strongly Journal of Power Sources 646 (2025) 236929 7 M. Rae et al. Fig. 4. (a): Comparison of SOC outputs for LSTM, MLP and NARX models against the experimental results. (b): Comparison of mean absolute errors (MAE) for LSTM, MLP, and NARX models. This was the result of 50% of the dataset being used for training. Table 5 Model accuracy when using the EIS measured at different SOC values. MLP EIS measured at: Adj R-squared RMSE 100% SOC 0.991 0.0253 75% SOC 0.991 0.0263 50% SOC 0.995 0.0195 25% SOC 0.996 0.0176 0% SOC 0.999 0.0108 correlated to the SOC than the EIS measurements at lower frequencies, depending on temperature. These results can be used to significantly reduce the experimental labour for obtaining battery data for SOC prediction by reducing the number of recorded observables. Reducing the number of input variables also reduces the computational cost of the ANN model. 5.3. Computational costs The testing of different ML approaches is done in terms of computational cost. Varying the number of layers, number of activation functions (neurones) in each layer, and type of activation considered has a significant impact on the computational costs of ML approaches. The computational costs of an ANN can be presented as the total duration of time or as the number of computations performed in the network. The latter is more complicated but provides a more generalised value independent of computer processing power and initialisation costs. The number of computations per iteration (or epoch) can be approximated as the number of nodes (synapses) plus the number of neural paths (connections) that connect them. Multiplying this by the number of iterations in training yields the approximated computational cost in terms of the number of computations. This eliminates the differences owing to the coding layout and format between each model. However, it assumes that all computations are the same; that is, applying the tansig or tanh function to a vector represents the same computational cost as multiplying the vector by single-valued weights. This limitation is overcome by assuming that most models have a similar ratio between complicated and simple computations. The MLP, LSTM, and NARX NNs have computation times that are less than 1 min. This was due to the size of the dataset used in this analysis. The comparison of duration in seconds and the number of computations between each model have contradicting results in Table 6 because of the difference in coding structure and functions used in MATLAB. The initialisation of each model is different and has a significant contribution to the total run time because of the relatively short training duration. Therefore, the approximate number of computations should be regarded as a more accurate representation of the computational cost differences between models. With this noted, the MLP has the lowest computational cost among the three models. However, LSTM has a similar approximate number of computations and a significant difference in duration. The reason the LSTM has a longer duration than NARX is partly due to the different initialisation processes; however, it may also be noted that the LSTM will have a greater number of complicated computations compared to the NARX. This is because the LSTM layer in the LSTM model duplicates the input vector and applies four activation functions (Eqs. (4), (5), (6), and (7)) through the four gates, as demonstrated in Section 2.5.1 and Fig. 2. It is worth noting that the values recorded in Table 6 are obtained from the optimal model configuration. When testing the effect of different learning rates (𝛼) in the following section, the computational cost was much greater to allow the convergence of the error curve. 5.4. Pattern recognition and sensitivity of learning rate The learning rate (𝛼) is a value that signifies the significance of the error produced after each iteration and is thus directly linked to the correction step sizes that the model applies to the weights per iteration. Consistent and high performance for a large range of 𝛼 values is characteristic of flexible and adaptable NN model structures. MLP and LSTM exhibit good performance for a larger range of 𝛼 than the NARX model. None of the three models can fit a model with 𝛼⪆1. The results from the different learning rates for each model are tabulated in Table 7. Beyond the observations from Fig. 5, there are two more interesting points. First, the LSTM error curve (Fig. 5b) is smoothed when 𝛼 decreases, which represents the ability of the LSTM model to detect more subtle underlying patterns/trends in the data when given a smaller learning rate and granted a much larger number of iterations for training (and computational cost exceeding 10 min). Second, the NARX model (Fig. 5c), while initially exhibiting the same behaviour as the LSTM, eventually reaches a turning point where the error begins to increase for 𝛼⪅10−4. However, the MLP model (Fig. 5a) does not exhibit either of these characteristics; rather, it remains relatively unhindered by a decrease in 𝛼. LSTM has the most complicated processing of data owing to the LSTM layer. The LSTM layer is primarily focused on uncovering longand short-term relationships and patterns and assigning a degree of significance to each. This process is likely to be the cause of the success of LSTM in subtle pattern recognition. To this extent, the NARX NN demonstrated the highest sensitivity to the learning rate. The LSTM NN has the most effective relationship with 𝛼, and the MLP NN demonstrates the lowest sensitivity to 𝛼, but does not indicate an ability for 𝛼 to make significant improvements in the model accuracy. Journal of Power Sources 646 (2025) 236929 8 M. Rae et al. Table 6 Computational cost of MLP, LSTM, and NARX models in [(number of computations) ×(Number of iterations)] and elapsed time (seconds) of the complete training process with N iterations. Values were recorded using the 50/50 training/testing ratio and optimal training parameters (Table 1). Model: MLP LSTM NARX Approximate number of computations (70) × (700) (1100) × (1000) (26) × (10000) Total Training Duration (seconds) 5 11 3 Fig. 5. Error plots for different learning rates, 𝛼, on the MLP (a), LSTM (b), and NARX (c) models. Table 7 Performance in RMSE and MAE for each model using decreasing 𝛼 as seen in Figure 5. MLP 𝛼RMSE MAE 5 0.2692 0.2322 0.5 0.0247 0.0201 0.00005 0.0302 0.0246 LSTM 1.2 0.2692 0.2322 0.12 0.0247 0.0241 0.00012 0.0138 0.0109 NARX 8.1 0.4362 0.3620 0.81 0.0182 0.0110 0.081 0.0275 0.0200 0.00081 0.0973 0.0648 5.5. Analysis of model generalisation to unseen data based on data size The ratio between the training and testing dataset portions had a significant impact on the accuracy of each model output. The impact of varying the training size of each model’s dataset is summarised in Fig. 6 by plotting the changes in RMSE 6(a) and SD 6(b). This shows that the MLP model is the least sensitive to reducing the training size compared to the LSTM and NARX models. MLP recognising the relationships between input and output variables for smaller datasets suggests superior generalisation abilities. Furthermore, the size of the dataset is most impactful to the NARX model’s ability to generalise to unseen data, demonstrated by the greatest decrease in performance when the size of the training data was decreased. In Table 8(b), the performance of the LSTM model is consistent and highly accurate when more than 25% of the data are used for training. This is significant because 25% of the total dataset comprises 18 samples, which does not make a full cycle. Therefore, LSTM successfully modelled the SOC of the battery without data to explain the behaviour of a full cycle. However, the RMSE increased significantly from 0.0267 to 0.1630 when the training size decreased from 25% to 20%. The changes in the relative error of the LSTM model output are highlighted in Fig. 7(b). Similarly, the data in Table 8(a) show that the MLP NN successfully predicts the SOC when using 20% or more of the data for training. In other words, the 14 samples used in the training process allowed the MLP NN to predict the following 53 samples with an RMSE of 0.0189 and an SD of 0.0312. The decrease in accuracy for MLP is highlighted by the jump in the SD from 0.0312 to 0.1906 when the training size decreases from 20% to 15%. This change is evident in the relative error plotted in Fig. 7(a). By contrast, the NARX NN did not exhibit flexibility with respect to the training/testing ratio. Table 8(c) shows the lowest acceptable model accuracy when the training data is 50% of the total dataset. Therefore, the NARX NN demonstrated the least flexibility with training data sizes. This deficiency is clearly presented in Fig. 7(c). This behaviour is a strong indication of the ability of the ANN model to understand the key relationships between the input and output datasets. The MLP and LSTM models recognise the key patterns and Journal of Power Sources 646 (2025) 236929 9