On the Efficiency of Subclass Knowledge Distillation in Classification Tasks

Ahmad Sajedi, Konstantinos N. PlataniotisarXiv 2021

TL;DR

This paper introduces Subclass Knowledge Distillation (SKD), a novel method to improve knowledge distillation by leveraging information about subclasses within broader classes. SKD allows a smaller student model to learn richer, fine-grained features from a larger teacher model, leading to significant performance gains, especially in tasks with few classes.

What Problem Does This Paper Address?

Knowledge distillation (KD) is a powerful technique for compressing large neural networks into smaller, more efficient ones. However, its effectiveness is limited in classification tasks with a small number of classes or binary detection. In such scenarios, the information transferred from the teacher to the student is restricted, hindering the student's ability to generalize. This paper addresses this limitation by proposing a method that utilizes "subclass" information – finer-grained categories within the main classes – to enrich the knowledge transfer process. This is particularly relevant in domains like medical imaging, where classes might have subtle variations that can be categorized as subclasses, offering valuable insights not present in the main class labels alone.

Methods

The core of this paper is the Subclass Knowledge Distillation (SKD) framework. Unlike traditional KD, which focuses on transferring the teacher's final class predictions (logits), SKD leverages the teacher's predictions on known subclasses. The process involves:

  1. Teacher Training: The teacher model is trained not only on the main class labels but also on the subclass labels. This allows it to learn more detailed features.
  2. Subclass Prediction Transfer: The student model is trained to mimic the teacher's subclass predictions. This is achieved by minimizing the Kullback-Leibler (KL) divergence between the student's and teacher's subclass probability distributions.
  3. Combined Loss: The student's training objective is a linear combination of the standard cross-entropy loss (for class labels) and the SKD loss (for subclass labels).

The authors also provide a theoretical analysis using information theory to quantify the amount of "label information bits" a teacher can transfer to a student, both in general multiclass settings and specifically for binary detection tasks. They derive upper bounds on this information transfer, demonstrating how subclass knowledge can increase it.

Datasets

The primary dataset used for evaluation is the Minimalistic HIStopathology (MHIST) dataset. This dataset focuses on the binary classification of colorectal polyps into Hyperplastic Polyps (HPs) and Sessile Serrated Adenomas (SSAs). The MHIST dataset is notable because it includes clinician-provided annotations that define subclasses based on the variability of label difficulty (e.g., "very easy," "easy," "hard," "very hard"). This allows for the creation of various subclass classification tasks (SL-21, SL-41, SL-22, SL-12, SL-14) to test the SKD framework.

Key Insights and Ideas

  • Subclasses as a Richer Source of Information: The paper highlights that subclass information, often overlooked, contains valuable "dark knowledge" about intra-class similarities and fine-grained features that can significantly boost model performance.
  • Bridging the Gap in Low-Class Scenarios: SKD is particularly effective when the number of main classes is small, a scenario where traditional KD struggles due to limited information transfer.
  • Information-Theoretic Quantification: The use of information theory to measure the "label information bits" transferred provides a rigorous way to understand why SKD is effective and how much additional knowledge is being conveyed.
  • Curriculum Learning Analogy: The use of clinician-annotated difficulty levels to define subclasses mirrors a curriculum learning approach, where the student learns progressively more detailed information.

Key Results

  • Performance Improvement: In the colorectal polyp classification task (SL-12), a student model trained with SKD achieved an F1-score of 85.05%. This represents an improvement of 2.14% over a student trained without any distillation and 1.49% over a student trained with conventional KD.
  • Increased Information Transfer: The study quantifies that SKD can provide an additional 0.4656 label bits per training sample compared to conventional KD, directly contributing to the performance gains.
  • Computational Efficiency: The SKD-trained student model is significantly more computationally efficient than the teacher (6x fewer FLOPs) while maintaining comparable inference times.
  • Generalization: The normalized confusion matrices show that SKD leads to a more accurate classification, with the student model exhibiting improved discrimination between subclasses and, consequently, better performance on the main class labels.

Limitations and Future Work

  • Dataset Specificity: While evaluated on a clinical dataset, the authors suggest that SKD's effectiveness might vary across different domains and dataset characteristics.
  • Theoretical Bounds: The paper derives upper bounds for label information transfer. Future work could focus on investigating the tightness of these bounds and developing methods to achieve them.
  • Experimental Validation: The authors propose extending the experimental evaluation of SKD to more diverse datasets to further validate its generalizability.
  • Theoretical Extensions: Exploring theoretical extensions, such as handling unbalanced subclass distributions or more complex class hierarchies, is also suggested.

Summary updated

Abstract

This work introduces a novel knowledge distillation framework for classification tasks where information on existing subclasses is available and taken into consideration. In classification tasks with a small number of classes or binary detection (two classes) the amount of information transferred from the teacher to the student network is restricted, thus limiting the utility of knowledge distillation. Performance can be improved by leveraging information about possible subclasses within the available classes in the classification task. To that end, we propose the so-called Subclass Knowledge Distillation (SKD) framework, which is the process of transferring the subclasses' prediction knowledge from a large teacher model into a smaller student one. Through SKD, additional meaningful information which is not in the teacher's class logits but exists in subclasses (e.g., similarities inside classes) will be conveyed to the student and boost its performance. Mathematically, we measure how many extra information bits the teacher can provide for the student via SKD framework. The framework developed is evaluated in clinical application, namely colorectal polyp binary classification. In this application, clinician-provided annotations are used to define subclasses based on the annotation label's variability in a curriculum style of learning. A lightweight, low complexity student trained with the proposed framework achieves an F1-score of 85.05%, an improvement of 2.14% and 1.49% gain over the student that trains without and with conventional knowledge distillation, respectively. These results show that the extra subclasses' knowledge (i.e., 0.4656 label bits per training sample in our experiment) can provide more information about the teacher generalization, and therefore SKD can benefit from using more information to increase the student performance.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
MHIST · colorectal polyp binary classificationTeacher in SubclassLevel-12 (SL-12; SKD task)Total label information bits/sample (upper bound)1.3019 bits/sampleImage Classification · split: train · subclasses=12 · label-level=subclass-level
Source quote
L249: {SubclassLevel-12} │ 1.3019
Reported baseline / comparator measurements (1)
BenchmarkMethodMetricScoreProtocol / Evidence
MHIST · colorectal polyp binary classificationTeacher in ClassLevel-11 (CL-11; class-only task) baselineTotal label information bits/sample (upper bound)0.8363 bits/sampleImage Classification · split: train · classes=11 · label-level=class-level
Source quote
L245: {ClassLevel-11} │ 0.8363
BibTeX
@misc{sajedi2021efficiency,
  author = {Ahmad Sajedi and Konstantinos N. Plataniotis},
  title = {{On the Efficiency of Subclass Knowledge Distillation in Classification Tasks}},
  year = {2021},
  eprint = {2109.05587},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.05587},
}
Figure