Skip to content

Search

Search projects, papers and posts, or ask the AI.

All research

Smart Grid and Electric VehiclesCo-Author

Data-Driven SoC Forecasting in Electric Vehicles: A Federated Learning Perspective

Tanish Patel, Harshvardhan Gaikwad

PDFDOI

A data-driven State of Charge forecasting framework for Electric Vehicles that leverages Federated Learning and ensemble machine learning to deliver privacy-preserving, accurate, and scalable battery state estimation across decentralized sources

Abstract

Electric vehicle (EV) adoption stands as a pivotal step in curbing carbon emissions and combating climate change. However, the persistent specter of range anxiety continues to impede widespread acceptance. Traditional State of Charge (SoC) estimation methods, coupled with basic machine learning models, grapple with accuracy and adaptability limitations. Yet, the advent of Federated Learning heralds a transformative era in the EV landscape, placing a premium on data security and privacy. This approach involves training models across a network of distributed sources, such as individual EVs, harnessing the wealth of diverse data streams. It continually refines models, ensuring SoC calculations maintain precision as the EV fleet evolves. Notably, it fortifies against cyberattacks by obviating centralized data storage. Embracing Federated Learning within the EV industry not only alleviates range anxiety but also fosters sustainable transportation, underscoring the role of EVs in shaping an ecologically conscious future. This paper concentrates on SoC estimation through the prism of Federated Learning. Techniques including Federated Averaging, Differential Privacy Techniques, and Ensemble Learning will be employed. To facilitate this research, a comprehensive vehicle model, encompassing the powertrain and heating circuit, was validated through real driving trips with a BMW i3 (60 Ah), yielding the requisite dataset. This dataset underwent meticulous extraction, cleansing, and exploratory data analysis involving numerous parameters. These preparatory steps lay the groundwork for the subsequent application of Federated Averaging, Differential Privacy Techniques, and Ensemble Learning to the dataset, aiming for precise SoC estimation.

Overview of the Work

The evolution of electric vehicles (EVs) has brought forth a myriad of technological advancements and challenges. Among the most crucial aspects of EVs is the "State of Charge" (SoC), which refers to the current battery capacity as a percentage of its maximum capacity. Understanding the SoC is pivotal, not only for users who need to know when to recharge their vehicles but also for manufacturers and service providers aiming to optimize battery lifespan and vehicle performance.

However, the estimation of SoC is not a straightforward task. Traditional methods rely heavily on historical data and simplistic models, often leading to inaccuracies. Moreover, the dynamic nature of EV usage patterns adds another layer of complexity to SoC estimation. However, the mere recognition of SoC's importance isn't sufficient. The precision in its estimation is equally, if not more, crucial. Accurate estimation of the State of Charge ensures the safe operation of EVs, providing real-time data that can be pivotal for decisions related to charging, discharging, and overall vehicle operation.

In the quest for more accurate and efficient methods of data processing and analysis, the concept of Federated Learning emerges as a promising approach. Federated Learning is a machine learning technique where the model is trained across multiple decentralized devices or servers holding local data samples, without exchanging the data itself. This method stands in stark contrast to traditional centralized learning and offers significant advantages, especially in terms of data privacy and efficiency.

With the increasing integration of EVs into our daily lives, the datasets associated with them have become more comprehensive and valuable. This upsurge in data brings to light the indispensable need for robust cybersecurity measures. Any compromise in the EV dataset could lead to severe consequences, ranging from financial losses to potential threats to passenger safety.

This is where the beauty of Federated Learning truly shines. By allowing data to remain on local devices and only updating the model's parameters, Federated Learning inherently provides an added layer of cybersecurity. Not only does this approach enhance the protection of sensitive data, but it also paves the way for more collaborative and large-scale machine learning endeavors without the associated risks of data breaches.

Methodology

The methodology of this research is structured around the principles of Federated Learning, which allows for decentralized model training while preserving data privacy. The process begins with the collection of real-world drive cycle data from a BMW i3, focusing on the first 10 Category A files due to processing constraints. This dataset undergoes rigorous preprocessing, including cleaning missing values, removing outliers, and standardizing features.

