From Pixel to Patch: Synthesize Context-Aware Features for Zero-Shot Semantic Segmentation

Zhangxuan Gu, Siyuan Zhou, Li Niu, Zihan Zhao, Liqing Zhang

TL;DR

This paper introduces CaGNet, a novel approach for zero-shot semantic segmentation that synthesizes context-aware visual features for unseen object categories. By leveraging pixel-wise contextual information and extending to patch-wise generation, CaGNet significantly improves segmentation performance on unseen objects, outperforming existing methods.

What Problem Does This Paper Address?

Semantic segmentation, the task of classifying every pixel in an image, is crucial for understanding visual scenes. However, it typically requires extensive pixel-level annotations, making it labor-intensive. Zero-shot learning (ZSL) aims to address this by enabling models to recognize categories they haven't seen during training, usually by transferring knowledge from seen categories via semantic representations (like word embeddings). While ZSL has seen success in image classification, it has been less explored for semantic segmentation due to the increased annotation burden. This paper tackles the challenge of zero-shot semantic segmentation, specifically focusing on how to generate visual features for unseen object categories using only their semantic descriptions, thereby reducing the need for exhaustive pixel-level annotations for all categories.

Methods

The core of CaGNet lies in its Context-aware Feature Generation Network (CaGNet). It builds upon a standard segmentation backbone (like DeeplabV2) and introduces a Contextual Module (CM). This CM extracts pixel-wise contextual information from the backbone's feature maps and encodes it into a contextual latent code (z). This code, along with the category's word embedding (w), is fed into a feature generator (G).

The key innovations are:

  • Contextual Latent Code: Instead of using random vectors, CaGNet uses contextual information to generate more diverse and meaningful latent codes. This helps mitigate the "mode collapse" problem, where generative models produce limited variations of features.
  • Pixel-wise Feature Generation: The generator synthesizes pixel-wise visual features for unseen categories. These generated features are then used to fine-tune the classifier, bridging the gap between seen and unseen categories.
  • Patch-wise Feature Generation: To further improve performance and leverage inter-pixel relationships, CaGNet extends to patch-wise generation. This involves using a modified PixelCNN to generate plausible "category patches" (representing semantic layouts) and then synthesizing corresponding "feature patches." These patch-wise features are used for a more advanced classifier fine-tuning.

The overall architecture involves a segmentation backbone (E), the contextual module (CM), a feature generator (G), a discriminator (D), and a classifier (C). The training process involves optimizing these components using losses for reconstruction (LREC), classification (LCLS), adversarial training (LADV), and KL divergence (LKL) to regularize the latent codes.

Datasets

The proposed method is evaluated on three standard semantic segmentation datasets:

  • Pascal-VOC 2012: Used with semantic boundary annotations.
  • Pascal-Context: Contains 33 object/stuff categories.
  • COCO-stuff: Features 182 categories.

The authors follow standard train/test splits and focus on using only seen categories for training, with unseen categories being the target for zero-shot generalization.

Key Insights and Ideas

  • Context is King (for Segmentation): The paper strongly suggests that pixel-wise visual features are heavily influenced by their surrounding context. Encoding this contextual information into latent codes is crucial for generating diverse and accurate features for unseen categories.
  • Beyond Randomness: Moving from random latent vectors to context-aware ones is a significant step in improving the diversity and quality of generated features, directly addressing a known limitation of previous ZSL methods.
  • Patch-wise Power: Extending from pixel-wise to patch-wise feature generation and fine-tuning allows the model to capture inter-pixel relationships, leading to more robust segmentation, especially for complex scenes.
  • PixelCNN for Semantic Layout: Using PixelCNN to generate category patches is an effective way to model the semantic layout of image regions, which is then leveraged for feature synthesis.

Key Results

CaGNet demonstrates significant improvements in zero-shot semantic segmentation across all tested datasets.

  • Pascal-VOC: CaGNet(pa) (patch-wise finetuning) achieves the best overall harmonic IoU (hIoU), outperforming previous methods like SPNet and ZS3Net.
  • COCO-stuff and Pascal-Context: CaGNet(pa) also shows superior performance, particularly in terms of "unseen" mIoU and overall hIoU.
  • Patch-wise vs. Pixel-wise: The patch-wise finetuning approach (CaGNet(pa)) consistently outperforms the pixel-wise finetuning approach (CaGNet(pi)), highlighting the benefit of considering inter-pixel relationships.
  • Feature Diversity: CaGNet generates more diverse unseen features compared to ZS3Net, and these generated features are closer in diversity to real unseen features.

Limitations and Future Work

  • Patch Size: The paper acknowledges that generating plausible large-scale category patches is challenging. Their approach focuses on smaller patches (3x3 by default), which limits the capture of larger spatial relationships. Future work could explore generating larger feature patches while considering reasonable shapes or poses of unseen objects.
  • Computational Cost: While CaGNet is efficient, it does introduce an additional contextual module, slightly increasing computational cost compared to simpler methods like SPNet.
  • Hyperparameter Sensitivity: The performance of patch-wise finetuning is shown to be sensitive to hyperparameters like Af (number of preset unseen pixels) and λr (ratio of pure to mixed patches), requiring careful tuning.

The authors suggest future work could focus on generating large feature patches with better consideration of object shapes and poses for unseen objects.

Summary updated

BibTeX
@article{gu2023from,
  author = {Zhangxuan Gu and Siyuan Zhou and Li Niu and Zihan Zhao and Liqing Zhang},
  title = {{From Pixel to Patch: Synthesize Context-Aware Features for Zero-Shot Semantic Segmentation}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2023},
  doi = {10.1109/tnnls.2022.3145962},
}
Figure