Face recognition method and device

By collecting and comparing the first face image when wearing a mask and the second face image when removing the mask for re-verification, and adjusting the threshold based on the deviation value, the problem of low face recognition efficiency when wearing a mask is solved, and the gate authentication speed and gate entry and exit efficiency are improved.

CN115810212BActive Publication Date: 2026-07-10CHINA CONSTRUCTION BANK +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2022-12-02
Publication Date
2026-07-10

Smart Images

  • Figure CN115810212B_ABST
    Figure CN115810212B_ABST
Patent Text Reader

Abstract

The application discloses a face recognition method and device, and relates to the field of artificial intelligence image recognition.The method comprises the following steps: collecting a first face image of a user wearing a mask; performing a recognition comparison operation on the first face image and a historical face image pre-stored in the background and a preset reference threshold to obtain a first comparison score; if the result of the recognition comparison operation is not passed, performing a re-verification operation on a second face image of the user taking off the mask to obtain a second comparison score; determining a deviation value of the second comparison score and the first comparison score, and updating the first reference threshold according to the deviation value of the result of the re-verification operation if the second comparison score exceeds a preset second reference threshold.The application can effectively improve the face recognition efficiency when wearing a mask, thereby improving the authentication speed when the user wearing a mask passes through the gate, reducing the queue, and improving the efficiency of entering and leaving the gate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence image recognition, specifically to a face recognition method and device. Background Technology

[0002] With the maturity and widespread acceptance of facial recognition technology, it has been applied in many fields, such as facial recognition access control and attendance, facial recognition phone unlocking, and facial recognition subway access. However, in public places where people are required to wear masks, the limited facial feature information available for mask recognition, coupled with higher thresholds for mask recognition scores, leads to less than ideal recognition results for certain groups. Summary of the Invention

[0003] To address the problems in the prior art, this application provides a face recognition method and apparatus that can effectively improve the efficiency of face recognition when wearing a mask, thereby increasing the authentication speed of users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates.

[0004] To solve at least one of the above problems, this application provides the following technical solution:

[0005] Firstly, this application provides a face recognition method, including:

[0006] Collect the first facial image of the user wearing a mask, and perform a recognition and comparison operation based on the first facial image and the historical facial images pre-stored in the background to obtain the first comparison score;

[0007] Determine whether the first comparison score exceeds a preset first benchmark threshold. If so, control the gate to allow passage; otherwise, perform a re-verification operation on the second face image when the user removes their mask to obtain a second comparison score.

[0008] If the second comparison score exceeds a preset second benchmark threshold, then the deviation between the second comparison score and the first comparison score is determined, and the first benchmark threshold is updated based on the deviation value.

[0009] Further, a recognition and comparison operation is performed based on the first facial image and historical facial images pre-stored in the background to obtain a first comparison score. It is then determined whether the first comparison score exceeds a preset first benchmark threshold. If so, the gate is controlled to allow passage, including:

[0010] A first comparison score is obtained by comparing the first face image with the first historical face image pre-stored in the background. The first historical face image is a historical face image of the user wearing a mask.

[0011] If the first comparison score exceeds a preset first benchmark threshold, the gate is controlled to allow passage. The first benchmark threshold is the threshold used when performing recognition and comparison operations on the first facial image of the user wearing a mask.

[0012] Further, the re-verification operation of the second facial image when the user removes their mask, obtaining a second comparison score, and determining that the second comparison score exceeds a preset second benchmark threshold, includes:

[0013] The system prompts the user to remove their mask and captures a second facial image of the user when they remove their mask. The captured second facial image is then compared with a second historical facial image pre-stored in the background to obtain a second comparison score. The second historical facial image is a historical facial image of the user when they are not wearing a mask.

[0014] The second comparison score is determined to exceed a preset second benchmark threshold, wherein the second benchmark threshold is the threshold used when performing recognition and comparison operations on a second face image when the user is not wearing a mask.

[0015] Further, determining the deviation between the second alignment score and the first alignment score, and updating the first benchmark threshold based on the deviation, includes:

[0016] The deviation between the second comparison score and the first comparison score is determined based on the difference between the first comparison score and the first benchmark threshold, and the difference between the second comparison score and the second benchmark threshold.

