Heterogeneous Graph-based Knowledge Transfer for Generalized Zero-shot Learning

Junjie Wang, Xiangfeng Wang, Bo Jin, Junchi Yan, Wenjie Zhang, Hongyuan Zha

TL;DR

This paper introduces HGKT (Heterogeneous Graph-based Knowledge Transfer), a novel framework for Generalized Zero-Shot Learning (GZSL) that remains completely agnostic to unseen classes during training. By representing classes as a structured graph and using Wasserstein barycenters to select representative nodes, the model leverages Graph Neural Networks (GNNs) to effectively transfer knowledge from seen to unseen categories, achieving state-of-the-art results on major benchmarks.

What Problem Does This Paper Address?

In Zero-Shot Learning (ZSL), a model must classify objects it has never seen during training (e.g., identifying a "zebra" after only seeing "horses" and "tigers"). Generalized ZSL (GZSL) is the more realistic—and difficult—version where the test set contains a mix of both seen and unseen classes.

Most existing GZSL methods suffer from two major flaws:

  1. Prior Knowledge Dependency: They often assume they know which unseen classes will appear later, which is unrealistic for dynamic, real-world applications.
  2. The Hubness Problem: When mapping visual features to a semantic "attribute" space, certain points (hubs) tend to become the nearest neighbors for almost everything, ruining classification accuracy.

Methods

The authors propose a Heterogeneous Graph-based Knowledge Transfer (HGKT) approach. The process is broken down into three main phases:

1. Graph Construction

The authors build a graph that captures two types of relationships:

  • Intra-class: Every instance within a seen class is connected to every other instance in that class (a "complete subgraph"). This forces the model to learn tight, cohesive clusters for each category.
  • Inter-class: To connect different classes, the authors select one "representative node" per class. Instead of just taking the average (Euclidean mean), they use the Wasserstein barycenter. This method better captures the underlying distribution of the class features. These representative nodes are then linked to their $k$-nearest neighbors.

2. Training (The GNN)

The model uses a two-layer Graph Neural Network (specifically a modified GraphSAGE).

  • Input: Class attribute vectors.
  • Target: Visual feature space. By mapping attributes into the visual space (rather than the other way around), the authors significantly mitigate the "hubness" problem.
  • Mechanism: The GNN learns how to aggregate information from a node's neighbors to produce a robust embedding.

3. Testing (Knowledge Transfer)

When a new, unseen class appears, the model looks at its attribute vector, finds its $k$-nearest seen classes, and uses the learned GNN functions to "predict" where that unseen class should sit in the visual feature space.

Datasets

The authors evaluated HGKT on five standard public benchmark datasets:

  • SUN (Scene Understanding)
  • CUB (Caltech-UCSD Birds-200-2011)
  • AwA1 & AwA2 (Animals with Attributes)
  • aPY (Attribute Pascal and Yahoo)

Key Insights and Ideas

  • Visual Space is Better: Mapping attributes to visual features is more effective than mapping visual features to attributes. It preserves the discriminative power of the features and avoids the mathematical "crowding" that causes hubness.
  • Wasserstein > Euclidean: The paper demonstrates that the Wasserstein barycenter is a superior way to pick a "representative" for a class. Simple averaging often picks a point that falls into overlapping regions between classes, leading to misclassification. Wasserstein distance respects the geometry of the probability distributions.
  • Topology Matters: By using a GNN, the model doesn't just learn a static mapping; it learns to maintain the "topology" (the relative positions) of classes. If "Zebra" is semantically between "Horse" and "Tiger," the GNN ensures its visual embedding is also positioned accordingly.

Key Results

The HGKT model achieved significant performance gains, particularly in the Harmonic Mean ($H$), which balances accuracy for both seen and unseen classes:

  • AwA2: Achieved an $H$ score of 52.7, a notable jump over previous baselines like DEM (45.1).
  • AwA1: Reached 53.6, significantly outperforming the state-of-the-art.
  • Agnostic Advantage: Unlike many competitors, HGKT achieved these results without "cheating" by looking at unseen class attributes during the training phase.

Limitations and Future Work

  • Attribute Quality: Like all ZSL methods, HGKT relies heavily on the quality of the high-level attributes provided. If the attributes are noisy or poorly defined, the graph construction will suffer.
  • Scalability: While the authors used neighbor sampling to handle large datasets, extremely large-scale graphs (millions of nodes) might still pose a computational challenge for the "complete subgraph" (intra-class) approach.
  • Dynamic Graphs: The current model constructs the graph once. Future work could explore dynamic graph updates where the model continues to refine its understanding of class relationships as it encounters more unseen samples.

Summary updated

BibTeX
@inproceedings{wang2020heterogeneous,
  author = {Junjie Wang and Xiangfeng Wang and Bo Jin and Junchi Yan and Wenjie Zhang and Hongyuan Zha},
  title = {{Heterogeneous Graph-based Knowledge Transfer for Generalized Zero-shot Learning}},
  booktitle = {ICPR},
  year = {2020},
  doi = {10.1109/icpr48806.2021.9412524},
}
Figure