LinyongGAN/SKETCH

official repository for ICML 2026 paper: SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction

HTML

8

4 commits

updated Jul 7, 2026

See the code

README

SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction


It is the official repo for the paper: SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction accepted by ICML 2026 in Seoul, South Korea.

πŸ“– Introduction

It is a project for predicting vessel trajectories. Accurate vessel trajectory prediction is a fundamental capability for maritime intelligence, supporting collision avoidance, port operation optimization, search and rescue, and fuel-efficient voyage planning. Our well-trained model can also serve as an off-the-shelf model for trajectory understanding and be applied to various downstream tasks.

We recast long-horizon vessel trajectory prediction as a hierarchical forecasting problem that explicitly models navigational intent. Our contributions are summarized as follows:

  1. We identify the lack of explicit global intent modeling as a fundamental limitation of existing long-horizon vessel trajectory prediction methods.

  2. We introduce the Next Key Point (NKP) as a semantic intent variable and condition it to trajectory prediction, separating global navigational decisions from local motion dynamics within a hierarchical framework.

  3. We propose an efficient training strategy for NKP-conditioned forecasting, allowing the model to generalize to open-set navigational targets rather than depending on a fixed closed set of ports.

  4. Experiments on large-scale AIS datasets show state-of-the-art performance, particularly in long-horizon prediction.

πŸš€ Quick Start

Please replace the code with the tag [TODO]. We have contained the public dataset and checkpoints in the repo, but the private dataset will not be revealed.

πŸ“¦ Installation

Run the bash code below:

conda create -n SKETCH python=3.9
conda activate SKETCH
pip install -r requirement.txt

Evaluation

Instructionfunction
python evaluate_final_dataloader_public.pyEvaluate on a public dataset
python evaluate_final_dataloader.pyevaluate on private (or other dataset)
python eval_sft.pyEvaluate the accuracy on stage II

Inference

Instructionfunction
python inference_final_public.pyDerive the visualization results for the public dataset. PNG and HTML are provided. You can specify the number of figures you want to sample
python inference_final.pyDerive the visualization results from the private (or other) dataset.

Training/Fine-tuning

Instructionfunction
python train.pyTrain the stage I
python sft.pySFT the stage II

Data Preprocessing

Running this section is not necessary. We provided sufficient files for evaluation and inference.

In the 'data_preprocessing' folder, we provided two sample scripts for data preprocessing and database preparation. We cannot provide the Excel file with NKPs, but we can provide a sample file in the 'data' folder. Please collect it by yourself if needed. The evaluation datasets have been given.

We also provided the code for database preparation for stage II. We have provided a sample database file for evaluation and inference. You can specify or enlarge it by yourself.

For both tools, please replace the path in the code with the [TODO] tag to process the data.

πŸ“Š Dataset Requirement

The training dataset should be a CSV file with columns: mmsi (to differentiate vessels only), lat, lon, sog, cog, next_lat, next_lon.

The evaluation/inference dataset should be a CSV file with columns: mmsi (to differentiate vessels only), lat, lon, sog, cog.

πŸ’» Implementation Details

