News classification
Contact us
- Add: No. 9, North Fourth Ring Road, Haidian District, Beijing. It mainly includes face recognition, living detection, ID card recognition, bank card recognition, business card recognition, license plate recognition, OCR recognition, and intelligent recognition technology.
- Tel: 13146317170 廖经理
- Fax:
- Email: 398017534@qq.com
ASM/ depth learning algorithm for feature point extraction of face recognition
ASM/ depth learning algorithm for feature point extraction of face recognition
ASM/ depth learning algorithm for feature point extraction of face recognition
Preface
Before, I learned a lot of things because of project needs, but I never had the habit of hand recording. After a project is finished, a lot of things will slowly become blurred for a long time. So, I decided to start from now, to do it, and to leave something. My personal research direction is machine vision, Deeplearning, machine learning. I also wrote several hydrology, hoping to have friends with like-minded friends. But this is done before a part based on facial feature points cartoon picture generation "project, and independent research direction, is familiar with the CSDN blog, the blog is not, can not try not to stick with the formula formula, can open code, try to open the code. If the effect is good, you will stick to it later.
Brief introduction of ASM algorithm
ASM is a method of feature point extraction based on statistical learning model. This method is proposed in 95 years. Before deep learning is not popularized, ASM should be a better solution for facial feature extraction. For the detailed introduction of ASM, you can refer to the introduction of the blog ASM algorithm. The ASM algorithm, similar to a common statistical learning algorithm, needs to prepare a dataset with a label, a Train (or Build) model, and then Test (Fit).
Current popular ASM algorithm packet comparison
Currently, there are 3 (more famous) toolkits for the ASM algorithm:
1.ASMLibrary
Provide function:
1) face detection and location using OpenCV
2) support the use of your own dataset Train and Fit
3) extract face feature points by training good model
Characteristic:
1) multiple faces can be detected at the same time
2) real-time video face detection and feature extraction
3) you can train your own model
4) provide a trained, 68 feature point model
5) using the model provided, the location of the feature point is better.
Facial features extracted by ASMLib
Insufficient:
Only provide API, not open source
Source link
2.asmlib-opencv
Provide function:
1) single face detection and feature extraction
2) support your own data sets Train and Fit
Features: Based on Opencv, simple, open source
Deficiency: only a single face can be used, and the positioning effect is not good
Source link
3.stasm
Features: the algorithm is more powerful, more accurate, and completely open source
Inadequate: hard to hand, high code complexity (if only applications, do not need to know the principle, or more easy).
Source link
Application and introduction of ASMLibrary
When facial feature points are detected, I use the 68 feature points extracted by the algorithm, and then use my own image data to do Fit. I simply modify the test source code and save the feature point coordinates to the txt file.
Note: when ASMLibrary is compiled, it needs to configure the Opencv environment. At the same time, change the configuration files in the source project, and change the.Lib to its own version, otherwise, the compiler will not pass.
Technological process:
1. read the picture, video, and picture list (it's added, easy to batch).
2. using Haar classifier to detect face area
3. use the trained model to find 68 feature points
4. save the 68 feature point coordinates into the txt file
//C++ feature points save demo_Fit.cpp
Savepath = savepath + ".Txt";
OFSTREAM examplefile (savepath);
If (examplefile.is_open ())
{
"//examplefile" "This is a line.\n";
"//examplefile" "This is another line.\n";
"Examplefile" "#People:" < < nFaces < < endl;
Examplefile < < < ##Points: > shapes[0].NPoints () < < endl;
For (int i = 0; I < nFaces; i++)
{
For (int j = 0; J < shapes[i].NPoints (); j++)
Examplefile < < < < < < < < < shapes[i][j].x > > < < shapes[i][j].y < < < < < endl;
}
Examplefile.close ();
}
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
Eleven
Twelve
Thirteen
Fourteen
Fifteen
Sixteen
# coordinates format
Lichao:1
Points:68
(61.5149134.076)
(61.1954151.526)
(63.4041169.403)
(67.9898186.943)
(75.983203.934)
(85.5157214.763)
...
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
Since ASMLib does not have the number of coordinates of the corresponding point, we have checked the literature and data, and the number in the lower drawing is basically used, and I have also tested it.
Coordinate point sequence number
Prospect - the use of Deeplearning to detect face feature points
With the great hints of computer computing power and storage capacity and the maturity of Deeplearning theory, many traditional feature extraction problems can be achieved by deep learning, and the effect is better. In the face feature point detection is also used before the Theano/Lasagne has been achieved, the effect is good, and later is also neglected to arrange, no tutorials left. Here is a brief introduction to other people's tutorial (English version), to make a simple explanation. If there are more people who are interested in it, I will write a deep learning tutorial for feature point detection.
Deep learning is mainly used for classification (classification) and regression (regression). In fact, feature point detection is regression problem. Every feature point coordinate (x, y) is regarded as continuous variable, and multiple feature points represent multiple class regression.
Preface
Before, I learned a lot of things because of project needs, but I never had the habit of hand recording. After a project is finished, a lot of things will slowly become blurred for a long time. So, I decided to start from now, to do it, and to leave something. My personal research direction is machine vision, Deeplearning, machine learning. I also wrote several hydrology, hoping to have friends with like-minded friends. But this is done before a part based on facial feature points cartoon picture generation "project, and independent research direction, is familiar with the CSDN blog, the blog is not, can not try not to stick with the formula formula, can open code, try to open the code. If the effect is good, you will stick to it later.
Brief introduction of ASM algorithm
ASM is a method of feature point extraction based on statistical learning model. This method is proposed in 95 years. Before deep learning is not popularized, ASM should be a better solution for facial feature extraction. For the detailed introduction of ASM, you can refer to the introduction of the blog ASM algorithm. The ASM algorithm, similar to a common statistical learning algorithm, needs to prepare a dataset with a label, a Train (or Build) model, and then Test (Fit).
Current popular ASM algorithm packet comparison
Currently, there are 3 (more famous) toolkits for the ASM algorithm:
1.ASMLibrary
Provide function:
1) face detection and location using OpenCV
2) support the use of your own dataset Train and Fit
3) extract face feature points by training good model
Characteristic:
1) multiple faces can be detected at the same time
2) real-time video face detection and feature extraction
3) you can train your own model
4) provide a trained, 68 feature point model
5) using the model provided, the location of the feature point is better.
Facial features extracted by ASMLib
Insufficient:
Only provide API, not open source
Source link
2.asmlib-opencv
Provide function:
1) single face detection and feature extraction
2) support your own data sets Train and Fit
Features: Based on Opencv, simple, open source
Deficiency: only a single face can be used, and the positioning effect is not good
Source link
3.stasm
Features: the algorithm is more powerful, more accurate, and completely open source
Inadequate: hard to hand, high code complexity (if only applications, do not need to know the principle, or more easy).
Source link
Application and introduction of ASMLibrary
When facial feature points are detected, I use the 68 feature points extracted by the algorithm, and then use my own image data to do Fit. I simply modify the test source code and save the feature point coordinates to the txt file.
Note: when ASMLibrary is compiled, it needs to configure the Opencv environment. At the same time, change the configuration files in the source project, and change the.Lib to its own version, otherwise, the compiler will not pass.
Technological process:
1. read the picture, video, and picture list (it's added, easy to batch).
2. using Haar classifier to detect face area
3. use the trained model to find 68 feature points
4. save the 68 feature point coordinates into the txt file
//C++ feature points save demo_Fit.cpp
Savepath = savepath + ".Txt";
OFSTREAM examplefile (savepath);
If (examplefile.is_open ())
{
"//examplefile" "This is a line.\n";
"//examplefile" "This is another line.\n";
"Examplefile" "#People:" < < nFaces < < endl;
Examplefile < < < ##Points: > shapes[0].NPoints () < < endl;
For (int i = 0; I < nFaces; i++)
{
For (int j = 0; J < shapes[i].NPoints (); j++)
Examplefile < < < < < < < < < shapes[i][j].x > > < < shapes[i][j].y < < < < < endl;
}
Examplefile.close ();
}
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
Eleven
Twelve
Thirteen
Fourteen
Fifteen
Sixteen
# coordinates format
Lichao:1
Points:68
(61.5149134.076)
(61.1954151.526)
(63.4041169.403)
(67.9898186.943)
(75.983203.934)
(85.5157214.763)
...
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
Since ASMLib does not have the number of coordinates of the corresponding point, we have checked the literature and data, and the number in the lower drawing is basically used, and I have also tested it.
Coordinate point sequence number
Prospect - the use of Deeplearning to detect face feature points
With the great hints of computer computing power and storage capacity and the maturity of Deeplearning theory, many traditional feature extraction problems can be achieved by deep learning, and the effect is better. In the face feature point detection is also used before the Theano/Lasagne has been achieved, the effect is good, and later is also neglected to arrange, no tutorials left. Here is a brief introduction to other people's tutorial (English version), to make a simple explanation. If there are more people who are interested in it, I will write a deep learning tutorial for feature point detection.
Deep learning is mainly used for classification (classification) and regression (regression). In fact, feature point detection is regression problem. Every feature point coordinate (x, y) is regarded as continuous variable, and multiple feature points represent multiple class regression.