TL;DR
This paper introduces SMTM, a novel semantic memory system that mimics human brain's "priming effect" to accelerate on-device CNN inference for mobile vision tasks. By encoding high-level visual features into compact semantic vectors and intelligently caching frequently-seen objects, SMTM achieves significant speedups (up to 2x) with minimal accuracy loss, making powerful AI more accessible on resource-constrained devices.
What Problem Does This Paper Address?
Mobile vision tasks, powered by Convolutional Neural Networks (CNNs), are increasingly prevalent for applications like augmented reality and facial recognition. However, running these computationally intensive models on mobile devices faces significant challenges: limited processing power, memory, and battery life. Cloud offloading is often not feasible due to latency constraints and privacy concerns. While temporal redundancy (the fact that objects in a scene tend to reappear) offers an opportunity for acceleration, existing methods struggle with high dimensionality of features, computational overhead, and dynamic scene changes. This paper aims to bridge this gap by introducing a memory system that efficiently leverages temporal redundancy for faster, on-device CNN inference.
Methods
SMTM's core innovation lies in its "semantic memory" inspired by the human brain's priming effect. Instead of directly caching raw images or high-dimensional feature maps, SMTM employs three key techniques:
- Semantic Vector Encoding: High-dimensional feature maps from CNN layers are compressed into low-dimensional "semantic vectors" using Global Average Pooling (GAP). These vectors capture high-level visual semantics, making them efficient for storage and lookup.
- Early Exit Mechanism: SMTM uses these semantic vectors to match incoming frames with cached objects. If a high confidence match is found, the CNN inference can "exit early," skipping subsequent layers and saving computation. A novel "cross-layer cumulative similarity" metric is used to determine the optimal exit point, balancing latency and accuracy.
- Adaptive Priming Memory: To handle dynamic scenes, SMTM uses a hierarchical memory structure with a fast memory (caching frequently and recently seen objects) and a global memory. An adaptive cache replacement policy, considering both frequency and recency, ensures the fast memory stays relevant. Furthermore, adaptive cache sizing and dynamically updated "semantic centers" (the representation of cached objects) help maintain performance under varying conditions.
Datasets
The paper evaluates SMTM on two large-scale datasets:
- UCF101: An action recognition dataset with 101 action categories. For evaluation, a subset of 10 action categories was used.
- Long-tail CIFAR-100: A subset of CIFAR-100 specifically designed to simulate the long-tail distribution of object occurrences in natural scenes, used for object classification.
Key Insights and Ideas
- Human Brain as Inspiration: The paper effectively draws a parallel between SMTM's semantic memory and the human brain's priming effect, highlighting how biological systems optimize for repeated stimuli.
- Semantic Vectors are Key: Compressing feature maps into semantic vectors is crucial. It drastically reduces memory footprint and computational cost for lookups, making the memory approach feasible on mobile devices.
- Early Exit is More Than Just Matching: The "cross-layer cumulative similarity" metric is a clever way to build confidence for early exits, moving beyond simple layer-wise matching and improving robustness.
- Adaptability is Crucial for Mobile: The adaptive cache size and semantic center updates are vital for real-world mobile scenarios where scenes and object distributions change rapidly. This makes SMTM robust to dynamic environments.
- Orthogonal Optimization: SMTM's approach of skipping layers without modifying CNN kernels makes it compatible with existing hardware and software optimizations, offering a significant advantage over methods requiring kernel-level changes.
Key Results
SMTM demonstrates impressive performance improvements:
- Speedup: Achieves up to 2x speedup over standard approaches and up to 1.5x over prior cache designs.
- Accuracy: Maintains acceptable accuracy, with an average accuracy loss of only 1.05% across five CNN models. In some cases, SMTM even achieved higher accuracy than baselines due to its adaptive semantic centers.
- Memory Overhead: Introduces a minimal memory overhead, averaging around 2MB, significantly less than previous methods.
- Energy Saving: Reports an average energy saving of 35.40% on mobile CPUs and 30.60% on mobile GPUs.
- Early Exit Ratio: Achieves high early exit ratios, with over 50% of images exiting inference in the first half of the network for action recognition tasks.
Limitations and Future Work
The authors acknowledge a few limitations and suggest future directions:
- Generalized Vision Tasks: While SMTM is currently focused on recognition and classification, they believe it can be generalized to other vision tasks like object detection, which often involve recognition components.
- Beyond Vision Tasks: The core semantic memory design could potentially be extended to other machine learning domains like natural language processing and speech recognition, where temporal redundancy is also prevalent (e.g., hot-spot keywords).
- Parameter Tuning: The confidence threshold for early exit (τ) offers a trade-off between accuracy and latency, which can be tuned by application developers based on specific requirements. Further research could explore more automated or adaptive thresholding strategies.
Summary updated