sdemyanov / ConvNet

Convolutional Neural Networks for Matlab for classification and segmentation, including Invariang Backpropagation (IBP) and Adversarial Training (AT) algorithms. Trained on GPU, require cuDNN v5.
240 stars 141 forks source link

application for face recognition #24

Open namjey opened 8 years ago

namjey commented 8 years ago

Hi! Now I am trying to adapt your ConvNet to train my database(faces 400 pictures (each 112*92 pix.)) and then I want to do face recognition.

My question is.. is it possible for ConvNet to do face recognition? I know that it's possible to recognize digits... is it possible to apply this network for face recognition? If so how many layers should I use to get good(applicable) results? how long does it usually take to train big database? (I tried to train your network just by changing input images(and target) to my face database... and result was... 95% error... after 10 epoch of training) Is it possible to train so that it could recoginize faces(with error less than 5%)?

Maybe you have tried face recognition with your network?

I am really looking forward to see your answer! Thank you!!

sdemyanov commented 8 years ago

Hi Namjey,

Theoretical answer is yes. In practice, the answer depends on your data. You want to recognize who is on a particular image, right? How many people (i.e. classes) do you have? How many images for each person (i.e. per class) do you have? Is 400 the total number? This is a very small number for complex image classification problems. If you have, say, 10 people with 40 images for each, 95% accuracy is probably impossible.

I cannot say how many layers should be used for this task. The general advice is to start from simple architectures and grow them as much as it decreases the test error. The time also depends on the image size, architecture and the number of objects in the training set. Training 60k 28x28 MNIST images usually takes several seconds per epoch on GPU.

No, I have not tried to do it by myself. Probably the best you can do is just to try and see what you get. Good luck with your experiments.

Regards, Sergey.

namjey commented 8 years ago

Thank you for your answer!!

My database has 40 classes and 10 pictures for each class. I use 5 pictures of each class to train the network(40*5=200). Rest pictures are used for testing. So, why can't I get results like 95%error? Is my database for training too small? I can add more pictures from other database, but it will also increase total number of classes. Can this approach enhance the results? What other recommendations?

Now I am using matlab version of cnn. However it takes too long for training... 1 epoche in about 160 sec... (Intel i5 3450) So I am trying to use gpu version. I installed cuda and visual studio, and of course configured path to files. But I am getting error related with mex file.. (I will post screenshot later... Now I am using phone).

Thank you!

sdemyanov commented 8 years ago

Hi. I think you can get 95% of error, the problem might be with 95% of accuracy. Yes, 5 pictures for each class is very small, it is practically nothing. Try to use precompiled windows binaries if you can. I can also advice you to use MatConvNet if you have problems.