使用k均值的面部表情分类 [英] facial expression classification using k-means

查看:135
本文介绍了使用k均值的面部表情分类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用k均值对面部表情进行分类的方法是:

My method for classifying facial expressions using k-means is:

  1. 使用opencv检测图像中的人脸
  2. 使用ASM和障碍物获取面部特征点
  3. 计算面部特征之间的距离(如图所示).将有5个距离.
  4. 计算每个面部表情的每个距离的质心(exp:在距离D1中,每个表情快乐,生气..."都有7个质心).
  5. 对每个k均值使用5个k均值一段距离,结果每个k均值将具有最接近第一步中计算的质心的距离表示的表达式.
  6. 最终表达将是出现在最多k均值结果中的表达

但是,使用该方法,我的结果是错误的吗? 我的方法正确还是在某处错误?

However, using that method my results are wrong? Is my method correct or is it wrong somewhere?

推荐答案

K-means不是分类算法.运行后,它仅查找K个元素的质心,因此将数据拆分为K个部分,但是在大多数情况下,它与所需的类没有任何关系.当您要探索数据并找到一些可区分的对象时,应使用此算法(作为所有聚类方法).在任何意义上都是可区分的.如果您的任务是构建一个可以识别某些给定类的系统,那么它就是 聚类 .易于实现和理解的最简单方法之一是 KNN (K -nearest neighbours),它大致完成了您要完成的任务-检查哪些类的对象与某些预定义的对象最接近.

K-means is not a classification algorithm. Once runned, it simply finds centroids of K elements, so it splits data into K parts, but in most cases it won't have anything to do with desired classes. This algorithm (as all the clustering methods) should be used when you want to explore data and find some distinguishable objects. Distinguishable in any sense. If your task is to build a system, which recognizes some given classes, then it is a classification problem, not clustering. One of the most simple methods, which are easy to both implement and understand is KNN (K-nearest neighbours), which roughly does what you are trying to accomplish - checks which classes' objects are the closest ones to some predefined ones.

为了更好地了解差异,让我们考虑一下您的情况-您正在尝试根据面部特征检测情绪状态.在此类数据上运行k均值可以将您的脸部照片分成许多组:

To better see the difference let us consider your case - you are trying to detect emotional state based on the face features. Running k-means on such data can split your face photos into many groups:

  • 如果您使用不同人的照片,它可以将特定人的照片聚在一起(因为他们的距离与其他人不同)
  • 它可以将数据拆分为例如男人和女人,因为此类功能存在性别差异
  • 它甚至可以根据距相机的距离拆分数据,因为视角会改变您的功能,从而形成集群".

如您所见,有数十种可能的合理"(甚至更完全不可解释的)分裂,而K均值(和 any )其他聚类算法将简单地找到其中之一(在大多数情况下-无法解释的一种).使用分类方法来克服此问题,以解释"算法的期望值.

As you can see, there are dozens possible "reasonable" (and even more completely not interpretable) splits, and K-means (and any) other clustering algorithm will simply find one of them (in most cases - the not interpretable one). Classification methods are used to overcome this issue, to "explain" the algorithm what are you expecting.

这篇关于使用k均值的面部表情分类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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