[0017] The first benchmark threshold is lowered based on the deviation value to obtain the updated first benchmark threshold.

[0018] Secondly, this application provides a face recognition device, comprising:

[0019] The first recognition and comparison module is used to collect the first face image of the user wearing a mask, and to perform recognition and comparison operations based on the first face image, historical face images pre-stored in the background, and a preset benchmark threshold to obtain a first comparison score.

[0020] The second identification and comparison module is used to determine whether the first comparison score exceeds a preset first benchmark threshold. If so, the gate is controlled to allow passage; otherwise, a re-verification operation is performed on the second face image when the user removes his / her mask to obtain the second comparison score.

[0021] The threshold adjustment module is used to determine whether the second comparison score exceeds a preset second benchmark threshold. If so, it determines the deviation between the second comparison score and the first comparison score, and updates the first benchmark threshold according to the deviation.

[0022] Furthermore, the first identification and comparison module includes:

[0023] The first comparison unit is used to perform a recognition and comparison operation based on the first face image and the first historical face image pre-stored in the background to obtain a first comparison score, wherein the first historical face image is a historical face image of the user wearing a mask.

[0024] The gate opening and passage unit is used to control the gate to release passage if the first comparison score exceeds a preset first benchmark threshold, wherein the first benchmark threshold is the threshold used when performing recognition and comparison operations on the first face image of the user wearing a mask.

[0025] Furthermore, the second identification and comparison module includes:

[0026] The second comparison unit is used to prompt the user to remove the mask and collect a second facial image of the user when removing the mask. The collected second facial image is compared with a second historical facial image pre-stored in the background to obtain a second comparison score. The second historical facial image is a historical facial image of the user when not wearing a mask.

[0027] The threshold comparison unit is used to determine whether the second comparison score exceeds a preset second benchmark threshold, wherein the second benchmark threshold is the threshold used when performing recognition and comparison operations on a second face image when the user is not wearing a mask.

[0028] Furthermore, the threshold adjustment module includes:

[0029] The deviation determination unit is used to determine the deviation value between the second comparison score and the first comparison score based on the difference between the first comparison score and the first benchmark threshold, and the difference between the second comparison score and the second benchmark threshold.

[0030] The threshold adjustment unit is used to lower the first reference threshold according to the deviation value to obtain the updated first reference threshold.

[0031] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the face recognition method.

[0032] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned face recognition method.

[0033] Fifthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the aforementioned face recognition method.

[0034] As can be seen from the above technical solution, this application provides a face recognition method and device. It acquires a first face image of a user wearing a mask, performs a recognition comparison operation based on the first face image, historical face images pre-stored in the background, and a preset benchmark threshold, and obtains a first comparison score. If the recognition comparison operation results in a failure, a re-verification operation is performed on a second face image of the user without a mask, and a second comparison score is obtained. It is determined that the second comparison score exceeds a preset second benchmark threshold; if so, the deviation value between the second comparison score and the first comparison score is determined, and the first benchmark threshold is updated based on the deviation value of the re-verification operation result. This application can effectively improve the face recognition efficiency when wearing a mask, thereby increasing the authentication speed of users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This is one of the flowcharts illustrating the face recognition method in the embodiments of this application;

[0037] Figure 2 This is a second schematic flowchart of the face recognition method in the embodiments of this application;

[0038] Figure 3 This is the third flowchart illustrating the face recognition method in this application embodiment;

[0039] Figure 4 This is the fourth flowchart illustrating the face recognition method in the embodiments of this application;

[0040] Figure 5 This is one of the structural diagrams of the face recognition device in the embodiments of this application;

[0041] Figure 6 This is the second structural diagram of the face recognition device in the embodiments of this application;

[0042] Figure 7 This is the third structural diagram of the face recognition device in the embodiments of this application;

[0043] Figure 8 This is the fourth structural diagram of the face recognition device in the embodiments of this application;

