Comparison of different Machine learning techniques for Facial Recognition

Face recognition vector

At ONE BCG, we have worked hard to develop a robust Face Recognition system that would aid organizations to authenticate folks in their premises. In fact, at the moment, we are at 90% accuracy using a Deep Learning algorithm. It was not possible to make this incredible technology without logic. There are various algorithms and approaches to implement this technology to obtain desirable results that we tested, implemented, failed, and learned.

We started with The k-nearest neighbors (KNN) algorithm. This is a simple, easy-to-implement supervised machine learning algorithm that can be used to solve both classification and regression problems. Let's unpack it and understand how it worked for us.

K-Nearest Neighbors

The KNN algorithm assumes that similar things exist nearby. In other words, similar things are near to each other.

Image showing how similar data points typically exist close to each other


  • K-Nearest Neighbours Algorithm is used for classification and regression. It only requires one Hyper Parameter to render accurate results that evolved persistently, not to mention, tackle the multi-class problems efficiently. 
  • It is simple and easy to implement. There's no need to build a model, tune several parameters, or make additional assumptions.


  • The algorithm computes distance and sorts all the training data at each prediction, which leads to latency in maintaining records in case of a large number of training data. 
  • It doesn't perform well on imbalanced data to illustrate in the event of two classes, A and B, and this might result in getting the less frequent class B wrongly classified. 
  • It is restricted to similar features with an optimal number of neighbors (training data), in case if the motion of an object is faster than normal then it's unable to detect the object.

Nevertheless, our team had overcome the KNN algorithm's flaws by opting for an algorithm that uses a Neural Network that is One-shot learning. The algorithm was quick enough to detect and predict results for a fast-moving object such as a human. In addition, it was proficient enough to learn from less data that would steer to lower computation power.

One-Shot Learning

One-shot learning is a classification task where one, or a few, examples are used to classify many new cases in the future. This characterizes tasks seen in the field of face recognition, such as face identification and face verification, where people must be classified correctly with different facial expressions, lighting conditions, accessories, and hairstyles given one or a few template photos.

  • One short learning algorithm is one of the fastest machine learning algorithms.
  • The basic idea behind one short learning algorithm is that the system should be able to recognize/learn object or image with the limited data within the system. 
  • This algorithm needs fewer data to train the system. This learning does not require thousands of pictures of the same object in order to recognize it. 
  • In face recognition, the system should able to identify an image just by feeding one picture of a person to the system.

Image showing Train a model to discriminate between a collection of same/different pairs

Siamese Network for One-Shot Learning

  • A Siamese network is an architecture with two parallel neural networks, each taking a different input, and whose outputs are combined to provide some prediction.
  • The objective of the Siamese network is to do the comparison and to find how similar are the two images.
  • To compare two images we compute the distance between their coding and if the distance between them is less than threshold images are the same otherwise images are different.
  • One-shot learning is known to be one of the right algorithms for object detection. 
The major disadvantage of a one-shot algorithm is that it fails to detect most of the features which lead to reduced accuracy of the system. Suppose a particular facial expression image is learned by the system. If a person changes his facial expression then the system fails to recognize the image.
Eventually, we decided to shift our Face Recognition system to Convolutional Neural Network in order to predict more accurate data as compared to One-Shot learning.

The camera stream the human face which is then fetched by the Computer vision and Neural Network as backend does the feature extracting processes it using the previous learning from the training data.

Neural Network

Machine learning subset Deep learning uses the concept of a neural network. The idea of this network is taken from human brain neurons.

  • The neurons are the basic working unit of the brain and are used to communicate. Similarly, machines use a neural network to communicate by passing information from one neuron to another.
  • Machine interpret sensory data and patterns they recognize are numerical, contained in vectors.
  • The most significant advantage of the neural network is error correction property. If a person changes his facial expressions which is previously not recorded by the system. His new facial expressions are added to the learning area in the system.   


  • Highly Customizable: It can be used to extract features as per the consumer's needs.
  • It can be used in multiple problems: It aids in semantic analysis, text analysis, segmentation as well as stock market analysis.


  • High computational power: It demands a parallel process to compute the problem which is given to the network.
  • Need more data: In order to operate flawlessly and achieve the highest accuracy it needs to be fed with more and more relatable data.

Without any doubt, Deep learning shows its high power now in relation to Face recognition delivering superhuman performance and excellent accuracy of output results. In this article, you have learned bits and pieces of deep learning techniques used in facial recognition, how these technologies have developed and how they work now.

If you want to learn how to implement this state of the art pipeline, I recommend you get in touch with us.

Comparison of different Machine learning techniques for Facial Recognition Comparison of different Machine learning techniques for Facial Recognition Reviewed by ONE BCG on September 24, 2019 Rating: 5

No comments:

Powered by Blogger.