Downloads · 30 days
0
ilessio-aiflowlab/DEF-spann
DEF-spann is a image classification model from ilessio-aiflowlab. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as apache-2.0.
Part of the ANIMA Perception Suite by Robot Flow Labs.
Downloads · 30 days
0
Access
Public
Updated Apr 4, 2026
Repo size
16.7 MB
Likes
0
Public
Click a slice to open those files.
.pth10 MB · 46%
From the Hugging Face model README
Part of the ANIMA Perception Suite by Robot Flow Labs.
SpaNN: Detecting Multiple Adversarial Patches on CNNs (arXiv:2506.18591) SaTML 2025 gerkbyrd et al.
SpaNN detects adversarial patch attacks by analyzing ensemble saliency-threshold attribute vectors extracted from victim model feature maps. The attack detector (AtkDetCNNRaw) is a lightweight 1D-CNN (417K params) that classifies threshold-swept clustering features as clean or adversarial.
Core Pipeline:
| Metric | Paper Target | Achieved |
|---|---|---|
| Val Accuracy | 85-92% | 97.9% |
| Val Loss | — | 0.0641 |
| Best Epoch | — | 50 (early stopped at 249) |
| Parameters | — | 416,905 |
Training Data: 6,746 samples (INRIA + CIFAR + ImageNet + COCO DINOv2)
| Format | File | Size | Use Case |
|---|---|---|---|
| PyTorch (.pth) | pytorch/DEF-spann_v1.pth | 5.0MB | Training, fine-tuning |
| SafeTensors | pytorch/DEF-spann_v1.safetensors | 1.7MB | Fast loading, safe |
| ONNX | onnx/DEF-spann_v1.onnx | 32KB | Cross-platform inference |
| TensorRT FP16 | — | — | Generate on target hardware |
| TensorRT FP32 | — | — | Generate on target hardware |
import torch
from def_spann.models import AtkDetCNNRaw
model = AtkDetCNNRaw(in_feats=4)
ckpt = torch.load("pytorch/DEF-spann_v1.pth", map_location="cpu")
model.load_state_dict(ckpt["model"])
model.eval()
# Input: (batch, 4_features, 20_thresholds)
x = torch.randn(1, 4, 20)
score = model(x) # → (1, 1), value in [0, 1]
is_attack = score >= 0.5
Two compiled CUDA kernels available in shared infrastructure:
local_entropy — Compute local entropy map for spatial anomaly detectionpatch_inpaint — Zero-fill detected adversarial patch regionsconfigs/training.tomldocker compose -f docker-compose.serve.yml --profile serve up -d
curl http://localhost:8080/health
Apache 2.0 — Robot Flow Labs / AIFLOW LABS LIMITED