
AI System for Intelligent Lifespan Prediction of Lithium-ion Batteries Driven by RK3588: Application of CNN + LSTM Fusion Algorithm
The prediction of the "remaining useful life" (RUL) of lithium-ion batteries is a crucial part of battery health management. The publicly available battery aging data from NASA provides key support for research and development. Traditional methods rely on manual analysis, which is low in both efficiency and accuracy. Existing embedded platforms have limited computing power, making it difficult to achieve real-time prediction. As a result, users' demands for accurate and lightweight solutions are hard to meet.
Forlinx Embedded combines the AI algorithm (CNN + LSTM fusion) with the RK3588 SoM, successfully breaking through these limitations and bringing efficient and accurate lithium-ion battery lifespan prediction.
1. Hardware platform: FET3588-C SoM
The FET3588-C SoM from Forlinx Embedded is a high-performance embedded platform designed and developed based on the Rockchip RK3588 flagship processor. It is equipped with a powerful NPU (Neural Processing Unit) with a computing power of 6 TOPS, which is specifically optimized for AI inference. It features low power consumption and strong computing capabilities, and can be applied to industrial and consumer electronic devices.
- AI algorithm module: It combines CNN to extract features and LSTM to capture trends, and predicts the battery capacity after fusion.
- Deployment module: The model is optimized into the.rknn format through the RKNN tool to ensure efficient operation on the RK3588 SoM.
- Data processing module: It supports extracting samples from the NASA dataset and generating prediction results.
2.How the algorithm predicts battery life?
01. Algorithm implementation
Feature extraction by CNN: The Convolutional Neural Network (CNN) processes five time-steps of battery voltage, current, temperature, etc., to extract local patterns during the charging process (such as inflection points in the voltage curve). Through multiple convolution kernels and the ReLU activation function, it generates feature vectors to capture subtle changes in battery operating conditions.
Trend capture by LSTM: The Long Short-Term Memory network (LSTM) analyzes the capacity sequence. Using the mechanisms of input gate, forget gate, and output gate, it can effectively remember and model the long-term decay trend of battery capacity (for example, the aging process from 2.0 Ah to 1.4 Ah). The following formula is used to dynamically update the hidden state to ensure the modeling of long-term dependencies.
Fusion and regression: The local features extracted by CNN and the long-term trends captured by LSTM are concatenated and fused, then input into the fully-connected layer for regression prediction. The output is a normalized battery capacity value. During the training process, the Mean Squared Error (MSE) loss function and the Adam optimizer are used, and a Dropout layer is added to prevent overfitting. Finally, the predicted result is inverse-normalized to the actual Ah capacity value using the MinMaxScaler.
RUL calculation: Based on the predicted capacity value, when the capacity decays to a preset threshold (usually 80% of the initial capacity, for example, 1.6 Ah), the Remaining Useful Life (RUL) can be calculated. The solution also introduces an exponential decay model for fitting optimization, and further refines the RUL prediction results through the parameter λ. The exponential decay model is as follows: The solution also introduces an exponential decay model for fitting optimization, and further refines the RUL prediction results through the parameter λ. The exponential decay model is as follows:
02 Deployment on the RK3588 SoM
Model conversion: Export the Keras model to ONNX, and then use the RKNN toolkit to convert it into the .rknn format, which supports the NPU of RK3588. FP16 quantization: FP16 quantization reduces the computational workload, and the inference time for a single sample is only 0.55 milliseconds.
Inference optimization: The RKNNLite API performs inference sample by sample, and the input is transposed into the NCHW format (e.g., [1, 1, 5]). It can be optimized for batch inference to reduce the loop overhead. INT8 quantization can further improve the efficiency, but the accuracy needs to be verified.
3. Effect demonstration
The figure above clearly shows the actual prediction effect of the solution:
- Blue line: The real battery capacity decay curve.
- Orange line: The battery capacity curve predicted by the AI model.
- X-axis: Sample index (representing time/number of cycles).
- Y-axis: Battery capacity (Ah).
It can be intuitively seen from the figure that the predicted curve (orange) basically coincides with the real curve (blue), which fully demonstrates the accuracy of the AI prediction model.
4.Summary
Forlinx Embedded deeply integrates the CNN + LSTM fused AI algorithm with the high-performance RK3588 SoM, precisely solving the problems of accuracy and efficiency in predicting the remaining useful life (RUL) of lithium batteries. On the FET3588-C SoM, the algorithm achieves a single-sample inference time of only 0.55 ms with FP16 quantization, balancing high accuracy (MAPE of 3.3%) and low power consumption. INT8 quantization can further optimize the efficiency.