SKETCH/
β”œβ”€β”€ README.md                          # Project documentation
β”œβ”€β”€ requirements.txt                   # Project dependencies
β”œβ”€β”€ LICENSE                            # License file
β”œβ”€β”€ train.py                           # Stage I pre-training script
β”œβ”€β”€ sft.py                             # Stage II supervised fine-tuning script
β”œβ”€β”€ eval_sft.py                        # Evaluate Stage II model accuracy
β”œβ”€β”€ evaluate_final_dataloader.py       # Evaluate final model on private dataset
β”œβ”€β”€ evaluate_final_dataloader_public.py # Evaluate final model on public dataset
β”œβ”€β”€ inference_final.py                 # Visualization inference on private dataset
β”œβ”€β”€ inference_final_public.py          # Visualization inference on public dataset
β”œβ”€β”€ horizon_wise.py                    # Evaluation script for different prediction horizons
β”œβ”€β”€ enrolled_trajectory.npy            # Enrolled trajectory data (for semantic key point retrieval)
β”œβ”€β”€ models/                            # Model definitions directory
β”‚   β”œβ”€β”€ model_minimind.py              # Base model architecture definition
β”‚   β”œβ”€β”€ model_minimind_sft.py          # Stage II supervised fine-tuning model
β”‚   └── model_minimind_final.py        # Final complete prediction model
β”œβ”€β”€ utils/                             # Utility functions directory
β”‚   β”œβ”€β”€ process.py                     # Data processing and data loaders
β”‚   β”œβ”€β”€ dataloader_public.py           # Public dataset data loader
β”‚   β”œβ”€β”€ earth_computation.py           # Earth science computation tools (coordinate conversion, distance calculation, etc.)
β”‚   β”œβ”€β”€ metrics.py                     # Evaluation metric calculation (Frechet distance, curvature, etc.)
β”‚   └── visualization.py               # Visualization tools (trajectory plotting)
β”œβ”€β”€ data/                              # Data directory
β”‚   β”œβ”€β”€ CapacityLargeModel_NKP_108.xlsx # Semantic key point data example
β”‚   └── ne_10m_coastline/              # Coastline data (for visualization)
β”œβ”€β”€ data_preprocessing/                # Data preprocessing directory
β”‚   β”œβ”€β”€ data_processing.ipynb          # Data processing notebook
β”‚   └── database_preperation.ipynb     # Database preparation notebook
β”œβ”€β”€ data_1_13/                         # Public Dataset folder
β”œβ”€β”€ demonstrations/                    # Demonstration/example directory
β”œβ”€β”€ weights_pretrain/                  # Stage I pre-trained weights storage directory
└── weights_sft_new/                   # Stage II fine-tuned weights storage directory

πŸ™ Acknowledgement

We utilized the MiniMind Model as the baseline. ne_10m_coastline was utilized to derive the distance from each coordinate to the nearest coastline.

πŸ“š Citations

