Predicting lithium-ion battery State of Health (SOH) from easily-measured per-cycle signals (voltage, current, internal resistance, cycle number), using the CALCE CS2 battery cycling dataset. Built and validated with Leave-One-Battery-Out (LOBO) cross-validation rather than a single train/test split, since only six battery cells are available.
- Parses 152 raw CALCE cycling files (six battery cells: CS2-33 through CS2-38) into a clean, one-row-per-cycle dataset.
- Applies several correctness checks during preprocessing:
- Validates that the assumed discharge step (
Step_Index == 7) is actually discharging (negative current) before trusting it. - Computes discharge capacity via trapezoidal integration of current over time, rather than trusting the file's own precomputed capacity column.
- Uses the mean of each battery's first 3 valid cycles as the reference ("100% SOH") capacity, instead of a single, noisier first cycle.
- Flags (and separately logs, without silently discarding) isolated capacity spikes and near-zero end-of-life cycles for manual review.
- Validates that the assumed discharge step (
- Trains three models — Linear Regression, Random Forest, Gradient Boosting — to
predict SOH from
cycle_number,C_rate,average_voltage_V,average_current_A, andinternal_resistance_ohm. - Evaluates all three with LOBO cross-validation (6 folds, one per battery) as the primary metric, since a single fixed split is a high-variance estimate with only 6 batteries available.
| Model | LOBO MAE (%) | LOBO RMSE (%) | LOBO R² |
|---|---|---|---|
| Gradient Boosting | 3.41 | 5.06 | 0.926 |
| Linear Regression | 3.51 | 5.00 | 0.925 |
| Random Forest | 3.74 | 5.78 | 0.893 |
Average discharge voltage is the single most important feature in both tree-based
models, consistent with known battery electrochemistry (voltage sag during
discharge tracks internal degradation). Full methodology, per-battery breakdowns,
and a feature ablation study are in the write-up (report/main.pdf /
report/main.tex).
.
├── CALCE_CS2_Battery_SOH_ML_Project_v2.ipynb # main analysis notebook
├── data/
│ └── CALCE_CS2_raw/ # raw cycling files (not tracked — see below)
├── outputs/
│ ├── CALCE_CS2_cycle_level_dataset.csv
│ ├── CALCE_CS2_ML_SOH_Dataset.csv
│ ├── CALCE_CS2_LOBO_CV_summary.csv
│ └── CALCE_CS2_Gradient_Boosting_SOH_Model.pkl
├── report/
│ ├── main.tex
│ ├── main.pdf
│ └── figures/
├── requirements.txt
└── README.md
Raw cycling data comes from the CALCE Battery Research Group
(University of Maryland), cells CS2-33 through CS2-38. The raw .xlsx files are
not included in this repository — they're large (hundreds of MB total) and
freely available from CALCE directly. Download them and place the extracted files
under data/CALCE_CS2_raw/ before running the notebook (the notebook's
EXTRACT_DIR path expects this layout).
pip install -r requirements.txt
jupyter notebook CALCE_CS2_Battery_SOH_ML_Project_v2.ipynbRun with Restart Kernel & Run All — later cells depend on state from earlier ones. Expect the discharge-step validation and LOBO CV summary printed near the top and middle of the notebook to be the numbers worth trusting; the single fixed-split results later in the notebook are kept only for the illustrative plots and are explicitly not the headline performance claim.
- Python 3.9+
- pandas, numpy, matplotlib, scikit-learn, openpyxl, joblib
Analysis code in this repository is provided as-is for academic/coursework purposes. The underlying CALCE CS2 dataset is © CALCE Battery Research Group, University of Maryland — refer to their site for data usage terms.
Ranit Das
M.Tech - Solid Mechanics and Design
IIT Kanpur