Website · Paper · LinkedIn XAI-driven augmentation & diagnostics for PyTorch vision : find model failures, fix with saliency-guided augmentation (ICD/AICD), prove with auditable reports. Watch the demo on bnnr.dev Demo with audio (1280p). Original 4K recording: bnnr.dev BNNR (Bulletproof Neural Network Recipe) An HTML failure report for any PyTorch vision checkpoint — see where your model looks when it's wrong,…
XAI-driven augmentation & diagnostics for PyTorch vision - find model failures, fix with saliency-guided augmentation (ICD/AICD), prove with auditable reports.
XAI-driven augmentation & diagnostics for PyTorch vision: find model failures, fix with saliency-guided augmentation (ICD/AICD), prove with auditable reports.
Demo with audio (1280p). Original 4K recording: bnnr.dev
BNNR (Bulletproof Neural Network Recipe)
An HTML failure report for any PyTorch vision checkpoint — see where your model looks when it’s wrong, then fix it with saliency-guided augmentation. MIT licensed. No retraining required for diagnostics.
Run bnnr analyze on a trained model and you get a self-contained HTML report: confusion matrix, top confused pairs, OptiCAM saliency overlays on the worst failures, and plain-language recommendations.
Try it without installing:sample analyze HTML report (MNIST, real run — confusion pairs, XAI heatmaps, recommendations).
When do I reach for BNNR?
I have a trained checkpoint and validation looks fine — but I don’t fully trust it. → bnnr analyze gives an XAI failure report in under 5 minutes, no retraining. See where the model actually looks on its worst errors.
My augmentations are guesswork. → ICD/AICD condition augmentation on saliency maps, then a branch search keeps only the augmentations that measurably improve your validation metric.
I need to prove model quality to stakeholders or compliance. → A portable report.html plus a structured JSON audit artifact you can attach to a review.
BNNR also ships a training pipeline (bnnr train), a live dashboard, multi-label support, and object detection (YOLO / COCO-mini). Single-label classification is the focus for analyze. Supported tasks in v0.8.0: single-label classification, multi-label classification, object detection. Full docs: docs/README.md (analyze · detection · benchmarks).
Analyze an existing model (start here)
If you already have a trained checkpoint, run diagnostics without retraining:
You get a self-contained report.html (metrics, confusion matrix, top confused pairs, OptiCAM saliency overlays on failures, recommendations) plus an analysis_report.json audit artifact.
No checkpoint yet? Open the sample HTML report from a real MNIST run — no install required.
See docs/analyze.md for the full workflow (custom datasets, torchvision models, multi-label).
Quickstart (train with BNNR)
pip install "bnnr[dashboard]"
# Zero flags — CIFAR-10 demo CNN, ICD preset, live dashboard (~1 min)
python3 -m bnnr demo
Interactive wizard (prompts for dataset/preset; sample limits 128/64):
Open http://127.0.0.1:8080/ for the live dashboard (QR code in terminal for mobile on the same Wi-Fi).
Advanced: pass --config path.yaml to override defaults.
XAI-driven augmentations (ICD & AICD)
BNNR uses saliency maps to guide augmentation, not random flips and crops. One Grad-CAM map yields two opposite augmentations: ICD hides the most salient tiles, so the model cannot lean on whatever it currently relies on; AICD hides the least salient tiles, which suppresses the surrounding context once attention is already on the object.
The masked tiles are filled with a configurable strategy (Gaussian blur, local mean, noise, or solid):
Median validation accuracy, 3 seeds (42–44), demo CNN on CIFAR-10. Baselines: 5 epochs fixed; BNNR: full branch-search pipeline (more compute). Not SOTA — illustrative comparison. Details: benchmarks/README.md · reproduce: benchmarks/run.py → benchmarks/summarize.py.
A fine-grained ResNet18 / Imagewoof benchmark (low-data, from-scratch; 5 seeds, RandAugment + TrivialAugment baselines) is in progress — cheap enough for a free Colab T4, with a one-command reproduce script. See benchmarks/README.md.
Where the model looks (OptiCAM)
Same CIFAR-10 validation image (test index 127, seed 44): original input plus OptiCAM overlays after three training setups. With crop+flip only, attention scatters toward image edges; RandAugment is more centered but diffuse. After BNNR branch search (ICD + AICD + ChurchNoise), heatmaps concentrate on the vehicle body.
Original → crop+flip · RandAugment (2,9) · BNNR branch search. Illustrative example from the benchmark harness.
Full overlays for 8 fixed val indices: benchmarks/runs/*/xai/ · regenerate figure: python scripts/build_benchmark_xai_readme_asset.py --pick val127
Live dashboard
Real metrics from a BNNR training run — branch tree, charts, XAI previews, and dataset insights.
Overview
Branch Tree
Metrics
Samples & XAI
Analysis
Dataset Insight
What makes BNNR different
XAI-driven augmentation (ICD / AICD) — augmentations guided by saliency maps; no other PyTorch toolkit combines explainability and data augmentation this way.
Auto-augmentation search — iterative branching keeps only augmentations that measurably improve your validation metric.
Auditable reports — structured JSON reports with metrics, XAI heatmaps, and branch decisions for stakeholders or compliance review.
评论