Dataset Viewer
Auto-converted to Parquet Duplicate
sample_id
stringlengths
23
25
mask_name
stringclasses
10 values
window_len_h
int64
6
12
n_steps
int64
72
144
n_masked
int64
0
120
⌀
n_evaluable
int64
0
120
⌀
block_start
int64
-1
142
⌀
block_len
int64
0
120
⌀
205136000_0000_w0000_12h
cont_2h
12
144
24
24
6
24
205136000_0000_w0000_12h
cont_4h
12
144
48
48
2
48
205136000_0000_w0000_12h
cont_6h
12
144
72
72
50
72
205136000_0000_w0000_12h
cont_8h
12
144
96
96
39
96
205136000_0000_w0000_12h
cont_10h
12
144
120
120
2
120
205136000_0000_w0000_12h
mcar_30
12
144
43
43
2
43
205136000_0000_w0000_12h
mcar_50
12
144
72
72
3
72
205136000_0000_w0000_12h
realgap
12
144
0
0
-1
0
205136000_0000_w0000_6h
cont_1h
6
72
12
12
3
12
205136000_0000_w0000_6h
cont_2h
6
72
24
24
39
24
205136000_0000_w0000_6h
cont_3h
6
72
36
36
12
36
205136000_0000_w0000_6h
cont_4h
6
72
48
48
17
48
205136000_0000_w0000_6h
mcar_30
6
72
21
21
6
21
205136000_0000_w0000_6h
mcar_50
6
72
36
36
1
36
205136000_0000_w0000_6h
realgap
6
72
0
0
-1
0
205136000_0000_w0072_6h
cont_1h
6
72
12
12
3
12
205136000_0000_w0072_6h
cont_2h
6
72
24
24
47
24
205136000_0000_w0072_6h
cont_3h
6
72
36
36
23
36
205136000_0000_w0072_6h
cont_4h
6
72
48
48
23
48
205136000_0000_w0072_6h
mcar_30
6
72
22
22
0
22
205136000_0000_w0072_6h
mcar_50
6
72
36
36
4
36
205136000_0000_w0072_6h
realgap
6
72
0
0
-1
0
205136000_0001_w0000_12h
cont_2h
12
144
24
24
2
24
205136000_0001_w0000_12h
cont_4h
12
144
48
48
32
48
205136000_0001_w0000_12h
cont_6h
12
144
72
72
55
72
205136000_0001_w0000_12h
cont_8h
12
144
96
96
12
96
205136000_0001_w0000_12h
cont_10h
12
144
120
120
21
120
205136000_0001_w0000_12h
mcar_30
12
144
43
43
5
43
205136000_0001_w0000_12h
mcar_50
12
144
72
72
1
72
205136000_0001_w0000_12h
realgap
12
144
0
0
-1
0
205136000_0001_w0072_12h
cont_2h
12
144
24
24
70
24
205136000_0001_w0072_12h
cont_4h
12
144
48
48
21
48
205136000_0001_w0072_12h
cont_6h
12
144
72
72
40
72
205136000_0001_w0072_12h
cont_8h
12
144
96
96
40
96
205136000_0001_w0072_12h
cont_10h
12
144
120
120
3
120
205136000_0001_w0072_12h
mcar_30
12
144
43
43
0
43
205136000_0001_w0072_12h
mcar_50
12
144
72
72
1
72
205136000_0001_w0072_12h
realgap
12
144
0
0
-1
0
205136000_0001_w0000_6h
cont_1h
6
72
12
12
25
12
205136000_0001_w0000_6h
cont_2h
6
72
24
24
8
24
205136000_0001_w0000_6h
cont_3h
6
72
36
36
12
36
205136000_0001_w0000_6h
cont_4h
6
72
48
48
23
48
205136000_0001_w0000_6h
mcar_30
6
72
21
21
2
21
205136000_0001_w0000_6h
mcar_50
6
72
36
36
2
36
205136000_0001_w0000_6h
realgap
6
72
0
0
-1
0
205136000_0001_w0072_6h
cont_1h
6
72
12
12
10
12
205136000_0001_w0072_6h
cont_2h
6
72
24
24
45
24
205136000_0001_w0072_6h
cont_3h
6
72
36
36
31
36
205136000_0001_w0072_6h
cont_4h
6
72
48
48
22
48
205136000_0001_w0072_6h
mcar_30
6
72
22
22
0
22
205136000_0001_w0072_6h
mcar_50
6
72
36
36
0
36
205136000_0001_w0072_6h
realgap
6
72
0
0
-1
0
205136000_0001_w0144_6h
cont_1h
6
72
12
12
27
12
205136000_0001_w0144_6h
cont_2h
6
72
24
24
42
24
205136000_0001_w0144_6h
cont_3h
6
72
36
36
23
36
205136000_0001_w0144_6h
cont_4h
6
72
48
48
1
48
205136000_0001_w0144_6h
mcar_30
6
72
22
22
1
22
205136000_0001_w0144_6h
mcar_50
6
72
36
36
2
36
205136000_0001_w0144_6h
realgap
6
72
0
0
-1
0
205136000_0004_w0072_12h
cont_2h
12
144
24
24
114
24
205136000_0004_w0072_12h
cont_4h
12
144
48
48
86
48
205136000_0004_w0072_12h
cont_6h
12
144
72
72
60
72
205136000_0004_w0072_12h
cont_8h
12
144
96
96
42
96
205136000_0004_w0072_12h
cont_10h
12
144
120
120
21
120
205136000_0004_w0072_12h
mcar_30
12
144
40
40
11
40
205136000_0004_w0072_12h
mcar_50
12
144
66
66
11
66
205136000_0004_w0072_12h
realgap
12
144
11
0
1
11
205136000_0004_w0144_12h
cont_2h
12
144
24
24
79
24
205136000_0004_w0144_12h
cont_4h
12
144
48
48
25
48
205136000_0004_w0144_12h
cont_6h
12
144
72
72
7
72
205136000_0004_w0144_12h
cont_8h
12
144
96
96
21
96
205136000_0004_w0144_12h
cont_10h
12
144
120
120
18
120
205136000_0004_w0144_12h
mcar_30
12
144
43
43
0
43
205136000_0004_w0144_12h
mcar_50
12
144
72
72
2
72
205136000_0004_w0144_12h
realgap
12
144
0
0
-1
0
205136000_0004_w0072_6h
cont_1h
6
72
12
12
51
12
205136000_0004_w0072_6h
cont_2h
6
72
24
24
33
24
205136000_0004_w0072_6h
cont_3h
6
72
36
36
17
36
205136000_0004_w0072_6h
cont_4h
6
72
48
48
18
48
205136000_0004_w0072_6h
mcar_30
6
72
18
18
16
18
205136000_0004_w0072_6h
mcar_50
6
72
30
30
20
30
205136000_0004_w0072_6h
realgap
6
72
11
0
1
11
205136000_0004_w0144_6h
cont_1h
6
72
12
12
44
12
205136000_0004_w0144_6h
cont_2h
6
72
24
24
2
24
205136000_0004_w0144_6h
cont_3h
6
72
36
36
22
36
205136000_0004_w0144_6h
cont_4h
6
72
48
48
21
48
205136000_0004_w0144_6h
mcar_30
6
72
22
22
0
22
205136000_0004_w0144_6h
mcar_50
6
72
36
36
2
36
205136000_0004_w0144_6h
realgap
6
72
0
0
-1
0
205136000_0004_w0216_6h
cont_1h
6
72
12
12
3
12
205136000_0004_w0216_6h
cont_2h
6
72
24
24
5
24
205136000_0004_w0216_6h
cont_3h
6
72
36
36
26
36
205136000_0004_w0216_6h
cont_4h
6
72
48
48
12
48
205136000_0004_w0216_6h
mcar_30
6
72
22
22
3
22
205136000_0004_w0216_6h
mcar_50
6
72
36
36
0
36
205136000_0004_w0216_6h
realgap
6
72
0
0
-1
0
205136000_0005_w0000_12h
cont_2h
12
144
24
24
35
24
205136000_0005_w0000_12h
cont_4h
12
144
48
48
6
48
205136000_0005_w0000_12h
cont_6h
12
144
72
72
22
72
205136000_0005_w0000_12h
cont_8h
12
144
96
96
16
96
End of preview. Expand in Data Studio

EnvShip-Voyage: Long-Term Ship Trajectory Imputation (and Prediction)

A benchmark for filling in long gaps in ship trajectories. Ships broadcast their position over AIS, but the signal drops out for minutes to hours at a time. This dataset gives you clean, fixed-length windows of vessel movement with the gaps marked, so you can train and fairly compare models that reconstruct the missing part of a track.

It is built from six months of Danish AIS data (cargo and tanker vessels) and comes with the environment around each track already sampled — water depth, distance to shore, and distance to the nearest shipping fairway — which most trajectory datasets don't provide.

  • 179,131 ready-to-use samples (windows), split so that no vessel appears in more than one split.
  • Two window lengths: 12 h (144 steps) and 6 h (72 steps), on a fixed 5-minute grid.
  • A frozen mask bank: for every sample, a set of pre-computed "hide these steps" patterns, so everyone evaluates on exactly the same gaps.
  • Baseline results (linear/spline interpolation) included as a reference point.

Quick facts

Samples (windows) 179,131
Splits (train / val / test) 118,292 / 19,936 / 40,903
Window lengths 12 h = 144 steps, 6 h = 72 steps (5-min grid)
Vessels 5,804 (cargo + tanker), vessel-disjoint splits
Region Danish waters (lat 53.5–59.0, lon 7.5–14.0)
Time span Jan–Jun 2026
Source Danish Maritime Authority AIS + OpenStreetMap seamarks + ETOPO 2022 bathymetry
Size on disk ~1.9 GB

What's in the repo

voyage_v1/regions/dma/build/
  s9/                     # the samples
    samples/track_i/part-*.parquet    # imputation samples (one row = one window)
    samples/track_p/part-*.parquet    # same windows split for causal prediction
    sample_index.parquet
  s10/                    # the mask bank
    masks/part-*.npz                  # bit-packed hide-these-steps masks
    mask_index.parquet
  s11/sample_index_split.parquet      # train/val/test label + metadata per sample
  s12/baseline_results.json           # linear/spline/hold reference scores

voyage_v1/basemaps/dma/               # the environment layer (shared, streamed per point)
  basemap.zarr/                       # land/water, depth, distance-to-shore
  fairway_dist.zarr/                  # distance to nearest fairway
  fairway_network/                    # fairway lines + traffic-separation schemes
  basemap_meta.json

pipeline/                             # the full build code (raw AIS -> this dataset)
tools/                                # dataloader, environment sampler, metrics
docs/                                 # schema, data card, design notes
configs/voyage.yaml                   # every setting used to build the dataset

The features in each sample

Each sample is one row with list-columns (one value per time step, in time order). A 12 h sample has 144 values per column, a 6 h sample has 72.

Position and motion

  • lat, lon — WGS84 coordinates (NaN where the ship's position is unknown at that step)
  • x_m, y_m — local metres (centred on the voyage), convenient for models
  • sog_kn — speed over ground (knots)
  • cog_sin, cog_cos, head_sin, head_cos — course and heading, split into sine/cosine so they wrap around correctly

Which steps are real vs missing (this is the point of the dataset)

  • observed_mask — 1 if this step is a genuine AIS observation, 0 if it was missing
  • position_available — 1 if a position is known (observed, or filled by a short safe interpolation)
  • interp_provenance — 0 = observed, 1 = short-gap interpolation, 2 = long gap left as an imputation target

Environment along the track (sampled from the basemap)

  • is_water, depth_m — water/land and water depth
  • d_shore_m, d_nav_m — distance to shore, distance to navigable water
  • dist_fairway_m, in_fairway — distance to the nearest shipping fairway, and whether the ship is on one

Per-sample info (in s11/sample_index_split.parquet): split, kept, difficulty_tier, real_coverage, n_real_gaps, max_gap_min, path_efficiency, gc_distance_km, travelled_km, ship_class, window_len_h, mmsi_hash.

Only rows with kept == True are part of the 179,131-sample benchmark. The file also keeps the rest (capped near-duplicate windows and a temporal pretraining pool) in case you want them.


The mask bank (how to set up an imputation task)

For every sample we pre-computed several masks, stored bit-packed in s10/masks/part-*.npz under the key "<sample_id>|<mask_name>". A mask is a 0/1 array the same length as the window; 1 means "hide this step and ask the model to reconstruct it."

Mask family What it hides
cont_1h … cont_10h one continuous block of the given length (the main imputation setting)
mcar_30, mcar_50 30 % / 50 % of steps at random
realgap the steps that were genuinely missing in the raw AIS

Evaluate only where you have ground truth: the steps that count are mask == 1 AND observed_mask == 1. Note realgap has no ground truth by definition (those steps were never observed), so use it for training or qualitative demos, not for scoring.


How to use it

import sys; sys.path.insert(0, "tools")
from dataloader import VoyageLoader

loader = VoyageLoader("voyage_v1/regions/dma/build")

for s in loader.iter_track_i(split="train", mask_name="cont_6h", window_len_h=12):
    # s.lat, s.lon            -> the trajectory (list of 144 values)
    # s.feats                 -> dict of the other per-step features (speed, course, depth, ...)
    # s.observed_mask         -> which steps are real
    # s.mask                  -> which steps to reconstruct (cont_6h here)
    # s.eval_mask             -> mask AND observed  (the steps you can actually score)
    ...

A minimal recipe: build the model input by blanking the masked positions, predict them, and score with tools/metrics.py (MAE / RMSE in metres, ADE / FDE). Compare against s12/baseline_results.json.

Environment lookups anywhere (not just along the samples) use the streaming basemap:

from env_loader import EnvLoader
env = EnvLoader("voyage_v1/basemaps/dma")
df = env.sample_track(lat_array, lon_array)   # depth, distance-to-shore, distance-to-fairway per point

How the dataset was built

The pipeline (in pipeline/) turns raw daily AIS files into this dataset. In short:

  1. Ingest (S1–S2, s1s2_ingest_month.sh). Download one month of AIS, standardise the columns, drop bad rows, sort and de-duplicate, and keep only cargo and tanker vessels.
  2. Assemble voyages (S3, s3_assemble_voyages.py). Group each vessel's points into voyages, cutting a new voyage wherever there's a gap longer than 2 hours. Keep voyages that are at least 4 hours long and mostly inside the region.
  3. Resample (S4, s4_resample.py). Put every voyage on a regular 1-minute grid, mark which steps are real, and interpolate only very short gaps (≤ 15 min). Check the motion is physically consistent.
  4. Environment (S5–S7). Build a shared map of depth, land/water, distance-to-shore, and fairways (s5_basemaps.py, s6_fairway.py), then sample those values along every voyage (s7_sample_env.py).
  5. Window (S9, s9_window.py). Slide 12 h and 6 h windows over the voyages on a 5-minute grid.
  6. Masks (S10, s10_masks.py). Pre-compute the frozen mask bank.
  7. Split and curate (S11, s11_split.py). Split by vessel so no vessel leaks across train/val/test, cap near-duplicate windows, and recalibrate difficulty tiers.
  8. Baselines, checks, packaging (S12–S14).

The exact settings live in configs/voyage.yaml. run_full_build.sh runs the whole thing; every stage is resumable.


Raw data — not included here, but here's where to get it

We deliberately do not ship the raw AIS files (they are large and already public). To rebuild from scratch, or to extend to more months/regions, download:

Point the pipeline at the downloaded AIS zips and run pipeline/run_full_build.sh.

Also not included: intermediate build products (the per-day filtered CSVs, the raw assembled voyages, the resampled tracks) — about 35 GB that the pipeline regenerates on its own. Only the finished, ready-to-use dataset is here.


Known limitations (worth reading)

  • Coarse near the coast. The depth/land map (ETOPO, ~450 m grid) is too coarse for narrow Danish channels, so roughly a quarter of near-shore points sit on a cell the map calls "land." These points are flagged, never deleted — open-water depth and distances are accurate, but treat the water/land label as approximate very close to shore.
  • Two ship types only. Cargo and tanker. Other vessel types were filtered out.
  • One region, six months. Danish waters, first half of 2026. Cross-region generalisation is future work.

License and attribution

  • This dataset (the packaged samples, masks, splits, and code) is released under CC-BY-4.0. If you use it, please cite it (below).
  • It is derived from public sources, whose terms you should also respect:
    • AIS data © Danish Maritime Authority, provided as open data.
    • Fairway / seamark data © OpenStreetMap contributors, licensed under the Open Database License (ODbL).
    • Bathymetry from ETOPO 2022 (NOAA / NCEI), public domain.

Citation

@misc{ma_envship_voyage_2026,
  title  = {EnvShip-Voyage: A Benchmark for Long-Term Ship Trajectory Imputation},
  author = {Ma, Kun},
  year   = {2026},
  howpublished = {\url{https://huggingface.co/datasets/mark000071/Ship_trajectory_interpolation}}
}

Questions or issues: open a discussion on the dataset page.

Downloads last month
88