@misc{gan2026sketchsemantickeypointconditioning,
      title={SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction}, 
      author={Linyong Gan and Zimo Li and Wenxin Xu and Xingjian Li and Jianhua Z. Huang and Enmei Tu and Shuhang Chen},
      year={2026},
      eprint={2601.18537},
      archivePrefix={arXiv},
      primaryClass={cs.RO},
      url={https://arxiv.org/abs/2601.18537}, 
}

Contributors

LinyongGAN

4 commits

LinyongGAN/SKETCH

official repository for ICML 2026 paper: SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction

HTML

8

4 commits

updated Jul 7, 2026

See the code

README

SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction


It is the official repo for the paper: SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction accepted by ICML 2026 in Seoul, South Korea.

πŸ“– Introduction

It is a project for predicting vessel trajectories. Accurate vessel trajectory prediction is a fundamental capability for maritime intelligence, supporting collision avoidance, port operation optimization, search and rescue, and fuel-efficient voyage planning. Our well-trained model can also serve as an off-the-shelf model for trajectory understanding and be applied to various downstream tasks.

We recast long-horizon vessel trajectory prediction as a hierarchical forecasting problem that explicitly models navigational intent. Our contributions are summarized as follows:

  1. We identify the lack of explicit global intent modeling as a fundamental limitation of existing long-horizon vessel trajectory prediction methods.

  2. We introduce the Next Key Point (NKP) as a semantic intent variable and condition it to trajectory prediction, separating global navigational decisions from local motion dynamics within a hierarchical framework.

  3. We propose an efficient training strategy for NKP-conditioned forecasting, allowing the model to generalize to open-set navigational targets rather than depending on a fixed closed set of ports.

  4. Experiments on large-scale AIS datasets show state-of-the-art performance, particularly in long-horizon prediction.

πŸš€ Quick Start

Please replace the code with the tag [TODO]. We have contained the public dataset and checkpoints in the repo, but the private dataset will not be revealed.

πŸ“¦ Installation

Run the bash code below:

conda create -n SKETCH python=3.9
conda activate SKETCH
pip install -r requirement.txt

Evaluation

Instructionfunction
python evaluate_final_dataloader_public.pyEvaluate on a public dataset
python evaluate_final_dataloader.pyevaluate on private (or other dataset)
python eval_sft.pyEvaluate the accuracy on stage II

Inference

Instructionfunction
python inference_final_public.pyDerive the visualization results for the public dataset. PNG and HTML are provided. You can specify the number of figures you want to sample
python inference_final.pyDerive the visualization results from the private (or other) dataset.

Training/Fine-tuning

Instructionfunction
python train.pyTrain the stage I
python sft.pySFT the stage II

Data Preprocessing

Running this section is not necessary. We provided sufficient files for evaluation and inference.

In the 'data_preprocessing' folder, we provided two sample scripts for data preprocessing and database preparation. We cannot provide the Excel file with NKPs, but we can provide a sample file in the 'data' folder. Please collect it by yourself if needed. The evaluation datasets have been given.

We also provided the code for database preparation for stage II. We have provided a sample database file for evaluation and inference. You can specify or enlarge it by yourself.

For both tools, please replace the path in the code with the [TODO] tag to process the data.

πŸ“Š Dataset Requirement

The training dataset should be a CSV file with columns: mmsi (to differentiate vessels only), lat, lon, sog, cog, next_lat, next_lon.

The evaluation/inference dataset should be a CSV file with columns: mmsi (to differentiate vessels only), lat, lon, sog, cog.

πŸ’» Implementation Details

SKETCH/
β”œβ”€β”€ README.md                          # Project documentation
β”œβ”€β”€ requirements.txt                   # Project dependencies
β”œβ”€β”€ LICENSE                            # License file
β”œβ”€β”€ train.py                           # Stage I pre-training script
β”œβ”€β”€ sft.py                             # Stage II supervised fine-tuning script
β”œβ”€β”€ eval_sft.py                        # Evaluate Stage II model accuracy
β”œβ”€β”€ evaluate_final_dataloader.py       # Evaluate final model on private dataset
β”œβ”€β”€ evaluate_final_dataloader_public.py # Evaluate final model on public dataset
β”œβ”€β”€ inference_final.py                 # Visualization inference on private dataset
β”œβ”€β”€ inference_final_public.py          # Visualization inference on public dataset
β”œβ”€β”€ horizon_wise.py                    # Evaluation script for different prediction horizons
β”œβ”€β”€ enrolled_trajectory.npy            # Enrolled trajectory data (for semantic key point retrieval)
β”œβ”€β”€ models/                            # Model definitions directory
β”‚   β”œβ”€β”€ model_minimind.py              # Base model architecture definition
β”‚   β”œβ”€β”€ model_minimind_sft.py          # Stage II supervised fine-tuning model
β”‚   └── model_minimind_final.py        # Final complete prediction model
β”œβ”€β”€ utils/                             # Utility functions directory
β”‚   β”œβ”€β”€ process.py                     # Data processing and data loaders
β”‚   β”œβ”€β”€ dataloader_public.py           # Public dataset data loader
β”‚   β”œβ”€β”€ earth_computation.py           # Earth science computation tools (coordinate conversion, distance calculation, etc.)
β”‚   β”œβ”€β”€ metrics.py                     # Evaluation metric calculation (Frechet distance, curvature, etc.)
β”‚   └── visualization.py               # Visualization tools (trajectory plotting)
β”œβ”€β”€ data/                              # Data directory
β”‚   β”œβ”€β”€ CapacityLargeModel_NKP_108.xlsx # Semantic key point data example
β”‚   └── ne_10m_coastline/              # Coastline data (for visualization)
β”œβ”€β”€ data_preprocessing/                # Data preprocessing directory
β”‚   β”œβ”€β”€ data_processing.ipynb          # Data processing notebook
β”‚   └── database_preperation.ipynb     # Database preparation notebook
β”œβ”€β”€ data_1_13/                         # Public Dataset folder
β”œβ”€β”€ demonstrations/                    # Demonstration/example directory
β”œβ”€β”€ weights_pretrain/                  # Stage I pre-trained weights storage directory
└── weights_sft_new/                   # Stage II fine-tuned weights storage directory

πŸ™ Acknowledgement

We utilized the MiniMind Model as the baseline. ne_10m_coastline was utilized to derive the distance from each coordinate to the nearest coastline.

πŸ“š Citations

@misc{gan2026sketchsemantickeypointconditioning,
      title={SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction}, 
      author={Linyong Gan and Zimo Li and Wenxin Xu and Xingjian Li and Jianhua Z. Huang and Enmei Tu and Shuhang Chen},
      year={2026},
      eprint={2601.18537},
      archivePrefix={arXiv},
      primaryClass={cs.RO},
      url={https://arxiv.org/abs/2601.18537}, 
}

Contributors

LinyongGAN

4 commits

Languages

HTML

99.0%