[0044] Figure 9 This is a schematic diagram of the structure of the electronic device in the embodiments of this application. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0047] In view of the problems existing in the prior art, this application provides a face recognition method and device. The method involves acquiring a first face image of a user wearing a mask, comparing the first face image with historical face images pre-stored in the background and a preset benchmark threshold to obtain a first comparison score. If the comparison operation fails, a second face image of the user without a mask is used for re-verification to obtain a second comparison score. The method determines if the second comparison score exceeds a preset second benchmark threshold. If so, the deviation between the second and first comparison scores is determined, and the first benchmark threshold is updated based on the deviation from the re-verification result. This application can effectively improve the efficiency of face recognition when wearing a mask, thereby increasing the authentication speed for users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates.

[0048] To effectively improve the efficiency of facial recognition when users are wearing masks, thereby increasing the authentication speed for users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates, this application provides an embodiment of a facial recognition method, see [link to embodiment]. Figure 1 The face recognition method specifically includes the following:

[0049] Step S101: Collect the first face image of the user wearing a mask, and perform a recognition and comparison operation based on the first face image and the historical face images pre-stored in the background to obtain the first comparison score.

[0050] Optionally, this application can first register the faces of the passersby. If the passersby are wearing masks and pass through the gate using facial recognition, the front end of this application first captures the first face image of the person wearing a mask, and the back end facial recognition system searches and compares the images, returning the ID of the person with the highest similarity and the first comparison score. If the first comparison score is greater than the first baseline threshold m when wearing a mask, the gate opens and the user is allowed to pass, while the recognition and comparison pass score p1 is recorded. If the first comparison score is less than the first baseline threshold m, the recognition and comparison pass score f1 is recorded.

[0051] Step S102: Determine whether the first comparison score exceeds the preset first benchmark threshold. If yes, control the gate to allow passage; otherwise, perform a re-verification operation on the second face image when the user removes their mask to obtain the second comparison score.

[0052] Step S103: Determine that the second comparison score exceeds a preset second benchmark threshold. If so, determine the deviation between the second comparison score and the first comparison score, and update the first benchmark threshold according to the deviation.

[0053] Optionally, when user recognition fails while wearing a mask, this application can notify the person passing through to remove their mask for normal face recognition. In this case, the front-end of this application captures a second face image of the person without a mask, and the back-end face recognition system searches and compares the images, returning the ID of the person with the highest similarity and a second comparison score. If the second comparison score is greater than the second baseline threshold n for the user without a mask, the gate opens, allowing the user to pass, and the recognition pass score p2 is recorded. If the second comparison score is less than the second baseline threshold n, the recognition pass score f2 is recorded.

[0054] Understandably, for typical threshold settings, the following relationship exists:

[0055] The manufacturer's recommended threshold r is less than the first baseline threshold m when wearing a mask, and less than the second baseline threshold n when not wearing a mask.

[0056] Optionally, for registered users, the score distribution corresponding to the above data collection process generally follows the following relationship:

[0057] Manufacturer recommended threshold r < mask comparison failure score f1 < normal comparison failure score f2 < first benchmark threshold m when wearing a mask < mask comparison success score p1 < second benchmark threshold n when not wearing a mask < normal comparison success score p2.

[0058] Specifically, in order to improve the success rate of mask recognition, this application can appropriately adjust the first baseline threshold m when wearing a mask, so that users whose mask recognition effect is not obvious can improve the pass rate.

[0059] Specifically, for users whose mask recognition fails but succeeds under normal circumstances, and whose IDs match the highest-scoring user in both mask and normal comparison searches, the mask failure score f1 and the normal comparison score p2 are obtained. In this case, the mask failure score f1 should be considered a passable threshold score, so the first baseline threshold m set for wearing a mask should be close to the value of f1. By collecting a large number of data values ​​in such cases, and combining the currently set first baseline threshold m for wearing a mask and the second baseline threshold n for not wearing a mask, the first baseline threshold m for wearing a mask is continuously iteratively updated and adjusted according to the actual situation.

[0060] Calculate the deviation value Δ:

[0061]

[0062] The first baseline threshold m for wearing a mask is then adjusted and updated based on the deviation value Δ as follows:

[0063] m=m-Δ

