Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BABY — Battery ESC Fault Detection & Localization

Self-contained deployment package for External Short Circuit (ESC) fault detection.
Classification: 97.85% (91/93) | Fault Localization: 98.6% (70/71)


Directory Structure

BABY/
├── esc_full_detector.py      # MAIN — Full detection pipeline (classify + localize)
├── features.py               # 70-feature extraction (9 groups)
├── best_model.pkl            # Trained ExtraTrees model + scaler + top26
│
├── train_and_save.py         # Training code (ExtraTrees + feature selection)
├── generator_v3.py           # Synthetic data generator V3 (domain-aware)
├── generator_original.py     # Original synthetic data generator
│
├── plot_sci_figures.py       # SCI Fig 1-6: Classification & Feature Analysis
├── plot_detection_sci.py     # SCI Fig D1-D6: Detection & Localization
│
├── detection_report.csv      # Full 93-file results (class + fault time)
├── detector_legacy.py        # Legacy simple detector (A311 reference)
│
├── syn_features.npz          # Synthetic features V1
├── syn_features_v5.npz       # Synthetic features V5
├── real_features.npz         # Real 93-file features
│
├── figures/                  # Generated SCI figures (PDF + PNG, 300 DPI)
│   ├── fig1_confusion_matrix.*
│   ├── fig2_tsne.*
│   ├── fig3_feature_importance.*
│   ├── fig4_per_class_accuracy.*
│   ├── fig5_voltage_profiles.*
│   ├── fig6_feature_selection.*
│   ├── fig_d1_cusum_demo.*
│   ├── fig_d2_delay_distribution.*
│   ├── fig_d3_vdrop_vs_resistance.*
│   ├── fig_d4_dt10ohm_showcase.*
│   ├── fig_d5_performance_summary.*
│   └── fig_d6_timeline_overview.*
│
└── figures_a311/             # Original A311 figures (backup)

Quick Start

Run full detection on all 93 files:

cd BABY
python esc_full_detector.py /root/autodl-tmp/real_fault_data_labeled

Run on a single file:

python esc_full_detector.py /path/to/some_file.csv

Regenerate SCI figures:

python plot_sci_figures.py        # Classification figures (Fig 1-6)
python plot_detection_sci.py      # Detection figures (Fig D1-D6)

Method Overview

Classification (5-class)

  • Model: ExtraTrees (n=1000, max_depth=12) + StandardScaler
  • Features: 70 statistical features → Top-26 via MI/KS domain-invariant selection
  • Training: Synthetic data (physics-based generator) → real data transfer
  • Bias Correction: c3_bias=0.165 for class 3 (0.1Ω)

Fault Time Localization (CUSUM)

  • Algorithm: Page's CUSUM (1954) on causal dV/dt
  • Signal processing: EMA(2s) → dV/dt(1s step) → CUSUM negative shift
  • DT protocol: ref=t[20,35]s, search from t≥40s, confirm ≥2mV/30s
  • GZ protocol: ref=t[10,25]s, search from t≥27s, confirm ≥10mV/20s

Results

Metric Value
Classification Accuracy 97.85% (91/93)
Fault Localization Rate 98.6% (70/71)
DT 10Ω Detection 21/21 (100%)
DT 0.01-1Ω Detection 9/9 (100%)
GZ Detection 40/41 (97.6%)
Normal False Alarm 1/22 (4.5%)

Dependencies

numpy, pandas, scikit-learn, joblib, matplotlib, scipy

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages