Building Graph Representations of Deep Vector Embeddings

Dario Garcia-Gasulla, Armand Vilalta, Ferran Parés, Jonathan Moreno, Eduard Ayguadé, Jesús Labarta, Ulises Cortés, Toyotaro Suzumura

This research presents a novel methodology for interpreting the internal representations of deep neural networks. Rather than treating neural network outputs as standard vector embeddings, the authors propose transforming these activations into a complex graph structure. This shift from metric to topological space allows for the application of network analysis tools, such as community detection, to uncover latent data patterns.

The Problem: Beyond Instance-Attribute Relationships

In traditional transfer learning, a pre-trained model (e.g., VGG16) is used to extract a "feature vector" from an image, which is then fed into a classifier. This approach primarily captures instance-attribute relationships—quantifying how much of a specific feature is present in a given image.

However, this paradigm often overlooks the rich instance-instance and feature-feature relationships inherent within the model's architecture. Standard vector embeddings are typically restricted to the final layers, which are highly discriminative but potentially information-sparse. By moving to a topological (graph) space, researchers can utilize community detection algorithms to identify coherent patterns that traditional distance-based clustering, like K-means, might fail to capture.

Methodology: The Graph Construction Pipeline

The proposed pipeline transforms Convolutional Neural Network (CNN) activations into a graph through three primary stages:

  1. Full-network Embedding (FNE): Instead of extracting features only from the final layer, activations are captured from every convolutional and fully-connected layer, creating a high-dimensional representation.
  2. Discretization: To mitigate noise, activations are standardized and discretized into three values: 1 (high activation), -1 (low activation), and 0 (irrelevant).
  3. Graph Construction:
    • Vertices: Nodes are created for every image and every neural feature (with separate nodes for positive and negative presence).
  4. Edges: Image-feature edges are drawn based on discretized activations. Feature-feature edges are established based on the pre-trained CNN's internal weights; if a weight between neurons exceeds a standard deviation threshold $k$, an edge is created.
The proposed pipeline for transforming CNN activations into a structured representation for graph construction.

Finally, the Fluid Communities (FluidC) algorithm is applied to the resulting graph to determine if the detected communities correspond to ground-truth image categories.

Experimental Setup and Datasets

The approach was evaluated using a VGG16 architecture pre-trained on ImageNet across four distinct datasets:

  • mit67: 6,700 indoor scene images (67 categories).
  • flowers102: 8,189 flower images (102 categories).
  • textures: 5,640 texture images (47 categories).
  • wood (Oulu Knots): 438 spruce wood knot images (7 categories).

Key Results and Insights

The quality of the identified communities was measured using Normalized Mutual Information (NMI) and Adjusted Mutual Information (AMI). The results demonstrate that community detection on a purely topological representation can recover categorical labels with significant accuracy without explicit training on target labels.

Graph statistics and community detection performance (NMI and AMI) across the four evaluation datasets.

As shown in the results, the system performed best on the flowers102 dataset (NMI: 0.54) and the mit67 dataset (NMI: 0.44). The resulting graphs were substantial in scale; for instance, the flower dataset graph comprised over 33,000 vertices and nearly 10 million edges.

Discussion and Future Work

A key insight from this work is the power of "absence": by including nodes for negative activations, the graph captures descriptive information about what a feature is not doing. Furthermore, by using internal weights for feature-feature edges, the graph inherits structural knowledge learned during the model's original training.

While promising, the authors note several areas for future exploration. This study was exploratory and lacked a direct baseline comparison against K-means clustering on FNE vectors. Additionally, the current graphs are undirected and unweighted; incorporating edge directionality (to reflect CNN flow) or weight (to reflect activation strength) could further refine the representation. Finally, the threshold $k$ for edge creation remains a sensitive hyperparameter that currently requires manual tuning.

Summary updated

BibTeX
@inproceedings{garciagasulla2017building,
  author = {Dario Garcia-Gasulla and Armand Vilalta and Ferran Parés and Jonathan Moreno and Eduard Ayguadé and Jesús Labarta and Ulises Cortés and Toyotaro Suzumura},
  title = {{Building Graph Representations of Deep Vector Embeddings}},
  booktitle = {SemDeep@IWCS},
  year = {2017},
}
Figure