{"id":23132605,"url":"https://github.com/louisccc/sg-risk-assessment","last_synced_at":"2025-08-14T11:41:49.192Z","repository":{"id":39729044,"uuid":"238277836","full_name":"louisccc/sg-risk-assessment","owner":"louisccc","description":"This repo includes the source code and dataset information for reproducing the results of our paper (https://arxiv.org/abs/2009.06435)","archived":false,"fork":false,"pushed_at":"2023-03-24T23:36:15.000Z","size":1560986,"stargazers_count":39,"open_issues_count":9,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-10-20T09:09:11.225Z","etag":null,"topics":["scene-graph"],"latest_commit_sha":null,"homepage":"","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/louisccc.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}},"created_at":"2020-02-04T18:37:17.000Z","updated_at":"2023-10-05T08:41:53.000Z","dependencies_parsed_at":"2023-01-22T04:46:29.002Z","dependency_job_id":null,"html_url":"https://github.com/louisccc/sg-risk-assessment","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisccc%2Fsg-risk-assessment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisccc%2Fsg-risk-assessment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisccc%2Fsg-risk-assessment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louisccc%2Fsg-risk-assessment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louisccc","download_url":"https://codeload.github.com/louisccc/sg-risk-assessment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230106164,"owners_count":18174012,"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":["scene-graph"],"created_at":"2024-12-17T11:19:12.924Z","updated_at":"2024-12-17T11:19:14.145Z","avatar_url":"https://github.com/louisccc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scene-graph Augmented Data-driven Risk Assessment of Autonomous Vehicle Decisions\nThis repository includes the code and dataset information required for reproducing the results in [our paper](https://arxiv.org/abs/2009.06435). Besides, we also integrated the source code of [our baseline method](https://arxiv.org/abs/1906.02859), [DeepTL-Lane-Change-Classification](https://github.com/Ekim-Yurtsever/DeepTL-Lane-Change-Classification), into this repo. The baseline approach infers the risk level of lane change video clips with deep CNN+LSTM. Our approach incoporates both spatial modeling and temporal modeling in the task of subjective risk assessment. \n\n**NOTE:** For a more comprehensive implementation of the code from this project and our other related work, please refer to our new open-source tool for AV scene-graph generation and embedding [roadscene2vec](https://github.com/AICPS/roadscene2vec).\n\n\nThe architecture of our approach is illustrated as below,\n\n![](https://github.com/louisccc/sg-risk-assessment/blob/master/assets/archi.png?raw=true)\n\nAs for fabricating the lane-changing datasets, we use Carla [CARLA](https://github.com/carla-simulator/carla) 0.9.8 which is an open-source autonomous car driving simulator. Besides, we also utilized the [scenario_runner](https://github.com/carla-simulator/scenario_runner) which was designed for CARLA challenge event. For real-driving datasets, we used Honda-Driving Dataset (HDD) in our experiments. We published the converted scene-graph datasets used in our paper [here](http://ieee-dataport.org/3618).\n\nThe architecture of this repository is as below:\n- **sg-risk-assessment/**: this folder consists of all the related source files used for our scene-graph based approach. \n- **baseline-risk-assessment/**: this folder consists of all the related source files used for the baseline method.\n- **sg_risk_assessment.py**: the script that triggers our scene-graph based approach. \n- **baseline_risk_assessment.py**: the script that triggers the baseline model.\n\n# To Get Started\nWe recommend our potential users to use [Anaconda](https://www.anaconda.com/) as the primary virtual environment. The requirements to run through our repo are as follows,\n- python \u003e= 3.6 \n- torch == 1.6.0\n- torch_geometric == 1.6.1\n\nOur recommended command sequence is as follows:\n```shell\n$ conda create --name sg_risk_assessment python=3.6\n$ conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1 -c pytorch\n$ python -m pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.6.0+cu101.html\n$ python -m pip install --no-index torch-sparse -f https://pytorch-geometric.com/whl/torch-1.6.0+cu101.html\n$ python -m pip install --no-index torch-cluster -f https://pytorch-geometric.com/whl/torch-1.6.0+cu101.html\n$ python -m pip install --no-index torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.6.0+cu101.html\n$ python -m pip install torch-geometric==1.6.1\n$ python -m pip install -r requirements.txt\n```\t\nThis set of commands assumes you to have cuda10.1 in your local. Please refer to the installation guides of [torch](https://pytorch.org/) and [pytorch_geometric](https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html) if you have different environment settings.\n\n# Usages\nFor running the sg-risk-assessment in this repo, you may refer to the following commands:\n```shell\n$ python sg_risk_assessment.py --pkl_path risk-assessment/scenegraph/synthetic/271_dataset.pkl\n\n# --pkl_path + [wherever path that stores the downloaded pkl]\n# For tuning hyperparameters view the config class of sg_risk_assessment.py\n```\n\nFor running the baseline-risk-assessment in this repo, you may refer to the following commands:\n```shell\n$ python baseline_risk_assessment.py --load_pkl True --pkl_path risk-assessment/scene/synthetic/271_dataset.pkl\n\n# --pkl_path + [wherever path that stores the downloaded pkl]\n# For tuning hyperparameters view the config class of baseline_risk_assessment.py\n```\n\nAfter running these commands, the expected outputs are a dump of metrics logged by wandb:\n```shell\nwandb:                    train_recall ▁████████████████████\nwandb:                   val_precision █▁▅▄▅▄▆▆▆▅▄▄▇▆▅▆▅▇▆▆▆\nwandb:                      val_recall ▁████████████████████\nwandb:                       train_fpr ▁█▅▅▄▅▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂\nwandb:                       train_tnr █▁▄▅▅▅▆▇▇▇▇▇▇▇▇▇▇▇▇▇▇\nwandb:                       train_fnr █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\nwandb:                         val_fpr ▁█▄▅▄▅▃▃▃▄▄▅▂▃▃▃▄▂▃▃▃\nwandb:                         val_tnr █▁▆▄▆▄▆▆▆▆▅▄▇▆▆▆▆▇▆▆▆\nwandb:                         val_fnr █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\nwandb:                      best_epoch ▁▁▂▂▂▂▃▃▄▄▄▄▅▅▅▅▅▇▇▇█\nwandb:                   best_val_loss █▃▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\nwandb:                    best_val_acc ▁▆█▇█████████████████\nwandb:                    best_val_auc ▁▅▆▆▇▇▇▇████▇▇▇▇▇████\nwandb:                    best_val_mcc ▁▇███████████████████\nwandb:           best_val_acc_balanced ▁████████████████████\nwandb:                       train_mcc ▁▇▇▇▇▇███████████████\nwandb:                         val_mcc ▁▇███████████████████\n```\n\nA graphical visualization of the model outputs including loss and additional metrics can be viewed by creating and linking your runs to [wandb](https://wandb.ai/home).\n\n# Citation \nPlease kindly consider citing our paper if you find our work useful for your research\n```\n@article{yu2020scene,\n  title={Scene-graph augmented data-driven risk assessment of autonomous vehicle decisions},\n  author={Yu, Shih-Yuan and Malawade, Arnav V and Muthirayan, Deepan and Khargonekar, Pramod P and Faruque, Mohammad A Al},\n  journal={arXiv preprint arXiv:2009.06435},\n  year={2020}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisccc%2Fsg-risk-assessment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouisccc%2Fsg-risk-assessment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouisccc%2Fsg-risk-assessment/lists"}