Edge Impulse Based ML-Tensor Flow Method for Precise Prediction of Remaining Useful Life (RUL) of EV Batteries

Abstract

Electric Vehicle (EV) adoption is rapidly increasing, necessitating efficient and precise methods for predicting EV charging requirements. The early and precise prediction of the battery discharging status is helpful to avoid the complete discharging of the battery. The complete discharge of the battery degrades its lifetime and requires a longer charging duration. In the present work, a novel approach leverages the Edge Impulse platform for live prediction of the battery status and early alert signal to avoid complete discharging. The proposed method predicts the actual remaining useful life of batteries. A powerful edge computing platform utilizes Tensor Flow-based machine learning models to predict EV charging needs accurately. The proposed method improves the overall lifetime of the battery by the efficient utilization and precise prediction of the battery status. The EON-Tuner and DSP processing blocks are used for efficient results. The performance of the proposed method is analyzed in terms of accuracy, mean square error and other performance parameters.

Share and Cite:

Hawsawi, T. and Zohdy, M. (2024) Edge Impulse Based ML-Tensor Flow Method for Precise Prediction of Remaining Useful Life (RUL) of EV Batteries. Journal of Power and Energy Engineering, 12, 1-15. doi: 10.4236/jpee.2024.126001.

1. Introduction

The prediction of the remaining useful life (RUL) of electric vehicle (EV) batteries is a critical aspect of battery management systems to ensure the safety, reliability, and optimal performance of the batteries throughout their life cycle [1] [2]. Accurate RUL prediction is essential for evaluating battery reliability, reducing the risk of battery usage, and providing a rationale for battery maintenance [2]. It can also reduce the risk of battery failure by predicting the end of life, thus improving the reliability and safety of battery-powered systems [3] [4]. Furthermore, precise RUL prediction is crucial for managing the health, estimating the state of a battery, and ensuring the optimal operation of battery systems [5] [6]. Several studies have focused on developing predictive models for RUL estimation of lithium-ion batteries, employing various techniques such as deep learning algorithms, neural networks, and statistical methods [7]-[11]. These models leverage multi-channel charging profiles, temporal pattern attention, and multi-scale prediction to accurately estimate the RUL of batteries [7] [8] [10] [12]. Additionally, the use of LSTM networks, transformer networks, and extreme learning machines has been explored for RUL prediction, indicating the diverse range of methodologies employed in this area [7] [8] [13].

Moreover, the importance of considering various factors, such as relaxation effects, degradation factors, and multi-source data in RUL prediction has been highlighted in the literature [4] [14] [15]. These factors are crucial in accurately estimating lithium-ion batteries’ RUL and state of health (SOH), which are essential for effective battery management and performance optimization [4] [15]. Predicting the remaining useful life of EV batteries is a multifaceted and critical research area encompassing various methodologies and considerations. Accurate RUL prediction is fundamental for ensuring lithium-ion batteries’ safety, reliability, and optimal performance in electric vehicles.

With the increasing demand for sustainable energy solutions, accurate prediction of RUL is essential for optimizing battery usage and minimizing environmental impact [16]. Various methods have been proposed for RUL prediction, including deep learning networks, particle filter algorithms, and hybrid optimization methods. However, these methods often face challenges such as prediction accuracy, stability, and generalization on diverse datasets [17]-[19].

