# A Unified Machine Learning Framework for Li-Ion Battery State Estimation and Prediction +
## 5 Implementation and Experimental Results
### Technical Implementation  
The implementation of these pipelines was based on the technical architecture of the proposed framework, which is depicted in Figure 7. This approach has been implemented as a standalone application that is containerized with Docker and Docker Compose to include the required services and facilitate the component's deployment. To further decouple development and deployment from production deployment, we have considered two Docker deployment configurations. In order to make it possible for the Flask application to be deployed in production, the production deployment configuration relies on the Gunicorn \"Green Unicorn\", a Python (version 3.12) Web Server Gateway Interface (WSGI) HTTP server, which allows for a quick, lightweight, and simple implementation that supports numerous workers. Additionally, data storage for the proposed implementation is based on MongoDB, the Mongoengine library, and pymongo. The core component service and the \begin{table}
\begin{tabular}{c c c l} \hline
**ML Model** & **Tuning Parameters** & & **Advantages and Disadvantages** \\ \hline \multirow{4}{*}{SVR} & SVR0 & + & Ignores small errors \\  & C feature & + & Handles complex relationships \\  & Kernel feature & \(-\) & High training cost on large datasets \\  & & \(-\) & Sensitive to hyperparameter tuning \\ \hline \end{tabular}
\end{table} 
Table 1: _Cont._mongoDB service are both configurable (i.e., database credentials and connection details) via environmental variables in the Docker Compose setup. As mentioned in a previous section, the \"Data Management\" component of the framework contains several processes regarding the \"Data Ingestion\", \"Data Harmonization\", and \"Data Preprocessing\" components. The first one can be applied through the broker accommodated to this framework or through the proposed data storage method based on the MongoDB library. Regarding the remaining components, several python libraries were employed to this application such as pandas and numpy for data preparation, manipulation, and processing as well as for the definition of huge, multi-dimensional arrays and matrices and high-level mathematical functions to work on these arrays. For the \"Model Management\" component of the proposed framework, several models and algorithms were implemented to achieve the prediction of the selected battery state through the process discussed in the previous section. They have been implemented as Python classes through Python packages such as Scikit-learn (or sklearn), tensorflow, and keras. Moreover, the deployment's results are communicated to the client applications, which are connected to the \"Battery State Prediction\" component, through the main interface. The suggested implementation's main interface is a GraphQL API, which is responsible for communicating analytics data and outcomes to client applications. GraphQL is an open-source API query and manipulation language. It includes a type system, a query language and execution semantics, static validation, and type introspection, as well as the ability to read, write (mutate), and subscribe to data changes. It supports a variety of languages, including Python. API development was performed utilizing the Graphene library and the Flask-GraphQL flask-related library. Finally, it is important to mention that this application does not examine the edge devices of the BMS such as the sensors that are connected to the battery cells, but it does examine the deployment of the proposed framework; thus all the required processes for  
Figure 7: The technical architecture of the proposed framework. this task took place in a virtual machine accommodated in the cloud. More specifically, this machine had the power of four CPUs with an architecture of x84_64, and the available memory was about 16 GB, while the storage capacity was about 120 GB. Furthermore, the network's performance was up to 5 Gbit/s.