RNNPool: Efficient Non-linear Pooling for RAM Constrained Inference

Oindrila Saha, Aditya Kusupati, Harsha Vardhan Simhadri, Manik Varma, Prateek JainOpenReview 2020

TL;DR

This paper introduces RNNPool, a novel pooling operator that uses Recurrent Neural Networks (RNNs) to efficiently downsample feature maps in Convolutional Neural Networks (CNNs). RNNPool significantly reduces memory and computational requirements for inference, making it suitable for resource-constrained devices like ARM Cortex-M4 microcontrollers, while maintaining competitive accuracy on tasks like image classification and face detection.

What Problem Does This Paper Address?

Modern Convolutional Neural Networks (CNNs) achieve impressive accuracy in computer vision tasks but often require substantial memory for intermediate feature maps, making them unsuitable for deployment on edge devices with limited RAM (e.g., microcontrollers with <256 KB). While standard pooling or strided convolutions can reduce memory by downsampling, they often lead to a significant loss of accuracy due to over-simplistic aggregation of features. The challenge is to find a method that can aggressively downsample feature maps to reduce memory and computation without sacrificing accuracy.

Methods

The core innovation is RNNPool, a novel pooling operator that leverages Recurrent Neural Networks (RNNs) to aggregate features over large image patches. Unlike traditional pooling, RNNPool uses a pair of RNNs (RNN1 and RNN2) to process information along both rows and columns of a patch, and then bidirectionally. This allows for a more nuanced and expressive aggregation of features.

Key aspects of the method:

  • RNN-based Aggregation: Instead of simple max or average operations, RNNs capture sequential dependencies within a patch.
  • Patch-wise Processing: RNNPool operates on patches, similar to standard pooling, but with a more sophisticated aggregation mechanism.
  • Syntactic Equivalence: RNNPool layers are designed to be drop-in replacements for standard pooling layers, allowing easy integration into existing CNN architectures.
  • Parameters: RNNPool has parameters for patch size, stride, and RNN hidden state sizes, which control its downsampling capability and expressiveness.
  • FastGRNN: The authors use a specific RNN variant called FastGRNN for its efficiency in terms of size and computation.

Datasets

The paper uses several datasets for training and evaluation:

  • ImageNet-10: A 10-class subset of ImageNet, used for image classification experiments.
  • CIFAR-10: Used for comparing RNNPool with standard pooling operators.
  • WIDER FACE: A large-scale face detection dataset, used for evaluating face detection models.
  • SCUT-HEAD: Used for head detection experiments.
  • Visual Wake Words dataset: Used for evaluating models on a task requiring low-power edge devices.
  • Synthetic datasets: Used to probe RNNPool's ability to capture edges, orientations, and shapes.

Key Insights and Ideas

  • RNNs as Powerful Pooling Operators: The paper demonstrates that RNNs, typically used for sequential data, can be effectively repurposed as sophisticated pooling operators for spatial data in CNNs. This challenges the conventional view of RNNs being solely for sequential tasks.
  • Balancing Efficiency and Accuracy: RNNPool strikes a crucial balance between aggressive downsampling (leading to reduced memory/compute) and feature aggregation quality (maintaining accuracy). This is a significant step towards deploying complex vision models on resource-constrained hardware.
  • Complementary to Existing Architectures: RNNPool is not a standalone architecture but a module that can be integrated into various existing CNNs (MobileNets, DenseNets, etc.), enhancing their efficiency without requiring a complete redesign.
  • Theoretical Lower Bounds: The paper provides theoretical analysis (Proposition 1 and Claim 1-4) to establish lower bounds on memory requirements for CNNs without recomputation, highlighting the inherent memory constraints and how RNNPool helps alleviate them.

Key Results

  • Significant Memory Reduction: RNNPool-based models achieved substantial reductions in peak RAM usage. For example, RNNPool+MobileNetV2 reduced peak memory by up to 10x, and RNNPool-Face-Quant achieved a model deployable on ARM Cortex-M4 with under 256 KB RAM.
  • Competitive Accuracy: Despite aggressive downsampling, RNNPool models maintained comparable or even improved accuracy. For instance, RNNPool+MobileNetV2 achieved similar accuracy to the base model, and RNNPool-Face-C achieved higher MAP than baselines on WIDER FACE.
  • Reduced Computational Cost: RNNPool also led to reductions in MAdds (Multiply-Adds), a measure of computational complexity. For example, RNNPool+MobileNetV2 reduced MAdds by about 25%.
  • State-of-the-Art on Edge Devices: The paper demonstrates a face detection model (RNNPool-Face-Quant) achieving state-of-the-art MAP for tiny ARM Cortex-M4 microcontrollers.
  • Outperforms ReNet: RNNPool generally outperformed ReNet (another RNN-based approach for vision) in terms of accuracy, model size, and MAdds for similar memory footprints.

Limitations and Future Work

  • Hyperparameter Tuning: While RNNPool offers flexibility, finding optimal hyperparameters (hidden sizes, patch sizes) for specific architectures and tasks might require further exploration.
  • Neural Architecture Search (NAS): The authors mention that extending RNNPool for NAS-based architectures like EfficientNets is a direction for future work.
  • Broader Impact Considerations: The paper acknowledges the dual-use nature of efficient edge AI, noting that while it enables beneficial applications (e.g., for visually impaired individuals), it could also be misused for surveillance.
  • Further Optimization: The paper suggests that further optimization of RNNPool models, potentially through sparsity or more advanced quantization techniques, could yield even greater efficiency.

Summary updated

BibTeX
@misc{saha2020rnnpool,
  author = {Oindrila Saha and Aditya Kusupati and Harsha Vardhan Simhadri and Manik Varma and Prateek Jain},
  title = {{RNNPool: Efficient Non-linear Pooling for RAM Constrained Inference}},
  year = {2020},
  eprint = {2002.11921},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.11921},
  howpublished = {OpenReview},
}
Figure