Code Monkey home page Code Monkey logo

mstformer's Introduction

MSTFormer: Motion Inspired Spatial-temporal Transformer with Dynamic-aware Attention for long-term Vessel Trajectory Prediction

This is a method for long-term ship trajectory prediction. It mainly improves the trajectory prediction performance by data augmentation, dynamic-aware attention, and knowledge-inspired loss function.

Requirements

geopy==2.2.0
ipdb==0.13.9
matplotlib==3.5.1
numpy==1.22.4
numpy_ext==0.9.8
pandas==1.4.3
scipy==1.8.1

Data

A simple dataset is provided for testing the code, or you can generate your own by rewriting data_loader.py.This project provides some commented out code that we use to process the data for reference.

Run

After configuring the environment, just run main_MSTFomer.py directly. Also, you can test different data by changing the parameters inside. The file where the logs are saved can be changed by changing the path in log.py.

Citation

If you find this repository useful in your research, please consider citing the following paper:

@misc{qiang2023mstformer,
      title={MSTFormer: Motion Inspired Spatial-temporal Transformer with Dynamic-aware Attention for long-term Vessel Trajectory Prediction}, 
      author={Huimin Qiang and Zhiyuan Guo and Shiyuan Xie and Xiaodong Peng},
      year={2023},
      eprint={2303.11540},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}

Contact

If you have any questions, feel free to contact Huimin Qiang through Email ([email protected]) or Github issues. Pull requests are highly welcomed!

Acknowledgments

Thanks to NOAA for providing the raw data (ttps://coast.noaa.gov/htdata/CMSP/AISDataHandler/2021/), and thanks to everyone for their interest in this work!

mstformer's People

Contributors

simple316 avatar

Stargazers

 avatar Dachang Dang avatar 豹发力 avatar Do1phln avatar  avatar  avatar 陈小道 avatar Mark Colley avatar wister avatar PengqianHan avatar ymq23 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar Chen avatar

mstformer's Issues

What's the use of "part_index_" in data_load.py

I use .csv file as the raw data. And I find that there is a "part_index_".
①What's the use of part_index_ ?
②What's the reason of df['timediffer'] > 2 in the code of "part_index_ = df[df['timediffer'] > 2].index.tolist()"?
thanks.
:-)

关于ATM的参数

我在源码中发现ATM在构建时,用到了如下几个参数

HEADING_PROB = 0.2  # 船首向的概率值
SHIP_PROB = 0.8  # 船上一位置概率值
SPEED_PROB = 0.02  # 船上一位置速度表示概率值,将乘船的速度
SPEED_LINE = 3  # 速度拖尾长度

以及在label_speed_heading函数中发现

        for dist, px, py in self.get_neighbors(current[0], current[1]):
            if dist == 0:
                # print(px,py)
                pos_probabilty[px, py] = 0.50002
            elif dist == 1:
                pos_probabilty[px, py] = 0.114675
            elif dist == 2:
                pos_probabilty[px, py] = 0.00516

请问这几个参数的值为什么要这样设置?尤其是第二个代码块中的数字,有什么特殊意义吗?

code about ATM: Augmented Trajectory Matrix

thanks for yuor work ~
but i am wonder where is the code about ATM: Augmented Trajectory Matrix.
i can not find it in data or model folder or other folder.
thanks a lot for telling me where it is.

code:about data_loader.py

Hello, I tried to generate the data set myself. Is the .npy in data_loader.py generated through read_Port? Map_data is generated through which function? Does the csv file refer to the data set provided by NOAA?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.