关于脸部验证的信心分数(相对于脸部识别)有什么提示吗? [英] Any tips on confidence score for face verification (as opposed to face recognition)?

查看:103
本文介绍了关于脸部验证的信心分数(相对于脸部识别)有什么提示吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在代码中使用特征脸(PCA)进行人脸识别.我使用OpenCV网站上的教程作为参考.尽管这对于识别人脸非常有效(即,它可以告诉您谁是正确的人),但是基于置信度得分的人脸验证(或冒名顶替者检测-验证人脸是否已加入训练集中)根本无法正常工作.

I'm using eigenfaces (PCA) for face recognition in my code. I used the tutorials in OpenCV's website as a reference. While this works great for recognizing faces (ie it can tell you who is who correctly), the confidence-score based face verification (or imposter detection- verifying whether the face is enrolled in the training set) doesn't work well at all.

我计算出欧几里得距离并将其用作置信度阈值.我还有其他方法可以计算置信度阈值吗?我尝试使用 http://www.cognotics.com/opencv中提到的马氏距离/servo_2007_series/part_5/page_5.html ,但它产生的值很奇怪.

I compute a Euclidean distance and use it as a confidence threshold. Are there any other ways I could calculate a confidence threshold? I tried using Mahalanobis distance as mentioned in http://www.cognotics.com/opencv/servo_2007_series/part_5/page_5.html , but it was producing pretty weird values.

PS:诸如face.com之类的解决方案可能不适用于我,因为我需要在本地进行所有操作.

PS: Solutions like face.com won't probably work for me because I need to do everything locally.

推荐答案

您可以使用subspaceProject()函数将新的输入面部投影到本征空间上,然后使用subspaceReconstruct()从本征空间生成重建的面部,然后比较如何与 input_face reconstructed_face 类似.已知的脸部(训练数据集中的脸部)具有的重构图像比冒名顶替者的脸部更类似于 input_face . 您可以设置相似性阈值进行验证. 这是代码:

You can project the new input face onto the Eigenspace using subspaceProject() function and then generate the reconstructed face back from the Eigenspace using subspaceReconstruct() and then compare how similar the input_face and the reconstructed_face is. A known face (face in the training data set) will have the reconstructed image more similar to the input_face than an imposter's face. You can set a similarity threshold for verification. Here's the code:

// Project the input face onto the eigenspace.
Mat projection = subspaceProject(eigenvectors, FaceRow,input_face.reshape(1,1));

//Generate the reconstructed face
Mat reconstructionRow = subspaceReconstruct(eigenvectors,FaceRow, projection);

// Reshape the row mat to an image mat
Mat reconstructionMat = reconstructionRow.reshape(1,faceHeight);

// Convert the floating-point pixels to regular 8-bit uchar.
Mat reconstructed_face = Mat(reconstructionMat.size(), CV_8U);

reconstructionMat.convertTo(reconstructed_face, CV_8U, 1, 0);

然后可以使用cv::norm()比较输入面部和重建面部.例如:

You can then compare the input face and the reconstructed face using cv::norm(). For example:

// Calculate the L2 relative error between the 2 images. 
double err = norm(input_face,reconstructed_face, CV_L2);
// Convert to a reasonable scale
double similarity = error / (double)(input_face.rows * input_face.cols);

这篇关于关于脸部验证的信心分数(相对于脸部识别)有什么提示吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