Towards Real-Time Action Recognition on Mobile Devices Using Deep Models

Chen-Lin Zhang, Xin-Xin Liu, Jianxin WuarXiv 2019

TL;DR

This paper bridges the gap between heavy server-side action recognition and mobile deployment by introducing a realistic "real-time" inference setting. The authors demonstrate that by using compact 2D architectures like MnasNet combined with temporal modules (TSM) and ImageNet pretraining, they can achieve state-of-the-art accuracy with a 6x speedup, enabling deep-learning-based action recognition to run at ~10 FPS on a standard smartphone.

What Problem Does This Paper Address?

Action recognition—identifying what a person is doing in a video—is computationally expensive. Current state-of-the-art models often rely on 3D convolutions or heavy ensembles that require massive GPU clusters. Furthermore, standard academic evaluation protocols use "heavy" inference: they might sample 10 different clips from a single video and perform 10 different spatial crops per frame, averaging the results to boost accuracy.

This approach is a non-starter for mobile devices with limited battery, thermal constraints, and no high-end GPUs. The authors identify a lack of research into efficient action recognition specifically tailored for mobile latency requirements. They set out to define a "realistic setting" for mobile inference and find the best architectural recipes to make it work.

Figure 1. Overall inference framework of two action recognition settings. The key differences between these two settings are the data augmentation and size of the models.

Methods

The authors propose a Real-Time Testing Setting: given a video stream, the model samples a single clip (e.g., 8 frames) and makes a prediction immediately without any data augmentation (no multi-cropping or multi-sampling).

To find the best model for this setting, they explored several avenues:

  • 2D vs. 3D CNNs: They compared 3D models (like MFNet) against 2D models using Temporal Segment Networks (TSN), which process individual frames and aggregate their scores.
  • Mobile Architectures: They evaluated manually designed compact models (MobileNetV1/V2, MnasNet) and models found via Neural Architecture Search (NASNet-A-Mobile, PNASNet-5-Mobile).
  • Enhancement Modules: They integrated the Temporal Shift Module (TSM), which facilitates information exchange across time by shifting feature channels between neighboring frames at zero computational cost, and Squeeze-and-Excitation (SE) blocks for better channel-wise feature recalibration.
  • Training Strategies: They investigated the impact of ImageNet pretraining and regularization techniques like Dropout and "Partial BN" (fixing most Batch Normalization layers) to combat overfitting.
Figure 2. Architectures of exactly one building cell of the three NAS searched models. Please note that in this figure, avg and max represent average and maximum pooling, sep represents depthwise convolution operation.

Datasets

  • Kinetics-400: A massive dataset of ~300,000 YouTube clips covering 400 human action classes. This served as the primary benchmark for evaluating accuracy vs. FLOPs.
  • 20BN Jester: A large-scale gesture recognition dataset (148,092 videos) used for a real-world case study and live mobile demo.
  • ImageNet: Used for pretraining the base 2D models.

Key Insights and Ideas

  • 2D + TSN > 3D: For mobile constraints, 2D-based models with temporal segments are significantly more efficient than 3D convolutions. They offer a much better accuracy-to-FLOPs trade-off.
  • ImageNet Pretraining is Essential: Contrary to recent findings in server-side 3D modeling (like SlowFast), the authors found that ImageNet pretraining improves mobile action recognition accuracy by 2-3%. It provides a better starting point and prevents compact models from getting stuck in poor local minima.
  • FLOPs $\neq$ Latency: This is a crucial engineering takeaway. While NAS-searched models (like NASNet) often have low FLOP counts, their complex branch structures (see Figure 2/5) result in high real-world latency on mobile CPUs compared to simpler, linear models like MobileNetV2 or MnasNet.
  • Overfitting is the Enemy: Even compact models like MnasNet tend to overfit on Kinetics. Techniques like high dropout (0.8) and fixing Batch Normalization layers are vital for performance.

Key Results

The authors' optimized model—MnasNet + TSM + SE—achieved performance comparable to a heavy ResNet-50 baseline but with 6x fewer FLOPs and significantly lower latency.

  • Efficiency: On the Kinetics dataset, their model reached ~66.5% accuracy with only 2.56B FLOPs, whereas standard models like ResNet-50+TSN require over 33B FLOPs for similar results.
  • Mobile Performance: In a live demo on a Huawei Mate 10 (Kirin 970 CPU), the model achieved approximately 10 FPS for sequential gesture recognition, meeting the threshold for "roughly real-time" interactive applications.
Figure 3. Accuracy-FLOPs trade-off on Kinetics validation set for various versions of TSN and other state-of-the-art approaches. Please note that all results are tested under the inference setting of real-time action recognition. 2D models with TSN are much closer to the top left corner than any other approach. For FLOPs calculation, we feed the sampled clip into models and calculate the overall FLOPs. The line in this figure represent to the FLOPs upper bound of current mobile CPUs.

Limitations and Future Work

While 10 FPS is a major milestone, it is on the lower end of what users perceive as "fluid" real-time (usually 24-30 FPS). The authors also noted that while TSM is highly effective for processing whole clips, it is harder to apply to strictly sequential, frame-by-frame online processing without specific caching strategies.

Future work will likely focus on even more efficient temporal modeling and exploring how to leverage mobile-specific hardware accelerators (like NPUs or DSPs) which were not utilized in this study.

Summary updated

Abstract

Action recognition is a vital task in computer vision, and many methods are developed to push it to the limit. However, current action recognition models have huge computational costs, which cannot be deployed to real-world tasks on mobile devices. In this paper, we first illustrate the setting of real-time action recognition, which is different from current action recognition inference settings. Under the new inference setting, we investigate state-of-the-art action recognition models on the Kinetics dataset empirically. Our results show that designing efficient real-time action recognition models is different from designing efficient ImageNet models, especially in weight initialization. We show that pre-trained weights on ImageNet improve the accuracy under the real-time action recognition setting. Finally, we use the hand gesture recognition task as a case study to evaluate our compact real-time action recognition models in real-world applications on mobile phones. Results show that our action recognition models, being 6x faster and with similar accuracy as state-of-the-art, can roughly meet the real-time requirements on mobile devices. To our best knowledge, this is the first paper that deploys current deep learning action recognition models on mobile devices.
BibTeX
@misc{zhang2019towards,
  author = {Chen-Lin Zhang and Xin-Xin Liu and Jianxin Wu},
  title = {{Towards Real-Time Action Recognition on Mobile Devices Using Deep Models}},
  year = {2019},
  eprint = {1906.07052},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.07052},
}

Loading related content...

Figure