Face verification vs. Face recognition

  1. Verification

    • Input image, name/ID
    • Output whether the input image is that of the claimed person
  2. Recognition

    • Has a database of K persons
    • Get an input image
    • Output ID if the image is any of the K persons (or “not recognized”)

One shot learning

In face recognition systems we need the model to learn from one example to recognize the person again. In a normal CNN, we could train the network on the number of employees we have, but this is not feasible since if new people join the work place we will have to train the network again.

It is much better to learn a similarity function. We define the function on a high level as follows :

A good way to make this function is to use a siamese network.

Siamese Network

We use a traditional convolutional neural network, but instead of using the softmax layer as the last layer, we just skip it. Suppose when we put image of a person through this network we get a vector of size 128. So if is the input, then the vector is represented as the output of the function which is the network as .

Similarly for input , we get the vector . We define the distance between this two images as :

This is known as the siamese neural network architecture. If and are the same person then we want to be small and vice versa.

One way to learn the parameters of the neural network, so that it gives a good encoding for our pictures of faces, is to define and apply gradient descent on the Triplet Loss Function.