experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).
MIT License
1.73k stars 784 forks source link

urgent: low loss but very bad predictions on my dataset #404

Closed kashyap-dhriti closed 5 years ago

kashyap-dhriti commented 5 years ago

I have tried on 5 images each having around 2000 of annotated rbc. I am running the model : as first with 3 warm up epoch then with 100 epochs. Also I have tried all the learning rates from 1e-3 to 1e-8. 1e-3 and 1e-4 are generating nan loss while 1e-5 onwards are generating results in a pattern as seen in the image. Also the loss is very low around 0.1 but still no prediction.

img00423_detected_20190206t154720

I have followed the exact details in READ ME section but still I am getting wrong result. Please help because I am not able to figure out the problem.

  1. reason of detection failure
  2. reason of formation of these patterns
rodrigo2019 commented 5 years ago

Look the pattern in your predicted image, your YOLO has a grid size of 13x13, and if you are using the defaults anchors, this means that you have 5 anchors for each cell, which implies that your network can predict at max 845 objects in a single image. You should create a custom network with a bigger grid size.

kashyap-dhriti commented 5 years ago

thank you for the reply. but i have 1 question. I am new to ML so can you please tell me from where I can change the grid size.

kashyap-dhriti commented 5 years ago

@rodrigo2019 thank you sir, I understood how to change the grid size and input size. but again the result is not improving. Now it does show more numbers of circles as prediction boxes but its not predicting correctly. Its showing any random predictions. can you tell me where I might be doing wrong.

kashyap-dhriti commented 5 years ago

@rodrigo2019 Okay I solved it by giving more number of epochs and setting input_size and train times correctly. thank you for your help.