Method and system for ultrasonically detecting charge state of hard-shell lithium battery based on deep learning
By constructing a battery state-of-charge estimation model based on a multi-scale convolutional neural network and a bidirectional long short-term memory network, the problems of accuracy and complexity in the state-of-charge estimation of hard-shell lithium batteries are solved, and efficient lithium battery state-of-charge estimation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI UNIV OF TECH
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-12
AI Technical Summary
Existing ultrasonic testing methods are insufficient to accurately estimate the state of charge of large-capacity hard-shell lithium batteries. Traditional signal processing methods have low signal-to-noise ratios, and existing deep learning methods are complex and inconvenient to use.
A deep learning-based approach is adopted, utilizing multi-scale convolutional neural networks, bidirectional long short-term memory networks, and selective state-space mechanisms to construct a battery state-of-charge estimation model. By preprocessing ultrasonic time-domain signals and combining an attention classification output mechanism, accurate estimation of the lithium battery state of charge is achieved.
It improves the accuracy of lithium battery state of charge estimation, simplifies the model training process, and enhances the accuracy and efficiency of estimation.
Smart Images

Figure CN122017574A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial inspection, and more specifically, to a method and system for ultrasonic testing of the state of charge of hard-shell lithium batteries based on deep learning. Background Technology
[0002] With the rapid development of new energy products, lithium batteries have become an indispensable mainstream energy storage technology, making the accurate estimation of the state of charge (SOC) of lithium-ion batteries crucial. The SOC of a lithium battery, also known as remaining capacity, refers to the ratio (S) of the remaining capacity (after a period of use or long-term storage without use) to its rated capacity under the same conditions. Ultrasonic battery testing is a recognized method for obtaining rich characteristic data from batteries, and ultrasonic technology is non-invasive, non-destructive, and convenient. Furthermore, unlike electrical parameter-based testing methods, ultrasonic testing does not require additional circuitry, simplifying the complexity of battery testing. Today, an increasing number of researchers are using ultrasonic technology to estimate the SOC of batteries.
[0003] Currently, there are three technologies for testing batteries using ultrasound: ultrasonic transmission, ultrasonic reflection, and ultrasonic guided wave. Due to the complex internal structure and physical characteristics of batteries, ultrasonic reflection and guided wave signals are also quite complex. When there are internal defects in the battery, the characteristics of the reflection and guided wave signals are complex and diverse. However, compared to other methods, ultrasonic transmission does not require consideration of the battery's internal structure, and its signal waveform characteristics are relatively simple.
[0004] Existing ultrasonic transmission-based measurement methods are all designed for testing low-capacity pouch lithium batteries. Pouch batteries have thin cells and thin casings, making it easy to obtain ultrasonic transmission signals related to the battery's internal charge. However, high-capacity hard-shell batteries typically use wound-up cells with a thick steel casing. As a result, ultrasonic waves attenuate significantly in thicker hard-shell lithium batteries, leading to a lower signal-to-noise ratio in the received transducer. Traditional signal processing methods are therefore unable to accurately reflect the state of charge (SOC) of the lithium battery.
[0005] Patent CN202311018433.5 provides a device and method for non-destructive testing of lithium batteries based on ultrasonic resonance spectrum. This method accurately measures the ultrasonic resonance spectrum based on transmitted or reflected waves at different locations within the lithium battery, identifies several resonant frequencies from the spectrum, and analyzes their distribution characteristics. It also analyzes the passband and bandgap characteristics of the ultrasonic resonance spectrum signal and extracts the amplitude information of transmitted or reflected waves at different frequency points from the ultrasonic resonance spectrum signal, obtaining amplitude cloud maps of transmitted or reflected waves at several frequency points, as well as the mechanical quality factor of the lithium battery. Specifically, compared to using the maximum amplitude variation of pulsed ultrasonic transmitted waves for SoC detection, this method, utilizing acoustic resonance spectrum technology, can not only accurately obtain the amplitude attenuation of several single-frequency ultrasonic waves after penetrating the lithium battery simultaneously, but also extract the mechanical quality factor value from the resonance peaks. Since waves of different frequencies attenuate inconsistently when propagating in the same medium, the mechanical quality factor value directly reflects the magnitude of material damping. By integrating the amplitude attenuation information of multiple frequency ultrasonic waves after penetrating the lithium battery and combining it with the mechanical quality factor value, a quantitative evaluation of the SoC can be performed. This method essentially uses amplitude information at different frequency points to reflect the State of Charge (SOC); however, it does not consider the overall time and frequency domain information of the transmitted signal, nor does it consider the correlation between the waveforms before and after the transmission signal. The patent does not disclose the SOC estimation results.
[0006] Patent CN114236403A describes a method for detecting the State of Charge (SOC) of a lithium-ion battery under test using ultrasound during charging and discharging. After signal decomposition, filtering, noise reduction, and reconstruction, ultrasonic time-domain features (structural, statistical, and transform features) are extended onto the fitted envelope. The correlation coefficient between these features and SOC is calculated, highly correlated features are selected, and a preliminary model is constructed using a low-complexity regression model (such as random forest). The final model is then trained using the highly correlated features of the training battery. The highly correlated features of the test battery are input into the final model to obtain the state of charge. However, this method is very complex and inconvenient to use.
[0007] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention
[0008] To address the problems in related technologies, this invention proposes a method and system for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning, in order to overcome the aforementioned technical problems existing in the prior art.
[0009] Therefore, the specific technical solution adopted by the present invention is as follows:
[0010] In a first aspect, the present invention proposes a method for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning, comprising:
[0011] S1. Acquire the ultrasonic time-domain signal of the hard-shell lithium battery and preprocess the ultrasonic time-domain signal to obtain the preprocessed ultrasonic time-domain signal.
[0012] S2. An initial battery state-of-charge estimation model is constructed based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm and selective state-space mechanism.
[0013] S3. Input the preprocessed ultrasonic time-domain signal into the initial battery state-of-charge estimation model for training calculation, and obtain the number of training iterations and the loss error threshold.
[0014] S4. The initial battery state of charge estimation model is iteratively calculated using the number of training iterations and the loss error threshold to obtain the optimal battery state of charge estimation model, thereby improving the estimation accuracy of lithium battery state of charge.
[0015] Furthermore, the ultrasonic time-domain signal of the hard-shell lithium battery is acquired, and the ultrasonic time-domain signal is preprocessed to obtain the preprocessed ultrasonic time-domain signal, which includes:
[0016] S11. Obtain the ultrasonic transmission time-domain signal of the hard-shell lithium battery at different percentages of charge.
[0017] S12. Process and analyze the ultrasonic transmission signal, and determine the optimal signal at the intermediate measurement point based on the experimental results.
[0018] S13. Locate the selected normalized experimental signal to obtain the maximum value of the experimental signal, and determine the coordinates of the first zero-crossing point after the maximum value, which will be used as the coordinates for signal extraction.
[0019] S14. Based on the coordinate points extracted from the signal, the ultrasonic transmission signal is divided into a preceding signal and a following signal; wherein, the following signal consists of data after the coordinates are extracted, data after encountering a preset number of zero crossings, and data before the last zero crossing.
[0020] S15. The extracted subsequent signal data is processed in batches, with a preset batch of data as the preprocessed ultrasonic time-domain signal.
[0021] Furthermore, multi-scale convolutional neural network techniques include:
[0022] A multi-scale convolutional neural network consists of two convolutional neural networks with different preset kernel sizes;
[0023] Two convolutional neural networks with different preset kernel sizes were used to extract the preprocessed ultrasonic time-domain signal to obtain the first frequency feature and the second frequency feature.
[0024] Each convolutional neural network consists of two convolutional layers and two average pooling layers, which are alternately arranged. The average pooling layer sets the pooling kernel size to a preset value according to the number of channels of the input signal, while ensuring that all features of the input signal can participate in the calculation, and sets the pooling stride to a preset value.
[0025] By using a nonlinear activation function, the extracted local features are nonlinearly transformed to obtain the spatial features of the ultrasonic time-domain signal.
[0026] Furthermore, the bidirectional long short-term memory network algorithm includes:
[0027] The bidirectional long short-term memory network algorithm consists of a forward long short-term memory network and a backward long short-term memory network;
[0028] The forward long short-term memory network processes the preprocessed ultrasound time-domain signal in chronological order to capture the past context information of the sequence and outputs the forward hidden state;
[0029] The backward long short-term memory network processes the preprocessed ultrasound time-domain signal in reverse chronological order to capture the future context information of the sequence and output the backward hidden state;
[0030] The forward and backward hidden states are fused at time points to obtain the temporal characteristics of the preprocessed ultrasonic time-domain signal.
[0031] Furthermore, selective state-space mechanisms include:
[0032] The spatial and temporal features extracted by multi-scale convolutional neural network technology and bidirectional long short-term memory network algorithm are refined and fused using the selective state space mechanism.
[0033] The preprocessed ultrasonic time-domain signal is calculated using the selective scanning method and dynamic parameter matrix in the selective state-space mechanism.
[0034] By using selective dynamic weight adjustment and state evolution integration to process the calculation results, the optimized characteristics of the preprocessed ultrasonic time-domain signal are obtained.
[0035] Furthermore, the initial battery state-of-charge estimation model is constructed based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm, and selective state-space mechanism, including:
[0036] S21. Construct an initial battery state of charge estimation model based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm and selective state space mechanism;
[0037] S22. Spatial features of preprocessed ultrasonic time-domain signals are extracted using multi-scale convolutional neural network technology.
[0038] S23. Use a bidirectional long short-term memory network algorithm to extract the temporal features of the preprocessed ultrasonic time-domain signal;
[0039] S24. Optimized features of the preprocessed ultrasonic time-domain signal are extracted using a selective state-space mechanism.
[0040] Furthermore, the initial battery state-of-charge estimation model also includes:
[0041] Attention-based classification output mechanism;
[0042] The self-attention mechanism is used to calculate the similarity between each element and other elements in the preprocessed ultrasound time-domain signal in order to capture the dependencies between various positions in the sequence.
[0043] A query, key, and value matrix is generated using a self-attention mechanism. Attention scores are calculated by dot product and weighted summation is performed to obtain a new data representation for each element.
[0044] By using linear transformation and nonlinear activation functions, feature transformation and mapping are performed on the processed ultrasonic time-domain signal to obtain the estimated state of charge of the hard-shell lithium battery, so as to achieve classification output.
[0045] Furthermore, the preprocessed ultrasonic time-domain signal is input into the initial battery state-of-charge estimation model for training calculation, and the training iteration number and loss error threshold are obtained, including:
[0046] S31. Construct a loss function using the first-order moment estimate after bias correction, the second-order moment estimate after bias correction, and the learning rate;
[0047] S32. Input the value of the first-order moment estimate after bias correction into the loss function again to calculate the second-order moment estimate after bias correction.
[0048] S33. Based on the loss function, train the initial battery state of charge estimation model and reach the preset number of training iterations and loss error threshold.
[0049] Furthermore, the initial battery state of charge estimation model is iteratively calculated using the number of training iterations and the loss error threshold to obtain the optimal battery state of charge estimation model, thereby improving the estimation accuracy of lithium battery state of charge, including:
[0050] S41. Divide the dataset into training set, validation set and test set according to a preset ratio;
[0051] S42. Set the learning rate of the adaptive optimizer to the initial value and set the weight decay value. To prevent overfitting, add L2 regularization to the adaptive optimizer and set the regularization rate.
[0052] S43. Based on the preset values of cross-validation, remove the maximum and minimum values in the cross-validation and calculate the average of the remaining results;
[0053] S44. Based on the training strategy and dataset, iteratively train the initial battery state of charge estimation model and calculate it using the loss function;
[0054] S45. When the number of training iterations reaches the preset number and the loss error is less than the preset threshold, the training stops, and the optimal battery state of charge estimation model is obtained to improve the estimation accuracy of lithium battery state of charge.
[0055] Secondly, the present invention also provides a deep learning-based ultrasonic detection system for the state of charge of hard-shell lithium batteries, comprising:
[0056] The preprocessing module is used to acquire the ultrasonic time-domain signal of the hard-shell lithium battery and preprocess the ultrasonic time-domain signal to obtain the preprocessed ultrasonic time-domain signal.
[0057] The model building module is used to construct an initial battery state-of-charge estimation model based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm and selective state space mechanism.
[0058] The model training module is used to input the preprocessed ultrasonic time-domain signal into the initial battery state of charge estimation model for training calculation, and to obtain the number of training iterations and the loss error threshold.
[0059] The model optimization module is used to iteratively calculate the initial battery state of charge estimation model using the number of training iterations and the loss error threshold, so as to obtain the optimal battery state of charge estimation model and improve the estimation accuracy of lithium battery state of charge.
[0060] The beneficial effects of this invention are as follows:
[0061] (1) This invention proposes a battery state of charge estimation model. The battery state of charge estimation model uses MSCNN layers to capture the spatial features of the signal. Bi-LSTM can capture the temporal features of the signal well. Mamba can capture the spatiotemporal dependence of the signal well. Using ultrasonic transmission signals as input data, the information contained in the signal is fully utilized to improve the estimation accuracy of SOC.
[0062] (2) The present invention adopts a battery state of charge estimation model. The entire network includes a multi-scale convolutional neural network layer (MSCNN), a Bi-LSTM layer, a Mamba layer and an output module. The ultrasonic transmission signals of different percentages of battery power are collected and the battery SOC is estimated through a deep neural network, so as to promote the development of deep learning ultrasonic transmission estimation of battery SOC. Attached Figure Description
[0063] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0064] Figure 1 This is a flowchart of a deep learning-based ultrasonic detection method for the state of charge of hard-shell lithium batteries according to an embodiment of the present invention.
[0065] Figure 2 This is a schematic diagram of a deep learning-based ultrasonic detection system for the state of charge of hard-shell lithium batteries according to an embodiment of the present invention.
[0066] Figure 3 This is a flowchart illustrating the construction and training process of the battery state of charge estimation model in the ultrasonic detection method for hard-shell lithium batteries based on deep learning, according to an embodiment of the present invention.
[0067] Figure 4 This is a framework diagram of the multi-scale convolutional neural network layer in the ultrasonic detection method for the state of charge of hard-shell lithium batteries based on deep learning according to an embodiment of the present invention.
[0068] Figure 5 This is a structural diagram of MSCNN in the deep learning-based ultrasonic detection method for the state of charge of hard-shell lithium batteries according to an embodiment of the present invention. Detailed Implementation
[0069] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention.
[0070] According to embodiments of the present invention, a method and system for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning are proposed.
[0071] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, the ultrasonic detection method for the state of charge of a hard-shell lithium battery based on deep learning according to an embodiment of the present invention includes:
[0072] Step S1: Obtain the ultrasonic time-domain signal of the hard-shell lithium battery and preprocess the ultrasonic time-domain signal to obtain the preprocessed ultrasonic time-domain signal.
[0073] Step S2: Construct an initial battery state-of-charge estimation model based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm, and selective state-space mechanism;
[0074] Step S3: Input the preprocessed ultrasonic time-domain signal into the initial battery state of charge estimation model for training calculation, and obtain the number of training iterations and the loss error threshold.
[0075] Step S4: Iteratively calculate the initial battery state of charge estimation model using the number of training iterations and the loss error threshold to obtain the optimal battery state of charge estimation model, thereby improving the estimation accuracy of lithium battery state of charge.
[0076] In this optional embodiment, the ultrasonic time-domain signal of the hard-shell lithium battery is acquired, and the ultrasonic time-domain signal is preprocessed to obtain the preprocessed ultrasonic time-domain signal, including:
[0077] S11. Obtain the ultrasonic transmission time-domain signal of the hard-shell lithium battery at different percentages of charge.
[0078] S12. Process and analyze the ultrasonic transmission signal, and determine the optimal signal at the intermediate measurement point based on the experimental results.
[0079] S13. Locate the selected normalized experimental signal to obtain the maximum value of the experimental signal, and determine the coordinates of the first zero-crossing point after the maximum value, which will be used as the coordinates for signal extraction.
[0080] S14. Based on the coordinate points extracted from the signal, the ultrasonic transmission signal is divided into a preceding signal and a following signal; wherein, the following signal consists of data after the coordinates are extracted, data after encountering a preset number of zero crossings, and data before the last zero crossing.
[0081] S15. The extracted subsequent signal data is processed in batches, with a preset batch of data as the preprocessed ultrasonic time-domain signal.
[0082] Specifically, the input sample data is constructed, including data acquisition and preprocessing. Ultrasonic transmission signals S(n) at different battery percentages are acquired, and the ultrasonic transmission signals S(n) are extracted and normalized to obtain the preprocessed back-end ultrasonic transmission signal Sl(n). The dataset used is from personal collection, with hard-shell lithium batteries as the experimental target. Specifically, this invention uses a constant temperature chamber to control the temperature to ensure the acquisition conditions, and uses an ultrasonic device to emit ultrasonic waves to six different batteries, recording the ultrasonic wave patterns at different battery percentages.
[0083] Simultaneously, the acquired ultrasonic transmission signals underwent signal extraction and preprocessing. After processing the experimental data, it was found that the signal obtained from the intermediate measuring point had the best effect, and therefore, the ultrasonic signal obtained from the intermediate measuring point was adopted. Signal extraction involved dividing the normalized transmission signal S(n) into two parts: a preceding signal Sf(n) and a following signal Sl(n). To perform extraction, the maximum value of the signal was first determined as the reference point for extraction. The coordinates closest to 0 near the first zero-crossing point after the maximum value were then used as the signal extraction coordinates. The following signal consisted of data after the extracted coordinates and data from the point after 10 consecutive zero-crossings up to the point before the last zero-crossing. The extracted signal dataset was processed in batches, with every 64 data points input into the initial battery state-of-charge estimation model.
[0084] In this optional embodiment, the multi-scale convolutional neural network technique includes:
[0085] A multi-scale convolutional neural network consists of two convolutional neural networks with different preset kernel sizes;
[0086] Two convolutional neural networks with different preset kernel sizes were used to extract the preprocessed ultrasonic time-domain signal to obtain the first frequency feature and the second frequency feature.
[0087] Each convolutional neural network consists of two convolutional layers and two average pooling layers, which are alternately arranged. The average pooling layer sets the pooling kernel size to a preset value according to the number of channels of the input signal, while ensuring that all features of the input signal can participate in the calculation, and sets the pooling stride to a preset value.
[0088] By using a nonlinear activation function, the extracted local features are nonlinearly transformed to obtain the spatial features of the ultrasonic time-domain signal.
[0089] Specifically, a multi-scale convolutional neural network is used to extract the first frequency feature and the second frequency feature from the input sample data;
[0090] Nonlinear processing is applied to local feature extraction based on nonlinear activation functions.
[0091] Specifically, such as Figure 5 As shown, the local feature extraction module consists of multiple MSCNNs (i.e., multi-scale convolutional neural networks), and the multi-scale convolutional neural network layers are as follows: Figure 4As shown, MSCNN consists of two CNNs (convolutional neural networks) with different kernel sizes. These two CNNs are used to precisely capture different frequencies. The smaller kernel captures the high-frequency features (first frequency features) of the ultrasound signal, while the larger kernel captures the low-frequency features (second frequency features). For example, if the dataset's acquisition rate (Fs) is 50 Hz (50 points per second), setting the size of the larger kernel to 200 (Fs*4) allows for the use of four windows to capture the ultrasound signal throughout the entire cycle. Setting the kernel size of the other CNN to 25 (Fs / 2) effectively extracts the high-frequency features of the ultrasound signal.
[0092] In MSCNN, each CNN consists of two convolutional layers and two average pooling layers. In addition, the ReLU activation function (i.e., a non-linear activation function) is used to maintain the non-linearity of MSCNN. The number of channels of the input signal is considered to be 1, so the kernel size used in the average pooling layer is 1. Since the features of each part of the input signal affect the classification result, a stride of 1 is selected in the average pooling layer. This module realizes spatial feature extraction.
[0093] The multi-scale convolutional neural network layer consists of two convolutional neural networks with different kernel sizes in the MSCNN. The smaller kernel captures the high-frequency features of the ultrasound signal, while the larger kernel captures the low-frequency features. The size of the larger kernel is set to 200 (Fs*4), allowing four windows to capture the ultrasound signal throughout the entire cycle. The kernel size of the other CNN is set to 25 (Fs / 2), which effectively extracts the high-frequency features of the ultrasound signal. Each CNN consists of two convolutional layers and two average pooling layers. Furthermore, the ReLU activation function is used to maintain the non-linearity of the MSCNN. The number of channels of the input signal is considered to be 1, so the kernel size used in the average pooling layer is 1. Since the features of each part of the input signal affect the classification result, a stride of 1 is chosen in the average pooling layer, and the Dropout parameter is set to 0.1.
[0094] In this optional embodiment, the bidirectional long short-term memory network algorithm includes:
[0095] The bidirectional long short-term memory network algorithm consists of a forward long short-term memory network and a backward long short-term memory network;
[0096] The forward long short-term memory network processes the preprocessed ultrasound time-domain signal in chronological order to capture the past context information of the sequence and outputs the forward hidden state;
[0097] The backward long short-term memory network processes the preprocessed ultrasound time-domain signal in reverse chronological order to capture the future context information of the sequence and output the backward hidden state;
[0098] The forward and backward hidden states are fused at time points to obtain the temporal characteristics of the preprocessed ultrasonic time-domain signal.
[0099] Specifically, the temporal feature extraction module consists of a Bi-LSTM (Bidirectional Long Short-Term Memory) module, which comprises a forward LSTM and a backward LSTM. The forward LSTM processes the feature sequence in chronological order to capture past contextual information, while the backward LSTM processes it in reverse chronological order to capture future contextual information. The hidden states of both are concatenated to provide complete context for each time point. A single LSTM is a special type of RNN, consisting of units, input gates, output gates, and forget gates. The expression for the forward LSTM is:
[0100]
[0101] The backward LSTM expression is:
[0102]
[0103] In the formula, Indicates the weights of the forward LSTM. Indicates the weights of the backward LSTM. Indicates the bias parameter. This represents the activation function. and Indicates a hidden state. and Indicates cell state, Indicates the input sequence, and Represents the Gate of Oblivion and Indicates the input gate. and Indicates the output gate. This represents the Sigmoid function.
[0104] In this optional embodiment, the selective state-space mechanism includes:
[0105] The spatial and temporal features extracted by multi-scale convolutional neural network technology and bidirectional long short-term memory network algorithm are refined and fused using the selective state space mechanism.
[0106] The preprocessed ultrasonic time-domain signal is calculated using the selective scanning method and dynamic parameter matrix in the selective state-space mechanism.
[0107] By using selective dynamic weight adjustment and state evolution integration to process the calculation results, the optimized characteristics of the preprocessed ultrasonic time-domain signal are obtained.
[0108] Specifically, the Selective StateSpace Model of the Mamba module (i.e., the state space mechanism) is used to refine and fuse the spatial features extracted by the multi-scale convolutional neural network module and the temporal features captured by the bidirectional long short-term memory network module.
[0109] The Mamba Selective State Space Model (S6) is characterized by a dynamic parameter matrix dependent on the input and a selective scanning mechanism, unlike the fixed parameters of traditional SSMs. The process is implemented as follows:
[0110]
[0111] in, It represents the internal state of the system at time t, capturing the evolutionary history and dynamic information of the sequence data. Represents the hidden state vector In time The instantaneous rate of change at that point External representation of input signal, Indicates the system in time The output is a result vector calculated based on the current state and input. A is the internal dynamic matrix of the system, B is the input matrix, C is the output matrix, and D is the feedforward matrix.
[0112] MSCNN outputs spatial features (e.g., high-frequency local transients and low-frequency global patterns), while Bi-LSTM outputs temporal features (concatenation of past and future contexts). The Mamba module receives these as input x(t), refines them using selective SSM (dynamic weight adjustment) and fuses them (state evolution integration), and passes the optimized output features to the attention classification output mechanism.
[0113] In this optional embodiment, the initial battery state-of-charge estimation model constructed based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm, and selective state-space mechanism includes:
[0114] S21. Construct an initial battery state of charge estimation model based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm and selective state space mechanism;
[0115] S22. Spatial features of preprocessed ultrasonic time-domain signals are extracted using multi-scale convolutional neural network technology.
[0116] S23. Use a bidirectional long short-term memory network algorithm to extract the temporal features of the preprocessed ultrasonic time-domain signal;
[0117] S24. Optimized features of the preprocessed ultrasonic time-domain signal are extracted using a selective state-space mechanism.
[0118] Specifically, an initial battery state-of-charge estimation model is constructed, including: a spatial feature extraction module, a temporal feature extraction module, a spatiotemporal dependency extraction module, and a classification output module. The network structure is as follows: Figure 3 As shown, the extracted signal dataset is input into the initial battery state-of-charge estimation model.
[0119] In this optional embodiment, the initial battery state-of-charge estimation model further includes:
[0120] Attention-based classification output mechanism;
[0121] The self-attention mechanism is used to calculate the similarity between each element and other elements in the preprocessed ultrasound time-domain signal in order to capture the dependencies between various positions in the sequence.
[0122] A query, key, and value matrix is generated using a self-attention mechanism. Attention scores are calculated by dot product and weighted summation is performed to obtain a new data representation for each element.
[0123] By using linear transformation and nonlinear activation functions, feature transformation and mapping are performed on the processed ultrasonic time-domain signal to obtain the estimated state of charge of the hard-shell lithium battery, so as to achieve classification output.
[0124] Specifically, the self-attention mechanism is used to calculate the similarity between each element in the input sequence and other elements, and to capture the dependencies between different positions in the sequence.
[0125] Generate query, key, and value matrices, calculate attention scores through dot products, and then sum them with weights to obtain the data representation for each element;
[0126] Based on linear transformation and nonlinear activation functions, feature transformation and mapping are performed on the input data to obtain the estimated battery state of charge, so as to achieve classification output.
[0127] Specifically, the self-attention mechanism captures the dependencies between positions in the input sequence by calculating the similarity between each element and other elements. It generates a query and sum matrix, calculates attention scores through dot products, and performs weighted summation to obtain a new representation for each element. The fully connected layer includes a series of linear transformations and non-linear activation functions to perform feature transformations and mappings on the input data, thereby obtaining the estimated battery SOC.
[0128] In this optional embodiment, the preprocessed ultrasonic time-domain signal is input into the initial battery state-of-charge estimation model for training calculation, and the training iteration number and loss error threshold are obtained, including:
[0129] S31. Construct a loss function using the first-order moment estimate after bias correction, the second-order moment estimate after bias correction, and the learning rate;
[0130] S32. Input the value of the first-order moment estimate after bias correction into the loss function again to calculate the second-order moment estimate after bias correction.
[0131] S33. Based on the loss function, train the initial battery state of charge estimation model and reach the preset number of training iterations and loss error threshold.
[0132] Specifically, constructing the loss function also includes:
[0133] A loss function is constructed using the bias-corrected first-order moment estimate, the bias-corrected second-order moment estimate, and the learning rate.
[0134] Specifically, constructing the loss function includes:
[0135] The expression for the first-order moment estimate after bias correction is:
[0136]
[0137] In the formula, This represents the first-order moment estimate after bias correction. Indicates the parameter at time step The value, For learning rate, This represents a small constant to prevent division by zero. It represents the second moment of the gradient.
[0138] The expression for the bias-corrected second-order moment estimate is obtained by inputting the first-order moment estimate value back into the loss function after bias correction:
[0139]
[0140] In the formula, Indicates time First-order momentum estimation with bias correction This represents the second-order momentum estimate. Indicates the parameter at time step The value, The loss function L represents the parameters gradient, This represents the first moment estimate of the gradient. This represents the second-order moment estimate of the gradient. This represents the exponential decay rate estimated by the first moment. This represents the exponential decay rate of the second-order moment estimate.
[0141] In this optional embodiment, the initial battery state of charge estimation model is iteratively calculated using the number of training iterations and the loss error threshold to obtain the optimal battery state of charge estimation model, thereby improving the estimation accuracy of the lithium battery state of charge, including:
[0142] S41. Divide the dataset into training set, validation set and test set according to a preset ratio;
[0143] S42. Set the learning rate of the adaptive optimizer to the initial value and set the weight decay value. To prevent overfitting, add L2 regularization to the adaptive optimizer and set the regularization rate.
[0144] S43. Based on the preset values of cross-validation, remove the maximum and minimum values in the cross-validation and calculate the average of the remaining results;
[0145] S44. Based on the training strategy and dataset, iteratively train the initial battery state of charge estimation model and calculate it using the loss function;
[0146] S45. When the number of training iterations reaches the preset number and the loss error is less than the preset threshold, the training stops, and the optimal battery state of charge estimation model is obtained to improve the estimation accuracy of lithium battery state of charge.
[0147] Specifically, the initial battery state of charge estimation model is trained, and the loss function L is calculated. Training stops when the number of training iterations reaches a set number or the loss error is less than a set threshold, thus obtaining the optimal reconstruction model. The dataset is divided into 8:1:1 proportions. 48 different percentages of SOC data from the ultrasonic transmission signals of hard-shell lithium batteries are used as the training set, 6 as the validation set, and the remaining 6 as the test set. Training is performed on the constructed initial battery state of charge estimation model. The K value of K cross-validation is set to 20. To prevent random errors, the maximum and minimum values obtained from the 20 cross-validations are removed, and the average of the remaining 18 results is calculated. To prevent overfitting, some solutions are adopted, such as L2 regularization. It is added to the Adam optimizer, and the regularization rate is set to 0.00001. In addition, the learner's learning rate is set to adaptive with an initial value of 0.001, the weight decay is set to 0.0001, and the training period is set to 500.
[0148] like Figure 2 As shown, according to another embodiment of the present invention, a deep learning-based ultrasonic detection system for the state of charge of a hard-shell lithium battery is also provided, comprising:
[0149] Preprocessing module 1 is used to acquire the ultrasonic time-domain signal of the hard-shell lithium battery and preprocess the ultrasonic time-domain signal to obtain the preprocessed ultrasonic time-domain signal.
[0150] Model building module 2 is used to build an initial battery state of charge estimation model based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm and selective state space mechanism;
[0151] Model training module 3 is used to input the preprocessed ultrasonic time-domain signal into the initial battery state of charge estimation model for training calculation, and to obtain the number of training iterations and the loss error threshold.
[0152] Model optimization module 4 is used to iteratively calculate the initial battery state of charge estimation model using the number of training iterations and the loss error threshold, so as to obtain the optimal battery state of charge estimation model and improve the estimation accuracy of lithium battery state of charge.
[0153] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning, characterized in that, include: S1. Acquire the ultrasonic time-domain signal of the hard-shell lithium battery and preprocess the ultrasonic time-domain signal to obtain the ultrasonic time-domain signal. S2. An initial battery state-of-charge estimation model is constructed based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm and selective state-space mechanism. S3. Input the preprocessed ultrasonic time-domain signal into the initial battery state-of-charge estimation model for training calculation, and obtain the number of training iterations and the loss error threshold. S4. The initial battery state of charge estimation model is iteratively calculated using the number of training iterations and the loss error threshold to obtain the optimal battery state of charge estimation model, thereby improving the estimation accuracy of lithium battery state of charge.
2. The method for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning according to claim 1, characterized in that, The process of acquiring the ultrasonic time-domain signal of the hard-shell lithium battery and preprocessing the ultrasonic time-domain signal to obtain the preprocessed ultrasonic time-domain signal includes: S11. Obtain the ultrasonic transmission time-domain signal of the hard-shell lithium battery at different percentages of charge. S12. Process and analyze the ultrasonic transmission signal, and determine the optimal signal at the intermediate measurement point based on the experimental results; S13. Locate the selected normalized experimental signal to obtain the maximum value of the experimental signal, and determine the coordinates of the first zero-crossing point after the maximum value, which will be used as the coordinates for signal extraction. S14. Based on the coordinate points extracted from the signal, the ultrasonic transmission signal is divided into a preceding signal and a following signal; wherein, the following signal consists of data after the coordinates are extracted, data after encountering a preset number of zero crossings, and data before the last zero crossing. S15. The extracted subsequent signal data is processed in batches, with a preset batch of data as the preprocessed ultrasonic time-domain signal.
3. The method for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning according to claim 1, characterized in that, The multi-scale convolutional neural network technology includes: A multi-scale convolutional neural network consists of two convolutional neural networks with different preset kernel sizes; Two convolutional neural networks with different preset kernel sizes were used to extract the preprocessed ultrasonic time-domain signal to obtain the first frequency feature and the second frequency feature. Each convolutional neural network consists of two convolutional layers and two average pooling layers, which are alternately arranged. The average pooling layer sets the pooling kernel size to a preset value according to the number of channels of the input signal, while ensuring that all features of the input signal can participate in the calculation, and sets the pooling stride to a preset value. By using a nonlinear activation function, the extracted local features are nonlinearly transformed to obtain the spatial features of the ultrasonic time-domain signal.
4. The method for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning according to claim 3, characterized in that, The bidirectional long short-term memory network algorithm includes: The bidirectional long short-term memory network algorithm consists of a forward long short-term memory network and a backward long short-term memory network; The forward long short-term memory network processes the preprocessed ultrasound time-domain signal in chronological order to capture the past context information of the sequence and outputs the forward hidden state; The backward long short-term memory network processes the preprocessed ultrasound time-domain signal in reverse chronological order to capture the future context information of the sequence and output the backward hidden state; The forward and backward hidden states are fused at time points to obtain the temporal characteristics of the preprocessed ultrasonic time-domain signal.
5. The method for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning according to claim 4, characterized in that, The selective state-space mechanism includes: The spatial and temporal features extracted by multi-scale convolutional neural network technology and bidirectional long short-term memory network algorithm are refined and fused using the selective state space mechanism. The preprocessed ultrasonic time-domain signal is calculated using the selective scanning method and dynamic parameter matrix in the selective state-space mechanism. By using selective dynamic weight adjustment and state evolution integration to process the calculation results, the optimized characteristics of the preprocessed ultrasonic time-domain signal are obtained.
6. The method for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning according to claim 5, characterized in that, The initial battery state-of-charge estimation model constructed based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm, and selective state-space mechanism includes: S21. Construct an initial battery state of charge estimation model based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm and selective state space mechanism; S22. Spatial features of preprocessed ultrasonic time-domain signals are extracted using multi-scale convolutional neural network technology. S23. Use a bidirectional long short-term memory network algorithm to extract the temporal features of the preprocessed ultrasonic time-domain signal; S24. Optimized features of the preprocessed ultrasonic time-domain signal are extracted using a selective state-space mechanism.
7. The method for ultrasonic detection of the state of charge of a hard-shell lithium battery based on deep learning according to claim 6, characterized in that, The initial battery state-of-charge estimation model also includes: Attention-based classification output mechanism; The self-attention mechanism is used to calculate the similarity between each element and other elements in the preprocessed ultrasound time-domain signal in order to capture the dependencies between various positions in the sequence. A query, key, and value matrix is generated using a self-attention mechanism. Attention scores are calculated by dot product and weighted summation is performed to obtain a new data representation for each element. By using linear transformation and nonlinear activation functions, feature transformation and mapping are performed on the processed ultrasonic time-domain signal to obtain the estimated state of charge of the hard-shell lithium battery, so as to achieve classification output.
8. The method for ultrasonic detection of the state of charge of hard-shell lithium batteries based on deep learning according to claim 1, characterized in that, The step of inputting the preprocessed ultrasonic time-domain signal into the initial battery state-of-charge estimation model for training calculation, and obtaining the number of training iterations and the loss error threshold, includes: S31. Construct a loss function using the first-order moment estimate after bias correction, the second-order moment estimate after bias correction, and the learning rate; S32. Input the value of the first-order moment estimate after bias correction into the loss function again to calculate the second-order moment estimate after bias correction. S33. Based on the loss function, train the initial battery state of charge estimation model and reach the preset number of training iterations and loss error threshold.
9. The method for ultrasonic detection of the state of charge of a hard-shell lithium battery based on deep learning according to claim 1, characterized in that, The step of iteratively calculating the initial battery state of charge estimation model using the number of training iterations and the loss error threshold to obtain the optimal battery state of charge estimation model, thereby improving the estimation accuracy of lithium battery state of charge, includes: S41. Divide the dataset into training set, validation set and test set according to a preset ratio; S42. Set the learning rate of the adaptive optimizer to the initial value and set the weight decay value. To prevent overfitting, add L2 regularization to the adaptive optimizer and set the regularization rate. S43. Based on the preset values of cross-validation, remove the maximum and minimum values in the cross-validation and calculate the average of the remaining results; S44. Based on the training strategy and dataset, iteratively train the initial battery state of charge estimation model and calculate it using the loss function; S45. When the number of training iterations reaches the preset number and the loss error is less than the preset threshold, the training stops, and the optimal battery state of charge estimation model is obtained to improve the estimation accuracy of lithium battery state of charge.
10. A deep learning-based ultrasonic detection system for the state of charge (SOC) of hard-shell lithium batteries, used to implement the deep learning-based ultrasonic detection method for the SOC of hard-shell lithium batteries as described in any one of claims 1-9, characterized in that, include: The preprocessing module is used to acquire the ultrasonic time-domain signal of the hard-shell lithium battery and preprocess the ultrasonic time-domain signal to obtain the preprocessed ultrasonic time-domain signal. The model building module is used to construct an initial battery state-of-charge estimation model based on multi-scale convolutional neural network technology, bidirectional long short-term memory network algorithm and selective state space mechanism. The model training module is used to input the preprocessed ultrasonic time-domain signal into the initial battery state of charge estimation model for training calculation, and to obtain the number of training iterations and the loss error threshold. The model optimization module is used to iteratively calculate the initial battery state of charge estimation model using the number of training iterations and the loss error threshold, so as to obtain the optimal battery state of charge estimation model and improve the estimation accuracy of lithium battery state of charge.