TinyVLM: Zero-Shot Object Detection on Microcontrollers via Vision-Language Distillation with Matryoshka Embeddings
Organizations: Independent Researcher
Abstract
Zero-shot object detection enables recognising novel objects without task-specific training, but current approaches rely on large vision language models (VLMs) like CLIP that require hundreds of megabytes of memory - far exceeding the constraints of micro controller units (MCUs). We present TinyVLM, the first framework enabling zero-shot object detection on resource-constrained MCUs with less than 1MB of memory. Our approach introduces three key innovations: (1) a decoupled architecture that separates visual inference from text encoding, allowing precomputed class embeddings to be stored in flash memory; (2) Matryoshka distillation that trains nested embeddings at multiple dimensions (16-256), enabling flexible accuracy-memory trade-offs; and (3) quantized embedding storage that reduces class prototype memory by 4x with minimal accuracy loss. Trained on Conceptual Captions 3M (CC3M), TinyVLM achieves competitive zero-shot accuracy on COCO, Flowers102, and Food101 while requiring only 285KB of RAM and 892KB of flash memory for the deployed vision encoder. We demonstrate real-time inference at 26 FPS on STM32H7 and over 1,000 FPS on MAX78000 with its CNN accelerator, enabling practical zero-shot detection on edge devices for the first time.
Figures & tables
| Method | Params | Memory | MCU |
| (M) | (MB) | Compatible | |
| CLIP ViT-B/32 [ 26 ] | 151 | 350 | ✗ |
| CLIP ViT-L/14 [ 26 ] | 428 | 812 | ✗ |
| OpenCLIP ViT-G/14 [ 8 ] | 1843 | 2100 | ✗ |
| TinyCLIP ViT-S [ 34 ] | 39 | 78 | ✗ |
| MobileCLIP-S2 [ 31 ] | 18 | 36 | ✗ |
| Method | Memory | COCO | Flowers | Food | Avg. |
|---|---|---|---|---|---|
| Teacher models | |||||
| CLIP ViT-B/32 | 350MB | 56.4 | 66.1 | 83.7 | 68.7 |
| CLIP ViT-L/14 | 812MB | 64.8 | 76.2 | 92.1 | 77.7 |
| OpenCLIP ViT-G/14 | 2.1GB | 68.3 | 79.5 | 93.8 | 80.5 |
| Efficient VLMs | |||||
| TinyCLIP ViT-S | 78MB | 45.2 | 55.3 | 74.2 | 58.2 |
| Method | Memory | MCU | COCO | LVIS |
|---|---|---|---|---|
| Deploy | AP50 | AP50 | ||
| OWL-ViT [ 21 ] | 580MB | ✗ | 34.2 | 25.6 |
| YOLO-World-S [ 7 ] | 52MB | ✗ | 37.1 | 24.3 |
| Grounding DINO [ 20 ] | 890MB | ✗ | 42.5 | 32.1 |
| TinyVLM -Det (64d) | 1.2MB | ✓ | 12.4 | 8.6 |
| TinyVLM -Det (128d) | 1.5MB | ✓ | 15.2 | 10.8 |
| Platform | Freq. | Flash | SRAM | Latency | Energy | FPS |
|---|---|---|---|---|---|---|
| (MHz) | (KB) | (KB) | (ms) | (mJ) | ||
| STM32H7 | 480 | 892 | 285 | 38 | 2.1 | 26 |
| MAX78000 † | 100 | 133 | 6 | 0.86 | 0.016 | 1,160 |
| GAP9 | 400 | 892 | 312 | 18 | 0.8 | 55 |
| ESP32-S3 | 240 | 892 | 165 | 52 | 3.2 | 19 |
| 64-dim | 256-dim | |||
|---|---|---|---|---|
| ✓ | 24.2 | 28.5 | ||
| ✓ | ✓ | 27.8 | 31.2 | |
| ✓ | ✓ | 26.5 | 30.8 | |
| ✓ | ✓ | ✓ | 29.5 | 33.8 |
| Weighting | 16-dim | 32-dim | 64-dim | 256-dim |
|---|---|---|---|---|
| Equal | 19.8 | 25.2 | 29.5 | 33.8 |
| Inverse ( ) | 21.2 | 24.8 | 28.6 | 32.1 |
| Log ( ) | 20.5 | 25.6 | 29.2 | 33.2 |
| Teacher | Teacher Acc. | Student Acc. | Retention |
|---|---|---|---|
| CLIP ViT-B/32 | 63.2 | 29.5 | 46.7% |
| CLIP ViT-L/14 | 75.5 | 32.8 | 43.4% |
| OpenCLIP ViT-G/14 | 80.1 | 34.2 | 42.7% |
| Precision | Memory (KB) | COCO Acc. | vs. Float32 |
|---|---|---|---|
| Float32 | 20.0 | 33.8 | — |
| Float16 | 10.0 | 33.7 | -0.3% |
| Int8 | 5.0 | 33.4 | -1.2% |
| Int4 | 2.5 | 32.1 | -5.0% |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value |
|---|---|
| Optimizer | AdamW |
| Learning rate | |
| Weight decay | 0.01 |
| LR schedule | Cosine annealing |
| Warmup epochs | 10 |
| Total epochs | 100 |
Object Detection
Object detection locates and classifies objects in images or video, balancing localization accuracy, robustness, and inference speed.
See all 605 papers