CN109753864A - A kind of face identification method based on caffe deep learning frame - Google Patents
A kind of face identification method based on caffe deep learning frame Download PDFInfo
- Publication number
- CN109753864A CN109753864A CN201811111787.3A CN201811111787A CN109753864A CN 109753864 A CN109753864 A CN 109753864A CN 201811111787 A CN201811111787 A CN 201811111787A CN 109753864 A CN109753864 A CN 109753864A
- Authority
- CN
- China
- Prior art keywords
- face
- caffe
- training
- convolutional neural
- deep learning
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Image Analysis (AREA)
Abstract
The invention discloses a kind of face identification method based on caffe deep learning frame, comprising steps of step (1), establishing face recognition database;Step (2) pre-processes database images;Step (3) builds convolutional neural networks with caffe frame;Step (4) uses the parallel frame training deep neural network model based on caffe;Step (5) is called and the caffe model after finishing is trained to be tested.The present invention is based on the deep learning frame based on caffe frame, suitable model parameter can be faster and better trained under improved neural network model, parallel computation picture is used during being identified, improves the recognition efficiency in the case of mass data greatly.
Description
Technical field
The present invention relates to computer visions, artificial intelligence field, are based on caffe deep learning frame more particularly to one kind
Face identification method.
Background technique
Continue to optimize and the progress of computer vision technique, artificial intelligence technology in recent years, brings all to human lives
It is mostly convenient, especially development is also continuously available by the face recognition technology of theoretical basis of such technology.Early stage recognition of face
Application predominantly solve a case, later be applied to mobile phone unlock etc. the not high place of safety requirements.Nowadays, recognition of face is wide
It is general to be applied to each sphere of life of the mankind such as education, finance, the administration of justice, such as many enterprise implement human face identification work-attendance checkings, video prison
Using face recognition technology to identify face etc. in control.
Caffe frame is a kind of open source software frame, and inside provides a set of basic programming framework, in other words a mould
Plate framework, to realize the depth convolutional neural networks deep learning scheduling algorithm under GPU parallel architecture, we can be according to frame
It defines the structure of various convolutional neural networks, and the code of oneself can be increased under this frame again, design new calculation
Method.
There are mainly two types of for face identification method common at present: the face identification method of shallow-layer feature, another kind are
Face identification method based on deep learning.The face identification method of shallow-layer feature mainly includes that the face based on geometrical characteristic is known
Other method, the face identification method based on template matching, face identification method based on model etc.;Face based on deep learning
Recognition methods is usually using convolutional neural networks structure.It is wider currently based on the face identification method application of deep learning.But mesh
That there is structures is complex for preceding some recognition of face networks, the problem that speed is relatively slow and resolution is not high, robustness is not strong.
Summary of the invention
Purpose of the invention is to overcome the shortcomings in the prior art, for recognition of face side existing in the prior art
The complicated network structure of method, the problem that recognition speed is relatively slow and resolution is not high, robustness is not strong provide a kind of based on caffe
The face identification method of deep learning frame, this method may be implemented under the conditions of network structure is simple faster, more accurately
Face is identified.
The purpose of the present invention is what is be achieved through the following technical solutions:
A kind of face identification method based on caffe deep learning frame, method includes the following steps:
Step (1) establishes face recognition database;
Step (2) pre-processes database images;
Step (3) builds convolutional neural networks with caffe frame;
Step (4) uses the parallel frame training deep neural network model based on caffe;
Step (5) is called and the caffe model after finishing is trained to be tested.
Further, step (1) the following steps are included:
Step (101) crawls Asian's face image from network, it is desirable that only has a people in every width figure, and marks out face
Position and the people's name accomplish that name and face correspond if there is duplication of name person only to choose a wherein people;
Database images are carried out enhancing processing by step (102), pass through the mirror surface conversion to image, pixel transform, color
The method expanding data library of transformation carries out data enhancing, in order to carry out subsequent feature extraction;The picture single cent that will have been marked
Part folder storage, the corresponding file of each name;Storage 10-20 picture is needed under one file.
Further, step (2) specifically includes following treatment process:
It step (201), Face datection and is aligned: established database is sent into multitask concatenated convolutional neural network
It carries out Face datection and the face of angle tilt is corrected i.e. face alignment;
Step (202), the fixed size that the face after detecting, being aligned is cut into 112*96.
Further, the step (3) builds convolutional neural networks with caffe frame, and building process specifically includes
Following treatment process:
Step (301), convolutional neural networks include five convolutional layers, five ReLu activation primitive layers, five maximum ponds
Layer, a full articulamentum, a softmax classification layer;Convolution kernel size and convolution are set in model.prototxt file
Step-length, the phase between the size of pond layer, the parameter of step-length and full articulamentum, softmax layers of classification number and each layer
Connect mode;
Step (302), entire iterative process is set in sovler.prototxt file needed for the number of iterations, batch ruler
Very little (batch size), learning rate and the every time step value (step value) of learning rate decline;And select two pieces of GPU simultaneously
It is trained.
Further, the parallel frame training deep neural network model based on caffe of the step (4), training
Process specifically includes following processing step:
Face after cutting is sent into the parallel frame training convolutional neural networks based on caffe by step (401), by
Grade extracts the feature of face, selects and intersects entropy function, and the weight layer-by-layer to convolutional neural networks is trained, dynamic by introducing
The stochastic gradient descent method (SGD) of amount constantly reduces loss function, optimization weight, to extract face characteristic;Loss function is
Cross entropy loss function, expression are as follows:
Wherein, p is to determine result for the probability of true tag, and y is the true tag of label;
Step (402) obtains trained neural network model, exports face feature vector;The feature that will have been extracted
Vector is sent into softmax classifier, and institute's classification number is the number that institute's training data concentrates name;Final output is to belong to
The score or probability of every one kind;
Step (403), the convergent that loss function is observed after having trained every time, adjust in time if there is Divergent Phenomenon
The size of learning rate and step value (step value);Multiple training result is compared, best weight value is obtained, terminates network training,
Training generates a caffe model file to store weight after finishing.
Further, step (5) specifically includes following processing step:
Step (501) sets face sample image to be measured as single image;First pass around multitask concatenated convolutional nerve
Network first by testing image carry out Face datection be aligned cutting, size is set as the testing image of 112*96 with name later
Label;
Step (502) inputs testing image in trained convolutional neural networks, the testing image can for plurality of human faces or
Complex environment image;Neural network after training has recognition capability, if identifying the face sample graph in previous step
Face as in, i.e., the name of exportable this person.
Compared with prior art, the beneficial effects brought by the technical solution of the present invention are as follows:
After image with face is sent into trained network by the present invention, rectangle frame is generated around the face,
The face detected is framed, if identifying face, the name of people is shown in the rectangle frame upper right corner, if the face detected
It is not face sample, then shows " unknown face ".This network structure is simple, and recognition accuracy is high, strong robustness, has obtained very well
Recognition effect can be more under improved neural network model and based on the deep learning frame based on caffe frame
It is good quickly to train suitable model parameter, parallel computation picture is used during being identified, is improved greatly a large amount of
Recognition efficiency under data cases.
Detailed description of the invention
Fig. 1 is the flow diagram of the present inventor's face recognition method;
Fig. 2 is the connection figure of convolutional neural networks used in the present inventor's face recognition method;
Specific embodiment
The invention will be further described with reference to the accompanying drawing.
As shown in Figure 1, being a kind of flow chart of face identification method based on caffe deep learning frame.Including following
Step:
1. face recognition database is established, specific:
Step 101 crawls Asian's face image from network, it is desirable that only has a people in every width figure, and marks out face position
It sets and the people's name, if there is duplication of name person only to choose a wherein people, accomplishes that name and face correspond;
Database images are carried out enhancing processing by step 102, are become by the mirror surface conversion to image, pixel transform, color
The method expanding data library changed carries out data enhancing, in order to preferably carry out subsequent feature extraction.The picture that will have been marked
Divide file storage, each name corresponds to a file, and storage plurality of pictures is needed under a file.
2. database images are pre-processed, specific:
Step 201, Face datection and be aligned: by established database be sent into multitask concatenated convolutional neural network into
The face of angle tilt is simultaneously corrected i.e. face alignment by row Face datection
Step 202, the fixed size that the face after detecting, being aligned is cut into 112*96.
3. convolutional neural networks are built with caffe frame, specific:
Convolutional neural networks used in step 301, the present inventor's face recognition method include five convolutional layers, five ReLu activation
Function layer, five maximum pond layers, a full articulamentum, a softmax classification layer.It is set in model.prototxt file
Set convolution kernel size and convolution step-length, the size of pond layer, the parameter of step-length and full articulamentum, softmax layers of classification number
And the interconnection mode between each layer;Specific: ReLu function is activation primitive well known to deep learning field, specifically
Expression formula is (0, x) y=max, and wherein x is input, and y is the greater in output, that is, output 0 and input, with this function
Purpose be increase network it is non-linear;
The convolution kernel size of conv_1 is 3*3, step-length 1;The convolution kernel size of conv_2 is 1*1, step-length 1;conv_
3 convolution kernel size is 3*3, step-length 1;The convolution kernel size of conv_4 is 1*1, step-length 1;The convolution kernel size of conv_5
For 3*3, step-length 1;Pond layer is 2*2, step-length 1;
Step 302, entire iterative process is set in sovler.prototxt file needed for the number of iterations, batch size
Batch size and learning rate and every time the step value step value of learning rate decline;Greatest iteration in the present embodiment
Number is set as 100000 times;And the mode for selecting two pieces of GPU to be trained simultaneously.
4. specific using the parallel frame training deep neural network model based on caffe:
Face after cutting is sent into the parallel frame training convolutional neural networks based on caffe by step 401, step by step
The feature of face is extracted, selects and intersects entropy function, the weight layer-by-layer to convolutional neural networks is trained, by dynamic with introducing
The stochastic gradient descent method SGD of amount constantly reduces loss function, optimization weight, preferably to extract face characteristic.The present invention
Used loss function is cross entropy loss function, and expression is as follows:
Wherein, p is to determine result for the probability of true tag, and y is the true tag of label.
Step 402 finally obtains trained neural network model, exports face feature vector.The spy that will have been extracted
It levies vector and is sent into softmax classifier, institute's classification number is the number that institute's training data concentrates name.Final output is to belong to
In the score or probability of every one kind.
Step 403, the convergent that loss function is observed after having trained every time, if Divergent Phenomenon occur should adjust in time
The size of habit rate and step value.Multiple training result is compared, best weight value is obtained, so far, network training terminates, training
A caffe model file is generated after finishing to store weight.
5. the caffe model after calling training to finish is tested, specific:
Face sample image when step 501, requirement test will be single image.It first has to first pass through multitask cascade volume
Product neural network first by picture to be tested carry out Face datection be aligned cutting, later by size for 112*96 image with name
For label.
Step 502 inputs image in trained convolutional neural networks, which can be plurality of human faces, complex environment figure
Picture.Neural network after training has the ability of identification, if identifying the people in the face sample image in previous step
Face, i.e., the name of exportable this person.
As shown in Fig. 2, for the connection figure of convolutional neural networks used in the present inventor's face recognition method: convolutional neural networks packet
Containing five convolutional layers, five ReLu activation primitive layers, five maximum pond layers, a full articulamentum and a full articulamentum
For softmax classification layer.Reach 92.05% by Average Accuracy of this method under the detection collection of self-control database.
The present invention is not limited to embodiments described above.Above the description of specific embodiment is intended to describe and say
Bright technical solution of the present invention, the above mentioned embodiment is only schematical, is not restrictive.This is not being departed from
In the case of invention objective and scope of the claimed protection, those skilled in the art may be used also under the inspiration of the present invention
The specific transformation of many forms is made, within these are all belonged to the scope of protection of the present invention.
Claims (6)
1. a kind of face identification method based on caffe deep learning frame, which is characterized in that method includes the following steps:
Step (1) establishes face recognition database;
Step (2) pre-processes database images;
Step (3) builds convolutional neural networks with caffe frame;
Step (4) uses the parallel frame training deep neural network model based on caffe;
Step (5) is called and the caffe model after finishing is trained to be tested.
2. a kind of face identification method based on caffe deep learning frame according to claim 1, which is characterized in that
Step (1) the following steps are included:
Step (101) crawls Asian's face image from network, it is desirable that only has a people in every width figure, and marks out face location
And the people's name accomplishes that name and face correspond if there is duplication of name person only to choose a wherein people;
Database images are carried out enhancing processing by step (102), pass through the mirror surface conversion to image, pixel transform, colour switching
Method expanding data library, carry out data enhancing, in order to carry out subsequent feature extraction;Divide the picture marked to file
Storage, the corresponding file of each name;Storage 10-20 picture is needed under one file.
3. a kind of face identification method based on caffe deep learning frame according to claim 1, which is characterized in that
Step (2) specifically includes following treatment process:
It step (201), Face datection and is aligned: established database being sent into multitask concatenated convolutional neural network and is carried out
The face of angle tilt is simultaneously corrected i.e. face alignment by Face datection;
Step (202), the fixed size that the face after detecting, being aligned is cut into 112*96.
4. a kind of face identification method based on caffe deep learning frame according to claim 1, which is characterized in that
The step (3) builds convolutional neural networks with caffe frame, and building process specifically includes following treatment process:
Step (301), convolutional neural networks include five convolutional layers, five ReLu activation primitive layers, five maximum pond layers, one
A full articulamentum, a softmax classification layer;Convolution kernel size and convolution step-length are set in model.prototxt file,
Interconnection between the size of pond layer, the parameter of step-length and full articulamentum, softmax layers of classification number and each layer
Mode;
Step (302), entire iterative process is set in sovler.prototxt file needed for the number of iterations, batch size
(batch size), learning rate and the every time step value (step value) of learning rate decline;And select two pieces of GPU simultaneously into
Row training.
5. a kind of face identification method based on caffe deep learning frame according to claim 1, which is characterized in that
The parallel frame training deep neural network model based on caffe of the step (4), training process specifically include following place
Manage step:
Face after cutting is sent into the parallel frame training convolutional neural networks based on caffe by step (401), is mentioned step by step
The feature of face is taken out, selects and intersects entropy function, the weight layer-by-layer to convolutional neural networks is trained, by introducing momentum
Stochastic gradient descent method (SGD) constantly reduces loss function, optimization weight, to extract face characteristic;Loss function is to intersect
Entropy loss function, expression are as follows:
Wherein, p is to determine result for the probability of true tag, and y is the true tag of label;
Step (402) obtains trained neural network model, exports face feature vector;The feature vector that will have been extracted
It is sent into softmax classifier, institute's classification number is the number that institute's training data concentrates name;Final output is each to belong to
The score or probability of class;
Step (403), the convergent that loss function is observed after having trained every time, the timely regularized learning algorithm if there is Divergent Phenomenon
The size of rate and step value (step value);Multiple training result is compared, best weight value is obtained, terminates network training, training
A caffe model file is generated after finishing to store weight.
6. a kind of face identification method based on caffe deep learning frame according to claim 1, which is characterized in that
Step (5) specifically includes following processing step:
Step (501) sets face sample image to be measured as single image;First pass around multitask concatenated convolutional neural network
First by testing image carry out Face datection be aligned cutting, later size is set as marking for the testing image of 112*96 with name
Label;
Step (502) inputs testing image in trained convolutional neural networks, which can be plurality of human faces or complexity
Ambient image;Neural network after training has recognition capability, if identifying in the face sample image in previous step
Face, i.e., the name of exportable this person.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811111787.3A CN109753864A (en) | 2018-09-24 | 2018-09-24 | A kind of face identification method based on caffe deep learning frame |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811111787.3A CN109753864A (en) | 2018-09-24 | 2018-09-24 | A kind of face identification method based on caffe deep learning frame |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109753864A true CN109753864A (en) | 2019-05-14 |
Family
ID=66402459
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811111787.3A Pending CN109753864A (en) | 2018-09-24 | 2018-09-24 | A kind of face identification method based on caffe deep learning frame |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109753864A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110647840A (en) * | 2019-09-19 | 2020-01-03 | 天津天地基业科技有限公司 | Face recognition method based on improved mobileNet V3 |
CN110674923A (en) * | 2019-08-15 | 2020-01-10 | 山东领能电子科技有限公司 | Rapid model verification method among multiple neural network frames |
CN110796112A (en) * | 2019-11-05 | 2020-02-14 | 青岛志泊电子信息科技有限公司 | In-vehicle face recognition system based on MATLAB |
CN111488806A (en) * | 2020-03-25 | 2020-08-04 | 天津大学 | Multi-scale face recognition method based on parallel branch neural network |
CN111800455A (en) * | 2020-05-13 | 2020-10-20 | 杭州电子科技大学富阳电子信息研究院有限公司 | Method for sharing convolutional neural network based on different host data sources in local area network |
CN112200075A (en) * | 2020-10-09 | 2021-01-08 | 西安西图之光智能科技有限公司 | Face anti-counterfeiting method based on anomaly detection |
CN112434615A (en) * | 2020-11-26 | 2021-03-02 | 天津大学 | Time sequence action detection method based on Tensorflow deep learning framework |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107330383A (en) * | 2017-06-18 | 2017-11-07 | 天津大学 | A kind of face identification method based on depth convolutional neural networks |
CN107832753A (en) * | 2017-12-21 | 2018-03-23 | 中通服公众信息产业股份有限公司 | A kind of face feature extraction method based on four value weights and multiple classification |
CN107993200A (en) * | 2017-11-02 | 2018-05-04 | 天津大学 | Picture noise level estimation method based on deep learning |
CN108062532A (en) * | 2017-12-28 | 2018-05-22 | 北京智慧眼科技股份有限公司 | Deep learning recognition of face network optimized approach, device and storage medium |
CN108256450A (en) * | 2018-01-04 | 2018-07-06 | 天津大学 | A kind of supervised learning method of recognition of face and face verification based on deep learning |
CN108304788A (en) * | 2018-01-18 | 2018-07-20 | 陕西炬云信息科技有限公司 | Face identification method based on deep neural network |
-
2018
- 2018-09-24 CN CN201811111787.3A patent/CN109753864A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107330383A (en) * | 2017-06-18 | 2017-11-07 | 天津大学 | A kind of face identification method based on depth convolutional neural networks |
CN107993200A (en) * | 2017-11-02 | 2018-05-04 | 天津大学 | Picture noise level estimation method based on deep learning |
CN107832753A (en) * | 2017-12-21 | 2018-03-23 | 中通服公众信息产业股份有限公司 | A kind of face feature extraction method based on four value weights and multiple classification |
CN108062532A (en) * | 2017-12-28 | 2018-05-22 | 北京智慧眼科技股份有限公司 | Deep learning recognition of face network optimized approach, device and storage medium |
CN108256450A (en) * | 2018-01-04 | 2018-07-06 | 天津大学 | A kind of supervised learning method of recognition of face and face verification based on deep learning |
CN108304788A (en) * | 2018-01-18 | 2018-07-20 | 陕西炬云信息科技有限公司 | Face identification method based on deep neural network |
Non-Patent Citations (2)
Title |
---|
《我是未来》节目组,: "遇见未来:21种正在改变世界的神器科技", vol. 2018, 《北京航空航天大学出版社》, pages: 79 - 80 * |
KAIPENG ZHANG ET AL.: "Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks", IEEE SIGNAL PROCESSING LETTERS, vol. 22, no. 10, pages 1 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110674923A (en) * | 2019-08-15 | 2020-01-10 | 山东领能电子科技有限公司 | Rapid model verification method among multiple neural network frames |
CN110647840A (en) * | 2019-09-19 | 2020-01-03 | 天津天地基业科技有限公司 | Face recognition method based on improved mobileNet V3 |
CN110796112A (en) * | 2019-11-05 | 2020-02-14 | 青岛志泊电子信息科技有限公司 | In-vehicle face recognition system based on MATLAB |
CN111488806A (en) * | 2020-03-25 | 2020-08-04 | 天津大学 | Multi-scale face recognition method based on parallel branch neural network |
CN111800455A (en) * | 2020-05-13 | 2020-10-20 | 杭州电子科技大学富阳电子信息研究院有限公司 | Method for sharing convolutional neural network based on different host data sources in local area network |
CN112200075A (en) * | 2020-10-09 | 2021-01-08 | 西安西图之光智能科技有限公司 | Face anti-counterfeiting method based on anomaly detection |
CN112200075B (en) * | 2020-10-09 | 2024-06-04 | 西安西图之光智能科技有限公司 | Human face anti-counterfeiting method based on anomaly detection |
CN112434615A (en) * | 2020-11-26 | 2021-03-02 | 天津大学 | Time sequence action detection method based on Tensorflow deep learning framework |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109753864A (en) | A kind of face identification method based on caffe deep learning frame | |
CN106570474B (en) | A kind of micro- expression recognition method based on 3D convolutional neural networks | |
CN106372581B (en) | Method for constructing and training face recognition feature extraction network | |
CN106407986B (en) | A kind of identification method of image target of synthetic aperture radar based on depth model | |
CN107844795B (en) | Convolutional neural network feature extraction method based on principal component analysis | |
CN108537743A (en) | A kind of face-image Enhancement Method based on generation confrontation network | |
CN108961675A (en) | Fall detection method based on convolutional neural networks | |
CN108961245A (en) | Picture quality classification method based on binary channels depth parallel-convolution network | |
CN108921822A (en) | Image object method of counting based on convolutional neural networks | |
CN106127108B (en) | A kind of manpower image region detection method based on convolutional neural networks | |
WO2018052587A1 (en) | Method and system for cell image segmentation using multi-stage convolutional neural networks | |
CN110532900A (en) | Facial expression recognizing method based on U-Net and LS-CNN | |
CN112464865A (en) | Facial expression recognition method based on pixel and geometric mixed features | |
CN109948714A (en) | Chinese scene text row recognition methods based on residual error convolution sum recurrent neural network | |
CN104834898A (en) | Quality classification method for portrait photography image | |
CN109886153A (en) | A kind of real-time face detection method based on depth convolutional neural networks | |
CN108121950B (en) | Large-pose face alignment method and system based on 3D model | |
CN104268593A (en) | Multiple-sparse-representation face recognition method for solving small sample size problem | |
CN109508670B (en) | Static gesture recognition method based on infrared camera | |
CN110378208A (en) | A kind of Activity recognition method based on depth residual error network | |
CN109086768A (en) | The semantic image dividing method of convolutional neural networks | |
CN105095867A (en) | Rapid dynamic face extraction and identification method based deep learning | |
CN106874879A (en) | Handwritten Digit Recognition method based on multiple features fusion and deep learning network extraction | |
CN112052772A (en) | Face shielding detection algorithm | |
CN110008961A (en) | Text real-time identification method, device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |