Papers
Topics
Authors
Recent
Search
2000 character limit reached

ProtoFlow: Invertible Prototypical Network

Updated 5 April 2026
  • ProtoFlow is an explainable machine learning framework that models class prototypes as invertible Gaussian mixture distributions in a deep latent space.
  • It integrates a bijective normalizing flow backbone with class-conditional GMMs to enable both accurate classification and faithful prototype visualization.
  • Empirical evaluations demonstrate strong performance and robust interpretability, maintaining accuracy even with aggressive prototype pruning on diverse datasets.

ProtoFlow refers to two distinct frameworks at the cutting edge of machine learning research: (1) an invertible prototypical neural network for interpretable and generative classification (Carmichael et al., 2024), and (2) a graph prototype-based model for robust, interpretable surgical workflow analysis (Holm et al., 16 Dec 2025). Both systems advance explainability and sample efficiency via learned prototype distributions, but in disparate technical and application domains. The following entry concentrates on the invertible prototypical network known as ProtoFlow (Carmichael et al., 2024), with separate reference to the surgical workflow ProtoFlow (Holm et al., 16 Dec 2025) where explicitly indicated.

1. Definition and Conceptual Overview

ProtoFlow is an intrinsically explainable, exactly invertible supervised learning framework that combines a deep normalizing flow backbone with class-conditional Gaussian mixture models (GMMs) in the latent space. In contrast to classic prototypical networks, which represent each class as prototype points in embedding space, ProtoFlow learns distributions over the latent space for each class, supporting both classification and generative modeling. These distributions can be inverted exactly—thanks to the bijective nature of the flow mapping—allowing for faithful prototype visualization in data space and enabling analysis of intra-class variability and interpretability (Carmichael et al., 2024).

2. Model Architecture

2.1 Normalizing Flow Backbone

ProtoFlow models the data xXRdx \in \mathcal{X} \subset \mathbb{R}^d and its latent code z=f(x)Zz=f(x)\in \mathcal{Z} via a bijective mapping implemented as a deep normalizing flow (DenseFlow) with cross-unit coupling and Nyström self-attention. The invertibility ensures that any point in latent space has a unique data point preimage and permits tractable, exact computation of data likelihoods:

pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|

where pzp_z is the class-conditional GMM used for modeling distributions in Z\mathcal{Z}.

2.2 Prototypical Latent Distributions

For each class c{1,,C}c\in\{1,\dots,C\}, ProtoFlow defines prototypes as GMMs:

pz(zc)=k=1Kπc,kN(z;μc,k,Σc,k)p_z(z\,|\,c) = \sum_{k=1}^K \pi_{c,k} \mathcal{N}(z;\mu_{c,k}, \Sigma_{c,k})

where KK is the number of mixture components (prototypes) per class, πc,k\pi_{c,k} are mixture weights (kπc,k=1\sum_k\pi_{c,k}=1), and z=f(x)Zz=f(x)\in \mathcal{Z}0 are diagonal, positive-definite covariances.

2.3 Inference and Generation

Classification uses Bayes' rule and the class-conditional latent densities:

z=f(x)Zz=f(x)\in \mathcal{Z}1

Generation and prototype visualization sample z=f(x)Zz=f(x)\in \mathcal{Z}2 for a prototype and use z=f(x)Zz=f(x)\in \mathcal{Z}3 to obtain a corresponding data sample that directly visualizes prototype semantics in z=f(x)Zz=f(x)\in \mathcal{Z}4-space.

3. Training and Optimization

3.1 Objective

The ProtoFlow loss combines four terms:

  • Discriminative cross-entropy: z=f(x)Zz=f(x)\in \mathcal{Z}5
  • Generative negative log-likelihood: z=f(x)Zz=f(x)\in \mathcal{Z}6
  • Consistency regularization: z=f(x)Zz=f(x)\in \mathcal{Z}7 encourages invariance under data augmentations z=f(x)Zz=f(x)\in \mathcal{Z}8
  • Prototype diversity penalty: z=f(x)Zz=f(x)\in \mathcal{Z}9 is the average pairwise Hellinger distance between prototypes within each class The total training objective is

pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|0

where the pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|1's are hyperparameters controlling the regularization strength.

3.2 Training Procedure

