Deep Microcompression: Structured Pruning and Bit-packed Quantization for Microcontrollers
Organizations: PowerLabs Technologies, Lagos, Nigeria
Abstract
This paper introduces Deep Microcompression (DMC), a hardware-aware pipeline for deep learning inference on bare-metal microcontrollers. DMC integrates structured pruning, quantization-aware training, and fixed-length bit-packing to achieve a 55.8 weight compression ratio on LeNet-5 (98.77% accuracy), generating a dependency-free C library with deterministic latency. On the RP2040 (Cortex-M0+), DMC reduces binary size by 3 versus TensorFlow Lite while matching its accuracy. Critically, DMC enables the first documented deployment of a standard CNN on the ATmega328P, a device constrained to 2KB SRAM, previously considered infeasible for CNN inference.
Figures & tables
| Model Config | Flash Memory (B) | SRAM Usage (B) | #MACs | #BOPs | Latency (s) | Energy (J) | Accuracy (%) | |||
| Weights | Code | Global Data | Workspace | Stack | ||||||
| I. Target Deployment (Hardware: ATmega328P) | ||||||||||
| DMC-Tiny (Ours) | 16,384 | 10,578 | 1,588 | 1,296 | 78 | 131,040 | 1,619,428 | 2.80 | 0.308 | 98.17 |
| II. Comparative Benchmark (Proxy Hardware: RP2040/Pico) † | ||||||||||
| Baseline (FP32) | 148,242 | 43,604 | 25,288 | 5,880 | 532 | 392,040 | 0 | 5.58 | 15.624 | 99.42 |
| DMC-Ultra | 2,640 | 43,876 | 7,712 | 5,880 | 544 | 226,740 | 2,269,400 | 0.15 | 0.431 | 98.77 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Configuration | Flash Memory (B) | SRAM Usage (B) | #MACs | #BOPs | Latency (s) | Energy (J) | Accuracy (%) | |||
| Weights | Code | Global Data | Workspace | Stack Peak | ||||||
| I. Compiler Optimization (Model: DMC-Ultra, Pack: 4-bit) | ||||||||||
| avr-gcc -O0 (None) | 2,638 | 17,484 | 6,158 | 5,880 | 83 | 226,740 | 2,269,400 | 9.37 | 2.76 | 98.77 |
| avr-gcc -O3 (Speed) | 2,638 | 13,566 | 6,168 | 5,880 | 64 | 226,740 | 2,269,400 | 4.77 | 1.41 | 98.77 |
| avr-gcc -Os (Size) | 2,638 | 10,712 | 6,172 | 5,880 | 69 | 226,740 | 2,269,400 | 5.07 | 1.50 | 98.77 |
| II. Bit-Packing Impact (Model: DMC-Ultra, Compiler: -Os) | ||||||||||
| Framework | Flash (KB) | RAM (KB) | Worksp. (KB) | Latency (s) | Energy (J) | Acc (%) |
|---|---|---|---|---|---|---|
| Float32 Baseline | ||||||
| TFLite Micro (FP32) | 365.2 | 27.4 | 24.7 | 0.60 | 0.13 | 98.91 |
| DMC (FP32) | 199.4 | 4.5 | 22.97 | 0.56 | 0.12 | 98.91 |
| Int8 Quantized | ||||||
| TFLite Micro (Int8) | 254.9 | 10.7 | 8.4 | 0.055 | 0.012 | 98.88 |
| DMC (Int8) | 86.4 | 7.7 | 5.7 | 0.226 | 0.05 | 98.89 |