Skip to content

USC-InfoLab/poly2vec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poly2Vec

Poly2Vec is a unified encoding framework that encodes points, polylines, and polygons into a fixed-length representation for spatial reasoning tasks.

📰 Paper

Our approach is presented in the following paper accepted to ICML 2025:

Poly2Vec: Polymorphic Fourier-Based Encoding of Geospatial Objects for GeoAI Applications
Maria Despoina Siampou, Jialiang Li, John Krumm, Cyrus Shahabi, Hua Lu
📄 Check out the paper

🔧 Installation

We recommend using a Conda environment with Python ≥ 3.9:

conda create -n poly2vec python=3.9
conda activate poly2vec

Then install the dependencies:

pip install -r requirements.txt

📦 Preprocessed Data

We utilized two OpenStreetMap (OSM) datasets in our evaluation: Singapore and New York. The required data can be downloaded from Geofabrik.

OSM Tags Used

  • Points (POIs): amenity, shop, tourism, leisure
  • Polylines (Roads): motorway, trunk, primary
  • Polygons (Buildings): building

Preprocessing Steps

  1. Place the downloaded .osm.pbf files into the ./data/ directory.

  2. Run the preprocessing script to extract and normalize geometries:

python utils/data_preprocessing.py

his will generate the following files inside each dataset folder:

  • poi_normalized.pkl
  • roads_normalized.pkl
  • buildings_normalized.pkl

Generate Datasets for Training and Evaluation

Run the following script:

python utils/data_generation.py

You will get files like polygon_polygon_topological_relationship_data.pt in each dataset's folder.

🚀 Training

Specify your training setup in the config.json file.

Example Run

To train a model on the New York polygon-polygon topological relation dataset using Poly2Vec:

python run.py \
  -dataset_name "NewYork" \
  -dataset_type1 "polygons" \
  -dataset_type2 "polygons" \
  -task "multi-relation" \
  -data_file "./data/NewYork/polygon_polygon_intersect_data.pt" \
  -encoder_type "poly2vec" \
  -data_path "./data/NewYork" \
  -num_classes 6

📄 Citation

If you found Poly2Vec useful, please consider citing us:

@inproceedings{
  siampou2025polyvec,
  title={Poly2Vec: Polymorphic Fourier-Based Encoding of Geospatial Objects for Geo{AI} Applications},
  author={Maria Despoina Siampou and Jialiang Li and John Krumm and Cyrus Shahabi and Hua Lu},
  booktitle={Forty-second International Conference on Machine Learning},
  year={2025},
  url={https://openreview.net/forum?id=kWyov6XrXs}
}

About

Official Implementation of Poly2vec presented @ [ICML '25]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages