facial expression classification using k-means

不想你离开。 提交于 2019-12-11 01:48:10

问题


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

  1. Use opencv to detect the face in the image
  2. Use ASM and stasm to get the facial feature point
  3. Calculate the distance between facial features (as show in the picture). There'll be 5 distances.

  4. Calculate the centroid for each distance for each facial expression (exp: in the distance D1 there are 7 centroids for each expression 'happy, angry...').
  5. Use 5 k-means each k-means for a distance and each k-means will have as a result the expression shown by the distance closest to the Centroid calculated in the first step.
  6. Final expression will be the expression that appears in the most k-means results

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


回答1:


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.

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:

  • If you use photos of different people, it can cluster photos of particular people together (as their distances differ from others)
  • it can split data into for example man and woman, as there are gender specific differences in such features
  • it can even split your data based on the distance from the camera, as the perspective changes your features, creating "clusters".
  • etc.

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.



来源:https://stackoverflow.com/questions/18623050/facial-expression-classification-using-k-means

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!