Repository for the paper "Statistical learning for accurate and interpretable battery lifetime prediction", a follow-up paper to Severson et al. ) https://github.com/petermattia/revisit-severson-et-al
revisit-severson-et-al This repository contains code for our work entitled "Statistical learning for accurate and interpretable battery lifetime prediction", a follow-up paper to Severson et al. A permanent archive of this work on Zenodo is available here: Statistical Learning for Accurate and Interpretable
Battery Lifetime Prediction
To cite this article: Peter M. Attia et al 2021 J. Electrochem. Soc. 168 090547 Our key scripts and functions are summarized here: - <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">generate_voltage_arrays.m</code>: MATLAB script that generates capacity arrays from the battery dataset and exports them to csvs (stored in <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">/data</code>).
- <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">revisit-severson-et-al.ipynb</code>: Python notebook containing most of the analysis and figure generation.
- <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">image_annotated_heatmap.py</code>: Helper function from matplotlib (see docstring for source).
- <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">lifetime_charging_time/lifetime_charging_time.ipynb</code>: Contains a mini analysis on cycle life vs. charging time.
In addition, we used three scripts for neural net model training in the <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">nn_models</code> directory. Calls to these scripts look like this: <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">python mlp_base.py --n_starts 10 --lr 0.001 --rw 0.0001 --hd 10</code>. - <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">mlp_base.py</code>: Trains MLP models
- <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">cnn_base.py</code>: Trains CNN models without baseline subtraction
- <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">cnn_base_nosubtract.py</code>: Trains CNN models with baseline subtraction
These scripts are used by another script that is written in a proprietary language used to interact with a cluster at IBM; this additional script is not included. Finally, we include three notebooks that analyze the results of MLP & CNN training in the <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">nn_models</code> directory. These notebooks will not run completely without all <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">.pkl</code> or <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">.pt</code> files present. - <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">Analyze_Results_MLP_CV.ipynb</code>: Analyzes the results from the MLP cross-validation study and selects the best hyperparameters. Also produces intermediate outputs including <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">mlp_predictions.json</code>, <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">mlp_predictions_cycavg.json</code>, and <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">mlp_shap_results.csv</code>.
- <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">MLP_FinalModel.ipynb</code>: Runs the final model based on the results of CV and generates the MLP interpretability figure using <code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">shap</code>. -<code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">Analyze_Results_CNN.ipynb</code>: Analyzes the results from the CNN study (not a formal CV study) and selects the best hyperparameters. The best performing model (<code style="box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, " sf="" mono",="" menlo,="" consolas,="" "liberation="" monospace;="" font-size:="" 13.6px;="" padding:="" 0.2em="" 0.4em;="" margin:="" 0px;="" white-space-collapse:="" break-spaces;="" background-color:="" var(--bgcolor-neutral-muted,="" var(--color-neutral-muted));="" border-radius:="" 6px;"="">CNN_n20000_rw0.001_lr0.0001_do0.0.pt</code>) is included for reference.
|