Git Product home page Git Product logo

facerecognition's Introduction

Face recognition

Face recognition using triplet loss, implementing FaceNet with pytorch. A small face dataset which consists of 62 IDs with 20 face images per ID for testing. The algorithm achieves accuracy above 97%.
人脸识别项目,提供一个小型数据集用作验证,使用三元组损失函数提升准确率和泛化能力,对FaceNet进行了一种实现。提供了一个小型的人脸数据集用于测试和验证。总共62个人,每人20张人脸图像。经测试,算法的准确率在97%以上,如果数据集更大一些,效果会更好。

Checkpoints

断点模型链接

Dependencies(依赖模块)

python3, pytorch, torchvision, cnn_finetune, opencv-python, numpy, tqdm. etc.

Module components(模块组成)

dataset module taking care of triplet selection and data loding.(数据集模块主要负责三元组选择和数据加载)

dataset.py

utility module taking care of image data formating, cleaning, and organization.(工具模块负责人脸数据的格式转换,数据清洗和数据组织)

utils.py

main module in charge of model definition, data/checkpoint loading, training, testing and validation.(主功能模块负责模型定义,数据、断点加载,训练,测试和验证。)

main.py

脚本运行效果截图:


Algorithm description(算法说明)

Inspired by Google's FaceNet, we design a special loss to improve the model's descriminative power for fine-grained classification task like face recognition. The basic principle is quite plain and simple: if a group face images belong to one person identity, they are definitelt closer to each other than image faces belonging to other person's identity. Its main thought is similar to clusting algorithm.
受谷歌FaceNet的启发,我们设计了一种特殊的损失函数(类似于三元组损失函数),用来提升细粒度分类任务的性能,比如人脸识别任务。它的基本**简单而朴素,如果一组人脸图像属于同一个人,那么这些图像相比其他人的人脸图像,他们之间肯定会更近似彼此。这个**类似于聚类。

We take advantage of a joint loss of classification and triplet loss to make the training convergence more easily and stable, the model is more able to discriminate between different ID's faces as illustrated above.
本算法在FaceNet的基础上改进了loss函数表达式,采用联合损失函数:CrossEntropy分类损失 + triplet损失,加快训练收敛并使得训练过程更稳定。

facerecognition's People

Contributors

captaineven avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.