Robust & Reliable Route Recommendation on Road Networks

Related tags

Deep LearningNeuroMLR
Overview

NeuroMLR: Robust & Reliable Route Recommendation on Road Networks

This repository is the official implementation of NeuroMLR: Robust & Reliable Route Recommendation on Road Networks.

Introduction

Predicting the most likely route from a source location to a destination is a core functionality in mapping services. Although the problem has been studied in the literature, two key limitations remain to be addressed. First, a significant portion of the routes recommended by existing methods fail to reach the destination. Second, existing techniques are transductive in nature; hence, they fail to recommend routes if unseen roads are encountered at inference time. We address these limitations through an inductive algorithm called NEUROMLR. NEUROMLR learns a generative model from historical trajectories by conditioning on three explanatory factors: the current location, the destination, and real-time traffic conditions. The conditional distributions are learned through a novel combination of Lipschitz embeddings with Graph Convolutional Networks (GCN) on historical trajectories.

Requirements

Dependencies

The code has been tested for Python version 3.8.10 and CUDA 10.2. We recommend that you use the same.

To create a virtual environment using conda,

conda create -n ENV_NAME python=3.8.10
conda activate ENV_NAME

All dependencies can be installed by running the following commands -

pip install -r requirements.txt
pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.6.0+cu102.html
pip install --no-index torch-sparse -f https://pytorch-geometric.com/whl/torch-1.6.0+cu102.html
pip install --no-index torch-cluster -f https://pytorch-geometric.com/whl/torch-1.6.0+cu102.html
pip install --no-index torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.6.0+cu102.html
pip install torch-geometric

Data

Download the preprocessed data and unzip the downloaded .zip file.

Set the PREFIX_PATH variable in my_constants.py as the path to this extracted folder.

For each city (Chengdu, Harbin, Porto, Beijing, CityIndia), there are two types of data:

1. Mapmatched pickled trajectories

Stored as a python pickled list of tuples, where each tuple is of the form (trip_id, trip, time_info). Here each trip is a list of edge identifiers.

2. OSM map data

In the map folder, there are the following files-

  1. nodes.shp : Contains OSM node information (global node id mapped to (latitude, longitude))
  2. edges.shp : Contains network connectivity information (global edge id mapped to corresponding node ids)
  3. graph_with_haversine.pkl : Pickled NetworkX graph corresponding to the OSM data

Training

After setting PREFIX_PATH in the my_constants.py file, the training script can be run directly as follows-

python train.py -dataset beijing -gnn GCN -lipschitz 

Other functionality can be toggled by adding them as arguments, for example,

python train.py -dataset DATASET -gpu_index GPU_ID -eval_frequency EVALUATION_PERIOD_IN_EPOCHS -epochs NUM_EPOCHS 
python train.py -traffic
python train.py -check_script
python train.py -cpu

Brief description of other arguments/functionality -

Argument Functionality
-check_script to run on a fixed subset of train_data, as a sanity test
-cpu forces computation on a cpu instead of the available gpu
-gnn can choose between a GCN or a GAT
-gnn_layers number of layers for the graph neural network used
-epochs number of epochs to train for
-percent_data percentage data used for training
-fixed_embeddings to make the embeddings static, they aren't learnt as parameters of the network
-embedding_size the dimension of embeddings used
-hidden_size hidden dimension for the MLP
-traffic to toggle the attention module

For exact details about the expected format and possible inputs please refer to the args.py and my_constants.py files.

Evaluation

The training code generates logs for evaluation. To evaluate any pretrained model, run

python eval.py -dataset DATASET -model_path MODEL_PATH

There should be two files under MODEL_PATH, namely model.pt and model_support.pkl (refer to the function save_model() defined in train.py to understand these files).

Pre-trained Models

You can find the pretrained models in the same zip as preprocessed data. To evaluate the models, set PREFIX_PATH in the my_constants.py file and run

python eval.py -dataset DATASET

Results

We present the performance results of both versions of NeuroMLR across five datasets.

NeuroMLR-Greedy

Dataset Precision(%) Recall(%) Reachability(%) Reachability distance (km)
Beijing 75.6 74.5 99.1 0.01
Chengdu 86.1 83.8 99.9 0.0002
CityIndia 74.3 70.1 96.1 0.03
Harbin 59.6 48.6 99.1 0.02
Porto 77.3 70.7 99.6 0.001

NeuroMLR-Dijkstra

Since NeuroMLR-Dijkstra guarantees reachability, the reachability metrics are not relevant here.

Dataset Precision(%) Recall(%)
Beijing 77.9 76.5
Chengdu 86.7 84.2
CityIndia 77.9 73.1
Harbin 66.1 49.6
Porto 79.2 70.9

Contributing

If you'd like to contribute, open an issue on this GitHub repository. All contributions are welcome!

TopFormer: Token Pyramid Transformer for Mobile Semantic Segmentation, CVPR2022

TopFormer: Token Pyramid Transformer for Mobile Semantic Segmentation Paper Links: TopFormer: Token Pyramid Transformer for Mobile Semantic Segmentati

