从视频中聚类人脸 [英] Clustering human faces from a video

查看:60
本文介绍了从视频中聚类人脸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了opencv中内置的人脸检测算法,以提取视频(以1 fps采样)的每一帧中的人脸.我还将每个脸部图像的大小调整为相同大小,并裁剪了一部分图像以消除背景噪音和头发.现在的问题是,我必须将这些面部图像聚类-每个聚类对应一个人.我实现了此处描述的算法 http://bitsearch.blogspot.in/2013/02/unsupervised-face-clustering-with-opencv.html

I have run the face detection algorithm inbuilt in opencv to extract faces in each frame of a video(sampled at 1 fps). I have also resized each face image to be of same size and I have cropped some fraction of image to remove background noise and hair. Now the problem is that I have to cluster these images of faces - Each cluster corresponding to a person. I implemented the algorithm described here http://bitsearch.blogspot.in/2013/02/unsupervised-face-clustering-with-opencv.html

基本上上述算法,迭代地使用OpenCV的LBPH人脸识别器对图像进行聚类.在该页面本身的描述中,结果并不令人满意.在我的实施中,结果更糟.谁能建议一种更好的面孔聚类方法?可能正在使用某些其他功能和某些其他群集算法.群集数未知.

Basically the above algorithm, uses LBPH face recognizer of OpenCV iteratively to cluster the images. In the description on that page itself the results are not satisfactory. In my implementation the results are worse. Can anyone suggest a better way to cluster faces? May be using some other feature and some other clustering algorithm. The number of clusters are unknown.

推荐答案

我建议看看

FaceNet:人脸识别和聚类的统一嵌入

我的短期科学摘要(如果想查看,请去那里数学部分正确呈现):

My shortscience summary (go there if you want to see the Math parts rendered correctly):

FaceNet将人脸图像直接映射到$ \ mathbb {R} ^ {128} $,其中距离直接对应于人脸相似性的度量.他们使用三重损失函数.三元组是(人A的脸,人A的另一面,不是A的人的脸).后来称为(锚,阳性,阴性).

FaceNet directly maps face images to $\mathbb{R}^{128}$ where distances directly correspond to a measure of face similarity. They use a triplet loss function. The triplet is (face of person A, other face of person A, face of person which is not A). Later, this is called (anchor, positive, negative).

损失函数是由LMNN学习和启发的.这样做的目的是使同一个人的两幅图像之间的距离最小化,而与另一个人的图像之间的距离最大化.

The loss function is learned and inspired by LMNN. The idea is to minimize the distance between the two images of the same person and maximize the distance to the other persons image.

大余量最近邻居(LMNN)正在学习伪度量

Large Margin Nearest Neighbor (LMNN) is learning a pseudo-metric

$$ d(x,y)=(x -y)M(x -y)^ T $$

$$d(x, y) = (x -y) M (x -y)^T$$

其中$ M $是一个正定矩阵.伪度量和度量之间的唯一区别是$ d(x,y)= 0 \ Leftrightarrow x = y $不成立.

where $M$ is a positive-definite matrix. The only difference between a pseudo-metric and a metric is that $d(x, y) = 0 \Leftrightarrow x = y$ does not hold.

首先显示简单的示例,然后增加难度.这是通过选择三胞胎来完成的.

Show simple examples first, then increase the difficulty. This is done by selecting the triplets.

他们使用的是的三胞胎.对于肯定示例,这意味着锚点和肯定示例之间的距离较大.对于否定示例,这意味着锚点与否定示例之间的距离很短.

They use the triplets which are hard. For the positive example, this means the distance between the anchor and the positive example is high. For the negative example this means the distance between the anchor and the negative example is low.

他们想要拥有

$$ || f(x_i ^ a)-f(x_i ^ p)|| _2 ^ 2 + \ alpha<|| f(x_i ^ a)-f(x_i ^ n)|| _2 ^ 2 $$

$$||f(x_i^a) - f(x_i^p)||_2^2 + \alpha < ||f(x_i^a) - f(x_i^n)||_2^2$$

其中$ \ alpha $是边距,$ x_i ^ a $是锚点,$ x_i ^ p $是正面示例,$ x_i ^ n $是负面示例.随着时间的推移,它们会增加\\ alpha $.至关重要的是,$ f $不能将图像映射到完整的$ \ mathbb {R} ^ {128} $中,而是在单位球面上.否则,只要使$ f'= 2 \ cdot f $,就可以使$ \ alpha $加倍.

where $\alpha$ is a margin and $x_i^a$ is the anchor, $x_i^p$ is the positive face example and $x_i^n$ is the negative example. They increase $\alpha$ over time. It is crucial that $f$ maps the images not in the complete $\mathbb{R}^{128}$, but on the unit sphere. Otherwise one could double $\alpha$ by simply making $f' = 2 \cdot f$.

  • 面部验证:这是同一个人吗?
  • 面部识别:这个人是谁?
  • Face verification: Is this the same person?
  • Face recognition: Who is this person?
  • 带标签的野外(LFW)的准确性达99.63%
  • YouTube Faces DB上
  • 95.12%的准确性
  • 99.63% accuracy on Labeled FAces in the Wild (LFW)
  • 95.12% accuracy on YouTube Faces DB

评估了两个模型: Zeiler&Fergus模型和基于初始模型的体系结构

Two models are evaluated: The Zeiler & Fergus model and an architecture based on the Inception model.

这篇关于从视频中聚类人脸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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