Graph annotation generative adversarial networks

Yoann Boget, Magda Gregorova, Alexandros Kalousis

Abstract

Generating high-dimensional data with complex relational structures, such as molecules or social networks, remains a significant challenge in machine learning. We introduce GrannGAN (Graph Annotation Generative Adversarial Networks), a novel framework designed to generate node and edge features conditioned on a fixed graph skeleton. By employing a two-phase adversarial strategy combined with permutation-equivariant message passing neural networks (MPNNs), GrannGAN avoids the computational overhead of graph matching and the biases of arbitrary node ordering. Our experiments on molecular and spatial datasets demonstrate that GrannGAN produces highly diverse annotations that closely match the underlying data distributions.

The Challenge of Graph Feature Generation

Modeling distributions over graphs is complicated by the non-uniqueness of graph representations; a graph with $n$ nodes has $n!$ possible adjacency matrix representations. Traditional generative models often rely on sequential generation (which is slow and requires ordering heuristics) or one-shot generation (which often suffers from mode collapse or requires expensive graph matching).

GrannGAN addresses a specific subset of this problem: conditional graph feature generation. Given a fixed, unannotated graph structure (the "skeleton"), the goal is to generate realistic node and edge features that respect the specific topology of that skeleton.

Methodology: Two-Phase Adversarial Generation

GrannGAN utilizes the Wasserstein GAN (WGAN) framework, factorizing the joint distribution of nodes and edges into two sequential phases.

The GrannGAN architecture: Node annotation (top) generates node features from a skeleton and noise; Edge annotation (bottom) generates edge features conditioned on the skeleton and the generated node features.
  1. Node Annotation Phase: A generator $g_V$ produces node features conditioned on the graph skeleton $\mathcal{S}$ and latent noise $\mathcal{Z}$. A critic $f_V$ evaluates the realism of these node annotations.
  2. Edge Annotation Phase: A second generator $g_E$ produces edge features conditioned on the skeleton $\mathcal{S}$, the previously generated node features $V$, and noise $\mathcal{Z}$. A critic $f_E$ evaluates the complete annotated graph.

Both generators and critics are implemented as Message Passing Neural Networks (MPNNs). Because MPNNs operate directly on the graph structure, the generators are naturally permutation-equivariant and the critics are permutation-invariant. This architectural choice ensures the model is insensitive to node ordering, allowing it to focus entirely on learning the feature distribution. To enhance the MPNNs' ability to capture complex topologies, node hidden states are augmented with structural features like node degrees and $k$-cycle counts.

Experimental Evaluation

The model was evaluated on three distinct datasets:

  • QM9: Small organic molecules (up to 9 atoms).
  • ZINC: Larger, more complex molecules (up to 38 atoms).
  • Fingerprints: Skeletonized human fingerprint regions with continuous spatial features.

Key Results

  • Distribution Matching: On the QM9 dataset, GrannGAN achieved a Jensen-Shannon Distance (JSD) for node features of $1.87 \times 10^{-3}$, significantly outperforming the autoregressive GraphAF model ($15.80 \times 10^{-3}$).
  • Diversity and Scalability: Unlike many one-shot models that suffer from mode collapse, GrannGAN maintained 100% uniqueness and novelty on the ZINC dataset. Even when generating 1,000 instances for a single fixed skeleton, the model achieved a 92.5% uniqueness rate, demonstrating robust feature diversity.
  • Continuous Feature Support: The model successfully learned the continuous spatial distributions in the Fingerprints dataset, matching both node/edge features and Euclidean distances between connected nodes.

Conclusion

GrannGAN represents a significant step forward in conditional graph generation. By decoupling structure from features and leveraging the permutation-invariant properties of MPNNs, it provides an efficient and effective way to annotate graph skeletons. Future work includes extending the model to handle partially annotated graphs and incorporating property-conditioning to guide the generation toward specific chemical or physical targets.

Summary updated

BibTeX
@inproceedings{boget2022graph,
  author = {Yoann Boget and Magda Gregorova and Alexandros Kalousis},
  title = {{Graph annotation generative adversarial networks}},
  booktitle = {ACML},
  year = {2022},
  url = {https://openreview.net/forum?id=MMVBjhHvLd},
}
Figure