Skip to main content
QUICK REVIEW

[Paper Review] Counterfactual Zero-Shot and Open-Set Visual Recognition

Zhongqi Yue, Tan Wang|arXiv (Cornell University)|Mar 1, 2021
Domain Adaptation and Few-Shot LearningComputer Science13 references21 citations
TL;DR

This paper proposes a counterfactual framework for Zero-Shot Learning (ZSL) and Open-Set Recognition (OSR) that improves generalization to unseen classes by generating class-attribute-conditional, sample-specific counterfactual images grounded in real sample features. By ensuring counterfactual faithfulness through disentangled sample and class attributes, the method applies a consistency rule for balanced seen/unseen classification, achieving state-of-the-art F1 scores in OSR and significantly reducing accuracy imbalance in ZSL.

ABSTRACT

We present a novel counterfactual framework for both Zero-Shot Learning (ZSL) and Open-Set Recognition (OSR), whose common challenge is generalizing to the unseen-classes by only training on the seen-classes. Our idea stems from the observation that the generated samples for unseen-classes are often out of the true distribution, which causes severe recognition rate imbalance between the seen-class (high) and unseen-class (low). We show that the key reason is that the generation is not Counterfactual Faithful, and thus we propose a faithful one, whose generation is from the sample-specific counterfactual question: What would the sample look like, if we set its class attribute to a certain class, while keeping its sample attribute unchanged? Thanks to the faithfulness, we can apply the Consistency Rule to perform unseen/seen binary classification, by asking: Would its counterfactual still look like itself? If ``yes'', the sample is from a certain class, and ``no'' otherwise. Through extensive experiments on ZSL and OSR, we demonstrate that our framework effectively mitigates the seen/unseen imbalance and hence significantly improves the overall performance. Note that this framework is orthogonal to existing methods, thus, it can serve as a new baseline to evaluate how ZSL/OSR models generalize. Codes are available at https://github.com/yue-zhongqi/gcm-cf.

Motivation & Objective

  • To address the severe performance imbalance between seen and unseen classes in ZSL and OSR, where models typically overfit to seen-class characteristics.
  • To improve generalization to unseen classes by generating counterfactual samples that are faithful to the true data distribution, avoiding out-of-distribution artifacts.
  • To establish a new baseline for ZSL and OSR evaluation by introducing a method orthogonal to existing approaches, grounded in counterfactual inference.
  • To enable robust open-set recognition through a consistency-based binary classifier that distinguishes seen from unseen samples using counterfactual generation.
  • To demonstrate that faithful counterfactual generation leads to better disentanglement of sample and class attributes without requiring explicit supervision.

Proposed method

  • Proposes a Generative Causal Model (GCM-CF) that generates counterfactual samples by modifying only the class attribute of a given sample while preserving its sample-specific attributes.
  • Defines counterfactuals as: 'What would the sample look like if its class were Y, given its observed sample attributes Z?' ensuring faithfulness to the true data distribution.
  • Applies the Consistency Rule: if a sample's counterfactual still resembles the original, it is classified as belonging to that class; otherwise, it is rejected as unseen.
  • Uses class-conditional generation via a conditional VAE or GAN to produce counterfactuals that lie within the true data manifold between seen and unseen classes.
  • Employs class-agnostic feature extraction and attention maps (CAM) to validate that generated counterfactuals preserve discriminative, pixel-level structure.
  • Integrates the counterfactual generation with a two-stage classifier: first, a binary seen/unseen classifier via consistency rule; second, a supervised classifier on seen classes using CGDL for final prediction.

Experimental results

Research questions

  • RQ1Can counterfactual generation grounded in sample-specific attributes reduce distributional shift in unseen-class generation and improve ZSL performance?
  • RQ2Does counterfactual faithfulness lead to a more balanced decision boundary between seen and unseen classes in both ZSL and OSR?
  • RQ3Can the Consistency Rule—based on whether a counterfactual resembles the original—effectively distinguish seen from unseen samples in open-set recognition?
  • RQ4Does the proposed method achieve state-of-the-art performance across multiple ZSL and OSR benchmarks without relying on disentangled supervision?
  • RQ5Is the improvement in F1 score due to better generalization to unseen classes, rather than increased accuracy on seen classes?

Key findings

  • GCM-CF achieves state-of-the-art F1 scores on all tested OSR datasets, including 91.37 on MNIST, 79.25 on SVHN, 72.63 on CIFAR10, 79.38 on C+10, and 74.60 on C+50.
  • The method significantly reduces the accuracy imbalance between seen and unseen classes in ZSL, with unseen accuracy improving substantially compared to conventional ZSL methods.
  • In the Openness-F1 Plot, GCM-CF maintains the highest F1 score across all openness levels, especially excelling in high-openness settings with many unseen classes.
  • The performance gain is not due to higher seen-class accuracy, as shown by comparable closed-set accuracy between standard CNN and CGDL, confirming the improvement stems from better unseen-class detection.
  • Qualitative results show that counterfactuals generated by GCM-CF are visually faithful and distinguishable from originals, enabling effective thresholding for open-set rejection.
  • The method demonstrates robustness across five random splits in OSR, outperforming baselines in every split, indicating consistent and generalizable improvement.

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.