BNNR
BNNR

Bulletproof Neural Network Recipe

Automate augmentation search for PyTorch vision models. Classification, detection, XAI explainability, and a real-time dashboard — all in one package.

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 augmentation search, explainability, 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.

Classification + Detection

Same workflow for both tasks. Accuracy for classification, mAP for detection. Bbox-aware augmentations automatically update coordinates.

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

Whether you're doing image classification or object detection, BNNR adapts to your workflow with minimal code.

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.

http://127.0.0.1:8080
84.7%
Best Accuracy
72.4%
Baseline
+12.3pp
BNNR Gain
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

Rust and corrosion texture overlay

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