Skip to main content

Identify optically shallow and deep waters in satellite imagery

Project description

Optically-Shallow-Deep

This python tool delineates optically shallow and deep waters in Sentinel-2 imagery. The tool uses a deep neural network (DNN) that was trained on a diverse set of global images.

Supported input includes Level-1C (L1C) SAFE files and ACOLITE-processed L2R netCDF files. The output geotiff contains probabilities of water pixels being optically shallow and deep.

Home page: https://github.com/yulunwu8/Optically-Shallow-Deep

Publication: Richardson, G., Foreman, N., Knudby, A., Wu, Y., & Lin, Y. (2024). Global deep learning model for delineation of optically shallow and optically deep water in Sentinel-2 imagery. Remote Sensing of Environment, 311, 114302. https://doi.org/10.1016/j.rse.2024.114302

Originally coded by G. Richardson and A. Knudby, modified and packaged by Y. Wu

Models trained by G. Richardson and N. Foreman

Installation

1 - Create a conda environment and activate it:

conda create --name opticallyshallowdeep python=3.10
conda activate opticallyshallowdeep

2 - Install tensorflow

For mac OS:

conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos

For Windows and Linux:

pip3 install tensorflow==2.13.0

More on installing tensorflow: https://www.tensorflow.org/install

3 - Install opticallyshallowdeep:

pip3 install opticallyshallowdeep

Quick Start

For L1C files:

import opticallyshallowdeep as osd

# Input file 
file_L1C = 'folder/S2.SAFE' 

# Output folder 
folder_out = 'folder/test_folder_out'

# Run the OSW/ODW classifier 
osd.run(file_L1C, folder_out)

For ACOLITE L2R files:

import opticallyshallowdeep as osd

# Input files 
file_L1C = 'test_folder_in/S2.SAFE' 
file_L2R = 'test_folder_in/L2R.nc' 

# Output folder 
folder_out = 'folder/test_folder_out'

# Run the OSW/ODW classifier 
osd.run(file_L1C, folder_out, file_L2R=file_L2R)

The L1C file is always required as it contains a built-in cloud mask. Pixels within 8 pixels of the cloud mask are masked to reduce the impact of clouds.

Output is a 1-band geotiff, with values of prediction probability of optically shallow water (OSW): 100 means most likely OSW, 0 means most likely optically deep water (ODW). Non-water pixels are masked.

A log file, an intermediate multi-band geotiff, and a preview PNG are also generated in the output folder. They can be deleted after the processing.

Sample Sentinel-2 scene and output:

Tips

It is recommended to treat pixels with values between 0 and 40 as ODW, and those between 60 and 100 as OSW (Richardson et al., 2024).

Users have reported that averaging results from multiple images acquired on different days can help reduce noise and improve the overall accuracy of classification results.

Training, test, and validation data

All annotated shapefiles used in training, testing, and validating the DNN model are in the annotated_shapefiles folder, grouped by Sentinel-2 Scene ID.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opticallyshallowdeep-1.2.3.tar.gz (259.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opticallyshallowdeep-1.2.3-py3-none-any.whl (259.5 kB view details)

Uploaded Python 3

File details

Details for the file opticallyshallowdeep-1.2.3.tar.gz.

File metadata

  • Download URL: opticallyshallowdeep-1.2.3.tar.gz
  • Upload date:
  • Size: 259.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for opticallyshallowdeep-1.2.3.tar.gz
Algorithm Hash digest
SHA256 099adea06cc0fa6534c56b70f03c1bf1f4de17e55b9ebb09cf7990aaa7b849e8
MD5 0a8bf5e01d0f6e62d982e1ef16f33c2d
BLAKE2b-256 4b65a1909ecfcb32c596ee608f10fd07db016b8d016e05ce9e7276fd73f67283

See more details on using hashes here.

File details

Details for the file opticallyshallowdeep-1.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for opticallyshallowdeep-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0aa019f02a2c463b4bfac921ccd1020c20938c852286e72bcd112e1623fa2e02
MD5 446302661680884e142db8e57457f97c
BLAKE2b-256 a104ea7b85dbe460304a7146ef1367b090eee821460c191caa9b83bfc170bd8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page