Code Monkey home page Code Monkey logo

movementanalysis's Introduction

Movement Analysis of Fishing vessels

An analysis on the behavior of fishing vessels in order to detect patterns and outliers/anomalies. This analysis utilizes ARIMA and OU process to model the trajectories, producing coefficients that represent the vessel movement. Next, a clustering analysis is performed to explore patterns in the movement of the fishing vessels. This source code is related to the work in [1]. Thus, if you are using this code please cite [1].

Usage Example

This is an example of how to run the movement analysis on DCAIS dataset. In this scenario, we apply OU process in 30 trajectories of fishing vessels that was navigating on April, 2020. The clustering algorithm executed is the hierarchical with average-linkage metric.

Import the requires libraries:

from preprocessing.clean_trajectories import Trajectories
from approach.ar_models import Models
from approach.clustering import Clustering
from datetime import datetime

Process the dataset online:

# Number of vessels
n_samples = 30
# Fishing type
vessel_type = [30, 1001, 1002]
# Time period
start_day = datetime(2020, 4, 1)
end_day = datetime(2020, 4, 30)
# Attributes
dim_set = ['lat', 'lon']
# Creating dataset
dataset = Trajectories(n_samples=n_samples, vessel_type=vessel_type, time_period=(start_day, end_day))

Modeling the trajectories and apply the clustering algorithm:

main_folder = f'./results/DCAIS_example/'
#### Extracting features
dataset_dict = dataset.pandas_to_dict()
features = Models(dataset=dataset_dict, features_opt='ou', dim_set=dim_set, folder=f'./results/DCAIS_example/')
### Runing clustering
result = Clustering(ais_data_path=dataset.preprocessed_path, distance_matrix_path=f'./results/DCAIS_example/features_coeffs.csv',
                        cluster_algorithm='hierarchical', linkage='average', folder=f'./results/DCAIS_example/', norm_dist=False)

Requirements

cycler==0.11.0
fonttools==4.28.2
joblib==1.1.0
kiwisolver==1.3.2
matplotlib==3.5.0
numpy==1.21.4
packaging==21.3
pandas==1.3.4
patsy==0.5.2
Pillow==8.4.0
pyparsing==3.0.6
python-dateutil==2.8.2
pytz==2021.3
scikit-learn==1.0.1
scipy==1.7.3
setuptools-scm==6.3.2
six==1.16.0
statsmodels==0.13.1
threadpoolctl==3.0.0
tomli==1.2.2

Reference

[1] Ferreira, M. D., Campbell, J. N., & Matwin, S. (2022). A novel machine learning approach to analyzing geospatial vessel patterns using AIS data. GIScience & Remote Sensing, 59(1), 1473-1490.

movementanalysis's People

Contributors

marthadais avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mhdella

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.