This repository provides Python code for training and inference of AI models for the detection of coastal boulders, as well as MATLAB code for compiling and processing the detection results generated by those Python workflows.
The deep-learning training and inference code is provided as Jupyter Notebook files. Code specific to Detectron2 is stored in the detectron2 directory.
- Open the target notebook file.
- Extract and load the model weight file.
- Load the target images.
This MATLAB app provides the position, size, and volume of boulders based on contours detected by Detectron2.
- Detect boulder contours using Detectron2 and save the results as a JSON file in COCO format with the accompanying sub-app (Python code).
- Load the JSON file, the orthoimage used for detection, and the corresponding DSM.
- Calculate the lengths of the a- and b-axes, area, orientation, location, and volume.
A simple usage example is provided in simple_example.m.
The approach used in this code is described and evaluated in the following referenced paper (open access).
https://www.nature.com/articles/s41598-025-29044-9

