Face recognition method and access control equipment

By dynamically adjusting the camera's frame rate and calling the second camera, and combining with the twin network to confirm the face matching results, the problem of inaccurate recognition of the access control device when the object to be identified is advanced rapidly or the environment brightness is low, the recognition accuracy is improved and the recognition is optimized. Power consumption realizes efficient face recognition of access control equipment.

CN119296218APending Publication Date: 2025-01-10SHENZHEN AOYAN TECH DEV CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411446278.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The problem of inaccurate facial recognition when the object to be identified is fast or the environment brightness is low.

Method used

By obtaining the travel speed and ambient brightness of the object to be identified, dynamically adjust the image acquisition frame rate of the camera, and call the second camera to collect images when necessary, and confirm the face matching results with the twin network to improve the recognition accuracy.

Benefits of technology

When the object to be identified is moving forward quickly or the ambient brightness is low, the acquisition frame rate is increased to improve the recognition accuracy, and the number of analyzing images increases within a unit time, but under normal circumstances, the power consumption and computing resource consumption are reduced, realizing the trade-off between power consumption and accuracy , improves the identification accuracy of access control equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296218A_ABST
    Figure CN119296218A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of access control equipment. The invention provides a face recognition method and access control equipment, the face recognition method is applied to the access control equipment, and the access control equipment calls a second camera to collect a second original image when recognizing that the advancing speed of a to-be-recognized object is greater than a preset speed threshold value or the ambient brightness is smaller than a preset brightness threshold value; obtaining a face matching result of a first original image collected by the first camera and a second original image collected by the second camera by using a pre-trained twin network; and when the face recognition result is that the to-be-recognized object is matched with the face library and the face matching result is that the first original image is matched with the second original image, sending a control instruction to perform unlocking operation. According to the invention, the fast movement of the to-be-recognized object and the face recognition precision in the dark environment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of access control technology, and in particular to a face recognition method and an access control device. Background Art

[0002] Access control devices, such as those commonly installed in warehouses, residential areas, and office buildings, currently use cameras to capture faces directly, then identify feature vectors and match them with feature vectors in a face library. If a match is found, the device will unlock the door.

[0003] In some scenarios, when the object to be identified moves at a fast speed or the ambient brightness is poor, inaccurate identification may occur. Summary of the invention

[0004] The present invention aims to solve the problem in the prior art that the travel speed and ambient brightness of an object to be identified cannot be adapted to perform face recognition.

[0005] In a first aspect, the present invention provides a face recognition method, which is applied to an access control device, and the method comprises: obtaining a travel speed and an ambient brightness of an object to be recognized; controlling an image acquisition frame rate of a first camera according to the travel speed and the ambient brightness and acquiring a first original image at the acquisition frame rate, wherein the acquisition frame rate is proportional to the travel speed and the ambient brightness of the object to be recognized, and the first original image comprises the object to be recognized; if the travel speed is less than a preset speed threshold, and the ambient brightness is greater than a preset brightness threshold, directly using the first original image and a face recognition model to obtain a face recognition result, and when the face recognition result is that the object to be recognized matches a face library, sending a control instruction to the access control device, so that the access control device performs an unlocking operation in response to the control instruction; if the travel speed is greater than the preset speed threshold, the ambient brightness is greater than the preset brightness threshold, and the face recognition result is obtained by directly using the first original image and a face recognition model, and when the face recognition result is that the object to be recognized matches a face library, sending a control instruction to the access control device, so that the access control device performs an unlocking operation in response to the control instruction; The preset speed threshold, or the ambient brightness is less than the preset brightness threshold, calls the second camera to capture a second original image, the second original image includes the object to be identified; wherein, the second camera and the first camera have different acquisition angles; the first original image and the second original image are sent to the face recognition model, and the face recognition model outputs a first eigenvector, a second eigenvector and a face recognition result; the first eigenvector and the second eigenvector are sent to the pre-trained twin network to obtain a face matching result of the first original image and the second original image; when the face recognition result is that the object to be identified matches the face library, and the face matching result is that the first original image matches the second original image, a control instruction is sent to the access control device, so that the access control device responds to the control instruction to perform an unlocking operation.

