WetSAT-ML (Wetlands flooding extent and trends using SATellite data and Machine Learning) version 1.0, It consists of an open-source algorithm integrated with platforms such as: Google Earth Engine, Google Colab, and Scikit Learn. The tool processes radar satellite data from the Sentinel-1 mission to generate wetland flooding extent maps, water permanence maps, and quantify key hydrological parameters, including flooded area time series, hydroperiods, and intra- and inter-annual wetland area trends. The algorithm will use machine learning models to characterize the scattering behavior of the radar signal for different wetland flooding conditions, enabling a pixel-level water detection in the satellite images.
https://colab.research.google.com/github/sei-latam/WETSAT_v2/blob/main/2_Modelling_WETSAT_Google_Colab/Master_Random_Forest_WetSAT.ipynbhttps://colab.research.google.com/github/CarlosMendez1997Sei/WETSAT_v2/blob/main/2_Modelling_WETSAT_Google_Colab/Master_Kmeans.ipynbhttps://colab.research.google.com/github/sei-latam/WETSAT_v2/blob/main/2_Modelling_WETSAT_Google_Colab/User_Version_Random_Forest_WetSAT.ipynbhttps://colab.research.google.com/github/sei-latam/WETSAT_v2/blob/main/2_Modelling_WETSAT_Google_Colab/User_Version_Kmeans_WetSAT.ipynbThe tool WetSAT-ML allow users to:
- Generate wetland flooding extent maps.
- Produce water permanence maps.
- Extract flooded area time series.
- Quantify intra-annual and inter-annual wetland hydrological trends.
WetSAT-ML methodology workflow for generating wetland flooding extent and trends using Sentinel-1 data and machine learning.
WETSAT_v2/
βββ 0_Original_Files/
β βββ aoi1/
β βββ aoi2/
β βββ sigma_dB/
β β βββ VH/
β β βββ VV/
β β βββ PR_index/
β βββ points_AOI2_BDE.shp
βββ models/
βββ README.md###################################### Artificial Intelligence Frameworks #####################################################
!pip install scikit-learn
###################################### Data, Geoprocessing and Graphics libraries #####################################################
!pip install rasterio
!pip install matplotlib
!pip install numpy
!pip install contextily
!pip install geopandas
## Geoprocessing packages
import rasterio
from rasterio.features import rasterize
import numpy as np
import geopandas as gpd
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import gc # Garbage collector to free memory
import os
import contextily as ctx
from shapely.geometry import box
import seaborn as sns
import joblib
import urllib.request
import warnings
from google.colab import files
from google.colab import data_tableInput Data:
- VH and VV SAR images (.tif)
- Compute PR Index
(PR = VH - VV)Input Data:
- Import shapefile points with labels and marks
- Reproject shapefile to match raster CRS
- Filter points within raster bounds
- Extract pixel values at labeled points
https://github.com/sei-latam/WETSAT_v2/tree/main/0_Original_Files/aoi1
https://github.com/sei-latam/WETSAT_v2/tree/main/0_Original_Files/aoi2HTTPS
https://github.com/sei-latam/WETSAT_v2.gitGitHub SSH
git@github.com:sei-latam/WETSAT_v2.gitGitHub CLI
gh repo clone sei-latam/WETSAT_v2from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report, confusion_matrix, accuracy_score
from sklearn.impute import SimpleImputer
from sklearn.multioutput import MultiOutputClassifier
from sklearn.preprocessing import LabelEncoder
from sklearn.exceptions import UndefinedMetricWarning
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.pipeline import Pipeline- Prepare Training Data (70%)
- Prepare Validation Data (30%)
- Store Data in pickle (.pkl) formats, for example ----> joblib.dump(le, "/models/label_encoder.pkl")
- Display Data
- Train a Random Forest classifier with hyperparameter tuning:
- Save the best model in pickle (.pkl) format, for example ----> joblib.dump(best_model, "/models/modelo_random_forest.pkl")
param_grid = {
'n_estimators': [100, 200],
'max_depth': [10, 20, None],
'min_samples_split': [2, 5],
'min_samples_leaf': [1, 2],
'max_features': ['sqrt', 'log2']
}- Accuracy score
- Best hyperparameters
- Confusion matrix
- Classification report
- Import the pickle files previously created (model, encoders and labels)
- Add news images (VV, VH and PR), if you don't have PR index, you can to recalculate the PR index following the equation (PR = VH - VV)
- Upload the model and make predictions
- Use encoder label to transform values (optional) π
- Export to raster (.tif) images in AOI selected, for example -----> Classification_labels_XX.tif
- Open the raster images predicted in Open Source GIS, for example QGIS
Version in R
https://github.com/sei-latam/WETSATVersion 1.0
https://github.com/sei-latam/WETSAT_v2For WetSAT-ML citations and references, please use the following structure:
Palomino-Γngel, S., MΓ©ndez, C., Zamora, D., Santos, T., Prasad, S., and Piman, T. (2025). WetSAT-ML: Wetlands flooding extent and trends using SATellite data and Machine Learning (Version 1.0) [Data System]. Stockholm Environment Institute (SEI). https://github.com/sei-latam/WETSAT_v2.
GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. https://fsf.org/ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
