adsb-rwr TrajNet
Trajectory forecasts for low-level air traffic from its live ADS-B track: where a helicopter or a military aircraft will be 30 s to 15 min from now, as a mixture of eight hypotheses, plus the probability that it comes within a given radius of a given point by each horizon. It is the model behind adsb-rwr, a home "radar warning receiver" that alerts a few minutes before interesting aircraft pass a house.
Trained on MuteXX/adsb-lol-low-level-traces-2026, rotorcraft, military and low general-aviation traces derived from adsb.lol globe_history (ODbL).
Variants
| folder | encoder | params | training days | windows | epochs | notes |
|---|---|---|---|---|---|---|
v5-tf-large | transformer 192 wide, 3 layers, 4 heads | 4.4 M | 90 (2026-07-24 to 2026-10-18) | 106 M | 12 | the alerter's production model at the time of writing |
v5-cap-big180 | transformer 256 wide, 4 layers, 4 heads | 6.1 M | 177 (2026-04-25 to 2026-10-18) | 212 M | 8 | twice the data; a small, consistent gain |
Both read the same inputs and ship with the exact place catalogue they were trained with in their ref/
folder (hotspots-v4.parquet and its two flow tables, built from the 90-day set, plus the OurAirports list).
The 177-day catalogue in the dataset repository is newer and is not what these weights expect.
What the model sees and says
Inputs, per aircraft, computed from its own track at prediction time:
- the last 300 s of fixes (up to 64 points: position, altitude, speed, track, vertical rate, source flags) in the aircraft's own frame, and a coarse 48-point summary of the last hour;
- static features: class (rotorcraft, military, general aviation), speed, altitude, time of day and weekday, a flight summary, identity embeddings for the airframe, callsign, squawk and operator (unknown is a valid value);
- 48 place tokens attended over by cross-attention: the nearest and most reachable entries of a traffic-learned map (where aircraft of its class land, lift off and loiter), airports, and the learned origin-to-destination and path-conditioned flows between them.
Outputs, per aircraft, for 30 horizons from 30 s to 900 s:
- an 8-component Gaussian mixture over the position at each horizon (weights, means, per-axis sigmas), the weighted mean, an altitude mean and sigma;
- the probability that the track has ended (landed or stopped) by each horizon;
- for any query points handed in (the house), the probability of coming within the query radius by each horizon, from a dedicated pass head on the trunk output.
The alerter sums the mode mass that crosses the house's radius, weighs it by the chance the flight is still airborne, and uses the pass head's answer as the alert probability.
Numbers
Held-out days 2026-10-19 to 2026-10-21, never used for training or model selection. "Mode" is the position error of the most likely component at 300 s, "mean" the weighted mean, "best" the closest component (what a perfect choice between hypotheses would give).
| rotorcraft, 300 s ahead | straight line | constant turn | v5-tf-large mode / mean / best | v5-cap-big180 mode / mean / best |
|---|---|---|---|---|
| all held-out windows | 6535 m | 6351 m | 3710 / 3575 / 1532 m | 3600 / 3495 / 1494 m |
The same models judged by what matters to the alerter, replaying the held-out days through the production engine for one house (replay with a 4 km radius; "lead" is alert time to entry into the radius):
| rotorcraft passes (1064) | alerted | median lead | ≥180 s | ≥300 s | false alerts / h |
|---|---|---|---|---|---|
| straight-line rule | 994 | 237 s | 55 % | 40 % | 0.07 |
| model, pass mass ≥ 0.1 | 1061 | 350 s | 73 % | 57 % | 0.10 |
| model, pass mass ≥ 0.3 | 1033 | 192 s | 51 % | 33 % | 0.02 |
Across five houses and four days (64 passes), with the shipped alerter configuration (pass threshold 0.7 for rotorcraft, 0.6 for military, a gate on the straight-path rule, formation grouping, an early heads-up tier at 0.3):
| passes alerted | rotorcraft median lead | rotorcraft ≥300 s | false alerts (20 house-days) | heads-ups: passes warned / false | |
|---|---|---|---|---|---|
| v5-tf-large | 63 / 64 | 269 s | 19 / 47 | 6 rotor + 6 mil | 49 at 339 s / 78 |
| v5-cap-big180 | 63 / 64 | 277 s | 21 / 47 | 8 rotor + 6 mil | 49 at 332 s / 76 |
The two are within noise of each other at the alert level, which is the point: the trajectory error improved by 3 % and the alerts did not change.
What the model cannot do: the remaining error is intent. A helicopter's destination is a dispatch decision that is not in its track; the best hypothesis is typically within 1.5 km while the chosen one is 3.7 km off. More data and more parameters were measured not to move this (90 to 180 days: 1 to 2 %; 256/4 against 192/3 at 90 days: equal).
Running it
code/ holds the inference code: the feature pipeline, the place tokenizer, the network and a small HTTP sidecar
(MIT licence; code/requirements.txt: torch, numpy, scipy, pyarrow). It needs a Python 3.12 or newer.
One aircraft from a JSON file of fixes, on the CPU:
cd code && pip install -r requirements.txt
python predict.py ../v5-tf-large --fixes track.json --cls rotor --type EC35 --query 51.5,7.9 --radius-m 4000
track.json is a list of fixes, oldest first, at least four spanning 20 s without a 90 s gap:
[{"t": 1790000000.0, "lat": 51.9, "lon": 7.6, "alt_m": 450, "gs_ms": 55, "track": 120, "vrate_ms": 0, "src": "adsb"}, ...].
The answer is the mixture (weight, [lat, lon] per horizon, sigma_m per horizon), the weighted mean path,
the altitude profile, the end-of-track curve and, with --query, the probability of coming within the radius of
that point by each horizon.
As a service, answering POST /predict for one aircraft or {"batch": [...]} for many in one forward pass:
cd code && python -m adsb_rwr_ml.serve ../v5-tf-large/model.pt --hotspots ../v5-tf-large/ref/hotspots-v4.parquet \
--od ../v5-tf-large/ref/hotspots-v4-od.parquet --od2 ../v5-tf-large/ref/hotspots-v4-od2.parquet \
--airports ../v5-tf-large/ref/airports.csv --port 8783
The request body is the same object as above plus optional identity keys (hex, callsign, squawk, op),
and queries / radius_m. Twelve aircraft take about 30 ms on a CPU, the GPU is not needed. The checkpoint is a
plain torch.save dict with model (state dict) and args (every training argument, including the horizons and
the feature layout); adsb_rwr_ml.model.from_args(args) rebuilds the network.
ONNX, in-process and in the browser
Each variant also ships model.onnx (fp32, opset 18, dynamic batch and query count, the serving settings in the
graph's metadata) and ref/hotspots-v4-catalogue.bin, the same place catalogue as a flat binary bundle (typed
arrays plus a JSON header, 122 MB, almost all of it the path-conditioned flows). v5-tf-large/ref/hotspots-v4-catalogue-europe.bin
is the same bundle cut to Europe (35 to 72 N, 12 W to 32 E; 27 MB): tokens are identical to the full catalogue's for
aircraft at least 300 km inside the box, so it is what the browser demo loads. The graph takes the model inputs
plus the pass-head queries and returns the mixture, the altitude profile, the end-of-track logits and the pass
logits in one call. code/adsb_rwr_ml/export_onnx.py and catalogue_bundle.py are the tools that produced them.
The feature pipeline exists in TypeScript as well (the adsb-rwr alerter's src/ml/, published with the code),
checked against the Python reference on real requests to 2e-16 relative and against this graph to 1e-4. With it
the alerter runs the model in-process on ONNX Runtime for Node, and a static page runs it in the browser on
ONNX Runtime Web. Measured, median per batch:
| aircraft | ONNX Runtime in Node, 8 threads | Python sidecar, GPU | Python sidecar, CPU |
|---|---|---|---|
| 1 | 2 ms | 4.5 ms | 5.4 ms |
| 12 | 13 ms | 30 ms | 34 ms |
| 60 | 68 ms | 149 ms | 166 ms |
In the browser one aircraft takes 6 to 8 ms on WASM with four threads and 21 ms on WebGPU after a 1.6 s first call. Known quirk, shared by every runtime: about 18,000 catalogue cells hold two entries at identical coordinates, and which one enters the token set at a tier boundary depends on tie order; the Python sidecar follows its KD-tree, the TypeScript port the catalogue index. On 5 of 39 real requests that moves the mean path by up to 2.8 km.
Licence and attribution
The weights were trained on an ODbL database and are published under the ODbL as well; the place catalogues in
ref/ are derivative databases of adsb.lol globe_history and carry the same licence. The code under code/ is MIT
(see LICENSE). Contains data from
adsb.lol globe_history, © adsb.lol contributors, made available under the Open Database License (ODbL) 1.0.
ref/airports.csv is from OurAirports (public domain).