An NSF-AI Institute ICICLE project leveraging Graph Neural Networks (GNNs) to predict food flows between counties and FAF zones for economic planning, infrastructure development, and policy-making. This model predicts food trade flows between U.S. counties and Freight Analysis Framework (FAF) zones using Graph Neural Networks (GNNs). It addresses the challenges of sparsity in trade data by applying a two-stage hurdle model that distinguishes between the presence and magnitude of trade.
Tags: Smart-Foodsheds, AI4CI, Food-Systems, Food-Access
Great News! The portal is now online at https://gnnfoodflowportal.pods.icicleai.tapis.io/
Please go to https://github.com/ICICLE-ai/GNNFoodFlowPortal/ for more updated information and better accessability
- Developed by: Qianheng Zhang & ICICLE Food Systems Team led by Professor Song Gao
- Funded by: NSF AI Institute for Intelligent Cyberinfrastructure with Computational Learning in the Environment (ICICLE) (OAC 2112606)
- Model type: Graph Neural Network (GAT and GCN variants)
- Language(s): English (for documentation and metadata)
- License: MIT License
- Framework: PyTorch, PyTorch Geometric This repository contains the core implementation for the FoodFlow GNN model. For comprehensive usage instructions, detailed tutorials, and visualization tools, please visit: https://huggingface.co/ICICLE-AI/FoodFlow_GNN_Model
MIT
If you find our code or ideas useful for your research, please cite our paper:
Zhang, Q., Dev, P., Miller, M., Morales, A., & Gao, S. (2025). Scalable Inter-County Food Flow Prediction Using Graph Neural Networks. ACM SIGSPATIAL '25, November 3–6, 2025, Minneapolis, MN, USA , 1-10.
@article{zhang2025scalable,
title={Scalable Inter-County Food Flow Prediction Using Graph Neural Networks},
author={Qianheng Zhang and Dev Paul and Michelle Miller and Alfonso Morales and Song Gao.},
journal={The 33rd ACM International Conference on Advances in Geographic
Information Systems (SIGSPATIAL ’25)},
volume={2025},
number={1},
pages={1--10},
year={2025},
doi={10.1145/3748636.3764168}
publisher={ACM}
}
- Problem: Predicting trade flows with many zero values
- Solution: Implement a two-stage hurdle model that:
- First predicts whether trade exists between two regions
- Then estimates the volume of trade when it exists
- Code example: See the GAT model implementation in
code/model.py - Results: See the resulted models in
code/models, note that models for different SCTG02 codes has to be trained separately
- Python 3.9+
- PyTorch (>=1.9.0)
- PyTorch Geometric (>=2.0.0)
- Other dependencies (see Hugging Face page for complete list)
- Problem: Capturing complex relationships in trade networks
- Solution: Combine multiple feature types:
- County-level economic indicators (population, employment_rate, median_income)
- Geographic distance and transportation modes
- Industry diversity metrics
Our approach uses Graph Neural Networks to model trade relationships between counties and FAF zones. The model architecture includes:
- Graph Attention Networks (GAT) to capture the importance of different connections
- Graph Convolutional Networks (GCN) for comparison
- A hurdle model approach that separates the prediction into classification and regression tasks
This design better handles the sparse nature of trade networks where many county pairs have zero trade. The model learns both from geographic proximity and economic similarity, providing more accurate predictions than traditional statistical methods.
- Complete setup instructions: Hugging Face - Setup Instructions
- Data download links: FoodFlow Inference Data
- Information for Visualization portal: FoodFlowPortal
- Troubleshooting: Hugging Face - Troubleshooting
- Predicting food flows between regions using node (county/FAF zone) and edge features
- Modeling economic connectivity and transportation dependency
Please visit the new online portal here: GNN Food Flow Portal for the latest interactive visualization and download features.
Please go to https://github.com/ICICLE-ai/GNNFoodFlowPortal/ for more updated information and better accessability
- Spatial forecasting of trade changes under policy shifts
- Identifying critical counties for supply chain resilience
- Real-time food trade forecasting
- Non-U.S. geographic settings without retraining
- Bias: Model predictions depend on historical FAF data and may not reflect unexpected future disruptions (e.g., disasters, pandemics)
- Limitations: Prediction is limited to predefined commodity codes (SCTG1)
- Data quality: Assumes accuracy of FAF flow data and economic indicators
Users should:
- Evaluate model generalizability before applying it to non-FAF settings
- Interpret sparse predictions carefully—zeros may result from missing data, not true absence
- Trade Data: FAF5.6.1 SCTG1 commodity flow data (
code/data/FAF5_SCTG1.csv) - Geographic Information:
- County shapefiles (
portal/code/data/shapefiles/cb_2017_us_county_500k/cb_2017_us_county_500k.shp) - State shapefiles (
portal/code/data/shapefiles/cb_2018_us_state_20m/cb_2018_us_state_20m.shp) - FAF zones shapefiles (
portal/code/data/shapefiles/2017_CFS_Metro_Areas_with_FAF/2017_CFS_Metro_Areas_with_FAF.shp)
- County shapefiles (
- FAF Economic Indicators: FAF-level economic data (
code/data/faf_features_aligned_filtered.csv) - County Economic Indicators: County-level economic data (
code/data/county_aligned_filtered.csv) - Distance Information: FAF Distance Matrix (
code/data/FAF_distance_Matrix.csv) Due to the low efficiency of separating county level distance matrix, the distance information is included within county level feature information
National Science Foundation (NSF) funded AI institute for Intelligent Cyberinfrastructure with Computational Learning in the Environment (ICICLE) (OAC 2112606)
- Extending the model to handle inter-county food trade flow predictions
- Refining the model to capture more granular food trade patterns