[0064] As described above, the face recognition method provided in this application can acquire a first face image of a user wearing a mask, perform a recognition comparison operation based on the first face image, historical face images pre-stored in the background, and a preset benchmark threshold to obtain a first comparison score; if the result of the recognition comparison operation is a failure, a re-verification operation is performed on a second face image of the user when the mask is removed to obtain a second comparison score; it is determined that the second comparison score exceeds a preset second benchmark threshold, and if so, the deviation value between the second comparison score and the first comparison score is determined, and the first benchmark threshold is updated based on the deviation value of the re-verification operation result; this application can effectively improve the face recognition efficiency when wearing a mask, thereby improving the authentication speed of users passing through the gate while wearing a mask, reducing queuing, and improving the efficiency of entering and exiting the gate.

[0065] In one embodiment of the face recognition method of this application, see [link to embodiment]. Figure 2 It can also specifically include the following:

[0066] Step S201: Perform a recognition and comparison operation based on the first face image and the first historical face image pre-stored in the background to obtain a first comparison score, wherein the first historical face image is a historical face image of the user wearing a mask.

[0067] Step S202: If the first comparison score exceeds a preset first benchmark threshold, the gate is controlled to allow passage, wherein the first benchmark threshold is the threshold used when performing recognition and comparison operations on the first face image of the user wearing a mask.

[0068] Optionally, this application can first register the faces of the passersby. If the passersby are wearing masks and pass through the gate using facial recognition, the front end of this application first captures the first face image of the person wearing a mask, and the back end facial recognition system searches and compares the images, returning the ID of the person with the highest similarity and the first comparison score. If the first comparison score is greater than the first baseline threshold m when wearing a mask, the gate opens and the user is allowed to pass, while the recognition and comparison pass score p1 is recorded. If the first comparison score is less than the first baseline threshold m, the recognition and comparison pass score f1 is recorded.

[0069] In one embodiment of the face recognition method of this application, see [link to embodiment]. Figure 3 It can also specifically include the following:

[0070] Step S301: Prompt the user to remove their mask and collect a second facial image of the user when removing their mask. Compare the collected second facial image with a second historical facial image pre-stored in the background to obtain a second comparison score. The second historical facial image is a historical facial image of the user when they are not wearing a mask.

[0071] Step S302: Determine that the second comparison score exceeds a preset second benchmark threshold, wherein the second benchmark threshold is the threshold used when performing recognition and comparison operations on the second face image when the user is not wearing a mask.

[0072] Optionally, when user recognition fails while wearing a mask, this application can notify the person passing through to remove their mask for normal face recognition. In this case, the front-end of this application captures a second face image of the person without a mask, and the back-end face recognition system searches and compares the images, returning the ID of the person with the highest similarity and a second comparison score. If the second comparison score is greater than the second baseline threshold n for the user without a mask, the gate opens, allowing the user to pass, and the recognition pass score p2 is recorded. If the second comparison score is less than the second baseline threshold n, the recognition pass score f2 is recorded.

[0073] Understandably, for typical threshold settings, the following relationship exists:

[0074] The manufacturer's recommended threshold r is less than the first baseline threshold m when wearing a mask, and less than the second baseline threshold n when not wearing a mask.

[0075] Optionally, for registered users, the score distribution corresponding to the above data collection process generally follows the following relationship:

[0076] Manufacturer recommended threshold r < mask comparison failure score f1 < normal comparison failure score f2 < first benchmark threshold m when wearing a mask < mask comparison success score p1 < second benchmark threshold n when not wearing a mask < normal comparison success score p2.

[0077] Specifically, in order to improve the success rate of mask recognition, this application can appropriately adjust the first baseline threshold m when wearing a mask, so that users whose mask recognition effect is not obvious can improve the pass rate.

[0078] In one embodiment of the face recognition method of this application, see [link to embodiment]. Figure 4 It can also specifically include the following:

[0079] Step S401: Determine the deviation value between the second comparison score and the first comparison score based on the difference between the first comparison score and the first benchmark threshold, and the difference between the second comparison score and the second benchmark threshold.

[0080] Step S402: Adjust the first reference threshold according to the deviation value to obtain the updated first reference threshold.

