Variational Prototyping-Encoder: One-Shot Learning With Prototypical Images

Junsik Kim, Tae-Hyun Oh, Seokju Lee, Fei Pan, In So Kweon · DOI

TL;DR

This paper introduces the Variational Prototyping-Encoder (VPE), a novel approach for one-shot learning of graphic symbols. VPE learns a generalizable embedding space by training an encoder-decoder model to translate real-world images into their corresponding prototypical images, effectively learning perceptual similarity without relying on explicit metric learning. This method achieves state-of-the-art performance on challenging one-shot classification tasks, particularly for traffic signs.

What Problem Does This Paper Address?

Recognizing graphic symbols like traffic signs and logos is crucial for many applications, but it presents a significant challenge for machine learning. These symbols often have a large "domain discrepancy" between their idealized "prototype" form and real-world images, which can be distorted by printing, lighting, and viewing angles. Furthermore, obtaining large, labeled datasets for every new symbol class is impractical and expensive. This is exacerbated by "intra-class data imbalance" (only one or a few examples per class) and "inter-class imbalance" (some classes having many more examples than others). Traditional methods struggle with these issues, especially in one-shot learning scenarios where only a single example of a new class is available.

Methods

The core of the proposed method is the Variational Prototyping-Encoder (VPE). VPE is trained using a meta-task: translating real-world images into their corresponding prototypical images. This is achieved using a variational autoencoder (VAE) framework, but with a key difference. Instead of reconstructing the input image, the VPE's decoder aims to generate the prototype image from a latent representation derived from the input real image.

Here's a breakdown of the VPE's approach:

  • Encoder-Decoder Structure: A VAE-like architecture is used, with an encoder mapping real images to a latent space and a decoder attempting to reconstruct a prototype from this latent space.
  • Meta-Task: Image Translation: The training objective is to learn an image-to-prototype translation. This forces the model to learn what makes a real image "look like" its prototype, effectively capturing perceptual similarity and robustness to real-world variations.
  • Variational Inference: A probabilistic encoder ($q_\phi(z|x)$) and a probabilistic decoder ($p_\theta(t|z)$) are employed. The model is trained by maximizing a variational lower bound on the marginal likelihood of the prototype, which includes a reconstruction term (how well the decoder generates the prototype) and a KL divergence term (regularizing the latent space to match a prior distribution).
  • One-Shot Classification: In the test phase, the trained encoder acts as a feature extractor. Embeddings for query images and prototype images are generated. Classification is then performed using a simple nearest neighbor (NN) approach in this learned latent space.

The authors also explore data augmentation techniques (random flips, rotations) and the use of a spatial transformer network (STN) to further improve robustness.

Datasets

The paper evaluates VPE on several datasets, focusing on cross-dataset evaluation to simulate real-world scenarios where training and testing classes are distinct:

  • Traffic Sign Datasets:
    • GTSRB: German Traffic Sign Recognition Benchmark.
  • TT100K: A large-scale traffic sign dataset.
  • Logo Datasets:
    • BelgaLogos: Used for training.
  • FlickrLogos-32: Used for testing.
  • TopLogo-10: Used for testing.

The experiments are designed to be challenging, often using classes seen during training for validation and entirely unseen classes for testing, simulating a true open-set recognition problem.

Key Insights and Ideas

  • Learning Perceptual Similarity: The core insight is that learning to translate real images to prototypes implicitly teaches the model about perceptual similarity, which is more robust than relying on explicit metric learning losses. This is crucial for bridging the domain gap.
  • Prototype as Strong Supervision: Using prototypes as the target for translation provides a strong, high-level visual supervision signal that guides the learning of a generalizable embedding space.
  • Robustness to Perturbations: The image translation task inherently makes the model robust to real-world perturbations (blur, lighting, geometric distortions) because it learns to "normalize" these variations to match the canonical prototype.
  • VPE vs. Metric Learning: VPE offers an alternative to traditional metric learning approaches by learning the embedding space through a generative, image-translation meta-task rather than by directly defining a distance metric.
  • Effectiveness of Augmentation: Augmentation significantly boosts VPE's performance, suggesting that the learned translation process benefits from diverse input variations.

Key Results

  • State-of-the-Art Performance: VPE consistently outperforms competing metric-based one-shot learning methods across various datasets.
  • Significant Gains on Traffic Signs: The improvement is particularly notable on traffic sign datasets, with VPE achieving accuracies like 83.79% on GTSRB (compared to 53.30% for the second best) and 71.80% on GTSRB TT100K (compared to 58.75%).
  • Competitive on Logos: While the gains are less dramatic on logo datasets, VPE still shows favorable performance, achieving 57.75% on Belga→Toplogos (compared to 36.62% for the second best).
  • Qualitative Improvements: t-SNE visualizations show that VPE produces more clearly separated embedding spaces for unseen classes compared to other methods. Distance heatmaps also demonstrate VPE's ability to capture block-patterned similarity aligned with category sets.
  • Image Retrieval: VPE also shows strong performance in image retrieval tasks, effectively retrieving relevant real images based on prototype queries.

Limitations and Future Work

  • Unseen Class Generation Accuracy: While VPE can handle high-level categories for unseen classes, the fine details of the generated prototypes are not always accurate.
  • Future Work: The authors suggest exploring advanced loss functions for reconstruction and investigating more sophisticated metrics for NN classification in the latent space. They also mention the potential for VPE to be applied to a wider range of applications.

Summary updated

BibTeX
@inproceedings{kim2019variational,
  author = {Junsik Kim and Tae-Hyun Oh and Seokju Lee and Fei Pan and In So Kweon},
  title = {{Variational Prototyping-Encoder: One-Shot Learning With Prototypical Images}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00969},
}
Figure