2025–2026 · in progress
Predicting vehicle rollover
Predicting, one to four seconds ahead, whether a heavy vehicle is about to roll over, from its onboard sensors; models trained in simulation, then fine-tuned and tested on real test-track recordings.
Context
Collective research project at École polytechnique for the French armament procurement agency (DGA), supervised by Sébastien Aubin (DGA); I lead the team of five students.
Stack
- PyTorch
- NumPy
- LSTM
- PatchTST
- Neural ODE
- XGBoost
- Optuna
Pipeline
- 110-DOF simulator (vdsim, NumPy), calibrated on real runs
- 21.5 s windows of onboard signals at 100 Hz
- 3Neural ODE features + LSTM / PatchTST
- 4Pre-train in simulation, fine-tune on the real runs
- 5Forecast max |LTR| 1 to 4 s ahead, alert at ≥ 0.7
- longest prediction horizon
- 4 s
- real test-track runs of an instrumented 3.2 t vehicle
- 392
- AUC-PR 2 s ahead on real runs beyond the training range, final model
- 0.937
How it works
A vehicle dynamics simulator generates trajectories and the lateral load-transfer ratio; three architectures (LSTM, PatchTST, gradient boosting) learn to forecast its maximum over the next seconds, optionally fed with features from a Neural ODE trained on the simulator; splits are made by scenario, never by timestep.
Results
Baseline: an LSTM trained only on real runs (243 runs whose peak load transfer stays below 0.9) catches 85% of dangerous windows (LTR ≥ 0.7) two seconds ahead on runs that go beyond it, at 78% precision (AUC-PR 0.916), and 81% four seconds ahead. In simulation, the same approach held 91 to 98% recall on out-of-range splits. The final model adds Neural ODE features, is pre-trained on simulation, then fine-tuned on the real runs, which are the costly part: AUC-PR 0.914 with a quarter of them, 0.928 with half and 0.937 with all of them (mean of 3 seeds). Most of the gain comes with a quarter to a half of the real runs, and with all of them it beats the baseline.
Technical details
Problem
The load-transfer ratio LTR = (F_left − F_right) / (F_left + F_right) compares the vertical forces on the two sides of the vehicle: 0 when balanced, ±1 when the wheels of one side leave the ground. Reading the current LTR gives no warning before the event. The models forecast the maximum |LTR| over the next 1, 2 or 4 seconds from the last 1.5 s of onboard signals at 100 Hz, and raise an alert above 0.7.
- Target
- max |LTR| over the next 1, 2 or 4 s
- Input window
- 150 steps (1.5 s at 100 Hz), stride 10
- Signals (simulation)
- 8: vx, vy, yaw, yaw rate, roll, pitch, steering angle and rate
- Signals (real runs)
- 7: the same without yaw, which drifts when integrated
- Danger threshold
- |LTR| ≥ 0.7
- Splits
- by scenario; test runs peak above the training range (0.7, 0.8 or 0.9)
Models
Three architectures were compared on the same windows. The LSTM, the smallest, generalised best beyond the training range. In simulation the models were trained with a pinball loss on the 10th, 50th and 90th percentiles and alerts use the 90th, since missing a rollover costs more than a false alarm. On the imbalanced real data the quantile loss collapsed, and a weighted MSE (1 + 9y)(ŷ − y)² replaced it.
- LSTM
- 1 layer, hidden 64, 21K parameters
- PatchTST
- patches of 15 steps, d_model 64, 4 heads, 2 layers, 109K parameters
- XGBoost
- 200 trees, depth 6, on the flattened window
- Training
- Adam, lr 1e-3, batch 64, early stopping (patience 15), gradient clipping 1.0
Neural ODE
A Neural ODE learns the vehicle dynamics ẋ = f(x, u) from the simulator: 6 state variables and 2 steering commands go through a 256–256–128 network with two heads, the state derivatives and the instantaneous LTR, integrated with an Euler step of 10 ms. It is trained first on one-step transitions, then on a curriculum of rollouts from 5 to 400 steps (0.05 to 4 s) with scheduled sampling that goes from full teacher forcing to none.
Its 128-dimensional hidden layer, projected to a few learned features, is then fed to the LSTM or PatchTST next to the raw signals. In simulation it raised PatchTST's AUC-PR on the hardest split from 0.69 to 0.88; On the real runs (trained on runs whose peak LTR stays below 0.9, tested on those that exceed it, 2 s ahead, mean of 3 seeds), with the backbone frozen and 16 features, it lifted the synthetic-pretraining pipeline fine-tuned on all the real training runs from 0.898 to 0.937 AUC-PR, and from 0.856 to 0.914 when fine-tuned on a quarter of them.
- Network
- 8 → 256 → 256 → 128, SiLU, 102K parameters
- Phase 1
- one-step transitions, lr 1e-3, input noise σ = 0.1
- Phase 2
- rollouts 5 → 400 steps, Huber loss, lr 1e-4
- Use
- hidden layer → 16 or 32 features for the sequence model
Data and search
684 simulated scenarios from a 10-degree-of-freedom vehicle simulator (Pacejka tyres, PID speed and Stanley steering controllers), then 392 real test-track runs of an instrumented 3.2 t vehicle with six-axis force sensors on all four wheels. The simulator was calibrated on the real runs (centre-of-gravity height, roll stiffness and damping, tyre stiffness), which brought the simulated-to-measured LTR ratio from 1.28 to 1.09.
A synthetic driver built from two Ornstein–Uhlenbeck processes (speed and steering), fitted to the real runs' statistics, generated 400 more scenarios in five minutes. With Neural ODE features, pre-training on them and fine-tuning on growing fractions of the real runs gives 0.914 AUC-PR at a quarter, 0.928 at half and 0.937 at all of them: most of the gain comes with a quarter to a half of the real runs. Hyperparameters were searched with Optuna (TPE sampler, median pruner): about 180 trials, 48 hours on an Apple M-series GPU.
- Simulated scenarios
- 684 (15 s each, 100 Hz)
- Real runs
- 392 of 488 files usable (evasive manoeuvres, slaloms, lane changes, sinusoids)
- Synthetic driver
- 400 scenarios, Ornstein–Uhlenbeck speed and steering
- Hyperparameter search
- Optuna, ~180 trials, ~48 h
- Real-only LSTM, 2 s
- AUC-PR 0.916, recall 85.1%, precision 78.4%
- Final model, 2 s
- AUC-PR 0.937: Neural ODE features, synthetic pre-training, all real runs