Therefore, there is a need for a method that can address these challenges and provide precise RUL prediction for EV batteries. The proposed Edge Impulse Based ML-Tensor Flow method offers several advantages over existing methods. It leverages Tiny Machine Learning (Tiny-ML) hardware, enabling on-device processing and real-time prediction, which is crucial for EV applications [20]. Additionally, the method integrates the Adam method, L2 regularization method, and incremental learning, enhancing the prediction accuracy and stability of the model [21]. Furthermore, the method utilizes a fusion model of Convolutional Neural Network (CNN), Gated Recurrent Unit (GRU), and Deep Neural Network (DNN), demonstrating superior RUL prediction accuracy compared to other hybrid methods and machine learning algorithms [22]. Moreover, the proposed method addresses the challenge of diverse datasets by utilizing a machine learning-assisted pipeline for multi-objective optimization, ensuring robustness and reliability in RUL prediction [23]. The Edge Impulse-based ML-Tensor Flow method presents a promising approach for precisely predicting RUL for EV batteries. By leveraging Tiny-ML hardware, integrating advanced machine learning techniques, and addressing the challenges of diverse datasets, this method offers a comprehensive solution for optimizing the performance and longevity of EV batteries, thereby contributing to the advancement of sustainable energy technologies. The contribution of the proposed work is explained below:

  • This work introduces the utilization of Edge Impulse in the context of EV battery RUL prediction. The proposed method enables efficient deployment of machine learning models directly onto EVs, facilitating real-time monitoring and adaptive maintenance strategies.

  • TensorFlow, a robust machine learning framework known for its scalability and efficiency, is incorporated, enhancing the predictive capabilities of the proposed method. The proposed approach can reveal intricate patterns in EV battery data, leading to more precise RUL predictions.

  • The integration of edge computing of this method enables the deployment of machine learning models directly on EVs, eliminating the need for centralized processing and enabling real-time performance.

  • By performing inference tasks at the edge, the proposed method ensures timely decision-making and proactive maintenance actions, enhancing the reliability and efficiency of EV battery management systems.

  • The proposed method offers improved accuracy and scalability compared to existing EV battery RUL prediction methods. By effectively handling high-dimensional data and leveraging advanced machine learning techniques, the proposed method can provide precise RUL estimates, enabling optimized battery performance and prolonging battery lifespan in electric vehicles.

2. Related Works

The remaining useful life of electric vehicle batteries is a critical factor in determining their performance and lifespan. By utilizing the Edge Impulse Based ML-Tensor Flow method, we can accurately predict the RUL of EV batteries. This method considers factors such as battery degradation, inconsistency, and intermittent discharge patterns to provide precise estimations [3]. Using this method, users can efficiently and cost-effectively monitor and evaluate the usage of many batteries at various installation points. The related works are discussed in this section.

Cai et al. [24] contributed to the EV power battery RUL prediction field by proposing an adaptive method based on the whale swarm algorithm–long short-term memory (WSA-LSTM) algorithm. The work focuses on improving the prediction accuracy of RUL under DC fast charging conditions by integrating dynamic data acquisition, health indicator analysis, and algorithm optimization. The method involves constructing a complete set of power battery health indicators to predict RUL from multiple dimensions, enhancing the algorithm’s generalization performance by using. The study acknowledges that the battery data obtained from the DC charging condition is not representative of the entire life cycle data of power batteries, limiting the ability to predict the state of health based solely on the usage habits of EV users.

In [25], the authors have proposed an integrated method combining Variational Mode Decomposition (VMD), Long Short-Term Memory (LSTM), and Gaussian Process Regression (GPR) algorithms to enhance the accuracy of RUL prediction for lithium-ion batteries. This novel approach addresses the challenges of capacity recovery phenomena and random noise fluctuations in battery degradation sequences. By decomposing the battery capacity degradation sequence into residual and capacity recovery components, the algorithm can capture the global degradation trend and fluctuations in capacity, leading to more accurate RUL predictions. The experimental results demonstrate the effectiveness of the proposed algorithm in predicting the RUL of lithium-ion batteries. The Absolute Error (AE) values for each battery group do not exceed 1, with the AE for the B0005 battery reaching 0 at both prediction starting points, indicating high prediction accuracy even with limited training samples. While the proposed algorithm shows promising results in RUL prediction for lithium-ion batteries, there are some limitations to consider. One potential limitation is the generalizability of the algorithm across different battery types and operating conditions. The study’s focus on lithium-ion batteries may restrict the algorithm’s applicability to other battery chemistries or systems. Additionally, the quality and quantity of training data available may influence the algorithm’s performance, as indicated by the need for sufficient training samples to achieve accurate predictions.

3. Mathematical Model of the Proposed Method

