BNNR
BNNR

Bulletproof Neural Network Recipe

BNNR automatically improves your PyTorch vision models using XAI — find what your model gets wrong, fix it with intelligent augmentation, and prove the result with structured reports and a live dashboard.

Zero flags: python -m bnnr demo for a ~1 min CIFAR-10 run with live dashboard, or python -m bnnr quickstart for the interactive wizard — getting started.

TrainExplainImproveProve
pip install "bnnr[dashboard]"

Original demo recording with audio (4K, ~53s) — press Play

XAI-driven augmentations

ICD and AICD use saliency maps to guide augmentation — not random flips and crops. See interactive before/after previews on the playground.

ICD

Intelligent Coarse Dropout

Masks high-saliency regions the model already relies on, forcing it to learn from surrounding context instead of shortcuts.

AICD

Anti-ICD

Masks low-saliency background and irrelevant textures, sharpening focus on the features that actually discriminate classes.

How BNNR works

A closed-loop pipeline that trains, diagnoses, repairs, and proves — so you ship models that actually work in production.

Step 1
Train

Train your model

Start with your PyTorch model and data. BNNR trains a baseline, then iteratively evaluates candidate augmentations — keeping only those that measurably improve performance.

Step 2
Explain

Understand with XAI

OptiCAM, GradCAM, NMF, and CRAFT saliency maps reveal what the model focuses on. Per-class diagnoses expose blind spots and biases invisible to accuracy alone.

Step 3
Improve

Fix with ICD / AICD

Intelligent Coarse Dropout (ICD) masks salient regions, forcing the model to learn from context. Anti-ICD (AICD) sharpens focus on key features. Both are XAI-driven and automatic.

Step 4
Prove

Prove with evidence

A structured report with metrics, XAI heatmaps, branch decisions, and before/after comparisons. Shareable, auditable, and ready for stakeholders or regulatory review.

Everything you need for better models

BNNR combines XAI diagnostics, intelligent augmentation, and real-time monitoring into a single, cohesive toolkit.

Train

Auto-Augment Search

Iterative branching strategy tests augmentations against a baseline, keeping only those that improve performance. No manual tuning needed.

Image Classification

End-to-end workflow from baseline training to stakeholder-ready reports, metrics, and dashboard views.

Object Detection

Full detection pipeline with YOLO and torchvision models (Faster R-CNN, RetinaNet, SSD). Bbox-aware augmentations, detection ICD/AICD, mAP metrics, and XAI saliency.

Explain

XAI Explainability

OptiCAM, GradCAM, NMF, and CRAFT heatmaps show why the model improves. Per-class diagnoses with severity and trend analysis.

Improve

ICD & AICD Augmentations

XAI-driven augmentations that use saliency maps to intelligently mask or focus regions. Forces the model to learn robust features instead of shortcuts.

8 Novel Augmentations

Unique texture-rich transforms: ChurchNoise, TeaStains, LuxferGlass, ProCAM, DifPresets, Smugs, Drust, and BasicAugmentation — designed for real-world domains.

GPU-Native Speed

ChurchNoise, ProCAM, DifPresets, ICD, and AICD run natively on CUDA tensors. Kornia integration for differentiable augmentations.

Prove

Real-time Dashboard

Live monitoring with 512×512 high-res previews, branch decision trees, per-class metrics, and XAI insights. Accessible from your phone via QR code.

Auditable Reports

Structured JSON reports with metrics, XAI heatmaps, and augmentation decisions. Export static dashboards for stakeholder review or regulatory compliance.

Simple yet powerful API

Start from the CLI with python -m bnnr demo, or plug BNNR into your existing PyTorch training loop with quick_run.

# Zero flags — CIFAR-10 demo, ICD preset, live dashboard (~1 min)
python -m bnnr demo

# Interactive wizard (dataset, preset, sample limits)
python -m bnnr quickstart

# Full training with built-in defaults
python -m bnnr train --dataset cifar10 --preset light --with-dashboard

Novel augmentations

Beyond standard flips and crops — texture-rich transforms and XAI-driven augmentations that force your model to learn better features.

ChurchNoise

Regional noise profiles simulating sensor artifacts

DifPresets

Circular diffusion-like effects (warm, cold, sharpen)

ProCAM

Camera lens defects: vignette, chromatic aberration

TeaStains

Dried liquid stain watermark overlays

LuxferGlass

Frosted glass refraction distortion

Smugs

Fingerprint smudges and grease streaks

Drust

Dust and debris particle overlay on the lens

ICD

Intelligent Coarse Dropout using XAI saliency maps

AICD

Anti-ICD: keeps salient regions, perturbs background

Open Source
MIT License
3.10+
Python
2.0+
PyTorch
0.4.11
PyPI