[0081] Specifically, for users whose mask recognition fails but succeeds under normal circumstances, and whose IDs match the highest-scoring user in both mask and normal comparison searches, the mask failure score f1 and the normal comparison score p2 are obtained. In this case, the mask failure score f1 should be considered a passable threshold score, so the first baseline threshold m set for wearing a mask should be close to the value of f1. By collecting a large number of data values ​​in such cases, and combining the currently set first baseline threshold m for wearing a mask and the second baseline threshold n for not wearing a mask, the first baseline threshold m for wearing a mask is continuously iteratively updated and adjusted according to the actual situation.

[0082] Calculate the deviation value Δ:

[0083]

[0084] The first baseline threshold m for wearing a mask is then adjusted and updated based on the deviation value Δ as follows:

[0085] m=m-Δ

[0086] To effectively improve the efficiency of facial recognition when users are wearing masks, thereby increasing the authentication speed for users passing through gates while wearing masks, reducing queuing, and improving entry and exit efficiency, this application provides an embodiment of a facial recognition device for implementing all or part of the aforementioned facial recognition method. See [link to embodiment]. Figure 5 The facial recognition device specifically includes the following components:

[0087] The first identification and comparison module 10 is used to collect a first face image of a user wearing a mask, and to perform identification and comparison operations based on the first face image, historical face images pre-stored in the background, and a preset benchmark threshold to obtain a first comparison score.

[0088] The second identification and comparison module 20 is used to determine whether the first comparison score exceeds a preset first benchmark threshold. If so, the gate is controlled to allow passage; otherwise, a re-verification operation is performed on the second face image when the user removes his / her mask to obtain the second comparison score.

[0089] The threshold adjustment module 30 is used to determine whether the second comparison score exceeds a preset second benchmark threshold. If so, it determines the deviation value between the second comparison score and the first comparison score, and updates the first benchmark threshold according to the deviation value.

[0090] As described above, the face recognition device provided in this application can acquire a first face image of a user wearing a mask, and perform a recognition comparison operation based on the first face image, historical face images pre-stored in the background, and a preset benchmark threshold to obtain a first comparison score. If the recognition comparison operation results in failure, a re-verification operation is performed on a second face image of the user when the mask is removed to obtain a second comparison score. It is determined that the second comparison score exceeds a preset second benchmark threshold. If so, the deviation value between the second comparison score and the first comparison score is determined, and the first benchmark threshold is updated based on the deviation value of the re-verification operation. This application can effectively improve the face recognition efficiency when wearing a mask, thereby increasing the authentication speed of users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates.

[0091] In one embodiment of the face recognition device of this application, see Figure 6 The first identification and comparison module 10 includes:

[0092] The first comparison unit 11 is used to perform a recognition and comparison operation based on the first face image and the first historical face image pre-stored in the background to obtain a first comparison score, wherein the first historical face image is a historical face image of the user wearing a mask.

[0093] The gate opening and passage unit 12 is used to control the gate to release passage if the first comparison score exceeds a preset first benchmark threshold, wherein the first benchmark threshold is the threshold used when performing recognition and comparison operations on the first face image of the user wearing a mask.

[0094] In one embodiment of the face recognition device of this application, see Figure 7 The second identification and comparison module 20 includes:

[0095] The second comparison unit 21 is used to prompt the user to remove the mask and collect a second facial image of the user when removing the mask. The collected second facial image is compared with a second historical facial image pre-stored in the background to obtain a second comparison score. The second historical facial image is a historical facial image of the user when not wearing a mask.

[0096] The threshold comparison unit 22 is used to determine that the second comparison score exceeds a preset second benchmark threshold, wherein the second benchmark threshold is the threshold used when performing recognition and comparison operations on the second face image when the user is not wearing a mask.

[0097] In one embodiment of the face recognition device of this application, see Figure 8 The threshold adjustment module 30 includes:

[0098] The deviation determination unit 31 is used to determine the deviation value between the second comparison score and the first comparison score based on the difference between the first comparison score and the first benchmark threshold and the difference between the second comparison score and the second benchmark threshold.

[0099] The threshold adjustment unit 32 is used to adjust the first reference threshold downward according to the deviation value to obtain the updated first reference threshold.

