burnin-anomaly-detection

AI-Driven Anomaly Detection in Component Burn-In & Screening

Static pass/fail limits miss latent defects: parts that stay under the datasheet maximum but behave abnormally for their lot or drift abnormally during burn-in. This project flags those parts with two modules, a risk decision layer and a plain-language reason for every flag.

data ──► features (per-lot median/MAD, log space)
            ├─► Module A: static limit + robust z-score + Isolation Forest   (dynamic outliers)
            └─► Module B: V0, V24 ──► forecast V168 + safety slope           (early rejection)
                         └─► Risk decision layer: PASS / INSPECT / REJECT + reason codes
                                   └─► Streamlit dashboard (Plotly drift-envelope plots)

Quick start

python -m venv .venv && .venv\Scripts\activate        # Windows
pip install -r requirements.txt && pip install -e .
python -m burnin.generate      # synthetic lots -> data/
python -m burnin.evaluate      # CV + tuning + held-out test -> models/, reports/
python -m burnin.figures       # presentation PNGs -> reports/figures/
streamlit run app/streamlit_app.py
pytest

Screen any CSV with the trained model (writes status, V168 forecast and reasons per part):

python -m burnin.predict path/to/lots.csv -o reports/predictions.csv

Deploy the dashboard (Streamlit Community Cloud)

  1. Go to https://share.streamlit.io and sign in with GitHub.
  2. Create app → Deploy a public app from GitHub, then set:
    • Repository: Aaradhay-Astitva/burnin-anomaly-detection
    • Branch: main
    • Main file path: app/streamlit_app.py
  3. Under Advanced settings, pick the newest Python version offered.
  4. Click Deploy. The first build takes a few minutes.

Data format

One row per part: lot_id, part_id, V0, V24, datasheet_max are required. V96, V168, parameter (default Iddq) and unit (default uA) are optional. label and defect_type are used only for scoring. A file with only V0/V24 runs in early-screening mode.

No dataset was provided, so burnin.generate simulates lots with log-normal baselines that differ from lot to lot. Six defect signatures are injected into about 4% of parts: gross_fail, lot_outlier, latent_linear, accelerating, step_jump and erratic. Every signature except gross_fail stays under the datasheet limit. The model is trained on 20 lots, and all headline numbers come from 8 separately generated, unseen lots.

How it works

Module A: dynamic outlier detection (src/burnin/module_a_outlier.py)

Module B: drift predictor (src/burnin/module_b_drift.py)

Decision layer (src/burnin/decision.py)

Explainability (src/burnin/explain.py)

Results (held-out test: 8 unseen lots, 4,000 parts, 170 defects)

Screen Recall Missed defects False-positive rate
Static datasheet limits (baseline) 0.171 141 0.000
Early screen @24h (static + A + B) 0.612 66 0.007
Full run @168h (static + A) 1.000 0 0.001

Honest limitations

Project layout

src/burnin/   generate · features · module_a_outlier · module_b_drift · decision · explain
              evaluate (CV, tuning, held-out test) · predict (CLI) · figures (PNG)
app/          Streamlit dashboard
tests/        pytest suite
data/         generated CSVs          models/   trained pipeline + thresholds
reports/      metrics, per-part results, figures