← work · all projects
network-congestion-prediction.md

CASE 07 / 07

Network Congestion Prediction

Graph Neural Networks · Spatiotemporal ML

SHIPPED2026
12345678Abilene 12-node topologyGATConv ×2spatial encodingLSTMT=20 sequenceMulti-Head Attnresidual fusion3-class outputNormal75%Warning62%Congested38%77.13% acc · 0.8973 AUC/ROC
77.13%
best accuracy
0.8973
best AUC/ROC
3
model variants
7
bugs fixed

overview.md

This project predicts network congestion classes (Normal / Warning / Congested) on graph-structured time-series data using the 12-node Abilene US backbone topology. Three model variants were built and compared: a Vanilla GAT spatial baseline, GAT+LSTM for spatiotemporal modelling, and GAT+LSTM+Attention as the optimised best variant. The core contribution is a systematic bottleneck diagnosis — seven bugs across training, evaluation, and architecture were identified and fixed, yielding consistent improvements across all models.

architecture.drawio

  1. Input: sliding window of 20 timesteps × 12 nodes × 5 features (RTT, queue depth, packet loss, jitter, throughput) from a synthetic AR(1) Abilene traffic generator.
  2. GATEncoder: two-layer GATConv (hidden=64, out=64, heads=4) encodes spatial node relationships across each timestep.
  3. Batched graph construction: precomputed edge-index offsets replace per-sample DataLoader loops — cached by batch size, eliminating the main training bottleneck.
  4. TemporalLSTM: processes the full T=20 GAT-encoded sequence per node, returns all timestep outputs for the attention layer.
  5. Multi-Head Self-Attention: query from final LSTM state, keys/values from full sequence; residual fusion (last_lstm + attn_context) + LayerNorm + Dropout(0.1).
  6. NodeClassifier: Linear(64, 3) → 3-class output (Normal / Warning / Congested) per node.

results.md

ModelAccuracyWeighted F1AUC/ROC
Vanilla GAT75.39%0.64350.8815
GAT + LSTM76.21%0.74500.8847
GAT + LSTM + Attention77.13%0.66960.8973

engineering.log

Seven bugs were fixed across all three model scripts:

  • Hardcoded class weights [0.3, 0.4, 0.6] → dynamic inverse-frequency weighting (most impactful — minority congestion class recall jumped from ~5% to 84%).
  • No gradient clipping → clip_grad_norm_ with max_norm=1.0 added.
  • Fixed LR for all epochs → ReduceLROnPlateau scheduler (mode=max, patience=5).
  • No model checkpointing → save/load best validation accuracy before test evaluation.
  • Slow per-sample DataLoader loop → batched edge-index offsets cached by batch size.
  • Full-batch gradient descent → mini-batch training with batch_size=64 via torch.split.
  • Macro-only F1 → added weighted F1, per-class breakdown, confusion matrix, and ROC curves.
Aditya Dixit · Jaipur, IndiaSet in IBM Plex Serif & Mono© 2026