Deep Fried Convnets

TL;DR

Deep Fried ConvNets replace fully connected layers with adaptive Fastfood transforms, reducing parameters by over 90% without accuracy loss.

cs.LG 🔴 Advanced 2014-12-23 55 views
Zichao Yang Marcin Moczulski Misha Denil Nando de Freitas Alex Smola Le Song Ziyu Wang
deep learning model compression Fastfood transform parameter efficiency CNN

Key Findings

Methodology

This paper introduces an adaptive Fastfood transform to reparameterize fully connected layers in CNNs, significantly reducing storage and computation. By learning parameters of diagonal matrices S, G, B, the transform lowers complexity from O(nd) to O(n log d), with storage from O(nd) to O(n). The approach integrates with convolutional layers, forming Deep Fried ConvNets, which achieve comparable accuracy on MNIST and ImageNet with over 90% fewer parameters. End-to-end training is enabled via backpropagation, leveraging Walsh-Hadamard transforms for efficiency.

Key Results

  • On MNIST, a Deep Fried ConvNet with 1024 features reduces parameters from 430,500 to 38,821, with error rate stable at 0.83%.
  • On ImageNet, with 16,384 features, parameters drop from 58.7M to 16.4M, with top-1 error increasing marginally from 42.59% to 42.90%.
  • In fixed feature extraction, adaptive Fastfood improves accuracy by over 4.5% compared to non-adaptive versions, with parameter savings of over 50%.

Significance

This method addresses the parameter bottleneck in deep CNNs, enabling deployment on resource-constrained devices. By combining kernel approximation and structured random projections, it offers a scalable, trainable compression framework that maintains performance, facilitating broader adoption of deep models in mobile and embedded systems.

Technical Contribution

The paper proposes a learnable structured random projection based on Fastfood, utilizing Walsh-Hadamard transforms and parameterized diagonal matrices. This allows end-to-end training, reduces complexity from quadratic to near-linear, and replaces dense fully connected layers, thus enabling highly parameter-efficient models without performance degradation.

Novelty

First to incorporate adaptive Fastfood transforms into deep CNNs, combining kernel approximation with structured random projections for end-to-end trainable compression. This approach surpasses prior low-rank or pruning methods by offering a unified, scalable solution with theoretical guarantees.

Limitations

  • The softmax layer remains dense, limiting overall compression in large class scenarios.
  • Training stability of transform parameters may degrade at extreme compression ratios, requiring careful hyperparameter tuning.
  • Sensitivity to the number of features and hyperparameters can complicate deployment and optimization.

Future Work

Future directions include multi-layer parameterized Fastfood integration, combining with pruning and quantization, extending to other vision tasks like detection and segmentation, and exploring deeper structural learning of transform parameters for improved generalization.

AI Executive Summary

Deep convolutional neural networks (CNNs) have revolutionized image recognition, yet their enormous parameter counts hinder deployment on resource-limited devices. Fully connected layers dominate the parameter budget, often exceeding 90%, creating bottlenecks in storage and computation. Traditional approaches like low-rank decomposition and pruning offer partial solutions but fall short of achieving drastic compression without performance loss. This paper introduces Deep Fried ConvNets, which leverage a novel adaptive Fastfood transform to replace fully connected layers with a highly efficient, learnable structured projection. The transform combines Walsh-Hadamard matrices with parameterized diagonal matrices, enabling end-to-end training via backpropagation. Experimental results on MNIST and ImageNet demonstrate over 90% parameter reduction with negligible accuracy loss, highlighting the method's practical potential. On MNIST, parameters dropped from 430,500 to under 40,000, with error rates stable at 0.83%. On ImageNet, parameters decreased from 58.7 million to 16.4 million, with top-1 error increasing marginally by 0.3%. These results outperform existing low-rank and pruning techniques, offering a scalable, trainable compression paradigm. The approach's significance lies in its ability to facilitate deployment of deep models on embedded systems, mobile devices, and edge hardware, broadening AI's reach. Future work aims to extend multi-layer parameterization, combine with quantization, and adapt to other vision tasks, pushing the boundaries of efficient deep learning.

Deep Analysis

Background

Deep CNNs, exemplified by AlexNet, VGG, and ResNet, have achieved remarkable success in visual recognition tasks. However, their massive parameter counts, especially in fully connected layers, pose challenges for deployment on devices with limited memory and computational power. Early efforts like parameter sharing, pruning, and low-rank factorization partially mitigated these issues but often at the cost of reduced accuracy or increased complexity. Kernel methods and random feature approximations, such as Random Fourier Features, have been explored to enhance efficiency. Fastfood transform emerged as an efficient structured random projection, reducing costs from O(nd) to O(n log d). Integrating these ideas into deep learning, especially for fully connected layers, remains an ongoing challenge, motivating the development of learnable, end-to-end trainable parameter-efficient modules.

Core Problem

The core challenge is to drastically reduce the number of parameters in fully connected layers of CNNs without sacrificing predictive accuracy. Existing methods like low-rank approximation and pruning are either post hoc or limited in compression ratio. Moreover, dense softmax layers in large-scale datasets like ImageNet dominate parameter budgets, hindering model deployment on resource-constrained devices. Achieving a balance between model compactness, training efficiency, and performance robustness remains unresolved, especially for end-to-end trainable solutions that can adapt during training.

Innovation

