Deep Learning Model Investigation For Face Recognition.
After testing deep learning module in dlib last week, I am starting to investigate dnn module in
The sample code caffe_googlenet.cpp can load a pretrained caffe model and finish image classification task in opencv just like using caffe.
I think it is better to use dnn module rather than rewrite dlib code for face recognition.
Then I start to find some pretrained model for face recognition in github which has cost plenty of time. I find a
vgg pretrained model.
I write code(https://github.com/yjwudi/dlib_face_recognition_for_digikam/blob/master/opencv-dnn/vgg1.cpp) to test it,
and the efficiency is as high as dlib, 99%. However, the caffe model is 580 MB, and the size has beyond the limit.
Then I start to test other models in BVLC model zoo(https://github.com/BVLC/caffe/wiki/Model-Zoo), there are ResFace101
model or Pose-Aware CNN Models(PAMs) and they are still a little big, about 300MB more or less. Then I learned that the
kind of inception_resnet_v1 model is smaller than other kinds of models, about tens of MB, but I did not find a pretrained
inception_resnet_v1 model for face recognition. I may have to train such a model using caffe later.
I also find a paper(http://arxiv.org/abs/1511.02683) in CVPR which claims they have a lightened CNN model for face recognition,
and they have a github repo(https://github.com/AlfredXiangWu/face_verification_experiment). I downloaded the models in
their github. The pretrained LightenedCNN_A.caffemodel is 27.3MB, and I write the test code (https://github.com/yjwudi/dlib_face_recognition_for_digikam/blob/master/opencv-dnn/vgg2.cpp),
the efficiency for this model is about 247/320, better than eigenfaces and fisherfishes but not as good as dlib.
The Accuracy is low because I did not align and crop the image which is the first step to use the model as claimed in the
author's github readme.md.
Plan for Next Step.
I had thought to add preprocessing code to test LightenedCNN_A.caffemodel, and go on with dnn module of openCV. But my mentor
Gilles Caulier told me that not all Linux Distro have switched from OpenCV2 to OpenCV3. There is no dnn module in OpenCV2.
So I have to give up my plan for using dnn module. And I should rewrite dlib face recognition part, port the module into DigiKam.
And now I am working on it.