Structured (De)composable Representations Trained with Neural Networks

Graham Spinks, Marie-Francine Moens

TL;DR

The authors introduce CoDiR (Composable Distance-based Representation learning), a method that replaces the standard final classification layer of a neural network with a structured matrix of distance estimates. By measuring how far an image is from various "environments" (randomized sets of labels), the model learns interpretable, high-rank representations that can be mathematically decomposed and recomposed to perform complex semantic image retrieval and classification.

What Problem Does This Paper Address?

Standard deep learning models for image classification typically use a "black box" approach: they map an input to a vector of probabilities via a cross-entropy loss. While effective, these representations often lack explicit structure, making it difficult to understand why a model made a choice or to manipulate the representation semantically (e.g., "find an image like this one, but replace the dog with a cat while keeping the park background").

The authors aim to bridge the gap between the raw power of neural networks and the interpretability of traditional "structured" methods (like document-term matrices in NLP). They want a representation that is:

  1. Structured: Organized along meaningful dimensions (classes and contexts).
  2. Composable: Capable of being modified using linear algebra to change specific semantic traits.
  3. Multimodal: Able to leverage both visual data and linguistic context (captions).

Methods

The core innovation is the CoDiR architecture. Instead of a standard softmax output, the model uses a fully connected layer to estimate the distance between an input instance and a set of "environments."

  • Environments ($e_j$): These are contextual distributions created by randomly grouping labels. For example, one environment might be defined by the labels {grass, ball, sky}.
  • Distance Metric: The model uses the Fisher Integral Probability Metric (IPM), a stable distance measure related to the Wasserstein (Earth Mover's) distance. It calculates how much "effort" it takes to move the distribution of a class to the distribution of an environment.
  • Template vs. Instance:
    • A Template ($T$) is the average distance of an entire class (e.g., "Football") to all environments.
  • An Instance Representation ($D$) is a 2D matrix for a specific image, where each element represents the distance between a class and an environment for that specific input.
  • Decomposition (SVD): Because the representation is a matrix, the authors can use Singular Value Decomposition (SVD). By modifying the resulting $U$ matrix (which represents class factors), they can "edit" the representation—for instance, swapping the "traffic light" factor for a "stop sign" factor—and then reconstruct a new representation to use for image retrieval.

Datasets

The researchers evaluated their method using the Microsoft COCO (Common Objects in Context) dataset.

  • Labels: Used 91 object categories for classification.
  • Captions: Used the descriptive captions to build "CoDiR (capt)" environments, extracting the most frequent nouns, verbs, and adjectives to provide richer contextual dimensions than object labels alone.

Key Insights and Ideas

  • Context as a Coordinate System: By measuring distances to randomized environments, the model creates a "coordinate system" for concepts. A "cat" is defined not just by being a cat, but by its relative distance to "furry things," "indoor things," and "things found on sofas."
  • High-Rank Representations: The authors found that their representations have a much higher rank than the number of labels used. This suggests the model is capturing "latent" continuous features and common-sense knowledge that go beyond simple discrete labels.
  • Linear Semantic Editing: The most striking insight is that semantic manipulation becomes a linear algebra problem. Because the matrix rows correspond to classes, you can literally subtract the "dog" row and add the "cat" row (via SVD components) to search for a semantically modified version of an image.

Key Results

  • Classification Performance: CoDiR consistently outperformed standard binary cross-entropy (BXENT) baselines. On a ResNet-101 backbone, CoDiR achieved an F1 score of 0.657 compared to the baseline's 0.592 when using caption-based environments.
  • Semantic Retrieval (M-NN): In the "Modified Nearest Neighbor" task (e.g., "find this image but with a different object"), CoDiR maintained high contextual similarity (F1%) while successfully switching the target label, significantly outperforming non-structured baselines.
  • Zero-Shot Capability: The model showed a better ability to classify previously unseen labels (like "panting dogs") using simple logistic regression on top of the pre-trained CoDiR representations compared to purely semantic models.

Limitations and Future Work

  • Memory Footprint: The final layer of CoDiR is $O(n_c \times n_e)$, where $n_c$ is the number of classes and $n_e$ is the number of environments. This is a larger memory footprint ($O(n^2)$) compared to the standard $O(n)$ classification layer, which might limit scaling to datasets with millions of classes.
  • Environment Selection: While randomized environments work well, the authors suggest that future work could explore more "principled" ways to select or learn the optimal environments to maximize discriminative power.
  • Unsupervised Learning: The current method relies on labels/captions to define environments. The authors suggest exploring how this structured approach could be applied to fully unsupervised representation learning.

Summary updated

Abstract

The paper proposes a novel technique for representing templates and instances of concept classes. A template representation refers to the generic representation that captures the characteristics of an entire class. The proposed technique uses end-to-end deep learning to learn structured and composable representations from input images and discrete labels. The obtained representations are based on distance estimates between the distributions given by the class label and those given by contextual information, which are modeled as environments. We prove that the representations have a clear structure allowing to decompose the representation into factors that represent classes and environments. We evaluate our novel technique on classification and retrieval tasks involving different modalities (visual and language data).
BibTeX
@inproceedings{spinks2020structured,
  author = {Graham Spinks and Marie-Francine Moens},
  title = {{Structured (De)composable Representations Trained with Neural Networks}},
  booktitle = {ANNPR},
  year = {2020},
  doi = {10.1007/978-3-030-58309-5\_3},
}

Loading related content...

Figure