Supervised Encoding for Discrete Representation Learning

Cat P. Le, Yi Zhou, Jie Ding, Vahid TarokhOpenReview 2019 · DOI

Abstract

Classical supervised classification tasks search for a nonlinear mapping that maps each encoded feature directly to a probability mass over the labels. Such a learning framework typically lacks the intuition that encoded features from the same class tend to be similar and thus has little interpretability for the learned features. In this paper, we propose a novel supervised learning model named Supervised-Encoding Quantizer (SEQ). The SEQ applies a quantizer to cluster and classify the encoded features. We found that the quantizer provides an interpretable graph where each cluster in the graph represents a class of data samples that have a particular style. We also trained a decoder that can decode convex combinations of the encoded features from similar and different clusters and provide guidance on style transfer between sub-classes.

Introduction

While deep learning models excel at classification, they are frequently criticized as "black boxes." A standard neural network maps an input to a label without necessarily organizing the internal feature space in a human-interpretable manner. For example, a model might correctly identify the digit "7," but it does not inherently distinguish between a "7" written with a crossbar and one without. This lack of transparency limits the utility of learned features for downstream tasks requiring nuance.

The Supervised-Encoding Quantizer (SEQ) addresses this by bridging the gap between high-accuracy classification and model interpretability. By combining supervised pre-training with $k$-means quantization, the model not only classifies data with state-of-the-art precision but also automatically identifies and visualizes distinct "styles" or sub-classes within the data.

Methodology

The SEQ model follows a structured three-step pipeline designed to organize the latent space semantically:

  1. Supervised Pre-training: An encoder is trained using standard supervised learning (Softmax layer + cross-entropy loss). This step forces the encoder to create a latent space where features ($Z$) are linearly separable according to their labels.
  2. $k$-means Quantization: The Softmax layer is removed, and the encoded features are passed to a $k$-means quantizer. By choosing a number of clusters ($K$) larger than the number of classes, the model performs "histogram-based labeling"—assigning each cluster a label based on a majority vote of the samples within it. This allows the model to identify fine-grained sub-classes (styles).
  3. Decoder Training: A decoder is trained to reconstruct the original input from the encoded features. During this phase, the encoder's weights are frozen to ensure the decoder learns to map the interpretable latent space back to the image domain accurately.
The SEQ architecture featuring an Encoder, a $k$-means Quantizer for discrete representation, and a Decoder for reconstruction.

Experimental Results

The researchers evaluated the SEQ model on two standard benchmarks: MNIST (handwritten digits) and Fashion-MNIST (clothing items).

  • State-of-the-Art Clustering: On the MNIST dataset, SEQ achieved a clustering accuracy of 99.74%, significantly outperforming prior methods such as DEC (86.55%) and CAE-$l_2$ (95.11%).
  • High Classification Performance: On the more challenging Fashion-MNIST dataset, the model reached a maximum accuracy of 91.8% when $K \geq 120$.
  • Architecture Impact: The Convolutional Autoencoder (CAE-4) version of the model consistently outperformed versions using only fully connected layers (LAE-2, LAE-4), highlighting the importance of spatial feature extraction for these tasks.

Interpretability and Style Discovery

A key insight of this work is that supervision aids clustering. Unlike purely unsupervised methods, SEQ uses labels to "organize" the feature space first, making the subsequent $k$-means step significantly more accurate.

The quantizer identifies "semantic styles" rather than just arbitrary groups. In MNIST, different clusters for the digit "1" represent different slants. In Fashion-MNIST, clusters for "bags" distinguish between those with no handles, short handles, and long handles. Furthermore, the embedding space is smooth and continuous; by taking convex combinations of features from different clusters, the decoder can generate "hybrid" styles that transition smoothly without the blurring artifacts common in Variational Autoencoders (VAEs).

Reconstructed samples from MNIST and Fashion-MNIST showing distinct stylistic clusters identified by the SEQ quantizer.

Conclusion and Future Work

The SEQ model demonstrates that discrete representation learning can achieve high accuracy while providing interpretable insights into data sub-structures. While the method currently depends on labeled data for the initial encoding phase, its ability to discover semantic styles offers significant potential. Future applications could include medical imaging, where generating specific types of pathological images could aid in diagnosis or clinician training. Subsequent research may also explore how $k$-means quantization scales to high-resolution images and datasets with thousands of classes.

Summary updated

BibTeX
@misc{le2019supervised,
  author = {Cat P. Le and Yi Zhou and Jie Ding and Vahid Tarokh},
  title = {{Supervised Encoding for Discrete Representation Learning}},
  year = {2019},
  eprint = {1910.11067},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.11067},
  howpublished = {OpenReview},
}
Figure