CN114445879A - High-precision face recognition method and face recognition equipment - Google Patents
High-precision face recognition method and face recognition equipment Download PDFInfo
- Publication number
- CN114445879A CN114445879A CN202111659059.8A CN202111659059A CN114445879A CN 114445879 A CN114445879 A CN 114445879A CN 202111659059 A CN202111659059 A CN 202111659059A CN 114445879 A CN114445879 A CN 114445879A
- Authority
- CN
- China
- Prior art keywords
- face
- image
- model
- recognition
- determining
- 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
Images
Landscapes
- Image Analysis (AREA)
- Collating Specific Patterns (AREA)
Abstract
The invention provides a high-precision face recognition method and face recognition equipment, wherein the method comprises the following steps: step 1: acquiring a target image based on a camera, reading the target image, determining a face range in the target image, and delineating the face range to output a face image; step 2: determining a face recognition model, inputting the face image into the face recognition model for face recognition, and outputting a recognition parameter; and step 3: and matching the identification parameters in a preset identity database to determine the identity information of the face. The method has the advantages that the target image is collected through the camera and is identified, so that the face is determined, the face image is accurately obtained, meanwhile, the face image is identified in the face identification model, the identity information of the face is accurately determined, the accuracy of obtaining the face image is improved, and the face identity information obtaining efficiency is improved.
Description
Technical Field
The invention relates to the technical field of face recognition, in particular to a high-precision face recognition method and face recognition equipment.
Background
At present, with the advancement of science and technology, face recognition is applied in many fields of life, for example, attendance checking and card punching during work, access control systems and the like all use face recognition,
however, the existing face recognition still has great inaccuracy, if people with similar growth have identification errors, great error is added to the face recognition, and the expansion of actions is not facilitated, so that the invention provides a high-precision face recognition method and a face recognition device in order to improve the accuracy of obtaining face images and the efficiency of obtaining face identity information.
Disclosure of Invention
The invention provides a high-precision face recognition method and face recognition equipment, which are used for acquiring a target image through a camera and recognizing the target image so as to determine a face, accurately acquire a face image of the face and simultaneously recognize the face image in a face recognition model so as to accurately determine identity information of the face.
The invention provides a high-precision face recognition method, which comprises the following steps:
step 1: acquiring a target image based on a camera, reading the target image, determining a face range in the target image, and delineating the face range to output a face image;
step 2: determining a face recognition model, inputting the face image into the face recognition model for face recognition, and outputting a recognition result;
and step 3: and matching the recognition result in a preset identity database to determine the identity information of the face.
Preferably, in step 1, the specific working process of reading the target image and determining the face range in the target image includes:
graying the target image, acquiring a grayscale image, reading the grayscale image, and determining pixel points of the grayscale image;
extracting the characteristics of the pixels of the gray level image, and determining the distribution characteristics of the pixels with the same characteristics in the gray level image;
comparing the target image with the gray image, determining the contour range of the human face in the gray image based on the distribution characteristics of the pixel points with the same type of characteristics in the gray image, and determining the pixel points of the human face contour;
and marking the face contour pixel points, and determining the face range in the target image based on the marking result.
Preferably, in step 1, a specific working process of delineating the face range and outputting a face image includes:
acquiring edge point information of the face range, and determining the sharpening degree of the face range boundary based on the edge point information of the face range;
edge sharpening is carried out on the boundary of the face range according to the sharpening degree, and the target image with the sharpened edge of the face range is input into a preset segmentation model;
determining the target image segmentation points in the preset segmentation model, and segmenting the target image in the preset segmentation model based on the segmentation points;
and generating the face image based on the segmentation result.
Preferably, the high-precision face recognition method, after generating the face image based on the segmentation result, further includes:
carrying out image analysis on the face image to determine the color value and the brightness value of the face image;
performing image quality evaluation on the facial image based on the color value and the brightness value, and acquiring an evaluation score;
comparing the evaluation score with a preset evaluation score, and judging whether the facial image needs image optimization processing;
when the evaluation score is equal to or larger than the preset evaluation score, judging that the face image does not need to be subjected to image optimization processing;
otherwise, judging that the face image needs to be subjected to image optimization processing;
when the face image needs to be subjected to image optimization processing, generating a first optimization index parameter according to the color value and a reference color value, and simultaneously generating a second optimization index parameter according to the brightness value and a reference brightness value;
and optimizing the face image in a preset optimization algorithm based on the first optimization index parameter and the second optimization index parameter.
Preferably, in step 2, a specific working process of determining a face recognition model, inputting the face image into the face recognition model for face recognition, and outputting a recognition result includes:
acquiring a face image of a target group, performing first learning on the face image of the target group in a preset convolutional neural network, and determining the face characteristics of the face image of the target group based on a first learning result;
and performing secondary learning on the face features in the preset convolutional neural network, and outputting a second learning result, wherein the second learning result comprises: similar feature points of the face features and difference feature points of the face features;
acquiring similar characteristic parameters corresponding to the similar characteristic points of the human face characteristics, and taking the similar characteristic parameters as first model parameters;
acquiring difference characteristic parameters corresponding to the difference characteristic points of the human face characteristics, adding difference labels to the difference characteristic parameters respectively, and taking the difference characteristic parameters added with the difference labels as second model parameters;
constructing a face recognition model based on the first model parameters and the second model parameters;
inputting the face image into the face recognition model for recognition to obtain recognition parameters, performing parameter matching on the recognition parameters in the face recognition model, and judging whether the recognition is successful or not based on a matching result;
when the identification parameters are matched with corresponding target parameters in the face identification model, judging that the face image identification is successful;
when the identification parameters are not matched with corresponding target parameters in the face identification model, judging that the face image is not successfully identified, recording the face image, and inputting the face image into the preset convolutional neural network for third learning;
and updating the model in the face recognition model based on the third learning result and the recognition parameters.
Preferably, in step 1, the working process of acquiring a target image based on a camera includes:
acquiring the shooting position of the camera, and determining the shooting range of the camera based on the shooting position, wherein the shooting range comprises: an upper and lower shooting range, a left and right shooting range;
determining the shooting height ratio of the camera according to the upper and lower shooting ranges, and estimating the target height range of the person shot by the camera based on the shooting height ratio of the camera;
comparing the target height range with a preset reference height range, and judging whether the shooting position of the camera needs to be adjusted or not;
when the target height range is equal to or larger than the preset reference height range, the shooting position of the camera does not need to be adjusted;
otherwise, judging that the shooting position of the camera needs to be adjusted, and determining a first adjustment strategy of the camera based on the difference value between the target height range and the preset reference height range;
determining the shooting width ratio of the camera based on the left and right shooting ranges, and determining the number of people shot by the camera based on the width shooting ratio of the camera;
when the number of people shot by the camera is less than 1 or equal to or greater than 2, determining a second adjustment strategy of the camera based on the width ratio of the camera;
and carrying out shooting adjustment on the camera based on the first adjustment strategy and the second adjustment strategy.
Preferably, in step 3, the specific process of matching the recognition result in a preset identity database to determine the face identity information includes:
reading the recognition result, determining the face data of the target user corresponding to the face image, and extracting the data identification of the face data;
inputting the face data into the preset identity database, and performing data matching in the identity database based on the data identification of the face data;
acquiring an identity file consistent with the data identification in the preset identity database based on a matching result;
and reading the identity file, and extracting the identity information of the target user corresponding to the face image.
Preferably, in step 2, the method for recognizing a high-precision face includes inputting the face image into the face recognition model for face recognition, and further includes:
acquiring an n-dimensional space vector A ═ a (a) of a face to be recognized corresponding to the face image1,a2,...an) And simultaneously extracting n-dimensional space vector B ═ (B) of the model face in the face recognition model1,b2,...bn);
Based on the n-dimensional space vector A ═ (a) of the face to be recognized1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn) Calculating the n-dimensional space of the face to be recognizedAn intervector A ═ a1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn) Euclidean distance and cosine distance of (d);
wherein, δ represents the Euclidean distance between the space vector of the face to be recognized and the space vector of the model face; cos theta represents the cosine distance between the space vector of the user face to be recognized and the space vector of the model face; mu.s1The first error factor is represented, and the value range is (0.23, 0.34); i denotes the current component, a1,a2,...anRepresenting the components of an n-dimensional space vector of a face to be recognized; b1,b2,...bnA component of a spatial vector representing a model face; n represents a dimension; mu.s2The second error factor is represented, and the value range is (0.26, 0.39);
based on the n-dimensional space vector A ═ (a) of the face of the user to be recognized1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn) Calculating the similarity between the target user face and the model face according to the Euclidean distance and the cosine distance;
wherein gamma represents the similarity between the face to be recognized and the model face;
comparing the similarity between the face to be recognized and the model face with a preset similarity, and judging whether the face to be recognized and the model face are the same person or not, wherein the similarity between the face to be recognized and the model face is smaller than or equal to the preset similarity;
when the similarity between the face to be recognized and the model face is equal to the preset similarity, judging that the face to be recognized and the model face are the same person, and successfully recognizing the face;
and when the similarity between the face to be recognized and the model face is smaller than the preset similarity, judging that the face to be recognized and the model face are not the same person, and determining that the face recognition is unsuccessful.
Preferably, the face data is distinguished by face blocks to obtain a plurality of face blocks, a block matrix of each face block is constructed, and a feature vector of each block matrix is extracted;
matching feature vectors for each face block based on the preset identity database,
judging whether special vectors exist in the feature vectors;
if the special vector exists, matching a first sub-library related to the special vector based on the preset identity database, and performing matching identification on the special vector based on the first sub-library;
if not, sorting the identification degrees of all the feature vectors;
wherein n1 represents the vector dimension involved in each feature vector, and M represents the total vector dimension corresponding to the standard face; oc represents a face feature weight corresponding to each feature vector; c1 denotes the actual set of elements of the corresponding feature vector; c2 denotes a set of normal elements corresponding to the normal vector; n represents the number of elements in the actual element set; ()doRepresenting the number of elements in the corresponding intersection set of C1 and C2;
according to the sequencing result, matching and identifying with the corresponding face sub-library in sequence;
and acquiring a matching identification result and using the matching identification result as auxiliary information for acquiring the corresponding identity file.
The invention relates to a face recognition device, comprising:
the identification module is used for acquiring a target image based on a camera, reading the target image, determining a face range in the target image, and delineating the face range to output a face image;
the first determining module is used for determining a face recognition model, inputting the face image into the face recognition model for face recognition and outputting a recognition result;
and the second determining module is used for matching the recognition result in a preset identity database to determine the identity information of the face.
Preferably, the camera includes:
the triggering unit is used for sending a first control instruction to the control unit when sensing objects appear in the target area, controlling the first acquisition unit and acquiring the sensing objects;
the control unit is also used for carrying out overall definition recognition on the acquired image of the induction object, judging whether the program problem is a fault or not if the acquired image is not clear, and controlling an alarm unit arranged on one side of the acquisition unit to give a first alarm if the acquired image is not clear;
otherwise, judging whether the surface of the acquisition body of the first acquisition unit is fuzzy or not, controlling a second acquisition unit to acquire the surface of the corresponding acquisition body, and controlling the alarm unit to give a second alarm if the surface of the acquisition body is determined to be fuzzy;
the second acquisition unit and the first acquisition unit are arranged at corresponding positions, and the control unit is connected with the trigger unit, the first acquisition unit, the second acquisition unit and the alarm unit.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of a high-precision face recognition method according to an embodiment of the present invention;
FIG. 2 is a flowchart of step 1 in a high-precision face recognition method according to an embodiment of the present invention;
FIG. 3 is a flowchart of step 3 in a high-precision face recognition method according to an embodiment of the present invention;
FIG. 4 is a block diagram of a face recognition device in an embodiment of the present invention;
fig. 5 is a structural diagram of a camera in the embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Example 1:
the embodiment provides a high-precision face recognition method, as shown in fig. 1, including:
step 1: acquiring a target image based on a camera, reading the target image, determining a face range in the target image, and delineating the face range to output a face image;
step 2: determining a face recognition model, inputting the face image into the face recognition model for face recognition, and outputting a recognition result;
and 3, step 3: and matching the recognition result in a preset identity database to determine the identity information of the face.
In this embodiment, the target image may be an image acquired based on a shooting range of the camera.
In this embodiment, the face recognition model may be a face recognition model obtained by extracting face samples and performing training.
In this embodiment, the preset identity database may be set in advance and is provided with all the identity databases recorded with face recognition.
In this embodiment, the recognition result may be the contour, size, dimension, eye distance, eyebrow, nose, mouth, and other characteristic parameters of the face parameters, and the specific face appearance.
The beneficial effects of the above technical scheme are: the method has the advantages that the target image is collected through the camera and is identified, so that the face is determined, the face image is accurately obtained, meanwhile, the face image is identified in the face identification model, the identity information of the face is accurately determined, the accuracy of obtaining the face image is improved, and the face identity information obtaining efficiency is improved.
Example 2:
on the basis of embodiment 1, this embodiment provides a high-precision face recognition method, which is characterized in that, as shown in fig. 2, in step 1, a specific working process of reading the target image and determining a face range in the target image includes:
step 101: graying the target image, acquiring a grayscale image, reading the grayscale image, and determining pixel points of the grayscale image;
step 102: extracting the characteristics of the pixels of the gray level image, and determining the distribution characteristics of the pixels with the same characteristics in the gray level image;
step 103: comparing the target image with the gray image, determining the contour range of the face in the gray image based on the distribution characteristics of pixel points with the same type of characteristics in the gray image, and determining the face contour pixel points;
step 104: and marking the face contour pixel points, and determining the face range in the target image based on the marking result.
In this embodiment, the grayscale image may be based on an image obtained after graying the target image.
In this embodiment, the features of the pixels may be, for example, shadow pixels, black pixels, white pixels, and the like that represent the human face contour in the grayscale image.
In this embodiment, the distribution characteristics of the pixels with the same type of characteristics in the grayscale image, for example, the distribution range of the pixels representing the face contour in the grayscale image, is the distribution characteristics of the pixels with the same type of characteristics in the grayscale image.
The beneficial effects of the above technical scheme are: the method has the advantages that the gray processing of the target image is favorable for determining the characteristics of the pixel points in the gray image, so that the distribution characteristics of the pixel points of the same type in the gray image are accurately obtained, the outline of the face is further determined, and the face range is accurately determined by marking.
Example 3:
on the basis of embodiment 1, this embodiment provides a high-precision face recognition method, and in step 1, a specific working process of delineating the face range and outputting a face image includes:
acquiring edge point information of the face range, and determining the sharpening degree of the face range boundary based on the edge point information of the face range;
edge sharpening is carried out on the boundary of the face range according to the sharpening degree, and the target image with the sharpened edge of the face range is input into a preset segmentation model;
determining the target image segmentation points in the preset segmentation model, and segmenting the target image in the preset segmentation model based on the segmentation points;
and generating the face image based on the segmentation result.
In this embodiment, the edge point information may be pixel point information of the boundary of the face range, the contrast of edge color, and the like.
In this embodiment, the preset segmentation model may be a model set in advance and used for analyzing the target image.
In this embodiment, the image segmentation point is a boundary point of the face range of the target image.
In this embodiment, the edge sharpening is performed on the boundary of the face range to compensate the contour of the face range, and the edge of the face range is enhanced.
The beneficial effects of the above technical scheme are: the edge of the boundary of the target range is sharpened, so that the edge of the face range is enhanced, the determination of segmentation points of the target image in a preset segmentation model is facilitated, the target image is segmented, the face image is accurately acquired, and the accuracy of face identification is improved.
Example 4:
on the basis of embodiment 3, this embodiment provides a high-precision face recognition method, which further includes, after generating the face image based on a segmentation result:
carrying out image analysis on the face image to determine the color value and the brightness value of the face image;
performing image quality evaluation on the facial image based on the color value and the brightness value, and acquiring an evaluation score;
comparing the evaluation score with a preset evaluation score, and judging whether the facial image needs image optimization processing;
when the evaluation score is equal to or larger than the preset evaluation score, judging that the face image does not need to be subjected to image optimization processing;
otherwise, judging that the face image needs to be subjected to image optimization processing;
when the face image needs to be subjected to image optimization processing, generating a first optimization index parameter according to the color value and a reference color value, and simultaneously generating a second optimization index parameter according to the brightness value and a reference brightness value;
and optimizing the face image in a preset optimization algorithm based on the first optimization index parameter and the second optimization index parameter.
In this embodiment, the evaluation score may be a score determined by performing comprehensive evaluation based on the color value and the luminance value of the acquired face image.
In this embodiment, the preset evaluation score may be a reference score for determining whether the face image needs to be optimized, where when the face image reaches the preset evaluation score, the face image may be used for normal face recognition, and when the face image does not reach the preset evaluation score, the face image may affect the face recognition due to poor chroma or brightness.
In this embodiment, the preset optimization algorithm may be an algorithm for performing image filtering, image color adjustment and optimization on the image, and image brightness adjustment and optimization.
In this embodiment, the first optimization index parameter may be an optimization index parameter formed by a difference between a color value and a reference color value, the parameter being determined to optimize colors of the face image, wherein the reference color value may be an image color value that normally identifies a face.
In this embodiment, the second optimization index parameter may be an optimization index parameter formed by a difference between a luminance value and a reference luminance value, which is a parameter determined to optimize the luminance of the face image of the human face, wherein the reference luminance value may be an image luminance value at which the human face is normally recognized.
The beneficial effects of the above technical scheme are: the brightness value and the color value of the face image are obtained and evaluated to obtain the evaluation value, so that whether the face image needs to be optimized or not is determined, when the face image needs to be optimized, the face image is accurately optimized through the first optimization index parameter and the second optimization index parameter, and the efficiency of recognizing the face is greatly improved.
Example 5:
on the basis of embodiment 1, this embodiment provides a high-precision face recognition method, and in step 2, a specific working process of determining a face recognition model, inputting the face image into the face recognition model for face recognition, and outputting a recognition result includes:
acquiring a face image of a target group, performing first learning on the face image of the target group in a preset convolutional neural network, and determining the face characteristics of the face image of the target group based on a first learning result;
and performing secondary learning on the face features in the preset convolutional neural network, and outputting a second learning result, wherein the second learning result comprises: similar feature points of the face features and difference feature points of the face features;
acquiring similar characteristic parameters corresponding to the similar characteristic points of the human face characteristics, and taking the similar characteristic parameters as first model parameters;
acquiring difference characteristic parameters corresponding to the difference characteristic points of the human face characteristics, adding difference labels to the difference characteristic parameters respectively, and taking the difference characteristic parameters added with the difference labels as second model parameters;
constructing a face recognition model based on the first model parameters and the second model parameters;
inputting the face image into the face recognition model for recognition to obtain recognition parameters, performing parameter matching on the recognition parameters in the face recognition model, and judging whether the recognition is successful or not based on a matching result;
when the identification parameters are matched with corresponding target parameters in the face identification model, judging that the face image identification is successful;
when the identification parameters are not matched with corresponding target parameters in the face identification model, judging that the face image is not successfully identified, recording the face image, and inputting the face image into the preset convolutional neural network for third learning;
and updating the model in the face recognition model based on the third learning result and the recognition parameters.
In this embodiment, the target group refers to a company or a community of people who have face entry in advance.
In this embodiment, the preset convolutional neural network is set in advance, and is used for processing the face image and determining feature information in the face image.
In this embodiment, the facial features refer to information with distinctive features on the faces in the target group, such as the size of a mole and the position of the mole.
In this embodiment, the similar feature points refer to feature information that everyone in the target group has, for example, each person in the target group has five sense organs, but there is a little difference in the shape and position of the five sense organs.
In this embodiment, the difference feature points refer to two or more distinct features in the target population, for example, there are moles in some people and there are no moles in some people, and there is a difference in the position and number of moles.
In this embodiment, the difference label refers to a kind of label for distinguishing different characteristic information.
In this embodiment, the identification parameters refer to the size of a face, the type of the face, and the like obtained after the face image is identified by the face identification model.
In this embodiment, the target parameter refers to face data which is matched with the face recognition model and is input into the system in advance.
The beneficial effects of the above technical scheme are: the preset convolutional neural network is trained for many times by acquiring the face images of the target group, so that the face recognition model is accurately constructed, meanwhile, the current face image is monitored in real time according to the constructed face recognition model, the face image is recognized with high precision, and meanwhile, the current face recognition model is updated when the face image is not recognized, so that the identity information of the face is accurately determined.
Example 6:
on the basis of embodiment 1, this embodiment provides a high-precision face recognition method, and in step 1, a working process of acquiring a target image based on a camera includes:
acquiring the shooting position of the camera, and determining the shooting range of the camera based on the shooting position, wherein the shooting range comprises: an upper and lower shooting range, a left and right shooting range;
determining the shooting height ratio of the camera according to the upper and lower shooting ranges, and estimating the target height range of the person shot by the camera based on the shooting height ratio of the camera;
comparing the target height range with a preset reference height range, and judging whether the shooting position of the camera needs to be adjusted or not;
when the target height range is equal to or larger than the preset reference height range, the shooting position of the camera does not need to be adjusted;
otherwise, judging that the shooting position of the camera needs to be adjusted, and determining a first adjustment strategy of the camera based on the difference value between the target height range and the preset reference height range;
determining the shooting width ratio of the camera based on the left and right shooting ranges, and determining the number of people shot by the camera based on the width shooting ratio of the camera;
when the number of people shot by the camera is less than 1 or equal to or greater than 2, determining a second adjustment strategy of the camera based on the width ratio of the camera;
and carrying out shooting adjustment on the camera based on the first adjustment strategy and the second adjustment strategy.
In this embodiment, the upper and lower shooting ranges may be the length of the shooting range of the camera, and the left and right shooting ranges may be the width of the shooting range of the camera.
In this embodiment, the shooting height ratio, that is, the length of the shooting range of the camera can actually determine the height of the target person.
In this embodiment, the first adjustment strategy may be to adjust the camera up and down so as to determine that the target height range is adjusted to the preset reference height range.
In this embodiment, the preset reference height range may be a height range set in advance, and covers the height of a general population.
In this embodiment, the second adjustment strategy can be to the shooting of camera focus etc. adjust to only be fit for with one person's face to be favorable to improving the precision that the camera discerned the people face, and then improved discernment time and efficiency.
The beneficial effects of the above technical scheme are: thereby through the size of confirming target height scope and with predetermine benchmark height scope and carry out the comparison and whether the position of judging the camera accurately need adjust, and confirm first adjustment strategy when needs adjust, simultaneously, when only reducing the image of camera collection to a personage through the second strategy, thereby when having avoided appearing a plurality of personages in the camera simultaneously, and increase the discernment degree of difficulty, consequently, not only improved the degree of accuracy of camera face identification, but also saved the face identification time.
Example 7:
on the basis of embodiment 1, this embodiment provides a high-precision face recognition method, as shown in fig. 3, in step 3, a specific process of matching the recognition result in a preset identity database to determine face identity information includes:
step 301: reading the recognition result, determining the face data of the target user corresponding to the face image, and extracting the data identification of the face data;
step 302: inputting the face data into the preset identity database, and performing data matching in the identity database based on the data identification of the face data;
step 303: acquiring an identity file consistent with the data identification in the preset identity database based on a matching result;
step 304: and reading the identity file, and extracting the identity information of the target user corresponding to the face image.
In this embodiment, the data identification may be a data identification determined based on characteristics of the face data of the target user, for example, a data identification determined from contour data or the like of the face of the target user.
In this embodiment, the identity file may be a file containing identity information of the target user.
In this embodiment, the identity information of the target user may be information of the name, age, position, etc. of the target user.
The beneficial effects of the above technical scheme are: the identity file is determined by determining the data identification of the face data and matching in the preset identity database, so that the identity information of the target user is accurately acquired, and the accuracy of face recognition is improved.
Example 8:
on the basis of embodiment 1, this embodiment provides a high-precision face recognition method, and in step 2, the method includes inputting the face image into the face recognition model for face recognition, and further includes:
acquiring an n-dimensional space vector A ═ a (a) of a face to be recognized corresponding to the face image1,a2,...an) And simultaneously extracting n-dimensional space vector B ═ (B) of the model face in the face recognition model1,b2,...bn);
Based on the n-dimensional space vector A ═ (a) of the face to be recognized1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn) And calculating the n-dimensional space vector A ═ (a) of the face to be recognized1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn) Euclidean distance and cosine distance of (d);
wherein, δ represents the Euclidean distance between the space vector of the face to be recognized and the space vector of the model face; cos theta represents the cosine distance between the space vector of the user face to be recognized and the space vector of the model face; mu.s1The first error factor is represented, and the value range is (0.23, 0.34); i denotes the current component, a1,a2,...anRepresenting the components of an n-dimensional space vector of a face to be recognized; b1,b2,...bnComponents of a space vector representing a model face; n represents a dimension; mu.s2The second error factor is represented, and the value range is (0.26, 0.39);
based on the n-dimensional space vector A ═ (a) of the face of the user to be recognized1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn(the Euclidean distance and the cosine distance, and calculating the similarity between the target user face and the model face;
wherein gamma represents the similarity between the face to be recognized and the model face;
comparing the similarity between the face to be recognized and the model face with a preset similarity, and judging whether the face to be recognized and the model face are the same person or not, wherein the similarity between the face to be recognized and the model face is smaller than or equal to the preset similarity;
when the similarity between the face to be recognized and the model face is equal to the preset similarity, judging that the face to be recognized and the model face are the same person, and successfully recognizing the face;
and when the similarity between the face to be recognized and the model face is smaller than the preset similarity, judging that the face to be recognized and the model face are not the same person, and determining that the face recognition is unsuccessful.
In this embodiment, the first error factor may be an error factor existing when the euclidean distance between the spatial vector of the face to be recognized and the spatial vector of the model face is calculated, and the obtained euclidean distance may be more objective and accurate by calculating the first error factor.
In this embodiment, the second error factor may be an error factor existing when the cosine distance between the space vector of the face to be recognized and the space vector of the model face is calculated, and the obtained cosine distance may be more objective and accurate by calculating the second error factor.
In this embodiment, the preset similarity may be 1, the closer the similarity between the face to be recognized and the model face is to 1, the more similar the face to be recognized and the model face is, and when the similarity between the face to be recognized and the model face is 1, that is, equal to the preset similarity, it may be determined that the face of the user and the model face are the same person.
The beneficial effects of the above technical scheme are: the Euclidean distance and the cosine distance between the n-dimensional space vector of the face to be recognized and the n-dimensional space vector of the model face in the face recognition model are accurately calculated, so that the similarity between the face to be recognized and the model face is favorably and accurately calculated, whether the face to be recognized and the model face are the same person is determined by comparing the similarity with the preset similarity, whether the face recognition is successful is further determined, and the accuracy of the face recognition is improved.
Example 9:
inputting the face data into the preset identity database, and in the process of performing data matching in the identity database based on the data identification of the face data, the method further comprises the following steps:
distinguishing the face blocks of the face data to obtain a plurality of face blocks, constructing a block matrix of each face block, and extracting a feature vector of each block matrix;
matching feature vectors of each face block based on the preset identity database,
judging whether special vectors exist in the feature vectors;
if the special vector exists, matching a first sub-library related to the special vector based on the preset identity database, and performing matching identification on the special vector based on the first sub-library;
if not, sorting the identification degrees of all the feature vectors;
wherein n1 represents the vector dimension involved in each feature vector, and M represents the total vector dimension corresponding to the standard face; oc represents a face feature weight corresponding to each feature vector; c1 denotes the actual set of elements of the corresponding feature vector; c2 denotes a set of standard elements corresponding to the standard vector; n represents the number of elements in the actual element set; ()doRepresenting the number of elements in the corresponding intersection set of C1 and C2;
according to the sequencing result, matching and identifying with the corresponding face sub-library in sequence;
and acquiring a matching identification result and using the matching identification result as auxiliary information for acquiring the corresponding identity file.
Such as: c1 ═ 1,2,3, 4, 9, 0, and C2 ═ 1,2,3,0,0,0, and in this case, C1 ═ C2 ═ 1,2,3,0, and (C1 ≈ C2)do=4;
()doIndicating that C1 ≦ C2 corresponds to the number of elements in the intersection set, where N is 6.
In this embodiment, by distinguishing the face blocks of the face data, a user can be identified by matching some of the blocks, so as to improve the identification efficiency and save the identification space, for example: the face data is divided into: eyes, nose, mouth, forehead, cheek five parts, and every part all has its corresponding matrix, and confirm based on facial data, for example, there is special recognition degree in user's mouth, at this moment, can regard as the eigenvector of mouth as the special vector, at this moment, from predetermineeing the identity database, directly match the sub-storehouse relevant with the mouth, save the discernment time greatly, for example predetermine the identity database, include: vectors corresponding to different face blocks and associated face descriptions and identity information.
In this embodiment, if no special vector exists, then all vectors are sorted according to their identification degrees, and the corresponding libraries are matched according to the result, thereby implementing matching identification.
The beneficial effects of the above technical scheme are: by carrying out block distinguishing on the face data, matrixes of different face blocks can be effectively obtained, then the feature vectors are extracted, and different modes are adopted for matching and identifying by judging whether the face data are special or not, so that an auxiliary basis is provided for subsequently acquiring corresponding identity files.
Example 10:
as shown in fig. 4, a face recognition apparatus of the present invention includes:
the identification module is used for acquiring a target image based on a camera, reading the target image, determining a face range in the target image, and delineating the face range to output a face image;
the first determining module is used for determining a face recognition model, inputting the face image into the face recognition model for face recognition and outputting a recognition result;
and the second determining module is used for matching the recognition result in a preset identity database to determine the identity information of the face.
Preferably, as shown in fig. 5, the camera includes:
the triggering unit is used for sending a first control instruction to the control unit when sensing objects appear in the target area, controlling the first acquisition unit and acquiring the sensing objects;
the control unit is also used for carrying out overall definition recognition on the acquired image of the induction object, judging whether the program problem is a fault or not if the acquired image is not clear, and controlling an alarm unit arranged on one side of the acquisition unit to give a first alarm if the acquired image is not clear;
otherwise, judging whether the surface of the acquisition body of the first acquisition unit is fuzzy or not, controlling a second acquisition unit to acquire the surface of the corresponding acquisition body, and controlling the alarm unit to give a second alarm if the surface of the acquisition body is determined to be fuzzy;
the second acquisition unit and the first acquisition unit are arranged at corresponding positions, and the control unit is connected with the trigger unit, the first acquisition unit, the second acquisition unit and the alarm unit.
The technical scheme has the advantages that the trigger unit is arranged, so that the work consumption is saved, the work efficiency is improved, the acquisition unit body and the program can be judged conveniently by arranging the acquisition unit, the normal acquisition of the first acquisition unit is ensured, and the alarm unit is arranged, so that the problem can be reminded to be handled in time.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A high-precision face recognition method is characterized by comprising the following steps:
step 1: acquiring a target image based on a camera, reading the target image, determining a face range in the target image, and delineating the face range to output a face image;
step 2: determining a face recognition model, inputting the face image into the face recognition model for face recognition, and outputting a recognition result;
and step 3: and matching the recognition result in a preset identity database to determine the identity information of the face.
2. The method for recognizing the human face with high precision according to claim 1, wherein in the step 1, the specific working process of reading the target image and determining the human face range in the target image comprises:
graying the target image, acquiring a grayscale image, reading the grayscale image, and determining pixel points of the grayscale image;
extracting the characteristics of the pixels of the gray level image, and determining the distribution characteristics of the pixels with the same characteristics in the gray level image;
comparing the target image with the gray image, determining the contour range of the human face in the gray image based on the distribution characteristics of the pixel points with the same type of characteristics in the gray image, and determining the pixel points of the human face contour;
and marking the face contour pixel points, and determining the face range in the target image based on the marking result.
3. The method for recognizing the human face with high precision according to claim 1, wherein in the step 1, a specific working process of delineating the human face range and outputting the human face image comprises the following steps:
acquiring edge point information of the face range, and determining the sharpening degree of the face range boundary based on the edge point information of the face range;
edge sharpening is carried out on the boundary of the face range according to the sharpening degree, and the target image with the sharpened edge of the face range is input into a preset segmentation model;
determining the target image segmentation points in the preset segmentation model, and segmenting the target image in the preset segmentation model based on the segmentation points;
generating the face image based on a segmentation result;
wherein, after the face image is generated based on the segmentation result, the method further comprises:
carrying out image analysis on the face image to determine the color value and the brightness value of the face image;
performing image quality evaluation on the facial image based on the color value and the brightness value, and acquiring an evaluation score;
comparing the evaluation score with a preset evaluation score, and judging whether the facial image needs image optimization processing;
when the evaluation score is equal to or larger than the preset evaluation score, judging that the face image does not need to be subjected to image optimization processing;
otherwise, judging that the face image needs to be subjected to image optimization processing;
when the face image needs to be subjected to image optimization processing, generating a first optimization index parameter according to the color value and a reference color value, and meanwhile, generating a second optimization index parameter according to the brightness value and a reference brightness value;
and optimizing the face image in a preset optimization algorithm based on the first optimization index parameter and the second optimization index parameter.
4. The method according to claim 1, wherein in step 2, a specific working process of determining a face recognition model, inputting the face image into the face recognition model for face recognition, and outputting a recognition result comprises:
acquiring a face image of a target group, performing first learning on the face image of the target group in a preset convolutional neural network, and determining the face characteristics of the face image of the target group based on a first learning result;
and performing secondary learning on the face features in the preset convolutional neural network, and outputting a second learning result, wherein the second learning result comprises: similar feature points of the face features and difference feature points of the face features;
acquiring similar characteristic parameters corresponding to the similar characteristic points of the human face characteristics, and taking the similar characteristic parameters as first model parameters;
acquiring difference characteristic parameters corresponding to the difference characteristic points of the human face characteristics, adding difference labels to the difference characteristic parameters respectively, and taking the difference characteristic parameters added with the difference labels as second model parameters;
constructing a face recognition model based on the first model parameters and the second model parameters;
inputting the face image into the face recognition model for recognition to obtain recognition parameters, performing parameter matching on the recognition parameters in the face recognition model, and judging whether the recognition is successful or not based on a matching result;
when the identification parameters are matched with corresponding target parameters in the face identification model, judging that the face image identification is successful;
when the identification parameters are not matched with corresponding target parameters in the face identification model, judging that the face image is not successfully identified, recording the face image, and inputting the face image into the preset convolutional neural network for third learning;
and updating the model in the face recognition model based on the third learning result and the recognition parameters.
5. The high-precision face recognition method according to claim 1, wherein in step 1, the working process of collecting the target image based on the camera comprises:
acquiring the shooting position of the camera, and determining the shooting range of the camera based on the shooting position, wherein the shooting range comprises: an upper and lower shooting range, a left and right shooting range;
determining the shooting height ratio of the camera according to the upper and lower shooting ranges, and estimating the target height range of the person shot by the camera based on the shooting height ratio of the camera;
comparing the target height range with a preset reference height range, and judging whether the shooting position of the camera needs to be adjusted or not;
when the target height range is equal to or larger than the preset reference height range, the shooting position of the camera does not need to be adjusted;
otherwise, judging that the shooting position of the camera needs to be adjusted, and determining a first adjustment strategy of the camera based on the difference value between the target height range and the preset reference height range;
determining the shooting width ratio of the camera based on the left and right shooting ranges, and determining the number of people shot by the camera based on the width shooting ratio of the camera;
when the number of people shot by the camera is less than 1 or equal to or greater than 2, determining a second adjustment strategy of the camera based on the width ratio of the camera;
and carrying out shooting adjustment on the camera based on the first adjustment strategy and the second adjustment strategy.
6. The method for recognizing the human face with high precision according to claim 1, wherein in the step 3, the specific process of matching the recognition result in a preset identity database to determine the identity information of the human face comprises:
reading the recognition result, determining the face data of the target user corresponding to the face image, and extracting the data identification of the face data;
inputting the face data into the preset identity database, and performing data matching in the identity database based on the data identification of the face data;
acquiring an identity file consistent with the data identification in the preset identity database based on a matching result;
and reading the identity file, and extracting the identity information of the target user corresponding to the face image.
7. A high-precision human face recognition method according to claim 1, wherein in step 2, the human face image is input into the human face recognition model for human face recognition, further comprising:
acquiring an n-dimensional space vector A ═ a (a) of a face to be recognized corresponding to the face image1,a2,...an) And simultaneously extracting n-dimensional space vector B ═ (B) of the model face in the face recognition model1,b2,...bn);
Based on the n-dimensional space vector A ═ (a) of the face to be recognized1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn) And calculating the n-dimensional space vector A ═ of (a) of the face to be recognized1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn) Euclidean distance and cosine distance of (d);
wherein, δ represents the Euclidean distance between the space vector of the face to be recognized and the space vector of the model face; cos theta represents the cosine distance between the space vector of the user face to be recognized and the space vector of the model face; mu.s1The first error factor is represented, and the value range is (0.23, 0.34); i denotes the current component, a1,a2,...anRepresenting the components of an n-dimensional space vector of a face to be recognized; b1,b2,...bnA component of a spatial vector representing a model face; n represents a dimension; mu.s2The second error factor is represented, and the value range is (0.26, 0.39);
based on the face of the user to be recognizedn-dimensional space vector a ═ a1,a2,...an) And the n-dimensional space vector B of the model face is equal to (B)1,b2,...bn) Calculating the similarity between the target user face and the model face according to the Euclidean distance and the cosine distance;
wherein gamma represents the similarity between the face to be recognized and the model face;
comparing the similarity between the face to be recognized and the model face with a preset similarity, and judging whether the face to be recognized and the model face are the same person or not, wherein the similarity between the face to be recognized and the model face is smaller than or equal to the preset similarity;
when the similarity between the face to be recognized and the model face is equal to the preset similarity, judging that the face to be recognized and the model face are the same person, and successfully recognizing the face;
and when the similarity between the face to be recognized and the model face is smaller than the preset similarity, judging that the face to be recognized and the model face are not the same person, and determining that the face recognition is unsuccessful.
8. The method as claimed in claim 6, wherein the face data is input into the preset identity database, and in the process of performing data matching in the identity database based on the data identification of the face data, the method further comprises:
distinguishing the face blocks of the face data to obtain a plurality of face blocks, constructing a block matrix of each face block, and extracting a feature vector of each block matrix;
matching feature vectors of each face block based on the preset identity database,
judging whether special vectors exist in the feature vectors;
if the special vector exists, matching a first sub-library related to the special vector based on the preset identity database, and performing matching identification on the special vector based on the first sub-library;
if not, sorting the identification degrees of all the feature vectors;
wherein n1 represents the vector dimension involved in each feature vector, and M represents the total vector dimension corresponding to the standard face; oc represents a face feature weight corresponding to each feature vector; c1 denotes the actual set of elements of the corresponding feature vector; c2 denotes a set of standard elements corresponding to the standard vector; n represents the number of elements in the actual element set; ()doRepresenting the number of elements in the corresponding intersection set of C1 and C2;
according to the sequencing result, matching and identifying with the corresponding face sub-library in sequence;
and acquiring a matching identification result and using the matching identification result as auxiliary information for acquiring the corresponding identity file.
9. A face recognition device, comprising:
the identification module is used for acquiring a target image based on a camera, reading the target image, determining a face range in the target image, and delineating the face range to output a face image;
the first determining module is used for determining a face recognition model, inputting the face image into the face recognition model for face recognition and outputting a recognition result;
and the second determining module is used for matching the recognition result in a preset identity database to determine the identity information of the face.
10. The face recognition device of claim 9, wherein the camera comprises:
the triggering unit is used for sending a first control instruction to the control unit when sensing objects appear in the target area, controlling the first acquisition unit and acquiring the sensing objects;
the control unit is also used for carrying out overall definition recognition on the acquired image of the induction object, judging whether the program problem is a fault or not if the acquired image is not clear, and controlling an alarm unit arranged on one side of the acquisition unit to give a first alarm if the acquired image is not clear;
otherwise, judging whether the surface of the acquisition body of the first acquisition unit is fuzzy or not, controlling a second acquisition unit to acquire the surface of the corresponding acquisition body, and controlling the alarm unit to give a second alarm if the surface of the acquisition body is determined to be fuzzy;
the second acquisition unit and the first acquisition unit are arranged at corresponding positions, and the control unit is connected with the trigger unit, the first acquisition unit, the second acquisition unit and the alarm unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111659059.8A CN114445879A (en) | 2021-12-30 | 2021-12-30 | High-precision face recognition method and face recognition equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111659059.8A CN114445879A (en) | 2021-12-30 | 2021-12-30 | High-precision face recognition method and face recognition equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114445879A true CN114445879A (en) | 2022-05-06 |
Family
ID=81365748
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111659059.8A Pending CN114445879A (en) | 2021-12-30 | 2021-12-30 | High-precision face recognition method and face recognition equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114445879A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114677750A (en) * | 2022-05-26 | 2022-06-28 | 广州番禺职业技术学院 | Intelligent mall face recognition system and method based on big data |
CN115578777A (en) * | 2022-11-10 | 2023-01-06 | 成都智元汇信息技术股份有限公司 | Image recognizing method and device for obtaining target based on space mapping |
CN117058738A (en) * | 2023-08-07 | 2023-11-14 | 深圳市华谕电子科技信息有限公司 | Remote face detection and recognition method and system for mobile law enforcement equipment |
CN117284131A (en) * | 2023-09-26 | 2023-12-26 | 广东安能电业有限公司 | Electric bicycle charging cabinet and control method thereof |
-
2021
- 2021-12-30 CN CN202111659059.8A patent/CN114445879A/en active Pending
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114677750A (en) * | 2022-05-26 | 2022-06-28 | 广州番禺职业技术学院 | Intelligent mall face recognition system and method based on big data |
CN115578777A (en) * | 2022-11-10 | 2023-01-06 | 成都智元汇信息技术股份有限公司 | Image recognizing method and device for obtaining target based on space mapping |
CN115578777B (en) * | 2022-11-10 | 2023-03-14 | 成都智元汇信息技术股份有限公司 | Image recognizing method and device for obtaining target based on space mapping |
CN117058738A (en) * | 2023-08-07 | 2023-11-14 | 深圳市华谕电子科技信息有限公司 | Remote face detection and recognition method and system for mobile law enforcement equipment |
CN117058738B (en) * | 2023-08-07 | 2024-05-03 | 深圳市华谕电子科技信息有限公司 | Remote face detection and recognition method and system for mobile law enforcement equipment |
CN117284131A (en) * | 2023-09-26 | 2023-12-26 | 广东安能电业有限公司 | Electric bicycle charging cabinet and control method thereof |
CN117284131B (en) * | 2023-09-26 | 2024-05-03 | 广东安能电业有限公司 | Electric bicycle charging cabinet and control method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110728225B (en) | High-speed face searching method for attendance checking | |
CN114445879A (en) | High-precision face recognition method and face recognition equipment | |
CN106815566B (en) | Face retrieval method based on multitask convolutional neural network | |
CN108268838B (en) | Facial expression recognition method and facial expression recognition system | |
CN108520226B (en) | Pedestrian re-identification method based on body decomposition and significance detection | |
CN103902961B (en) | Face recognition method and device | |
EP1229493B1 (en) | Multi-mode digital image processing method for detecting eyes | |
CN100492397C (en) | Face meta-data creation equipment and method, face distinguishing system and method | |
US11194997B1 (en) | Method and system for thermal infrared facial recognition | |
EP1667068A1 (en) | Object posture estimation/correlation system using weight information | |
KR20080065532A (en) | Method and system for automated face detection and recognition | |
KR20170006355A (en) | Method of motion vector and feature vector based fake face detection and apparatus for the same | |
CN109740572A (en) | A kind of human face in-vivo detection method based on partial color textural characteristics | |
CN113449704B (en) | Face recognition model training method and device, electronic equipment and storage medium | |
CN108108760A (en) | A kind of fast human face recognition | |
CN106250825A (en) | A kind of at the medical insurance adaptive face identification system of applications fields scape | |
CN110909618A (en) | Pet identity recognition method and device | |
CN106650574A (en) | Face identification method based on PCANet | |
CN109376717A (en) | Personal identification method, device, electronic equipment and the storage medium of face comparison | |
CN111274883A (en) | Synthetic sketch face recognition method based on multi-scale HOG (histogram of oriented gradient) features and deep features | |
CN112801859A (en) | Cosmetic mirror system with cosmetic guiding function | |
CN112115835A (en) | Face key point-based certificate photo local anomaly detection method | |
CN115690884A (en) | Face recognition method, face recognition system, storage medium and computing equipment | |
CN117877085A (en) | Psychological analysis method based on micro-expression recognition | |
CN109886320B (en) | Human femoral X-ray intelligent recognition method and system |
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 |