TL;DR
Convolutional Neural Networks (CNNs) often perform redundant calculations on similar input data or activation maps, a phenomenon known as "transient redundancy." This paper introduces TREC, a novel convolution operator that dynamically detects and skips these redundant computations using Locality-Sensitive Hashing (LSH) built directly into the network's forward and backward passes. By doing so, TREC achieves a 3.51× average speedup on microcontrollers with less than 1% accuracy loss.
The Challenge of Edge Deployment
Deploying CNNs on edge devices, like microcontrollers (MCUs) with severely limited memory (e.g., 2MB), is incredibly challenging due to the intensive computational requirements of convolution operations.
To speed up inference, researchers typically compress models by removing lasting redundancy—static weights that can be pruned or quantized offline. However, there is another type of waste called transient redundancy. This occurs dynamically during inference when an image or activation map contains highly similar spatial patches (e.g., a large area of blue sky or a blank wall).
Previous attempts to remove transient redundancy (like the "Deep Reuse" method) relied on ad-hoc, offline clustering outside the neural network pipeline. Because the network couldn't adapt to the clustering errors during training, these methods caused unstable inference and significant accuracy drops (up to 5% fluctuations between runs). This paper seeks to solve that instability by making transient redundancy elimination a native, differentiable part of the CNN architecture.
Methods: Introducing TREC
The authors propose TREC (Transient Redundancy Elimination-based Convolution) as a drop-in replacement for standard Im2col + GEMM convolutional layers.
The Forward Pass: LSH and Recovery
In the forward pass, TREC slices the input matrix and applies Locality-Sensitive Hashing (LSH) to group similar vectors into clusters. It then computes the convolution only on the cluster centroids. Finally, a recovery step broadcasts the computed results back to the original output shape, drastically reducing the number of matrix multiplications required.
The Backward Pass: Making LSH Differentiable
The core technical novelty lies in the backward pass. Standard LSH relies on discrete, non-differentiable steps (like binary mapping), which breaks backpropagation. To fix this, TREC introduces:
- Binary Approximation: Replaces harsh step functions with a smooth, parameterized Sigmoid function.
- Bindec Conversion: Uses a custom transformation matrix and an impulse-like Gaussian function to map vectors to their cluster IDs differentiably.
- Dynamic Parameter Setting: To prevent gradient explosion during training, the width of the Gaussian function ($\sigma$) is dynamically scaled based on the number of hash functions ($H$).
Datasets and Evaluation
The models were trained and evaluated on CIFAR-10 and a downsampled version of ImageNet (64×64). The downsampled ImageNet was used specifically for ResNet-34, as standard high-resolution ImageNet images would cause the microcontroller to run out of memory. The evaluated networks included CifarNet, ZfNet, SqueezeNet (with and without complex bypass), and ResNet-34.
Key Insights
- End-to-End Integration is Crucial: By making the clustering step differentiable, the network actually learns to compensate for the slight errors introduced by grouping similar (but not identical) patches together. This is why TREC is vastly more stable than prior ad-hoc methods.
- Dynamic Gradients Prevent Explosions: Hardcoding the width of the Gaussian approximation function leads to gradient explosions as the number of hash functions increases. Dynamically bounding this parameter ensures stable convergence.
- Complementary to Pruning: TREC targets transient redundancy, meaning it stacks perfectly with techniques that target lasting redundancy. For example, TREC was successfully applied to a ZfNet model that had already been heavily channel-pruned to fit on an MCU.
- Theoretical Guarantees: The authors mathematically prove that TREC-equipped CNNs maintain the same robustness (Lipschitz constant) as standard CNNs and are guaranteed to converge during training.
Results
- Computation Reduction: TREC successfully detects and removes over 96% of transient redundancy computations in single convolutional layers.
- Speedup: It achieves an average single-layer speedup of 4.40× (peaking at 18.66× on SqueezeNet expand layers). End-to-end network inference on an STM32 microcontroller speeds up by an average of 3.51×.
- Accuracy: TREC incurs a minimal average accuracy loss of just ~0.7%. Compared to the prior state-of-the-art (Deep Reuse), TREC reduces accuracy loss by up to 84% and entirely eliminates wild run-to-run performance fluctuations.
Limitations and Future Work
The authors note that this study specifically focuses on spatial transient redundancy within Convolutional Neural Networks (CNNs). However, transient redundancy likely exists in other types of neural network architectures (such as Transformers or RNNs) and in other modalities (like temporal redundancy in video or audio). Exploring TREC-like operators for these alternative architectures and data types is left as a promising direction for future work.
Summary updated