PatchVAE: Learning Local Latent Codes for Recognition

Kamal Gupta, Saurabh Singh, Abhinav Shrivastava · DOI

Introduction

In unsupervised representation learning, a significant gap exists between generative modeling and self-supervised learning for recognition. Standard Variational Auto-encoders (VAEs) prioritize global reconstruction, attempting to compress an entire image into a single latent code. This objective often forces the model to preserve semantically irrelevant details, such as background noise or textures, which can hinder performance on downstream recognition tasks like object classification.

PatchVAE addresses this by shifting the focus from global reconstruction to local, repetitive image patches. The authors argue that for effective visual recognition, a model should discard non-informative noise and instead concentrate on meaningful, recurring parts (e.g., a bird's beak or a car's wheel).

Methods: The Patch-Based Bottleneck

The core innovation of PatchVAE is its structured bottleneck, which replaces the single global latent vector of a traditional VAE with a grid-based representation.

Comparison of standard VAE (a) and PatchVAE (b) architectures.

As shown in the architecture comparison, PatchVAE decomposes the image representation into two distinct latent variables for each grid location:

  1. Occurrence Code ($z_{occ}$): A discrete Bernoulli variable indicating whether a specific learned part exists at a given location.
  2. Appearance Code ($z_{app}$): A continuous Gaussian variable describing the visual characteristics of that part.

By forcing the model to reconstruct images using a limited set of these "parts," the encoder is incentivized to identify patterns that repeat across the dataset. To further refine this process, the authors employ a Weighted Reconstruction Loss ($L_w$) using a Laplacian filter to emphasize high-detail regions (edges and textures) while ignoring flat backgrounds. Additionally, adversarial training is used to encourage the decoder to produce more abstract, realistic features.

Key Insights and Results

The research demonstrates a fundamental trade-off: while PatchVAE may underperform standard VAEs on pixel-level reconstruction metrics (like PSNR), it significantly outperforms them in semantic recognition. This confirms that "throwing away" the right information—specifically non-repetitive background data—is crucial for learning useful representations.

Visualization of part discovery, occurrence maps, and semantic part samples in PatchVAE.

Quantitative Performance

The model was evaluated on several benchmarks, including ImageNet, CIFAR100, and MIT Indoor Scene Recognition. On ImageNet, using a ResNet18 backbone, PatchVAE achieved 47.87% Top-1 accuracy, surpassing the standard $\beta$-VAE's 44.45%. Similar gains of 2-3% were observed across other scene-centric datasets like Places205.

Qualitative Part Discovery

Qualitative analysis reveals that PatchVAE naturally discovers semantic components without supervision. As illustrated in the visualizations, the model identifies specific parts like bird heads, dog faces, or textures of strawberries and corn. The disentanglement of $z_{occ}$ and $z_{app}$ allows for "part swapping," where the appearance of a part from one image can be reconstructed onto the occurrence map of another.

Conclusion and Future Work

PatchVAE successfully bridges the gap between generative modeling and recognition by focusing on mid-level features. While it is not optimized for high-fidelity image synthesis, its ability to learn semantically meaningful parts makes it a powerful tool for unsupervised representation learning. Future research may explore more complex part representations, such as using Mixtures of Gaussians to capture varied appearances of the same semantic part from different angles.

Summary updated

BibTeX
@inproceedings{gupta2020patchvae,
  author = {Kamal Gupta and Saurabh Singh and Abhinav Shrivastava},
  title = {{PatchVAE: Learning Local Latent Codes for Recognition}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00480},
}
Figure