This repository implements a framework for large-scale modelling of freshwater Cultural Ecosystem Services (CES), structured around four main Python scripts and supported by key data files.
- Francesc Comalada (Main developer, ICRA) – [email protected]
- Vicenç Acuña (Supervision, ICRA)
- Xavier Garcia (Supervision, ICRA)
Please contact us if you have questions or suggestions: [email protected]
Contains an example Excel file (Bounding_box_example.xlsx) defining bounding boxes along a river. Each row should contain:
sw_lat: southwest latitudesw_lon: southwest longitudene_lat: northeast latitudene_lon: northeast longitude
Includes a ResNet152 .pth file trained to classify images into five CES categories.
Four Jupyter notebooks performing the full modelling pipeline (described below).
- Install Visual Studio Code
- Download the folder
CES Modellingfrom this repository - Open it in VS Code via
File > Open Folder - Navigate to
/notebooks/AI_Model.ipynband open it - Install Python 3.10.3
- In VS Code, click
Select Kernel > Python Environments..., and choose.venv (Python 3.10.3) - Run the notebooks inside
scripts/sequentially
- Downloads geolocated Flickr photos using bounding box and time filters.
- Classifies images into CES categories using a pre-trained ResNet152 CNN.
- Achieves ~91% classification accuracy.
- Extracts and structures metadata (timestamp, user ID, geolocation, etc.) from classified images.
- Builds predictive models (XGBoost) linking CES presence to predictors like NDVI, population density, naturalness, and river order.
- Includes residual analysis, spatial autocorrelation (Moran's I), and interpolation, and mapping.
- Place photos inside a folder (e.g.,
photos_example) - The model will sort them into subfolders by predicted CES category
- Use relative paths within the main
CES Modellingdirectory
This repository includes a GeoPackage of CES images from the Iberian Peninsula, used in the original publication.
This repository contains six raster layers highlighting areas with high visitation rates but low population density, derived from crowdsourced data.
This repository includes the row code of the Resnet-152 model (for replication) (freshCES-net.ipynb)
This repository includes the photo ID used for model training and each photo's category (Training_CES_photos.xlsx) and model validation with unseen data (Ter_Validation_CES_photos.xlsx)
If you use this tool, please cite it as appropriate (publication pending). Your acknowledgement supports ongoing research.
Distributed for academic and non-commercial use.
We hope this tool supports your research. For any feedback or issues, feel free to open an issue or email us.