Abstract
Object detection is traditionally a computationally intensive task, typically reserved for GPUs or high-end embedded systems. This paper introduces µYOLO, a highly optimized single-shot detector designed specifically for the ultra-resource-constrained environment of microcontrollers (MCUs). By leveraging architectural slimming, depth-wise separable convolutions, and aggressive pruning, µYOLO achieves functional real-time detection (~3.5 FPS) on an ARM Cortex-M7 processor. The model maintains a minimal footprint of under 800 KB of Flash and 350 KB of RAM, demonstrating the feasibility of complex computer vision tasks on "TinyML" hardware.
Introduction
Microcontrollers are the foundational components of the Internet of Things (IoT), prized for their energy efficiency and low cost. However, their severe memory and processing limitations—often less than 2 MB of Flash and 1 MB of RAM—have historically precluded the use of advanced object detection models like YOLO. This research investigates whether a single-shot detection pipeline can be sufficiently compressed to operate within these constraints while maintaining acceptable localization and classification accuracy.
Methodology
The µYOLO architecture is a streamlined variant of the original YOLO framework, specifically engineered for the OpenMV H7 R2 (Cortex-M7 at 480 MHz).
Architectural Optimization
The backbone utilizes a single standard convolution followed by seven depth-wise separable convolutions. This approach drastically reduces the parameter count and computational complexity. To further minimize memory usage, the detection grid was reduced to $5 \times 5$ ($S=5$) with only two bounding box predictors per cell ($B=2$). The default input resolution was set to $128 \times 128$ pixels.
Training and Compression Pipeline
- Pre-training: The backbone was pre-trained on the Caltech-256 dataset for robust feature extraction.
- Pruning: Iterative gradual pruning using an L1 norm heuristic was applied to eliminate redundant weights.
- Quantization: Post-training quantization converted the model to 8-bit integers, enabling efficient hardware-level integer arithmetic and reducing the storage footprint.
Experimental Results
The model was evaluated on three datasets: Human detection (COCO subset), Vehicle detection (COCO subset), and a custom "Fridge" dataset of toy groceries.
As shown in Figure 1, µYOLO achieved its highest performance on the "Fridge" dataset (56.4% mAP), while struggling more with the complex "Vehicles" task (12.3% mAP). In terms of efficiency, the system maintained a consistent frame rate of 3.45 to 3.49 FPS. The memory footprint remained well within MCU limits, utilizing approximately 706–771 KB of Flash and 324 KB of RAM.
Discussion
The Resolution Sweet Spot
A critical finding of this study was the relationship between input resolution and accuracy. While one might expect higher resolutions to yield better results, increasing the input size beyond $128 \times 128$ pixels did not provide significant mAP gains.
As illustrated in Figure 2, higher resolutions (e.g., $448 \times 448$) actually slowed training convergence and risked exceeding the device's RAM capacity without a proportional increase in detection quality.
Limitations and Error Analysis
The primary failure mode identified was a high rate of false negatives (missing objects), particularly in complex scenes with small or occluded objects. This "capacity gap" suggests that while µYOLO is effective for controlled environments (like the Fridge dataset), further optimization is needed for unconstrained "in-the-wild" scenarios.
Conclusion
µYOLO proves that single-shot object detection is viable on microcontrollers. Future work will explore more aggressive pruning schedules and the utilization of specialized hardware accelerators to bridge the performance gap in complex environments.
Summary updated