Making my own face recogniser - same results independent of input image

92 views
Skip to first unread message

Thomas Wood

unread,
Feb 22, 2016, 5:45:38 AM2/22/16
to Caffe Users
Hi,

I am working on training a face recogniser. The recogniser I am planning will be trained on a few thousand faces.

As an easy starting point, I am trying to make a neural net that can differentiate 2 faces: Princess Diana and David Beckham (these were faces that it was easy to get a lot of images for!)
I have preprocessed the images with OpenCV so my training set is a set of 227x227 images each with only the face in. I've put 300 images of each. I know this isn't much, but it's more a practice run than anything.

My net is a modified CaffeNet file (attached), and I've also taken the CaffeNet solver. 

I've been able to train it for 9000 iterations.
What happens when I then run my trained model is that every time, I get the same output values, no matter what input image I give it:
David Beckham 0 0.432829
Princess Diana 1 0.567171

The numbers are exact every time to all visible decimal places.

This looks odd to me, as I would not expect excellent performance, but I would at least have expected a change in output for different input images.

Has anyone seen this effect before? Is there something obvious that I'm missing?
I know CaffeNet isn't the most adequate net architecture for the problem, also I've been looking at the VGG net (http://www.robots.ox.ac.uk/~vgg/software/vgg_face/), but they only supply the deploy.prototxt file and I was not sure how to convert this to a train_test.prototxt.

I would be grateful for any advice, especially if someone has tried making their own face recogniser from scratch as I am doing.

Thanks

Tom
tw-caffenet-solver2.prototxt
tw-caffenet-train_val.prototxt

Nam Vo

unread,
Feb 22, 2016, 8:56:43 PM2/22/16
to Caffe Users
Did the loss drop and accuracy increase during training.
I suggest to include accuracy layer for training phase to monitor the accuracy.

Thomas Wood

unread,
Feb 23, 2016, 7:29:10 AM2/23/16
to Caffe Users
Thank you Nam. I will check that, it looks like at some points the loss has got to this:
loss = -nan
So maybe that will be the problem. I will try adding the accuracy layer

Nam Vo

unread,
Feb 23, 2016, 4:46:44 PM2/23/16
to Caffe Users
Yeah you want to make sure the training is working first.
Look like it isn't here, I suggest lowering the learning rate till it does, that might be the problem.

Thomas Wood

unread,
Feb 25, 2016, 6:42:21 AM2/25/16
to Caffe Users
OK thank you. If I get any problems I will post again. 

Dhruv Bhandari

unread,
Oct 23, 2016, 5:34:10 AM10/23/16
to Caffe Users
Hi Thomas,


I'm facing the same error. My net is producing the same  feature vector (1x4096) for all inputs. I checked the euclidean distance between feature vectors of two different images and it was found to be ZERO.

Were you able to solve your problem? Can you help me?

Thanks in Advance !!
Reply all
Reply to author
Forward
0 new messages