[0006] In some embodiments, the face recognition method further includes: training a speed recognition model using footstep audio; collecting the footstep audio using a microphone, and confirming the moving speed of the object to be recognized using the speed recognition model and the footstep audio.

[0007] In some embodiments, the face recognition method also includes: capturing an environmental image based on a preset frame rate and a preset exposure; cropping and splicing the upper, lower, left and right areas of the environmental image to obtain a target environmental image; and calculating the average pixel brightness of the target environmental image to obtain the environmental brightness.

[0008] In some embodiments, the face recognition model includes a backbone network and a face library matching network; the first original image is sent to the backbone network so that the backbone network outputs a first feature vector; the first feature vector is sent to the face library matching network, and the face library matching network outputs a face recognition result based on the first feature vector and the feature vectors stored in the face library.

[0009] In some embodiments, the step of sending the first original image into the backbone network so that the backbone network outputs a first feature vector includes: obtaining an optical flow image and a pixel difference image corresponding to the first original image N frames before the current moment; N is an integer greater than 1; sequentially sending the optical flow image, the pixel difference image and the first original image of N frames into the time series extraction network to obtain N first feature vectors. In some embodiments, the first feature vector is sent into the face library matching network, and the face library matching network outputs a face recognition result based on the first feature vector and the feature vectors stored in the face library, including: sending the first feature vector into the gender recognition network to obtain male gender and female gender; if the gender is male, sending the first feature vector corresponding to the male gender into the male face library matching network to obtain a male face recognition result; if the gender is female, sending the first feature vector corresponding to the female gender into the female face library matching network to obtain a female face recognition result.

[0010] In some embodiments, the face recognition method further includes: sending the second original image to the backbone network so that the backbone network outputs a second feature vector.

[0011] In some embodiments, the loss function calculation formula for the face recognition model training is: L_ALL=L_S+L_P; wherein, L_ALL is the loss function value for the face recognition model training, and L_S is calculated by the difference between the output result of the face recognition model and the sample label; L_P is the loss function value of the twin network.

[0012] In some embodiments, L_P = (1-a)*0.4*d 2 +a*0.6*(md)2 , where a is the matching result, which takes the value of 1 or 0, d is the Euclidean distance between the first eigenvector and the second eigenvector, and m is the safety distance.

[0013] In a second aspect, the present invention provides an access control device, comprising: a first camera, a second camera; and one or more processors connected to the first camera and the second camera, wherein the one or more processors are configured to execute a face recognition program to implement the above-mentioned face recognition method.

[0014] The embodiment of the present invention increases the acquisition frame rate when the object to be identified moves forward quickly (for example, walking fast) or the ambient brightness is low. At this time, more images need to be analyzed per unit time, which will increase the power consumption of the system and the consumption of computing resources, but can improve the recognition accuracy. When the object to be identified moves normally and the ambient brightness is appropriate, images are acquired at a preset frame rate. At this time, the number of images that need to be analyzed per unit time is smaller, but because the brightness is high enough and the object to be identified stays in front of the camera for a longer time, the recognition accuracy will not drop significantly, thereby achieving a trade-off between power consumption and accuracy. Then, a twin network is used as a supplement to the face recognition model. When the images acquired by the two cameras match, it is confirmed that the face recognition result is a match between the object to be identified and the face library before the unlocking operation is performed, thereby improving the recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A schematic diagram of a flow chart of an embodiment of a face recognition method provided by the present invention;

[0016] Figure 2 A schematic diagram of a flow chart of another embodiment of the face recognition method provided by the present invention;

[0017] Figure 3 A functional block diagram of the access control device provided by the present invention;

[0018] Figure 4 A functional block diagram of a computer-readable storage device provided by the present invention.

[0019] In the accompanying drawings, the components represented by the reference numerals are listed as follows:

[0020] A first camera 11, a second camera 12, a face recognition model 20, a face library 21, a backbone network 22, a face library matching network 23, and a twin network 30. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0022] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0023] In the description of the present invention, the term "for example" is used to mean "used as an example, illustration or explanation". Any embodiment described as "for example" in the present invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present invention.

[0024] Example 1

[0025] Reference Figures 1 to 3 The present invention provides a face recognition method, which is applied to access control equipment, referring to Figure 1 , the method comprising:

[0026] S100, obtaining the travel speed and ambient brightness of the object to be identified;

