← SKAY · PortfolioOpen the console ↗
Streaming · Forecasting · Evaluated AI

UrbanSense
A digital twin for Casablanca

A real-time digital twin on Casablanca’s real road network: Kafka and Spark streaming, a GRU forecaster with honest uncertainty, an attack detector, and a bilingual assistant that is not allowed to invent numbers. Casablanca has no open real-time traffic feed, so the dynamics are replayed from METR-LA (labelled everywhere), with live TomTom data as an optional source. Final-year team project (4 engineers), defended September 2026 — jury verdict: “excellent work”.

870 ms
p95 latency
100%
inside 2 s budget
3.07
GRU MAE (mph)
88.5%
conformal coverage

Architecture

Sensor to answer, in under two seconds.

01 · IngestKafka (KRaft) carries sensor messages for 207 sensors placed on the real Casablanca road network (OpenStreetMap). Traffic dynamics are replayed from METR-LA, a real academic dataset — labelled as such in the UI — with live TomTom Casablanca traffic as an optional second source.
02 · StreamSpark Structured Streaming validates against JSON Schema contracts and writes to InfluxDB + MongoDB.
03 · ForecastA GRU seq2seq model (928k params) predicts traffic 15 minutes ahead, with split-conformal uncertainty bands.
04 · DefendA false-data-injection detector flags spoofed sensors — and its blind spot is published, not hidden.
05 · ExplainA bilingual EN/FR assistant service answers from the data, with every number checked against its source. It is evaluated as a backend service; the public console does not wire it in yet, and says so.

Measured, not asserted

Every number comes from a run you can repeat.

emit → store p50260 ms
emit → store p95870 ms
messages inside the 2 s budget8,280 / 8,280
GRU MAE @15 min (METR-LA)3.07 mph
published FC-LSTM baseline3.44 mph
conformal coverage (90% nominal)88.5%

16/16 CI checks green with the real Docker stack up. The public console runs in replay mode — there is no public backend, and it says so.

What stands out

01
My part
Owned M3 — the Next.js + deck.gl console and the agentic assistant — and implemented all four modules at the team's request. Wrote the 18,000-word report in French, the 18-slide deck and a 22-page rehearsal guide.
02
Beats the baseline, honestly
MAE 3.07 beats the published FC-LSTM (3.44) and correctly never beats DCRNN (2.77) — a result that did would signal leakage, so it was checked for.
03
An evaluation that says no
A 34-question bilingual golden set plus a mechanical groundedness check rejected two LLMs (35.3% and 55.9% grounded) for inventing numbers. The shipped assistant routes deterministically instead.
04
A negative result, published
An A4 corridor attack defeats spatial detection (1.0× vs 9.4× / 3.8× / 2.2× on A1–A3). CUSUM partially catches it at a 28.86% false-positive rate — reported as disqualifying, not buried.
Kafka (KRaft)Spark Structured StreamingInfluxDBMongoDBPyTorch GRUConformal predictionNext.js 16deck.glDocker ComposeJSON SchemaCI

Explore the twin.

The console replays the labelled METR-LA traffic on Casablanca’s real streets. The source is a private team repository — available on request.

Open the console ↗

Built by SKAY · Oussama Skia with a team of four — AI / ML Engineer · Casablanca