How to build a single-object localization CNN based-on an object classification network?

3 次查看(过去 30 天)
Hi all,
I'm new to convolutional neural network. I'm trying to use Alexnet to build a single object localization network, which I think is a simple problem in this area. What I did is to replace the last three layers of Alexnet, which are fullyConnnectedLayer(1000), softmaxLayer, and classificationLayer, with two layers, which are fullyConnectedLayer(4) and regressionLayer. Did I do it right? When I tried to train this network, the result seems wrong. Specifically, the Mini-batch Loss and the Mini-batch RMSE were NaN all the time. What would be the reason for this?
Thank you in advance!
Shuwei.

回答(1 个)

Ankitha Kollegal Arjun
If the regression response values are very big and/or you have many regressors, your loss will become large, and it eventually leads to NaNs. This is the reason your Mini-batch Loss and the Mini-batch RMSE are NaN.
There are two workarounds which might fix the issue. Try one of the following:
1. Lower the initial learning rate. See more details on the initial learning rate here:
2. Normalize the responses so that the maximum value is 1. You can use the function "normc" for this:
Hope this helps!
  1 个评论
Shuwei Qiu
Shuwei Qiu 2017-7-28
Thanks for your answer! I fixed this NaN issue using your first solution. But I have another issue which is the predicted bounding box from my network is always the same no matter what is the input image. I was wondering do you have any idea to fix this? Thank you very much in advance!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by