[0027] The traveling speed of the object to be identified can be realized by sound or infrared medium. The present invention is preferably sound. The frequency of the footsteps audio is different at different traveling speeds of the object to be identified. Therefore, the frequency spectrum of the sound can be analyzed in practical applications to confirm the traveling speed of the object to be identified; However, in practical applications, there is a situation where the object to be identified stamps its feet in place or other working conditions occur, which leads to the mistaken belief that the object to be identified is moving forward quickly. Therefore, this embodiment preferably uses S110 to train the speed recognition model using footsteps audio; S120, uses a microphone to collect footsteps audio, and uses the speed recognition model and the footsteps audio to confirm the traveling speed of the object to be identified. In practical applications, the speed recognition model only needs to identify footsteps audio and non-footsteps audio (stomping or other audio), and then obtains the frequency of the footsteps audio, and obtains the traveling speed based on the mapping table of frequency and traveling speed, which is conducive to improving the calculation speed. In practical applications, only footsteps audio and other sounds need to be used, combined with footsteps audio tags and non-footsteps audio tags, to train the footsteps audio recognition model, and to obtain the speed recognition model in combination with the frequency analysis model.

[0028] The ambient brightness can be obtained by analyzing the collected image and the brightness value of the pixel. In other embodiments, it can also be achieved by a light measuring device. In this embodiment, it is preferably obtained by analyzing the collected image to reduce costs.

[0029] S200, controlling the image acquisition frame rate of the first camera 11 according to the travel speed and the ambient brightness, and acquiring a first original image at the acquisition frame rate, wherein the acquisition frame rate is proportional to the travel speed of the object to be identified and the ambient brightness, and the first original image includes the object to be identified;

[0030] In this embodiment, the weight Wp=Wa*travel speed+Wb*ambient brightness, and then the acquisition frame rate is obtained by Wp*preset frame rate, where the preset frame rate can be 25 frames, 30 frames, 50 frames, or 60 frames.

[0031] S310: if the travel speed is less than a preset speed threshold and the ambient brightness is greater than a preset brightness threshold, directly use the first original image and the face recognition model to obtain a face recognition result, and when the face recognition result is that the object to be recognized matches the face library, send a control instruction to the access control device, so that the access control device performs an unlocking operation in response to the control instruction;

[0032] In this embodiment, when the object to be identified moves normally and the ambient brightness is appropriate, images are captured at a preset frame rate. At this time, the number of images that need to be analyzed per unit time is smaller, but because the brightness is high enough and the object to be identified stays in front of the camera for a longer time, the recognition accuracy does not decrease.

[0033] It achieves a trade-off between power consumption and accuracy, and is very suitable for access control devices that need to use batteries as a power source, thus improving the battery life of access control devices.

[0034] S321. If the travel speed is greater than the preset speed threshold, or the ambient brightness is less than the preset brightness threshold, call the second camera 12 to capture a second original image; wherein the second camera 12 has a different acquisition angle from the first camera 11, and the second original image includes the object to be identified; illustratively, the first camera 11 is facing the object to be identified, and the second camera 12 can be one or more, shooting from 90 degrees (side), 60 degrees, 45 degrees, 30 degrees or other angles of the object to be identified.

[0035] In this embodiment, if the acquisition frame rate is increased when the object to be identified moves forward quickly (for example, walking fast) or the ambient brightness is low, more images need to be analyzed per unit time, which will increase the power consumption of the system and the consumption of computing resources, but can improve the recognition accuracy.

[0036] S322, sending the first original image and the second original image to a face recognition model, and the face recognition model outputs a first feature vector, a second feature vector, and a face recognition result;

[0037] S323, sending the first feature vector and the second feature vector to the pre-trained twin network 30 to obtain a face matching result of the first original image and the second original image;

[0038] S324: When the face recognition result is that the object to be recognized matches the face library, and the face matching result is that the first original image matches the second original image, a control instruction is sent to the access control device, so that the access control device performs an unlocking operation in response to the control instruction.

[0039] This embodiment supplements the twin network 30, which does not increase the amount of calculation too much and can avoid a significant increase in power consumption.

