TensorFlow SiameseNet Face Recognition

The main work of the article is to use the SiameseNet model to achieve the function of face recognition.
The SiameseNet convolutional neural network model is as follows (detailed structure moves to GitHub, a simplified version of VGG):
SiameseNet model
Input and output examples

The data set uses Microsoft’s MS-Celeb-1M public face data set. We directly download the aligned data set. First, there is a cleaned list on the network. The file name is: MS-Celeb-1M_clean_list.txt, about 160M. Then use the combination algorithm to generate two files, positive_pairs_path.txt and negative_pairs_path.txt, each about 1.5million pairs.
Generate file example

The key question is, how to define the loss function, the loss function is Logistic Regression loss function actually, it is worth noting that the last layer of the activation function should use Sigmoid Function. The Loss function is as follows:
Loss function

The next step is training, training on TITAN X for about 3 days, we can see this Loss curve:
Loss curve

We can see that Loss converges very well, but after several trials, when Loss drops to around 0.1, it doesn’t fall. I haven’t found a reason yet. If you have ideas to solve this problem, you can give me a message or Email me ([email protected]).

What about the correct rate of our model?
Haha, not very good, the correct rate on the LFW is 90%+, and the model needs to be optimized.

Project source code:
https://github.com/hfrommane/TF-siamesenet

If you like, give me a star, thanks.

发布了34 篇原创文章 · 获赞 12 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/hfrommane/article/details/79690933