Achieving Real-Time Object Detection on Mobile Devices with Neural Pruning Search
Abstract
Real-time object detection is critical for autonomous systems but remains computationally prohibitive for mobile devices. This paper presents a compiler-aware neural pruning search framework that automates the discovery of optimal pruning strategies. By leveraging Bayesian Optimization with a Weisfeiler-Lehman graph kernel, the framework identifies layer-specific pruning schemes and rates that maximize accuracy under strict latency constraints. Experimental results on a Samsung Galaxy S20 demonstrate inference speeds of 55ms for YOLOv4 and 99ms for PointPillars, achieving state-of-the-art performance for mobile 2D and 3D detection.
Introduction
Object detection serves as the "eyes" for autonomous vehicles and robotics. However, high-performance models like YOLOv4 (2D) and PointPillars (3D) typically require high-end GPUs, making them difficult to deploy on mobile or edge hardware. While neural network pruning—the removal of redundant weights—is a common compression technique, it often faces a trade-off: aggressive pruning can lead to significant accuracy loss, while unstructured pruning may not yield actual hardware speedups. Finding the optimal pruning configuration for every layer in a deep network is a complex search problem that has traditionally relied on manual expertise.
Methods: Automatic Neural Pruning Search
The proposed framework automates this process through a "Controller-Evaluator" architecture that balances accuracy and hardware efficiency.
Search Space and Heterogeneous Pruning
The search space includes various pruning schemes (Filter/Channel, Pattern-based, and Block-based) and pruning rates (ranging from 1x to 10x, including a "skip" option for layer removal). This allows for heterogeneous pruning, where different layers utilize different strategies based on their sensitivity and contribution to the model's performance.
Compiler-Aware Latency Measurement
A key innovation is the "compiler-aware" approach. Instead of using theoretical metrics like FLOPs, the framework measures actual latency on target mobile devices. By incorporating compiler optimizations into the search loop, the system ensures that the selected pruning patterns are those that the mobile hardware can effectively accelerate.
Efficient Search via Bayesian Optimization
To avoid the prohibitive cost of training every candidate model, the authors employ Bayesian Optimization (BO) with a Weisfeiler-Lehman (WL) graph kernel. This method predicts the performance of pruning "proposals" based on their structural similarity, significantly reducing the number of models that must be fully trained and evaluated.
Experimental Results
The framework was evaluated on the MS COCO (2D) and KITTI (3D) datasets using a Samsung Galaxy S20 smartphone.
2D Object Detection (YOLOv4)
The search identified a sparse YOLOv4 configuration that achieved a 5.18x speedup over the baseline, reaching an inference time of 55.2ms. As shown in Figure 1, the proposed results significantly outperform other mobile acceleration frameworks such as MNN, TVM, and TFLite in the accuracy-latency Pareto frontier.
3D Object Detection (PointPillars)
For 3D detection, the framework achieved a landmark result of 99ms inference time for PointPillars (0.24m grid size). This represents the first instance of real-time 3D detection on a standard smartphone. Detailed metrics in Figure 4 highlight that the proposed method maintains high accuracy (mAP) while drastically reducing parameters and computational load (MACs) compared to standard pruning techniques.
Discussion and Conclusion
The success of this framework underscores the importance of heterogeneous pruning and hardware-aware search. By allowing the system to "skip" layers or apply fine-grained patterns where necessary, the search discovers architectures that humans might overlook. While the current search is hardware-specific and requires initial computational overhead, it paves the way for deploying sophisticated computer vision models on ubiquitous mobile devices. Future work may extend this approach to more complex architectures like Vision Transformers.
Summary updated