[0040] The embodiment of the present invention increases the acquisition frame rate when the object to be identified moves forward quickly (for example, walking fast) or the ambient brightness is low. At this time, more images need to be analyzed per unit time, which will increase the power consumption of the system and the consumption of computing resources, but can improve the recognition accuracy. When the object to be identified moves normally and the ambient brightness is appropriate, images are acquired at a preset frame rate. At this time, the number of images required to be analyzed per unit time is smaller, but because the brightness is high enough and the object to be identified stays in front of the camera for a longer time, the recognition accuracy will not drop significantly, thereby achieving a trade-off between power consumption and accuracy. Then, steps S322 to S324 use the twin network 30 as a supplement to the face recognition model. When the images captured by the two cameras match, it is confirmed that the face recognition result is a match between the object to be identified and the face library before the unlocking operation is performed, thereby improving the recognition accuracy.

[0041] In some embodiments, the face recognition method also includes: capturing an environmental image based on a preset frame rate and a preset exposure; cropping and splicing the upper, lower, left and right areas of the environmental image to obtain a target environmental image; and calculating the average pixel brightness of the target environmental image to obtain the environmental brightness.

[0042] In this embodiment, in order to reduce the number of parameters and calculations of the brightness calculation model, when calculating the brightness, the image is first cropped and spliced ​​to obtain the target environment image, and then the global light metering method is used for light metering. In practical applications, the upper, lower, left and right areas of the environment image can be cropped and spliced ​​according to the preset width and length. For example, if the environment image is 480*640, the upper side can be 100*400, the lower side can be 100*400, the left side can be 480*120, and the right side can be 480*120.

[0043] It should be noted that when the camera is triggered to collect environmental images, the object to be identified is often standing in front of the camera. At this time, the fill light or the display screen light of the access control device will cause the object to be identified to reflect light. If spot metering is used to calculate the reflection of the object to be identified, the ambient brightness calculation will be inaccurate. Global metering (using the average brightness of all pixels) can solve this problem, but global metering will increase the amount of calculation.

[0044] The present invention first cuts and splices the edges of the environmental image (the edges generally do not or less include the image area of ​​the object to be identified itself) to obtain the target environmental image, and then performs global light measurement on the target environmental image, that is, calculates the pixel brightness mean of the target environmental image, so as to accurately and efficiently calculate the environmental brightness.

[0045] Reference Figure 2 and Figure 3In some embodiments, the face recognition model includes a backbone network 22 and a face library matching network 23; the face recognition method further includes:

[0046] S410, sending the first original image to the backbone network 22, so that the backbone network 22 outputs a first feature vector;

[0047] Specifically, a convolutional neural network can be directly used as the backbone network 22 to extract the first feature vector; however, in order to improve the accuracy, this embodiment proposes a feature extraction method, that is, step S410 includes:

[0048] S411, obtaining an optical flow image and a pixel difference image corresponding to the first original image N frames before the current moment, where N is an integer greater than 1;

[0049] Wherein, assuming that the current moment is moment L, the optical flow image and pixel difference image at moments L to LN can be calculated by using the first original image at moment L and moments L-1 to LN-1;

[0050] Then, the optical flow image and the pixel difference image at each moment and the first original image are spliced ​​to obtain a spliced ​​image, and the process proceeds to step S412, that is, N frames of spliced ​​images are sequentially sent to a temporal extraction network to obtain N first feature vectors;

[0051] S412, sequentially sending N frames of the optical flow image, the pixel difference image and the first original image to a temporal extraction network to obtain N first feature vectors.

[0052] In this embodiment, the spliced ​​image has spatial information, and the first feature vector having spatial information and temporal information can be obtained by sequentially sending N frames of spliced ​​images to the time series extraction network, thereby improving recognition accuracy.

[0053] S420, the first feature vector is sent to the face database matching network 23, and the face database matching network 23 outputs a face recognition result according to the first feature vector and the feature vector stored in the face database 21.

[0054] The face library matching network 23, that is, pre-shooting the face image of the authorized object to be identified, and then extracting and storing the feature vector, and then if the distance between the first feature vector and the stored feature vector is less than a preset threshold, it is confirmed that the object to be identified matches the face library, that is, confirming that the identified object is the authorized object to be identified.

