[Paper Review] RNNPool: Efficient Non-linear Pooling for RAM Constrained Inference
This paper introduces RNNPool, a novel RNN-based pooling operator that efficiently downsamples large activation maps in CNNs using recurrent networks to aggregate features over large receptive fields, significantly reducing peak RAM usage and computational cost while maintaining high accuracy. It enables state-of-the-art face detection on ARM Cortex-M4 devices with under 256 KB RAM, achieving 0.78 MAP on WIDER FACE using 80× fewer MAdds than prior methods.
Standard Convolutional Neural Networks (CNNs) designed for computer vision tasks tend to have large intermediate activation maps. These require large working memory and are thus unsuitable for deployment on resource-constrained devices typically used for inference on the edge. Aggressively downsampling the images via pooling or strided convolutions can address the problem but leads to a significant decrease in accuracy due to gross aggregation of the feature map by standard pooling operators. In this paper, we introduce RNNPool, a novel pooling operator based on Recurrent Neural Networks (RNNs), that efficiently aggregates features over large patches of an image and rapidly downsamples activation maps. Empirical evaluation indicates that an RNNPool layer can effectively replace multiple blocks in a variety of architectures such as MobileNets, DenseNet when applied to standard vision tasks like image classification and face detection. That is, RNNPool can significantly decrease computational complexity and peak memory usage for inference while retaining comparable accuracy. We use RNNPool with the standard S3FD architecture to construct a face detection method that achieves state-of-the-art MAP for tiny ARM Cortex-M4 class microcontrollers with under 256 KB of RAM. Code is released at https://github.com/Microsoft/EdgeML.
Motivation & Objective
- To address the challenge of high memory and computational demands in deploying standard CNNs on resource-constrained edge devices with limited RAM, such as ARM Cortex-M4 microcontrollers.
- To overcome the accuracy degradation caused by aggressive downsampling via standard pooling or strided convolutions in such memory-constrained environments.
- To design a novel pooling operator that enables rapid, non-linear down-sampling of activation maps while preserving feature expressiveness and minimizing memory overhead.
- To demonstrate that RNNPool can effectively replace multiple standard CNN blocks, especially in early network stages, to drastically reduce peak memory and MAdds without accuracy loss.
- To achieve state-of-the-art performance in face detection on tiny edge devices by integrating RNNPool into the S3FD architecture.
Proposed method
- RNNPool uses two separate RNNs—one processing rows and one processing columns—within a sliding window (patch) of size r×c to aggregate features non-linearly.
- The operator applies a recurrence over each row and column of a feature patch, producing a compact, high-level representation of size 4h₂, where h₂ is the hidden dimension of the RNN.
- It supports configurable hyperparameters: patch size (receptive field), stride (for non-overlapping or overlapping patches), and output dimension (h₂), enabling flexible down-sampling.
- The RNNPool layer is differentiable and can be inserted syntactically like standard pooling layers, allowing seamless replacement of max/average pooling or strided convolutions in existing architectures.
- The method uses FastGRNN as the RNN cell to minimize MAdds while maintaining high accuracy, with minimal parameter overhead.
- RNNPool is applied to replace multiple initial blocks in MobileNetV2, DenseNet, and S3FD, reducing activation map size and peak memory usage during inference.
Experimental results
Research questions
- RQ1Can a non-linear, RNN-based pooling operator effectively downsample large activation maps in CNNs while preserving model accuracy on resource-constrained devices?
- RQ2To what extent can RNNPool replace multiple standard CNN blocks in early network stages to reduce peak memory and computational complexity?
- RQ3How does RNNPool compare to standard pooling and strided convolutions in terms of accuracy, memory usage, and MAdds when applied to image classification and face detection tasks?
- RQ4Can RNNPool enable state-of-the-art face detection performance on ultra-low-memory edge devices, such as ARM Cortex-M4 microcontrollers with under 256 KB RAM?
- RQ5What is the optimal configuration of RNNPool hyperparameters (patch size, stride, hidden size, RNN cell type) for balancing accuracy, memory, and compute efficiency?
Key findings
- RNNPool reduced the peak memory requirement of MobileNetV2 by up to 10× and MAdds by approximately 25% on ImageNet-10 while maintaining 94.4% accuracy.
- Using FastGRNN in RNNPool reduced MAdds by 226M compared to 266M for LSTM, with a 1% higher accuracy (94.4% vs. 93.4%) on ImageNet-10.
- A single RNNPool layer with patch size 16, stride 8, and 32 output channels reduced a 640×640×3 input to an 80×80×32 activation map, requiring only ~200 KB of RAM.
- The RNNPool-enhanced S3FD model achieved 0.78 MAP on the medium category of WIDER FACE, outperforming EXTD, and used 80× fewer MAdds while running on a device with only 225 KB RAM.
- Replacing the final average pooling layer in MobileNetV2 with RNNPool improved accuracy by approximately 1%.
- The training dynamics of RNNPool-based models were comparable to standard models, indicating no significant training difficulty.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.