Semantic Contrastive Embedding for Generalized Zero-Shot Learning

Zongyan Han, Zhenyong Fu, Shuo Chen, Jian Yang

Abstract

Generalized Zero-Shot Learning (GZSL) faces two primary challenges: the inherent bias toward seen classes due to data imbalance and the lack of discriminative power in standard visual feature spaces. This paper introduces CE-GZSL, a hybrid framework that addresses these issues by combining generative feature synthesis with a novel contrastive embedding approach. By employing both instance-level and class-level contrastive constraints, the model learns a highly discriminative embedding space that effectively bridges the gap between visual and semantic information, achieving state-of-the-art performance across multiple benchmarks.

Introduction

In Zero-Shot Learning (ZSL), a model is tasked with recognizing objects from classes it has never encountered during training, relying instead on semantic descriptions like attributes. Generalized ZSL (GZSL) is a more realistic and difficult variant where the test set contains a mix of both seen and unseen classes.

The performance of GZSL models is typically hindered by two factors. First, models are naturally biased toward seen classes because they lack training images for unseen categories. Second, the visual features extracted from pre-trained networks often fail to capture the fine-grained details necessary to distinguish between similar unseen classes. While generative methods have attempted to solve the imbalance by synthesizing features, they often struggle with noise in the original visual space.

The CE-GZSL Framework

CE-GZSL (Contrastive Embedding for GZSL) proposes a "best of both worlds" hybrid approach. It integrates a feature generator with a specialized embedding model to improve both the quantity and quality of data available for training.

Hybrid Architecture

The model utilizes a Conditional GAN (cGAN) to synthesize visual features for unseen classes based on their semantic attribute vectors. Instead of performing classification in the raw visual space, CE-GZSL maps both real (seen) and synthetic (unseen) features into a newly learned Embedding Space.

The CE-GZSL framework: (a) Instance-level contrastive embedding, (b) Class-level contrastive embedding, and (c) the overall hybrid GZSL framework integrating feature generation and embedding.

Contrastive Embedding Strategy

The core innovation lies in the dual-level contrastive loss used to shape the embedding space:

  • Instance-level Contrastive Embedding: This forces the model to distinguish a specific instance from a pool of negative samples from different classes. This encourages the capture of fine-grained, discriminative structures.
  • Class-level Contrastive Embedding: This ensures that an image's embedding is closer to its own class's semantic descriptor than to those of other classes, providing global organization.

Experimental Evaluation

The authors evaluated CE-GZSL on five standard benchmarks: AWA1, AWA2, CUB (birds), FLO (flowers), and SUN (scenes). They followed the "Proposed Split" (PS) protocol to ensure rigorous testing without data leakage.

Key Results

CE-GZSL achieved significant performance gains, particularly in the harmonic mean ($H$), which balances accuracy on seen ($S$) and unseen ($U$) classes. On the CUB dataset, it became the first method to surpass 60% accuracy for both $U$ and $H$. Specifically, it reached 70.0% on AWA2, 65.3% on CUB, and 73.5% on FLO.

Performance curves showing accuracy for unseen (U), seen (S), and harmonic mean (H) as the number of synthesized instances increases across different datasets.

As shown in the performance curves, the model effectively manages the trade-off between seen and unseen class accuracy. As more synthetic instances are added, the accuracy on unseen classes ($U$) rises significantly, leading to a peak in the harmonic mean ($H$) before the model eventually begins to overfit the synthetic data.

Conclusion

CE-GZSL demonstrates that treating individual images as distinct entities through instance-wise supervision is crucial for learning robust representations in ZSL. By combining feature generation to solve data imbalance with contrastive embedding to enhance discriminative power, the framework sets a new performance ceiling for GZSL. Future work may explore more advanced generative models, such as Variational Autoencoders, to further refine the quality of synthesized features.

Summary updated

BibTeX
@article{han2022semantic,
  author = {Zongyan Han and Zhenyong Fu and Shuo Chen and Jian Yang},
  title = {{Semantic Contrastive Embedding for Generalized Zero-Shot Learning}},
  journal = {Int. J. Comput. Vis.},
  year = {2022},
  doi = {10.1007/s11263-022-01656-y},
}
Figure