├── Dynamic ├── Report.pdf └── main_code.ipynb ├── Hierarchical └── test.ipynb ├── README.md └── RL_object_detection.pdf /Dynamic/Report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManooshSamiei/Object-Detection-Deep-Reinforcement-Learning/4856a23aef8d25bb53cad8e2107dbb92d77aa23f/Dynamic/Report.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Object-Detection-Deep-Reinforcement-Learning 2 | 3 | COMP 767 Final Project by Manoosh Samiei and Ruofeng Li (2020/04/20) 4 | --------------------------------------------------------------------------------- 5 | 6 | --------------------------------------------------------------------------------- 7 | Kaggle.json key file 8 | --------------------------------------------------------------------------------- 9 | 10 | Since the number of files in folders of VOC 2012 dataset is very large, mounting this dataset from google drive crashes the google colab sessions. Thus, we download dataset directly from Kaggle website when we run the code. 11 | 12 | To download dataset from kaggle, you need a kaggle.json key. We provided this key file in the code base. If you like to download your own kaggle key from your account, use below instructions: 13 | 14 | - Go to the Kaggle website (www.kaggle.com) 15 | 16 | - Register for a Kaggle account (log in to the exsiting account if you already have one) 17 | 18 | - Go to "My Account" 19 | 20 | - Select "Create New API Token" under the API section to download the kaggle.json file 21 | 22 | --------------------------------------------------------------------------------- 23 | Hierarchical Method 24 | --------------------------------------------------------------------------------- 25 | To test models: 26 | 27 | - upload the corresponding notebook to google Colab 28 | - connect to google colab GPU 29 | - upload the model to the left folder bar of google colab in the following directory: 30 | - pascal/models_image_zooms 31 | - to manually upload a file in folder, right click on the folder and click upload 32 | - Be careful that the name of the model used in the testing part should be changed to the name of the model (if it is not the same as the uploaded model). 33 | - Upload kaggle json file, using code snippet, to download dataset directly 34 | - run code snippets in the order they are placed, except mounting google drive and training agent code 35 | - run testing agent part 36 | --------------------------------------------------------------------------------- 37 | To train models: 38 | 39 | - connect to google colab GPU 40 | - Upload kaggle json file, using code snippet, to download dataset directly 41 | - run code snippets in the order they are placed 42 | - Mount your google drive to save trained model for each spoch 43 | - run training agent part 44 | - The models will be also saved in colab folder tab, and can be downloaded manually. 45 | 46 | --------------------------------------------------------------------------------- 47 | Dynamic method 48 | --------------------------------------------------------------------------------- 49 | 50 | - connect to google colab GPU 51 | - upload model to the left folder bar of google colab in pascal folder 52 | - to manually upload a file in folder, right click on the folder and click upload 53 | - Upload kaggle json file, using code snippet, to download dataset directly 54 | - run code snippets in the order they are placed 55 | 56 | In some notebooks, the directory of loading model, in test function, might have been changed to google drive directory. To make it compatible with manual upload of models, simply comment out those lines. 57 | 58 | To only test a model, you need to comments out calling train_deep_q() function in main function, and directly run the test. 59 | 60 | --------------------------------------------------------------------------------- 61 | Note: It is highly recommended to run the code with GPU since the runtime is around 30mins per epoch for the hierarchical model and around 1hour per epoch for the dynamic model. 62 | 63 | --------------------------------------------------------------------------------- 64 | Test-train split: 65 | 66 | In training, we use images listed in objectclass_train.txt file in datatset. For testing we use images listed in objectclass_val.txt file in datatset. 67 | 68 | 69 | Number of examples for different object categories do not differ significantly. For most classes, there are around 300 images for each class. However, among classes we tested, 'car' class has around 500 images. 70 | 71 | Table of results are included in our submitted report. 72 | 73 | In this project, we used google colaboratoru gpu to train and test our models. 74 | 75 | --------------------------------------------------------------------------------- 76 | ## Please cite the following if you used the code and report: 77 | ``` 78 | @misc{https://doi.org/10.48550/arxiv.2208.04511, 79 | doi = {10.48550/ARXIV.2208.04511}, 80 | url = {https://arxiv.org/abs/2208.04511}, 81 | author = {Samiei, Manoosh and Li, Ruofeng}, 82 | keywords = {Computer Vision and Pattern Recognition (cs.CV), Artificial Intelligence (cs.AI), FOS: Computer and information sciences, FOS: Computer and information sciences}, 83 | title = {Object Detection with Deep Reinforcement Learning}, 84 | publisher = {arXiv}, 85 | year = {2022}, 86 | copyright = {Creative Commons Attribution 4.0 International} 87 | } 88 | ``` 89 | -------------------------------------------------------------------------------- /RL_object_detection.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManooshSamiei/Object-Detection-Deep-Reinforcement-Learning/4856a23aef8d25bb53cad8e2107dbb92d77aa23f/RL_object_detection.pdf --------------------------------------------------------------------------------