Stochastic Prototype Embeddings

Tyler R. Scott, Karl Ridgeway, Michael C. MozerarXiv 2019

Introduction

Deep neural networks have achieved remarkable success in various domains, yet they often struggle with a fundamental human trait: the ability to express doubt. Traditional models are typically deterministic, mapping complex inputs like images to single points in a latent embedding space. While efficient, this approach is inherently brittle. When faced with blurry, noisy, or out-of-distribution data, a deterministic model has no mechanism to signal uncertainty, often leading to overconfident but incorrect predictions.

To address this, researchers have introduced Stochastic Prototype Embeddings (SPE). This framework shifts the paradigm from point-based embeddings to probabilistic distributions, allowing neural networks to represent not just "what" an object is, but also "how sure" they are about that identification.

Methods: Embeddings as Distributions

The core innovation of SPE lies in its treatment of the latent space. Building upon the Prototypical Networks (PN) architecture, SPE introduces three key components:

  1. Probabilistic Mapping: Instead of a fixed vector, each input $x$ is mapped to a Gaussian distribution $p(z|x)$ characterized by a mean $\mu$ and a diagonal covariance matrix $\Sigma$. The variance across dimensions serves as a direct proxy for the model's uncertainty.
  2. Confidence-Weighted Prototypes: In few-shot learning, classes are defined by a small "support set" of examples. SPE calculates the class prototype as a confidence-weighted average. Inputs with high variance (indicating low confidence) are automatically down-weighted, preventing noisy or ambiguous examples from corrupting the class representation.
  3. The Intersection Sampler: A significant challenge in stochastic modeling is the mathematical complexity of marginalizing over distributions. The authors developed the "Intersection Sampler," a novel technique that focuses on the overlap between the input distribution and the class distribution. This allows for efficient training and inference without the computational overhead typically associated with Bayesian methods.
Overview of the SPE framework: mapping inputs to Gaussian distributions and forming confidence-weighted prototypes.

Experimental Evaluation

The effectiveness of SPE was tested across three diverse benchmarks:

  • Synthetic Color-Orientation Data: Used to evaluate the model's ability to disentangle independent features like rotation and color.
  • Omniglot: A standard few-shot learning dataset containing 1,623 handwritten characters. SPE excelled here, particularly in 1-shot, 20-class tasks.
  • N-Digit MNIST: A complex task involving concatenated digits (e.g., "71"), testing the model's ability to handle factorial labels and large-set classification.

Key Insights and Results

SPE demonstrates a significant advantage in handling "garbage" or corrupted data. In scenarios where the support set was intentionally noisy, SPE maintained an accuracy of 48.0%, significantly higher than the 42.8% achieved by deterministic Prototypical Networks. This robustness stems from the model's ability to "ignore" high-variance outliers.

Furthermore, the use of diagonal covariance matrices encourages disentanglement. The model naturally aligns specific features—such as character complexity or aspect ratio in Omniglot—with the axes of the embedding space. This makes the latent representations more interpretable and allows the model to generalize to unseen combinations of features, as seen in the N-digit MNIST results where SPE outperformed previous state-of-the-art stochastic methods like Hedged Instance Embeddings (HIB) by 5-10%.

Latent space visualization showing embeddings as uncertainty ellipses, where larger ellipses indicate higher model doubt.

Conclusion

Stochastic Prototype Embeddings provide a robust framework for few-shot learning that accounts for data ambiguity. By representing inputs as distributions rather than points, SPE gains a "sense of doubt" that makes it more resilient to noise and better at capturing the underlying structure of complex datasets. While currently limited by the assumption of independent dimensions (diagonal covariance), SPE paves the way for more self-aware and interpretable AI systems.

Summary updated

BibTeX
@misc{scott2019stochastic,
  author = {Tyler R. Scott and Karl Ridgeway and Michael C. Mozer},
  title = {{Stochastic Prototype Embeddings}},
  year = {2019},
  eprint = {1909.11702},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.11702},
}
Figure