Skip to content

my-course-work/xSmile

Repository files navigation

xSmile

Automatic smile detector based on step-wise regression.

How does it work?

The algorithm trains a very simple smile classifier that analyzes a grayscale image (24 × 24) and outputs a prediction indicating whether the image is smiling or not. It makes decision by combining 5 features of the input image through step-wise regression, each of which is computed as

Step-wise regression is a greedy algorithm: at each round j, choose the jth feature (r1, c1, r2, c2) such that – when it is added to the set of j − 1 features that have already been selected – the accuracy (fPC) of the overall classifier is maximized.

Getting Started

Prerequisites

  • Python v3.6.4
  • NumPy v1.14.0
  • Matplotlib v2.0.2

Running

To test out the classifier, run the following command in the terminal:

python3 smile_detector.py 10

It should output the accuracy of the algorithm:

Accuracy: 1.000000

and generate a image of the selected features:

Performance

Size of Training Set Training Accuracy Testing Accuracy Selected Features
400 0.827500 0.711160 Selected features with 400 training examples
800 0.802500 0.740700 Selected features with 800 training examples
1200 0.798333 0.749453 Selected features with 1200 training examples
1600 0.788750 0.763676 Selected features with 1600 training examples
2000 0.782500 0.764223 Selected features with 2000 training examples

Accuracies vs the number of images in the training set

Accuracies vs the Size of the Training Set

In the figure, as the size of training set increases, the training accuracy decreases. The testing accuracy, however, increases. We can see that the two curves are gradually getting close to each other. The decrease of training accuracy and the increase of testing accuracy indicate that the model is getting less and less overfitted as the size of training set increases.

Author

License

This project is licensed under the MIT License

About

Smile detector based on step-wise regression

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages