# Application of Deep Learning Techniques for the State of Charge Prediction of Lithium-Ion Batteries
## 2 Research Model
\[i_{t}=\sigma(W_{i}\cdot[h_{t}-_{1},x_{t}]+b_{i})\overset{\sim}{C}_{t}=\tanh(W_ {C}\cdot[h_{t-1},x_{t}]+b_{C}) \tag{4}\]  
The cell state update calculates each new cell state. Here, \(C_{t}\) in Equation (5) is the cell state at the current time \(t\), which is responsible for the long-term memory of LSTM. \(C_{t-1}\) is the cell state at the previous time point \(t-1\) and represents past information. \[C_{t}=f_{t}\;\times\;C_{t-1}\;+\;i_{t}\;\times\;\overset{\sim}{C}_{t} \tag{5}\]  
The output gate determines which part of the cell state to output, which will be used to determine the next hidden state. Here, \(o_{t}\) in Equation (6) is the activation value of the output gate at the current time \(t\), which determines which information to output among the cell states. \(W_{o}\) is the weight of the output gate. \(b_{o}\) is the bias of the output gate. \(H_{t}\) is the hidden state at the current time \(t\) and is the output value passed to the next time point. \[o_{t}=\sigma(W_{o}\cdot[h_{t-1},x_{t}]+b_{o})\;h_{t}=o_{t}\;\times\;\tanh(C_{t}) \tag{6}\]  
Figure 2: Flow diagram inside a forward-flowing LSTM cell. Here, \(W\) and \(b\) represent the weights and biases being learned. \(\sigma\) is the sigmoid activation function, and \(\tanh\) is the hyperbolic tangent activation function. \([h_{t-1},x_{t}]\) means concatenating the previous hidden state and the current input. These inputs play an important role in determining the operation of each gate and the updating of the cell state. Weights and biases are optimized through learning, and the sigmoid function and hyperbolic tangent function provide nonlinear transformations, allowing complex patterns to be learned. At the last stage of each forward propagation, a loss function is calculated to minimize the error between the estimated value and the measured value, and the mean square error (MSE) is used. The loss function is as follows in Equation (7) [20]. \[Loss=\frac{1}{n}\underset{t=1}{\sum}\underset{t=1}{\sum}(SOC_{t}-SOC_{t}^{*} )^{2} \tag{7}\]  
\(SOC_{t}\) is the measured value of step \(t\), and is a value estimated by the \(SOC_{t}^{*}\) network. \(n\) represents the total length of data. The network weights are updated using the difference between the measured value and the estimated value using the backpropagation technique. This is performed through Adam, an optimization technique. Adam is a method that combines the advantages of AdaGrad [21] and RMSProp [22] and is characterized by simple implementation and high computational efficiency. SOC represents the amount of charge stored in the battery and is calculated by the battery management system as it is expressed as a percentage or a range from 0% to 100%. The formula for calculating the state of charge (SOC) through the current integration method is as follows [21; 22],  
\[SOC_{t}\ (\%)=SOC_{0}-\left(\frac{\int_{0}^{t}idt}{C_{n}}\right)\times 100 \tag{8}\]  
where \(SOC_{t}\) is the measured SOC at time step ttt, and \(SOC_{0}\) is the initial SOC value. In this study, \(SOC_{0}\) was estimated based on a lookup table derived from the results of the OCV experiment conducted with a SOC 5% pulse. Figure 3 presents graphs showing the relationship between open circuit voltage (OCV) and the state of charge (SOC) for four different battery cells (cell IDs 35, 36, 37, and 38). Each graph illustrates the relationship between the state of charge of a battery cell, expressed as a percentage of SOC, and its voltage, measured as OCV in volts. The graphs in Figure 3 should ideally demonstrate that OCV increases as SOC increases, reflecting that when a battery is fully charged (SOC 100%), the OCV should be high. Any observed discrepancies or irregularities might be attributed to measurement errors or specific characteristics of the battery cells. Therefore, it is essential to account for these variations accurately when developing models for SOC estimation to ensure the correct relationship is captured.