Views
No views yet
nn.MultiheadAttention layer computes attention between all tag queries and all ViT patch tokens; each query's attended feature is projected through a scalar linear classifier. No MLP, no positional encoding — the query itself encodes "what to look for". This design is modular: the head can be swapped without touching the dataset, training loop, or metrics.1Input image (448×448)
2 │
3 ▼
4┌─────────────────────┐
5│ DINOv3 │ pretrained ViT backbone
6└─────────┬───────────┘
7 │ tokens: (B, N_patches+5, D)
8 ▼
9┌─────────────────────┐
10│ Tag Query Head │
11│ │
12│ tag_queries: │ learned (num_tags, D)
13│ (num_tags, D) ─────┼─→ cross-attention ──→ tag features (B, num_tags, D)
14│ │ queries attend to ViT patch tokens
15│ classifier: │
16│ Linear(D→1) ───────┘ → logits (B, num_tags)
17└─────────────────────┘
18 │
19 ▼
20 sigmoid(logits) → per-tag probabilities[0.10, 0.15, …, 0.95].| Model | Params | Input | Latency | mAP | Macro F1 | Micro F1 | Best threshold |
|---|---|---|---|---|---|---|---|
| Ours (L/16) - trained from scratch | 319.0M | 448×448 | 36.6ms | 0.5352 | 0.4775 | 0.6884 | 0.20 |
| WD-eva02-large-tagger-v3 | 315.2M | 448×448 | 50.3ms | 0.4822 | 0.4344 | 0.6684 | 0.30 |
| Ours (B/16) - trained from scratch | 96.8M | 448×448 | 24.9ms | 0.4693 | 0.4195 | 0.6684 | 0.20 |
| WD-SwinV2-tagger-v3 | 98.0M | 448×448 | 35.8ms | 0.4603 | 0.4140 | 0.6474 | 0.15 |
| ML-Danbooru | 68.9M | 448×448 | 34.0ms | 0.4023 | 0.3490 | 0.5952 | 0.60 |
| JoyTag | 91.5M | 448×448 | 20.2ms | 0.3783 | 0.3429 | 0.6179 | 0.35 |
| DeepDanbooru (CNN) | 161.0M | 512×512 | 33.6ms | 0.2100 | 0.1920 | 0.4692 | 0.15 |
trojblue/danbooru2025-metadatatag_string_general + tag_string_character + tag_string_copyright unified; tags with frequency ≥ 100; images with ≥ 2 tagsdata/ignored_tags.txttrojblue/danbooru2025-metadata — training datasrc/compared_models/: DeepDanbooru, WD-tagger, ML-Danbooru, JoyTag