Triplet Loss入门
Face verification vs. face recogntion
Verification
- Input image, name/ID
- Output whether the input image is that of the claimed person.
Recognition
- Has a database of K peosons(or not recognized)
Relations
We can use a face verification system to make a face recognition system. The accuracy of the verification system has to be high (around 99.9% or more) to be use accurately within a recognition system because the recognition system accuracy will be less than the verification system given K persons.
One Shot Learning
- One of the face recognition challenges is to solve one shot learning problem.
- One Shot Learning: A recognition system is able to recognize a person, learning from one image.
- Historically deep learning doesn’t work well with a small number of data.
Instead to make this work, we will learn a similarity function:
d ( i m g 1 , i m g 2 ) d( img1, img2 ) d(img1,img2) = degree of difference between images.
We want d result to be low in case of the same faces.
We use τ \tau τ as a threshold for d:
If d ( i m g 1 , i m g 2 ) < = τ d( img1, img2 ) <= \tau d(img1,img2)<=τ Then the faces are the same.- Similarity function helps us solving the one shot learning. Also its robust to new inputs.
Siamese Network
- We will implement the similarity function using a type of NNs called Siamease Network in which we can pass multiple inputs to the two or more networks with the same architecture and parameters.
- The loss function will be d ( x 1 , x 2 ) = ∣ ∣ f ( x 1 ) − f ( x 2 ) ∣ ∣ 2 d(x^1, x^2) = || f(x^1) - f(x^2) ||^2 d(x