[0055] Reference Figure 2 and Figure 3In some embodiments, in order to reduce the amount of calculation of the face library matching network 23, the face library 21 can be divided into a male library and a female library for storage; then the gender is first identified, and then the corresponding library (male library and / or female library) is called. At this time, the amount of calculation for face library matching is halved, and the number of parameters is also greatly reduced. Specifically, step S420 includes:

[0056] S421, sending the first feature vector to a gender recognition network to obtain male gender and female gender;

[0057] S422, if the gender is male, sending the first feature vector corresponding to the male gender to the male face library matching network to obtain a male face recognition result;

[0058] S423: If the gender is female, the first feature vector corresponding to the female gender is sent to the female face library matching network to obtain a female face recognition result.

[0059] This embodiment effectively reduces the amount of calculation by dividing a single library into multiple libraries. The face library matching network 23 that does not use this method needs to traverse all the stored feature vectors in sequence and compare them one by one until the result is obtained, while the face library matching network 23 of this embodiment only needs to traverse the feature vectors of half of the face library 21, reducing the amount of calculation.

[0060] In some embodiments, the face recognition method further includes:

[0061] The second original image is sent to the backbone network 22 so that the backbone network 22 outputs the second eigenvector. In other words, this embodiment reuses the backbone network 22, outputs the first eigenvector and the second eigenvector as inputs of the twin network 30, and reduces the number of parameters of the twin network 30.

[0062] Furthermore, the present invention also designs a loss function of the face recognition model, and also considers the loss function of the twin network 30 when training the face recognition model.

[0063] In this embodiment, the training data of the face recognition model includes the first original image and the second original image. The amount of training data has increased, but the face recognition model takes into account the loss function of the twin network 30 during the training process. At this time, when the first original image and the second original image do not match, the face recognition model is more inclined to determine that the object to be recognized is an unauthorized object to be recognized. When the first original image and the second original image match, the face recognition model is more inclined to determine that the object to be recognized is an authorized object to be recognized, which is more in line with the recognition logic.

[0064] Specifically, the loss function calculation formula for face recognition model training can be as shown in Formula 1-1:

[0065] L_ALL=L_S+L_P (1-1)

[0066] Wherein, L_ALL is the loss function value of the face recognition model training, and L_S is calculated by the difference between the output result of the face recognition model and the sample label;

[0067] L_P is the loss function value of the twin network 30.

[0068] Furthermore, the loss function of the twin network 30 is as shown in Formula 1-2:

[0069] L_P=(1-a)*0.4*d 2 +a*0.6*(md) 2 (1-2)

[0070] Wherein, a is the matching result, and the value of a is 0 or 1. When the matching result is correct, a=1, and when the matching result is wrong, a=0. d is the Euclidean distance between the first eigenvector and the second eigenvector, and m is the safety distance.

[0071] In this embodiment, when the matching result is correct, the loss value is positively correlated with the Euclidean distance, and when the matching result is incorrect, the loss value is negatively correlated with the Euclidean distance.

[0072] Example 2

[0073] See also Figure 3 , Figure 3Schematic diagram of an embodiment of a door access control device provided by an embodiment of the present invention. The door access control device includes: a first camera 11, a second camera 12; and one or more processors connected to the first camera 11 and the second camera 12, wherein the one or more processors are configured to execute a face recognition program to implement the following steps: obtaining the travel speed and ambient brightness of the object to be identified; controlling the image acquisition frame rate of the first camera 11 according to the travel speed and the ambient brightness and acquiring a first original image at the acquisition frame rate, wherein the acquisition frame rate is proportional to the travel speed and ambient brightness of the object to be identified, and the first original image includes the object to be identified; if the travel speed is less than a preset speed threshold, and the ambient brightness is greater than a preset brightness threshold, directly using the first original image and the face recognition model to obtain a face recognition result, and when the face recognition result is that the object to be identified matches the face library, sending a control instruction to the door access control device so that the door access control device responds An unlocking operation should be performed in response to the control instruction; if the travel speed is greater than the preset speed threshold, or the ambient brightness is less than the preset brightness threshold, the second camera 12 is called to capture a second original image, and the second original image includes the object to be identified; wherein the second camera 12 has a different acquisition angle from the first camera 11; the first original image and the second original image are sent to a face recognition model, and the face recognition model outputs a first feature vector, a second feature vector and a face recognition result; the first feature vector and the second feature vector are sent to a pre-trained twin network 30 to obtain a face matching result of the first original image and the second original image; when the face recognition result is that the object to be identified matches the face library, and the face matching result is that the first original image and the second original image match, a control instruction is sent to the access control device, so that the access control device performs an unlocking operation in response to the control instruction.

