Face Recognition with CNN

asked 2020-04-15 22:12:52 -0600

rioadhii gravatar image

Hello everyone, I am trying to develop realtime face recognition using neural networks. I have read several answers in this forum, such as using the dnn module of opencv, caffe model. But I am still confused about the steps, so far I have written the steps as follows:

  1. prepare a face dataset to train face detection
  2. prepare a recognizable face dataset
  3. train the system to detect faces using haar or lbp cascade classifiers
  4. train the system to recognize faces based on detected faces using cnn

My question is :

  1. Is it possible to create a real time face recognition application using CNN to train face detection and face recognition using OpenCV?
  2. If possible, what do I need? and are my steps correct?

Thanks in advance :)

edit retag flag offensive close merge delete


Well try to resolve/clarify you confusion - it will even get funnier from here on :-) There a difference between face detection and face recognition. Also, you are mixing haar or lbp cascade classifiers(old approach) with caffe models(dnn / new approach). They are somewhat doing the same thing (object detection) but they working different. Then you mentioed you want to create a training set? For object detection you can use a pre trained model. For the recognition part you get to get familar with embeddings.

Look dont undererstimate the things and try to get the basic first. Start small.

holger gravatar imageholger ( 2020-04-16 04:42:47 -0600 )edit

Hi, thanks for answering. By the way, your statement is quite clear, I will use a pretrained caffe model to detect faces. then, using what I can make my own face dataset, for use when face recognition?

rioadhii gravatar imagerioadhii ( 2020-04-16 13:01:43 -0600 )edit

You will need to locate the face, then crop it. Then you will do some further preprocessing steps(face alignment) so you can feed it into a another network(different (pretrained) model! - Google for facenet).
You will get a vector with 128 elements(128 dimensions). Then you can just use euclidean distance calculation to measure the similarity of two vectors/faces. Thats it - the rest you need to do yourself pls - this is just top level explanation what you need to do.
So basically you dont need to train anything. Just detect the face and get similarity vector and then compare - that's it.

holger gravatar imageholger ( 2020-04-16 15:43:16 -0600 )edit

ok got it, I'm done with face detection, it's time for the next step, thanks for advice

rioadhii gravatar imagerioadhii ( 2020-04-18 00:20:36 -0600 )edit