[Paper Review] Honk: A PyTorch Reimplementation of Convolutional Neural Networks for Keyword Spotting
Honk presents a faithful PyTorch reimplementation of TensorFlow-based convolutional neural network models for keyword spotting, using the Google Speech Commands Dataset. It achieves comparable accuracy to the original TensorFlow models—90.2% for the full model and 78.4% with momentum training—while offering improved code readability and extensibility for research and deployment on edge devices.
We describe Honk, an open-source PyTorch reimplementation of convolutional neural networks for keyword spotting that are included as examples in TensorFlow. These models are useful for recognizing "command triggers" in speech-based interfaces (e.g., "Hey Siri"), which serve as explicit cues for audio recordings of utterances that are sent to the cloud for full speech recognition. Evaluation on Google's recently released Speech Commands Dataset shows that our reimplementation is comparable in accuracy and provides a starting point for future work on the keyword spotting task.
Motivation & Objective
- To provide a faithful, open-source PyTorch reimplementation of TensorFlow’s keyword spotting models for improved code readability and maintainability.
- To enable researchers and developers to replicate and extend keyword spotting models using modern deep learning frameworks.
- To support low-power, on-device keyword spotting for privacy-preserving voice interfaces by offering a production-ready implementation.
- To facilitate deployment of trained models via a RESTful API and desktop demo application for real-time inference.
- To serve as a foundation for future research on command trigger detection in speech-based systems.
Proposed method
- Reimplemented the full and compact models from Sainath and Parada (2015) in PyTorch, mirroring the architecture and hyperparameters of the original TensorFlow code.
- Applied the same input preprocessing pipeline: band-pass filtering, MFCC extraction with 30ms window and 10ms shift, and stacking of all 30ms frames over one second.
- Used data augmentation via random time-shifting (±100ms) and mixing in background noise (white, pink, human-made) with 80% probability per epoch.
- Cached preprocessed inputs to accelerate training, with 30% cache eviction per epoch to manage memory.
- Trained models using Adam optimizer with learning rates of 0.001 (full) and 0.01 (compact), and also experimented with SGD with momentum (0.9).
- Split the Speech Commands Dataset using SHA1 hash of filenames to ensure consistent train/val/test splits (80%/10%/10%) across runs.
Experimental results
Research questions
- RQ1Can a PyTorch reimplementation of TensorFlow’s keyword spotting models achieve comparable accuracy on the Speech Commands Dataset?
- RQ2Does the use of PyTorch improve code readability and maintainability compared to TensorFlow for this task?
- RQ3How do optimization techniques like SGD with momentum affect model convergence and performance on keyword spotting models?
- RQ4To what extent can the reimplementation support real-world deployment through APIs and desktop applications?
- RQ5Can the reimplementation serve as a reliable baseline for future research in on-device keyword spotting?
Key findings
- The PyTorch reimplementation achieved a test accuracy of 90.2% ± 0.515 for the full model when training with momentum, closely matching the TensorFlow baseline.
- The compact model reached 78.4% ± 0.631 accuracy with momentum training, slightly outperforming the original TensorFlow implementation (77.4% ± 0.839).
- The confidence intervals of the PyTorch and TensorFlow implementations overlapped, indicating statistical equivalence in performance.
- The full model converged in approximately 30 epochs, while the compact model required around 55 epochs for optimal performance.
- The implementation successfully supports deployment via a RESTful API and a desktop application, enabling real-time on-device keyword spotting.
- The codebase includes utilities for data collection, model testing, and caching, enhancing reproducibility and extensibility for future research.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.