Knowledge Projection for Deep Neural Networks

Zhi Zhang, Guanghan Ning, Zhihai HearXiv 2017

TL;DR

This paper introduces Knowledge Projection Network (KPN), a novel framework that transfers knowledge from a large, pre-trained "teacher" network to a smaller, faster "student" network. KPN significantly reduces computational complexity and the need for large labeled datasets, achieving competitive accuracy by projecting learned representations from the teacher to guide the student's training.

What Problem Does This Paper Address?

Modern deep neural networks (DNNs) achieve impressive performance on various tasks, but they come with significant drawbacks: they require massive amounts of labeled data for effective training and are computationally very expensive, making them impractical for resource-constrained environments like mobile devices or real-time applications. This paper tackles two intertwined problems: the need for efficient, low-complexity models and the challenge of training effectively with limited labeled data, especially when adapting to new domains. Existing methods often address these issues separately, leading to suboptimal solutions.

Methods

The core of the KPN framework is Knowledge Projection. A large, pre-trained "teacher" network (trained on a large dataset) observes the training data. A learned projection matrix (implemented as a convolutional layer) maps features from an intermediate layer of the teacher network to an intermediate "injection" layer in a thinner, faster "student" network. This projected knowledge acts as a guide, regularizing the student's training process.

Key aspects of the method include:

  • Teacher-Student Architecture: The student network uses similar building blocks as the teacher but is designed to be thinner (fewer channels) and potentially deeper to reduce computational cost while retaining representation power. Bottleneck structures (squeeze-then-expand) are employed to further reduce channel redundancy.
  • Knowledge Projection Layer: This layer bridges the teacher and student, learning to project relevant features. It's implemented as a 1x1 convolutional layer, offering computational efficiency and preserving spatial consistency.
  • Joint Loss Function: The student network is trained using a combination of a problem-specific loss (e.g., cross-entropy) and a knowledge projection loss, which penalizes deviations from the teacher's guidance.
  • Iterative Pruning for Route Selection: A crucial innovation is an iterative process to automatically select the optimal "route" for knowledge projection – i.e., which specific intermediate layer in the teacher to use as the knowledge source and which layer in the student to inject it into. This involves training multiple KPN configurations and pruning the less effective ones.
  • Multi-Path Multi-Stage Training: The training is divided into an initialization stage (where the student learns to adapt to the teacher's guidance without direct access to the target labels) and a joint training stage (where both the knowledge projection and problem-specific losses are minimized).

Datasets

The paper evaluates KPN on several benchmark datasets, often using a large dataset for training the teacher network and a smaller, related dataset for training the student network.

  • CIFAR-10 and CIFAR-100: Used to demonstrate KPN's effectiveness in transferring knowledge from a teacher trained on CIFAR-100 to a student trained on CIFAR-10.
  • ImageNet and MS COCO: Mentioned as examples of large datasets used for training powerful teacher networks.
  • PASCAL VOC 07: Used with a VGG-16 teacher pre-trained on ImageNet to evaluate performance on object classification with reduced training data.
  • MNIST and Omniglot: Used to test KPN's performance on very small and challenging handwritten character recognition tasks.

Key Insights and Ideas

  • Knowledge Projection as a Regularizer: The core idea is that knowledge from a well-trained, large network can act as a powerful regularizer for a smaller network, preventing overfitting and guiding it towards better representations, especially when labeled data is scarce.
  • Bridging Domain Adaptation and Model Compression: KPN elegantly addresses both domain adaptation (learning on a new dataset/domain) and model compression (creating smaller, faster models) simultaneously, which are often treated as separate problems.
  • Automatic Route Selection is Crucial: The iterative pruning mechanism for selecting the knowledge projection route is vital. It suggests that not all layers are equally good sources or targets for knowledge transfer, and an automated search can find optimal pairings.
  • Middle Layers are Often Best for Projection: The iterative pruning analysis indicates that projection routes involving intermediate layers (neither too shallow nor too deep) tend to yield better results, suggesting a balance between low-level features and task-specific information.
  • Robustness to Data Scarcity: KPN demonstrates strong performance even when the student network is trained on very small subsets of data, highlighting its ability to leverage pre-existing knowledge effectively.

Key Results

KPN demonstrates significant improvements in both accuracy and efficiency:

  • Accuracy Improvement: KPN achieved up to a 4% improvement in accuracy compared to existing methods on benchmark datasets.
  • Complexity Reduction: The framework reduced network complexity by 4 to 10 times, with some student networks being up to 34 times faster than the teacher network while using less than 2% of its parameters.
  • CIFAR-10: Achieved 92.37% accuracy with 0.27M parameters and 31M MACs, outperforming standard training and fine-tuning methods, especially with reduced training samples.
  • PASCAL VOC 07: Achieved 91.2% accuracy with 8M parameters and 3361M MACs, outperforming standard training and fine-tuning by a large margin, reducing model size by 2x, and improving inference speed by 4.6x.
  • Omniglot: Showed strong robustness against aggressive reduction of labeled training samples, achieving competitive error rates.

Limitations and Future Work

  • Teacher Network Dependency: The performance of KPN is inherently dependent on the quality and relevance of the pre-trained teacher network.
  • Computational Cost of Pruning: The iterative pruning process, while effective, adds computational overhead during the training phase.
  • Future Work: The authors suggest extending KPN to other computer vision tasks like object detection, segmentation, and pose estimation by adapting the loss function. They also propose using KPN as a building block in traditional model compression techniques and exploring its benefits on large networks and datasets where speed is not the primary concern but performance is paramount.

Summary updated

BibTeX
@misc{zhang2017knowledge,
  author = {Zhi Zhang and Guanghan Ning and Zhihai He},
  title = {{Knowledge Projection for Deep Neural Networks}},
  year = {2017},
  eprint = {1710.09505},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1710.09505},
}
Figure