A face recognition method, device, system and storage medium

By adopting a multi-level face recognition model in edge devices, multiple recognition of images to be recognized at different sizes is solved, and a more efficient and accurate face recognition is achieved.

CN112668358BActive Publication Date: 2025-03-11GUANGZHOU HUIRUI SITONG INFORMATION SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910944733.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-30
Publication Date
2025-03-11
Estimated Expiration
2039-09-30

AI Technical Summary

Technical Problem

When the prior art performs face detection and recognition in edge devices, although the computing efficiency is accelerated, the recognition effect is not significantly improved, and accurate facial recognition results cannot be obtained.

Method used

A multi-level face recognition model is used to identify images to be recognized of different sizes, and the images are recognized multiple times through the first face recognition model, the second face recognition model and the third face recognition model to ensure the accuracy of the recognition results.

Benefits of technology

Through the multi-level face recognition model, the face images in the image to be recognized can be extracted and identified more accurately, improving the effect and accuracy of face recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112668358B_ABST
    Figure CN112668358B_ABST
Patent Text Reader

Abstract

The present invention relates to a face recognition method, device, system and storage medium, the method comprising: recognizing at least two images to be recognized of different sizes by at least two first face recognition models to obtain each first face image in the images to be recognized; recognizing all the first face images by a second face recognition model to obtain each second face image in the first face image; recognizing all the second face images by a third face recognition model to obtain a face recognition result. The embodiment of the present invention recognizes original images to be recognized at different scales through multi-level face recognition models, extracts face images of images to be recognized at different scales, and further recognizes the face images obtained from the images to be recognized at different scales through the second face recognition model and the third face recognition model, so as to determine the accurate face images in the images to be recognized and improve the face recognition effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a face recognition method, device, system and storage medium. Background Art

[0002] With the advancement of technology, biometric recognition technology is increasingly being used in daily life. As a biometric recognition technology, face recognition technology has been widely used due to its easy collection, non-contact, and high recognition rate. Face liveness detection technology is an important part of the face recognition system. By distinguishing whether the object in front of the camera is a real person or a prosthesis, it can effectively improve the security of the face recognition system.

[0003] Face detection and recognition in edge devices is a difficult and hot topic in current research. The conventional approach is to deploy the face detection model and face recognition model trained on the PC to the front-end edge device, and use the ARM instruction set acceleration on the edge device to complete the image face detection and recognition functions using a neural network. These solutions are all software-accelerated face recognition solutions. Under simple instruction acceleration, the system computing efficiency is accelerated, but the final recognition effect will not change much, and users cannot obtain accurate face recognition results. Summary of the invention

[0004] In order to solve the problems existing in the prior art, at least one embodiment of the present invention provides a face recognition method, device, system and storage medium.

[0005] In a first aspect, an embodiment of the present invention provides a face recognition method, the method comprising:

[0006] Recognize at least two to-be-recognized images of different sizes by using at least two first face recognition models to obtain each first face image in the to-be-recognized images; wherein the to-be-recognized images are obtained by using the same original to-be-recognized images, and the first face recognition models correspond one-to-one to the to-be-recognized images;

[0007] Recognize all the first facial images by using a second facial recognition model to obtain each second facial image in the first facial image;

[0008] Recognize all the second face images by using a third face recognition model to obtain a face recognition result;

[0009] Among them, the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model.

[0010] Based on the above technical solution, the embodiment of the present invention can also make the following improvements.

[0011] In combination with the first aspect, in a first embodiment of the first aspect, the image to be recognized is obtained by using the same original image to be recognized, and the first face recognition model corresponds one-to-one to the image to be recognized, including:

[0012] Obtaining the image width of the original image to be recognized and the minimum pixel required for face recognition;

[0013] Obtaining a first number of the first face recognition models according to the image width and the minimum size;

[0014] Based on the original images to be identified, obtaining the first number of images to be identified, wherein after the images to be identified are sorted according to image sizes, the size of any image to be identified is a preset multiple of the size of a subsequent image to be identified;

