Abstract
DEBUG-HD is a resource-efficient, on-device debugging framework for TinyML that identifies input corruptions (e.g., noise, blur, or sensor shifts) using Hyper-Dimensional Computing (HDC). By replacing standard random projection matrices with a novel MLP-assisted encoding, it achieves a 27% accuracy boost over prior binary HDC methods. This makes on-chip diagnostics viable for KB-sized devices, providing developers with a root-cause analysis tool that respects privacy and operates without cloud connectivity.
Introduction
TinyML models, typically deployed on milliwatt-powered microcontrollers, often operate in "the wild"—remote areas, industrial settings, or within medical wearables. These environments are inherently unpredictable; a camera lens might become smudged, or a microphone might encounter unexpected wind noise. When such "input corruptions" occur, model accuracy can plummet, yet standard debugging is often impossible due to three main factors:
- Connectivity: Devices frequently lack the bandwidth or cloud access to return data for analysis.
- Privacy: Transmitting raw sensor data (audio, images) often violates strict privacy regulations.
- Safety: In real-time applications like autonomous navigation, the system cannot be paused for external debugging.
DEBUG-HD addresses this gap by providing a local, on-device diagnostic tool that identifies what changed in the input to cause a failure.
Methodology: MLP-assisted Encoding
The researchers leverage Hyper-Dimensional Computing (HDC), a paradigm that represents data as massive vectors (hypervectors) and utilizes simple bitwise operations like XOR and bundling. While traditional HDC relies on random projection matrices, this approach fails at the lower dimensions (<1,000) required for the memory constraints of TinyML devices because the vectors lose their necessary orthogonality.
DEBUG-HD introduces a novel MLP-assisted encoding scheme to overcome this limitation:
- Learned Projection: Instead of a random matrix, a simple 2-layer Multi-Layer Perceptron (MLP) is trained on the training data to learn a more discriminative mapping.
- Binarization: The weights from the MLP's hidden layer are passed through a sign function (
sgn()) to create a binary projection matrix, ensuring hardware efficiency. - Diagnostic Sidecar: The HDC classifier acts as a "sidecar" that remains dormant until an on-device monitor detects a drop in accuracy. Once activated, it classifies the current input into a specific corruption type (e.g., "50% Gaussian Noise").
Experimental Evaluation
The framework was evaluated on three primary tasks: SpeechCmd (audio keyword spotting), CIFAR10 (image classification), and TinyImageNet (200-class image classification). To simulate real-world failures, the authors used Corrupted-in-Distribution (CID) versions of these datasets, including 19 types of image corruptions and 11 audio-specific corruptions like air absorption and time stretching.
Results and Discussion
DEBUG-HD demonstrates a significant leap in performance over existing binary HDC methods, achieving an average accuracy boost of 27%.
Key insights from the results include:
- Efficiency vs. Accuracy: DEBUG-HD achieved 12% higher accuracy than the best-performing prior work while maintaining a tiny memory footprint. As shown in Figure 3(b), the HDC model is significantly smaller than the base neural networks it monitors.
- Diagnostic Utility: While Top-1 accuracy for specific corruptions was modest (e.g., 68% on CIFAR10), the Top-3 accuracy reached 95%. This is highly valuable for developers, as it narrows down the root cause of a failure to a very small set of possibilities.
- The Similarity Ceiling: The authors noted that some corruptions (like "defocus blur" vs. "gaussian blur") are visually so similar that they represent an intrinsic limit for any on-device debugger, a finding supported by Structural Similarity Index (SSIM) analysis.
Conclusion
DEBUG-HD proves that HDC is exceptionally well-suited as a diagnostic instrument—a lightweight specialist that identifies data shifts rather than a general-purpose classifier. While it is slightly outperformed by full, non-binarized MLPs, the trade-off for extreme energy efficiency and low memory overhead makes it a viable addition to existing TinyML pipelines. Future work will explore feature engineering to better separate "look-alike" data shifts and minimize overhead for the simplest of base models.
Summary updated