BNNR
BNNR

Bulletproof Neural Network Recipe

Make PyTorch vision models production-ready. XAI diagnostics, intelligent augmentation, and evidence-based reporting — in one closed-loop toolkit.

TrainExplainImproveProve
pip install "bnnr[dashboard]"

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.

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

Train image classifiers with a minimal, consistent API — from baseline to augmentation search and live monitoring.

from bnnr import quick_run, BNNRConfig

result = quick_run(
    model, train_loader, val_loader,
    config=BNNRConfig(
        m_epochs=5,
        max_iterations=3,
        device="auto",
    )
)
print(f"Best: {result.best_metrics}")
# Best: {'accuracy': 0.847, 'f1_macro': 0.845}

Real-time dashboard

Monitor your training live with branch decision trees, metrics charts, augmentation previews, and XAI insights — all from your browser or phone.

Preview below mirrors the real dashboard KPI layout (sample numbers only — your session shows live metrics).

http://127.0.0.1:8080
94.1%
Best Accuracy ★
91.2%
Current Accuracy
89.8%
Best F1 (macro) ★
+2.8pp
BNNR Gain vs Baseline
6
Decisions Made
9
Branches Evaluated
Training progress (selected path)accuracy · F1 · loss
Branch Decision Tree

Interactive visualization of the augmentation search tree. Click nodes for details, hover for metrics.

Mobile Access

Scan the QR code printed in your terminal to monitor training from your phone. Full dashboard, responsive layout.

Try it in Google Colab

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.9+
Python
2.0+
PyTorch
0.1.0
Version