Skip to content
realize-labPublic
forked from jowariak/FOCUS_

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

FOCUS

This repository contains the implementation of FOCUS (Framework for Environmental Contamination Under Sparse Supervision), our geospatial deep learning framework for PFAS contamination mapping and fish-consumption advisory prediction. FOCUS combines a task-specific geospatial foundation model, a hydrology-informed noise-aware segmentation objective, and hydrology-informed decision-focused learning for advisory prediction.

Getting Started

Dependencies

  1. conda create -n <environment-name> python==3.9
  2. conda activate <environment-name>
  3. Install torch (tested for >=1.7.1 and <=1.11.0) and torchvision (tested for >=0.8.2 and <=0.12). May vary with your system. Please check at: https://pytorch.org/get-started/previous-versions/.
    1. e.g.: pip install torch==1.11.0+cu115 torchvision==0.12.0+cu115 --extra-index-url https://download.pytorch.org/whl/cu115
  4. pip install -U openmim
  5. mim install mmcv-full==1.6.2 -f https://download.openmmlab.com/mmcv/dist/{cuda_version}/{torch_version}/index.html. Note that pre-built wheels (fast installs without needing to build) only exist for some versions of torch and CUDA. Check compatibilities here: https://mmcv.readthedocs.io/en/v1.6.2/get_started/installation.html
    1. e.g.: mim install mmcv-full==1.6.2 -f https://download.openmmlab.com/mmcv/dist/cu115/torch1.11.0/index.html
  6. pip install -r requirements.txt

Core package list (see requirements.txt)

Repository Structure

File Description
pretraining.py Pretrains the shared encoder on multichannel geospatial features via masked autoencoding.
main.py Fine-tunes the pretrained encoder end-to-end on both the segmentation objective and the decision-focused advisory objective (hydrologic attention head), and evaluates the trained model (concentration MAE, meals/month MAE, mean unsafe excess, mean asymmetric decision cost, segmentation metrics).
patch_extraction.py Extracts aligned image and mask patches for model training. Handles multichannel rasters and label masks.
noise_masks.py Creates noise-aware label masks based on distance, flow, land cover, and sampling priors ($M_i$; Eq. 3 in the paper).

Data

The original PFAS monitoring data are provided by EPA, and MPART.

To run the code, you will need:

  • Multi-band geospatial rasters with:
    • Land cover (e.g., NLCD)
    • Distance-to-facility bands
    • Flow direction / hydrological features (D8)
  • Point-level PFAS measurements, both as expanded raster labels (for segmentation) and as raw point-level species/concentration records (for the advisory head)

Data Availability. The full multi-year, continental U.S. (CONUS) raster corpus underlying this work is approximately 30 TB and is not hosted directly due to size. We release the complete high-resolution raster corpus for Michigan, along with the processed train/test data used in this study, on Google Drive. The full CONUS corpus is archived on our institutional compute resources and will be released upon publication.

Status

This repository provides the core implementation used in the FOCUS framework, including the geospatial foundation model, noise-aware segmentation objective, and decision-focused advisory head. We plan to release expanded generatd documentation and usage examples in a future update.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages