Identifying and mapping urban Crime-Hotspots using a deep-learning model and sequential images of deviant locations (i.e., Location of reported deviant incidents such as crime and civil complaints).
[AAAI2022] "DevianceNet: Learning to Predict Deviance from A Large-scale Geo-tagged Dataset"
[TPAMI2024] "What Makes Deviant Places?"
- This repository contains the code for the DevianceNet applied to the deviance prediction.
deviance_video.1.mp4
![](https://private-user-images.githubusercontent.com/70624468/324354580-5f23c5dd-6156-4801-b1eb-3477ca12674b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1OTkxMjksIm5iZiI6MTcxOTU5ODgyOSwicGF0aCI6Ii83MDYyNDQ2OC8zMjQzNTQ1ODAtNWYyM2M1ZGQtNjE1Ni00ODAxLWIxZWItMzQ3N2NhMTI2NzRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDE4MjAyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWExYTRhZDQ0ZWZlYWFjNTM2ZWZiZjg0MGEwNTAwOGZmZjUyNDQ5MWE3OWUxZjI3ODhkMGZlOTdjNzQyNDZiNDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.L35aQwxMm6I7aEcDgmhn1AsYmwDVW4YETWh9FaMSgBQ)
- Sequential images
- Geo-tagged image files annotated with deviance class
- Dataset description
Please download the dataset at (https://drive.google.com/drive/folders/1ERFaC_6IseQgXDvs5_ep5at56b-b7Vmg?usp=sharing).
Deviance
├── Seoul
│ ├── Seoul_train_SEA
│ │ ├── v_class1_g37.499,127.1251_c0
│ │ │ ├── frame000000.jpg
│ │ │ └── ...
│ │ └── ...
│ ├── Seoul_train_DIA
│ │ └── ...
│ ├── Seoul_test_SEA
│ │ └── ...
│ └── Seoul_test_DIA
│ └── ...
├── Busan
│ └── ...
├── Incheon
│ └── ...
├── Daejeon
│ └── ...
├── Daegu
│ └── ...
├── Newyork
│ └── ...
└── Chicago
└── ...
The directory {City}_{Train/Test}_{SEA/DIA} is used for train/test corresponding to the {City}.
The files v_class{Number}_g{GPS}_c{Direction} is annotated with corresponding deviance class, GPS and viewpoint direction.
Note that '+'(ex. v_class2_g35.0911,129.0394_c1+) indicates the additional sets of sequential images in the GPS.
- Our implementation of DevianeNet (./models/devianceNet.py)
- Official implementation of DevianceNet (./main.py)
- Train & evaluation code for Deviance Dataset
- Code description
- Ubuntu 16.04
- python 3.8
- numpy>=1.18.5
- torch==1.7.0
- torchvision>=0.5.0
- pillow>= 8.0.1
- scikit-image
- tqdm
- sklearn
- pandas
- h5py
- matplotlib
- apex
- scipy>=1.4.1
- Download the dataset and pretrained weights at (https://drive.google.com/drive/folders/1ERFaC_6IseQgXDvs5_ep5at56b-b7Vmg?usp=sharing).
- Put the dataset into ./data/ folder
- [Application & Evaluation] Put the pretrained weights into ./weight_file/ folder.
Use the 'main.py' to train/test our model.
# Train
python main.py --train_folder_directory {Dataset Directory} --SEA_folder_directory {Dataset Directory} --DIA_folder_directory {Dataset Directory} --experiment_description Train --batch_size 36 --num_threads 16 --classifier_type SEA_DIA
# Test SEA
python main.py --SEA_folder_directory {Dataset Directory} --experiment_description Test_SEA --batch_size 1 --classifier_type SEA_DIA --test_only --weight_load_pth ./weight_file/[AAAI2022-DevianceNet]SEA.pth --test_metric SEA
# Test DIA
python main.py --DIA_folder_directory {Dataset Directory} --experiment_description Test_DIA --batch_size 1 --classifier_type SEA_DIA --test_only --weight_load_pth ./weight_file/[AAAI2022-DevianceNet]DIA.pth --test_metric DIA
# Application
python main.py --SEA_folder_directory ./application --experiment_description Test_DIA --batch_size 1 --classifier_type SEA_DIA --test_only --weight_load_pth ./weight_file/[AAAI2022-DevianceNet]SEA.pth --test_metric SEA
If you find this code useful for your research, please cite our paper :)
@inproceedings{park2022deviance,
title={DevianceNet: Learning to Predict Deviance from A Large-scale Geo-tagged Dataset},
author={Park, Jin-Hwi and Park, Young-Jae and Lee, Junoh and Jeon, Hae-Gon},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
year={2022}
}
Part of our code is borrowed from following implementations. We thank the authors for releasing their code and models.