Node classification

On this page 7

Node classification is the task of predicting a categorical label for each node in a graph, using the node’s own features together with the structure of its connections and the labels of other nodes. In graph learning, a core area of artificial intelligence, it is the most widely studied benchmark task and the main proving ground for graph neural networks.

Typical applications include classifying users of a social network, assigning research papers to topics in a citation graph, flagging fraudulent accounts in a transaction network and predicting protein functions in an interaction network. In most of these settings only a small fraction of nodes carries labels, so the task is usually framed as semi-supervised learning on a single large graph.

How node classification works

A model receives a graph with nodes, edges and a feature vector for each node, plus known labels for a training subset. It learns a function that maps each node to a probability distribution over classes, and training minimizes cross-entropy loss computed only on labeled nodes, while unlabeled nodes still influence predictions through the edges.

The approach rests on the assumption that connected nodes tend to share labels, a property called homophily. A graph neural network exploits it through neighborhood aggregation: in each layer, a node combines messages from its neighbors with its own representation, so after k layers its embedding summarizes its k-hop neighborhood.

A final linear layer with a softmax converts each embedding into class scores. For multi-label settings, such as proteins with several functions, the softmax is replaced by independent sigmoid outputs and a binary cross-entropy loss.

Transductive and inductive settings

The learning setting determines which nodes the model sees during training and which methods are allowed. Confusing these settings is a frequent source of misleading comparisons in published results.

SettingWhat the model sees in trainingTypical methods
TransductiveThe whole graph, labels for a subsetGCN, GAT, label propagation
InductiveTraining subgraph only; new nodes appear laterGraphSAGE, sampled GNNs
Semi-supervisedFew labels, many unlabeled nodesGCN with Planetoid splits
Few-shot or zero-shotVery few or no labels for some classesMeta-learning, graph foundation models
TemporalGraph evolves; predict labels at later timesDynamic graph neural networks
Main node classification settings

Transductive learning suits a fixed graph such as a citation network snapshot. Inductive learning is required in production systems where new users, products or accounts arrive constantly and the model must classify them without retraining.

Methods used for node classification

Methods range from structure-only algorithms to deep message passing models. The right choice depends on graph size, feature quality and the degree of homophily, and simple methods are often more competitive than their age suggests.

Method familyUses featuresUses structureMain strength
Label propagationNoYesFast, strong under high homophily
Feature-only MLPYesNoBaseline that reveals structural value
Embeddings (DeepWalk, node2vec)OptionalYes, via random walksUnsupervised, reusable vectors
Graph convolutional networkYesYes, normalized averagingSimple, strong semi-supervised baseline
Graph attention networkYesYes, learned neighbor weightsHandles uneven neighbor importance
GraphSAGEYesYes, sampled neighborsInductive and scalable
Graph transformerYesYes, global attention plus encodingsCaptures long-range dependencies
Families of node classification methods

Hybrid techniques such as Correct and Smooth first train a simple model on features and then propagate its residual errors and predictions along edges. On several Open Graph Benchmark datasets, this approach matches much larger GNNs at a fraction of the training cost.

Benchmarks and evaluation

Node classification results are reported mainly as accuracy for single-label tasks and ROC-AUC or micro-F1 for multi-label tasks. Because small benchmarks are sensitive to the split, reliable studies average over many random seeds and splits and report the standard deviation.

DatasetNodesClassesNotes
Cora2,7087Citation graph; 20 labels per class in the Planetoid split
CiteSeer3,3276Citation graph with sparse features
PubMed19,7173Medical citation graph
ogbn-arxiv169,34340Time-based split by publication year
ogbn-productsAbout 2.4 million47Co-purchase graph; needs sampling
Chameleon and SquirrelThousands5Heterophilous Wikipedia graphs
Widely used node classification datasets

The Open Graph Benchmark introduced realistic splits, for example separating papers by year, which exposes distribution shift that random splits hide. Results on the classic Planetoid graphs have largely saturated, with differences between strong methods often within one standard deviation.

Limitations and common pitfalls

Node classification models inherit the weaknesses of message passing. Stacking many layers causes over-smoothing, where node embeddings converge and classes become indistinguishable, so most practical models use two or three layers. Long-range information is compressed through narrow paths, a problem known as over-squashing.

  • Heterophily: when neighbors usually have different labels, standard GNNs can perform worse than a feature-only MLP.
  • Information leakage: test labels or future edges included during training inflate scores, especially in transductive setups.
  • Degree bias: low-degree nodes receive less information and are classified less accurately.
  • Scalability: full-batch training on graphs with millions of nodes exceeds GPU memory without neighbor sampling or Cluster-GCN.
  • Fairness risks: propagation can spread biased labels through communities, which matters in credit or moderation decisions.

A disciplined workflow therefore starts with an MLP and a label propagation baseline. If a GNN does not clearly beat both, the graph structure may add little value or the homophily assumption may not hold.

In simple terms

Imagine a large network of people, where lines show who knows whom. You know the hobby of only a few people. Node classification guesses the hobby of everyone else.

It looks at what each person is like and who they are connected to. Friends often share interests, so their known hobbies are strong clues. The computer learns how to combine these clues into a good guess for each person.

A practical example

A payment provider wants to detect mule accounts used to move stolen money. Its fraud team builds a graph in which about 5 million accounts are nodes and transfers between them are edges. Each account has features such as account age, transaction counts and device changes, but investigators have confirmed labels for only about 20,000 accounts.

The team trains an inductive GraphSAGE model with neighbor sampling, so newly opened accounts can be scored daily without retraining. It compares the model with a gradient-boosted classifier that uses only account features, evaluating both on accounts labeled in a later month to avoid leakage.

The graph model catches noticeably more mule accounts at the same false-positive rate, because mules cluster around shared senders and devices that the feature-only model cannot see. Investigators now review the highest-scoring accounts first, which shortens the time to freeze suspicious funds.