Dissecting Efficient Architectures for Wake-Word Detection

Cody Berger, Juncheng B Li, Yiyuan Li, Aaron Berger, Dmitri Berger, Karthik Ganesan, Emma Strubell, Florian MetzeES-FoMO @ ICML 2023

TL;DR

This paper investigates why the performance of wake-word detection models often degrades when moving from powerful GPUs to resource-constrained CPUs, a crucial issue for edge devices. By dissecting various efficient neural network architectures, they reveal that structural differences, particularly in convolution and attention mechanisms, significantly impact this cross-platform performance gap, offering insights for designing more robust edge AI.

What Problem Does This Paper Address?

Deploying wake-word detection models on edge devices (like smart speakers or wearables) is challenging because these devices have limited computational power (CPUs) compared to the powerful hardware (GPUs/TPUs) typically used for training. While models trained on GPUs often perform well in simulations, their accuracy and speed can drop significantly when run on a CPU in real-time. This performance degradation is not uniform across different model architectures. The paper aims to understand why this happens by analyzing how various architectural components contribute to the efficiency and accuracy differences between GPU and CPU execution, a critical gap in current research that often overlooks this practical deployment challenge.

Methods

The researchers compared six different neural network architectures for wake-word detection: five Convolutional Neural Networks (CNNs) including VGG19_bn, DSCNN, EfficientNet_b1, EfficientNet_b7, EfficientNetV2_m, EfficientNetV2_xl, and one Transformer-based model (ViT style). They trained these models on the Speech Commands dataset and then evaluated their performance on both GPU and CPU platforms. A key aspect of their methodology was to analyze performance at a granular level, examining the latency and computational cost (FLOPS) of individual layer types (e.g., convolution, batch normalization, attention) within each architecture. They also performed static post-training quantization (PTQ) on two representative models (VGG19_bn and DSCNN) to assess its impact on efficiency. Over-the-air testing was conducted to simulate real-world deployment scenarios.

Datasets

The primary dataset used for training and evaluation was the Google Speech Commands dataset (Warden, 2018). This dataset contains audio samples for various spoken words, including a specific keyword for wake-word detection. The authors augmented this dataset with additional non-keyword audio files and applied transformations to create training, validation, and test sets.

Key Insights and Ideas

  • Cross-Platform Performance Mismatch is Real and Significant: The paper strongly demonstrates that models performing well on GPUs don't necessarily translate to the same performance on CPUs. This gap is not just about raw speed but also impacts accuracy.
  • Architecture Matters More Than You Think: The specific way an architecture is built (e.g., using depthwise separable convolutions vs. standard convolutions, or how attention is implemented) has a profound effect on how well it utilizes GPU parallelism versus CPU sequential processing.
  • CNNs Aren't Uniformly Better on CPUs: While CNNs are generally considered efficient, the type of CNN matters. Architectures like DSCNN (based on MobileNetV2's MBConv blocks) show better CPU performance due to their design, whereas models like VGG19_bn, with more parallelizable standard convolutions, excel on GPUs but suffer more on CPUs.
  • NAS for Images Doesn't Always Translate to Audio: Newer architectures like EfficientNetV2, optimized for image tasks using Neural Architecture Search (NAS), didn't necessarily perform optimally for audio wake-word detection, suggesting domain-specific optimization is crucial.
  • Quantization Offers a Boost, But Not a Magic Bullet: Post-training quantization can improve latency on CPUs, but the speedup is often less than theoretically possible, especially for models with heavy reliance on operations like convolution.

Key Results

  • VGG19_bn and EfficientNet_b7 achieved the highest F1 scores on GPU during over-the-air testing.
  • DSCNN achieved the lowest latency on CPU and showed only a small performance drop.
  • EfficientNetV2_xl exhibited a particularly steep decline in performance and a large latency increase when moving from GPU to CPU.
  • Moving from GPU to CPU, all models except EfficientNetV2_m saw their F1 scores drop below the digital baseline.
  • VGG19_bn experienced an exponentially larger latency increase (100x) transitioning from GPU to CPU compared to MBConv-based models.
  • Quantizing VGG19_bn and DSCNN to int8 improved latency by 2.3x and 1.31x respectively, without harming F1 scores.

Limitations and Future Work

  • Limited PTQ Tools: The authors found that applying post-training quantization (PTQ) to a wider range of models was challenging due to the immaturity of available open-source tools, particularly for Transformer architectures. They plan to continue their work on quantization for other models.
  • Hardware Representation: The M1 Mac's CPU, while powerful, might not be a perfect representation of typical portable, edge CPUs. The authors chose not to use it in their experiments, opting for a Raspberry Pi 4B.
  • Future Work: The paper suggests that future research should focus on training CNN-based audio models jointly optimized for FLOPS and accuracy, potentially using NAS specifically for audio tasks. They also highlight the need for better PTQ tools and further investigation into the impact of specific architectural components on cross-platform performance.

Summary updated

BibTeX
@inproceedings{berger2023dissecting,
  author = {Cody Berger and Juncheng B Li and Yiyuan Li and Aaron Berger and Dmitri Berger and Karthik Ganesan and Emma Strubell and Florian Metze},
  title = {{Dissecting Efficient Architectures for Wake-Word Detection}},
  booktitle = {ES-FoMO @ ICML},
  year = {2023},
  url = {https://openreview.net/forum?id=lmaAcSViye},
}
Figure