---
title: Data engine and offline evaluation for end-to-end driving
url: https://gurkanozkan.ai/learn/design/mle-data-engine-and-offline-evaluation-for-end-to-end-driving-11/
markdown: https://gurkanozkan.ai/learn/design/mle-data-engine-and-offline-evaluation-for-end-to-end-driving-11.md
kind: design
role: ML engineering
json: https://gurkanozkan.ai/api/learn/design/mle-data-engine-and-offline-evaluation-for-end-to-end-driving-11.json
---

# Data engine and offline evaluation for end-to-end driving

Design the pipeline that turns fleet driving logs into training data for an end-to-end driving model and decides whether a new model is ready for road testing.

## Constraints

- hundreds of petabytes of multimodal logs
- thousands of hours of new driving per week
- safety-driver interventions as rare, high-value events

## What to cover

- **Requirements**: Design the pipeline that turns fleet driving logs into training data for an end-to-end driving model and decides whether a new model is ready for road testing.
- **Estimates**: hundreds of petabytes of multimodal logs; thousands of hours of new driving per week; safety-driver interventions as rare, high-value events.
- **API**
- **Data model**
- **Architecture**: Ingestion and schema normalisation; automatic scenario tagging and embedding-based search.; Intervention mining; curation with a model-in-the-loop (better models select better data).; Large-scale distributed training.; Evaluation ladder: open-loop metrics → closed-loop simulation and generative world-model scenarios for what-if testing → track tests → supervised road tests.; Regression suite of hard scenarios; release gating.
- **Deep dives**
- **Trade-offs**: data quantity vs curation quality; simulation fidelity vs scale; open-loop speed vs closed-loop validity; generalisation across vehicle platforms.
- **Evaluation**: Scenario-weighted pass rates; intervention rate per 1,000 km in supervised trials.; Closed-loop collision and comfort metrics; correlation of sim scores with on-road outcomes (rank agreement).

## Reference design

### Requirements

**Two systems**
- **Data engine**: ingest fleet logs (multi-camera video, other sensors, vehicle signals, driver interventions), normalise them across vehicle platforms, tag and index scenarios, mine valuable data (interventions, rare events, model disagreements), and build versioned training sets for an end-to-end driving model.
- **Evaluation and release gating**: decide, with evidence, whether a new model is safe and good enough to go to supervised road testing.

**Constraints and assumptions to confirm**
- Hundreds of petabytes in storage; thousands of hours of new driving per week across cities and vehicle platforms (different cameras and calibrations).
- Safety-driver interventions are rare and are the highest-value signal; each needs a reason (safety, comfort, route, system fault).
- Privacy: faces and number plates blurred before data is used beyond safety investigation; UK GDPR retention rules; data-sharing agreements with fleet partners.
- Reproducibility: any model must be traceable to the exact data, code and configuration it was trained on.
- Release decisions involve a safety team and a documented safety case; the pipeline produces evidence, it does not decide alone.
- **Users**: research engineers (dataset building), safety engineers (evaluation), operations (road testing).


### Estimates

- **New data**: assume 3,000 driving hours/week. ~8 cameras at ~10 Mbps compressed ≈ 36 GB/h, plus other sensors ≈ **~40 GB/h** → 120 TB/week ≈ **6 PB/year raw**. Decoded frames at several resolutions, embeddings, reconstructions and simulation outputs multiply that 5–10×, so hundreds of PB with history is plausible.
- **Distance**: at ~25 km/h urban average, 3,000 h ≈ 75,000 km/week. At one intervention per ~50 km in a newly launched city, ~1,500 interventions/week — rare relative to the data, but plenty to mine.
- **Clips**: 3,000 h = 10.8M seconds ≈ 1.1M ten-second clips/week; curation might up-weight the most informative ~10–20%.
- **Tagging and embedding**: sampling 2 fps × 8 cameras ≈ 173M images/week; a vision encoder at ~2k images/s per GPU ≈ 86k GPU-seconds ≈ 24 GPU-hours/week — cheap next to training.
- **Training I/O**: 1,000 GPUs × 5 samples/s × (8 cameras × 6 frames × ~100 KB) ≈ **24 GB/s** sustained reads → pre-sharded, compressed sample files on a high-throughput store with local NVMe caching.
- **Closed-loop evaluation**: 10k scenarios × 30 s × 3 seeds = 900k simulated seconds per candidate; at ~1× real time per GPU for a neural simulator ≈ 250 GPU-hours per model — affordable per release candidate, too much per training checkpoint, hence an evaluation ladder.


### API

Internal services rather than a public API:
```
Search:   POST /v1/scenes/search {text: "cyclist overtaking at night in rain",
                                  filters: {city, platform, date_range, tags, intervention: true},
                                  embedding_query?: clip_id}   → [{clip_id, score, thumbnails}]
Datasets: POST /v1/datasets {name, query | clip_ids, sampling_weights, split_rules, exclusions}
                             → {dataset_id, version, manifest_uri, stats}
Mining:   POST /v1/mining/jobs {type: "intervention"|"disagreement"|"rare_event", model_id, window}
Eval:     POST /v1/eval/runs {model_id, suite: "release-v14", levels: ["open_loop", "closed_loop"]}
                             → {run_id}; GET /v1/eval/runs/{id} → metrics per scenario, regressions
Release:  POST /v1/releases/{model_id}/evidence  → assembled report for the safety review
```
Every dataset version and evaluation suite is immutable, so results are reproducible and comparable.