[0015] Based on the image size of each of the images to be recognized, the first number of first face recognition models are obtained, wherein, after the first face recognition models are sorted according to the image sizes that can be processed by the first face recognition models, the image size that can be processed by any of the first face recognition models is a preset multiple of the image size that can be processed by the next first face recognition model.

[0016] In combination with the first embodiment of the first aspect, in the second embodiment of the first aspect, obtaining the first number of the first face recognition models according to the image width and the minimum size includes:

[0017] The first quantity is calculated by the following calculation formula:

[0018]

[0019] Wherein, N is the first number, floor is a floor function, log is a logarithmic function, msize is the minimum size required for face recognition, and w is the image width.

[0020] In combination with the first aspect, in a third embodiment of the first aspect, recognizing all the first facial images by using a second facial recognition model to obtain each second facial image in the first facial images includes:

[0021] Establishing a second face recognition model, wherein the image size that can be processed by the second face recognition model is a first preset size;

[0022] The first facial image is recognized by using the second facial recognition model to obtain the second facial image.

[0023] In combination with the first aspect, in a fourth embodiment of the first aspect, recognizing all the first facial images by using a second facial recognition model to obtain each second facial image in the first facial images includes:

[0024] Establishing a second face recognition model, wherein the image size that can be processed by the second face recognition model is a second preset size, wherein the second preset size is the first preset value multiplied by the first preset size;

[0025] splicing all the first face images according to a third preset size to obtain at least one first image; wherein the third preset size is the second preset value multiplied by the second preset size;

[0026] The first image is recognized by the second face recognition model to obtain the second face image.

[0027] In combination with the first aspect or the first, second, third or fourth embodiment of the first aspect, in a fifth embodiment of the first aspect, the step of recognizing all the second face images by a third face recognition model to obtain a face recognition result; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model, includes:

[0028] Establishing a third face recognition model, wherein the image size that can be processed by the third face recognition model is a fourth preset size;

[0029] The second facial image is recognized by the third facial recognition model to obtain the third facial image.

[0030] In combination with the first aspect or the first, second, third or fourth embodiment of the first aspect, in a sixth embodiment of the first aspect, the step of recognizing all the second face images by a third face recognition model to obtain a face recognition result; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model, includes:

[0031] Establishing a third face recognition model, wherein the image size that can be processed by the second face recognition model is a fifth preset size, wherein the fifth preset size is the third preset value multiplied by the fourth preset size;

[0032] splicing all the second facial images according to a sixth preset size to obtain at least one second image; wherein the sixth preset size is the fourth preset value multiplied by the fifth preset size;

[0033] The second image is recognized by the third face recognition model to obtain the face recognition result.

[0034] In a second aspect, an embodiment of the present invention provides a face recognition device, the device comprising:

[0035] A first recognition unit, configured to recognize at least two to-be-recognized images of different sizes by using at least two first face recognition models to obtain each first face image in the to-be-recognized images; wherein the to-be-recognized images are obtained by using the same original to-be-recognized images, and the first face recognition models correspond one-to-one to the to-be-recognized images;

[0036] A second recognition unit, configured to recognize all of the first facial images by using a second facial recognition model to obtain each second facial image in the first facial images;

[0037] The third recognition unit is used to obtain a face recognition result by recognizing all the second face images through a third face recognition model; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model.

[0038] In a third aspect, an embodiment of the present invention provides a face recognition system, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0039] Memory, used to store computer programs;

[0040] The processor is used to implement the face recognition method described in any embodiment of the first aspect when executing the program stored in the memory.