The proposed work introduces a novel approach for the live prediction of the Remaining Useful Life (RUL) of Electric Vehicle (EV) batteries. This method deploys a TensorFlow model for RUL prediction using the Tiny-ML framework on a Cortex-M4 target board provided by Edge Impulse. This deployment enables real-time prediction of RUL directly on the edge device, enhancing the efficiency and effectiveness of battery management systems in EVs.

The TensorFlow model developed for RUL prediction leverages the capabilities of deep learning algorithms to capture complex patterns in battery behavior and accurately estimate RUL. The model can be efficiently deployed on edge devices with limited computational resources by utilizing the Tiny-ML framework, which is optimized for low-power microcontroller units (MCUs) like the Cortex-M4. This deployment ensures that RUL prediction can be performed continuously and autonomously within the EV, enabling proactive maintenance and optimization of battery usage. The derivation of Tensorflow-based neural network equations is derived in this section.

Let us consider a neural network with layers. The forward pass equations for the l-th layer (excluding the input layer) are given by:

z [ l ] = W [ l ] a [ l1 ] + b [ l ] a [ l ] =ReLU( z [ l ] ) (1)

where W [ l ] is the weight matrix, b [ l ] is the bias vector, a [ l1 ] is the activation from the previous layer, and ReLU is the Rectified Linear Unit activation function.

The backward pass equations for gradient descent involve computing gradients of the loss function with respect to the parameters. Let L be the loss function. For the output layer:

z LL = y ^ y (2)

W [ L ] = z LL a [ L1 ] T (3)

b LL = z LL] (4)

For Hidden Layers

z l! = a l] a [ l ] z l! (5)

W [ l ] = z l! a [ l1 ] T (6)

b l] = z [l (7)

where a l] is the gradient of the loss with respect to the activations, and a [ l ] z ll is the derivative of the activation function. The Neural Network Architecture is shown in Figure 1.

The performance of the proposed model is compared with the Support Vector Machine (SVM). The objective function for SVM is given by:

min w,b 1 2 w 2 (8)

y ( i ) ( w T x ( i ) +b )1fori=1,2,,m (9)

These formulations aim to find the maximum margin hyperplane that separates the classes, where w is the weight vector, b is the bias term, x ( i ) are the input vectors, and y ( i ) are the corresponding class labels.

The performance of the proposed model is also compared with decision tree regression method. The splitting criterion for decision tree regression is based on minimizing the variance of the target variable within each split. Let J( s,t ) be the splitting criterion for feature s at threshold:

J( s,t )= m left m Var( y left )+ m right m Var( y right ) (10)

where m left and m right are the number of samples in the left and right splits, y left and y right are the target variable values in the left and right splits, and Var is the variance.

Figure 1. Architecture of the Proposed Model (Edge Impulse).

These extended derivations provide a deeper understanding of the mathematical principles underlying each model, including TensorFlow-based neural networks, SVM, and Decision Tree regression, for precise prediction of EV battery RUL.

For the analysis of the proposed work, the Hawaii Natural Energy Institute database is used, which offers a comprehensive insight into the behavior of 14 NMC-LCO 18650 batteries subjected to extensive cycling at 25˚C. The features are precisely extracted from voltage and current profiles over 1000 cycles. This dataset presents a rich source of information for studying battery performance and predicting remaining useful life (RUL). Key variables such as discharge time, voltage thresholds, time constants, and charging characteristics have been meticulously recorded, providing a holistic view of battery behavior. The dataset is openly accessible on GitHub [26].

In the proposed work, the dataset is used to develop predictive models to estimate the remaining useful life of batteries, a crucial factor in optimizing their usage and maintenance. The dataset’s extensive cycling regime and detailed feature engineering lay a robust foundation for machine learning algorithms to uncover patterns and relationships within the data. The tensor flow-based edge impulse model is used to predict RUL accurately. These models can inform decision-making processes regarding battery replacement, thus enhancing the reliability and efficiency of energy storage systems. The critical parameters of the dataset and model details are shown in Figure 2.

Figure 2. Parameter details and features of proposed model.

4. Result Analysis & Discussion

The 4 hours and 27 minutes dataset is collected for the training and testing. For the analysis, average value, mean value, maximum value, minimum value, RMS, and standard deviation are analyzed for each feature parameter. A total of 1128 classes are formed by the feature extraction method of Edge Impulse. The training window size is 12,048. The feature parameters are given in Figure 3.

Figure 3. Method and details of training parameters.

For the performance analysis, the real-time processing delay and RAM usage are also analyzed for the proposed work, as shown in Figure 4.

The training settings configurations are essential for effectively training a machine learning model, as shown in Figure 5. With a designated number of training cycles set at 100, the model undergoes multiple iterations through the dataset to learn the underlying patterns and relationships. Utilizing a learned optimizer ensures that the model adjusts its parameters efficiently based on the observed data, optimizing its performance over time. A crucial hyperparameter, the learning rate (0.005), dictates the magnitude of parameter updates during training, influencing the convergence and stability of the model.

Figure 4. Peak time and peak RAM usage.

Figure 5. Training parameters settings.

Several key configurations in advanced training settings further tailor the training process. The validation set size determines the proportion of data reserved for evaluating the model’s performance during training, which is crucial for preventing overfitting (in the proposed model, it is 20%). The option to split the train/validation set based on metadata enhances the flexibility of dataset management. Additionally, parameters like batch size and auto-weighting of classes play pivotal roles in optimizing training efficiency, particularly in handling imbalanced datasets (32 in the proposed model).

The results are analyzed for the various parameters, as shown in Figure 6. The voltage discharge, decrement, and discharge time are analyzed and represented in Figure 6. The results indicated that the predicted values are aligned on a vertical axis.

Figure 6. Training pattern of various parameters.

Figure 7. True value and predicted value of data samples.

In Figure 7, the true value and predicted values are analysed for 20% of the data samples. The peak RAM usage and flash usage are also analysed for the process analysis. The incorrect values are represented by read colour and correct prediction is represented by green colour. For the accuracy analysis and the performance analysis of the proposed method, the mean square error is calculated for the real time dataset. The results show that the proposed tensor flow model predicts the RUL with 93% accuracy as shown in Figure 8. Different features are optimized for the precise prediction of proposed method.

Figure 9 displays a sample of the test data results. The real-time model and

Figure 8. Accuracy analysis and mean square error.

Figure 9. The sample results of test data.

code are designed for the Cortex M4 Microcontroller board and the real-time data, respectively.

The RAM and memory usage parameters are shown in Figure 10 for both quantized and unoptimized values. The EON tuner is also enabled for precise analysis and prediction.

The performance is also compared with the non-real-time models. The decision tree method is used to analyze the actual value and predicted values.

The decision results are analyzed in terms of mean square error and accuracy. The accuracy of the decision tree is 98%, but for the real model, as shown in Figure 11 and compared in Table 1. In addition, the method is also checked for the real-time dataset and the real-time decision tree, which have higher mean square error and poor accuracy.

Figure 10. EON compiler based accuracy analysis.

Figure 11. Decision tree predicted and true value.

Table 1. Comparisons of decision results.


Mean Square Error

Accuracy

Decision Tree

1457.26

98% (Non Real-time data)

68% for Real-time Data

Tensor Flow NN

1568

92% for Real-time data

Support Vector Machine

10842

89% (Non Real-time data)

56% for Real-time Data)

Figure 12. Support vector machine predicted and true value.

In Figure 12, the performance is also compared with the support vector regression method for non-real-time datasets. The results show that the MSE is very high, and the accuracy is 89% for the support vector as shown in Table 1.

5. Conclusions

This study thoroughly investigates the development and performance evaluation of a machine learning model designed explicitly for real-time prediction of Remaining Useful Life (RUL). Leveraging TensorFlow NN, the model demonstrates commendable accuracy, achieving 93% in predicting RUL. Through meticulous feature optimization and parameter tuning, including a dataset comprising 1128 classes and comprehensive feature parameters, the model showcases its capability to effectively learn underlying patterns and relationships, which is essential for accurate predictions. Moreover, the analysis extends beyond mere accuracy metrics, delving into resource utilization aspects such as RAM and memory consumption, which are crucial for practical deployment on resource-constrained platforms. The incorporation of the EON compiler aids in assessing trade-offs between model performance and resource efficiency, offering valuable insights for informed decision-making during deployment and ultimately highlighting the model’s potential for real-world applications in predictive maintenance and similar domains.

Comparative analyses with alternative methods, including decision tree and support vector machine, shed light on the TensorFlow NN model’s robustness, particularly in real-time scenarios. While the decision tree method exhibits high accuracy (98%) for non-real-time data, its performance significantly deteriorates for real-time applications, underscoring the challenges associated with processing speed and resource constraints. In contrast, the TensorFlow NN model maintains stable performance, with a slightly lower accuracy of 92% for real-time data, indicating its reliability and suitability for practical deployment. Future research directions involve further refining the model architecture and exploring alternative algorithms to address these challenges, ultimately advancing the applicability of machine learning in real-time prediction tasks and facilitating predictive maintenance efforts in various industrial contexts.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Qin, H., Fan, X., Fan, Y., Wang, R. and Tian, F. (2022) Lithium-Ion Batteries RUL Prediction Based on Temporal Pattern Attention. Journal of Physics: Conference Series, 2320, Article 012005.[CrossRef]
[2] Li, X., Shu, X., Shen, J., Xiao, R., Yan, W. and Chen, Z. (2017) An On-Board Remaining Useful Life Estimation Algorithm for Lithium-Ion Batteries of Electric Vehicles. Energies, 10, Article 691.[CrossRef]
[3] Wu, Y., Li, W., Wang, Y. and Zhang, K. (2019) Remaining Useful Life Prediction of Lithium-Ion Batteries Using Neural Network and Bat-Based Particle Filter. IEEE Access, 7, 54843-54854.[CrossRef]
[4] Elmahallawy, M., Elfouly, T., Alouani, A. and Massoud, A.M. (2022) A Comprehensive Review of Lithium-Ion Batteries Modeling, and State of Health and Remaining Useful Lifetime Prediction. IEEE Access, 10, 119040-119070.[CrossRef]
[5] Chen, D., Hong, W. and Zhou, X. (2022) Transformer Network for Remaining Useful Life Prediction of Lithium-Ion Batteries. IEEE Access, 10, 19621-19628.[CrossRef]
[6] Jin, S., Sui, X., Huang, X., Wang, S., Teodorescu, R. and Stroe, D. (2021) Overview of Machine Learning Methods for Lithium-Ion Battery Remaining Useful Lifetime Prediction. Electronics, 10, Article 3126.[CrossRef]
[7] Park, K., Choi, Y., Choi, W.J., Ryu, H. and Kim, H. (2020) LSTM-Based Battery Remaining Useful Life Prediction with Multi-Channel Charging Profiles. IEEE Access, 8, 20786-20798.[CrossRef]
[8] Khumprom, P. and Yodo, N. (2019) A Data-Driven Predictive Prognostic Model for Lithium-Ion Batteries Based on a Deep Learning Algorithm. Energies, 12, Article 660.[CrossRef]
[9] Ansari, S., Ayob, A., Hossain Lipu, M.S., Hussain, A. and Saad, M.H.M. (2021) Multi-Channel Profile Based Artificial Neural Network Approach for Remaining Useful Life Prediction of Electric Vehicle Lithium-Ion Batteries. Energies, 14, Article 7521.[CrossRef]
[10] Mao, L., Xu, J., Chen, J., Zhao, J., Wu, Y. and Yao, F. (2020) A LSTM-STW and GS-LM Fusion Method for Lithium-Ion Battery RUL Prediction Based on EEMD. Energies, 13, Article 2380.[CrossRef]
[11] Qiao, J., Liu, X. and Chen, Z. (2020) Prediction of the Remaining Useful Life of Lithium-Ion Batteries Based on Empirical Mode Decomposition and Deep Neural Networks. IEEE Access, 8, 42760-42767.[CrossRef]
[12] Jia, S. (2021) Economic, Environmental, Social, and Health Benefits of Urban Traffic Emission Reduction Management Strategies: Case Study of Beijing, China. Sustainable Cities and Society, 67, Article 102737.[CrossRef]
[13] Meng, X., Wang, W., Cao, X., Li, G. and Li, D. (2023) A RUL Prediction Method of Lithium-Ion Battery Based on Extreme Learning Machine. Journal of Physics: Conference Series, 2492, Article 012026.[CrossRef]
[14] Xu, X., Yu, C., Tang, S., Sun, X., Si, X. and Wu, L. (2019) Remaining Useful Life Prediction of Lithium-Ion Batteries Based on Wiener Processes with Considering the Relaxation Effect. Energies, 12, Article 1685.[CrossRef]
[15] Lu, J., Li, X., Lei, H., Liu, Y. and Xiong, R. (2019) Remaining Useful Life Prediction Driven by Multi-Source Data for Batteries in Electric Vehicles. DEStech Transactions on Environment, Energy and Earth Sciences.[CrossRef]
[16] Zhao, J. and Burke, A.F. (2022) Electric Vehicle Batteries: Status and Perspectives of Data-Driven Diagnosis and Prognosis. Batteries, 8, Article 142.[CrossRef]
[17] Xie, G., Peng, X., Li, X., Hei, X. and Hu, S. (2019) Remaining Useful Life Prediction of Lithium‐Ion Battery Based on an Improved Particle Filter Algorithm. The Canadian Journal of Chemical Engineering, 98, 1365-1376.[CrossRef]
[18] Bosello, M., Falcomer, C., Rossi, C. and Pau, G. (2023) To Charge or to Sell? EV Pack Useful Life Estimation via LSTMs, CNNs, and Autoencoders. Energies, 16, Article 2837.[CrossRef]
[19] Hawsawi, T., Alolaiwy, M., Taleb, Y., Mezaael, A. and Zohdy, M. (2023) An Improved Thevenin Model-Based State-of-Charge Estimation of a Commercial Lithium-Ion Battery Using Kalman Filter. 2023 IEEE Smart World Congress (SWC), Portsmouth, 28-31 August 2023, 735-741.[CrossRef]
[20] Lahade, S.V., Namuduri, S., Upadhyay, H. and Bhansali, S. (2020) Alcohol Sensor Calibration on the Edge Using Tiny Machine Learning (Tiny-ML) Hardware. ECS Meeting Abstracts, 2020, Article 1848.[CrossRef]
[21] Wang, C., Lu, N., Wang, S., Cheng, Y. and Jiang, B. (2018) Dynamic Long Short-Term Memory Neural-Network—Based Indirect Remaining-Useful-Life Prognosis for Satellite Lithium-Ion Battery. Applied Sciences, 8, Article 2078.[CrossRef]
[22] He, W., Huang, H., Feng, C., Lu, G., Han, P. and Zhao, Z. (2023) Using CNN-GRU-DNN Hybrid Method for Remaining Useful Life Prediction of Lithium-Ion Batteries. Second International Conference on Energy, Power, and Electrical Technology (ICEPET 2023), Kuala Lumpur, 127881V.[CrossRef]
[23] Duquesnoy, M., Liu, C., Dominguez, D.Z., Kumar, V., Ayerbe, E. and Franco, A.A. (2023) Machine Learning-Assisted Multi-Objective Optimization of Battery Manufacturing from Synthetic Data Generated by Physics-Based Simulations. Energy Storage Materials, 56, 50-61.[CrossRef]
[24] Cai, S., Hu, J., Ma, S., Yang, Z. and Wu, H. (2022) Remaining Useful Life Prediction Method of EV Power Battery for DC Fast Charging Condition. Energy Reports, 8, 1003-1010.[CrossRef]
[25] Sun, C., Qu, A., Zhang, J., Shi, Q. and Jia, Z. (2022) Remaining Useful Life Prediction for Lithium-Ion Batteries Based on Improved Variational Mode Decomposition and Machine Learning Algorithm. Energies, 16, Article 313.[CrossRef]
[26] Battery Remaining Useful Life (RUL).
https://www.kaggle.com/datasets/ignaciovinuales/battery-remaining-useful-life-rul

Copyright © 2026 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.