[0100] From a hardware perspective, in order to effectively improve the efficiency of facial recognition when wearing masks, thereby increasing the authentication speed for users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates, this application provides an embodiment of an electronic device for implementing all or part of the aforementioned facial recognition method. The electronic device specifically includes the following components:

[0101] The system comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to transmit information between the face recognition device and core business systems, user terminals, and related databases and other related devices; the logic controller can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the logic controller can be implemented with reference to the embodiments of the face recognition method and the face recognition device in the embodiments, the content of which is incorporated herein, and repeated details will not be described again.

[0102] It is understood that the user terminal may include smartphones, tablet computers, network set-top boxes, portable computers, desktop computers, personal digital assistants (PDAs), in-vehicle devices, smart wearable devices, etc. Among these, the smart wearable devices may include smart glasses, smartwatches, smart bracelets, etc.

[0103] In practical applications, the face recognition method can be partially executed on the electronic device side as described above, or all operations can be completed in the client device. The choice can be made based on the processing power of the client device and the limitations of the user's usage scenario. This application does not impose any limitations on this. If all operations are completed in the client device, the client device may further include a processor.

[0104] The aforementioned client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission. The server may include a server on the task scheduling center side; in other implementation scenarios, it may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, a server cluster consisting of multiple servers, or a distributed server structure.

[0105] Figure 9 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application. Figure 9 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that... Figure 9 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.

[0106] In one embodiment, the face recognition method functionality can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:

[0107] Step S101: Collect the first face image of the user wearing a mask, and perform a recognition and comparison operation based on the first face image and the historical face images pre-stored in the background to obtain the first comparison score.

[0108] Step S102: Determine whether the first comparison score exceeds the preset first benchmark threshold. If yes, control the gate to allow passage; otherwise, perform a re-verification operation on the second face image when the user removes their mask to obtain the second comparison score.

[0109] Step S103: Determine that the second comparison score exceeds a preset second benchmark threshold. If so, determine the deviation between the second comparison score and the first comparison score, and update the first benchmark threshold according to the deviation.

[0110] As described above, the electronic device provided in this application collects a first facial image of a user wearing a mask, performs a recognition and comparison operation based on the first facial image, historical facial images pre-stored in the background, and a preset benchmark threshold to obtain a first comparison score; if the result of the recognition and comparison operation is a failure, a re-verification operation is performed on a second facial image of the user when the mask is removed to obtain a second comparison score; it is determined that the second comparison score exceeds a preset second benchmark threshold, and if so, the deviation value between the second comparison score and the first comparison score is determined, and the first benchmark threshold is updated based on the deviation value of the re-verification operation result; this application can effectively improve the efficiency of facial recognition when wearing a mask, thereby improving the authentication speed of users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates.

[0111] In another embodiment, the face recognition device can be configured separately from the central processing unit 9100. For example, the face recognition device can be configured as a chip connected to the central processing unit 9100, and the face recognition method function can be implemented through the control of the central processing unit.

[0112] like Figure 9 As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily need to include these components. Figure 9 All components shown; in addition, the electronic device 9600 may also include Figure 9 For components not shown, please refer to existing technology.

[0113] like Figure 9 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs and controls the operation of various components of the electronic device 9600.

[0114] The memory 9140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.

[0115] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.

[0116] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 9100.

[0117] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0118] The communication module 9110 is a transmitter / receiver 9110 that transmits and receives signals via the antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processing unit 9100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.

[0119] Based on different communication technologies, multiple communication modules 9110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby realizing typical telecommunications functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 9130 is coupled to a central processing unit 9100, enabling on-device recording via the microphone 9132 and on-device playback of stored sound via the speaker 9131.

[0120] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the face recognition method with a server or client execution subject in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the face recognition method with a server or client execution subject in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0121] Step S101: Collect the first face image of the user wearing a mask, and perform a recognition and comparison operation based on the first face image and the historical face images pre-stored in the background to obtain the first comparison score.

[0122] Step S102: Determine whether the first comparison score exceeds the preset first benchmark threshold. If yes, control the gate to allow passage; otherwise, perform a re-verification operation on the second face image when the user removes their mask to obtain the second comparison score.

