{"id":29248840,"url":"https://github.com/hkuds/graphst","last_synced_at":"2025-09-06T04:38:54.806Z","repository":{"id":179606324,"uuid":"645206960","full_name":"HKUDS/GraphST","owner":"HKUDS","description":"[ICML'2023] \"GraphST: Spatial-Temporal Graph Learning with Adversarial Contrastive Adaptation\"","archived":false,"fork":false,"pushed_at":"2024-12-24T08:40:15.000Z","size":2180,"stargazers_count":49,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-24T09:33:13.895Z","etag":null,"topics":["contrastive-learning","graph-neural-networks","graph-representation-learning","spatio-temporal-prediction","urban-computing"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2306.10683","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HKUDS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-25T06:43:11.000Z","updated_at":"2024-12-24T08:40:19.000Z","dependencies_parsed_at":"2023-12-19T12:08:57.055Z","dependency_job_id":"4be2fa1d-19c5-4ba3-b9e6-4dda177e2a80","html_url":"https://github.com/HKUDS/GraphST","commit_stats":null,"previous_names":["hkuds/graphst"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HKUDS/GraphST","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HKUDS%2FGraphST","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HKUDS%2FGraphST/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HKUDS%2FGraphST/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HKUDS%2FGraphST/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HKUDS","download_url":"https://codeload.github.com/HKUDS/GraphST/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HKUDS%2FGraphST/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263421915,"owners_count":23464052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contrastive-learning","graph-neural-networks","graph-representation-learning","spatio-temporal-prediction","urban-computing"],"created_at":"2025-07-04T00:09:13.163Z","updated_at":"2025-07-04T00:09:15.721Z","avatar_url":"https://github.com/HKUDS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Framework](./pictures/framework.png)\n\n# Initial Data link\nhttps://drive.google.com/drive/folders/1heuy-28olym0Tn4bkMaJTABVF9kXMZNe?usp=sharing\n\n\n# Spatial-Temporal Graph Learning with Adversarial Contrastive Adaptation #\nThis is the implementation of Spatial-Temporal Graph Learning with Adversarial Contrastive Adaptation (ICML'23) in the following paper:\n\n## Requirements ##\nPytorch = 1.7.0 and Tensorflow = 1.15.3 (crime prediction task (ST-SHN))\n\n## Data ##\nMoblity data, crime data, census block data, POI data, house price of Chicago ([https://data.cityofchicago.org/](https://data.cityofchicago.org/)) and New York([https://opendata.cityofnewyork.us/](https://opendata.cityofnewyork.us/)).\nAlso, we provide the process data and processing code for data preprocessing.\n\n## Data Preocessing ##\n    cd data_pre\n    pre_s1.py # collecing positions of 180 (234 regions) in Manhatton (a certain district) in New York (Chicago).\n    pre_s2.py # collecting traffic data\n    pre_s3.py # preprocessing the traffic data on correspongding regions\n    pre_s4.py # preprocessing the POI data and obtain POI-aware Region Graph\n    pre_poi_transformer.py # obatining the features of nodes by Transformer and Skip-gram\n    pre_spatial_graph.py # constructing the trajectory-based Regoin Graph and Distance-based Region Graph\n    pre_s5.py # constructing a hierarical graph\n    pre_s6_dataloader.py # obtaining the dataloder (dataset.pt file) for next step to get region embeddings\n    cd house\n    pre_s7.py # processing house data\n\n## Hyperparameters ##\nThe dimensionality d of region representation is set as 96 . The depth of convolutional layers in GCN is set as 2. The learning rate is initialized as 0.001 with the weight decay of 1e-5. The number of hidden units is 256. The number of projection hidden is 256. The eps is set as 0.5. And alpha is set as.1, beta is set as 0.1; the lamb is set as 0.05. For the crime prediction backbone model, ST-SHN is configured with the learning rate of 0.001 and the weight decay of 0.96. The depth of the spatial path aggregation layers is set as 2. For the traffic prediction backbone model ST-GCN, the historical time window of all tests are set as 60 minutes with 12 observed data points that are utilized to forecast traffic conditions in the next 15, 30, 45 minutes. The baselines are implemented with the source code released by their original papers. We further apply the grid search strategy for parameter tuning in baselines to achieve their best performance. \n\n## Spatial-Temporal Adversarial Graph Model (STAG) Training and Obtaining Region Representations ##\n    train_edit_auto.py   # training for obatining region representations\n\n## TASK 1: Crime Prediction Task ##\nThe code of the ST-SHN is [https://github.com/akaxlh/ST-SHN](https://github.com/akaxlh/ST-SHN)\n\nReplace the area embedding with the region represenation vetcor and run `HG_ST_labcode.py`.\n\n\n## TASK 2:  Traffic Prediction Task ##\nThe code of the ST-GCN is [https://github.com/VeritasYin/STGCN_IJCAI-18](https://github.com/VeritasYin/STGCN_IJCAI-18)\nST-GCN predicts traffic in one stage, namely 15 minutes.\nRun `main.py`.\n\n\n## TASK 3: House Prediction Prediction Task ##\nWe use Lasso Regression to perform house price evaluation task.\n\nJust `cd house` and run `pre_s9.py` and got the regression result.\n\n![Prediction Results](./pictures/result.png)\n\n## Citing ##\nIf our paper benefits to your research, please cite our paper using the bitex below:\n\n    @inproceedings{zhang2023spatial,\n      title={Spatial-Temporal Graph Learning with Adversarial Contrastive Adaptation},\n      author={Zhang, Qianru and Huang, Chao and Xia, Lianghao and Wang, Zheng and Yiu, Siu Ming and Han, Ruihua},\n      booktitle={International Conference on Machine Learning},\n      pages={41151--41163},\n      year={2023},\n      organization={PMLR}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkuds%2Fgraphst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhkuds%2Fgraphst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkuds%2Fgraphst/lists"}