[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the face recognition method described in any embodiment of the first aspect.

[0042] Compared with the prior art, the above-mentioned technical scheme of the present invention has the following advantages: the embodiment of the present invention uses a multi-level face recognition model to identify the original images to be identified at different scales, extracts face images of the images to be identified at different scales, and further identifies the face images obtained from the images to be identified at different scales through the second face recognition model and the third face recognition model, thereby determining the precise face image in the image to be identified and improving the face recognition effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a schematic diagram of implementing a face recognition method provided by an embodiment of the present invention;

[0044] Figure 2is a flow chart of a face recognition method provided by another embodiment of the present invention;

[0045] Figure 3 This is a flow chart of a face recognition method provided by another embodiment of the present invention;

[0046] Figure 4 This is a second flow chart of a face recognition method provided by another embodiment of the present invention;

[0047] Figure 5 FIG3 is a flow chart of a face recognition method provided by another embodiment of the present invention;

[0048] Figure 6 FIG4 is a fourth flow chart of a face recognition method provided by another embodiment of the present invention;

[0049] Figure 7 is a structural schematic diagram of a face recognition device provided by another embodiment of the present invention;

[0050] Figure 8 It is a structural schematic diagram of a face recognition system provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] like Figure 1 As shown, an embodiment of the present invention provides a face recognition method. Figure 1 , the method comprises the following steps:

[0053] S11. Recognize at least two images to be recognized of different sizes using at least two first face recognition models to obtain each first face image in the images to be recognized; wherein the images to be recognized are obtained through the same original images to be recognized, and the first face recognition models correspond one-to-one to the images to be recognized.

[0054] In this embodiment, the first face recognition model corresponds to the image to be recognized one by one, that is, the image to be recognized that can be processed by each first face recognition image is an image to be recognized of a certain size; by adjusting the image size of the original image to be recognized, multiple images to be recognized at different sizes are obtained, and the first face recognition model corresponding to the image to be recognized is used to recognize the images to be recognized of corresponding sizes respectively, so as to obtain face images of the original image to be recognized at different scales. Specifically, by detecting face images in images to be recognized of different sizes, the face recognition effect of the original image to be recognized is ensured.

[0055] Preferably, the image size that can be processed by the first face recognition image is the same as the image size of the corresponding image to be recognized.

[0056] S12: Recognize all of the first facial images using a second facial recognition model to obtain each second facial image in the first facial images.

[0057] In this embodiment, since the first facial image is extracted from the image to be identified, the image size of the image to be identified corresponding to each first facial image is inconsistent, and the image size of the first facial image extracted is also inconsistent. Each first facial recognition image is recognized again through the second facial recognition image to further determine the second facial image in the first facial image recognized by the first facial recognition model. If the second facial image is not recognized in the first facial image, it means that the first facial image is caused by a recognition error, and the recognition error may be caused by different image sizes. The second facial recognition image can verify the recognition result of the first facial recognition model.

[0058] S13. Recognize all the second face images through a third face recognition model to obtain a face recognition result; wherein, the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model.

[0059] In this embodiment, the second facial image is further recognized by the third facial recognition model to obtain a facial recognition result. For example, if the third facial recognition model can recognize a facial image from the second facial image, it means that the facial recognition is completed and there is a facial image in the original image to be recognized. If the third recognition model fails to recognize a facial image from the second facial image, it means that the second facial image obtained from the first facial image is incorrect.

[0060] Specifically, a third face recognition model can be used to identify each second face image to determine whether there is a face image in each second face image. When the number of second face images corresponding to the same face image reaches a preset threshold, for example, when the number reaches a preset ratio of the number of images to be identified, that is, most of the recognition models identify the face in the image to be identified and extract the corresponding face image, the face image is used as the face recognition result.

[0061] This solution uses a multi-level face recognition model to complete face detection of images to be identified, ensuring the final face detection accuracy and effect.

[0062] In this embodiment, a fourth face recognition model and a fifth face recognition model can be added to continue to recognize the recognition results obtained by the previous face recognition model to improve the recognition accuracy. The specific level can be set by the user according to the accuracy and will not be repeated in this solution.

[0063] like Figure 2 As shown, in step S11, the image to be recognized is obtained through the same original image to be recognized, and the first face recognition model corresponds to the image to be recognized one by one, including the following steps:

[0064] S21, obtaining the image width of the original image to be recognized and the minimum pixel required for face recognition.

[0065] In this embodiment, different face recognition models have different accuracies in recognizing faces in images. The smaller the pixels of the image, the more difficult it is for the face recognition model to recognize. The face recognition model requires a larger amount of data for training, and this type of face recognition model is often more prone to errors.