[0123] Step S103: Determine that the second comparison score exceeds a preset second benchmark threshold. If so, determine the deviation between the second comparison score and the first comparison score, and update the first benchmark threshold according to the deviation.

[0124] As described above, the computer-readable storage medium provided in this application embodiment acquires a first facial image of a user wearing a mask, performs a recognition and comparison operation based on the first facial image, historical facial images pre-stored in the background, and a preset benchmark threshold to obtain a first comparison score; if the result of the recognition and comparison operation is a failure, a re-verification operation is performed on a second facial image of the user when the mask is removed to obtain a second comparison score; it is determined that the second comparison score exceeds a preset second benchmark threshold, and if so, the deviation value between the second comparison score and the first comparison score is determined, and the first benchmark threshold is updated based on the deviation value of the re-verification operation result; this application can effectively improve the efficiency of facial recognition when wearing a mask, thereby improving the authentication speed of users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates.

[0125] Embodiments of this application also provide a computer program product capable of implementing all steps of the face recognition method in the above embodiments, where the execution subject is a server or a client. When this computer program / instruction is executed by a processor, it implements the steps of the face recognition method. For example, the computer program / instruction implements the following steps:

[0126] Step S101: Collect the first face image of the user wearing a mask, and perform a recognition and comparison operation based on the first face image and the historical face images pre-stored in the background to obtain the first comparison score.

[0127] Step S102: Determine whether the first comparison score exceeds the preset first benchmark threshold. If yes, control the gate to allow passage; otherwise, perform a re-verification operation on the second face image when the user removes their mask to obtain the second comparison score.

[0128] Step S103: Determine that the second comparison score exceeds a preset second benchmark threshold. If so, determine the deviation between the second comparison score and the first comparison score, and update the first benchmark threshold according to the deviation.

[0129] As described above, the computer program product provided in this application collects a first facial image of a user wearing a mask, performs a recognition and comparison operation based on the first facial image, historical facial images pre-stored in the background, and a preset benchmark threshold to obtain a first comparison score; if the result of the recognition and comparison operation is a failure, a re-verification operation is performed on a second facial image of the user when the mask is removed to obtain a second comparison score; it is determined that the second comparison score exceeds a preset second benchmark threshold, and if so, the deviation value between the second comparison score and the first comparison score is determined, and the first benchmark threshold is updated based on the deviation value of the re-verification operation result; this application can effectively improve the efficiency of facial recognition when wearing a mask, thereby improving the authentication speed of users passing through gates while wearing masks, reducing queuing, and improving the efficiency of entering and exiting gates.

[0130] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0131] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0132] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0133] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0134] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A face recognition method, characterized in that, The method includes: Collect the first facial image of the user wearing a mask, and perform a recognition and comparison operation based on the first facial image and the historical facial images pre-stored in the background to obtain the first comparison score; Determine whether the first comparison score exceeds a preset first benchmark threshold. If so, control the gate to allow passage; otherwise, perform a re-verification operation on the second face image when the user removes their mask to obtain a second comparison score. Determine whether the second comparison score exceeds a preset second benchmark threshold. If so, determine the deviation between the second comparison score and the first comparison score, and update the first benchmark threshold based on the deviation. After determining that the first comparison score does not exceed a preset first benchmark threshold, the method further includes: recording the mask comparison failure score; after determining that the second comparison score exceeds a preset second benchmark threshold, the method further includes: controlling the gate to allow passage and recording the normal comparison success score; correspondingly, determining the deviation value between the second comparison score and the first comparison score includes: The deviation value is determined according to the following formula: Where n is the preset second benchmark threshold, and m is the preset first benchmark threshold. f 1 represents the score for failed mask matching. p 2 This is the score for a successful normal comparison.

2. The face recognition method according to claim 1, characterized in that, A comparison operation is performed between the first facial image and historical facial images pre-stored in the background to obtain a first comparison score. It is then determined whether the first comparison score exceeds a preset first baseline threshold. If so, the gate is controlled to allow passage, including: A first comparison score is obtained by comparing the first face image with the first historical face image pre-stored in the background. The first historical face image is a historical face image of the user wearing a mask. If the first comparison score exceeds a preset first benchmark threshold, the gate is controlled to allow passage. The first benchmark threshold is the threshold used when performing recognition and comparison operations on the first facial image of the user wearing a mask.

