SEAuAIS: A Self-Explainable Autoencoder with AIS-based Maritime Anomaly Detection
Abstract
[Will be added upon submission]
Authors
-
Harald Vilhelm Skat-Rørdam1
harsk@dtu.dk
-
Rune D. Kjærsgaard1
rdokj@dtu.dk
-
Emil Hovad1
emilh@dtu.dk
-
Line K. H. Clemmensen1,2 ✉️
lkhc@dtu.dk
1 Technical University of Denmark (DTU)
2 University of Copenhagen (KU)
✉️ Corresponding author
Citation
[To be added]
Makefile Commands
This project uses a Makefile
to automate various tasks. Below are the available commands and their descriptions.
Use make <target>
to run automated tasks.
Environment
-
make create_environment
Create or update the conda/mamba env (GPU if available).
Uses your installedmamba
if present, else falls back toconda
. -
make remove_environment
Remove the$(PROJECT_NAME)
conda/mamba environment. -
make test_environment
Runtest_environment.py
to verify Python version, imports, conda env name, and CUDA status.
Data
-
make data_download
Download raw data -
make data_preprocess
Preprocess downloaded data
Model
-
make train
Train the main model (Svalbard data) -
make train_Bornholm
Train the main model (Bornholm data)
Results
-
make video
Creates animation of anomaly detection of ships in ROI
Code Quality & Utilities
-
make check_environment
Print Python interpreter, conda/mamba availability and GPU status. -
make clean
Remove__pycache__
and.py[co]
files. -
make lint
Check withisort
andblack
. -
make format
Applyblack
+isort
formatting. -
make help
Show this list of available targets.
Python commands
Data
-
python
scripts/data/data_download.py config/data_config.json
Download raw data -
python
scripts/data/data_preprocessing.py config/data_config.json
Preprocess downloaded data
Model
Train
-
python
scripts/model/train.py
Train the main model (Svalbard data) -
python
scripts/model/train_Bornholm.py
Train the main model (Bornholm data)
Results
-
python
scripts/results/video.py
Creates animation of anomaly detection of ships in ROI
Project Organization
├── config <- Configuration files (e.g., data_config.json).
│
├── data
│ ├── external <- Data from third-party sources.
│ ├── interim <- Intermediate data that has been transformed.
│ ├── processed <- Final, canonical data sets for modeling.
│ │ ├── Bornholm
│ │ │ ├── Labelled Data <- Labelled Bornholm data.
│ │ │ └── Unlabelled Data <- Unlabelled Bornholm data.
│ │ └── Svalbard_Full <- Processed Svalbard data.
│ └── raw
│ └── Svalbard_Full <- Original, immutable Svalbard data dump.
│
├── environment.yml <- Conda environment configuration file.
│
├── LICENSE <- Open-source license if one is chosen
│
├── Makefile <- Makefile with convenience commands like make train
│
├── models <- Trained and serialized models, model predictions, or model summaries.
│ ├── best_model_Bornholm <- Best model for Bornholm.
│ └── best_model_Svalbard <- Best model for Svalbard.
│
├── pyproject.toml <- Project configuration file for SEAuAIS (dependencies, tools like black, etc.)
│
├── README.md <- The top-level README for developers using this project.
│
├── reports <- Generated reports such as HTML, PDF, LaTeX, etc.
│ ├── Bornholm <- Reports for Bornholm.
│ ├── Grouped <- Grouped reports.
│ └── Svalbard <- Reports for Svalbard.
│
├── requirements.txt <- File for specifying the environment and Python dependencies.
│
├── scripts <- Standalone command-line scripts to perform various tasks like training or evaluation.
│ ├── data <- Scripts for data-related tasks.
│ │ ├── data_download.py <- Script for downloading data.
│ │ └── data_preprocessing.py <- Script for preprocessing data.
│ ├── model <- Scripts for model-related tasks.
│ │ ├── train.py <- Script for training models.
│ │ └── train_Bornholm.py <- Script for training models.
│ └── results <- Scripts for handling results.
│ ├── ship_inference_grouped.ipynb <- Jupyter notebook for ship inference (both ROIs).
│ └── video.py <- Script for generating videos.
│
├── setup.cfg <- Configuration file for linting (e.g., flake8 settings).
│
├── setup.py <- Setup file for building and distributing the project.
│
├── src <- Main source code for the SEAuAIS Python package.
│ ├── data_utils <- Utilities for data processing.
│ │ ├── __init__.py <- Makes data_utils a Python package.
│ │ └── helper.py <- Functions for data processing.
│ ├── SEAuAIS <- Source code for the SEAuAIS package.
│ │ ├── __init__.py <- Makes SEAuAIS a Python package.
│ │ ├── DB_score.py <- DB score logic function.
│ │ ├── helper_functions.py <- Utility/helper functions.
│ │ ├── preproc.py <- Loads and handles data for model.
│ │ ├── SEAuAIS.py <- The model.
│ │ └── SEAuAIS_train_and_test.py <- Training and test logic.
│ ├── inference_utils <- Utilities for inference and plotting.
│ │ ├── __init__.py <- Makes inference_utils a Python package.
│ │ └── plot_helper.py <- Helper functions for plotting.
│ └── model_utils <- Utilities for model handling.
│ ├── __init__.py <- Makes model_utils a Python package.
│ ├── config.py <- Configuration settings like hyperparameters and file paths.
│ ├── helper.py <- Helper functions for model handling.
│ └── train.py <- Core training logic (called by scripts/train_model.py).
│
├── test_environment.py <- Script to test if the environment is set up correctly.
License
The MIT License (MIT) Copyright (c) 2024, DTU Compute
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.