Skip to main content
QUICK REVIEW

[Paper Review] Contrastive Embedding for Generalized Zero-Shot Learning

Zongyan Han, Zhenyong Fu|arXiv (Cornell University)|Mar 30, 2021
Domain Adaptation and Few-Shot LearningComputer Science69 references22 citations
TL;DR

This paper proposes CE-GZSL, a hybrid generalized zero-shot learning framework that integrates a feature generation model with a contrastive embedding model to improve classification by mapping both real and synthetic visual features into a discriminative embedding space. The method leverages both class-wise and instance-wise supervision via contrastive loss, achieving state-of-the-art performance on three of five benchmark datasets, with significant gains in harmonic mean accuracy.

ABSTRACT

Generalized zero-shot learning (GZSL) aims to recognize objects from both seen and unseen classes, when only the labeled examples from seen classes are provided. Recent feature generation methods learn a generative model that can synthesize the missing visual features of unseen classes to mitigate the data-imbalance problem in GZSL. However, the original visual feature space is suboptimal for GZSL classification since it lacks discriminative information. To tackle this issue, we propose to integrate the generation model with the embedding model, yielding a hybrid GZSL framework. The hybrid GZSL approach maps both the real and the synthetic samples produced by the generation model into an embedding space, where we perform the final GZSL classification. Specifically, we propose a contrastive embedding (CE) for our hybrid GZSL framework. The proposed contrastive embedding can leverage not only the class-wise supervision but also the instance-wise supervision, where the latter is usually neglected by existing GZSL researches. We evaluate our proposed hybrid GZSL framework with contrastive embedding, named CE-GZSL, on five benchmark datasets. The results show that our CEGZSL method can outperform the state-of-the-arts by a significant margin on three datasets. Our codes are available on https://github.com/Hanzy1996/CE-GZSL.

Motivation & Objective

  • To address the data imbalance and poor generalization in generalized zero-shot learning (GZSL), where unseen classes lack training samples.
  • To overcome the suboptimal discriminative capacity of the original visual feature space in GZSL by learning a more meaningful embedding space.
  • To improve GZSL performance by integrating feature generation with a contrastive embedding model that utilizes both class-wise and instance-wise supervision.
  • To mitigate the bias toward seen classes in GZSL by synthesizing unseen class features and learning robust representations in a unified embedding space.

Proposed method

  • The framework combines a feature generation model that synthesizes visual features for unseen classes with a contrastive embedding model that maps both real and synthetic features into a shared embedding space.
  • A contrastive embedding loss is introduced to enforce that positive pairs (e.g., same-class samples) are closer in the embedding space than negative pairs, using both class-level and instance-level supervision.
  • The contrastive loss is computed using a temperature-scaled cross-entropy formulation, with learnable temperature parameters τₑ and τₛ for embedding and semantic space, respectively.
  • The final GZSL classifier is trained in the embedding space using a supervised softmax classifier on the combined real and generated features.
  • The method is evaluated with ablation studies on embedding dimension, number of generated samples, and mini-batch sampling strategies, showing robustness and performance gains.
  • Hyperparameters such as embedding dimension and batch size are tuned via cross-validation, with 2,048 dimensions selected as a trade-off between performance and computational cost.

Experimental results

Research questions

  • RQ1Can integrating a contrastive embedding model with a feature generation model improve generalization in generalized zero-shot learning?
  • RQ2Does leveraging instance-wise supervision in addition to class-wise supervision lead to better performance in GZSL?
  • RQ3How does the choice of embedding dimension and number of generated samples affect the performance of the hybrid GZSL framework?
  • RQ4Is the proposed contrastive embedding method robust to variations in temperature parameters and batch sampling strategies?

Key findings

  • CE-GZSL achieves state-of-the-art performance on three of five benchmark datasets—AWA1, AWA2, and FLO—outperforming previous methods by a significant margin.
  • On AWA1, the method achieves a harmonic mean accuracy of 69.0 when using 2,048-dimensional embeddings, with 64.9% top-1 accuracy on unseen classes and 73.9% on seen classes.
  • On AWA2, the method achieves a harmonic mean of 70.0 with 63.1% accuracy on unseen classes and 78.6% on seen classes using 2,048-dimensional embeddings.
  • On FLO, the method achieves a harmonic mean of 73.5 with 69.0% accuracy on unseen classes and 80.3% on seen classes, outperforming prior methods.
  • The method is robust to temperature hyperparameters τₑ and τₛ, with optimal values varying by dataset: τₑ=0.1, τₛ=0.1 on AWA1, CUB, and SUN; τₑ=10.0, τₛ=1.0 on AWA2; τₑ=0.1, τₛ=1.0 on FLO.
  • Using a large random mini-batch of 4,096 samples yields better performance than hand-crafted sampling strategies, indicating that sufficient positive and negative pairs are critical for contrastive learning.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.