[0066] S22. Obtain a first number of the first face recognition models according to the image width and the minimum size.

[0067] In this embodiment, according to the image width of the original image to be recognized and the minimum pixel required for face recognition, it is determined how many times the original image to be recognized can be adjusted to adjust the pixels in the original image to be recognized to the minimum pixel, that is, the images to be recognized of different sizes in the above embodiment are obtained by changing the size of the pixels in the original image to be recognized. For example, the pixels of the original image to be recognized are reduced to one-half to obtain the image to be recognized, and then reduced to one-half again to obtain another image to be recognized. This step is continuously performed until the pixels of the last image to be recognized reach or approach the first number, and then the new image to be recognized is stopped. The number of images to be recognized obtained in this process is recorded as the first number. Of course, the reduction method of the original image to be recognized in this solution is not particularly limited, and it can also be a value of one-third or two-thirds, etc., and the first number can be obtained by reducing it according to the preset rules set by the user. Of course, the original image to be recognized that has been enlarged by a certain amount can also be obtained as the image to be recognized, but the recognition effect will not increase if the pixels of the original image to be recognized are enlarged, so the image to be recognized obtained after the pixels of the original image to be recognized are enlarged can be added.

[0068] S23. Based on the original images to be recognized, obtain the first number of images to be recognized, wherein after the images to be recognized are sorted according to image sizes, the size of any image to be recognized is a preset multiple of the size of a subsequent image to be recognized.

[0069] In this embodiment, a first number of images to be identified are obtained by scaling the original images to be identified by a preset multiple. Since the pixel size changes after scaling, the image size changes. In this solution, after the images to be identified are sorted by image size, the size of the previous image to be identified is a preset multiple of the size of the next image to be identified. For example, the size of the previous image to be identified is twice the size of the next image to be identified, or 1.5 times, 3 times, 4 times or more.

[0070] S24. Based on the image size of each of the images to be recognized, obtain the first number of first face recognition models, wherein, after sorting the first face recognition models according to the image sizes that can be processed by the first face recognition models, the image size that can be processed by any of the first face recognition models is a preset multiple of the image size that can be processed by the next first face recognition model.

[0071] In this embodiment, based on the image size of each image to be recognized, the corresponding first face recognition model is obtained respectively, and the size of the image that can be processed by the first face recognition model is in the same ratio as the size of the image to be recognized, that is, the accuracy of each first face recognition model is consistent with the corresponding image to be recognized. Preferably, the image size of the image that can be processed by each first face recognition model can be set to be consistent with the image size of the corresponding image to be recognized to speed up processing efficiency.

[0072] In this embodiment, in step S22, obtaining the first number of the first face recognition models according to the image width and the minimum size may include the following method:

[0073] The first quantity is calculated by the following calculation formula:

[0074]

[0075] Wherein, N is the first number, floor is a floor function, log is a logarithmic function, msize is the minimum size required for face recognition, and w is the image width.

[0076] In this embodiment, the first number is calculated by using a logarithmic function with 2 as the lower value and other corresponding parameters. The preset multiple between the first facial images processed in the above steps can be 2 times. The base of the logarithmic function in this scheme can be adjusted according to the value of the preset multiple to adapt to calculations in different situations.

[0077] The first face recognition model can be obtained based on the NNIE neural network inference engine of the HiSilicon chip, and the trained model can be obtained through data training. NNIE mapping is used to complete the model conversion of N scales for the first-level face detection, and converted into a data instruction file that can be loaded on the HiSilicon Hi35xx chip, and the single neural network model of the first level is expanded to N neural network models, and N neural networks are used for forward reasoning to complete the first-level face detection.

[0078] In order to reduce the forward inference time of the face recognition model, the deep separable convolution layer with large channels is first split (for example, if the number of channels is 1024, it is split into two 512 layers and then convolved separately), and then the deep separable convolutions are completed separately and then merged to achieve hardware accelerated calculation of large channel convolutions.

[0079] Before performing face recognition on different face recognition images, NNIE mapping is used to convert the trained face model into a data instruction file that can be loaded on the HiSilicon series chips.

[0080] like Figure 3The embodiment of the present invention provides a face recognition method. Figure 3 , the embodiment of the present invention comprises the following steps:

[0081] S31. Identify at least two images to be identified of different sizes using at least two first face recognition models to obtain each first face image in the images to be identified; wherein the images to be identified are obtained through the same original images to be identified, and the first face recognition models correspond one-to-one to the images to be identified.

[0082] The content of step S31 may refer to the description of step S11 in the above embodiment, and will not be repeated in this embodiment.

[0083] S32: Establish a second face recognition model, wherein the image size that can be processed by the second face recognition model is a first preset size.

[0084] In this embodiment, the first preset size may be a fixed size of 24×24 pixels as a cell size, which is not particularly limited in this embodiment, and the specific parameters may be set by the user.

[0085] S33: Recognize the first facial image using the second facial recognition model to obtain the second facial image.

[0086] In this embodiment, the plurality of first face images recognized in the above steps are sent one by one to the second face recognition model of the cell size to complete the second level face detection.

[0087] S34. Recognize all the second face images through a third face recognition model to obtain a face recognition result; wherein, the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model.

[0088] The content of step S34 may refer to the description of step S13 in the above embodiment, and will not be repeated in this embodiment.

[0089] like Figure 4 The embodiment of the present invention provides a face recognition method. Figure 4 , the embodiment of the present invention comprises the following steps:

[0090] S41. Identify at least two images to be identified of different sizes using at least two first face recognition models to obtain each first face image in the images to be identified; wherein the images to be identified are obtained through the same original images to be identified, and the first face recognition models correspond one-to-one to the images to be identified.

[0091] The content of step S41 may refer to the description of step S11 in the above embodiment, and will not be repeated in this embodiment.

[0092] S42. Establish a second face recognition model, wherein the image size that can be processed by the second face recognition model is a second preset size, wherein the second preset size is the first preset value multiplied by the first preset size.

[0093] In this embodiment, the first preset size may be a fixed size of 24×24 pixels, and the first preset size of the first preset threshold is used as a cell size. This is not particularly limited in this embodiment, and the specific parameters may be set by the user.

[0094] S43. Splice all the first facial images according to a third preset size to obtain at least one first image; wherein the third preset size is the second preset value multiplied by the second preset size.

[0095] In this embodiment, the multiple first face images identified in the above steps are spliced ​​to generate a second preset value of cell size, the insufficient ones are filled with blanks, and the spliced ​​image is sent to the second face recognition model. Specifically, the first face image pictures are horizontally spliced ​​with a second preset value of cell size, and the insufficient ones are filled with grayscale pixels to become the second preset value of cell size.

[0096] S44: Recognize the first image using the second face recognition model to obtain the second face image.

[0097] The spliced ​​image is sent to the second face recognition model for recognition to obtain each second face image in the image to speed up the recognition efficiency.

[0098] S44. Recognize all the second facial images through a third facial recognition model to obtain a facial recognition result; wherein, the image size that can be processed by the third facial recognition model is larger than the image size that can be processed by the second facial recognition model.

[0099] The content of step S45 may refer to the description of step S13 in the above embodiment, and will not be repeated in this embodiment.

[0100] like Figure 5 As shown, in combination with the above embodiments, an embodiment of the present invention provides a face recognition method, the difference being that the face recognition result is obtained by recognizing all the second face images through a third face recognition model; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model, comprising the following steps:

[0101] S51. Establish a third face recognition model, wherein the image size that can be processed by the third face recognition model is a fourth preset size.

[0102] In this embodiment, the fourth preset size can be a fixed size of 48×48 pixels as a cell size, or it can be twice the first preset size in the above embodiment. This is not particularly limited in this embodiment, and the specific parameters can be set by the user.

[0103] S52: Recognize the second facial image using the third facial recognition model to obtain the third facial image.

[0104] In this embodiment, the plurality of second face images recognized in the above embodiment are sent one by one to the third face recognition model of the cell size to complete the third level face detection.

