Abstract
This paper describes AutoFocus, an efficient multi-scale inference algorithm for deep-learning based object detectors. Instead of processing an entire image pyramid, AutoFocus adopts a coarse to fine approach and only processes regions which are likely to contain small objects at finer scales. This is achieved by predicting category agnostic segmentation maps for small objects at coarser scales, called FocusPixels. FocusPixels can be predicted with high recall, and in many cases, they only cover a small fraction of the entire image. To make efficient use of FocusPixels, an algorithm is proposed which generates compact rectangular FocusChips which enclose FocusPixels. The detector is only applied inside FocusChips, which reduces computation while processing finer scales. Different types of error can arise when detections from FocusChips of multiple scales are combined, hence techniques to correct them are proposed. AutoFocus obtains an mAP of 47.9% (68.3% at 50% overlap) on the COCO test-dev set while processing 6.4 images per second on a Titan X (Pascal) GPU. This is 2.5× faster than our multi-scale baseline detector and matches its mAP. The number of pixels processed in the pyramid can be reduced by 5× with a 1% drop in mAP. AutoFocus obtains more than 10% mAP gain compared to RetinaNet but runs at the same speed with the same ResNet-101 backbone.
Introduction: The Efficiency Gap in Multi-Scale Detection
In object detection, size matters. Small objects are notoriously difficult to detect at standard resolutions, so researchers typically use "image pyramids"—processing the same image at multiple scales (e.g., 1x, 2x, and 3x resolution). While this improves accuracy, it is incredibly inefficient.
The authors point out a striking statistic: in the COCO dataset, small objects occupy only 0.3% of the total pixel area. Standard multi-scale inference spends equal energy on every pixel at every scale, meaning 99.7% of the high-resolution computation is essentially wasted on background or large objects that were already easily detected at lower resolutions.
AutoFocus aims to eliminate this waste by adopting a "coarse-to-fine" approach inspired by human foveal vision. It is a "smart zoom" algorithm that drastically reduces the computational cost of multi-scale inference. By predicting which regions are likely to contain small objects at a low resolution, the system only processes those specific areas at high resolution, achieving state-of-the-art accuracy with significant speedups.
Methods: FocusPixels and FocusChips
The AutoFocus framework consists of three main components that work together to prune unnecessary computation:
- FocusPixels: The network includes a lightweight, category-agnostic segmentation head. At a coarse (low-resolution) scale, it predicts a binary map of "FocusPixels"—areas likely to contain small objects that require a closer look. Because it doesn't need to identify what the object is, just that something small is there, this task is much easier and faster than full detection.
- FocusChips: To make these predictions usable for standard GPU-accelerated detectors (which prefer rectangular inputs), the authors developed an algorithm to group FocusPixels into compact rectangular crops called "FocusChips." This process involves dilating the pixel maps to ensure enough spatial context is included for the detector to work accurately.
- Focus Stacking: When you crop an image, you create artificial boundaries. An object that was originally large might get sliced into a small fragment that looks like a different object, leading to false positives. AutoFocus uses a "Focus Stacking" strategy to merge detections across scales and specifically prunes detections that occur at the boundaries of FocusChips unless they also appear in the original image boundary.
Key Results and Performance
The authors evaluated AutoFocus on the MS COCO and PASCAL VOC 2007 benchmarks. Key findings include:
- Speed vs. Accuracy: AutoFocus achieved an mAP of 47.9% on COCO test-dev, matching the performance of the high-accuracy SNIPER baseline while running at 6.4 images per second (a 2.5x speedup).
- Pixel Reduction: The algorithm can reduce the number of pixels processed in the image pyramid by 5x with only a negligible 1% drop in mAP.
- Competitive Edge: AutoFocus obtained a 10% higher mAP than the popular RetinaNet detector while running at the same inference speed using the same ResNet-101 backbone.
- Theoretical Limit: The authors show that with "perfect" FocusPixel prediction, a theoretical speedup of nearly 10x is possible, suggesting significant room for even more optimized implementations.
Conclusion
AutoFocus demonstrates that processing a 3x upsampled image (which requires 9x the computation) is often unnecessary. We can achieve the same accuracy by only processing ~5-20% of the pixels. By training the "where to look" component to be category-agnostic, the model generalizes better. Future work could involve integrating AutoFocus with one-stage detectors like YOLO or expanding the logic to tasks like instance segmentation and video inference.
Summary updated