Hust Visual Learning Team 253 Dec 21, 2022
Repositorio oficial del curso IIC2233 Programación Avanzada 🚀✨

IIC2233 - Programación Avanzada Evaluación Las evaluaciones serán efectuadas por medio de actividades prácticas en clases y tareas. Se calculará la no

IIC2233 @ UC 0 Dec 15, 2022
Code for our paper 'Generalized Category Discovery'

Generalized Category Discovery This repo is a placeholder for code for our paper: Generalized Category Discovery Abstract: In this paper, we consider

107 Dec 28, 2022
A PyTorch library for Vision Transformers

VFormer A PyTorch library for Vision Transformers Getting Started Read the contributing guidelines in CONTRIBUTING.rst to learn how to start contribut

Society for Artificial Intelligence and Deep Learning 142 Nov 28, 2022
UDP++ (ECCVW 2020 Oral), (Winner of COCO 2020 Keypoint Challenge).

UDP-Pose This is the pytorch implementation for UDP++, which won the Fisrt place in COCO Keypoint Challenge at ECCV 2020 Workshop. Top-Down Results on

20 Jul 29, 2022
GAN-STEM-Conv2MultiSlice - Exploring Generative Adversarial Networks for Image-to-Image Translation in STEM Simulation

GAN-STEM-Conv2MultiSlice GAN method to help covert lower resolution STEM images generated by convolution methods to higher resolution STEM images gene

UW-Madison Computational Materials Group 2 Feb 10, 2021
Session-based Recommendation, CoHHN, price preferences, interest preferences, Heterogeneous Hypergraph, Co-guided Learning, SIGIR2022

This is our implementation for the paper: Price DOES Matter! Modeling Price and Interest Preferences in Session-based Recommendation Xiaokun Zhang, Bo

Xiaokun Zhang 27 Dec 02, 2022
Inference pipeline for our participation in the FeTA challenge 2021.

feta-inference Inference pipeline for our participation in the FeTA challenge 2021. Team name: TRABIT Installation Download the two folders in https:/

Lucas Fidon 2 Apr 13, 2022
NCVX (NonConVeX): A User-Friendly and Scalable Package for Nonconvex Optimization in Machine Learning.

The source code is temporariy removed, as we are solving potential copyright and license issues with GRANSO (http://www.timmitchell.com/software/GRANS

SUN Group @ UMN 28 Aug 03, 2022
Code for the preprint "Well-classified Examples are Underestimated in Classification with Deep Neural Networks"

This is a repository for the paper of "Well-classified Examples are Underestimated in Classification with Deep Neural Networks" The implementation and

LancoPKU 25 Dec 11, 2022
[Arxiv preprint] Causality-inspired Single-source Domain Generalization for Medical Image Segmentation (code&data-processing pipeline)

Causality-inspired Single-source Domain Generalization for Medical Image Segmentation Arxiv preprint Repository under construction. Might still be bug

Cheng 31 Dec 27, 2022
Airborne magnetic data of the Osborne Mine and Lightning Creek sill complex, Australia

Osborne Mine, Australia - Airborne total-field magnetic anomaly This is a section of a survey acquired in 1990 by the Queensland Government, Australia

Fatiando a Terra Datasets 1 Jan 21, 2022
3 Apr 20, 2022
Kaggle DSTL Satellite Imagery Feature Detection

Kaggle DSTL Satellite Imagery Feature Detection

Konstantin Lopuhin 206 Oct 29, 2022
TensorFlow-LiveLessons - "Deep Learning with TensorFlow" LiveLessons

TensorFlow-LiveLessons Note that the second edition of this video series is now available here. The second edition contains all of the content from th

Deep Learning Study Group 830 Jan 03, 2023
Code for SIMMC 2.0: A Task-oriented Dialog Dataset for Immersive Multimodal Conversations

The Second Situated Interactive MultiModal Conversations (SIMMC 2.0) Challenge 2021 Welcome to the Second Situated Interactive Multimodal Conversation

Facebook Research 81 Nov 22, 2022
A Player for Kanye West's Stem Player. Sort of an emulator.

Stem Player Player Stem Player Player Usage Download the latest release here Optional: install ffmpeg, instructions here NOTE: DOES NOT ENABLE DOWNLOA

119 Dec 28, 2022
Adaptable tools to make reinforcement learning and evolutionary computation algorithms.

Pearl The Parallel Evolutionary and Reinforcement Learning Library (Pearl) is a pytorch based package with the goal of being excellent for rapid proto

38 Jan 01, 2023
Preprossing-loan-data-with-NumPy - In this project, I have cleaned and pre-processed the loan data that belongs to an affiliate bank based in the United States.

Preprossing-loan-data-with-NumPy In this project, I have cleaned and pre-processed the loan data that belongs to an affiliate bank based in the United

Dhawal Chitnavis 2 Jan 03, 2022
This is the official PyTorch implementation for "Mesa: A Memory-saving Training Framework for Transformers".

Mesa: A Memory-saving Training Framework for Transformers This is the official PyTorch implementation for Mesa: A Memory-saving Training Framework for

Zhuang AI Group 105 Dec 06, 2022