CN107577990A - A kind of extensive face identification method for accelerating retrieval based on GPU - Google Patents

A kind of extensive face identification method for accelerating retrieval based on GPU Download PDF

Info

Publication number
CN107577990A
CN107577990A CN201710675398.2A CN201710675398A CN107577990A CN 107577990 A CN107577990 A CN 107577990A CN 201710675398 A CN201710675398 A CN 201710675398A CN 107577990 A CN107577990 A CN 107577990A
Authority
CN
China
Prior art keywords
face
gpu
real
hash
valued
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.)
Granted
Application number
CN201710675398.2A
Other languages
Chinese (zh)
Other versions
CN107577990B (en
Inventor
邹复好
曹锋
李开
王浩
白兴强
栾朝阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WUHAN SHIJI JINQIAO SAFETY TECHNOLOGY Co Ltd
Huazhong University of Science and Technology
Original Assignee
WUHAN SHIJI JINQIAO SAFETY TECHNOLOGY Co Ltd
Huazhong University of Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by WUHAN SHIJI JINQIAO SAFETY TECHNOLOGY Co Ltd, Huazhong University of Science and Technology filed Critical WUHAN SHIJI JINQIAO SAFETY TECHNOLOGY Co Ltd
Priority to CN201710675398.2A priority Critical patent/CN107577990B/en
Publication of CN107577990A publication Critical patent/CN107577990A/en
Application granted granted Critical
Publication of CN107577990B publication Critical patent/CN107577990B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a kind of extensive face identification method for accelerating retrieval based on GPU, it is related to computer vision field, including Face datection is with aliging, face characteristic extraction, the coarse matching that Hash feature is obtained, face index data base is established, more GPU accelerate, Candidate Set based on Hash obtains, the accurate matching based on distance metric and ballot obtain and most match the steps such as people.The two benches characteristic matching of extensive face identification method based on hash index and more GPU speed-up computations disclosed by the invention for accelerating retrieval based on GPU, the screening of candidate feature vector can be accelerated using computation capability powerful GPU, it is greatly reduced when being retrieved on large-scale dataset and consumes, the types of applications demand that based on the realization of depth convolutional neural networks and requirement of real-time is higher can be met well.

Description

A kind of extensive face identification method for accelerating retrieval based on GPU
Technical field
The present invention relates to computer vision field, and in particular to a kind of extensive recognition of face for accelerating retrieval based on GPU Method.
Background technology
In recent years, with the fast lifting of computing power and the constantly improve of deep learning method, pattern-recognition and people Work smart field all achieves great breakthrough.People are obtained by deep learning method in many pattern recognition tasks Very excellent effect, recognition of face are no exception.As the arrival in big data epoch, face image data are more and more richer Richness, how to be concentrated in large-scale human face data and efficiently and accurately identify a person's identity information, be that current pattern is known Other and information retrieval field research focus.
A kind of important means of the recognition of face as identification identity, has high theory and application value.And it is based on people The image retrieval of face is also an information retrieval field significantly direction, there is quite varied application.Such as giving pleasure to Happy field, most like star's face can be found by submitting the image of oneself;In police field, face alignment can be passed through Retrieval, to help to find criminal;And for example in safety-security area, gate control system can be related to, blacklist monitoring, differentiated " boatman " etc. Using;In addition, in the Self-Service of bank, " testimony of a witness unification " in hotel, the various fields such as information security have pole to this Big application demand.Therefore, research and development are a kind of takes into account recognition efficiency and the face classification device of accuracy rate under large-scale data environment With high realistic meaning.
Traditional face retrieval method is first manual extraction face characteristic, and then face characteristic storehouse is searched based on arest neighbors Rope, the search based on facial image is converted into the similarity measurement based on real-valued vector.This method is counting on a small scale It is fine according to being showed on collection, once but data set increase, recognition efficiency can drastically decline with accuracy rate.In addition, the feature of face to Amount is typically high dimensional feature vectors, in the case of dimensional comparison height, if we also carry out arest neighbors to whole database Search, efficiency is very low.
Recognition of face in the case of large-scale data is substantially the search problem of multi-medium data, is returned to be identified Face several most similar data, i.e. approximate KNN searching algorithm on feature space.In image approximate search field, Two kinds of implementation methods can be divided into, one kind is directly to carry out similarity searching in high-dimensional feature space, and another is by higher-dimension Space reflection is converted into the search problem based on semantic hash method to Hamming space.The former is in the larger situation of data volume Under, have one it is apparent the shortcomings that be exactly " dimension disaster " problem.In order to solve the problems, such as dimension disaster, scholars have done a lot The research of semantic hash method, semantic hash method can generate very compact Hash codes directly to reflect original feature space Semantic information, the closely located feature on original feature space, then Hamming distance is close, otherwise farther out.And based on It is research Hash generation method mostly in the proximity search research work of semantic hash method, it is few on designing Hash rope Attract the research for improving recall precision.So how in large-scale hash, the proximity search of hash method is accelerated to drop Consumption is an of great value research direction when low.
The content of the invention
For defect present in prior art, the big of retrieval is accelerated based on GPU it is an object of the invention to provide a kind of Scale face identification method, the powerful computation capabilities of GPU can be utilized to accelerate the screening of candidate feature vector, be greatly reduced Consumed when being retrieved on large-scale dataset, can well meet based on the realization of depth convolutional neural networks and real-time will Seek higher types of applications demand.
To achieve the above objectives, the present invention adopts the technical scheme that:
A kind of extensive face identification method for being accelerated retrieval based on GPU, this method are comprised the following steps:
S1, picture to be detected inputted into MTCNN networks, using Face datection algorithm, detect in photo the position of face and Key point position, the face that alignment detection arrives;
S2, use the reality of human face photo and the photo mirror image after the deep learning model extraction step S1 processing trained Value tag vector, then merge two real-valued vectors and real-valued of the dimensionality reduction as the face;
S3, the real-valued is converted into Hash feature;
S4, repeat step S1-S3 detect face to be measured one by one, are characterized as indexing using the Hash, real-valued vector As value, key assignments type face database is established;
S5, using more GPU Hash lookup algorithm is accelerated to obtain Hash of the k with the Hash feature neighbour of picture to be detected Feature;
S6, the k Hash feature obtained using in S5 are searched in the face database, obtained as index The Candidate Set being made up of k real-valued vector;
S7, calculate the real-valued vector of the photo to be checked vector similitude degree vectorial with real-valued in Candidate Set Span from;
S8, the vector similitude degree according to the vectorial vector with the real-valued of photo to be checked of real-valued in Candidate Set Span is from ballot obtains the fraction of each photo to be checked, using highest scoring person as face recognition result.
On the basis of above-mentioned technical proposal, the step S1 specifically includes following steps:
S101, picture to be detected inputted into MTCNN networks, use the first CNN to produce face candidate collection window and its recurrence Position coordinates, then merge the higher face window of degree of overlapping with non-maxima suppression algorithm, produce face window candidate Collection;
S102, the obtained results of step S101 are sent to twoth CNN more complicated than the first CNN, result is refiltered With the fine setting of face the window's position;
S103, the obtained results of step S102 are sent to threeth CNN more complicated than the 2nd CNN be finely adjusted, and generate The final position of face window and the coordinate of five face key points in each picture to be detected;
Final face window whether has been generated in S104, judgment step S103, if nothing, has terminated identification;If so, extraction is most Whole face video in window, and face correction is aligned to center, save as regulation resolution sizes.
On the basis of above-mentioned technical proposal, face feature extraction network extraction human face photo and the photo mirror image are used Real-valued vector;
Face characteristic extraction network is 32 layer depth convolutional neural networks, including convolutional layer, down-sampled layer, PRelu Active coating, full articulamentum and loss function layer.
On the basis of above-mentioned technical proposal, the loss function layer includes softmax-loss and center-loss two Individual loss function, the softmax-loss loss functions are used to improve class of the sample after network mapping in feature space Interior extent of polymerization;The center-loss loss functions are used to increase between class of the sample after network mapping in feature space Distance.
On the basis of above-mentioned technical proposal, in the step S2, face shines after fusion steps S1 processing as follows The real-valued vector of the piece real-valued vector sum photo mirror image:
Fi=max (xi, yi) i=1,2 ..., n
Wherein, xi and yi is vector x to be fused respectively, and y i-th dimension, n is the dimension of real-valued vector, and fi is fusion The i-th dimension of real-valued vector afterwards.
It is as follows that the face obtained in step S2 is real in the step S3 on the basis of above-mentioned technical proposal Value tag is converted into Hash feature:
F (x)=0.5 × (sign (x)+1)
Wherein,
On the basis of above-mentioned technical proposal, in the step S5, Hash lookup algorithm is accelerated to obtain k using more GPU The Hash feature of neighbour specifically includes following steps:
S501, the data set for forming N number of Hash feature of whole, M parts are divided into according to the GPU numbers M being set using, Each part is no more than SUBN=(N+M-1)/M Hash feature, by all Hash features of the Sub Data Set after division from master Machine copies corresponding equipment end to;
S502, computational threads number, parallel computation Hash codes to be checked and all Hash in data set are set to every piece of GPU The Hamming distance of code;
S503, all Hamming distances are divided into SUBN/K groups by data adjacent K for one group, it is parallel to perform, will The Hamming distance of all SUBN/K groups is sorted using merger, is ordered as in group in order;
S504, find out successively array index [nK, (n+1) K) and [(n+1) K, (n+2) K) in K minimum in Hamming distance Individual data, and move it into [nK, (n+1) K) position, wherein n=0,2,4 ..., relatively array index [nK, (n+ every time 1) K) in maximum and array index [(n+1) K, (n+2) K) middle minimum value size, if [nK, (n+1) K) in most It is worth greatly larger, the two is exchanged;
S505, repeat step S503, S504, sort respectively [0, K), [2K, 3K), [4K, 5K) ..., will [0, K) and [2K, 3K) this 2K array is one group, K minimum Hamming distance before finding out, and move it into [0, K), the rest may be inferred, until On all M blocks GPU the preceding K Hamming distance of packet be stored in [0, K) on position;
S506, M GPU result of calculation copied in main frame end memory, to all M*K Hamming distances, using most Big heapsort, M*K data are traveled through, obtain K Hamming distance minimum in M group data.
On the basis of above-mentioned technical proposal, in the step S7, Cosine measurements or European metric calculation step are used The distance of the real-valued vector and each real-valued vector in Candidate Set of the face to be checked obtained in S5.
On the basis of above-mentioned technical proposal, in the step S8, the ballot device formula used is as follows:
Wherein, score (id) is the final vote fraction of each face ID in Candidate Set, and sim is what is obtained in step S7 The distance of the real-valued vector and real-valued vector in Candidate Set of face to be checked, threshold are setting threshold value.
Compared with prior art, the advantage of the invention is that:
(1) the extensive face identification method for accelerating to retrieve based on GPU of the invention is based on hash index and more GPU add The two benches characteristic matching that speed calculates, the powerful computation capabilities of GPU can be utilized to accelerate the screening of candidate feature vector, greatly Width reduces to be consumed when being retrieved on large-scale dataset, can be met well based on the realization of depth convolutional neural networks and real When property requires higher types of applications demand.
(2) the extensive face identification method for accelerating to retrieve based on GPU of the invention is accurate on LFW face test sets Rate reaches 99.48%, and the discrimination in MegaFace test assignments reaches 72.5%, realizes and is being greatly reduced on a large scale Consumption simultaneously, ensures the effect of high recognition accuracy when being retrieved on data set.
(3) it is of the invention to accelerate each step of extensive face identification method of retrieval relatively independent based on GPU, can be with Technological progress or actual demand and the implementation adjusted without influenceing other steps, autgmentability are replaced on wherein some step Well.
Brief description of the drawings
Fig. 1 is the schematic diagram based on the GPU extensive recognition of face search methods accelerated in the embodiment of the present invention;
Fig. 2 is the MTCNN frame diagrams of Face datection and crucial point location in the embodiment of the present invention;
Fig. 3 is that the face characteristic based on deep learning proposed in the embodiment of the present invention extracts network structure;
Fig. 4 is that the face real-valued proposed in the embodiment of the present invention is extracted with merging frame diagram;
Fig. 5 is the Hash lookup algorithm flow chart accelerated based on GPU proposed in the embodiment of the present invention.
Embodiment
The present invention is described in further detail below in conjunction with drawings and Examples.
The explanation of nouns used in the embodiment of the present invention is as follows:
MTCNN:Multi-task convolutional neural network, the convolutional neural networks of multitask;
CNN:Convolutional neural network, convolutional neural networks;
PReLU(Parametric Rectified Linear Unit):Activation primitive with parameter.
Shown in Figure 1, the embodiment of the present invention provides a kind of extensive face identification method for accelerating retrieval based on GPU, Comprise the following steps:
S1, picture to be detected inputted into MTCNN networks, using Face datection algorithm, detect in photo the position of face and Key point position, the face that alignment detection arrives;
S2, use the reality of human face photo and the photo mirror image after the deep learning model extraction step S1 processing trained Value tag vector, then merges two vectors and real-valued of the dimensionality reduction as the face;
The face real-valued obtained in step S2 is converted into Hash feature by S3, design hash function;
S4, repeat step S1-S3 detect face to be measured one by one, are characterized as indexing using the Hash in step S3, and real value is special Sign vector establishes key assignments type face database as value;
S5, according to step S1-S3 to inquiry photo disposal obtain Hash feature, use more GPU accelerate Hash lookup algorithm Obtain the Hash feature of k neighbour;
S6, the Hash feature obtained using in S5 are looked into as index in the face database that step S4 is established Look for, obtain the Candidate Set of corresponding real-valued vector;
S7, the real-valued vector and the Hamming distance of characteristic vector in Candidate Set for calculating photo to be checked;
S8, according to vectorial with vectorial Hamming distance to be checked in Candidate Set, after subtracting threshold value, ballot obtains each Candidate ID fraction, using highest scoring person as face recognition result.
A kind of extensive face identification method for being accelerated retrieval based on GPU provided by the present invention, query process is divided into Coarse matching and two stages of fine match.Wherein, coarse matching stage generates every face figure first with depth salted hash Salted The Hash feature as corresponding to, Hash feature all in data set is established into efficient index, uses the Kazakhstan of GPU speed-up computations Uncommon lookup algorithm inquires about the Hash feature of facial image to be retrieved and the Hamming distance of all Hash features, will meet to be less than spy Determine face corresponding to the preceding k Hash feature of Hamming distance and Hamming distance minimum and, as Candidate Set, obtain coarse matching stage Obtained result.In accurate matching stage, the Hash feature in Candidate Set take out corresponding to real-valued, it is suitable to choose Method for measuring similarity, the real-valued in Candidate Set is compared with the real-valued of face to be retrieved.It will compare Result be sent to ballot device in, finally, gained vote fraction highest face ID be face recognition result.
Each step in the inventive method one embodiment is described in detail step by step below to complete to accelerate the big rule of retrieval based on GPU The detailed process of mould face identification method:
Step S1, picture to be detected is inputted into MTCNN networks, using Face datection algorithm, detects the position of face in photo Put and key point position, the face that alignment detection arrives;
The present invention is using MTCNN methods as Face datection and crucial independent positioning method, its overall frame diagram such as Fig. 2 Shown, it specifically includes following steps to Face datection and key point localization process:
S101, picture to be detected inputted into MTCNN networks, use the first CNN to produce face candidate collection window and its recurrence Position coordinates, then merge the higher face window of degree of overlapping with non-maxima suppression algorithm, produce face window candidate Collection;
S102, the obtained results of step S101 are sent to twoth CNN more complicated than the first CNN, result is refiltered With the fine setting of face the window's position;
S103, the result for obtaining step S102 are finely adjusted by the 3rd CNN more complicated than the 2nd CNN again, and are produced The position of raw each final face window of picture to be detected and the coordinate of five face key points;
Whether there is final face window to produce in S104, judgment step S103, if nothing, terminate identification;If so, extraction is most Whole face video in window, and face correction is extremely hit exactly to it, save as regulation resolution sizes.
As shown in figure 3, the MTCNN in the embodiment of the present invention divides three phases to handle image:First CNN is used Full convolutional network P-Net (Proposal Network), obtains a part of face window Candidate Set, wherein being returned using bounding box Come back and calibrate and merge candidate frame with NMS;Then a 2nd more complicated CNN is sent to, it uses full convolutional network R-Net (Refine Network) removes more non-face regions;Result is finally input to more complicated 3rd CNN Network O-Net (Output Network) does fine processing, exports final face frame and five facial key point positions.
This method devises three network structures to do cascade optimization processing.Compared to polytypic object detection task, Face datection task is two classification problems, therefore less wave filter is needed for the detection of its relative target, but is needed More preferable discrimination is wanted, so designing deeper network structure in O-Net to extract more preferable semantic feature.And In order to reach the target of real-time, the size of the convolution kernel of design is all 3 × 3 and 2 × 2, it is possible to reduce many operands, Three CNN structures are as shown in Figure 3.
Picture to be detected is inputted into MTCNN networks, after being handled by step S101-S103, has just obtained input picture Whether there is the coordinate of face, the position of face window and face key point, then by step S104 processing, obtain in step S2 Human face photo after required processing.
Step S2, using human face photo and the photo mirror image after the deep learning model extraction step S1 processing trained Real-valued vector, then merge two vectors and real-valued of the dimensionality reduction as the face;
The face characteristic extraction network that the present invention designs is exactly the knot of the residual block according to residual error network-Resnet Structure is stacked and formed, and devises one 32 layers of depth convolutional neural networks, including convolutional layer, down-sampled layer, PRelu active coatings, A variety of different types of structures such as full articulamentum, the nonlinear transformation of complexity is fitted by the combination of various structures, it is overall Network structure it is as shown in Figure 4.
The concrete configuration of network and parameter setting are as shown in the table:
The input of network is the image that resolution ratio is 96 × 112 × 3, the feature of the dimension of output 512.Network structure one is shared 32 layers, what Conv was represented is convolutional layer, and MP is down-sampled layer (using the method in maximum pond), and FC is full articulamentum.Weight What is represented again is the overlapping number of the structure, and output is the output size by feature after this layer.As can be seen from the table, More local number of parameters is more rearward for network structure, and the number of parameters of last layer of full articulamentum is the one of total number of parameters Half, the characteristic vector of final output is 512 dimensions.Loss function layer, the feature that the present invention uses are followed by last FC layer Extraction network uses two loss functions of softmax-loss and center-loss simultaneously, to improve aggregation and class spacing in class From remote, accuracy rate is finally improved.Center-loss passes through each class to training set on the basis of softmax-loss A class center is recorded respectively in feature space, and in the training process, increase sample is after network mapping in feature space With the distance restraint at class center, feature extent of polymerization in class after mapping is improved, increases class in combination with softmax-loss Between distance, make study to feature there is more preferable generalization and resolving ability.
S4, repeat step S1-S3 detect face to be measured one by one, are characterized as indexing using the Hash in step S3, and real value is special Sign vector establishes key assignments type face database as value;
Because the data scale of the invention handled is at hundred million grades, in order to retrieve real-valued corresponding to Hash feature faster Vector, Redis storage real-valued vectors can be used, each hash index corresponds to multiple characteristic vectors, if some characteristic vector Then hash index corresponding to addition is not present in caused Hash feature in database, is otherwise appended to this feature vector pair Answer in hash index.In order to store the information on face, the present invention stores corresponding information using three tables, is respectively Hashcode_set, face_info_hash and person_info_hash.Wherein hashcode_set is the number of aggregate type According to structure, whole hash indexs is stored.Face_info_hash and person_info_hash is the Hash classes in Redis Type data structure, the wherein data storage in the form of key-value pair, face_info_hash store the relevant information of every face, Person_info_hash stores everyone information, and everyone has unique ID, while everyone can have multiple faces.
The concrete structure of person_info_hash keys is as follows:
The concrete structure of face_info_hash keys is as follows:
Because two tables are all key assignments type data structures, it is possible to freely add new information every face piece Its corresponding hash index is stored in face_info_hash tables, corresponding hash index is many to be stored in the key of key name The real-valued vector of individual face, the key name of each characteristic vector is made up of as shown in the table the id and numbering of face:
Step S5, previous step is obtained real-valued vector sum Hash feature corresponding to human face photo to be checked to Amount carries out coarse matching.In the extensive face identification method of the present invention, coarse matching stage is retrieval and picture to be checked K nearest Hash feature of Hamming distance.It is well known that a kind of graphics processors for image rendering of GPU, it is integrated with Very more calculating cores, is usually used in data processing and scientific algorithm.GPU this powerful computation capability meets greatly The application scenarios that scale characteristic distance calculates, i.e., found in large-scale Hash feature and meet that K Hash of querying condition is special Sign.Therefore, the present invention devises a kind of Top K Hash lookup algorithms accelerated based on more GPU.Algorithm main flow such as Fig. 5 It is shown, specifically include following steps:
S501, the data set for forming N number of Hash feature of whole, according to the GPU number M being set using, are divided into M portions Point, each part is no more than SUBN=(N+M-1)/M Hash feature, by all Hash features of the Sub Data Set after division Corresponding equipment end is copied to from main frame;
S502, computational threads number, parallel computation Hash codes to be checked and all Hash in data set are set to every piece of GPU The Hamming distance of code;
S503, all Hamming distances are divided into SUBN/K groups by data adjacent K for one group, it is parallel to perform, will The Hamming distance of all SUBN/K groups is sorted using merger, is ordered as in group in order;
S504, find out successively array index [nK, (n+1) K) and [(n+1) K, (n+2) K) in K minimum in Hamming distance Individual data, and move it into [nK, (n+1) K) position, wherein n=0,2,4 ..., relatively array index [nK, (n+ every time 1) K) in maximum and array index [(n+1) K, (n+2) K) middle minimum value size, if [nK, (n+1) K) in most It is worth greatly larger, the two is exchanged;
S505, repeat step S503, S504, sort respectively [0, K), [2K, 3K), [4K, 5K) ..., will [0, K) and [2K, 3K) this 2K array is one group, K minimum Hamming distance before finding out, and move it into [0, K), the rest may be inferred, until On all M blocks GPU the preceding K Hamming distance of packet be stored in [0, K) on position;
S506, M GPU result of calculation copied in main frame end memory, to all M*K Hamming distances, using most Big heapsort, M*K data are traveled through, obtain K Hamming distance minimum in M group data.
The target of algorithm is found in N number of Hash feature, K minimum Hash of the Hamming distance with inquiring about Hash feature Feature, all N number of Hash features are divided into M parts according to available GPU numbers M first, (N+M-1)/M is contained in each part Individual Hash feature, copy the Hash feature of each part to equipment end from main frame respectively, then every piece of GPU is done respectively as Lower operation, set every piece of GPU to be used for the size of block (Block) and the grid (Grid) calculated, utilize GPU parallel computation energy Power quickly calculates the Hamming distance of Hash codes to be checked and all Hash codes in data set, finally from all Hamming distances K minimum Hamming distance is returned before selection, and the result that M GPU is calculated is used into merger according to distance in host side afterwards The thought of sequence merges, and obtains the K Hash feature minimum with the Hash feature Hamming distance of inquiry.Idiographic flow is as described above Described in step S501-S506.
Whole algorithm is the thought with merger (Merge Sort) and bitonic sorting (Bitonic Sort), is realized Hash on GPU quickly calculates and retrieval.Need to safeguard one and Hamming based on GPU every piece of GPU of hash indexing method accelerated Apart from list identical index structure, when Hamming distance changes, and meanwhile the position of moving index, last Top K Hammings The position of distance is the position of manipulative indexing.
The main video memory expense of algorithm is to store all Hamming distances, space complexity O(N), on time overhead, The main calculating including Hamming distance and double expenses for adjusting merger sequence, during the two, the former time complexity is O(N), the time complexity of the latter is O(NlogN), therefore overall time complexity is O(NlogN)
Accelerated using GPU after Hash lookup algorithm finds out the hash index of candidate, according to these hash indexs from The face feature vector of the corresponding storage of all hash indexs is obtained in face database, these face feature vectors just form time Selected works.
In step S6, using the Hash characteristic vector obtained in step S5 as key name, key corresponding to key name in Redis is inquired about Value, can obtain candidate feature vector, establish process according to face database in step 4, stored in each hash index The Id of people is corresponded in the sub-key name of characteristic vector containing characteristic vector, according to id and corresponding real-valued vector, is inquired about successively The hash index obtained in Redis in all steps 5, characteristic vector of the obtained all subkeys to one map structure of composition Candidate Set, described map structures such as following table:
Id Characteristic vector
Id1_face_feature_0 Id1 corresponds to the real-valued of the 1st photo of people
Id2_face_feature_0 Id2 corresponds to the real-valued of the 1st photo of people
Id2_face_feature_1 Id2 corresponds to the real-valued of the 2nd photo of people
Step S7, calculate the real-valued vector and the Hamming distance of characteristic vector in Candidate Set of photo to be checked;
In the step, real-valued vector and each in Candidate Set of the face to be checked obtained in calculation procedure S5 The distance of characteristic vector, realization of the invention use Cosine as similarity measurement, but are not limited to Cosine measurements, also European measurement etc. can be used.When two vectorial Cosine distances are closer to 1, show that the two vectors are more similar.Will meter The key name and distance of the obtained each characteristic vector of foundation are stored in map structures, remain to handle in next step.
Step S8, according to vectorial in Candidate Set and vectorial Hamming distance to be checked, after subtracting threshold value, ballot obtains Each candidate ID fraction, using highest scoring person as face recognition result.
Obtain in face characteristic to be checked and Candidate Set after proprietary similarity score, due to possible in Candidate Set Everyone has a pictures incessantly, so need one ballot device of design to vote face ID, device of being voted in the present embodiment Design is as follows:
Wherein, score (id) is the final vote fraction of each face ID in Candidate Set, and sim is what is obtained in step S7 The real-valued vector and the distance of characteristic vector in Candidate Set of face to be checked, threshold are setting threshold value.It can see Go out when cosine distances are more than threshold value, people's score increase corresponding to the picture, otherwise corresponding to the branch that obtains of people reduces, ballot The maximum ID of fraction is final recognition result.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from On the premise of the principle of the invention, some improvements and modifications can also be made, these improvements and modifications are also considered as the protection of the present invention Within the scope of.The content not being described in detail in this specification belongs to prior art known to professional and technical personnel in the field.

Claims (9)

1. a kind of extensive face identification method for accelerating retrieval based on GPU, it is characterised in that this method comprises the following steps:
S1, picture to be detected inputted into MTCNN networks, using Face datection algorithm, detect the position of face and key in photo Point position, the face that alignment detection arrives;
S2, use the real-valued of human face photo and the photo mirror image after the deep learning model extraction step S1 processing trained Vector, then merge two real-valued vectors and real-valued of the dimensionality reduction as the face;
S3, the real-valued is converted into Hash feature;
S4, repeat step S1-S3 detect face to be measured one by one, are characterized as indexing using the Hash, real-valued vector conduct Value, establishes key assignments type face database;
S5, using more GPU Hash lookup algorithm is accelerated to obtain Hash features of the k with the Hash feature neighbour of picture to be detected;
S6, the k Hash feature obtained using in S5 are searched in the face database, obtained by k as index The Candidate Set of real-valued vector composition;
S7, the real-valued vector for calculating photo to be checked and real-valued vector in Candidate Set vector similitude measurement away from From;
S8, according to the vector similitude measurement of the vectorial vector with the real-valued of photo to be checked of real-valued in Candidate Set away from From ballot obtains the fraction of each photo to be checked, using highest scoring person as face recognition result.
2. accelerate the extensive face identification method of retrieval based on GPU as claimed in claim 1, it is characterised in that:The step Rapid S1 specifically includes following steps:
S101, picture to be detected inputted into MTCNN networks, use the first CNN to produce the position of face candidate collection window and its recurrence Coordinate is put, then merges the higher face window of degree of overlapping with non-maxima suppression algorithm, produces face window Candidate Set;
S102, the obtained results of step S101 are sent to twoth CNN more complicated than the first CNN, result refiltered and people The fine setting of face the window's position;
S103, the obtained results of step S102 are sent to threeth CNN more complicated than the 2nd CNN be finely adjusted, and generate each The coordinate of the position of final face window and five face key points in picture to be detected;
Final face window whether has been generated in S104, judgment step S103, if nothing, has terminated identification;If so, extract final face Video in window, and face correction is aligned to center, save as regulation resolution sizes.
3. accelerate the extensive face identification method of retrieval based on GPU as claimed in claim 1, it is characterised in that:
Use the real-valued of face feature extraction network extraction human face photo and photo mirror image vector;
Face characteristic extraction network be 32 layer depth convolutional neural networks, including convolutional layer, down-sampled layer, PRelu are activated Layer, full articulamentum and loss function layer.
4. accelerate the extensive face identification method of retrieval based on GPU as claimed in claim 3, it is characterised in that:The damage Losing function layer includes two loss functions of softmax-loss and center-loss, and the softmax-loss loss functions are used In improving sample extent of polymerization in class after network mapping in feature space;The center-loss loss functions are used for Increase between class distance of the sample after network mapping in feature space.
5. accelerate the extensive face identification method of retrieval based on GPU as claimed in claim 1, it is characterised in that:The step In rapid S2, as follows after fusion steps S1 processing the human face photo real-valued vector sum photo mirror image real-valued to Amount:
fi=max (xi, yi) i=1,2 ..., n
Wherein, xiAnd yiIt is vector x to be fused respectively, y i-th dimension, n is the dimension of real-valued vector, fiFor the reality after fusion The i-th dimension of value tag vector.
6. accelerate the extensive face identification method of retrieval based on GPU as claimed in claim 1, it is characterised in that:The step In rapid S3, the face real-valued obtained in step S2 is converted into Hash feature as follows:
F (x)=0.5 × (sign (x)+1)
Wherein,
7. accelerate the extensive face identification method of retrieval based on GPU as claimed in claim 1, it is characterised in that:The step In rapid S5, accelerate Hash lookup algorithm to obtain the Hash feature of k neighbour using more GPU and specifically include following steps:
S501, the data set for forming N number of Hash feature of whole, M parts are divided into according to the GPU numbers M being set using, each Part is no more than SUBN=(N+M-1)/M Hash feature, and all Hash features of the Sub Data Set after division are copied from main frame Shellfish equipment end corresponding to;
S502, computational threads number, the Chinese of parallel computation Hash codes to be checked and all Hash codes in data set are set to every piece of GPU Prescribed distance;
S503, all Hamming distances are divided into SUBN/K groups by data adjacent K for one group, it is parallel to perform, will be all The Hamming distance of SUBN/K groups is sorted using merger, is ordered as in group in order;
S504, find out successively array index [nK, (n+1) K) and [(n+1) K, (n+2) K) in K number minimum in Hamming distance According to, and move it into [nK, (n+1) K) position, wherein n=0,2,4 ..., every time relatively array index [nK, (n+1) K) in Maximum and array index [(n+1) K, (n+2) K) middle minimum value size, if [nK, (n+1) K) in maximum it is larger Then the two is exchanged;
S505, repeat step S503, S504, sort respectively [0, K), [2K, 3K), [4K, 5K) ..., will [0, K) and [2K, 3K) this 2K array is one group, K minimum Hamming distance before finding out, and move it into [0, K), the rest may be inferred, until all M blocks The preceding K Hamming distance of the upper packets of GPU be stored in [0, K) on position;
S506, M GPU result of calculation copied in main frame end memory, to all M*K Hamming distances, use most raft Sequence, M*K data are traveled through, obtain K Hamming distance minimum in M group data.
8. accelerate the extensive face identification method of retrieval based on GPU as claimed in claim 1, it is characterised in that:The step In rapid S7, using the real-valued vector of the face to be checked obtained in Cosine measurements or European metric calculation step S5 with waiting The distance of each real-valued vector in selected works.
9. accelerate the extensive face identification method of retrieval based on GPU as claimed in claim 1, it is characterised in that:The step In rapid S8, the ballot device formula used is as follows:
<mrow> <mi>s</mi> <mi>o</mi> <mi>c</mi> <mi>r</mi> <mi>e</mi> <mrow> <mo>(</mo> <mi>i</mi> <mi>d</mi> <mo>)</mo> </mrow> <mo>=</mo> <mi>s</mi> <mi>c</mi> <mi>o</mi> <mi>r</mi> <mi>e</mi> <mrow> <mo>(</mo> <mi>i</mi> <mi>d</mi> <mo>)</mo> </mrow> <mo>+</mo> <mfenced open = "{" close = "}"> <mtable> <mtr> <mtd> <mrow> <mi>s</mi> <mi>i</mi> <mi>m</mi> <mo>-</mo> <mi>t</mi> <mi>h</mi> <mi>r</mi> <mi>e</mi> <mi>s</mi> <mi>h</mi> <mi>o</mi> <mi>l</mi> <mi>d</mi> </mrow> </mtd> <mtd> <mrow> <mi>i</mi> <mi>f</mi> <mi> </mi> <mi>s</mi> <mi>i</mi> <mi>m</mi> <mo>&gt;</mo> <mi>t</mi> <mi>h</mi> <mi>r</mi> <mi>e</mi> <mi>s</mi> <mi>h</mi> <mi>o</mi> <mi>l</mi> <mi>d</mi> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mn>0.3</mn> <mo>*</mo> <mrow> <mo>(</mo> <mi>s</mi> <mi>i</mi> <mi>m</mi> <mo>-</mo> <mi>t</mi> <mi>h</mi> <mi>r</mi> <mi>e</mi> <mi>s</mi> <mi>h</mi> <mi>o</mi> <mi>l</mi> <mi>d</mi> <mo>)</mo> </mrow> </mrow> </mtd> <mtd> <mrow> <mi>o</mi> <mi>t</mi> <mi>h</mi> <mi>e</mi> <mi>r</mi> <mi>w</mi> <mi>i</mi> <mi>s</mi> <mi>e</mi> </mrow> </mtd> </mtr> </mtable> </mfenced> </mrow>
Wherein, score (id) is the final vote fraction of each face ID in Candidate Set, and sim is to be checked to be obtained in step S7 The distance of the real-valued vector and real-valued vector in Candidate Set of face is ask, threshold is to set threshold value.
CN201710675398.2A 2017-08-09 2017-08-09 Large-scale face recognition method based on GPU (graphics processing Unit) accelerated retrieval Active CN107577990B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710675398.2A CN107577990B (en) 2017-08-09 2017-08-09 Large-scale face recognition method based on GPU (graphics processing Unit) accelerated retrieval

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710675398.2A CN107577990B (en) 2017-08-09 2017-08-09 Large-scale face recognition method based on GPU (graphics processing Unit) accelerated retrieval

Publications (2)

Publication Number Publication Date
CN107577990A true CN107577990A (en) 2018-01-12
CN107577990B CN107577990B (en) 2020-02-18

Family

ID=61034399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710675398.2A Active CN107577990B (en) 2017-08-09 2017-08-09 Large-scale face recognition method based on GPU (graphics processing Unit) accelerated retrieval

Country Status (1)

Country Link
CN (1) CN107577990B (en)

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920720A (en) * 2018-07-30 2018-11-30 电子科技大学 The large-scale image search method accelerated based on depth Hash and GPU
CN108921065A (en) * 2018-06-21 2018-11-30 北京陌上花科技有限公司 The method and apparatus for establishing property data base
CN109034119A (en) * 2018-08-27 2018-12-18 苏州广目信息技术有限公司 A kind of method for detecting human face of the full convolutional neural networks based on optimization
CN109062942A (en) * 2018-06-21 2018-12-21 北京陌上花科技有限公司 Data query method and apparatus
CN109241325A (en) * 2018-09-11 2019-01-18 武汉魅瞳科技有限公司 A kind of extensive face retrieval method and apparatus based on depth characteristic
CN109783692A (en) * 2019-01-08 2019-05-21 深圳英飞拓科技股份有限公司 The target signature code comparison method and device that a kind of fast data and slow data combine
CN110059644A (en) * 2019-04-23 2019-07-26 杭州智趣智能信息技术有限公司 A kind of biopsy method based on facial image, system and associated component
CN110110125A (en) * 2019-04-28 2019-08-09 重庆学析优科技有限公司 A kind of quick accurately picture searching matching process and system
CN110110113A (en) * 2019-05-20 2019-08-09 重庆紫光华山智安科技有限公司 Image search method, system and electronic device
CN110263603A (en) * 2018-05-14 2019-09-20 桂林远望智能通信科技有限公司 Face identification method and device based on center loss and residual error visual simulation network
CN110390344A (en) * 2018-04-19 2019-10-29 华为技术有限公司 Alternative frame update method and device
CN110503127A (en) * 2018-05-17 2019-11-26 国际商业机器公司 The acceleration of convolutional neural networks on analog array
CN110647722A (en) * 2019-09-20 2020-01-03 北京中科寒武纪科技有限公司 Data processing method and device and related product
CN110659290A (en) * 2019-09-20 2020-01-07 北京中科寒武纪科技有限公司 Data processing method and device and related product
CN110879984A (en) * 2019-11-18 2020-03-13 上海眼控科技股份有限公司 Face comparison method and device
CN111310732A (en) * 2020-03-19 2020-06-19 广东宜教通教育有限公司 High-precision face authentication method, system, computer equipment and storage medium
CN111382287A (en) * 2018-12-30 2020-07-07 浙江宇视科技有限公司 Picture searching method and device, storage medium and electronic equipment
CN112000845A (en) * 2020-08-19 2020-11-27 东北大学 Hyperspatial hash indexing method based on GPU acceleration
CN112215183A (en) * 2020-10-21 2021-01-12 中国银行股份有限公司 Bank customer identification method and device
CN112434678A (en) * 2021-01-27 2021-03-02 成都无糖信息技术有限公司 Face measurement feature space searching system and method based on artificial neural network
CN112527855A (en) * 2020-09-23 2021-03-19 碧桂园生活服务集团股份有限公司 Face vector fast comparison technology
CN112685580A (en) * 2020-12-25 2021-04-20 公安部第三研究所 Social network head portrait comparison distributed detection system, method and device based on deep learning, processor and storage medium thereof
CN112907810A (en) * 2021-04-02 2021-06-04 吉林大学 Face recognition temperature measurement campus access control system based on embedded GPU
CN113254686A (en) * 2021-04-02 2021-08-13 青岛以萨数据技术有限公司 Personnel behavior detection method, device and storage medium
CN113469350A (en) * 2021-07-07 2021-10-01 武汉魅瞳科技有限公司 Deep convolutional neural network acceleration method and system suitable for NPU
CN113516002A (en) * 2021-03-05 2021-10-19 武汉特斯联智能工程有限公司 Face recognition method and device based on face recognition model and applying smart community
CN114048344A (en) * 2021-11-25 2022-02-15 天翼数字生活科技有限公司 Similar face searching method, device, equipment and readable storage medium
CN114064948A (en) * 2021-10-15 2022-02-18 西安深信科创信息技术有限公司 Hash image retrieval method and device based on generalized average pooling strategy

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6691126B1 (en) * 2000-06-14 2004-02-10 International Business Machines Corporation Method and apparatus for locating multi-region objects in an image or video database
CN102521366A (en) * 2011-12-16 2012-06-27 华中科技大学 Image retrieval method integrating classification with hash partitioning and image retrieval system utilizing same
CN106599830A (en) * 2016-12-09 2017-04-26 中国科学院自动化研究所 Method and apparatus for positioning face key points

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6691126B1 (en) * 2000-06-14 2004-02-10 International Business Machines Corporation Method and apparatus for locating multi-region objects in an image or video database
CN102521366A (en) * 2011-12-16 2012-06-27 华中科技大学 Image retrieval method integrating classification with hash partitioning and image retrieval system utilizing same
CN106599830A (en) * 2016-12-09 2017-04-26 中国科学院自动化研究所 Method and apparatus for positioning face key points

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
DONG WANG ETC.: ""FaceHunter:A multi-task convolutional neural network based face detector"", 《SIGNAL PROCESSING:IMAGE COMMUNICATION》 *
倪康康: ""基于哈希算法的图像检索系统"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
陈伟平: ""图像相似性计算及其GPU加速的若干研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110390344A (en) * 2018-04-19 2019-10-29 华为技术有限公司 Alternative frame update method and device
CN110263603A (en) * 2018-05-14 2019-09-20 桂林远望智能通信科技有限公司 Face identification method and device based on center loss and residual error visual simulation network
CN110263603B (en) * 2018-05-14 2021-08-06 桂林远望智能通信科技有限公司 Face recognition method and device based on central loss and residual error visual simulation network
CN110503127B (en) * 2018-05-17 2023-05-30 国际商业机器公司 Acceleration of convolutional neural networks on analog arrays
CN110503127A (en) * 2018-05-17 2019-11-26 国际商业机器公司 The acceleration of convolutional neural networks on analog array
CN108921065A (en) * 2018-06-21 2018-11-30 北京陌上花科技有限公司 The method and apparatus for establishing property data base
CN109062942A (en) * 2018-06-21 2018-12-21 北京陌上花科技有限公司 Data query method and apparatus
CN108920720A (en) * 2018-07-30 2018-11-30 电子科技大学 The large-scale image search method accelerated based on depth Hash and GPU
CN109034119A (en) * 2018-08-27 2018-12-18 苏州广目信息技术有限公司 A kind of method for detecting human face of the full convolutional neural networks based on optimization
CN109241325B (en) * 2018-09-11 2020-12-08 武汉魅瞳科技有限公司 Large-scale face retrieval method and device based on depth features
CN109241325A (en) * 2018-09-11 2019-01-18 武汉魅瞳科技有限公司 A kind of extensive face retrieval method and apparatus based on depth characteristic
CN111382287A (en) * 2018-12-30 2020-07-07 浙江宇视科技有限公司 Picture searching method and device, storage medium and electronic equipment
CN109783692A (en) * 2019-01-08 2019-05-21 深圳英飞拓科技股份有限公司 The target signature code comparison method and device that a kind of fast data and slow data combine
CN109783692B (en) * 2019-01-08 2021-12-31 深圳英飞拓科技股份有限公司 Target feature code comparison method and device combining fast data with slow data
CN110059644A (en) * 2019-04-23 2019-07-26 杭州智趣智能信息技术有限公司 A kind of biopsy method based on facial image, system and associated component
CN110110125A (en) * 2019-04-28 2019-08-09 重庆学析优科技有限公司 A kind of quick accurately picture searching matching process and system
CN110110113A (en) * 2019-05-20 2019-08-09 重庆紫光华山智安科技有限公司 Image search method, system and electronic device
CN110659290A (en) * 2019-09-20 2020-01-07 北京中科寒武纪科技有限公司 Data processing method and device and related product
CN110647722B (en) * 2019-09-20 2024-03-01 中科寒武纪科技股份有限公司 Data processing method and device and related products
CN110659290B (en) * 2019-09-20 2021-06-11 中科寒武纪科技股份有限公司 Data processing method and device and related product
CN110647722A (en) * 2019-09-20 2020-01-03 北京中科寒武纪科技有限公司 Data processing method and device and related product
CN110879984A (en) * 2019-11-18 2020-03-13 上海眼控科技股份有限公司 Face comparison method and device
CN111310732A (en) * 2020-03-19 2020-06-19 广东宜教通教育有限公司 High-precision face authentication method, system, computer equipment and storage medium
CN112000845A (en) * 2020-08-19 2020-11-27 东北大学 Hyperspatial hash indexing method based on GPU acceleration
CN112000845B (en) * 2020-08-19 2021-07-20 东北大学 Hyperspatial hash indexing method based on GPU acceleration
CN112527855B (en) * 2020-09-23 2024-05-03 广东协城信息科技有限公司 Face vector quick comparison technology
CN112527855A (en) * 2020-09-23 2021-03-19 碧桂园生活服务集团股份有限公司 Face vector fast comparison technology
CN112215183A (en) * 2020-10-21 2021-01-12 中国银行股份有限公司 Bank customer identification method and device
CN112685580A (en) * 2020-12-25 2021-04-20 公安部第三研究所 Social network head portrait comparison distributed detection system, method and device based on deep learning, processor and storage medium thereof
CN112434678A (en) * 2021-01-27 2021-03-02 成都无糖信息技术有限公司 Face measurement feature space searching system and method based on artificial neural network
CN113516002A (en) * 2021-03-05 2021-10-19 武汉特斯联智能工程有限公司 Face recognition method and device based on face recognition model and applying smart community
CN113254686A (en) * 2021-04-02 2021-08-13 青岛以萨数据技术有限公司 Personnel behavior detection method, device and storage medium
CN113254686B (en) * 2021-04-02 2023-08-01 青岛以萨数据技术有限公司 Personnel behavior detection method, device and storage medium
CN112907810A (en) * 2021-04-02 2021-06-04 吉林大学 Face recognition temperature measurement campus access control system based on embedded GPU
CN113469350B (en) * 2021-07-07 2023-03-24 武汉魅瞳科技有限公司 Deep convolutional neural network acceleration method and system suitable for NPU
CN113469350A (en) * 2021-07-07 2021-10-01 武汉魅瞳科技有限公司 Deep convolutional neural network acceleration method and system suitable for NPU
CN114064948A (en) * 2021-10-15 2022-02-18 西安深信科创信息技术有限公司 Hash image retrieval method and device based on generalized average pooling strategy
CN114048344A (en) * 2021-11-25 2022-02-15 天翼数字生活科技有限公司 Similar face searching method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN107577990B (en) 2020-02-18

Similar Documents

Publication Publication Date Title
CN107577990A (en) A kind of extensive face identification method for accelerating retrieval based on GPU
CN110532920B (en) Face recognition method for small-quantity data set based on FaceNet method
Leng et al. 3D object retrieval with stacked local convolutional autoencoder
Lin et al. Masked face detection via a modified LeNet
CN110287952A (en) A kind of recognition methods and system for tieing up sonagram piece character
CN112183435A (en) Two-stage hand target detection method
CN113032613B (en) Three-dimensional model retrieval method based on interactive attention convolution neural network
CN115830637B (en) Method for re-identifying blocked pedestrians based on attitude estimation and background suppression
CN105843925A (en) Similar image searching method based on improvement of BOW algorithm
Zhang et al. Rotation-invariant feature learning for object detection in VHR optical remote sensing images by double-net
Xia et al. Trademark image retrieval via transformation-invariant deep hashing
Wu et al. Research on individual recognition and matching of whale and dolphin based on efficientnet model
CN107644203A (en) A kind of feature point detecting method of form adaptive classification
CN110503090A (en) Character machining network training method, character detection method and character machining device based on limited attention model
Liu et al. A novel fingerprint matching algorithm using minutiae phase difference feature
CN112598055B (en) Helmet wearing detection method, computer-readable storage medium and electronic device
Zhang et al. UT-ATD: Universal Transformer for Anomalous Trajectory Detection by Embedding Trajectory Information.
CN115050044A (en) Cross-modal pedestrian re-identification method based on MLP-Mixer
Zhang et al. Object detection of VisDrone by stronger feature extraction FasterRCNN
Visalatchi et al. Intelligent Vision with TensorFlow using Neural Network Algorithms
Wu et al. Visual loop closure detection by matching binary visual features using locality sensitive hashing
Wang et al. From coarse to fine: multi-level feature fusion network for fine-grained image retrieval
Zhang Similarity image retrieval model based on local feature fusion and deep metric learning
Chu et al. EfficientFCOS: An efficient one-stage object detection model based on FCOS
Cao et al. Improved YOLOv3 model based on ResNeXt for target detection

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
GR01 Patent grant
GR01 Patent grant