trainingOptions for a RCNN detector with AlexNet

2 views (last 30 days)
Hello everyone!
I would like to train an RCNN network to detect traffic signs. CNN's network (net) is AlexNet, which has already been trained and tested to recognize traffic signs (94% test accuracy).
Below are the options I used to train the RCNN network. During training I obtained an accuracy of 84%, but on the test side it does not find many signs (I have an accuracy of 25% if the score> 0.5).
I would like to have more signs detected and I suspect that the problem is with the options chosen for training. Can someone please help me with the training options?
options = trainingOptions('sgdm', ...
'MiniBatchSize', 128, ...
'InitialLearnRate', 1e-3, ...
'LearnRateSchedule', 'piecewise', ...
'LearnRateDropFactor', 0.1, ...
'LearnRateDropPeriod', 100, ...
'MaxEpochs', 30, ...
'Verbose', true);
rcnn = trainRCNNObjectDetector(DataTrain, net, options, ...
'NegativeOverlapRange', [0 0.3], 'PositiveOverlapRange',[0.5 1]);
[bbox, score, label] = detect(rcnn, img, 'MiniBatchSize', 128);

Answers (1)

Image Analyst
Image Analyst on 25 Jun 2022
Why are you retraining it when you said it has already been trained to recognize stop signs? If that's true, just delete the first two lines of your code and just have the call to detect.
If the accuracy is not high enough, you can do transfer learning (re-train alexnet) for a "stop-sign-only detector" by supplying a ton of stop sign images. It will be better but it won't be able to detect anything else. Is that what you're thinking of doing? How many stop signs do you have? Do you know how many stops signs the original alexnet training had? You should have many, many more than that.
Also, see section 15.3.3.10:
  2 Comments
Andrei Agârbiceanu
Andrei Agârbiceanu on 26 Jun 2022
Thank you for your answer!
My AlexNet network has 20 classes, so 20 traffic signs. For each class I used 700 training images, 100 validation images and 200 testing images.
I am very satisfied with the recognition of traffic signs. I would have liked the RCNN detection to be higher, to find more signs for me. At this moment out of 300 traffic signs he finds me about 90.
Image Analyst
Image Analyst on 26 Jun 2022
Try training longer, or using more training images, or use higher resolution network. alexnet has only 227x227 which is extremely low spatial resolution especially if the sign takes up only a small fraction of the scene.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!