Mapping Australian sandy beaches using image segmentation deep learning method based on U-Net architecture.
git clone https://bitbucket.csiro.au/scm/~yon012/sandybeachmapping_dl.git
pip install -r requirements.txt
Download data: See Spatial processing and downloading of data
Run deep learning pipeline:
- Setup configs:
config/config.yaml - Run training:
$ python -m sandybeachmapping_dl.main - Run evaluation:
$ python -m sandybeachmapping_dl.main --config-name='config_eval.yaml'
- Folder:
<data_dir> - Filename convention:
<IMAGE_SOURCE>_<AUS_STATE>_<IMAGE_TYPE>_FID.tif<IMAGE_SOURCE>: Image source, e.g., from Bing<AUS_STATE>: Australian state<IMAGE_TYPE>: Eitherimage,mask, ormaskpred
{R} scripts to tile and download images for input into {python} ML code, and then convert ML raster output to polygon vectors are found in the folder coast_tiling_extraction. The extraction scripts can be run for each Australian State (e.g. VIC).
- Not used
download_and_Tile_beach_images.Rtile the region of a OSM beach into n x m tiles covering the entire OSM beach id polygon. tile_beach_images.Rdefine 512 x 512 image tiles along the coastline of a Australian state (e.g. VIC). The tiles overlap, but tiles with more than 5 overlaps are removed (rs > thr).download_tile_images.Rdownload the aerial images for each 512 x 512 tile in previous step.mask_tile_images.Rrasterise the binary "mask" of the OSM beach polygons for each image tile in the previous step.- Not used
mask_tile_images_BeachCliffsSea.Rmake a classified mask to include a cliff and beach mask.
- Not used
polygonise_ml_output_maskpred.Rconvert the ML output rasters to polygon vectors, to compare to OSM beaches.
- Select test set to evaluate in configs:
test_imagesetmask: Test images with masksmask+nomask: Test images with masks and images without masksall: All images, including from training, validation and testing. Outputs will be in<maskpred_subdir>_all.
<output_dir>/<maskpred_subdir>/: GeoTiff of predicted masks<output_dir>/<maskpred_subdir>_polygons.shp.zip: Shapefile of predicted masks- In
<modelout_dir>/:model.pth: Trained modelloss_metric.pkl: Loss metrics
Suk Yee Yong (sukyee.yong@csiro.au)
Julian O'Grady (julian.ogrady@csiro.au)
This project is being developed as part of Scientific Computing Collaboration Project 2024H1 for ERRFP 1343: Machine Learning Methods to Identify Australian Beaches from a Citizen Science derived training data.
Dataset of OpenStreetMap (OSM) beaches is created using overpass API.
Open source packages used: PyTorch, SMP, terra
If you find this repository useful, please cite the paper:
@article{yong2024sandybeachmappingdl,
author = {Yong, Suk Yee and O'Grady, Julian and Gregory, Rebecca and Lynton, Dylan},
doi = {10.3390/rs16183534},
issn = {2072-4292},
journal = {Remote Sensing},
number = {18},
title = {Regional-Scale Image Segmentation of Sandy Beaches in Southeastern Australia},
url = {https://www.mdpi.com/2072-4292/16/18/3534},
volume = {16},
article-number = {3534},
year = {2024},
}CSIRO Open Source Software Licence Agreement (variation of the BSD / MIT License)
