MZQMohd Zamin Quadri
All work

Master's thesis on reliable machine learning

Uncertainty Quantification for Traffic Prediction

A traffic model that says how sure it is.

Role
Researcher and thesis author
Classification
Academic research
Institution
Technical University of Munich
Inspect repository
Information spreads through a fixed road network, then each junction carries how unsure the surrogate is there.A road network of twenty-five junctions. One junction is intervened on and the effect propagates outward along real hop distance; the network then lifts so that height carries that distance, a prediction appears at each junction, and a band of uncertainty grows around it with distance from the intervention. A reliability inset shows the tracked calibration curve moving from 0.2687 to 0.0479 expected calibration error, and the least confident junctions are finally marked for human review.
  1. Problem

    A fast traffic model can be wrong with no warning.

  2. How it was solved

    I measured its uncertainty and set aside the answers it trusted least.

    1. Simulation
    2. Graph network
    3. Uncertainty
    4. Review
  3. Result

    41.2%

    lower error on the answers it kept

    • All predictionsMAE 3.95
    • Most confident halfMAE 2.32
  4. Built with

    • PyTorch
    • PyTorch Geometric
    • NumPy
    • scikit-learn
    See the evidence on GitHub
A road network of twenty-five junctions. One junction is intervened on and the effect propagates outward along real hop distance; the network then lifts so that height carries that distance, a prediction appears at each junction, and a band of uncertainty grows around it with distance from the intervention. A reliability inset shows the tracked calibration curve moving from 0.2687 to 0.0479 expected calibration error, and the least confident junctions are finally marked for human review.

Master's thesis / Transport

A graph network answers in milliseconds what a traffic simulator takes hours to compute. The question is not whether it is fast. It is when it may be believed.

Held-out scope100 scenarios

A fast answer, and the policy that decides whether to give it

confident enoughnot confident enoughcalibrated against simulated truthPolicy scenariosAgent-based simulation runs.Hours each, which is the…Road-link graphLinks as nodes. The network isfixed; the demand on it is…Graph surrogatePointNet encoder,TransformerConv and GAT…Uncertainty estimateHow unsure the surrogate is,per junction, not per run.Review policyReads the uncertainty anddecides whether to answer at…Answered directlyMilliseconds instead of hours,where the estimate supports…Held for reviewThe predictions the policydeclines to make on its own.
The uncertainty estimate is not a figure printed beside the prediction - it is what the review policy reads. The return path is calibration: a stated uncertainty means nothing until it is checked against error observed on simulated truth.

This diagram in words

  1. Policy scenarios source — Agent-based simulation runs. Hours each, which is the problem.
  2. Road-link graph process — Links as nodes. The network is fixed; the demand on it is not.
    NumPy
  3. Graph surrogate process — PointNet encoder, TransformerConv and GAT layers.
    PyTorch · PyTorch Geometric
  4. Uncertainty estimate process — How unsure the surrogate is, per junction, not per run.
  5. Review policy gate — Reads the uncertainty and decides whether to answer at all.
  6. Answered directly sink — Milliseconds instead of hours, where the estimate supports it.
    Streamlit
  7. Held for review sink — The predictions the policy declines to make on its own.

01NetworkOne held-out scenario: a road network of 31,635 segments, drawn here in schematic.

Road segments per scenario
31,63559,851 edges
Held-out scenarios
1003,163,500 node-level predictions
Drawn here
113 segmentsschematic; the corpus is not redistributable
claimed1.0
Claimed coverage against delivered coverage. Below the line is over-confidence: at a nominal 90% the raw interval held 48.6% of the truth, and one temperature of 2.7025 moved it to 79.5%.
keep 0%keep everything
Error of the kept set as more of the network is accepted without review. Keeping the most confident half lowers mean absolute error from 3.9483 to 2.321 veh/h, a 41.22% reduction. The other half is not solved, it is sent to a person.

MC Dropout (30 stochastic passes), full cached 100-graph test set: 3,163,500 held-out node-level predictions. Uncertainty ranks error at Spearman ρ 0.4818.

Read the full background

Problem

Why this work exists

Paris-scale transport simulations are expensive, while a fast surrogate can fail unevenly across road links and policy regimes. Point predictions alone do not tell an analyst when to trust the approximation.

Contribution

What I can claim

Built on the MATSim corpus and PointNetTransfGAT infrastructure of prior work, then evaluated training variants, MC Dropout, deep ensembles, sigma scaling, split and adaptive conformal prediction, selective prediction, CQR, and error-detection diagnostics.

Technical questionHow does an expensive transport simulation become a confidence-aware review decision?
  1. 01SimulateCapacity-reduction policy scenarios
  2. 02RepresentOne graph node per road link
  3. 03ApproximatePointNet + TransformerConv + GAT
  4. 04QuantifyDropout, ensembles, and intervals
  5. 05DecideCalibrate, retain, or route to review
ArchitectureFive features per road segment, twice through a PointNet against each end of the segment, then attention over the neighbourhood, and a graph convolution for the single number out.
Layer sizes read from scripts/gnn/models/point_net_transf_gat.py, not from the write-up
StageShape
PointNet, start positionLocal MLP 7 to 256, global MLP 256 to 512 to 512
PointNet, end positionLocal MLP 514 to 256, global MLP 256 to 512 to 128
TransformerConv128 to 256, four heads
TransformerConv256 to 512, four heads
GATConv512 to 64
GATConv64 to 1
Technical questionOn the same five features and the same held-out scenarios, does the graph surrogate predict better than an ordinary tabular model?

