GraphMind Citation-graph topic classification Connecting…

Graph neural networks · transductive node classification

Classifying research papers by topic from their citation graph

Each node is a paper described only by binary word-presence indicators; each edge is a citation. A two-layer graph convolutional network (GCN) predicts one of seven topics by combining a paper's own words with those of the papers it cites or is cited by. This workspace runs the exported ONNX model live and lets you inspect what the graph contributes.

Dataset
Dataset Cora (Planetoid split)
Graph
Graph loading…
Model
Model 2-layer GCN · ONNX Runtime
Test accuracy
Test accuracy —

Graph explorer

Select a paper (node) from Cora. The prediction comes from POST /predict/cora_node; the neighbourhood is drawn from the real citation edges.

0 – 2707
Neighbourhood
One test paper per topic
Loading from dataset…
Misclassified test papers

Citation neighbourhood

Nodes coloured by ground-truth topic. Click a node to recentre.

No node selected Choose a node index or one of the dataset samples above.
Selected Prediction ≠ label Training node
Neighbourhood as a table

GCN prediction

Softmax over the model's 7 output logits

—
Awaiting a node Prediction, class probabilities and the edge-ablation result will appear here.

Edge experiment: does message passing change the answer?

Build a small graph from real Cora feature vectors, connect nodes however you like, and run the model twice through POST /predict: once with your edges and once with self-loops only. Note that a node's prediction here depends only on the nodes you include, not on its full Cora neighbourhood.

1 · Nodes

0 / 12

    2 · Edges

    0 edges
      Request payload (JSON)
      {}

      Evaluation

      Live numbers are recomputed by the server from the shipped simple_gcn_cora.onnx on the Planetoid public split. Recorded numbers are copied from the training notebook's saved outputs. Each figure is labelled with its source.

      Method, data and reproducibility

      Architecture

      notebook cell 22
      1. InputX ∈ {0,1}N×1433, edge_index ∈ ℕ2×E
      2. GCNConv1433 → 32
      3. ReLU · Dropout(p = 0.5)train only
      4. GCNConv32 → 7 logits
      5. Softmax · argmaxapplied in main.py

      H(l+1) = σ( D̃−½ Ã D̃−½ H(l) W(l) ),  Ã = A + I

      Each layer averages a node's representation with its degree-normalised neighbours, so two layers let information flow from papers up to two citations away (Kipf & Welling, 2017).

      Dataset

      live from data/Planetoid

      Training setup

      notebook cells 22–26
      Objective
      Cross-entropy on the 140 training nodes only
      Optimiser
      Adam, lr = 0.01, no weight decay
      Epochs
      Up to 200, early stopping on validation accuracy (patience 20) — stopped at epoch 35
      Inference
      Full graph (transductive): all 2,708 nodes and edges are passed in a single forward pass
      Export
      torch.onnx.export, opset 18, dynamic node and edge dimensions
      Serving
      FastAPI + ONNX Runtime (CPUExecutionProvider)

      Model I/O signature

      live from ONNX session

      Limitations and research notes

      1. Single run. All recorded numbers come from one training run with no fixed PyTorch seed; no mean ± standard deviation over seeds is reported, so small differences between models should not be over-interpreted.
      2. Exported weights are the final-epoch weights. The notebook stores best_state = model.state_dict(), which keeps references to the live parameters rather than a copy. The restored model is therefore the epoch-35 model: its validation accuracy measured here is lower than the logged best (0.812).
      3. Overfitting to 140 labels. Training accuracy is 1.000 while validation and test accuracy are ≈0.79.
      4. Transductive setting. Test papers' features and citation edges are visible at inference time (standard for Planetoid). The model cannot classify a genuinely new paper without adding it to the graph.
      5. No raw text. Cora in PyTorch Geometric ships only binary indicators over an undistributed 1,433-word vocabulary, so this interface cannot show titles or words, and free-text input is not possible.
      6. Baseline description mismatch. The notebook's text says the Random Forest also uses degree and log-degree features, but the code trains on the TF-IDF-reweighted word features only.
      7. Correlation, not causation. Better accuracy with edges indicates topical homophily in the citation graph; it does not show that citations determine topics.

      Reproduce locally

      cd DL/GNN_RESEARCH
      python3.11 -m venv .venv && source .venv/bin/activate
      pip install -r requirements.txt
      uvicorn ui_api:app --port 8000
      # open http://localhost:8000
      Weights
      simple_gcn_cora.onnx + .onnx.data
      Data
      data/Planetoid/Cora (processed by torch-geometric)
      Training
      cora_citation_network_classification_(1).ipynb
      API
      OpenAPI docs · /predict · /predict/cora_node · /info · /api/ui/*

      References: McCallum et al. (2000), Cora; Yang, Cohen & Salakhutdinov (2016), Planetoid split; Kipf & Welling (2017), GCN; Fey & Lenssen (2019), PyTorch Geometric.