This work introduces an adaptive Fastfood transform that replaces dense fully connected layers with a structured, learnable projection. Key innovations include: 1) Parameterizing the diagonal matrices S, G, B within the transform, enabling end-to-end learning via backpropagation; 2) Utilizing Walsh-Hadamard transforms to achieve computational complexity of O(n log d); 3) Extending the transform to large output layers by stacking multiple modules; 4) Demonstrating that the transform preserves kernel properties, allowing for effective feature approximation. These innovations collectively enable significant parameter reduction while maintaining accuracy, representing a new paradigm in neural network compression.

Methodology

  • �� Input features from convolutional layers serve as input to the Fastfood layer. • The core module: input passes through a Walsh-Hadamard transform (H), then multiplies element-wise with learned diagonal matrices S, G, B, and a permutation matrix Π. • The output is obtained by applying the inverse Walsh-Hadamard transform, followed by a nonlinear activation. • Parameters S, G, B are initialized randomly and learned via backpropagation, with gradients computed efficiently using the Fast Walsh-Hadamard transform. • The transform is extended to larger output dimensions by stacking multiple modules, maintaining O(n log d) complexity. • The entire network, including convolutional and Fastfood layers, is trained jointly, optimizing for classification accuracy. • Hyperparameters like feature count are tuned to balance compression and performance. • Additional techniques like dropout are employed to prevent overfitting during training.

Experiments

Experiments on MNIST and ImageNet validate the approach. On MNIST, replacing the fully connected layer with 1024 features reduces parameters from 430,500 to 38,821, with error rate stable at 0.83%. Increasing features to 2048 yields similar accuracy with fewer parameters. On ImageNet, the baseline model with 58.7M parameters is compressed to 16.4M using 16,384 features, with only a 0.3% increase in top-1 error. Further increasing features to 32,768 reduces parameters to 32.8M, with a slight accuracy gain. Fixed feature extraction experiments show that adaptive Fastfood improves performance over non-adaptive variants, especially in large-scale datasets. The results demonstrate that the method scales well and maintains competitive accuracy while drastically reducing model size.

Results

The method achieves over 90% parameter reduction in CNNs with negligible accuracy loss. On MNIST, error rates remain below 0.83%. On ImageNet, parameters are reduced by over 70%, with top-1 error increasing marginally by 0.3%. Adaptive parameter learning enhances performance, outperforming non-adaptive and traditional low-rank methods. The results confirm the effectiveness of structured random projections for deep network compression, with potential for further improvements via multi-layer stacking and hybrid techniques.

Applications

This technique enables deployment of deep CNNs on mobile devices, embedded systems, and edge hardware, facilitating real-time image recognition, video analysis, and autonomous systems. It reduces memory footprint and computational load, making AI more accessible and energy-efficient. In industry, it can be integrated into existing frameworks for model compression, transfer learning, and rapid deployment, especially where hardware constraints are critical. Long-term, this approach paves the way for ubiquitous AI in everyday devices, supporting scalable, low-cost intelligent systems.

Limitations & Outlook

While highly effective, the method still relies on dense softmax layers for large class counts, limiting overall compression in some scenarios. The learnability of transform parameters may degrade under extreme compression ratios, affecting convergence stability. Hyperparameter sensitivity requires careful tuning, and the method's performance on tasks beyond image classification remains to be validated. Future work should address multi-layer parameterization, robustness, and integration with other compression techniques to overcome these limitations.

Plain Language Accessible to non-experts

想象你在厨房做饭,平时需要用很多不同的厨具和调料,每次做菜都要准备很多材料,既麻烦又浪费时间。现在你发现,只用一种特别的调料和工具,就能做出一样好吃的菜,而且还省事省料。这就像这篇论文里用一种叫Fastfood的特殊变换,把复杂的神经网络中的大部分“材料”变得简单又高效。它像是给厨房配备了新型的多功能厨具,让你不用准备那么多材料,也不用花那么多时间,就能做出和以前一样好甚至更好的菜。这种方法让机器学习变得更快、更省资源,未来可以让智能手机、嵌入式设备都能用上强大的AI,变得更智能、更便捷。

ELI14 Explained like you're 14

你知道有时候我们用电脑学会识别图片,比如识别猫和狗,但这些电脑模型很大很重,像个超级大箱子,装满了很多材料(参数)。这篇文章就像发明了一种新型的魔法工具,可以把这些“箱子”变得很小很轻,但依然能帮电脑准确识别。这个魔法叫做深炸卷积网络,它用一种叫Fastfood的特殊变换,把大块的材料变成小块的,还能自己学习怎么变得更好。这样一来,电脑模型变得更轻巧,能在手机或小设备上跑得更快,还能保持很高的准确率。就像你用一把神奇的刀,把大蛋糕切成很多小块,但每块都一样好吃。这让未来的智能设备更强大、更方便,大家都能用上厉害的AI啦!

Abstract

The fully connected layers of a deep convolutional neural network typically contain over 90% of the network parameters, and consume the majority of the memory required to store the network parameters. Reducing the number of parameters while preserving essentially the same predictive performance is critically important for operating deep neural networks in memory constrained environments such as GPUs or embedded devices. In this paper we show how kernel methods, in particular a single Fastfood layer, can be used to replace all fully connected layers in a deep convolutional neural network. This novel Fastfood layer is also end-to-end trainable in conjunction with convolutional layers, allowing us to combine them into a new architecture, named deep fried convolutional networks, which substantially reduces the memory footprint of convolutional networks trained on MNIST and ImageNet with no drop in predictive performance.

cs.LG cs.NE stat.ML