### Data model

- **DriveLog**: vehicle, platform (sensor rig and calibration version), software version, route, city, date, weather, total distance, storage URIs, privacy status (blurred / restricted).
- **Clip**: log, time window, sensor streams, auto-tags (weather, road type, junction type, agents present, manoeuvre), embedding, quality flags (sensor dropouts, calibration drift).
- **Event**: intervention or disengagement (timestamp, reason, driver note), hard braking, near miss, model–driver disagreement.
- **ScenarioTaxonomy**: hierarchical categories (unprotected turn, roundabout, pedestrian crossing, cyclist overtake …) with criticality weights.
- **DatasetVersion**: clip ids, sampling weights, splits, exclusion rules, lineage, statistics by category.
- **Model**: checkpoint, dataset version, code commit, config, training metrics.
- **EvalSuite / EvalRun**: suite version (scenario list, sim versions, metrics definitions), run results per scenario and seed.
- **ReleaseRecord**: model, evidence, decision, approvers, conditions (cities, speeds, weather).


### Architecture

```
Fleet ─► upload (depot, bulk) ─► Ingestion: decode, time-sync, schema normalisation
   across platforms, calibration attach, privacy blurring, quality checks
   ─► Lake (raw + derived, tiered storage)
   ─► Auto-tagging + embeddings ─► Scenario index (text and embedding search)
   ─► Mining: interventions, rare events, model–driver disagreement, uncertainty
   ─► Curation with model in the loop (current model scores where it is weak)
   ─► Dataset builder (versioned manifests, sampling weights) ─► sharded samples
   ─► Distributed training (data-parallel + sharding, checkpoints, lineage)
Evaluation ladder per candidate:
   open-loop metrics (cheap, every checkpoint)
   ─► closed-loop simulation: reconstructed real scenes + generative world-model
      what-if variants + hard-scenario regression suite
   ─► track tests (closed course, scripted hazards)
   ─► supervised road tests (safety drivers, limited ODD) ─► fleet data again
Release gating: evidence report ─► safety review ─► go / no-go with conditions
```


### Deep dives

**Intervention mining and model-in-the-loop curation.** Every intervention is pulled with ~20 s of context, triaged by reason, and turned into a training example (what the human did) and an evaluation scenario (closed-loop replay and generated variants). The current model also scores the whole new corpus: clips where it disagrees with the human driver or is uncertain are up-weighted, so better models select better data. Guard against over-fitting to the mined distribution by keeping a stratified random sample in every dataset.

**Why open-loop is not enough.** Open-loop metrics (trajectory error against the logged human path) are cheap but poorly correlated with driving quality: small errors compound in closed loop, and the logged world does not react to the model. Closed-loop simulation lets the model drive and other agents respond, catching compounding errors. Generative world models add what-if variations (a pedestrian stepping out, different weather) around real scenes.

**Trusting the simulator.** Measure rank agreement (e.g. Kendall's tau) between simulated scores and on-road intervention rates across past model versions; re-weight scenarios and fix simulator gaps where they disagree.


### Trade-offs

- **Data quantity vs curation quality**: more hours improve coverage, but most driving is uneventful; curated, re-weighted data improves rare-scenario behaviour faster per GPU-hour. Keep a random baseline slice to avoid blind spots introduced by curation.
- **Simulation fidelity vs scale**: photoreal neural reconstructions and world models are expensive per scenario; cheaper simulators run more scenarios but with a sim-to-real gap. Use cheap levels to filter and expensive ones to decide.
- **Open-loop speed vs closed-loop validity**: open-loop runs on every checkpoint in minutes; closed-loop on release candidates only. Track how well open-loop predicts closed-loop so the ladder filters correctly.
- **Generalisation across vehicle platforms**: mixing platforms grows the data but differing sensors and calibrations can confuse the model; normalise inputs, condition on platform, and evaluate per platform before deploying to a new one.


### Evaluation

- **Scenario-weighted pass rates**: per category pass rates in closed loop, weighted by criticality and real-world frequency; a release must not regress any safety-critical category (e.g. zero new collisions in the hard-scenario suite), and the weighted score must beat the incumbent beyond its confidence interval across seeds.
- **Closed-loop metrics**: collisions, near misses (time-to-collision thresholds), traffic-rule violations, progress and route completion, comfort (jerk, harsh braking).
- **Road outcomes**: interventions per 1,000 km in supervised trials, split by reason, city, weather and road type, with confidence intervals (interventions are rare, so long trials are needed for tight bounds).
- **Simulator validity**: rank agreement between sim scores and on-road outcomes across model versions, reviewed each release.
- **Data-engine health**: ingestion lag, tagging accuracy on audited samples, share of interventions mined and triaged within a week, dataset reproducibility checks.


## What a strong design shows

- Treats interventions as the most valuable signal and builds mining, triage and scenario creation around them.
- Uses the model in the loop to select data and versions every dataset for reproducibility.
- Builds an evaluation ladder from open-loop to closed-loop simulation, track and supervised road tests, explaining why open-loop alone misleads.
- Validates the simulator against road outcomes with rank agreement.
- Gates releases on scenario-level non-regression and produces evidence for a human safety review.

---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
