Abstract
Modern deep neural networks (DNNs) are often limited by GPU memory constraints, particularly in tasks requiring high-resolution inputs like semantic segmentation. We present In-Place Activated Batch Normalization (InPlace-ABN), a technique that fuses BatchNorm and Activation layers to reduce training memory footprints by up to 50%. By employing invertible activation functions such as Leaky ReLU, InPlace-ABN discards intermediate forward-pass activations and reconstructs them during backpropagation. This memory efficiency allows for larger batch sizes and higher image resolutions, directly translating to improved performance across various benchmarks, including ImageNet-1k, Cityscapes, and Mapillary Vistas.
Introduction
Training state-of-the-art DNNs like ResNet or ResNeXt involves a significant memory overhead. Deep learning frameworks typically store intermediate activations during the forward pass to compute gradients during the backward pass. The standard sequence of Batch Normalization (BN) followed by an Activation (ACT) is particularly memory-intensive, as it requires storing multiple large tensors. In memory-constrained scenarios, such as semantic segmentation of high-resolution images, this bottleneck often forces the use of sub-optimally small batch sizes, hindering training stability and final model accuracy.
Methodology
InPlace-ABN addresses this by replacing the standard BN -> ACT sequence with a single, unified layer. While standard approaches store the input to the BN layer, its normalized output, and the final activated output, InPlace-ABN stores only the final activated output.
The key to this approach is the use of invertible activation functions. While the standard ReLU is non-invertible, Leaky ReLU (with a small negative slope) allows for the mathematical reconstruction of input values from the output. During the backward pass, InPlace-ABN recovers the discarded intermediate values by applying the inverse of the activation and BN operations.
Architecturally, this significantly reduces the number of buffers that must be kept in memory. As shown in the comparison of residual bottleneck blocks, the InPlace-ABN version halves the store buffer requirement.
Experimental Evaluation
The authors evaluated InPlace-ABN on ImageNet-1k for classification and several challenging datasets for semantic segmentation: Cityscapes, COCO-Stuff, and Mapillary Vistas. The latter is particularly demanding, featuring diverse street-level images up to 22 megapixels. The primary goal was to demonstrate how memory savings could be reinvested into larger batch sizes and higher training resolutions.
Key Results
InPlace-ABN achieves up to a 50% theoretical memory reduction in BN+ACT blocks with a negligible computational overhead of approximately 1-2%.
- Image Classification: On ImageNet, the memory savings enabled training a deeper ResNeXt-152 model on the same hardware, improving top-1 accuracy from 77.04% to 78.28%.
- Semantic Segmentation: The impact was most pronounced in memory-starved segmentation tasks. By increasing training crop sizes (e.g., from 512x512 to 672x672), the models achieved state-of-the-art results: 79.40% mIoU on Cityscapes and 53.12% on Mapillary Vistas using a single-scale approach.
Conclusion
InPlace-ABN provides a simple yet effective plug-in solution for memory-constrained DNN training. By leveraging invertibility, it allows researchers to reinvest saved memory into larger batches or higher resolutions, leading to significant performance gains in complex vision tasks. Future work includes extending this method to object detection and 3D deep learning, potentially combining it with mixed-precision training for further efficiency.
Summary updated