Checking for non-preferred file/folder path names (may take a long time depending on the number of files/folders) ...

Code and data for "Image-based classification of stream stage to support ephemeral stream monitoring"


Authors:
Owners: This resource does not have an owner who is an active HydroShare user. Contact CUAHSI (help@cuahsi.org) for information on this resource.
Type: Resource
Storage: The size of this resource is 401.2 MB
Created: May 09, 2025 at 6:36 p.m. (UTC)
Last updated: Feb 04, 2026 at 7:22 p.m. (UTC)
Citation: See how to cite this resource
Content types: File Set Content  Single File Content  CSV Content 
Sharing Status: Public
Views: 100
Downloads: 10
+1 Votes: Be the first one to 
 this.
Comments: No comments (yet)

Abstract

This resource contains model code and data used in "Imagery classification of stream stage to support ephemeral stream monitoring". The "Model" folder contains the Logistic Regression model used in the paper to classify stream state as "high water" levels, "low water" levels, "no water", or "obstructed" for images ("Photos.zip") of Perry Creek, California from August 2017-November 2023. Within the "Model" folder, there is also a model that was optimized for running on personal computers; this will generate slightly different results compared to the model used in the paper, but uses less memory. The "Photos" .zip contains the "Labeled" photos that were used to train the model and the "Unlabeled" photos that were classified by the model. The "Data" folder contains surface meteorology, soil moisture, stream stage, and streamflow data used in the paper to understand the hydrologic context of the image classifications and develop a deeper understanding of the hydrology of the Perry Creek watershed. Instructions for how to use the method presented here to classify photos from the USGS Flow Photo Explorer are provided in the "USGS_Photo_Instructions" folder. Please refer to the manuscript and the metadata below for detailed descriptions of the data and methods.

Here are instructions for how to run the model (instructions for running the PC-optimized version are in guide.txt of "PC_optimized_model.zip"):
1. Install Python 3.10 here: https://www.python.org/downloads/release/python-3100/ (once installed, add to PATH; Note: later Python version may work, but has not been tested)
2. Open your preferred interpreter (Ex: Visual Studio Code)
3. Check that you have Python 3.10 with "python --version"
4. Download the "Model_in_Paper" folder and "Photos.zip" into a folder on your computer. Unzip "Photos.zip".
5. Check your paths to ensure that they look like: "working_dir/Labeled_Photos/PEC/*" and "working_dir/Unlabeled_Photos/PEC/*"
6. In your working directory, create a virtual environment (you can also use a package manager like Conda) by typing this in the Terminal: "python -m venv venv"
7. Activate the virtual environment (Windows: "venv\Scripts\activate" or Mac: "source venv/bin/activate")
8. Install the packages from the requirements.txt file: "pip install -r requirements.txt"
9. Update the paths in main.py to point to where the photos are saved ("photo_path") and where you would like figures saved ("working_dir").
10. Use Python 3.10 to run main.py to classify the photos (navigate to the "Model_in_Paper" folder in Terminal and run "python main.py"). Main.py uses many of the functions in the "Model_in_Paper/utils" folder. The code will generate figures from the manuscript and return image classifications for the unlabeled photos that should resemble those in the "Model_in_Paper/image_classifications_final_model.csv".
11. The user can adjust the model configuration in main.py and/or use the model to classify their own field camera stream photos (using a folder of identically-sized, labeled photos sorted by image label and a folder of identically-sized, unlabeled photos).

Subject Keywords

Coverage

Spatial

Coordinate System/Geographic Projection:
WGS 84 EPSG:4326
Coordinate Units:
Decimal degrees
Place/Area Name:
Perry Creek
North Latitude
39.2023°
East Longitude
-123.1532°
South Latitude
39.1977°
West Longitude
-123.1599°

Temporal

Start Date:
End Date:

Content

Related Resources

The content of this resource references Ralph, F. M., Wilson, A. M., Alden, D., Ellis, C. J., Cooper, A., Paulsson, K., Kawzenuk, B. K., and Yao, P.: Center for Western Weather and Water Extremes (CW3E) Surface Meteorological Observational Dataset, https://doi.org/10.6075/J0SX6DDH, accessed on December 19, 2024, 2022.
The content of this resource references NOAA: NOAA National Water Model CONUS Retrospective Dataset, https://registry.opendata.aws/nwm-archive, 2024a.
The content of this resource references California Department of Water Resources. "PEC Station Metadata." California Data Exchange Center, https://cdec.water.ca.gov/dynamicapp/staMeta?station_id=PEC. Accessed 15 May 2025.

Credits

Funding Agencies

This resource was created using funding from the following sources:
Agency Name Award Title Award Number
U.S. Army Corps of Engineers Engineer Research and Development Center Forecast Informed Reservoir Operations Program W912HZ-24-2-0001
Hellman Fellows Program Faculty Fellowship None
U.S. National Science Foundation DISES: Decentralized management of integrated water resources: Understanding cross-scale decision feedbacks to support coordinated sustainability 2205239

Contributors

People or Organizations that contributed technically, materially, financially, or provided general support for the creation of the resource's content but are not considered authors.

Name Organization Address Phone Author Identifiers
Garrett McGurk
Anahita Jensen
F. Martin Ralph

How to Cite

Ogle, S. E., M. C. Levy (2026). Code and data for "Image-based classification of stream stage to support ephemeral stream monitoring", HydroShare, http://www.hydroshare.org/resource/926f16b0d54242879777b19fa805ef79

This resource is shared under the Creative Commons Attribution CC BY.

http://creativecommons.org/licenses/by/4.0/
CC-BY

Comments

There are currently no comments

New Comment

required