NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A2I: Adjacency-to-Image Structural Encodings for Graph Learning

Heesoo Jung, Hogun ParkNeurIPS 2026

TL;DR

Instead of summarizing graph neighborhoods through message passing or eigenvalue math, A2I (Adjacency-to-Image) literally draws a picture of a node's local adjacency matrix and feeds it into a frozen ResNet-50. By looking directly at the geometry of connections rather than indirect statistical summaries, it spots structural differences that trip up standard Graph Neural Networks—and learns topological patterns that transfer cleanly across completely different graphs.

What Problem Does This Paper Address?

How do you teach a neural network the "shape" of a graph? Usually, we rely on one of two strategies: message passing (GNNs, where nodes iteratively average features from their neighbors) or explicit structural encodings (injecting random-walk statistics or Laplacian eigenvalues into the nodes).

Both approaches rely on compressed, indirect summaries of topology, and both have blind spots. Standard GNNs are famously upper-bounded by the 1-Weisfeiler-Leman (1-WL) isomorphism test, meaning certain distinct wiring patterns look identical to them. Spectral methods (using eigenvalues) fail on cospectral graphs—non-isomorphic graphs that happen to share the exact same spectrum. Furthermore, naïvely gluing structural encodings onto node features often causes "feature interference," muddying the node's actual attribute data. The authors ask: can we skip the lossy math summaries, encode local adjacency matrices directly as images, and fuse them with node features without scrambling either signal?

Methods

A2I splits graph representation into two distinct steps: visual preprocessing and prototype-guided fusion.

Figure 1: Overview of the A2I framework for target node representation.
  1. Sorting and Rendering (New): An adjacency matrix isn't naturally an image because shuffling node IDs scrambles the pixels, and $k$-hop neighborhoods vary wildly in size. Finding a true canonical node ordering is as hard as graph isomorphism itself. Instead, A2I uses a fast surrogate: for a target node, it extracts $1$- to $K$-hop subgraphs and sorts the nodes by BFS distance and degree. Rather than building giant dense matrices in memory, A2I directly maps sorted node pairs into a fixed $M \times M$ pixel grid via block-averaging.
  2. Frozen Vision Encoding (Standard tool, novel use): These $M \times M$ grayscale grids are duplicated across RGB channels and passed through a frozen, pre-trained ResNet-50 to produce multi-scale structural tokens.
  3. Prototype Bottleneck & Gated Fusion (New): Rather than feeding raw ResNet vectors into a graph model, A2I projects them onto a small set of learnable structural prototypes via soft attention—capturing recurring topological motifs. A lightweight Transformer then processes these prototype tokens alongside standard GNN/Graph Transformer feature tokens, combining the final outputs via a learned gate.

Datasets

No new real-world benchmarks are introduced, though custom synthetic sets are generated to test theory. The authors evaluate on:

  • Node Classification: Homophilous graphs (Cora, Citeseer), heterophilous graphs where connected nodes often have different labels (Squirrel, Chameleon, Roman-Empire), and a large-scale citation network (Ogbn-Arxiv).
  • Cross-Dataset Transfer: PubMed and Amazon co-purchase networks (Photo, Computers).
  • Synthetic Benchmarks: Contextual Stochastic Block Models (CSBM) for few-shot size generalization, Circular Skip Link (CSL) graphs for 1-WL expressiveness, and 600 canonical cospectral pairs (4×4 Rook’s graph vs. Shrikhande graph).

Key Insights and Ideas

  • Resized adjacency matrices are secretly graphons: Why should resizing a tiny 10-node neighborhood and a massive 500-node neighborhood to the same $M \times M$ image make sense? The authors link block-averaging to graphon theory—the continuous limit of dense graphs. Graphs generated from the same structural family converge to the same visual pattern, explaining why A2I transfers across graphs of wildly different sizes.
  • Bounded permutation error: While BFS+degree sorting has ties (meaning two node labelings of the same graph can yield slightly different images), the authors prove that under bounded average degree, the embedding discrepancy shrinks at a rate of $O(1/\sqrt{N_k})$ as subgraph size $N_k$ grows.
  • Rescaling, not distorting, feature attention: Mathematically unpacking the Transformer attention weights reveals that adding structural prototype tokens simply multiplies the original feature-to-feature attention by a scalar factor. It modulates the relative importance of feature interactions without corrupting them.

Key Results

  • Big gains on heterophilous and missing-feature graphs: Adding A2I to a standard GCN boosts accuracy on Roman-Empire by 25.6 percentage points (51.2% $\rightarrow$ 76.8%), whereas RWSE and Laplacian encodings barely budge the baseline (~51.4%). When 30%–60% of node features are randomly masked out, A2I holds remarkably steady by leaning on topology.
  • 54x Preprocessing Speedup: By mapping sparse edges directly to image pixels without densifying adjacency matrices, preprocessing on Ogbn-Arxiv drops from 64,800 seconds (18 hours) to 1,200 seconds (20 minutes).
Figure 2: Time comparison of the pre-processing step in log-scale between ours and the naive ap- proach.
  • Cracking Cospectral Pairs: Spectral baselines (LPE, LLPE) and random walks (RWSE) get stuck at 50%–53.8% accuracy trying to separate Rook's and Shrikhande cospectral graphs. A2I hits 92.3%, with its learned prototypes achieving 97.8% class purity from pure structure.
  • Cross-Graph Transfer: Pre-training on one dataset and few-shot fine-tuning on another (even across domains, like Cora $\rightarrow$ Amazon Photo) yields an average +5.76 percentage point gain over training from scratch, compared to <1 pp for GCN and GraphSAGE.

Limitations and Future Work

  • Hub nodes and massive scale: Even with the direct-to-pixel trick, A2I still requires extracting $K$-hop subgraphs. On graphs much larger than Ogbn-Arxiv or scale-free networks with massive hub nodes, $K$-hop neighborhoods explode in size, making extraction impractical and weakening the bounded-degree theoretical guarantees.
  • Task scope: Real-world experiments focus strictly on node classification. Extending image-based structural encodings to large-scale graph classification and link prediction is left for future work.

Summary updated

BibTeX
@inproceedings{jung2026i,
  author = {Heesoo Jung and Hogun Park},
  title = {{A2I: Adjacency-to-Image Structural Encodings for Graph Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=omQbj7k7El},
}
Figure