Lithium battery thermal early warning method based on multi-mode BiLSTM-Mama
Through the multi-modal BiLSTM-Mamba method, combined with visual and time series data, Vision Transformer and CNN-BiLSTM are used to extract features and input them into the Mamba model, which solves the shortcomings of hot spot identification and real-time monitoring in lithium battery thermal warning and improves the accuracy of the warning. performance and reliability to prevent thermal runaway of lithium batteries.
Patent Information
- Application Number
- CN202410623653.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-09-03
AI Technical Summary
Existing lithium battery thermal warning methods cannot accurately identify internal battery hot spots and monitor battery status in real time, and single-modal data analysis easily ignores the relationship between local features and overall features, leading to misjudgment of thermal runaway of lithium batteries.
A lithium battery thermal warning method based on multi-modal BiLSTM-Mamba is adopted. By combining infrared images, thermal imaging images, battery internal current, voltage and temperature data, Vision Transformer and CNN-BiLSTM neural networks are used to extract features and couple them to predict the temperature. Input the Mamba model for heat warning to improve the accuracy and reliability of the warning.
By integrating multiple features and models, the accuracy and reliability of thermal runaway warning for lithium batteries are improved, and the battery surface temperature can be predicted faster and more accurately to prevent thermal runaway.
Smart Images