No. A gradient-boosted tree reaches R² 0.7414 against the best graph model’s 0.6841, and trains in about three minutes rather than hours. The graph model earns its place a different way: on ranking its own errors, MC dropout on the weaker network reaches Spearman 0.4817 against the ensemble’s 0.3997, which is what the selective-review result is built on. The tree carries no notion of the network at all.

All rows: 80/10/10 scenario-level split, seed 42, 100 held-out scenarios, 3,163,500 test nodes. Source: results/trials/non_gnn_baseline_results.json
ModelR²MAE (veh/h)RMSE (veh/h)
XGBoost0.74142.77395.6933
Deep ensemble0.68413.48536.2927
Random forest0.66123.26286.5164
T8 with MC dropout0.58563.94797.2073
MLP0.49283.88317.9730
What did not workEight runs, in order. The two that weight the loss toward the large changes are the clearest result in the table, and neither was pursued.
Source: docs/verified/VERIFIED_RESULTS_MASTER.csv
RunWhat changedR²Split
T1First run, Excluded from comparison: a linear final layer, not the graph convolution T2 onward use.not comparable80/15/5
T2Correct architecture0.511780/15/5
T3Weighted loss, Weighting the loss toward large changes halves the fit.0.224680/15/5
T4Weighted loss, dropout back0.242680/15/5
T5Smaller batch0.555380/15/5
T6Lower learning rate0.522380/15/5
T780/10/10 split0.547180/10/10
T8Lower dropout, The model every uncertainty result on this page is built on.0.595780/10/10
Technical questionHow does accepted-set error change at six audited review-capacity choices?
Six selected audited operating points; values are observed, not interpolated
RetainedAccepted-set MAEReview queue
10%1.05 veh/h2,847,150
25%1.79 veh/h2,372,625
50%2.32 veh/h1,581,750
75%2.80 veh/h790,875
90%3.23 veh/h316,350
100%3.95 veh/h0

Six selected audited operating points from a 5-percentage-point evaluation grid. The interface never interpolates between them and shows no random-review baseline. Rows outside the retained set enter a review queue; the analysis does not label them wrong or unsafe.

Method

How a fast approximation earns the right to be used

An agent-based transport simulation is expensive enough that policy questions get asked less often than they should.

  1. Represent

    The network is the input.

  2. Propagate

    Information reaches a link by travelling through the structure.

  3. Predict

    Every junction now has an estimate.

  4. Quantify

    Each junction gets a measure of how much the model had to work with.

  5. Decline

    The junctions the model is least sure about are marked rather than hidden, which is what makes a review queue possible instead of a blanket trust decision.

  6. What this does not show

    The figure is a construction, not a measurement: ring size is a function of hop distance in this drawing. The measured relationship between uncertainty and error is in the evidence table below, along with what it does not establish.

How it was built

System

Workflow and decisions

The research separates fast surrogate inference from uncertainty estimation, calibration, and the downstream accept-or-review decision. Each layer has a distinct evaluation protocol so confidence claims are not inferred from point accuracy alone.

  1. 1MATSim policy scenarios
  2. 2Road-link graph representation
  3. 3PointNet + TransformerConv + GAT surrogate
  4. 4Uncertainty estimation
  5. 5Calibration and review policy
  • PyTorch
  • PyTorch Geometric
  • NumPy
  • SciPy
  • scikit-learn
  • Streamlit
  • LaTeX

Evidence

What is actually versioned

Held-out scope100 scenarios

3,163,500 road-link predictions in the cached test artifacts.

Primary GNNR2 0.596

Deterministic Trial 8; MAE 3.96 veh/h and RMSE 7.12 veh/h.

Uncertainty rankingrho 0.482

Pooled Spearman correlation between MC Dropout uncertainty and absolute error.

Selective review41.2% lower MAE

Accepted-set MAE at 50% retention versus accepting every prediction.

Deep ensembleR2 0.684

5-member ensemble; MAE 3.49 veh/h and uncertainty-error rho 0.400.

Marginal coverage90.02% / 95.01%

Reported final-thesis split-conformal protocol at nominal 90% / 95%.

Inspection points

Go directly to the evidence

How the work is checked

Quality controls

How the work is checked

  • Prediction-to-analysis workflow backed by tracked numeric artifacts
  • Aggregate-only local evidence dashboard with automated regression checks
  • Calibration protocols versioned instead of combining incompatible splits
  • Thesis claims cross-checked against generated reports and cached predictions

Limitations

Where the evidence stops

  • One Paris network, one capacity-reduction intervention family, and a fixed 1,000-scenario subset
  • Raw MATSim data is not publicly redistributable; a fresh clone cannot reproduce raw simulation-to-graph processing
  • Historical preprocessing used split-specific scalers, creating an evaluation-distribution methodology risk
  • Uncertainty ranking weakens in some high-change regimes, and coverage is marginal rather than a per-scenario guarantee
  • The portfolio application analyses cached artifacts; it is not a live policy simulator
  • On the same five features and the same held-out split, a gradient-boosted tree reaches R-squared 0.7414 against the best graph model's 0.6841. The graph surrogate is retained for its uncertainty behaviour, not for its accuracy.
What this changed in my practice

What this changed in my practice

Reliable ML is not one score. Ranking, calibration, conditional behaviour, compute cost, and the operational cost of review must be evaluated together.

Next evidence milestone: A future replication should fit preprocessing only on training data and test transfer across networks and intervention families.

LearnThe reasoning, written up

tutorial4 min read

Calibration Is Not Classification Accuracy

A model can be accurate and badly calibrated, or well calibrated and useless. What each property means, how to measure both, and why thresholds are a decision.

tutorial5 min read

Production AI Systems Need Refusal Paths

Every stage that can degrade should be able to decline. Where refusal belongs across ingestion, retrieval, extraction and inference, and what omitting it costs.