Abstract
Convolutional neural networks (CNN) are increasingly used in many areas of computer vision. They are particularly attractive because of their ability to "absorb" great quantities of labeled data through millions of parameters. However, as model sizes increase, so do the storage and memory requirements of the classifiers. We present a novel network architecture, Frequency-Sensitive Hashed Nets (FreshNets), which exploits inherent redundancy in both convolutional layers and fully-connected layers of a deep learning model, leading to dramatic savings in memory and storage consumption. Based on the key observation that the weights of learned convolutional filters are typically smooth and low-frequency, we first convert filter weights to the frequency domain with a discrete cosine transform (DCT) and use a low-cost hash function to randomly group frequency parameters into hash buckets. All parameters assigned the same hash bucket share a single value learned with standard back-propagation. To further reduce model size we allocate fewer hash buckets to high-frequency components, which are generally less important. We evaluate FreshNets on eight data sets, and show that it leads to drastically better compressed performance than several relevant baselines.
Introduction
As deep learning models grow in complexity, their memory and storage footprints have exploded—the 2014 ImageNet winner, for instance, required over 500MB of parameters. This creates a "disjunction" between state-of-the-art AI and the hardware reality of mobile devices, which often have strict RAM limits (like the 1GB found in the iPhone 6 at the time of publication).
Existing compression methods, such as low-rank decomposition or simple weight hashing in the spatial domain, often ignore a fundamental property of CNNs: spatial locality. Convolutional filters are typically "smooth," meaning nearby pixels are highly correlated. Compressing these filters in the spatial domain often introduces "noise" or "chatter" that destroys this smoothness, leading to a sharp drop in model performance.
Methods
The authors introduce FreshNets, which combines two key concepts: the Hashing Trick and the Discrete Cosine Transform (DCT).
- Frequency Domain Mapping: Instead of learning weights in the spatial domain, FreshNets converts filters to the frequency domain using DCT. Because natural images and learned filters are generally smooth, most of the "energy" (and information) is concentrated in the low-frequency components.
- Random Weight Sharing: To reduce the number of parameters, the authors use a hash function to group multiple frequency parameters into "buckets." All parameters in a bucket share a single learned value.
- Frequency-Sensitive Hashing: This is the core innovation. Not all frequencies are equally important. FreshNets allocates more hash buckets (and thus more unique parameters) to low-frequency components and fewer buckets to high-frequency ones. This ensures that the most critical parts of the filter are preserved with high fidelity, while less important details are aggressively compressed.
- Training: The model is trained using standard backpropagation. The gradient for a single hash bucket value is simply the sum of the gradients of all frequency components assigned to that bucket.
Datasets
The researchers evaluated FreshNets across eight image classification benchmarks:
- Standard Benchmarks: CIFAR-10, CIFAR-100, and SVHN (Street View House Numbers).
- MNIST Variants: Five challenging versions of MNIST designed to test robustness, including rotated digits (ROT), background noise (BG-RAND), and background images (BG-IMG).
Key Insights and Ideas
- The "Smoothness" Priority: The "aha moment" is realizing that convolutional filters are essentially low-pass filters. By compressing in the frequency domain, you are effectively performing a "smart" blur rather than adding random spatial noise.
- Independence from Filter Count: A compelling property of this approach is that the number of parameters can be made independent of the number of convolutional filters. You can increase the "width" of your network (more filters) without necessarily increasing the storage cost, provided you are willing to accept more hash collisions.
- Visual Preservation: Visualizing the filters reveals that FreshNets filters remain recognizable and smooth even when compressed 16x, whereas spatial hashing (HashedNets) results in chaotic, noisy filters that lose their feature-detecting capabilities.
Key Results
FreshNets consistently outperformed baselines like Low-Rank Decomposition (LRD) and standard HashedNets, especially as compression became more aggressive.
- CIFAR-10: At 1/64 compression (shrinking the model by 64x), FreshNets achieved a 30.79% error rate, significantly better than LRD (34.35%) and spatial HashedNets (43.08%).
- Robustness: On the MNIST-ROT (rotated) dataset at 1/16 compression, FreshNets maintained a 3.87% error rate, nearly matching the uncompressed CNN (3.42%), while other compression methods saw error rates jump much higher.
- Parameter Efficiency: The authors demonstrated that by using a Beta distribution to allocate hash buckets, they could mathematically optimize the trade-off between low and high-frequency preservation.
Limitations and Future Work
- Computational Overhead: While FreshNets reduces storage and memory for weights, it introduces the need for an inverse DCT (IDCT) transformation during the forward pass to reconstruct the filters. The authors note this is a "low-cost" operation, but in extremely latency-sensitive environments, this extra step must be accounted for.
- Fixed Frequency Bands: The current implementation partitions frequencies into bands based on the sum of their indices ($j_1 + j_2$). Future work could explore more sophisticated, data-driven ways to determine which frequency components deserve the most "hash budget."
- Quantization Synergy: The paper focuses on reducing the number of parameters. The authors suggest that combining this with reduced bit-precision (quantization) could lead to even more extreme compression levels.
Summary updated