Home

Awesome

Keras-RetinaNet for Open Images Challenge 2018

This code was used to get 15th place in Kaggle Google AI Open Images - Object Detection Track competition: https://www.kaggle.com/c/google-ai-open-images-object-detection-track/leaderboard

Repository contains the following:

Online demo

http://nn-box.com/box/ - upload image wait several seconds and it will show boxes. ResNet152 is used as backbone.

Requirements

Python 3.5, Keras 2.3.1, Keras-RetinaNet 0.5.1

Pretrained models 2018

There are 3 RetinaNet models based on ResNet50, ResNet101 and ResNet152 for 443 classes (only Level 1).

BackboneImage Size (px)Model (training)Model (inference)Small validation mAPFull validation mAP
ResNet50768 - 1024533 MB178 MB0.46210.3520
ResNet101768 - 1024739 MB247 MB0.50310.3870
ResNet152600 - 800918 MB308 MB0.51940.3959

Pretrained models 2019

There are 3 RetinaNet models based on ResNet50, ResNet101 and ResNet152 for all 500 classes.

BackboneImage Size (px)Model (training)Model (inference)Small validation mAPLB (Public)
ResNet50768 - 1024534 MB178 MB0.45940.4223
ResNet101768 - 1024752 MB251 MB0.49860.4520
ResNet152600 - 800932 MB312 MB0.49910.4651

Inference

Example can be found here: retinanet_inference_example.py

You need to change files_to_process = glob.glob(DATASET_PATH + 'validation_big/*.jpg') to your own set of files. On output you will get "predictions_*.csv" file with boxes.

Having Level 1 predictions you can expand it to all 500 classes using code from create_higher_level_predictions_from_level_1_predictions_csv.py

Training

For training you need to download OID dataset (~500 GB images): https://storage.googleapis.com/openimages/web/challenge.html

Next fix paths in a00_utils_and_constants.py

Then to train on OID dataset you need to run python files in following order:

then

or

Ensembles

If you have predictions from several models, for example for ResNet101 and ResNet152 backbones, then you can ensemble boxes with script:

Proposed method increases the overall performance:

Method description