[0074] In some embodiments, the face recognition method further includes: training a speed recognition model using footstep audio; collecting the footstep audio using a microphone, and confirming the moving speed of the object to be recognized using the speed recognition model and the footstep audio.

[0075] In some embodiments, the face recognition method further includes: collecting an environmental image based on a preset frame rate and a preset exposure; cutting and splicing the upper, lower, left and right areas of the environmental image to obtain a target environmental image; calculating the average pixel brightness of the target environmental image to obtain the environmental brightness. In some embodiments, the face recognition model includes a backbone network 22 and a face library matching network 23; the first original image is sent to the backbone network 22, so that the backbone network 22 outputs a first feature vector; the first feature vector is sent to the face library matching network 23, and the face library matching network 23 outputs a face recognition result based on the first feature vector and the feature vector stored in the face library 21.

[0076] In some embodiments, the sending of the first original image into the backbone network 22 so that the backbone network 22 outputs a first feature vector includes: obtaining an optical flow image and a pixel difference image corresponding to the first original image N frames before the current moment; N is an integer greater than 1; and sending N frames of the optical flow image, pixel difference image and first original image into a temporal extraction network in sequence to obtain N first feature vectors.

[0077] In some embodiments, the first feature vector is sent to the face library matching network 23, and the face library matching network 23 outputs a face recognition result based on the first feature vector and the feature vector stored in the face library 21, including: sending the first feature vector to the gender recognition network to obtain male gender and female gender; if it is male gender, sending the first feature vector corresponding to the male gender to the male face library matching network 23 to obtain a male face recognition result; if it is female gender, sending the first feature vector corresponding to the female gender to the female face library matching network 23 to obtain a female face recognition result.

[0078] In some embodiments, the face recognition method further includes: sending the second original image to the backbone network 22, so that the backbone network 22 outputs a second feature vector.

[0079] In some embodiments, the loss function calculation formula for the face recognition model training is: L_ALL=L_S+L_P; wherein, L_ALL is the loss function value for the face recognition model training, and L_S is calculated by the difference between the output result of the face recognition model and the sample label; L_P is the loss function value of the twin network 30.

[0080] In some embodiments, L_P = (1-a)*0.4*d 2 +a*0.6*(md) 2 ; Where a is the matching result, d is the Euclidean distance between the first eigenvector and the second eigenvector, and m is the safety distance.

[0081] Example 3

[0082] See also Figure 4 , Figure 4 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. Figure 4As shown, the present embodiment provides a computer-readable storage medium 40 on which a computer program 41 is stored, and when the computer program 41 is executed by a processor, the following steps are implemented: obtaining the travel speed and ambient brightness of the object to be identified; controlling the image acquisition frame rate of the first camera 11 according to the travel speed and the ambient brightness and acquiring a first original image at the acquisition frame rate, wherein the acquisition frame rate is proportional to the travel speed and the ambient brightness of the object to be identified, and the first original image includes the object to be identified; if the travel speed is less than a preset speed threshold, and the ambient brightness is greater than a preset brightness threshold, directly using the first original image and the face recognition model to obtain a face recognition result, and when the face recognition result is that the object to be identified matches the face library, sending a control instruction to the access control device, so that the access control device performs an unlocking operation in response to the control instruction; if When the travel speed is greater than the preset speed threshold, or the ambient brightness is less than the preset brightness threshold, the second camera 12 is called to capture a second original image, and the second original image includes the object to be identified; wherein the second camera 12 has a different acquisition angle from the first camera 11; the first original image and the second original image are sent to a face recognition model, and the face recognition model outputs a first feature vector, a second feature vector and a face recognition result; the first feature vector and the second feature vector are sent to a pre-trained twin network 30 to obtain a face matching result of the first original image and the second original image; when the face recognition result is that the object to be identified matches the face library, and the face matching result is that the first original image and the second original image match, a control instruction is sent to the access control device, so that the access control device performs an unlocking operation in response to the control instruction.