ProtoFlow requires only class labels for supervision; no explicit concept or prototype annotations are needed. The pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|2 means per class can be initialized randomly or by K-means in latent space, and the parameters pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|3 are updated via SGD or optionally an EM schedule. Robustness is further enhanced by strong augmentation (random crop, jitter, flips, rotations, shear) and an EMA of model weights. Prototype pruning is conducted by discarding components with pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|4 below an Otsu-thresholded pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|5: up to 80–90% of prototypes can be pruned with pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|6 accuracy loss on datasets such as CIFAR-100 (Carmichael et al., 2024).

4. Interpretability and Prototype Visualization

Traditional prototypical models (e.g., ProtoPNet) offer interpretability either through a non-bijective decoder or post hoc nearest-neighbor assignment, which leads to a semantic gap and reduced prototype faithfulness, especially when pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|7 is not injective. ProtoFlow's approach—defining prototypes as invertible GMMs in latent space—addresses these shortcomings in three fundamental ways:

  1. Invertibility: pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|8 is bijective and enables exact realization of prototype samples in data space via pdata(x)=pz(f(x))detf(x)/xp_{\text{data}}(x) = p_z(f(x)) \cdot |\det\,\partial f(x)/\partial x|9.
  2. Expressivity: Modeling distributions, not points, captures intra-prototype variability (e.g., pose, color changes within a semantic class).
  3. Faithfulness: Prototypes directly correspond to precisely defined regions in data space, bypassing the need for approximate decoders or proxy nearest-neighbors.

Visualization of a prototype involves sampling pzp_z0 and recovering pzp_z1, yielding exact images representing prototypical variations. The mean vector often maps to a canonical shape or “core” concept, while sampling from the full distribution demonstrates feature variability consistent with semantic variability observed in real data (Carmichael et al., 2024).

5. Empirical Evaluation

ProtoFlow demonstrates state-of-the-art or competitive joint generative and discriminative performance among flow-based classifiers. On standard datasets:

Dataset Accuracy (%) BPD ECE
MNIST (28×28) 99.36 0.535 0.006
CIFAR-10 (32×32) 91.54 3.95 0.083
CIFAR-100 (32×32) 69.80 5.03 0.292
Flowers-102 (64×64) 59.80 13.5
Oxford-IIIT Pet 53.58 4.89

ProtoFlow consistently matches or outperforms prior normalizing-flow classifiers (e.g., Glow+GMM, IB-INN, SCNF) with richer interpretability. Performance remains robust under significant prototype pruning (up to 90%) and under Gaussian perturbations to the maximum-likelihood prototype (pzp_z2 stability). Consistency regularization sharpens mean-point visualizations but can add noise to stochastic samples, mitigable via truncated sampling (Carmichael et al., 2024).

6. Implementation and Computational Details

ProtoFlow is implemented using a pre-trained DenseFlow backbone for density estimation on datasets of various resolutions, with three densely-connected coupling blocks. The typical setup uses pzp_z3 mixture components per class, AdamW optimizer (learning rate pzp_z4 with cosine decay), batch size 256, and training for 150 epochs with EMA. At inference, 100 Monte Carlo flow samples per example are averaged over five data augmentations for logits and likelihoods. Prototype sampling is performed with a truncation trick, restricting sampled latents to low-norm regions (pzp_z5 for pzp_z6), balancing realism and diversity. Prototype part visualization can be refined by occlusion-based patch analysis, where patches from a query are moved over a mean prototype and the class/prototype activation heatmap is recorded (Carmichael et al., 2024).

A related, but architecturally distinct, framework named ProtoFlow addresses robust and interpretable surgical workflow modeling via dynamic scene graph prototypes (Holm et al., 16 Dec 2025). This model employs a GNN encoder–decoder with self-supervised pretraining and prototype-clustered embeddings to support data-efficient, explainable workflow phase classification. In extreme few-shot settings (1–5 videos), this ProtoFlow significantly outperforms GNN baselines. Learned prototypes correspond to clinically relevant sub-techniques and can flag workflow anomalies or rare complications, offering transparency for surgical data science, decision support, and training (Holm et al., 16 Dec 2025).

A plausible implication is that the core idea of invertible, interpretable prototype distributions has broad impact, with variants emerging for structured domains beyond standard image datasets.


References:

  • "This Probably Looks Exactly Like That: An Invertible Prototypical Network" (Carmichael et al., 2024)
  • "ProtoFlow: Interpretable and Robust Surgical Workflow Modeling with Learned Dynamic Scene Graph Prototypes" (Holm et al., 16 Dec 2025)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to ProtoFlow.