Figure CN118587159A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of lithium battery thermal warning, and relates to a lithium battery thermal warning method based on multi-modal BiLSTM-Mamba. Background Art
[0002] Lithium battery thermal runaway is a difficult problem in current lithium battery research. In order to deal with the risk of lithium battery thermal runaway, lithium battery systems usually adopt thermal warning functions. Traditional lithium battery thermal warning methods are mainly based on temperature sensors for monitoring. When the battery temperature exceeds the preset safety threshold, the system will issue an alarm to remind the user or take corresponding control measures. This method has the advantages of simplicity and low cost, but it also has some limitations, such as the inability to accurately identify hot spots inside the battery and the inability to monitor the battery status in real time.
[0003] In recent years, with the development of data-driven technology, more and more research has applied it to thermal warning of lithium batteries. Among them, Transformer can be used to analyze and predict the data change trend of the battery, so as to detect potential thermal runaway risks in advance. By receiving data from multiple sensors as input, the Transformer model can learn the dynamic characteristics and temperature changes of the battery system, thereby realizing future prediction and trend analysis of battery heat. However, the relative error of Transformer will increase when processing very long sequences or multiple dimensions, making it difficult for the model to capture dependencies between distant positions. In order to solve the problem of relative error and capture long-distance dependencies, the researchers introduced LSTM as part of the encoder of the Transformer model. The data is fed to the LSTM layer as an input sequence. LSTM performs step-by-step calculations on the sequence dimension, using gating mechanisms and memory units to capture long-term dependencies and local patterns in the sequence, obtain better sequence modeling capabilities, and achieve a better balance between global and local contexts.
[0004] Although the above methods have shown good results, they still have shortcomings in actual lithium battery thermal warning applications. On the one hand, the complex attention score calculation process leads to slow reasoning speed, and thermal warning operations cannot be performed well in some special thermal runaway situations, and representative features and potential thermal runaway data are lost or ignored. On the other hand, only focusing on single-modal data is prone to ignoring the relationship between local features and overall features, leading to misjudgment of lithium battery thermal runaway. Summary of the invention
[0005] In view of this, the object of the present invention is to provide a lithium battery thermal warning method based on multimodal BiLSTM-Mamba to improve the accuracy and reliability of thermal warning to prevent thermal runaway of lithium batteries.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] A lithium battery thermal warning method based on multimodal BiLSTM-Mamba is provided. The method comprises: collecting infrared images, thermal imaging images, internal current and voltage of the battery and battery temperature data of the lithium battery; inputting the infrared images and thermal imaging images into a Vision Transformer neural network to process the images, extracting temperature features and predicting the surface temperature of the lithium battery; inputting the current, voltage and temperature data into a CNN-BiLSTM neural network for feature extraction and learning, and combining multiple feature representations to predict the surface temperature of the lithium battery; finally, coupling the predicted temperatures of the two neural networks and inputting them into a Mamba model to predict thermal warning, so as to achieve the purpose of preventing thermal runaway.
[0008] Furthermore, the process of processing the infrared image and the thermal imaging image in the Vision Transformer neural network includes:
[0009] Firstly, the input infrared image and thermal imaging image mapping are encoded into feature tensors, and then three scale features are extracted through three different hidden layers to represent the heat distribution characteristics of small, medium and large lithium batteries respectively;
[0010] Transform is used as the feature extraction model. Its input is a token sequence composed of heat distribution feature maps. The sequence is extracted through the MSA attention mechanism. Then the output of MSA attention is added to the EmbeddedPatches sequence of the original image and substituted into the MLP layer to obtain the output z. M :
[0011] z M =MLP(LN(z A ))+z A
[0012] In the formula, z A Represents the output tensor of the attention layer; for z M Normalize and take only z M The first value of is used for temperature extraction, and the output of the Vision Transformer neural network is
[0013] Among them, the loss weight of extracting features through the hidden layer is expressed as:
[0014]
[0015] In the formula, l represents the average intensity of all pixels in the image, t l Indicates the brightness threshold.
[0016] The Vision Transformer neural network uses Huber Loss as the loss function, which is expressed as:
[0017]
[0018]
[0019] Where W I represents the incentive weight, focusing on the darker heat color; δ represents the parameter of Huber Loss, and f(x) represents the actual temperature data.
[0020] Furthermore, the process of temperature prediction by CNN-BiLSTM neural network includes: taking current, voltage and temperature data as the input sequence of CNN, extracting multiple features through multiple convolutional layers in CNN, and setting convolution kernels of different sizes for different feature maps of the input sequence in each convolutional layer; taking the current, voltage and temperature sequence output by CNN as the input x of BiLSTM t , the bidirectional time series information of the data is extracted through BiLSTM to improve the learning accuracy of the predicted temperature. The update process of BiLSTM is expressed as:
[0021]
[0022] In the formula, represents the forward output of LSTM in time, represents the backward output of LSTM in time, represents the predicted temperature, y t Represents the output of BiLSTM.
[0023] Furthermore, the predicted temperature of coupling the two neural networks includes: first calculating the regression error rate between the predicted temperature and the actual temperature of the battery:
[0024]
[0025] Where, T s,t , They represent the actual battery temperature and the predicted battery temperature at time t, n represents the number of samples, E represents the maximum error of the training set, At the same time, set the weight of the predicted temperature
[0026] Modify the weight values of the two neural networks predicting temperature so that the sum of the two modified weights is 1, which are expressed as:
[0027]
[0028]
[0029] In the formula, a′ VIT and a′ BiLSTM Respectively represent the weight values of the Vision Transformer neural network and the CNN-BiLSTM neural network for predicting temperature; coupled battery predicts temperature according to the modified weight values:
[0030]
[0031] In the formula, represents the coupled predicted temperature, represents the predicted temperature of the Vision Transformer neural network, Represents the predicted temperature by the CNN-BiLSTM neural network.
[0032] The Mamba model predicts thermal warnings. Specifically, the predicted temperature of the two coupled neural networks is As the input sequence of the Manba model, the processed Divide the input data into (S, L, D) sizes Where S represents batch size, L represents sequence length, and D represents input dimension. A selectable state space model is constructed, which includes (Δ, A, B, C) parameters, discretized linear recursive equations, and convolution calculation equations. The discretized linear recursive equation is expressed as:
[0033]
[0034]
[0035] In the formula, Δ represents the step size, A represents the system matrix, B represents the control matrix, and I represents the unit matrix. represents the discretized system matrix, represents the discretized control matrix;
[0036] The convolution calculation equation is expressed as:
[0037]
[0038] y t =Ch t
[0039] In the formula, C represents the output matrix, y t Represents the output of the Mabam model;
[0040] The thermal warning of lithium battery is predicted according to the constructed selective state space model. The selective state space model updates the state matrix through input data, and its updating process is:
[0041]
[0042]
[0043]
[0044]
[0045] Where σ(·) represents the activation function.
[0046] The beneficial effects of the present invention are:
[0047] (1) The present invention improves the accuracy and reliability of lithium battery thermal runaway warning by comprehensively considering the combination of multiple features and models.
[0048] (2) The present invention makes full use of the image feature information of the infrared thermal imaging image of the lithium battery, processes the image through the VisionTransformer model, makes better use of the temperature feature extraction, and improves the reliability of thermal runaway prediction. At the same time, the influence of current, voltage, temperature, etc. on the surface temperature of the lithium battery is comprehensively considered, and feature extraction and learning are performed through CNN-BiLSTM, which effectively integrates multiple features to represent the predicted battery surface temperature. Finally, the Mamba model is used to process the coupled surface temperature sequence to obtain the prediction result faster and more accurately.
[0049] (3) The present invention is based on a common deep learning model, is practical and operable, can perform effective lithium battery thermal warning in practical applications, and can achieve better results.
[0050] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0052] Figure 1 This is a schematic diagram of the framework of the lithium battery thermal warning method based on multi-modal BiLSTM-Mamba proposed in the present invention;
[0053] Figure 2 It is a multi-layer scale feature Vision Transform model;
[0054] Figure 3 It is a lithium battery surface temperature prediction model based on CNN-BiLSTM;
[0055] Figure 4 Schematic diagram of the operation process of the Mamba model. DETAILED DESCRIPTION
[0056] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0057] The present invention proposes a lithium battery thermal warning method based on multi-modal BiLSTM-Mamba, such as Figure 1 As shown in the figure, the time-series infrared thermal imaging images, current, voltage, temperature and other characteristics of the lithium battery are used as data input. First, the lithium battery thermal imaging image uses the Vision Transformer neural network to process the image data and simulate the surface temperature of the lithium battery. Secondly, from the perspective of the internal data of the battery, the surface temperature of the lithium battery is estimated based on the convolutional neural network (CNN) and the bidirectional long short-term memory network (BILSTM). Finally, the coupled predicted temperature T is used as input data to predict thermal warning in the Mamba model to prevent thermal runaway.
[0058] In one embodiment of the present invention, the design of the Vision Transformer neural network is as follows: Figure 2 As shown in the figure, the neural network uses a multi-layer model to learn the thermal map features of lithium batteries, and inputs infrared images and thermal imaging images. The mapping is encoded as a feature tensor, where H and W represent the height and width of the image, and 3 is the number of RGB channels. Three scale features are obtained in three different hidden layers of the network Represent the heat distribution characteristics of small, medium and large lithium batteries respectively. In order to obtain the heat distribution of lithium batteries and the characteristics of heat accumulation areas, more attention needs to be paid to areas with darker colors and higher brightness. By giving higher weights to losses, the model can be encouraged to pay more attention to the heat visible areas. The weight correction formula is:
[0059]
[0060] Where l represents brightness, which represents the average intensity of all pixels in the input infrared thermal image, and t lis the brightness threshold. Tokens with less heat accumulation or whose brightness is lower than t l will be assigned a smaller weight α.
[0061] Transform is used as the feature extraction model, and the input is the heat distribution feature map f R 、f T and f R-T The token sequence is composed of the image H*W divided according to the patchsize. A patch is used as feature a after passing Position Embedding i , through the weight matrix W q , W k , W v Get the target word matrix, keyword matrix, and original feature sequence q i , k i 、v i , then the attention formula is expressed as:
[0062]
[0063] Among them, i and j are the sequence numbers of the target word matrix Q and the keyword matrix K respectively, Q = a i W q , K = a j W k ;d k is the key feature dimension.
[0064] Integrating attention mechanism:
[0065]
[0066] Where V is the original feature; Can be b i Indicates that Can be equivalent to a i,j For the characteristics of lithium battery thermal imaging and infrared images Scale, Q, K, V can be expressed as Among them (H i *W i ) is the feature map resolution, c is the number of channels. Similarity matrix Divide by d k Normalization is performed to enhance the stability of the training gradient. In the infrared thermal imaging attention module, Among them, proj is the feature embedding layer. It not only encodes the spatial relationship of thermal features through the attention mechanism, but also cross-captures the connection between thermal features and thermal visibility.
[0067] Add the MSA attention output to the original image Embedded Patches sequence and substitute it into the MLP layer:
[0068] z M =MLP(LN(z A ))+z A (4)
[0069] In the formula, z A 、z M are the output tensors of the attention layer and the MLP layer respectively. Among them, Embedded Patches means that the image is processed into blocks to obtain a sequence, and the operation of adding the sequence to the MSA output is a residual operation. M Normalize to get the predicted temperature Only take z M The first value of is used for temperature extraction, i.e.
[0070] The loss function of the Vision Transform neural network is defined as follows:
[0071]
[0072]
[0073] Among them, W I To motivate the weight, focus on the darker heat colors; δ is the parameter of Huber Loss, which is set to 1. When the prediction deviation is less than δ, the loss uses square error, and when the prediction deviation is greater than δ, the linear error is used. Compared with the least squares linear regression, Huber Loss reduces the degree of punishment for abnormal points.
[0074] In one embodiment of the present invention, the design of the CNN-BiLSTM neural network is as follows: Figure 3 As shown in the figure, the battery current, voltage, and temperature are used as the input sequence for predicting the surface temperature. The internal features of the sequence are extracted through the CNN convolution layer. The CNN with multiple convolution layers can ensure the comprehensive extraction of multiple features through multi-layer convolution. Each convolution layer sets convolution kernels of different sizes for different feature maps of the input sequence to understand more feature information. When the convolution kernel of size r×k is used to extract I j 、V j 、T j When local features are used, the convolution result is expressed as:
[0075] C i =f(W·V(w i:i+r-1 )+b) (6)
[0076] Where W is the convolution kernel parameter, indicating the convolution operation; V(w i:i+r-1 ) represents the r row vector from i to i+r-1; b represents the bias; C i represents the local feature vector from i to i+r-1 obtained by convolution operation; f(·) represents the activation function.
[0077] The ReLU function is used as the activation function to capture the nonlinear relationship within the network and accelerate the training convergence, that is, f(x) = max(0,x). Through unilateral inhibition, the ReLU function allows the neurons within the neural network to be sparsely activated without saturation. j 、V j , T j Perform the convolution operation from top to bottom according to STEP = 1, then the local feature vector set C SeT The solution formula is:
[0078] C SeT ={C1,C2,…,C i+r-1} (7)
[0079] Selecting the maximum pooling method can reduce the dimension of features and make the network extract features more efficiently, that is, d i =Max(C i ). A batch normalization layer is added after each pooling layer to ensure that the output feature values of the pooling layer follow the standard normal distribution, thereby accelerating the convergence of the network.
[0080] LSTM includes forget gate, input gate, and output gate to realize the retention and update of storage unit state information. CNN outputs current, voltage, and temperature sequence I j '、V j '、T j 'As BiLSTM input information x t The forget gate reads the output h at time t-1 t-1 and input x at time t t , the information is mapped to the range of 0-1 through sigmoid. The output of the forget gate is f t as follows:
[0081] f t =σ(W f x t +U f h t-1 +b f ) (8)
[0082] Where W f is the weight matrix between the input gate and the forget gate, U f is the weight matrix between the hidden layer and the forget gate, b fis the bias vector of the forget gate. The update process of the input gate and output gate is as follows:
[0083]
[0084]
[0085] where c t is an implicit state, Generated using tanh activation; W i , W c 、b i Connect the weight and bias vector for the input gate, W c , U c 、b c Connect the weight and bias vectors for the storage unit, W o , U o 、b c Connect the weight and bias vectors to the output gates.
[0086] Long sequences will weaken the temporal correlation of data. BiLSTM can be used to extract bidirectional time series information of data to improve the prediction accuracy. Learning accuracy. Assume that the input feature of BiLSTM at time t is The forward output function of the LSTM at time t is The backward output function of the LSTM in time t is The final output y t By combining the output, y t =[SOC] T The update process of BiLSTM is as follows:
[0087]
[0088] In one embodiment of the present invention, the design of the Mamba decoder is as follows Figure 4 As shown, the temperature predicted by the VisionTransformer neural network and the CNN-BiLSTM neural network before decoding are combined, and the adaptive model AdaBoost is used to form a stronger data model.
[0089] First calculate the regression error rate:
[0090]
[0091] Among them, T s,t , are the actual battery temperature and the predicted battery temperature at time t, n is the number of samples, and E is the maximum error of the training set, that is, Also set the weight of the predicted temperature
[0092] Battery temperature predicted by two neural networks and Modify the weight value so that the sum of the two weights is 1. The weight is expressed as:
[0093]
[0094] Finally coupled battery predicted temperature As input sequence is processed in the decoder module.
[0095] against and image temperature data After being fully connected, it is not possible to effectively handle long dependencies and the problem of excessive space and time complexity. The Mamba model improved by the state space model SSM is used to perform targeted reasoning on thermal warnings. Divide the input data into (S, L, D) sizes Where S is the batch size, L is the sequence length, and D is the input dimension. The selectable state space model consists of (Δ, A, B, C) parameters, discretized linear recursion, and convolution calculations, where Δ is the step size, A is the system matrix, B is the control matrix, and C is the output matrix. The specific steps are as follows:
[0096]
[0097]
[0098] Specifically, the system matrix and control matrix By discretizing A and B, the convolution calculation model of formula (15) is constructed. In order to focus on the overheating temperature area of the lithium battery and the overall temperature trend, it is necessary to filter out unimportant features and irrelevant noise. Mamba can update the state matrix through input data. The specific steps are as follows:
[0099]
[0100]
[0101] Among them, σ(·) is the activation function. According to equations (16) and (17), we can get:
[0102]
[0103] When tWhen it approaches 0, the hidden state is basically independent of the current input, that is, the current input has little effect on the output, reflecting the selectivity. For unimportant tokens, parameters with smaller weights are selected to filter them. When a token is more important, g t Increase, and g t It is again determined by the current input, so the current input will have a greater impact on the output.
[0104] Mamba abandons the convolution operation and uses the new operation process of formula (19). The operators satisfy the commutative and associative laws:
[0105]
[0106] Selecting a scanning algorithm can process data in parallel and reduce the waste of computing resources.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A lithium battery thermal warning method based on multimodal BiLSTM-Mamba, characterized in that: The method includes: collecting infrared images, thermal imaging images, internal current, voltage and battery temperature data of lithium batteries; inputting infrared images and thermal imaging images into the Vision Transformer neural network to process the images, extracting temperature features and predicting the surface temperature of lithium batteries; inputting current, voltage and temperature data into the CNN-BiLSTM neural network for feature extraction and learning, and combining multiple feature representations to predict the surface temperature of lithium batteries; finally, coupling the predicted temperatures of the two neural networks and inputting them into the Mamba model to predict thermal warnings, so as to achieve the purpose of preventing thermal runaway.
2. The lithium battery thermal warning method according to claim 1, characterized in that: The process of processing the infrared image and the thermal imaging image in the Vision Transformer neural network includes: Firstly, the input infrared image and thermal imaging image mapping are encoded into feature tensors, and then three scale features are extracted through three different hidden layers to represent the heat distribution characteristics of small, medium and large lithium batteries respectively. Transform is used as the feature extraction model. Its input is a token sequence composed of heat distribution feature maps. The sequence is extracted through the MSA attention mechanism. Then the output of MSA attention is added to the Embedded Patches sequence of the original image and substituted into the MLP layer to obtain the output z. M : With M =MLP(LN(z A ))+z A In the formula, z A Represents the output tensor of the attention layer; for z M Normalize and take only z M The first value of is used for temperature extraction, and the output of the Vision Transformer neural network is 3. The lithium battery thermal warning method according to claim 2, characterized in that: The loss weight of extracting features through the hidden layer is expressed as: In the formula, l represents the average intensity of all pixels in the image, t l Indicates the brightness threshold.
4. The lithium battery thermal warning method according to claim 1 or 2, characterized in that: The VisionTransformer neural network uses Huber Loss as the loss function: Where W I represents the incentive weight, focusing on the darker heat color; δ represents the parameter of Huber Loss, and f(x) represents the actual temperature data.
5. The lithium battery thermal warning method according to claim 1, characterized in that: The process of temperature prediction using CNN-BiLSTM neural network includes: taking current, voltage and temperature data as the input sequence of CNN, extracting multiple features through multiple convolutional layers in CNN, and setting convolution kernels of different sizes for different feature maps of the input sequence in each convolutional layer; taking the current, voltage and temperature sequence output by CNN as the input x of BiLSTM t , the bidirectional time series information of the data is extracted through BiLSTM to improve the learning accuracy of the predicted temperature. The update process of BiLSTM is expressed as: In the formula, represents the forward output of LSTM in time, represents the backward output of LSTM in time, represents the predicted temperature, y t Represents the output of BiLSTM.
6. The lithium battery thermal warning method according to claim 1, characterized in that: The temperature prediction of coupling two neural networks includes: first calculating the regression error rate between the predicted temperature and the actual temperature of the battery: Where, T s,t , They represent the actual battery temperature and the predicted battery temperature at time t, n represents the number of samples, E represents the maximum error of the training set, At the same time, set the weight of the predicted temperature Modify the weight values of the two neural networks predicting temperature so that the sum of the two modified weights is 1, which are expressed as: In the formula, a′ VIT and a′ BiLSTM Respectively represent the weight values of the Vision Transformer neural network and the CNN-BiLSTM neural network for predicting temperature; coupled battery predicts temperature according to the modified weight values: In the formula, represents the coupled predicted temperature, represents the predicted temperature of the Vision Transformer neural network, Represents the predicted temperature by the CNN-BiLSTM neural network.
7. The lithium battery thermal warning method according to claim 1, characterized in that: The process of predicting heat warnings through the Mamba model includes: coupling the predicted temperature of the two neural networks As the input sequence of the Manba model, the processed Divide the input data into (S, L, D) sizes Where S represents batch size, L represents sequence length, and D represents input dimension. A selectable state space model is constructed, which includes (Δ, A, B, C) parameters, discretized linear recursive equations, and convolution calculation equations. The discretized linear recursive equation is expressed as: In the formula, Δ represents the step size, A represents the system matrix, B represents the control matrix, and I represents the unit matrix. represents the discretized system matrix, represents the discretized control matrix; The convolution calculation equation is expressed as: the t =Ch t In the formula, C represents the output matrix, y t Represents the output of the Mabam model; The thermal warning of lithium battery is predicted according to the constructed selective state space model. The selective state space model updates the state matrix through input data, and its updating process is: Where σ(·) represents the activation function.
Citation Information
Patent Citations
Lithium ion battery SOH estimation and RUL prediction method based on TTSNet
CN116467580A
Lithium battery module temperature field reconstruction method based on deep operator learning
CN117195713A
Method for predicting SOH (state of health) of battery based on Transform combination model
CN117347867A
Battery SOC estimation method and power management system
CN117538757A
Vehicle-mounted lithium battery collision thermal runaway early warning method and system
CN117601655A
Cited By
Transform-based battery pack thermal fault analysis method and device
CN119165365A
Battery pack thermal fault analysis method and device based on transformer
CN119165365B
Heating and ventilation air conditioner heat supply prediction method, system, equipment and medium
CN119474754A
Photovoltaic power generation electricity stealing detection method and verification method based on hybrid deep learning model
CN119474889A
Lithium battery SOC estimation method based on multi-scale physical information neural network
CN119881678A
