Abstract
Deep Neural Networks (DNNs) are computationally intensive, making deployment on edge devices challenging. While network pruning offers a solution, determining optimal pruning ratios for each layer is difficult, especially in complex architectures with non-linear topologies. We introduce AGMC (Auto Graph encoder-decoder Model Compression), a framework that models DNNs as computational graphs. AGMC leverages Graph Convolutional Networks (GCNs) to learn structural embeddings and a Reinforcement Learning (RL) agent to automate pruning decisions. Our approach outperforms existing handcrafted and AutoML methods, maintaining higher accuracy under aggressive FLOPs constraints.
Introduction
The deployment of Deep Neural Networks (DNNs) on resource-constrained edge devices requires significant model compression. Network pruning, which removes redundant channels, is a primary technique for acceleration. However, finding the "Goldilocks" pruning ratio for each layer—balancing speed and accuracy—remains a challenge. Traditional manual heuristics and recent AutoML approaches often treat layers as isolated entities, using handcrafted features like layer index or kernel size. These methods fail to account for the structural topology of the network, such as residual connections in ResNets, which are critical for understanding inter-layer dependencies and redundancy.
The AGMC Framework
AGMC addresses these limitations by treating the DNN as a computational graph. The framework consists of a specialized encoder-decoder architecture integrated with a Reinforcement Learning agent.
1. Simplified Graph Representation
To manage complexity, AGMC groups low-level operations into "primitive" nodes (e.g., a combination of Convolution, ReLU, and Batch Normalization). This abstraction allows the model to focus on high-level architectural patterns rather than individual operations.
2. Graph Encoder-Decoder
The core of AGMC is its ability to learn from the network's structure:
- Encoder: A two-layer GCN processes the computational graph to generate a global embedding ($g$) that captures the entire network's topology.
- Decoder: An LSTM unrolls this global embedding into a sequence of hidden state vectors ($s_t$), one for each layer. This ensures that the state representation for any given layer is informed by the global context of the network.
3. RL Agent and Action Rescaling
A Deep Deterministic Policy Gradient (DDPG) agent uses these learned embeddings to predict continuous pruning ratios. To ensure the agent adheres to a specific computational budget (e.g., 50% FLOPs reduction), an action rescaling algorithm adjusts the predicted ratios dynamically.
Experimental Results
The authors evaluated AGMC on CIFAR-10/100 and ImageNet datasets using various architectures, including ResNet, VGG-16, and MobileNet.
As shown in the results, AGMC consistently achieves superior performance:
- ResNet-56: At a 50% FLOPs reduction, AGMC maintains 92.76% accuracy, significantly outperforming the popular AMC method (90.2%).
- VGG-16: On ImageNet, AGMC achieves 70.35% accuracy at 20% FLOPs, a substantial improvement over handcrafted methods like FP (55.9%) or RNP (66.92%).
- Efficiency: The RL search process is highly efficient, taking only 5 minutes for a ResNet-56 model on a single GPU.
Discussion
A key insight from this work is that structure is a feature. By learning embeddings directly from the graph, AGMC avoids the limitations of handcrafted features. Experiments showed that these learned graph embeddings resulted in a 2x lower error rate compared to the feature sets used in previous state-of-the-art methods. Furthermore, the graph encoder demonstrates strong generalizability; an encoder trained on ResNet-56 can be effectively transferred to ResNet-20 with minimal fine-tuning, suggesting it learns fundamental structural rules.
Conclusion
AGMC demonstrates that automating model compression through graph-based learning is both effective and efficient. By capturing the structural dependencies of DNNs, it finds more stable and accurate pruning strategies than previous methods. Future work may involve automating the initial graph simplification step and extending the framework to non-structured pruning or other architectures like Transformers.
Summary updated