
Description:
This repository contains the code and data for a comparative evaluation of physically based (SWAT+) and machine learning (ML) hydrological models applied to two contrasting watersheds in Angola. The study investigates model performance using three satellite and reanalysis precipitation datasets: MSWEP, IMERG, and ERA5-Land. Model evaluation was performed using two complementary approaches: traditional calibration–validation metrics and flow-duration-curve (FDC) statistics to capture minimum, mean, and maximum flow behavior.
The SWAT+ models were executed with SWAT+ version 61.0.2 (swatplus-61.0.2-ifx-win_amd64-Rel.exe) and calibrated using the SWAT+ Toolbox (v2.4.1) via an automated Latin Hypercube Sampling (LHS) scheme targeting the Nash–Sutcliffe Efficiency (NSE) objective function. Machine learning models—including Random Forest and Artificial Neural Networks—were trained with input features selected through permutation importance analysis and further refined by ANN optimization. Input features comprised lagged precipitation, relative humidity, air temperature, and cyclical transformations of month to account for seasonality.
The datasets were split into training (51%), validation (13%), and testing (36%) subsets, ensuring robust evaluation across wet and dry periods. Data imbalance was mitigated using SMOGN resampling to improve predictions of rare and extreme flow events. Hyperparameter tuning was conducted via Hyperopt with up to 100 evaluations.
Key findings highlight the variability in model skill depending on watershed size, flow regime, and evaluation method. MSWEP emerged as the most reliable precipitation dataset, while ML models better captured flow extremes, especially when enhanced by SMOGN. This work demonstrates the value of integrating physically based and data-driven models alongside multiple evaluation techniques to improve hydrological representation in data-scarce regions.
Included Files:
SWAT+ model input files and calibration scripts
Machine learning model scripts with feature selection, training, and evaluation code
Preprocessing and SMOGN resampling implementation
Hyperparameter optimization workflows using Hyperopt
Software Requirements:
SWAT+ version 61.0.2 (swatplus-61.0.2-ifx-win_amd64-Rel.exe)
SWAT+ Toolbox (v2.4.1)
Python (with libraries: scikit-learn, hyperopt, pandas, numpy, SMOGN implementation)