Application overview
Key performance targets:
- High precision: Achieve a test root mean square error (RMSE) under 2% SOC
- High correlation: Maintain an r-squared greater than 0.99 on held-out test data
- Resource efficiency: Optimize model footprint for seamless integration with MCU budgets
Start evaluating
Data collection
The dataset is derived from the LG SoC dataset (LG_18650HG2_Liion_Battery_Data), a public time-series repository containing exhaustive charge/discharge cycles for lithium-ion battery cells. The raw data comprises 4,491 individual files logged at fixed intervals, capturing the electrochemical behavior of the cells across diverse operating profiles.
Each sample file contains four primary input attributes: voltage (V), current (A), temperature (°C), and capacity (Ah). To prepare the data for the NPU-optimized regression model, a time-series windowing approach was implemented using a SimpleWindow method. Data was segmented into frames of 128 samples with a stride of 0.05 (dense overlap), resulting in four continuous input channels—voltage, current, temperature, and capacity (coulomb count)—used to predict the target variable: State-of-Charge (SOC) expressed as a percentage.
Data quality
The REGR_20k_NPU model was trained and validated on the complete 4,491-file LG dataset. The model achieved a test RMSE of 2.56% (0.0256) and a test R-squared of 0.99. During the training process (50 epochs, stride_size 0.05), the model reached a best-epoch R-squared of 0.987, confirming a high-fidelity fit between the predicted SOC and the actual ground truth across the held-out test data.
Building and train your model
Accelerate development by leveraging advanced optimization and automation to design, train, and deploy high-performance AI models. For this use case, models are trained using the tinyml-tensorolab tinyml-tensorlab CLI either directly with the provided configuration file or via the tinyml-workflow-agent skill. Executing the config_MSPM0.yaml file automates the end-to-end pipeline—handling feature extraction, training, quantization, and compilation. To maximize hardware efficiency, Quantization Mode 2 (NPU-optimized INT8) is enabled by default within the configuration.
Find the right model
Select the ideal model based on your specific accuracy and resource requirements. The recommended model for this use case is REGR_20k_NPU, a ~20,000-parameter regression model validated against the complete 4,491-file dataset. On the MSPM0G5187, this model maintains a highly efficient footprint of 26.39 KB (comprising 2.43 KB code, 21.52 KB read-only, and 2.45 KB read/write), utilizing NPU-optimized INT8 quantization. To expedite your development, pre-trained reference models and training configurations are available in the TI tinyML Model Zoo, enabling engineers to easily reproduce these results or fine-tune models using proprietary datasets.
Deploying your model
Transition from training to production with a seamless, start-to-finish workflow. CCStudio™ Edge AI Studio simplifies the deployment of trained models to embedded targets. For developers seeking deeper customization and granular control, the MSPM0-SDK provides a comprehensive framework, utilizing the TI Neural Network Compiler to convert trained models into ready-to-use libraries. This enables the integration of accelerated SOC estimation directly into your embedded BMS application with minimal manual effort.
Choosing the right device
| Product number | Processing core | NPU available | Clock frequency (MHz) | Benchmark metrics | ||
|---|---|---|---|---|---|---|
| Latency (ms) | Flash (kB) | SRAM (kB) | ||||
| MSPM0G5187 | Arm® Cortex®-M0+ | TinyEngine™ NPU | 80 | <7 | 23.95 | 2.45 |
All the hardware, software and resources you’ll need to get started
Rotor temperature prediction using multiple sensors with high framerate
Find and localize specific objects, people in real-time at R-squared value over 96.9% using AI-accelerated processors and industry-standard software.