PP-LCNet: A Lightweight CPU Convolutional Neural Network

Cheng Cui, Tingquan Gao, Shengyu Wei, Yuning Du, Ruoyu Guo, Shuilong Dong, Bin Lu, Ying Zhou, Xueying Lv, Qiwen Liu, Xiaoguang Hu, Dianhai Yu, Yanjun MaarXiv 2021

TL;DR

This paper introduces PP-LCNet, a lightweight convolutional neural network specifically designed for efficient inference on Intel CPUs using the MKLDNN acceleration strategy. By strategically combining several existing techniques, PP-LCNet achieves competitive accuracy with significantly reduced latency compared to other state-of-the-art lightweight models on CPU platforms.

What Problem Does This Paper Address?

The proliferation of deep learning models, particularly Convolutional Neural Networks (CNNs), has led to remarkable advancements in computer vision tasks like image classification, object detection, and semantic segmentation. However, as these models become more complex and computationally intensive, achieving fast inference speeds on resource-constrained devices, especially those with x86 architecture CPUs, becomes a significant challenge. While many lightweight networks exist, their performance on Intel CPUs, even with acceleration libraries like MKLDNN, is often suboptimal. This paper aims to bridge this gap by proposing a network architecture and design principles tailored for efficient CPU inference.

Methods

PP-LCNet is built upon a "BaseNet" that uses depthwise separable convolutions, similar to MobileNetV1, but optimized for Intel CPUs. The authors then introduce several key modifications and strategic choices to enhance performance without sacrificing speed:

  • H-Swish Activation Function: Replacing the standard ReLU activation with H-Swish, which has been shown to improve accuracy with minimal impact on inference time.
  • Strategic Placement of SE Modules: While Squeeze-and-Excitation (SE) modules are known to boost accuracy, they can also increase latency. PP-LCNet strategically places SE modules only in the later stages of the network, where they offer a good balance between accuracy improvement and latency.
  • Larger Convolution Kernels at the Tail: Similar to SE modules, larger kernels (e.g., 5x5) can improve accuracy but might increase latency. The authors found that using 5x5 kernels specifically at the end of the network provides a significant accuracy boost with minimal latency overhead.
  • Larger 1x1 Convolution Layer After GAP: A 1280-dimensional 1x1 convolutional layer is added after the Global Average Pooling (GAP) layer. This increases the capacity to capture feature combinations without a substantial increase in inference time.

Datasets

The paper evaluates PP-LCNet on the following datasets:

  • ImageNet-1k: Used for training and evaluating image classification performance.
  • COCO-2017: Used for object detection tasks.
  • Cityscapes: Used for semantic segmentation tasks.

Key Insights and Ideas

  • CPU-Centric Design is Crucial: The paper highlights that optimizations that work well on mobile (ARM) devices don't always translate directly to Intel CPUs, especially when leveraging specific acceleration libraries like MKLDNN.
  • Strategic Combination of Techniques: PP-LCNet's success comes from a thoughtful combination of existing techniques (H-Swish, SE modules, larger kernels) rather than entirely novel components. The key is how and where these are applied.
  • Late-Stage Optimization: Both SE modules and larger kernels are most effective when applied towards the end of the network for achieving a good accuracy-speed trade-off on CPUs.
  • The Power of a Larger FC Layer: Appending a larger 1x1 convolutional layer after GAP significantly improves accuracy by allowing for better feature combination.

Key Results

  • Image Classification: PP-LCNet outperforms state-of-the-art lightweight models on Intel CPUs in terms of accuracy-latency trade-off. For example, PP-LCNet-1x achieves 71.32% Top-1 accuracy with 2.46ms latency, which is competitive with or better than models like MobileNetV2-1x and MobileNetV3-small-1.25x.
  • Object Detection: Using PP-LCNet as a backbone for the lightweight PicoDet model significantly improves mAP and reduces latency compared to using MobileNetV3-large as the backbone. PP-LCNet-1x achieved 26.9 mAP with 7.9ms latency.
  • Semantic Segmentation: PP-LCNet-0.5x as a backbone for Deeplabv3+ achieved a higher mIoU (58.36%) than MobileNetV3-large-0.5x (55.42%) while reducing inference time by 53ms. PP-LCNet-1x also showed similar improvements.

Limitations and Future Work

  • NAS Integration: The authors suggest that their work can inform Neural Architecture Search (NAS) by reducing the search space and improving search efficiency. They plan to use NAS in the future to discover even faster and stronger models.
  • Further Optimization: While the paper focuses on specific techniques, there's always room for further exploration and optimization of network components and their placement for different CPU architectures and MKLDNN versions.

Summary updated

BibTeX
@misc{cui2021pp,
  author = {Cheng Cui and Tingquan Gao and Shengyu Wei and Yuning Du and Ruoyu Guo and Shuilong Dong and Bin Lu and Ying Zhou and Xueying Lv and Qiwen Liu and Xiaoguang Hu and Dianhai Yu and Yanjun Ma},
  title = {{PP-LCNet: A Lightweight CPU Convolutional Neural Network}},
  year = {2021},
  eprint = {2109.15099},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.15099},
}
Figure