Home

Awesome

<div align="center"> <img src="./image/Logo_RGB.png" width="300"> </div>

BatteryML: An Open-Source Tool for Machine Learning on Battery Degradation

Recent News

Official code and data repository of BatteryML: An Open-Source Tool for Machine Learning on Battery Degradation (ICLR 2024). Please star, watch, and fork BatteryML for the active updates! We appreciate any questions and suggestions!

Our paper is now available on Arxiv and ICLR 2024! This paper provides detailed introduction to our design, which we will be actively updating during the development of BatteryML.

Introduction

The performance degradation of lithium batteries is a complex electrochemical process, involving factors such as the growth of solid electrolyte interface, lithium precipitation, loss of active materials, etc. Furthermore, this inevitable performance degradation can have a significant impact on critical commercial scenarios, such as causing 'range anxiety' for electric vehicle users and affecting the power stability of energy storage systems. Therefore, effectively analyzing and predicting the performance degradation of lithium batteries to provide guidance for early prevention and intervention has become a crucial research topic.

To this end, we open source the BatteryML tool to facilitate the research and development of machine learning on battery degradation. We hope BatteryML can empower both battery researchers and data scientists to gain deeper insights from battery degradation data and build more powerful models for accurate predictions and early interventions.

Framework

<!-- <img src="./image/framework.png" width="800"> --> <img src="./image/framework_new.png" width="800">

Highlights:

Dataset

Data SourceElectrode ChemistryNominal CapacityVoltage Range (V)RUL dist.SOC dist. (%)SOH dist. (%)Cell Count
CALCELCO/graphite1.12.7-4.2566±10677±1748±3013
MATRLFP/graphite1.12.0-3.6823±36893±736±36180
HUSTLFP/graphite1.12.0-3.61899±389100±1043±2877
HNEINMC_LCO/graphite2.83.0-4.3248±1564±1749±2814
RWTHNMC/carbon1.113.5-3.9658±6460±2446±2248
SNLNCA,NMC,LFP/graphite1.12.0-3.61256±132186±745±2761
UL_PURNCA/graphite3.42.7-4.2209±5089±641±3310

For RUL (Remaining Useful Life) tasks, we also created combined datasets from the public sources to assess training efficacy when various battery data are combined. Notably:

For more detailed information on the data, please refer to the Appendix A of our paper.

Benchmark result of RUL(Remain Useful Life) task

Benchmark results for remaining useful life prediction. The comparison methods are split into four types, including

  1. dummy regressor, a trivial baseline that uses the mean of training label as predictions;
  2. linear models with features designed by domain experts;
  3. traditional statistical models with QdLinear feature;
  4. deep models with QdLinear feature.

For models sensitive to initialization, we present the error mean across ten seeds and attach the standard deviation as subscript.

ModelsMATR1MATR2HUSTSNLCLOCRUHCRUSHMIX
Dummy regressor398510419466331239576573
"Variance" model136211398360179118506521
"Discharge" model32914932226714376>1000>1000
"Full" model167>100033543313893>1000331
Ridge regression116184>100024216965>1000372
PCR9018743520019768560376
PLSR10418143124217660535383
Gaussian process154224>1000251204115>1000573
XGBoost334799395547215119330205
Random forest168±9233±7368±7532±25192±281±1416±5197±0
MLP149±3275±27459±9370±81146±5103±4565±9451±42
CNN102±94228±104465±75924±267>1000174±92545±11272±101
LSTM119±11219±33443±29539±40222±12105±10519±39268±9
Transformer135±13364±25391±11424±23187±1481±8550±21271±16

Quick Start

Install

pip install -r requirements.txt
pip install .

This will install the BatteryML into your Python environment, together with a convenient command line interface (CLI) batteryml. You may also need to install PyTorch for deep models.

Download Raw Data and Run Preprocessing Scripts

<!-- Download the raw data and execute the preprocessing scripts as per the provided [instruction](./dataprepare.md). You can also use the code below to download public datasets and convert them to BatteryML's uniform data format. -->

Download raw files of public datasets and preprocess them into BatteryData of BatteryML is now as simple as two commands:

batteryml download MATR /path/to/save/raw/data
batteryml preprocess MATR /path/to/save/raw/data /path/to/save/processed/data

Run Cycler Preprocessing Scripts to process your data

If your data is measured by a cycler such as ARBIN, NEWARE, etc., you can use this command to process your data into BatteryData of BatteryML.

batteryml preprocess ARBIN /path/to/save/raw/data /path/to/save/processed/data --config /path/to/config/yaml/file

Due to variations in software versions and configurations, the data format and fields exported by the same cycler may differ. Therefore, we have added default processing configurations in the /configs/cycler directory to map raw data to target data fields. You can edit these default configurations as needed.

We currently support ARBIN and NEWARE data formats. Additionally, Biologic, LANDT, and Indigo formats are being integrated. If you encounter any issues with our cycler processing your data, please submit an issue and attach a sample data file to help us ensure rapid compatibility with your data format.

Run training and/or inference tasks using config files

BatteryML supports using a simple config file to specify the training and inference process. We provided several examples in configs. For example, to reproduce the "variance" model for battery life prediction, run

batteryml run configs/baselines/sklearn/variance_model/matr_1.yaml --workspace ./workspace/test --train --eval

Citation

If you find this work useful, we would appreciate citations to the following paper:

@inproceedings{zhang2024batteryml,
  title={Battery{ML}: An Open-source Platform for Machine Learning on Battery Degradation},
  author={Han Zhang and Xiaofan Gui and Shun Zheng and Ziheng Lu and Yuqi Li and Jiang Bian},
  booktitle={The Twelfth International Conference on Learning Representations},
  year={2024}
}

Documentation

By leveraging BatteryML, researchers can gain valuable insights into the latest advancements in battery prediction and materials science, enabling them to conduct experiments efficiently and effectively. We invite you to join us in our journey to accelerate battery research and innovation by contributing to and utilizing BatteryML for your research endeavors.