Exploratory data analysis is performed to identify the most relevant parameters for SoC prediction, leading to the selection of 13 key features. The dataset, comprising over 2 million datapoints, is then utilized in a Federated Learning framework where local models are trained on individual EV nodes. These local models are subsequently aggregated at a central server using Federated Averaging, ensuring that raw data remains on the local devices.

Various regression algorithms are applied, including Lasso, Ridge, ElasticNet, Support Vector Regression (SVR), Random Forest, and Gradient Boosting. Each algorithm employs different regularization techniques to balance model complexity and accuracy. The performance of these models is evaluated based on metrics such as Root Mean Square Error (RMSE) and R².

The dataset used in this research was sourced from an open-access repository and includes real-world drive cycles from a BMW i3, with only the first 10 Category A files selected due to processing constraints. Data preprocessing involved cleaning missing values, removing outliers, and standardizing features, followed by exploratory analysis using correlation heatmaps to identify the 13 most relevant parameters for SoC prediction.

With over 2 million datapoints extracted, Federated Learning (FL) was employed to preserve data privacy by allowing distributed local training and global model aggregation without raw data sharing. The study incorporated various regression algorithms including Lasso, Ridge, and ElasticNet, each leveraging different regularization techniques to balance model simplicity and accuracy in a federated setup. Advanced regressors like Support Vector Regression (SVR), Random Forest, and Gradient Boosting were integrated for their superior handling of non-linear patterns and robustness across high-dimensional datasets.

The FL pipeline involved client-level local training followed by weighted aggregation at a central server, repeated over multiple rounds to iteratively improve the global model’s generalization performance. This methodology demonstrated that Random Forest achieved the highest accuracy (RMSE: 0.232, R²: 0.9996), validating the effectiveness of federated ensemble learning for accurate and private SoC estimation in EVs.

Results

The global shift toward electric vehicles (EVs) has intensified the need for advanced battery management systems, with particular emphasis on the accurate prediction of State of Charge (SoC), which not only mitigates range anxiety for users but also supports grid-level energy optimization as EV batteries increasingly act as distributed energy storage units. Traditional SoC estimation techniques, while valuable, often struggle with non-linear battery behaviors and external influences, necessitating more sophisticated approaches such as machine learning (ML). This study systematically evaluates six ML models—Lasso Regression, Ridge Regression, ElasticNet, Support Vector Regression (SVR), Random Forest Regressor, and Gradient Boosting Machine (GBM)—within a federated learning (FL) framework, which preserves privacy by training locally on distributed datasets without centralizing raw data. To assess model performance, several statistical metrics were employed: Mean Squared Error (MSE), which emphasizes large errors and is sensitive to outliers; Mean Absolute Error (MAE), a more uniform measure of average prediction accuracy; Root Mean Squared Error (RMSE), providing interpretable error magnitude in original units; and the Coefficient of Determination (R²), which quantifies the proportion of variance explained by the model. The federated training process utilized weighted global aggregation across ten rounds using distinct CSV files, accommodating non-uniform datasets by adjusting client contributions accordingly. Each model underwent careful hyperparameter tuning, with ElasticNet combining L1 and L2 penalties, Ridge minimizing multicollinearity effects through L2 regularization, and Lasso promoting feature sparsity. SVR leveraged an RBF kernel to capture non-linearities, while Random Forest and GBM applied ensemble learning to sequentially or independently aggregate decision trees for higher accuracy. Visualization plots were generated to illustrate model behavior across rounds. Final performance results show Random Forest Regressor achieving the highest accuracy with an RMSE of 0.232 and R² of 0.9996, followed by GBM with comparable performance, indicating their suitability for high-dimensional, non-linear SoC prediction tasks in privacy-sensitive contexts. Hyperparameter configurations and training plots affirm the robustness and scalability of this federated learning pipeline. These findings underline the transformative potential of ensemble-based federated ML models for real-world EV deployments, where accurate, resilient, and interpretable battery state estimation is vital for optimizing user experience and sustainable energy ecosystems.