Introduction
Object detection is a fundamental task in computer vision, yet its training has historically lagged behind image classification in terms of scale. While classification models are routinely trained with mini-batches of hundreds or thousands of images, state-of-the-art detectors like Mask R-CNN have typically been restricted to small batches (e.g., 2 to 16 images). This limitation stems from the high memory requirements of high-resolution detection images and the optimization challenges associated with scaling detection tasks.
MegDet addresses these hurdles, enabling training with mini-batches of up to 256 images across 128 GPUs. This framework significantly reduces training time—from days to hours—while simultaneously improving final detection accuracy.
Technical Innovations
Cross-GPU Batch Normalization (CGBN)
Standard Batch Normalization (BN) computes statistics locally on each GPU. In detection, where a single GPU might only hold 2 images, these local statistics are highly unstable. MegDet introduces CGBN, which synchronizes mean and variance statistics across all GPUs in a cluster. By utilizing the statistics of the entire 256-image batch, CGBN provides stable normalization that is essential for high-performance detection.
Warmup Learning Rate Policy
Scaling the mini-batch size requires a proportional increase in the learning rate according to the Linear Scaling Rule. However, high initial learning rates can cause training to diverge. MegDet employs a "warmup" strategy, starting with a very small learning rate and gradually increasing it to the target value during the initial iterations to ensure stable convergence.
Variance Equivalence
The authors provide a theoretical justification for the Linear Scaling Rule based on maintaining the variance of gradient updates. They argue that as the batch size increases, the learning rate should scale linearly to keep the update variance consistent, which is crucial for large-scale optimization.
Experimental Results
Efficiency and Accuracy
MegDet demonstrates a remarkable reduction in training time. For a ResNet-50 based detector on the MS COCO dataset, training time was slashed from 33 hours (with a batch size of 16) to just 4 hours (with a batch size of 256).
Beyond speed, the large mini-batch approach improves accuracy. On the COCO validation set, MegDet achieved 37.1 mmAP, outperforming the 36.2 mmAP of the small-batch baseline. This improvement is partly attributed to more stable positive-to-negative sample ratios in larger batches, which helps mitigate the class imbalance problem inherent in object detection.
COCO 2017 Challenge Success
An ensemble of MegDet models secured 1st place in the COCO 2017 Detection Challenge, achieving 52.5 mmAP. This result highlights the effectiveness of large-batch training for pushing the boundaries of state-of-the-art detection.
Conclusion and Future Work
MegDet proves that large mini-batch training is not only feasible for object detection but also highly beneficial for both speed and accuracy. While the approach requires significant computational resources and introduces communication overhead for CGBN, it sets a new standard for large-scale detector training. Future research will investigate the convergence lag observed in large-batch models during early training epochs and further optimize communication efficiency in massive GPU clusters.
Summary updated