3. The face recognition method according to claim 2, characterized in that, The re-verification operation of the second facial image when the user removes their mask, obtaining a second comparison score, and determining whether the second comparison score exceeds a preset second benchmark threshold, includes: The system prompts the user to remove their mask and captures a second facial image of the user when they remove their mask. The captured second facial image is then compared with a second historical facial image pre-stored in the background to obtain a second comparison score. The second historical facial image is a historical facial image of the user when they are not wearing a mask. The second comparison score is determined to exceed a preset second benchmark threshold, wherein the second benchmark threshold is the threshold used when performing recognition and comparison operations on a second face image when the user is not wearing a mask.

4. The face recognition method according to claim 3, characterized in that, The step of determining the deviation between the second alignment score and the first alignment score, and updating the first benchmark threshold based on the deviation, includes: The deviation between the second comparison score and the first comparison score is determined based on the difference between the first comparison score and the first benchmark threshold, and the difference between the second comparison score and the second benchmark threshold. The first benchmark threshold is lowered based on the deviation value to obtain the updated first benchmark threshold.

5. A face recognition device, characterized in that, include: The first recognition and comparison module is used to collect the first face image of the user wearing a mask, and to perform recognition and comparison operations based on the first face image, historical face images pre-stored in the background, and a preset benchmark threshold to obtain a first comparison score. The second identification and comparison module is used to determine whether the first comparison score exceeds a preset first benchmark threshold. If so, the gate is controlled to allow passage; otherwise, a re-verification operation is performed on the second face image when the user removes his / her mask to obtain the second comparison score. The threshold adjustment module is used to determine whether the second comparison score exceeds a preset second benchmark threshold. If so, it determines the deviation between the second comparison score and the first comparison score, and updates the first benchmark threshold according to the deviation. After determining that the first comparison score does not exceed a preset first benchmark threshold, the method further includes: recording the mask comparison failure score; after determining that the second comparison score exceeds a preset second benchmark threshold, the method further includes: controlling the gate to allow passage and recording the normal comparison success score; correspondingly, determining the deviation value between the second comparison score and the first comparison score includes: The deviation value is determined according to the following formula: Where n is the preset second benchmark threshold, and m is the preset first benchmark threshold. f 1 represents the score for failed mask matching. p 2 This is the score for a successful normal comparison.

6. The face recognition device according to claim 5, characterized in that, The first identification and comparison module includes: The first comparison unit is used to perform a recognition and comparison operation based on the first face image and the first historical face image pre-stored in the background to obtain a first comparison score, wherein the first historical face image is a historical face image of the user wearing a mask. The gate opening and passage unit is used to control the gate to release passage if the first comparison score exceeds a preset first benchmark threshold, wherein the first benchmark threshold is the threshold used when performing recognition and comparison operations on the first face image of the user wearing a mask.

7. The face recognition device according to claim 6, characterized in that, The second identification and comparison module includes: The second comparison unit is used to prompt the user to remove the mask and collect a second facial image of the user when removing the mask. The collected second facial image is compared with a second historical facial image pre-stored in the background to obtain a second comparison score. The second historical facial image is a historical facial image of the user when not wearing a mask. The threshold comparison unit is used to determine whether the second comparison score exceeds a preset second benchmark threshold, wherein the second benchmark threshold is the threshold used when performing recognition and comparison operations on a second face image when the user is not wearing a mask.

8. The face recognition device according to claim 7, characterized in that, The threshold adjustment module includes: The deviation determination unit is used to determine the deviation value between the second comparison score and the first comparison score based on the difference between the first comparison score and the first benchmark threshold, and the difference between the second comparison score and the second benchmark threshold. The threshold adjustment unit is used to lower the first reference threshold according to the deviation value to obtain the updated first reference threshold.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the face recognition method according to any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the face recognition method according to any one of claims 1 to 4.

11. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the face recognition method according to any one of claims 1 to 4.