[0105] like Figure 6 As shown, in combination with the above embodiments, an embodiment of the present invention provides a face recognition method, the difference being that the face recognition result is obtained by recognizing all the second face images through a third face recognition model; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model, comprising the following steps:

[0106] S61. Establish a third face recognition model, wherein the image size that can be processed by the second face recognition model is a fifth preset size, wherein the fifth preset size is the third preset value multiplied by the fourth preset size.

[0107] In this embodiment, the fourth preset size may be a fixed size of 48×48 pixels, and the fourth preset size of the third preset threshold is used as a cell size. This is not particularly limited in this embodiment, and the specific parameters may be set by the user.

[0108] S62. Splice all the second facial images according to a sixth preset size to obtain at least one second image; wherein the sixth preset size is the fourth preset value multiplied by the fifth preset size.

[0109] In this embodiment, the plurality of second face images identified in the above steps are spliced ​​to generate a third preset value of cell size, the insufficient ones are filled with blanks, and the spliced ​​image is sent to the third face recognition model. Specifically, the second face image pictures are spliced ​​horizontally with a third preset value of cell size, and the ones less than the second preset value of cell size are filled with grayscale pixels to become the second preset value of cell size.

[0110] S63: Recognize the second image using the third face recognition model to obtain the face recognition result.

[0111] In this embodiment, the spliced ​​image is sent to a third face recognition model for recognition, and a face image in the image is obtained as a face recognition result to speed up the recognition efficiency.

[0112] like Figure 7 As shown, an embodiment of the present invention provides a face recognition device, which includes: a first recognition unit 11, a second recognition unit 12 and a third recognition unit 13.

[0113] In this embodiment, the first recognition unit 11 is used to recognize at least two images to be recognized of different sizes through at least two first face recognition models to obtain each first face image in the images to be recognized; wherein the images to be recognized are obtained through the same original images to be recognized, and the first face recognition model corresponds one-to-one to the images to be recognized.

[0114] In this embodiment, the second recognition unit 12 is configured to recognize all of the first facial images by using a second facial recognition model to obtain each second facial image in the first facial images.

[0115] In this embodiment, the third recognition unit 13 is used to obtain a face recognition result by recognizing all the second face images through a third face recognition model; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model.

[0116] In this embodiment, the first recognition unit 11 is specifically used to obtain the image width of the original image to be recognized and the minimum pixel required for face recognition; obtain the first number of the first face recognition models according to the image width and the minimum size; obtain the first number of images to be recognized based on the original image to be recognized, wherein after the images to be recognized are sorted according to image size, the size of any of the images to be recognized is a preset multiple of the size of the next image to be recognized; based on the image size of each of the images to be recognized, obtain the first number of first face recognition models, wherein, after the first face recognition models are sorted according to the image size that can be processed by the first face recognition model, the image size that can be processed by any of the first face recognition models is a preset multiple of the image size that can be processed by the next first face recognition model.

[0117] In this embodiment, the first identification unit 11 is specifically configured to calculate the first quantity by the following calculation formula:

[0118]

[0119] Wherein, N is the first number, floor is a floor function, log is a logarithmic function, msize is the minimum size required for face recognition, and w is the image width.

[0120] In this embodiment, the second recognition unit 12 is specifically used to establish a second face recognition model, and the image size that the second face recognition model can process is a first preset size; the first face image is recognized by the second face recognition model to obtain the second face image. Alternatively, it is specifically used to establish a second face recognition model, and the image size that the second face recognition model can process is a second preset size, wherein the second preset size is a first preset value multiplied by the first preset size; all the first face images are spliced ​​according to a third preset size to obtain at least one first image; wherein the third preset size is a second preset value multiplied by the second preset size; the first image is recognized by the second face recognition model to obtain the second face image.

[0121] In this embodiment, the third recognition unit 13 is specifically used to establish a third face recognition model, and the image size that can be processed by the third face recognition model is a fourth preset size; the second face image is recognized by the third face recognition model to obtain the third face image. Alternatively, a third face recognition model is established, and the image size that can be processed by the second face recognition model is a fifth preset size, wherein the fifth preset size is the third preset value multiplied by the fourth preset size; all the second face images are spliced ​​according to the sixth preset size to obtain at least one second image;

[0122] Among them, the sixth preset size is the fourth preset value multiplied by the fifth preset size; the second image is recognized by the third face recognition model to obtain the face recognition result.

[0123] like Figure 8 As shown, an embodiment of the present invention provides a face recognition system, including a processor 1110, a communication interface 1120, a memory 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 communicate with each other through the communication bus 1140;

[0124] Memory 1130, used for storing computer programs;

[0125] The processor 1110 is used to implement the following method when executing the program stored in the memory 1130:

[0126] Recognize at least two to-be-recognized images of different sizes by using at least two first face recognition models to obtain each first face image in the to-be-recognized images; wherein the to-be-recognized images are obtained by using the same original to-be-recognized images, and the first face recognition models correspond one-to-one to the to-be-recognized images;

[0127] Recognize all the first facial images by using a second facial recognition model to obtain each second facial image in the first facial image;

[0128] All the second face images are recognized by a third face recognition model to obtain a face recognition result; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model.

[0129] In the electronic device provided by the embodiment of the present invention, the processor 1110 replaces the character nouns to be replaced in the text data to be processed with the replacement character nouns by executing the program stored in the memory 1130, so that the user can read the text data with the character names replaced, thereby enhancing user interactivity and improving the user's reading pleasure and sense of immersion.

[0130] The communication bus 1140 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The communication interface 1120 is used for communication between the electronic device and other devices.

[0131] The memory 1130 may include a random access memory 1130 (RAM), or may include a non-volatile memory 1130 (non-volatile memory), such as at least one disk memory 1130. Optionally, the memory 1130 may also be at least one storage device located away from the processor 1110.

[0132] The above-mentioned processor 1110 can be a general-purpose processor 1110, including a central processing unit 1110 (CPU), a network processor 1110 (NP), etc.; it can also be a digital signal processor 1110 (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.

[0133] An embodiment of the present invention provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the face recognition method described in any of the above embodiments.

[0134] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidStateDisk (SSD)), etc.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A face recognition method, characterized in that: The method comprises: Recognize at least two to-be-recognized images of different sizes by using at least two first face recognition models to obtain each first face image in the to-be-recognized images; wherein the to-be-recognized images are obtained by using the same original to-be-recognized images, and the first face recognition models correspond one-to-one to the to-be-recognized images; Recognize all the first facial images by using a second facial recognition model to obtain each second facial image in the first facial image; Recognize all the second face images by using a third face recognition model to obtain a face recognition result; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model; The image to be recognized is obtained by using the same original image to be recognized, and the first face recognition model corresponds to the image to be recognized one by one, including: Obtaining the image width of the original image to be recognized and the minimum size required for face recognition; Obtaining a first number of the first face recognition models according to the image width and the minimum size; Based on the original images to be identified, obtaining the first number of images to be identified, wherein after the images to be identified are sorted according to image sizes, the size of any image to be identified is a preset multiple of the size of a subsequent image to be identified; Based on the image size of each of the images to be recognized, obtaining the first number of first face recognition models, wherein after sorting the first face recognition models according to the image sizes that can be processed by the first face recognition models, the image size that can be processed by any of the first face recognition models is a preset multiple of the image size that can be processed by a subsequent first face recognition model; The obtaining, according to the image width and the minimum size, a first number of the first face recognition models comprises: The first quantity is calculated by the following calculation formula: Wherein, N is the first number, floor is a floor function, log is a logarithmic function, msize is the minimum size required for face recognition, and w is the image width; The step of recognizing all the first face images by using a second face recognition model to obtain each second face image in the first face images includes: Establishing a second face recognition model, wherein the image size that can be processed by the second face recognition model is a second preset size, wherein the second preset size is the first preset value multiplied by the first preset size; splicing all the first face images according to a third preset size to obtain at least one first image; wherein the third preset size is the second preset value multiplied by the second preset size; Recognize the first image using the second face recognition model to obtain the second face image; The step of recognizing all the second face images by a third face recognition model to obtain a face recognition result, wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model, comprises: Establishing a third face recognition model, wherein the image size that can be processed by the second face recognition model is a fifth preset size, wherein the fifth preset size is the third preset value multiplied by the fourth preset size; splicing all the second facial images according to a sixth preset size to obtain at least one second image; wherein the sixth preset size is the fourth preset value multiplied by the fifth preset size; The second image is recognized by the third face recognition model to obtain the face recognition result.

