This repo consists of a very basic model for Facial Emotion Recognition. The dataset for Facial Emotion Recognition can be
downloaded from
here.
Now coming to the dataset, the data consists of 48x48 pixel grayscale images of faces. The faces have been automatically
registered so that the face is more or less centered and occupies about the same amount of space in each image.
The task is to categorize each face based on the emotion shown in the facial expression in to one of seven categories:
(0=Angry, 1=Disgust, 2=Fear, 3=Happy, 4=Sad, 5=Surprise, 6=Neutral).
train.csv contains two columns, "emotion" and "pixels". The "emotion" column contains a numeric code ranging from 0 to 6,
inclusive, for the emotion that is present in the image. The "pixels" column contains a string surrounded in quotes for
each image. The contents of this string a space-separated pixel values in row major order. test.csv contains only the
"pixels" column and our task is to predict the emotion column.
Once downloaded, we need to split the dataset in feature columns and label columns. Over here I have splitted them to get 4 files:
- X_train.csv -> Contains the training data pixel values. 28709 examples
- y_train.csv -> Contains a single column which is a numeric code ranging from 0 to 6, for the training purpose.
- X_test.csv -> Contains the testing data pixel values. 7178 examples
- y_test.csv -> Contains a single column which is a numeric code ranging from 0 to 6 for the testing purpose.
In the implementation of kNN, I have used L2 distance Norm which has the geometric interpretation of computing the euclidean distance between two vectors. The distance takes the form: