https://github.com/remontsuri/ev-qa-framework
ML-powered QA framework for EV battery systems — telemetry validation, anomaly detection, SOH prediction, CAN bus (2.0B + J1939) emulation, DBC parser, Prometheus metrics, Grafana dashboard
https://github.com/remontsuri/ev-qa-framework
anomaly-detection battery bms can-bus dbc electric-vehicle ev grafana j1939 lstm machine-learning prometheus python quality-assurance soh-prediction
Last synced: 14 days ago
JSON representation
ML-powered QA framework for EV battery systems — telemetry validation, anomaly detection, SOH prediction, CAN bus (2.0B + J1939) emulation, DBC parser, Prometheus metrics, Grafana dashboard
- Host: GitHub
- URL: https://github.com/remontsuri/ev-qa-framework
- Owner: remontsuri
- License: mit
- Created: 2026-01-15T21:14:42.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-06-05T09:36:58.000Z (22 days ago)
- Last Synced: 2026-06-05T12:10:43.697Z (22 days ago)
- Topics: anomaly-detection, battery, bms, can-bus, dbc, electric-vehicle, ev, grafana, j1939, lstm, machine-learning, prometheus, python, quality-assurance, soh-prediction
- Language: Python
- Homepage: https://remontsuri.github.io/EV-QA-Framework/
- Size: 855 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# EV-QA-Framework





[](https://github.com/remontsuri/EV-QA-Framework/releases)
[](https://github.com/remontsuri/EV-QA-Framework/actions/workflows/test.yml)
**EV Battery QA Framework — detect thermal runaway, validate BMS telemetry, comply with UN 38.3 / IEC 62660 / GB 38031, and ship with 948 passing tests and a Docker-ready pipeline.**
22 modules. MIT licensed. Python 3.9+.
---
## 30-second value
```bash
git clone https://github.com/remontsuri/EV-QA-Framework.git
cd EV-QA-Framework
docker compose up -d
open http://localhost:8081
```
Done. You now have a running battery QA workstation:
- telementry validation
- ML anomaly detection
- thermal runaway early warning
- cell imbalance analysis
- SOH prediction
- compliance testing against 6 international standards
- live dashboard with Prometheus metrics
No cloud account required. No external dependencies. Just a CSV and a terminal.
---
## What you get
**Input safety layer.** Pydantic schemas for voltage, current, temperature, SOC, SOH. Bad VINs, out-of-range values, and malformed rows are rejected before they reach your models.
**Anomaly detection.** Isolation Forest on voltage/current/temperature streams. Configurable contamination, severity thresholds, estimator count.
**Thermal runaway prediction.** Rule-based heuristics (dT/dt, temperature, anomaly score) and ML mode. CRITICAL trigger at \>85 °C or heating rate \>10 °C/min. Catches overheating before cascade. Confidence score clamped to [0, 1].
**SOH prediction.** LSTM-based State of Health forecasting from historical telemetry. Transformer-based prediction via `soh_transformer` for longer sequences.
**Cell imbalance analysis.** Statistical analysis of cell group voltages with configurable thresholds, outlier detection, linear regression trend.
**Battery scoring.** Composite health score (0–100) with letter grades (A+ through F). Combines SOH, internal resistance, cell balance, and thermal history.
**CAN bus & DBC.** CAN 2.0B and J1939 simulation and reception. DBC parser supports Vector CANdb, SavvyCAN exports, Intel/Motorola byte order.
**Fleet analytics.** Aggregate analysis across vehicle fleets: degradation curves, anomaly distribution, SOH histograms.
**Digital twin.** Real-time battery simulation mirroring physical pack behavior. Charge/discharge what-if scenarios and aging projections.
**V2G scenarios.** Vehicle-to-Grid simulation: bidirectional energy flow, grid demand response, cycling impact on battery health, revenue estimation.
**AutoML.** Automated model selection and hyperparameter optimization for SOH prediction and anomaly detection.
**HIL integration.** Hardware-in-the-Loop interface for physical BMS hardware and test stands via TCP/Serial.
**Compliance testing.** UN 38.3, IEC 62660, SAE J2464, ISO 12405, GB/T 31484, GB/T 31486, GB 38031.
**Observability.** Prometheus `/metrics` endpoint, Grafana dashboard, HTML coverage reports, JUnit XML.
---
## Quick start
```bash
# Python CLI (direct)
uv run pytest -v
uv run python run_factory_inspection.py
# Docker Compose (recommended for fresh environments)
docker compose up --build
```
- Tests + HTML coverage: http://localhost:8081/coverage/
- Prometheus metrics: http://localhost:8081/metrics
---
## One-liners
Analyze a CSV:
```bash
uv run python -m ev_qa_framework.cli analyze -i examples/tesla_model_s_defective.csv -o report.json
```
Emulate CAN traffic:
```bash
uv run python -m ev_qa_framework.cli emulate --dbc my_battery.dbc --duration 60
```
Train SOH model:
```bash
uv run python -m ev_qa_framework.cli train-soh -d examples/tesla_battery_qa_test.py
```
---
## Project structure
```
ev_qa_framework/
framework.py # core QA engine
models.py # Pydantic models + telemetry validation
config.py # thresholds and ML config
analysis.py # Isolation Forest, EVBatteryAnalyzer
soh_predictor.py # LSTM for SOH (TensorFlow optional)
soh_transformer.py # Transformer SOH predictor
can_bus.py # CAN 2.0B + J1939 simulation
dbc_parser.py # .dbc file parser (Vector CANdb + SavvyCAN)
cell_balance.py # cell voltage imbalance analysis
thermal_runaway.py # thermal runaway prediction (rule + ML)
battery_scoring.py # composite battery health scoring
physics_features.py # electrochemical/thermal feature extraction
fleet_analytics.py # fleet-wide analytics and benchmarking
digital_twin.py # real-time battery digital twin
v2g_scenarios.py # Vehicle-to-Grid simulation
automl.py # automated model selection and HPO
hil.py # Hardware-in-the-Loop interface
metrics.py # Prometheus metrics
cli.py # CLI entry point
chemistries.py # battery chemistry definitions (LFP, NMC, NCA)
tests/ # 948 tests
examples/ # sample telemetry and demos
run_factory_inspection.py # end-to-end factory QA demo
```
---
## Status
| Artifact | Value |
|---|---|
| Tests | 948 passed |
| Coverage | ~93% |
| CI | Docker Compose |
| License | MIT |
| Python | 3.9+ |
Regression risk is tracked in `tests/`. Coverage artifacts (`coverage/`, `junit.xml`) are present in the release pipeline.
---
## Roadmap
- [x] GitHub Actions CI badge + nightly coverage job
- [x] Grafana dashboard import JSON + provisioning
- [ ] public PyPI release
- [ ] real BMS telemetry adapters (Tesla, BYD, Nio)
- [ ] V2S + charging-station scenarios
- [ ] integration with Vector CANoe / CANalyzer