MATLAB Answers

2

Issues with yolo v2 network

Asked by Felix Chen on 4 May 2019
Latest activity Commented on by Felix Chen on 25 Aug 2019 at 7:16
Hey, gus I just working on a traffic sign detection projec. My input image is 1200X1600. And I set the input layer of the yolov2 488X488. Use EstimateAnchorBoxes.m to etimate 5 anchor boxes size for my dataset. But after training the network predict nothing. Should I resize the input image to 488X488 then do the estimation(currently the anchor boxes were estimated with 1200X1600 input and label)? Or any recommended anchhor boxes for 488X488 for yolov2 network?
And another question is does anyone know how to use 'detector = trainYOLOv2ObjectDetector(___,'MultiScaleTrainingSizes',trainingSizes)' this syntax? I tried it, and the matlab told me is not a vaild parameter. An example of this syntax would help me a lot.
Thanks very much.

  0 Comments

Sign in to comment.

4 Answers

Answer by Hakan Hekimgil on 20 Jun 2019

It seems like the YOLO trainer in MATLAB is published before it is actually finalized and the information given in the documentation is not entirely correct.
For the 'MultiScaleTrainingSizes' parameter, I managed to have it work by replacing it with 'TrainingImageSize'...

  1 Comment

Felix Chen on 25 Aug 2019 at 7:16
Okay, will try go with this, thanks for sharing.

Sign in to comment.


Answer by cui
on 2 Aug 2019

I have tried to use 1280*1024 size image as the input of the network. The training is very time consuming, about the square of the small image size. After waiting for a long time of training, the result is bad. Nothing can be detected. Later I switched to 320*320 image size as input, training speed is faster, but still can not detect the person object, I think the official document lacks this explanation.

  1 Comment

Felix Chen on 25 Aug 2019 at 7:15
Yep, I did have the same issues, maybe change the anchor box would help.

Sign in to comment.


Answer by Zahra Moayed on 5 Aug 2019

Hi all,
Please share if you found a solution for it. When I train with single object (person), I can get precision/recall of 0.92 but when I add another class (car) with same images and just few, the accuracy is 0, meaning even the person cannot be detected in an of the images even my training images!
All the matlab examples are tarined only on single objects but how about if we have more than one class? Does anyone hve any success to help me please?

  0 Comments

Sign in to comment.


Answer by cui
on 6 Aug 2019

Hi , dear @Zahra Moayed:
Can I know the resolution of your input image? Also use resnet50 as the basic network training? if you can provide code to post here, thank you very much!
In addition,@Felix Chen, I saw that the YOLO author's settings for anchors are as follows:
So YOLOv2 I made some design choice errors, I made the anchor box size relative to the feature size of the last layer. Since the network is 32 downsampled. This means it is relative to 32 pixels, so the 9x9 anchor is actually 288px x 288px.
In YOLOv3, the anchor size is the actual pixel value. This simplifies a lot of things and is a bit difficult to implement.

  1 Comment

Hi Cui,
The size of my image are [1280,720] and when I found the anchorboxes, i resized them to be fit in [224 224] Resnet-50 input. but as I said, it only works with single class :(
anchorBoxes = [
131 100
60 50
50 37
92 76
75 61
];
anchorBoxes = [round(anchorBoxes(:,1)/5),round(anchorBoxes(:,2)/3)];%%[1280, 720]->[224, 224]

Sign in to comment.