Giter VIP home page Giter VIP logo

temporal-mr-gcn's Introduction

Temporal MR-GCN

Towards Accurate Vehicle Behaviour Classification
With Multi Relational Graph Convolutional Networks

Link to our paper on arxiv : https://arxiv.org/abs/2002.00786
For any queries mail : [email protected] (or) [email protected]

Our method detects and classifies objects of interest (vehicles) in a video scene into 6 classes moving away, moving towards us, parked, lane change(L->R), lane change(R->L), overtake. Note that our method is not based on classifying the ego-vehicle.


Base-line Implementation details


Apart from comparisons in the paper, we compare with Structural-RNN, a LSTM based graph network. Since the tasks in their paper confine only to driver-anticipation, we use one of their methods similar to our task. Specifically, we use the detection method of activity-anticipation mentioned in the paper due to the similarity in the architecture and task . We use Vehicles as Humans and Lane Markings as Objects in their architecture for our purpose. Similar to the Human-Object, Human-Human and Object-Object interactions, we observe the Vehicle-Lane, Vehicle-Vehicle and Lane-Lane interactions for all time-steps. We give features similar to the baselines in the paper.

Method St-RNN LSTM LSTM +
Multi-head attetnion
Ours
Moving away 76 37 56 85.3
moving towards us 51 35 41 89.5
Parked 83 34 46 94.8
lane-change(L->R) 52 6 8 84.1
lane-change(R->L) 57 24 27 86.4
Overtake 63 15 13 72.3

Dataset


We selected 3 main datasets to perform the experiments.

  1. Apollo
  2. Kitti
  3. Indian

Graphs for all datasets can be downloaded from graphs.
For information on how each graph is stored as a npz file, go through the README file in the same link.

On apollo we have selected sequences from scene-parsing dataset and picked around 70 small sequences(each containing aroud 100 images) manually that include behaviours of our interest. Similarly on Kitti, we use tracking sequences 4,5,10 which are in line with our class requirement.

Installation


Requirements
dgl
pytorch == 1.2.0
pandas
numpy
tqdm

Installing without GPU:

pip3 install requirements.txt

To install and use GPU for dgl, cuda support can be installed from their official website, dgl .
And set use_cuda = 1 in training/testing codes.

Testing and Training on apollo dataset

git clone https://github.com/ma8sa/temporal-MR-GCN.git
cd temporal-MR-GCN
--testing
python3 lstm_rgcn_test_apollo.py
--training
python3 lstm_rgcn_train_apollo.py

NOTE : Make sure to extract the corresponding graphs(lstm_graphs_apollo) and place it in the same folder where you are running the code from.

In training, lstm_rgcn_train_apollo has all the parameters in main function to tune. main_model.py contains the complete model. rgcn_layer.py contains the dgl format of MR-GCN. graphs_preproc_apollo.py conatains all the data preprocessing methods used.

Testing on Indian/Kitti dataset (Transfer Learning)

for indian,
python3 lstm_rgcn_test_ind_kitti.py indian
for kitti,
python3 lstm_rgcn_test_ind_kitti.py kitti

NOTE : Make sure to extract the corresponding graphs (lstm_graphs_kitti for kitti and lstm_graphs_indian for indian) and place it in the same folder where you are running the code from.

RESULTS


0->Move forward
1->Moving towards us
2->Parked
3-> lane-change(L->R)
4-> lane-change(R->L)
5-> Overtake

Results on Apollo
0 1 2 3 4 5
class accuracy(train) 95 98 97 96 96 97
class counts(train) 2673 685 3574 424 452 525
class accuracy(val) 85 89 94 84 86 72
class counts(val) 814 237 1415 162 130 73

Since the number of cars showing overtake behaviour are less, we augmented and added few synthetic-graphs and augmented data to train data only for apollo. With a little more data, the model can clearly learn overtake too above 80%, as number of synthetic graphs added were too low 76.

Results on Kitti tested with weights trained on Apollo
0 1 2
class accuracy 99 98 98
class counts 504 230 674
Results on Indian tested with weights trained on Apollo
0 1 2
class accuracy 99 92 99
class counts 324 229 2547

temporal-mr-gcn's People

Contributors

ma8sa avatar

Stargazers

 avatar  avatar ChengJJ avatar EmilyM avatar Dream avatar  avatar  avatar  avatar Hank Kung avatar  avatar  avatar  avatar Li Zirui avatar  avatar Xin avatar mxlol233 avatar

Watchers

 avatar Li Zirui avatar paper2code - bot avatar

temporal-mr-gcn's Issues

About scene graph construction

Thank you for your novel work. However, I am interested in the details of scene graph construction. Could you release the code and more implementation details about how to construct scene graphs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.