A battery remaining useful life prediction method, system, device and medium based on a double-branch encoder
Patent Information
- Application Number
- CN202611269502.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-10-09
AI Technical Summary
然而,现有基于深度学习的RUL预测方法主要集中在单一模态数据的特征提取,例如仅使用1D电池充电曲线进行预测,而由于数据的单一性,往往无法充分捕捉电池退化的复杂动态
[0016]本发明由于采取以上技术方案,其具有以下优点:本发明通过双分支编码器结合1D充电曲线和2D GAF图像的多模态数据,能够有效提取电池的早期退化信号,提升电池RUL预测的精度。尤其是在数据稀缺的情况下,本发明能够克服传统方法的局限性,提供更准确的预测结果。通过设计高效的网络架构,充分挖掘时间序列和图像表示之间的交互信息,本发明提供了一种鲁棒且高效的电池健康监测解决方案,适用于电动汽车和储能系统等多个领域。
Smart Images

Figure CN122882998A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of battery health management technology, and specifically relates to a method, system, device and medium for predicting the remaining service life (RUL) of a battery based on a dual-branch encoder, which is applicable to scenarios of predicting the RUL of lithium-ion batteries using multimodal representations (including 1D charging curves and 2D GAF images). Background Technology
[0002] Lithium-ion batteries are widely used in electric vehicles and energy storage systems, and battery rangeability (RUL) prediction is a crucial task in battery health management systems. Traditional RUL prediction methods largely rely on long-cycle charging data, but in practical applications, data scarcity is a common problem, especially in the early stages of battery life when charging cycles are limited. At this time, the battery's degradation signals are weak and susceptible to noise interference, leading to a decrease in the prediction accuracy of traditional RUL prediction methods.
[0003] To overcome the impact of data scarcity, many deep learning-based RUL prediction methods have emerged. However, existing deep learning-based RUL prediction methods mainly focus on feature extraction from single-modality data, such as using only 1D battery charging curves for prediction. Due to the limited data diversity, these methods often fail to fully capture the complex dynamics of battery degradation.
[0004] Recent research has proposed the concept of multimodal data fusion, which combines data from different modalities, such as 1D time series data and 2D image data, to enhance the robustness of prediction models. However, the effectiveness of this multimodal data fusion remains challenging under low-data conditions. How to design an efficient network architecture to achieve high-accuracy RUL predictions with limited data remains an urgent problem to be solved. Summary of the Invention
[0005] To address the aforementioned problems, the present invention aims to provide a method, system, device, and medium for predicting the remaining battery life (RUL) based on a dual-branch encoder. By combining multimodal data from 1D charging curves and 2D GAF images with a dual-branch encoder, early degradation signals of the battery can be effectively extracted, thereby improving the accuracy of battery RUL prediction.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for predicting the remaining battery life based on a dual-branch encoder, comprising the following steps: The charging data of the battery under test is collected and preprocessed to obtain the current input data; The current input data is fed into a pre-trained dual-branch encoder to extract temporal and spatial features. The extracted temporal and spatial features are fused and then input into a pre-trained Transformer model to perform regression prediction on the RUL of the tested battery, thus obtaining the RUL prediction result.
[0007] Furthermore, before collecting and preprocessing the charging data of the tested battery to obtain the current input data, the process also includes: Collect and preprocess battery charging data to create a multimodal dataset containing one-dimensional charging curves and two-dimensional GAF images; The pre-built bi-branch encoder and Transformer models were trained and optimized based on a multimodal dataset to obtain the best-performing bi-branch encoder and Transformer models.
[0008] Furthermore, the process of collecting and preprocessing battery charging data to establish a multimodal dataset containing one-dimensional charging curves and two-dimensional GAF images includes: The charging and discharging process of different types of lithium-ion batteries is monitored to obtain multiple operating parameters of different types of lithium-ion batteries under different operating conditions, including at least voltage, current, temperature and remaining capacity. One-dimensional charging curves are generated based on multiple operating parameters of different types of lithium-ion batteries under different operating conditions. Based on the one-dimensional charging curve, a corresponding two-dimensional GAF image is generated; One-dimensional charging curves and two-dimensional GAF images are used together as the original multimodal dataset; The original multimodal dataset is preprocessed and organized into a preset data format to serve as the multimodal dataset.
[0009] Furthermore, the dual-branch encoder includes a curve encoder and a GAF encoder; The curve encoder takes a one-dimensional charging curve as input, uses a one-dimensional convolutional neural network to extract multi-scale features from the one-dimensional charging curve, and outputs time-series features. The GAF encoder takes two-dimensional GAF image data as input, processes the two-dimensional GAF image data using a 2D convolutional neural network, and outputs spatial features.
[0010] Furthermore, the curve encoder includes a dimension transformation module, a first Stem module, a multi-scale residual block, and an output module; The dimension transformation module is used to perform dimension transformation on the input one-dimensional charging curve using Einops rearrangement to obtain input data of a preset dimension; The first Stem module is used to extract temporal local patterns from the input data using multiple convolutional layers; The multi-scale residual block is used for multi-scale temporal feature enhancement based on temporal local patterns; The output module is used to output the extracted temporal features.
[0011] Furthermore, the GAF encoder includes a second Stem module, multiple cascaded inverted residual modules, and an adaptive average pooling module; The second Stem module is used to extract the spatial patterns of the input two-dimensional GAF image data using a deep convolutional network; Each of the inverted residual modules is used for multi-level spatial feature enhancement based on spatial patterns; The adaptive average pooling module is used to adjust the size of multi-level spatial features to a preset size to ensure that the output feature dimension matches the subsequent feature fusion module.
[0012] Furthermore, the Transformer model is composed of multiple stacked Transformer modules, each of which includes a layer normalization layer, a multi-head self-attention sub-layer, and a feedforward neural network sub-layer. The layer normalization is used to normalize the input data; The multi-head self-attention sublayer is used to perform Q, K, V linear mapping on normalized data, calculate the scaling dot product attention weights between different time segments and image regions, and aggregate cross-modal context features based on these attention weights. The feedforward neural network sublayer is used to perform nonlinear transformation and channel dimension mapping on the context features output by the multi-head self-attention sublayer, and output them sequentially to the next Transformer module; The final layer of the Transformer module outputs the CLS token features from the sequence to the prediction head, which then outputs the final RUL prediction value.
[0013] Secondly, the present invention provides a battery remaining life prediction system based on a dual-branch encoder, comprising: The real-time data acquisition module is used to collect and preprocess the charging data of the battery under test to obtain the current input data; The feature extraction module is used to input the current input data into a pre-trained dual-branch encoder and extract temporal and spatial features. The feature fusion and prediction module is used to fuse the extracted temporal and spatial features and input them into a pre-trained Transformer model to perform regression prediction on the RUL of the tested battery and obtain the RUL prediction result.
[0014] Thirdly, the present invention provides a computer-readable storage medium for storing one or more programs, said one or more programs including instructions that, when executed by a computing device, cause the computing device to perform any method.
[0015] Fourthly, the present invention provides a computing device comprising: one or more processors and a memory, wherein the memory stores one or more programs and is configured to be executed by the one or more processors, the one or more programs including instructions for performing any method.
[0016] This invention, by adopting the above technical solutions, has the following advantages: By combining multimodal data from 1D charging curves and 2D GAF images with a dual-branch encoder, it can effectively extract early degradation signals of the battery, improving the accuracy of battery RUL prediction. Especially in situations where data is scarce, this invention can overcome the limitations of traditional methods and provide more accurate prediction results. By designing an efficient network architecture and fully exploring the interaction information between time series and image representations, this invention provides a robust and efficient battery health monitoring solution applicable to multiple fields such as electric vehicles and energy storage systems. Attached Figure Description
[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. In the drawings: Figure 1 This is a flowchart of the battery remaining life prediction method based on a dual-branch encoder provided in an embodiment of the present invention; Figure 2 This is an overall structural diagram of the dual-branch encoder and Transformer model provided in an embodiment of the present invention; Figure 3 A comparison chart of battery RUL prediction results provided in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention are within the scope of protection of the present invention.
[0019] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0020] In some embodiments of the present invention, a method for predicting the remaining battery life based on a dual-branch encoder is provided. This method predicts the remaining battery life by acquiring multidimensional battery data and its Gramian Angular Field (GAF) image representation. The present invention requires only a small amount of multimodal data (1D charging curves and 2D GAF images) as input. Using a constructed dual-branch deep learning network, the remaining battery life can be obtained, thereby providing users with information on battery health and enabling battery management.
[0021] Correspondingly, in other embodiments of the present invention, a battery remaining life prediction system, device, and medium based on a dual-branch encoder are provided.
[0022] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the invention and to fully convey the scope of the invention to those skilled in the art.
[0023] Example 1 like Figure 1 As shown, this embodiment provides a method for predicting the remaining battery life based on a dual-branch encoder, which includes the following steps: Step 1: Collect and preprocess battery charging data to create a multimodal dataset containing one-dimensional (1D) charging curves and two-dimensional (2D) GAF images; Step 2: Train the pre-built dual-branch encoder and Transformer model based on the multimodal dataset to obtain the dual-branch encoder and Transformer model with the best performance; Step 3: Collect and preprocess the charging data of the battery under test to obtain the current input data; Step 4: Input the current input data into the dual-branch encoder to extract temporal and spatial features; Step 5: After fusing the extracted temporal and spatial features, input them into the Transformer model to perform regression prediction on the RUL of the tested battery and obtain the RUL prediction result.
[0024] Furthermore, step 1 above includes the following steps: Step 1.1: Monitor the charging and discharging process of different types of lithium-ion batteries and obtain multiple operating parameters of different types of lithium-ion batteries under different working conditions, including information such as voltage, current, temperature and remaining capacity; Step 1.2: Generate 1D charging curves based on multiple operating parameters of different types of lithium-ion batteries under different operating conditions; Step 1.3: Generate the corresponding 2D GAF image based on the 1D charging curve; Step 1.4: Combine the 1D charging curve and the 2D GAF image as the original multimodal dataset; Step 1.5: Preprocess the original multimodal dataset and organize it into a preset data format as a multimodal dataset.
[0025] In this embodiment, the multimodal dataset is organized into a data format suitable for deep learning algorithms.
[0026] Furthermore, in step 1.5 above, the preprocessing of the original multimodal dataset includes denoising and normalization.
[0027] Preferably, for 1D charging curve data, this embodiment uses a Savitzky-Golay filter for smoothing to remove high-frequency noise. Subsequently, Z-score normalization is used to normalize the filtered 1D charging curve data so that the mean of each input feature is 0 and the variance is 1, thereby accelerating the convergence of the model. For 2D GAF image data, since it is generated by mapping the already smoothed and normalized 1D charging curves, the generation process mainly characterizes the angular correlation between sequential samples. Therefore, this embodiment prioritizes normalizing its pixel values to the range of [0,1] to preserve the GAF texture structure. When there is significant discrete noise in the image generation or scaling process, lightweight median filtering or Gaussian filtering can also be optionally used for smoothing, but this optional processing does not change the temporal correlation expression of the GAF image.
[0028] Furthermore, step 2 above includes the following steps: Step 2.1: Divide the training dataset according to a preset ratio to obtain the training set, validation set, and test set; Step 2.2: Train the pre-built dual-branch encoder and Transformer model using the training set; Step 2.3: During the model training phase, through validation and optimization iterations, the dual-branch encoder and Transformer models with the best performance on the validation set are selected for RUL prediction of the tested batteries in the test set.
[0029] Furthermore, in step 2.2 above, the dual-branch encoder constructed in this embodiment includes a curve encoder and a GAF encoder. The curve encoder takes a 1D charging curve as input, uses a 1D convolutional neural network (CNN) to extract multi-scale features from the 1D charging curve, and outputs temporal features. The GAF encoder takes 2D GAF image data as input, uses a 2D convolutional neural network to process the 2D GAF image data, and outputs spatial features.
[0030] Furthermore, the curve encoder includes a dimension transformation module, a first Stem module, a multi-scale residual block (MultiScaleResBlock1D), and an output module. The dimension transformation module uses einops rearrangement to transform the dimensions of the input 1D charging curve, obtaining input data of a preset dimension. The first Stem module uses multiple convolutional layers to extract temporal local patterns from the input data. The multi-scale residual block performs multi-scale temporal feature enhancement based on these temporal local patterns. The output module outputs the extracted temporal features.
[0031] Furthermore, the GAF encoder includes a second Stem module, multiple cascaded inverted residual modules (MBConv), and an adaptive average pooling module. The second Stem module is used to extract spatial patterns from the input 2D GAF image data using a deep convolutional network; each inverted residual module is used to perform multi-level spatial feature enhancement based on the spatial patterns; and the adaptive average pooling module is used to adjust the dimensions of the multi-level spatial features to a preset size to ensure that the output feature dimensions match those of subsequent feature fusion modules.
[0032] Furthermore, in step 2.2 above, the Transformer model used in this embodiment employs a standard multi-head self-attention mechanism to enhance the interaction effect of cross-modal features and fully leverage the complementary advantages of 1D and 2D data. Simultaneously, the introduction of a multi-head attention structure into the self-attention mechanism allows the model to process information in parallel across multiple subspaces, enhancing its representational capabilities, and making it particularly suitable for scenarios with limited data.
[0033] Specifically, the Transformer model is constructed by stacking multiple Transformer modules. Each Transformer module includes a layer normalization layer, a multi-head self-attention sub-layer, and a feedforward neural network sub-layer. The layer normalization layer normalizes the input data; the multi-head self-attention sub-layer performs Q, K, V linear mapping on the normalized data, calculates the scaling dot product attention weights between different time segments and image regions, and aggregates cross-modal contextual features based on these attention weights; the feedforward neural network sub-layer performs non-linear transformations and channel dimension mappings on the contextual features output by the multi-head self-attention sub-layer to enhance feature representation. After the multiple Transformer modules are concatenated, only the CLS token features from the output sequence of the last layer are input into the prediction head to obtain the final RUL prediction value.
[0034] Furthermore, in step 2.3 above, during the training phase, when validating the model, K-fold cross-validation is used, with mean squared error as the optimization objective, to ensure the model's generalization performance on various datasets.
[0035] Furthermore, in step 5 above, when fusing the extracted temporal and spatial features, the feature fusion strategy is as follows: convert the temporal and spatial features into token sequences respectively, concatenate them into a long sequence representation, and add CLStoken and position encoding to obtain a fused feature sequence, so that the Transformer model can take into account both the relative order and spatial layout information of the sequence.
[0036] Example 2 This embodiment further illustrates the battery remaining life prediction method based on a dual-branch encoder proposed in this invention using a specific case.
[0037] Specifically, it includes the following steps: Step 1: Collect battery charging data, obtain multiple operating parameters of the battery, and after preprocessing, establish a multimodal dataset containing one-dimensional charging curves and two-dimensional GAF images to form an offline training database for the battery.
[0038] Specifically: First, by monitoring the charging and discharging processes of different types of lithium-ion batteries, information such as voltage, current, temperature, and remaining capacity of different lithium-ion batteries under different operating conditions is recorded. At the same time, a 2DGAF (Gramian Angular Field) image representation corresponding to the charging curve is generated, thereby establishing an offline training database for batteries.
[0039] This embodiment uses publicly available battery datasets and battery data collected in the laboratory, including charge-discharge cycle data under different temperature conditions of 25℃, 35℃, and 45℃. For each charging cycle, the voltage, current, temperature, time, and capacity sequences of the constant current charging phase are extracted to construct a 1D charging curve data with dimensions (B, 5, 4, 300), where B represents the sample batch size, 5 represents the number of feature channels (voltage, current, temperature, time, capacity), 4 represents the number of historical charging cycles, and 300 represents the sequence length. Simultaneously, the single-cycle charging curve is converted into a GAF image. Specifically, the charging sequence of each feature channel is normalized and scaled to [-1, 1]. The scaled sequence... Mapped to polar coordinates angle Map the time index to the radius ,based on or A two-dimensional angle correlation matrix is generated and adjusted to a size of 224×224 to obtain the GAF image corresponding to each feature channel, and finally a 2D GAF image data with dimensions (B,5,224,224) is generated.
[0040] Then, the obtained raw data is preprocessed.
[0041] Specifically, the charging curve data is first smoothed using a Savitzky-Golay filter with a window length of 11 and a polynomial order of 3 to remove high-frequency noise. Then, the denoised data is Z-score normalized to ensure that the mean of each input feature is 0 and the variance is 1, thereby accelerating model convergence. For GAF image data, since it originates from the smoothed charging curve, this embodiment does not perform independent strong denoising but normalizes the pixel values to the range [0,1]. If necessary, a lightweight smoothing filter can be used before normalization to eliminate isolated noise introduced by scaling interpolation. The preprocessed data is randomly divided according to a training set: validation set: test set ratio of 7:1:2.
[0042] Step 2: Design a dual-branch encoder architecture to process 1D charging curve and 2D GAF image data respectively. The overall network structure is as follows: Figure 2 As shown.
[0043] Specifically: The 1D branch (CurveEncoder) first transforms the input data of dimension (B, 5, 4, 300) into (B, 4, 1500) through einops rearrangement, where B represents the batch size of the input samples for one training or inference session. Then, through the Stem layer (containing 7×1 convolutions and max pooling) and 4 stages of multi-scale residual blocks (MultiScaleResBlock1D), multi-scale temporal features are extracted progressively.
[0044] In the CurveEncoder, the Stem layer is located at the front of the network with an input dimension of (B, 4, 1500). Initial feature extraction is performed first through a 7×1 convolution (ConvBNAct1D, stride=1, padding=3), expanding the number of channels from 4 to 16. Then, it goes through batch normalization (BatchNorm1d) and the SiLU activation function, and then through a max pooling layer (MaxPool1d) with a kernel size of 2 and a stride of 2 for downsampling. The output dimension is (B, 16, 750), providing preliminary feature representation for subsequent multi-scale residual blocks.
[0045] The MultiScaleResBlock1D structure in CurveEncoder contains three parallel convolutional branches: Branch 1 uses a 3×1 convolution (dilation=1), Branch 2 uses a 3×1 convolution (dilation=2) to expand the receptive field, and Branch 3 uses a 5×1 convolution (dilation=1) to capture wide-range patterns. The outputs of the three branches are concatenated along the channel dimension, then fused using a 1×1 convolution, and finally weighted by the SE (Squeeze-and-Excitation) attention module. When the number of input and output channels or the sequence length are the same, the weighted output is directly added to the input residual. When the number of channels or the sequence length are different, the input is dimension-matched using a 1×1 convolution shortcut branch before the residuals are added, and the output is then activated by the SiLU activation function.
[0046] Specifically, the four stages are connected in series, with the output of the previous stage serving as the input of the next stage. Each stage contains two MultiScaleResBlock1D blocks, with the output of the previous block serving as the input of the next block. Stage 1 maintains the output dimension as (B, 16, 750), Stage 2 adjusts the output to (B, 32, 375), Stage 3 adjusts the output to (B, 64, 188), and Stage 4 maintains the output as (B, 64, 188). This final output serves as the temporal feature extracted by the CurveEncoder.
[0047] 2D branch (GAFEncoder): The input dimension is (B,5,224,224). After passing through the second Stem module (containing 7×7 convolution and max pooling) and 4 stages of MBConv blocks (inverted residual structure), spatial features are extracted step by step. Finally, the output dimension is fixed to (B,64,14,14) through an adaptive average pooling layer.
[0048] The Stem layer of GAFEncoder is located at the front of the network and consists of a 7×7 convolutional layer and a max pooling layer. The input dimension is (B, 5, 224, 224). Initial feature extraction is performed first through a 7×7 convolutional layer (ConvBNAct2D, stride=2, padding=3), expanding the number of channels from 5 to 16. Then, batch normalization and SiLU activation function are applied. Next, downsampling is performed through a max pooling layer with a kernel size of 3, a stride of 2, and padding of 1. The output dimension is (B, 16, 56, 56), providing preliminary spatial feature representation for the subsequent MBConv stage.
[0049] The MBConv structure in GAFEncoder employs an inverted residual design, comprising an expanded convolutional module, a depthwise separable convolutional module, an SE attention module, and a projective convolutional module. The specific process is as follows: First, a 1×1 pointwise expanded convolutional module expands the channels to a factor of the input's expand_ratio (expansion ratio of 4), followed by batch normalization and SiLU activation. Then, a 3×3 depthwise separable convolutional module extracts spatial features, with a stride of 1 or 2 depending on requirements, maintaining the number of channels, followed by batch normalization and SiLU activation. Next, the SE attention module adaptively weights the channels. It first generates channel statistics through global average pooling, then generates weights through two 1×1 convolutional layers (compression ratio of 0.25), which are multiplied by the input after Sigmoid activation. Finally, a 1×1 pointwise projective convolutional module projects the channels back to the original dimension (or the target output dimension), followed by batch normalization.
[0050] In GAFEncoder, MBConv blocks are concatenated from Stage 1 to Stage 4, with the output of the previous Stage serving as the input to the next Stage. Each Stage contains two MBConv blocks, with the output of the previous MBConv block serving as the input to the next MBConv block. When the input and output dimensions of an MBConv block are the same and the stride is 1, residual connections are enabled, adding the input and projected output and then outputting the result after passing through the SiLU activation function. During downsampling (stride=2 or input / output channels mismatch), the input dimensions are matched using a 1×1 convolutional shortcut connection. The adaptive average pooling layer is set to AdaptiveAvgPool2d((14,14)) to fix the spatial size of the GAFEncoder output to 14×14, ultimately yielding the spatial feature (B,64,14,14).
[0051] Step 3: Fuse the temporal and spatial features to form a unified feature vector, and input it into the Transformer model.
[0052] Specifically, the temporal features (B, 64, 188) output by the CurveEncoder are rearranged into a sequence (B, 188, 64) using einops, and the spatial features (B, 64, 14, 14) output by the GAFEncoder are flattened into a sequence (B, 196, 64). The two sequences are concatenated to form a fused feature sequence (B, 384, 64). A learnable CLS token (with dimensions (B, 1, 64)) is added, resulting in an input sequence of (B, 385, 64), which is then overlaid with a length-adaptive sinusoidal positional code (maximum length supported is 512) to facilitate the Transformer model's consideration of the relative order of the sequences during learning.
[0053] Step 4: In the Transformer model, the standard multi-head self-attention mechanism is used for computation to model cross-modal interaction information.
[0054] Specifically, each Transformer Block contains layer normalization, a multi-head self-attention sub-layer, and a feedforward neural network sub-layer. The attention calculation process is as follows: First, layer normalization normalizes the input using LayerNorm; second, the multi-head self-attention sub-layer transforms the input into Q, K, and V matrices (all with dimensions (B, 385, 64)) through linear projection, splits them into 8 attention heads (each with a dimension of 8), and then... Calculate the scaled dot product attention; then, concatenate the outputs of each attention head, perform linear projection, and add the residuals to the input of the block. In this embodiment, through the standard self-attention mechanism, the model can adaptively establish the correlation between 1D temporal features and 2D spatial features, making full use of the complementarity of multimodal data.
[0055] Step 5: Further extract global information through multi-layer Transformer modules, and finally perform regression prediction on the RUL of the battery.
[0056] Specifically, an 8-layer stacked Transformer Block is used, with each layer maintaining a channel dimension of 64 and a sequence length of 385. Each Transformer Block includes a first normalization layer, a multi-head self-attention sublayer, a second normalization layer, and a feedforward neural network sublayer. The output of the t-th Transformer Block serves as the input of the (t+1)-th Transformer Block, thus data transfer and layer-by-layer feature interaction occur through concatenation between the blocks. The feedforward neural network consists of two linear layers (64→192→64), SiLU activation, and Dropout (p=0.1). The first linear layer expands the channel dimension of each token from 64 to 192 to improve non-linear expressiveness, while the second linear layer compresses the dimension back to 64 to match the residual branch. After encoding by the 8th Transformer Block, only the feature vector (B, 64) corresponding to the CLS token in the final output sequence is extracted and input into the prediction head. The prediction head consists of two linear layers (64→128→1), GELU activation, and Dropout. The first linear layer performs a high-dimensional non-linear mapping on the global features of CLS, and the second linear layer regresses the mapping result into a single RUL prediction value.
[0057] Step 6: During the training process, the model is validated and optimized, and finally the model that performs best on the validation set is selected.
[0058] Specifically, the mean squared error (MSE) is used as the loss function, the AdamW optimizer is employed, the initial learning rate is set to 1e-3, the weight decay is set to 1e-4, and a cosine annealing learning rate scheduling strategy is used. K-fold cross-validation (K=5) is implemented. When the validation set loss no longer decreases for 10 consecutive epochs, the current best model parameters are saved and training is stopped. Finally, the saved best model is used to evaluate the RUL prediction on the test set to ensure the model's generalization ability on different datasets. Figure 3 The figure shows the prediction results of RUL, and it can be seen from the figure that the predicted value of the present invention highly overlaps with the actual value.
[0059] Step 7: Use the best-performing dual-branch encoder and Transformer model from Step 6 to process the multimodal data of the battery under test and obtain the RUL prediction results of the battery under test.
[0060] The parameters of each module in this embodiment are shown in Table 1 below.
[0061] Table 1 Input / output and key parameter configurations for each module
[0062] Example 3 The above-described embodiment 1 provides a method for predicting the remaining battery life based on a dual-branch encoder. Correspondingly, this embodiment provides a system for predicting the remaining battery life based on a dual-branch encoder. The system provided in this embodiment can implement the method for predicting the remaining battery life based on a dual-branch encoder in embodiment 1. This system can be implemented through software, hardware, or a combination of both. For example, the system may include integrated or separate functional modules or units to perform the corresponding steps in the methods of embodiment 1. Since the system in this embodiment is basically similar to the method embodiment, the description process in this embodiment is relatively simple. For relevant details, please refer to the description of embodiment 1. The system embodiment provided in this embodiment is merely illustrative.
[0063] The battery remaining life prediction system based on a dual-branch encoder provided in this embodiment includes: The dataset building module is used to collect and preprocess battery charging data to build a multimodal dataset containing one-dimensional (1D) charging curves and two-dimensional (2D) GAF images; The training optimization module is used to train pre-built dual-branch encoder and Transformer models based on multimodal datasets to obtain the dual-branch encoder and Transformer models with optimal performance. The real-time data acquisition module is used to collect and preprocess the charging data of the battery under test to obtain the current input data; The feature extraction module is used to input the current input data into the dual-branch encoder and extract temporal and spatial features; The feature fusion and prediction module is used to fuse the extracted temporal and spatial features and input them into the Transformer model to perform regression prediction on the RUL of the tested battery and obtain the RUL prediction result.
[0064] Furthermore, the dataset construction module includes a training data acquisition module and a preprocessing module. The training data acquisition module is used to acquire voltage, current, temperature, time, and capacity data during the charging and discharging processes of different types of lithium-ion batteries, forming a set of battery operating parameters. The preprocessing module is used to generate 1D charging curves and corresponding 2D GAF images based on the battery operating parameter set, and performs smoothing, denoising, and standardization processing on the 1D charging curves, and pixel normalization processing on the 2D GAF images to obtain a multimodal dataset.
[0065] Example 4 This embodiment provides a processing device corresponding to the battery remaining life prediction method based on a dual-branch encoder provided in Embodiment 1. The processing device can be a processing device for a client, such as a mobile phone, laptop, tablet computer, desktop computer, etc., to execute the method of Embodiment 1.
[0066] The processing device includes a processor, a memory, a communication interface, and a bus. The processor, memory, and communication interface are connected via the bus to communicate with each other. The memory stores a computer program that can run on the processor. When the processor runs the computer program, it executes the battery remaining life prediction method based on a dual-branch encoder provided in Embodiment 1.
[0067] Preferably, the memory may be high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device.
[0068] Preferably, the processor can be any type of general-purpose processor such as a central processing unit (CPU) or a digital signal processor (DSP), and there is no limitation herein.
[0069] Example 5 The battery remaining life prediction method based on a dual-branch encoder in Embodiment 1 can be specifically implemented as a computer program product. The computer program product may include a computer-readable storage medium on which computer-readable program instructions for executing the battery remaining life prediction method based on a dual-branch encoder described in Embodiment 1 are loaded.
[0070] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof.
[0071] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for predicting the remaining battery life based on a dual-branch encoder, characterized in that, Includes the following steps: The charging data of the battery under test is collected and preprocessed to obtain the current input data; The current input data is fed into a pre-trained dual-branch encoder to extract temporal and spatial features. The extracted temporal and spatial features are fused and then input into a pre-trained Transformer model to perform regression prediction on the RUL of the tested battery, thus obtaining the RUL prediction result.
2. The method for predicting remaining battery life based on a dual-branch encoder as described in claim 1, characterized in that, Before collecting and preprocessing the charging data of the battery under test to obtain the current input data, the process also includes: Collect and preprocess battery charging data to create a multimodal dataset containing one-dimensional charging curves and two-dimensional GAF images; The pre-built bi-branch encoder and Transformer models were trained and optimized based on a multimodal dataset to obtain the best-performing bi-branch encoder and Transformer models.
3. The method for predicting remaining battery life based on a dual-branch encoder as described in claim 2, characterized in that, The process of collecting and preprocessing battery charging data to establish a multimodal dataset containing one-dimensional charging curves and two-dimensional GAF images includes: The charging and discharging process of different types of lithium-ion batteries is monitored to obtain multiple operating parameters of different types of lithium-ion batteries under different operating conditions, including at least voltage, current, temperature and remaining capacity. One-dimensional charging curves are generated based on multiple operating parameters of different types of lithium-ion batteries under different operating conditions. Based on the one-dimensional charging curve, a corresponding two-dimensional GAF image is generated; One-dimensional charging curves and two-dimensional GAF images are used together as the original multimodal dataset; The original multimodal dataset is preprocessed and organized into a preset data format to serve as the multimodal dataset.
4. The method for predicting remaining battery life based on a dual-branch encoder as described in claim 2, characterized in that, The dual-branch encoder includes a curve encoder and a GAF encoder; The curve encoder takes a one-dimensional charging curve as input, uses a one-dimensional convolutional neural network to extract multi-scale features from the one-dimensional charging curve, and outputs time-series features. The GAF encoder takes two-dimensional GAF image data as input, processes the two-dimensional GAF image data using a 2D convolutional neural network, and outputs spatial features.
5. The method for predicting remaining battery life based on a dual-branch encoder as described in claim 4, characterized in that, The curve encoder includes a dimension transformation module, a first Stem module, a multi-scale residual block, and an output module; The dimension transformation module is used to perform dimension transformation on the input one-dimensional charging curve using Einops rearrangement to obtain input data of a preset dimension; The first Stem module is used to extract temporal local patterns from the input data using multiple convolutional layers; The multi-scale residual block is used for multi-scale temporal feature enhancement based on temporal local patterns; The output module is used to output the extracted temporal features.
6. The method for predicting remaining battery life based on a dual-branch encoder as described in claim 4, characterized in that, The GAF encoder includes a second Stem module, multiple cascaded inverted residual modules, and an adaptive average pooling module; The second Stem module is used to extract the spatial patterns of the input two-dimensional GAF image data using a deep convolutional network; Each of the inverted residual modules is used for multi-level spatial feature enhancement based on spatial patterns; The adaptive average pooling module is used to adjust the size of multi-level spatial features to a preset size to ensure that the output feature dimension matches the subsequent feature fusion module.
7. The method for predicting remaining battery life based on a dual-branch encoder as described in claim 1, characterized in that, The Transformer model is composed of multiple stacked Transformer modules, each of which includes a layer normalization, a multi-head self-attention sub-layer, and a feedforward neural network sub-layer. The layer normalization is used to normalize the input data; The multi-head self-attention sublayer is used to perform Q, K, V linear mapping on normalized data, calculate the scaling dot product attention weights between different time segments and image regions, and aggregate cross-modal context features based on these attention weights. The feedforward neural network sublayer is used to perform nonlinear transformation and channel dimension mapping on the context features output by the multi-head self-attention sublayer, and output them sequentially to the next Transformer module; The final layer of the Transformer module outputs the CLS token features from the sequence to the prediction head, which then outputs the final RUL prediction value.
8. A battery remaining life prediction system based on a dual-branch encoder, characterized in that, include: The real-time data acquisition module is used to collect and preprocess the charging data of the battery under test to obtain the current input data; The feature extraction module is used to input the current input data into a pre-trained dual-branch encoder and extract temporal and spatial features. The feature fusion and prediction module is used to fuse the extracted temporal and spatial features and input them into a pre-trained Transformer model to perform regression prediction on the RUL of the tested battery and obtain the RUL prediction result.
9. A computer-readable storage medium for storing one or more programs, characterized in that, The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform any of the methods described in claims 1 to 7.
10. A computing device, characterized in that, include: One or more processors and a memory, wherein the memory stores one or more programs and is configured to be executed by the one or more processors, the one or more programs including instructions for performing any of the methods described in claims 1 to 7.