Deep Geometric Knowledge Distillation with Graphs

Carlos Lassance, Myriam Bontonou, Ghouthi Boukli Hacene, Vincent Gripon, Jian Tang, Antonio Ortega

Introduction

Deep Neural Networks (DNNs) have achieved remarkable success across various domains, yet their deployment on resource-constrained devices remains a challenge due to their immense size and computational requirements. Knowledge Distillation (KD) has emerged as a primary technique to address this, where a compact "student" network is trained to mimic the behavior of a high-performance "teacher" network.

Traditional KD methods, often referred to as Individual KD, typically require the student and teacher to share identical internal dimensions to facilitate direct feature map comparison. This constraint significantly limits the flexibility of network design, particularly when attempting to reduce the width of the student model. While Relational Knowledge Distillation (RKD) offers a solution by focusing on the relative distances between data points rather than absolute coordinates, it remains sensitive to outliers and often fails to capture the intricate local geometric structures of the latent space.

Methodology: Graph Knowledge Distillation (GKD)

This paper introduces Graph Knowledge Distillation (GKD), a novel approach that leverages graph theory to transfer geometric understanding. Instead of comparing raw distances, GKD represents a batch of training examples as nodes in a similarity graph.

The GKD Pipeline

  1. Graph Construction: For each layer, a $k$-nearest neighbor ($k$-NN) similarity graph is constructed. The edge weights between images are determined by their cosine similarity, reflecting how the network perceives their relationship.
  2. Normalization: A critical innovation in GKD is the use of a normalized adjacency matrix ($A = D^{-1/2}WD^{-1/2}$). Drawing from Graph Signal Processing, this step ensures that the distillation loss is not dominated by a few outlier pairs, promoting more stable learning.
  3. Loss Function: The student is trained to minimize the squared Frobenius norm between its normalized adjacency matrix and that of the teacher. This encourages the student to replicate the teacher's internal "clustering" logic.

Geometric Variations

The authors explored several refinements to the graph structure:

  • Locality: Restricting the graph to the $k$ closest neighbors.
  • Higher Order: Examining multi-hop relationships via powers of the adjacency matrix.
  • Task Specificity: Focusing on the "margin" between different classes to emphasize decision boundaries.

Key Insights and Ideas

Geometry Over Coordinates

The fundamental premise of GKD is that the exact numerical values in a feature map are less important than the relational structure they define. If a teacher model identifies two images as similar, the student should maintain that relationship, regardless of the difference in their internal vector dimensions.

The Importance of Consistency

Beyond raw accuracy, GKD improves the logical alignment between models. As shown in the consistency analysis, GKD students exhibit a significantly higher degree of alignment with the teacher's internal classification logic compared to previous RKD methods.

Consistency of GKD vs RKD-D across block depths

Local Knowledge is Key

Empirical results suggest that the most valuable knowledge resides in local structures. The best performance was achieved with small values of $k$ (e.g., $k=5$), indicating that learning how a teacher distinguishes between highly similar items is more beneficial than learning relationships between disparate objects.

Key Results

The researchers evaluated GKD using CIFAR-10 and CIFAR-100 benchmarks, employing a WideResNet28-1 as the teacher and a WideResNet28-0.5 (possessing only ~27% of the parameters) as the student.

Performance comparison on CIFAR datasets

As detailed in the results table, GKD consistently outperforms both the vanilla baseline and the previous state-of-the-art RKD-D method. On CIFAR-10, GKD achieved a 9.70% error rate, a notable improvement over the 10.26% baseline and 10.06% for RKD-D. Furthermore, when the graph was restricted to focus on the "margin" between different classes, the error rate was further reduced to 9.54%.

Conclusion and Future Work

GKD demonstrates that representing data relationships as normalized graphs provides a robust and dimension-agnostic framework for knowledge distillation. While highly effective on CIFAR benchmarks, future research is needed to determine how these geometric techniques scale to larger datasets like ImageNet and more complex tasks such as object detection. Additionally, exploring alternative graph metrics, such as diffusion distances, may further enhance the capture of complex manifold structures in latent space.

Summary updated

BibTeX
@inproceedings{lassance2019deep,
  author = {Carlos Lassance and Myriam Bontonou and Ghouthi Boukli Hacene and Vincent Gripon and Jian Tang and Antonio Ortega},
  title = {{Deep Geometric Knowledge Distillation with Graphs}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2019},
  doi = {10.1109/icassp40776.2020.9053986},
}
Figure