2. The face recognition method according to claim 1, characterized in that: The step of recognizing all the first face images by using a second face recognition model to obtain each second face image in the first face images includes: Establishing a second face recognition model, wherein the image size that can be processed by the second face recognition model is a first preset size; The first facial image is recognized by using the second facial recognition model to obtain the second facial image.

3. The face recognition method according to any one of claims 1 to 2, characterized in that: The step of recognizing all the second face images by a third face recognition model to obtain a face recognition result, wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model, comprises: Establishing a third face recognition model, wherein the image size that can be processed by the third face recognition model is a fourth preset size; The second facial image is recognized by the third facial recognition model to obtain a third facial image.

4. A face recognition device, characterized in that: The device comprises: A first recognition unit, configured to recognize at least two to-be-recognized images of different sizes by using at least two first face recognition models to obtain each first face image in the to-be-recognized images; wherein the to-be-recognized images are obtained by using the same original to-be-recognized images, and the first face recognition models correspond one-to-one to the to-be-recognized images; A second recognition unit, configured to recognize all of the first facial images by using a second facial recognition model to obtain each second facial image in the first facial images; A third recognition unit, configured to recognize all the second face images by using a third face recognition model to obtain a face recognition result; wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model; The image to be recognized is obtained by using the same original image to be recognized, and the first face recognition model corresponds to the image to be recognized one by one, including: Obtaining the image width of the original image to be recognized and the minimum size required for face recognition; Obtaining a first number of the first face recognition models according to the image width and the minimum size; Based on the original images to be identified, obtaining the first number of images to be identified, wherein after the images to be identified are sorted according to image sizes, the size of any image to be identified is a preset multiple of the size of a subsequent image to be identified; Based on the image size of each of the images to be recognized, obtaining the first number of first face recognition models, wherein after sorting the first face recognition models according to the image sizes that can be processed by the first face recognition models, the image size that can be processed by any of the first face recognition models is a preset multiple of the image size that can be processed by a subsequent first face recognition model; The obtaining, according to the image width and the minimum size, a first number of the first face recognition models comprises: The first quantity is calculated by the following calculation formula: Wherein, N is the first number, floor is a floor function, log is a logarithmic function, msize is the minimum size required for face recognition, and w is the image width; The step of recognizing all the first face images by using a second face recognition model to obtain each second face image in the first face images includes: Establishing a second face recognition model, wherein the image size that can be processed by the second face recognition model is a second preset size, wherein the second preset size is the first preset value multiplied by the first preset size; splicing all the first face images according to a third preset size to obtain at least one first image; wherein the third preset size is the second preset value multiplied by the second preset size; Recognize the first image using the second face recognition model to obtain the second face image; The step of recognizing all the second face images by a third face recognition model to obtain a face recognition result, wherein the image size that can be processed by the third face recognition model is larger than the image size that can be processed by the second face recognition model, comprises: Establishing a third face recognition model, wherein the image size that can be processed by the second face recognition model is a fifth preset size, wherein the fifth preset size is the third preset value multiplied by the fourth preset size; splicing all the second facial images according to a sixth preset size to obtain at least one second image; wherein the sixth preset size is the fourth preset value multiplied by the fifth preset size; The second image is recognized by the third face recognition model to obtain the face recognition result.

5. A face recognition system, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, used to implement the face recognition method described in any one of claims 1 to 3 when executing a program stored in a memory.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the face recognition method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Face detection method and face detection device

    CN105912990A

  • Multiscale face detection method and computing equipment

    CN108537208A