Counting with Regression in Caffe, training Loss reducing but predicted values remain the same

28 views
Skip to first unread message

khanbaba

unread,
Sep 28, 2016, 3:53:26 PM9/28/16
to Caffe Users
Hi all,
I am trying to count objects in an image using Alexnet. 
I have currently images containing 1 object, 2, 3 and 4 objects per image. For initial checkup, i have 10 images per class. such that in training set i have
image   label
image1 1
image2 1
image3 1
.
.
.
image39 4
image40 4
I used imagenet create script to create a lmdb file for this dataset. Which successfully converted my set of images to lmdb. 
Alexnet as an example is converted to a regression model for learning the number of objects in the image. 
I inserted EucledeanLoss layer instead of Softmax Layer. As being told by many posts in this group. 
The rest of the network is the same. 
However, despite doing all the above, when i run the model, I received only zeros as output. And it does not learn any thing. However the loss is decreased continiously while trianing. 
I don't understand whether am i doing some mistake in displaying the predicted data. or am i doing any other mistake. 
forexample the output is given like: 
I0928 17:52:45.585160 18302 solver.cpp:243] Iteration 1880, loss = 0.60498
I0928 17:52:45.585212 18302 solver.cpp:259]     Train net output #0: loss = 0.60498 (* 1 = 0.60498 loss)
I0928 17:52:45.585225 18302 solver.cpp:592] Iteration 1880, lr = 1e-06
I0928 17:52:48.397922 18302 solver.cpp:347] Iteration 1900, Testing net (#0)
I0928 17:52:48.499543 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 1
I0928 17:52:48.499630 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 1
I0928 17:52:48.499637 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 1
I0928 17:52:48.499641 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 2
I0928 17:52:48.499645 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 2
I0928 17:52:48.499650 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 2
I0928 17:52:48.499655 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 2
I0928 17:52:48.499660 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 3
I0928 17:52:48.499663 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 3
I0928 17:52:48.499668 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 3
I0928 17:52:48.499672 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 3
I0928 17:52:48.499677 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 4
I0928 17:52:48.499681 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 4
I0928 17:52:48.499687 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 4
I0928 17:52:48.499692 18302 accuracy_layer.cpp:88] Predicted_Value: 0 Actual Label: 4 

Can any body guide me what could be the point due to which the predicted value is always 0. 
Thank you in advance. 

Regards
KBaba
Reply all
Reply to author
Forward
0 new messages