[0083] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0084] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented 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.

[0085] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0088] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0089] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A face recognition method, characterized in that: Applied to access control equipment, the method includes: Obtain the moving speed and ambient brightness of the object to be identified; Controlling the image acquisition frame rate of the first camera according to the travel speed and the ambient brightness and acquiring a first original image at the acquisition frame rate, wherein the acquisition frame rate is proportional to the travel speed and the ambient brightness, and the first original image includes an object to be identified; If the travel speed is less than the preset speed threshold and the ambient brightness is greater than the preset brightness threshold, directly use the first original image and the face recognition model to obtain a face recognition result, and when the face recognition result is that the object to be recognized matches the face library, send a control instruction to the access control device, so that the access control device performs an unlocking operation in response to the control instruction; If the travel speed is greater than the preset speed threshold, or the ambient brightness is less than the preset brightness threshold, calling a second camera to capture a second original image; wherein the second camera has a different capture angle from the first camera, and the second original image includes the object to be identified; Sending the first original image and the second original image to a face recognition model, wherein the face recognition model outputs a first feature vector, a second feature vector, and a face recognition result; Sending the first eigenvector and the second eigenvector into the pre-trained twin network to obtain a face matching result of the first original image and the second original image; When the face recognition result is that the object to be recognized matches the face library, and the face matching result is that the first original image matches the second original image, a control instruction is sent to the access control device, so that the access control device performs an unlocking operation in response to the control instruction.

2. The face recognition method according to claim 1, characterized in that: Also includes: Use footstep audio to train a speed recognition model; A microphone is used to collect footsteps audio, and the speed recognition model and the footsteps audio are used to confirm the moving speed of the object to be recognized.

3. The face recognition method according to claim 2, characterized in that: Also includes: Acquire an environmental image based on a preset frame rate and a preset exposure; Cutting and splicing the upper, lower, left and right areas of the environment image to obtain a target environment image; The average brightness of pixels in the target environment image is calculated to obtain the environment brightness.

4. The face recognition method according to claim 1, characterized in that: The face recognition model includes a backbone network and a face library matching network; the method includes: Sending the first original image to the backbone network so that the backbone network outputs a first feature vector; The first feature vector is sent to the face database matching network, and the face database matching network outputs a face recognition result based on the first feature vector and the feature vectors stored in the face database.

5. The face recognition method according to claim 4, characterized in that: The step of sending the first original image to the backbone network so that the backbone network outputs a first feature vector includes: Obtain an optical flow image and a pixel difference image corresponding to the first original image N frames before the current moment; N is an integer greater than 1; The N frames of the optical flow image, the pixel difference image and the first original image are sequentially sent to a temporal extraction network to obtain N first feature vectors.

6. The face recognition method according to claim 5, characterized in that: The first feature vector is sent to the face database matching network, and the face database matching network outputs a face recognition result according to the first feature vector and the feature vector stored in the face database, including: Sending the first feature vector to a gender recognition network to obtain male gender and female gender; If the gender is male, the first feature vector corresponding to the male gender is sent to the male face library matching network to obtain the male face recognition result; If the gender is female, the first feature vector corresponding to the female gender is sent to the female face library matching network to obtain the female face recognition result.

7. The face recognition method according to claim 4, characterized in that: Also includes: The second original image is sent to the backbone network so that the backbone network outputs a second feature vector.

8. The face recognition method according to claim 3, characterized in that: The loss function calculation formula for the face recognition model training is: L_ALL=L_S+L_P; Among them, L_ALL is the loss function value of the face recognition model training, L_S is calculated by the difference between the output result of the face recognition model and the sample label; L_P is the loss function value of the twin network.

9. The face recognition method according to claim 8, characterized in that: L_P=(1-a)*0.4*d 2 +a*0.6*(md) 2 , where a is the matching result, which takes the value of 1 or 0, d is the Euclidean distance between the first eigenvector and the second eigenvector, and m is the safety distance.

10. A door access control device, characterized in that: include: First camera; Second camera; as well as One or more processors are connected to the first camera and the second camera, and the one or more processors are configured to execute a face recognition program to implement the face recognition method as described in any one of claims 1 to 9.

Citation Information

Cited By

  • Vision-based access control method, storage medium and access control equipment

    CN122157404A