Skip to main content
Ido AvitalAI Engineer · Data Scientist
Menu

Data science & ML

GraphSAGE on Citation Networks

Node classification on the Cora citation graph

Node classification on the Cora citation graph with a two-layer GraphSAGE model, written as the student part of a course framework.

Technical lab Status: Completed Academic

Citation graph Undirected edges Two SAGE layers Topic labels

Workflow diagram

From citations to topic labels Drawn for this site from the model file. Illustrative, not data.

The problem

Papers cite papers: can a model predict a paper's topic from its own words and its neighbours' in the citation graph?

My Role & Leadership

Project Owner · Technical Lead · Developer. Owned and implemented the model and data layer of a course assignment: the feature, edge and label loaders, the two-layer GraphSAGE model and the training loop with best-checkpoint selection.

  • Led the graph choices: self-loops removed, because SAGEConv already keeps each node's own features, and the citation graph made undirected.
  • Made training reproducible with strict-improvement checkpointing.

The algorithm

Each layer averages a paper's neighbours' features and combines them with its own; two layers let a paper's label depend on papers up to two citations away.

What I developed

  • Edge preparation: invalid references dropped, self-loops removed (SAGEConv already keeps a node's own features), the directed citation graph made undirected and deduplicated.
  • A two-layer GraphSAGE (256 hidden units, dropout 0.5).
  • Training with strict-improvement checkpointing, so ties resolve to the earliest epoch and runs are reproducible.

Implementation decisions

  • Remove self-loops, because SAGEConv already keeps each node's own features and a loop would count them twice.
  • Make the graph undirected, so a paper learns from the papers that cite it as well as those it cites.

What was provided

  • The training and evaluation framework, and the Cora dataset.
  • GraphSAGE itself is published work by others.

Key technologies

  • PyTorch
  • PyTorch Geometric
  • GraphSAGE

Known limits

No accuracy is recorded in the supplied files, so none is claimed. GraphSAGE and Cora are established work by others.

All projects

Questions about GraphSAGE on Citation Networks