# Lithium-Ion Battery State of Health Estimation Based on CNN-LSTM-Attention-FVIM Health Features
## 3 Algorithm Principle Explanation
### Long Short-Term Memory Network  
Long Short-Term Memory (LSTM) is a special recurrent neural network (RNN) designed to solve the problem of gradient vanishing or exploding in a traditional RNN when processing long sequence data. Its main advantages are as follows. First, LSTM effectively captures long-term dependencies in the sequence through the gating mechanism, which compensates for the problem of exponential gradient decay or explosion caused by chain derivation in traditional RNNs. Second, through the synergy of the forget gate, input gate, and output gate, LSTM dynamically controls the storage, forgetting, and output of information to avoid interference from irrelevant information. At the same time, the excellent performance in various tasks also reflects the wide applicability of the LSTMneural network model. For example, it has shown excellent predictive ability in other lithium-ion battery SOH research. Third, through the sparse activation of the gated unit, some neurons selectively participate in the calculation, creating an implicit regularization effect, which helps to alleviate overfitting. The LSTM gating mechanism includes a forget gate, input gate, update memory unit state, and output gate [36]. 1. Forget gate: The main function of the forget gate is to decide which old information to discard from the cell state. The output of the forget gate is a value between 0 and 1, indicating the degree to which each piece of information is retained. The formula is as follows. \[f_{t}=\sigma\Big{(}W_{f}\cdot[h_{t-1},x_{t}]\Big{)}+\sigma b_{f}\] (3) \(\sigma\) is the sigmoid activation function. \(f_{t}\) is the output of the forget gate. \([h_{t-1},x_{t}]\) is the connection between the hidden state of the previous moment and the current input. \(W_{f}\) is the weight matrix of the forget gate. \(b_{f}\) is the bias term of the forget gate. 2. Input gate: The main function of the input gate is to decide what new information to store in the cell state. The sigmoid layer is used to determine the information that needs to be updated, and the \(\tanh\) layer generates new candidate memory cells. The formula is as follows. \[i_{t}=\sigma(b_{i}+W_{i}\cdot[h_{t-1},x_{t}])\] (4) \[\widetilde{C}_{t}=\tanh(b_{C}+W_{C}\cdot[h_{t-1},x_{t}])\] (5) \(i_{t}\) is the output of the input gate. \(\widetilde{C}_{t}\) is the new candidate memory cell. \(b_{i}\) and \(b_{C}\) are the bias term of the input gate and the candidate memory cell. \(W_{C}\) and \(W_{i}\) are the weight matrix of the input gate and the candidate memory cell. 3. The current memory unit is updated using the forget gate and the first two components of the input gate. The formula is as follows. \[C_{t}=f_{t}\cdot C_{t-1}+i_{t}\cdot\widetilde{C}_{t}\] (6) \(f_{t}\) is the output of the forget gate, controlling the proportion of old memory retention, \(i_{t}\) the output of the input gate, controlling the proportion of new memory writing. \(C_{t}\) is the state of the memory unit at the current moment. \(C_{t-1}\) is the state of the memory unit at the previous moment. 4. Output gate: The output gate controls which parts of the memory cell state will be output; that is, it determines the hidden state output at the current moment. The formula is as follows. \[o_{t}=\sigma(b_{o}+W_{o}\cdot[h_{t-1},x_{t}])\] (7) \[h_{t}=o_{t}\cdot\tanh(C_{t})\] (8) \(b_{o}\) is the bias term of the output gate. \(h_{t}\) is the hidden state at the current moment. \(o_{t}\) is the output of the output gate. \(W_{o}\) is the weight matrix of the output gate. The main workflow of LSTM is divided into three stages. The first is to analyze the current input \(x_{t}\) and the previous hidden state \(h_{t-1}\) in the forget gate and to determine the part of the cell state that needs to be forgotten, which is the forget stage. Then, in the second stage, the memory stage, the input gate selects the key features of the input, forms candidate memories, and updates the cell state. Finally, the output gate generates the current hidden state based on the cell state updated in the previous step.