WO2021082548A1 - Living body testing method and apparatus, server and facial recognition device - Google Patents

Living body testing method and apparatus, server and facial recognition device Download PDF

Info

Publication number
WO2021082548A1
WO2021082548A1 PCT/CN2020/103962 CN2020103962W WO2021082548A1 WO 2021082548 A1 WO2021082548 A1 WO 2021082548A1 CN 2020103962 W CN2020103962 W CN 2020103962W WO 2021082548 A1 WO2021082548 A1 WO 2021082548A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
scene
feature
feature group
sample
Prior art date
Application number
PCT/CN2020/103962
Other languages
French (fr)
Chinese (zh)
Inventor
曹佳炯
Original Assignee
支付宝(杭州)信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021082548A1 publication Critical patent/WO2021082548A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/40Spoof detection, e.g. liveness detection
    • G06V40/45Detection of the body part being alive

Definitions

  • This specification belongs to the field of Internet technology, and in particular relates to a living body detection method, device, server and face recognition equipment.
  • face recognition technology is often used to determine the identity of the user by performing face recognition on the collected image data, and then provide the user with the corresponding service or open the corresponding authority.
  • a living detection model corresponding to the specific scene is trained to perform living detection to determine whether the face object in the image data to be recognized is real. Human faces instead of photos, videos, or masks.
  • This manual provides a living body detection method, device, server, and face recognition equipment, so that the preset living body detection model trained and established in the second scene can be effectively used to compare the image data collected in the first scene
  • the target object is more efficient and accurate live detection.
  • the living body detection method, device, server and face recognition equipment provided in this manual are implemented as follows:
  • a living body detection method includes: acquiring target image data, wherein the target image data includes image data including a target object collected in a first scene; calling a preset living body detection model to obtain data from the target image The target feature group is extracted from the, and the probability value of the target object being a non-living object is determined as the target probability through the preset live detection model, wherein the preset live detection model includes the use of the second scene A model trained on sample data; determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene, wherein the anchor point feature group of the first scene is determined according to the sample data of the first scene; According to the target feature group distance and the target probability, it is determined whether the target object is a living object.
  • a living body detection device includes: an acquisition module for acquiring target image data, wherein the target image data includes image data including a target object acquired in a first scene; a use module for using preset A living body detection model, extracting a target feature group from the target image data, and determining the probability value of the target object being a non-living body object through the preset living body detection model as the target probability, wherein the preset The living body detection model includes a model trained using sample data of the second scene; a first determining module is used to determine the target feature group distance according to the target feature group and the anchor point feature group of the first scene, wherein the The anchor point feature group of the first scene is determined according to the sample data of the first scene; the second determining module is configured to determine whether the target object is a living object according to the distance of the target feature group and the target probability.
  • a server includes a processor and a memory for storing executable instructions of the processor.
  • the target image data is obtained, wherein the target image data includes data collected in a first scene.
  • Image data of a target object using a preset living body detection model to extract a target feature group from the target image data, and determining the probability that the target object is a non-living body object through the preset living body detection model Value as the target probability, wherein the preset liveness detection model includes a model trained using sample data of the second scene; the target feature group distance is determined according to the target feature group and the anchor point feature group of the first scene, Wherein, the anchor point feature group of the first scene is determined according to the sample data of the first scene; according to the distance of the target feature group and the target probability, it is determined whether the target object is a living object.
  • a computer-readable storage medium on which computer instructions are stored, which realize acquisition of target image data when the instructions are executed, wherein the target image data includes image data including a target object collected in a first scene; Using a preset life detection model, extract a target feature group from the target image data, and determine the probability value of the target object being a non-living object through the preset life detection model as the target probability, wherein,
  • the preset living detection model includes a model trained using sample data of the second scene; the target feature group distance is determined according to the target feature group and the anchor point feature group of the first scene, wherein the first scene The anchor point feature group of is determined according to the sample data of the first scene; according to the distance of the target feature group and the target probability, it is determined whether the target object is a living object.
  • a face recognition device includes a processor and a memory for storing executable instructions of the processor.
  • the processor executes the instructions, the above-mentioned living body detection method is implemented to determine the target image data used for face recognition. Whether the target object of is a living object; in the case where it is determined that the target object is not a living object, it is determined that the face recognition fails.
  • the living body detection method, device, server, and face recognition equipment provided in this manual process the target image data collected in the first scene by using a preset living body detection model trained on the second scene to extract the corresponding target features
  • the above model determines the target probability that the target object in the target image data belongs to the non-living object; at the same time, the anchor point of the first scene determined based on the sample data of the first scene is introduced and used
  • the feature group is used to determine the target feature group distance between the target feature group and the anchor point feature group; then the above-mentioned target probability and the target feature group distance are combined to more accurately determine the target in the target image data collected in the first scene Whether the object is a living object. Therefore, there is no need to separately train the corresponding living detection model for the first scene, and the living detection model that has been trained in other scenes can be effectively used to efficiently analyze the target objects in the target image data collected in the first scene. Perform a live test.
  • FIG. 1 is a schematic diagram of an embodiment of the system structure composition of the living body detection method provided by the embodiment of this specification;
  • FIG. 2 is a schematic diagram of an embodiment of applying the living body detection method provided in the embodiment of this specification in an example of a scene;
  • FIG. 3 is a schematic diagram of an embodiment of applying the living body detection method provided by the embodiment of this specification in an example of a scene
  • FIG. 4 is a schematic flowchart of a living body detection method provided by an embodiment of this specification.
  • FIG. 5 is a schematic diagram of an embodiment of a living body detection method provided by an embodiment of this specification.
  • FIG. 6 is a schematic diagram of an embodiment of a living body detection method provided by an embodiment of this specification.
  • FIG. 7 is a schematic diagram of the structural composition of a server provided by an embodiment of this specification.
  • FIG. 8 is a schematic diagram of the structural composition of a living body detection device provided by an embodiment of this specification.
  • the embodiments of the present specification provide a living body detection method, and the living body detection method can be specifically applied to a system architecture including a server and a collection terminal.
  • a system architecture including a server and a collection terminal.
  • the collection terminal is arranged in the first scenario, and the collection terminal is coupled with the server in a wired or wireless manner to facilitate data interaction.
  • the collection terminal may be specifically used to collect the target image data of the first scene, and send the target image data to the server.
  • the target image data includes image data including a target object (for example, a human face, etc.) collected in the first scene.
  • the server may be specifically configured to call a preset life detection model, extract a target feature group from the target image data, and determine that the target object is based on the target feature through the preset life detection model The probability value of the non-living object is used as the target probability.
  • the preset living body detection model includes a model obtained by training using sample data of the second scene. Determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene.
  • the anchor point feature group of the first scene is determined according to the sample data of the first scene. According to the target feature group distance and the target probability, it is determined whether the target object is a living object.
  • the server may be a background service server that is applied to the side of the data processing platform and can implement functions such as data transmission and data processing.
  • the server may be an electronic device with data operation, storage functions, and network interaction functions; it may also be a software program that runs in the electronic device and provides support for data processing, storage, and network interaction.
  • the number of the servers is not specifically limited.
  • the server may specifically be one server, or several servers, or a server cluster formed by several servers.
  • the collection terminal may be a front-end device that is applied to the side of a specific scene area and can implement functions such as data collection and data transmission.
  • the collection terminal may be, for example, a surveillance camera, or other electronic equipment equipped with a camera, such as a tablet computer, a notebook computer, a smart phone, and the like.
  • company A can apply the living body detection method provided in the embodiment of this specification to perform living body detection on the face image collected by the company's access control system.
  • company A has set up an attendance system inside the company before, and a set of face recognition equipment (recorded as the first face recognition device) is deployed in the attendance system.
  • the face equipment includes a camera and processing Device.
  • the attendance system can call the above-mentioned first face recognition device to perform face recognition based on the face photo taken by the camera to identify and confirm the identity information of the employee who checks in. Refer to Figure 2.
  • the processor will first call the trained first live detection model for the face.
  • the face object in the photo is subject to live detection to determine whether the face object in the collected face photo is a living object. If it is determined by the above-mentioned first live body detection model that the face in the face photo is the face of a live object, then the face recognition device will perform further face recognition on the above-mentioned face photo through live body detection, and determine The identity information of the employee corresponding to the face, and the determined identity information of the employee is fed back to the attendance system to complete the attendance record of the employee.
  • the corresponding feature can be extracted from the face photo first, and then it is determined whether the face object of the face photo is a living object according to the extracted features. If it is determined by the above-mentioned first liveness detection model that the face given in the face photo is not the face of a live object, then the liveness detection is not passed. At this time, the face recognition device will judge that someone is using a face that contains other people’s faces. The photo, video or mask pretends to be another person to punch in on behalf of the card, and then no further face recognition will be performed on the face photo, but an alarm will be issued and the attendance record will stop, prompting the user to open the failure.
  • the above-mentioned second face recognition device includes a camera and a processor.
  • the above-mentioned camera may be arranged above the gate position outside the company to collect face photos of people who are about to enter the company.
  • the processor in the second face recognition device also needs to use the live body detection model to first perform live body detection on the face photos collected by the camera, and after the detection determines that the face objects in the collected face photos are live objects , Then further face recognition will be performed on the face in the face photo to determine whether the identity information corresponding to the face object is an employee of company A, and then the determination result will be fed back to the access control system. According to the determination result, the access control system will automatically open the door of the company after determining that the identity information corresponding to the face object in the face photo is an employee of company A, so that the employee can enter the company smoothly.
  • company A currently has the first live detection model that has been trained.
  • the model is designed and trained for the application scenario of the attendance system corresponding to the first face recognition device. Therefore, this model is not suitable for the application scenario of the access control system corresponding to the second face recognition device. If the first living body detection model is directly applied to the scene of the access control system, recognition errors are often prone to occur.
  • the camera is usually set indoors and the environmental conditions are relatively stable.
  • the outside light is relatively sufficient, and the resulting face photos It is usually relatively clear.
  • employees often cooperate with the camera to collect facial photos during the clock-in process. Therefore, in the application scenario of the attendance system, the image quality of the face photos to be processed by the living body detection model will be relatively high.
  • the living body detection model will be relatively strict in the specific detection process.
  • the environmental conditions are more complex and changeable and not stable enough, resulting in insufficient light from outside when taking face photos, for example, The light is too strong at noon, and the light at night is too weak, so the collected face photos may not be clear enough.
  • employees usually do not cooperate with the camera to collect facial photos when entering the company. Therefore, the image quality of the face photos collected in the application scenarios of the access control system and processed by the living body detection model is usually relatively low. Furthermore, because A company's requirements for the accuracy of the access control system are not as high as that of the attendance system.
  • the first live detection model for the application scenario of the attendance system is directly applied to the second face recognition device to determine whether the face object in the face photo collected by the second face recognition device is a live object. Detection errors are often prone to occur. For example, it may often happen that the employees of the company cannot be identified, resulting in failure to open the door for the employees of the company in time.
  • the processor of the second face device can first directly call the trained application scenario that is suitable for the attendance system.
  • the first living body detection model checks the camera of the second face device that contains human face objects collected outdoors. Feature extraction is performed on the face photos of, and the corresponding target feature group is obtained. Further, the probability value of determining that the face object is a non-living object based on the target feature group by the first living body detection model may be used as the target probability.
  • the target probability value obtained may not be completely accurate, but it can be used as a reference for judging living objects. in accordance with. Generally, the larger the value of the target probability value, the more likely the corresponding face object is not a living object, but a non-living object.
  • the processor may compare the target feature group extracted based on the first living body detection model with a predetermined anchor point feature group of the application scenario of the access control system, and calculate the difference between the target feature group and the aforementioned anchor point feature group. Characteristic distance.
  • the aforementioned anchor point feature group can be specifically understood as a feature set that includes typical features of positive samples in different situations (for example, different environmental conditions) in the application scenario of the access control system.
  • the aforementioned anchor point feature group may be determined in advance according to the positive sample data in the sample data in the application scenario of the access control system.
  • the above-mentioned positive samples may specifically include image data containing real human faces.
  • the feature distance between the target feature group and the anchor point feature group can be specifically used to measure the difference between the target feature group and the positive sample feature of the application scenario of the access control system under different conditions (for example, different lighting conditions, different acquisition angles, etc.) degree.
  • the data can also be used as a reference basis for judging living objects.
  • this data is a kind of reference data that has considered and took into account the environmental conditions and accuracy requirements of the application scenario of the access control system.
  • the larger the feature distance between the target feature group and the anchor point feature group the more likely the corresponding face object is not a living object.
  • the difference between the target feature group and the anchor point feature group can be calculated separately as the target feature group and the anchor point feature group.
  • the feature distance of each feature in, then the feature distance between the target feature group and the anchor feature group is determined according to the feature distance of each feature in the target feature group and the anchor feature group, which can be recorded as the target feature group distance.
  • the above characteristic distance can be determined according to the following formula:
  • Dis tan ce can be specifically used to represent the feature distance between the target feature group and the anchor point feature group
  • D center can specifically be used to represent the feature distance between the target feature group and the center point feature in the anchor feature group
  • D K specifically It can be used to represent the feature distance between the target feature group and the feature numbered K in the anchor feature group
  • f can be specifically represented as the target feature group
  • f center can be specifically represented as the center point feature in the anchor feature group
  • 2 can be expressed as a modulo operation.
  • the above two data can be synthesized at the same time.
  • it is more accurate and efficient to determine whether the face object in the face photo collected in the scene is a living object.
  • the first score is first determined according to the feature distance between the target feature group and the anchor point feature group; the second score is determined according to the target probability.
  • the first score can be determined by comparing the feature distance between the target feature group and the anchor point feature group and the preset distance threshold. If the above characteristic distance is less than the preset distance threshold, a relatively high first score can be obtained. On the contrary, if the above characteristic distance is greater than the preset distance threshold, the first score obtained will be relatively low.
  • the second score can be determined by comparing the target probability with a preset ratio threshold. If the target probability is less than the preset ratio threshold, a relatively high second score can be obtained. On the contrary, if the aforementioned target probability is greater than the preset ratio threshold, the second score obtained will also be relatively low.
  • the above-mentioned preset distance threshold and preset ratio threshold can be set according to specific conditions in combination with specific accuracy requirements.
  • the specific values of the preset distance threshold and the preset ratio threshold are not limited in this specification.
  • a weighted sum of the first score and the second score may be performed according to a preset weighting rule to obtain a third score.
  • the first weight corresponding to the first score and the second weight corresponding to the second score can be determined according to a preset weight rule, and the product of the first score and the first weight is then multiplied by the second score The sum obtained by adding the product given by the second weight is used as the above-mentioned third score.
  • the above-mentioned third score can be understood as an evaluation score obtained by comprehensively considering the two reference basis of target probability and target feature group distance. Furthermore, it can be determined more accurately whether the face object in the detected face photo is a living object according to the third score.
  • the third score may be compared with a preset score threshold to obtain a comparison result. According to the comparison result, it is determined whether the target object is a living object.
  • the third score is less than or equal to the aforementioned preset score threshold, it can be determined that the face object is not a living object, and then it can be directly determined that the face recognition fails, and no further face recognition is performed. And the second face recognition device will feed back the recognition result of the face recognition failure to the access control system. At this time, the access control system will not open the door for the person based on the face recognition result. If it is determined according to the comparison result that the third score is greater than the preset score threshold, it can be determined that the face object is a living object, and further face recognition can be performed.
  • the identity information corresponding to the face object is an employee of company A
  • the second face recognition device will feed back the recognition result of successful face recognition to the access control system.
  • the access control system will automatically open the door for the person based on the face recognition result.
  • company A can collect photos containing real human faces under a variety of outdoor environmental conditions through the camera of the second face device deployed in the access control system in advance as positive sample data to form a positive sample data Set, can be denoted as X.
  • x i can be specifically used to represent the photo numbered i in the positive sample data set.
  • the time of collection and the weather data at the time of collection can be recorded. Further, according to the collection time and the weather data at the time of collection, the face photos corresponding to different collection time and weather data combinations can be selected from the large number of collected face photos as positive sample data.
  • each positive sample data in the positive sample data set can be input to the trained first living body detection model, and the corresponding sample feature can be extracted through the first living body detection model.
  • each sample feature corresponds to a positive sample data.
  • f i can be specifically used to represent the sample feature corresponding to the photo numbered i.
  • corresponding feature processing can be performed on the above-mentioned sample features respectively.
  • an average feature (may be denoted as f mean ) can be determined according to specific conditions; then, the average feature is subtracted from each of the multiple sample features to obtain the processed sample feature.
  • the above-mentioned sample characteristics can be normalized, so that the values of the above-mentioned sample characteristics are unified within a numerical range, so as to reduce errors in the subsequent processing.
  • a corresponding processed sample feature set based on the processed template features, which can be denoted as F'.
  • f i ′ can be specifically used to represent the processed sample feature corresponding to the photo numbered i.
  • the central point characteristic can be determined by calculating the characteristic average value of the above-mentioned processed sample characteristic set.
  • the above-mentioned center point feature can be determined according to the following formula: Among them, f center can be specifically expressed as the above-mentioned center point feature.
  • the sample features that meet the requirements can enable the selected sample features to have a relatively comprehensive coverage for the targeted application scenarios of the access control system.
  • the methods for determining the characteristics of the samples that meet the requirements listed above are merely illustrative.
  • the processed sample features can also be sorted according to the characteristic distance between the processed sample features and the center point feature in descending distance; the preset number of processed sample features at the top of the ranking can be obtained As a sample feature that meets the requirements.
  • the sample characteristics that meet the requirements can also be determined in the following manner:
  • the above f at can be specifically used to represent the characteristics of the sample with the number t that meet the requirements
  • K can specifically represent a preset number
  • TopK() can specifically be represented as an operation to obtain the top K data in numerical order.
  • the anchor point feature group corresponding to the application scenario of the access control system can be established according to the above-mentioned center point feature and the selected sample feature that meets the requirements.
  • the anchor point feature group may specifically include a center point feature and a sample feature that meets the requirements.
  • the above anchor point feature group can be denoted as Thus, an anchor point feature group that can effectively and comprehensively reflect the environmental characteristics of the application scenario of the access control system is obtained.
  • the second face recognition device comprehensively utilizes the first living body detection model for the application scenario of the attendance system and the above-mentioned anchor feature group for the application scenario of the access control system to perform living detection on the face photos collected by the camera. Record and count the error rate within each preset time period.
  • the above error ratio can be specifically understood as the ratio of the number of in-vivo detection errors in a preset period of time to the total number of in-vivo detections performed in the period.
  • the processor of the second face recognition device will compare the above error ratio with a preset ratio threshold, and if it is determined that the error ratio is greater than the above preset ratio threshold, it can determine the application scenario of the current access control system
  • the characteristics of the data to be processed have changed, and the detection error of live detection based on the previously determined anchor point feature group will be relatively large.
  • the anchor point feature group corresponding to the latest situation of the application scenario of the access control system can be re-determined to replace the currently used anchor point feature group, and update the anchor point feature group to reduce detection errors.
  • the second face recognition device can still have a high accuracy rate when performing live body detection on the face photo in the application scenario of the current access control system based on the new anchor point feature group.
  • the living body detection method provided in this manual can effectively use the living body detection model that has been trained in other application scenarios, and efficiently detect people in the face photos collected in the current application scene.
  • the face object performs a more accurate live body detection.
  • an embodiment of the present specification provides a living body detection method, wherein the method is specifically applied to the server side.
  • the method may include the following content.
  • S401 Acquire target image data, where the target image data includes image data including the target object collected in the first scene.
  • the above-mentioned target image data can be specifically understood as the image data collected in the first scene and containing the target object to be detected.
  • the aforementioned target image data may specifically be photos, image data, and the like. This specification does not limit the specific form type of the above-mentioned target image data.
  • the above-mentioned target image data can also be intercepted from multimedia data such as video images.
  • multimedia data such as video images.
  • the image frame containing the target object can be intercepted from the surveillance video as the above-mentioned target image data.
  • the aforementioned target object may be specifically determined according to the corresponding application scenario.
  • the above-mentioned target object may be the face data of the user.
  • the above-mentioned target object may be the user's iris data.
  • the target objects listed above are only schematic illustrations. During specific implementation, according to specific circumstances, the aforementioned target object may also be object data of other types of content. In this regard, this manual is not limited.
  • the above-mentioned first scenario may be specifically understood as a specific application scenario targeted by the living body detection method.
  • the above-mentioned first scenario may be a business scenario in which the access control system automatically opens the door for a user who has passed through facial recognition to allow this type of user to enter. It can also be that the face payment system verifies the identity of the paying user through face recognition. If the authentication is the same, it responds to the payment instruction of the paying user and calls the funds data in the user’s account to write off the transaction order.
  • Application scenarios can also be that the identity determination system matches the collected iris of the user with the iris stored in the identity information database to identify the application scenarios for determining the identity information of the user, and so on.
  • the first scenario listed above is only a schematic illustration. During specific implementation, according to specific conditions and business requirements, other forms or types of application scenarios can also be introduced as the first scenario described above. In this regard, this manual is not limited.
  • the target object in the target image data may be subjected to live detection to determine whether the target object is a live object. If it is found that the target object is not a living object through live detection, the target object in the target image data may be a photo or mask containing the face of another person, or a picture containing the iris of another person, etc., and then the target object in the target image can be judged It is not a real person, but may be a disguised attack. At this time, further identification of the target object can be stopped.
  • image data including the target object in the first scene may be collected by an image acquisition device such as a camera as the target image data.
  • an image acquisition device such as a camera
  • image data including the target object in the first scene may be collected by an image acquisition device.
  • an image acquisition device such as a camera
  • the above-mentioned manners for obtaining target image data are merely schematic illustrations.
  • other suitable methods may also be used to obtain the target image data containing the target object in the first scene. In this regard, this manual is not limited.
  • S403 Invoking a preset living body detection model, extracting a target feature group from the target image data, and determining the probability value of the target object being a non-living body object through the preset living body detection model as the target probability,
  • the preset living body detection model includes a model obtained by training using sample data of the second scene.
  • the aforementioned target feature group may specifically include image feature data extracted from target image data for determining whether the target object is a living object. For example, whether there are features such as the reflection of the frame of the mobile phone or the reflection of the photo paper in the image data. For another example, the feature of the displacement change between the key points of the target object (for example, the position of the corner of the mouth in the face) in two consecutive frames of pictures in the video data, and so on.
  • the target feature group listed above is only a schematic illustration. During specific implementation, according to specific application scenarios, other types of feature data can also be used as the target feature group. In this regard, this manual is not limited.
  • the above-mentioned living object can be specifically understood as a characteristic object of a real person, for example, a real person's face, a real person's iris, and so on.
  • a non-living object can be specifically understood as a data object disguised as a characteristic object of a real person, for example, a picture containing a real person's face or a face mask.
  • the aforementioned target probability may specifically include a probability value used to reflect that the target object in the target image data is not a living object.
  • a probability value used to reflect that the target object in the target image data is not a living object.
  • the value of the target probability is larger, correspondingly, the target object in the target image is more likely to be not a living object.
  • the value of the target probability is smaller, correspondingly, the target object in the target image is more likely to be a living object.
  • the aforementioned preset living body detection model may specifically include a pre-trained model for living body detection on the image data of the second scene.
  • the foregoing second scenario may be a different application scenario from the first scenario, the environmental conditions involved, and/or the accuracy requirements for detection are different.
  • the foregoing second scenario may also be an application scenario that is the same or similar to the first scenario.
  • the above-mentioned preset living body detection model is based on the characteristics of the environmental conditions and detection accuracy requirements of the second scene, and is established using the sample data in the second scene. In order to determine whether the target object in the image data to be recognized is a living object.
  • the target image data to be recognized is input to the above-mentioned preset living body detection model.
  • the preset living detection model When the preset living detection model is running, it can first extract the corresponding image feature from the input image data; then determine the probability value of the target object corresponding to the image feature as a non-living object according to the image feature; The aforementioned probability value is compared with a preset judgment threshold value, and when the aforementioned probability value is greater than the preset judgment threshold value, it can be judged that the target object is not a living object.
  • the preset living body detection model corresponding to the second scene is directly applied to the first scene, the target collected in the first scene If the target object in the image data is detected in vivo, the accuracy of the detection may not be high, and the detection error is prone to occur.
  • the application of the preset life detection model in the first scene has to deal with the same problems as the second scene, the preset life detection model can be used to perform the target image data collected in the first scene. Processing to extract the corresponding image features; at the same time, it can also judge whether the target object in the target image data is a living object based on the image feature, and give the corresponding probability value. Although the accuracy of this probability value is not high, but It also has a certain reference value.
  • the preset living detection model that has been trained in the second scene can be directly called, and the target image data collected in the first scene containing the target object is input
  • the corresponding image feature can be extracted from the above-mentioned target image data as the target feature group.
  • the aforementioned target probability value can be used as a type of subsequent reference data used to determine whether the target object is a living object.
  • S405 Determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene, where the anchor point feature group of the first scene is determined according to the sample data of the first scene.
  • the aforementioned anchor point feature group can be specifically understood as a feature set that includes image features of positive samples in different situations in the first scene.
  • the positive samples in the above different situations may specifically include image data containing living objects collected under different environmental conditions (for example, different light intensity, shooting angles, shooting distances, etc.).
  • image data containing living objects under different conditions can be collected in advance for the first scene as positive sample data, and then the anchor point feature group can be established based on the positive sample data.
  • part of the negative sample data in addition to collecting and using positive sample data in the above manner to establish an anchor point feature group, part of the negative sample data can also be collected and used in the process of establishing an anchor point feature group.
  • the positive sample data may be mixed with part of the collected negative sample data, and then the above-mentioned anchor point feature group can be established based on the above-mentioned sample data including the negative sample data and the original data.
  • the noise caused by the negative samples in the scene can be introduced, so that the established anchor point feature group can better reflect the image characteristics in the real scene and have better effects.
  • the above-mentioned negative sample data may specifically include image data that does not contain living objects collected under different environmental conditions (for example, different light intensity, shooting angle, shooting distance, etc.).
  • the aforementioned target feature group distance can be specifically understood as the distance between the target feature group and the aforementioned anchor point feature group.
  • the feature distance between the target feature group and the anchor point feature group can be specifically used to measure the degree of difference between the target feature group and the positive sample features of the first scene in different situations.
  • the above-mentioned characteristic distance may also be used as a kind of reference data combined with the specific characteristics of the first scene for subsequent determination of whether the target object is a living object. By contacting the positive sample data of the first scene, the reference data has considered and took into account the characteristics of the first scene’s environmental conditions and accuracy requirements, and made up for the previously determined target probability that did not take into account the specific characteristics of the first scene. insufficient.
  • the distance value of the target feature group is larger, correspondingly, the similarity between the features of the target feature group and the anchor point feature group is also lower, and the corresponding target object is more likely to be not a living object.
  • the distance value of the target feature group is smaller, the similarity between the target feature group and the anchor point feature group is correspondingly higher, and the corresponding target object is more likely to be a living object.
  • the foregoing determination of the target feature group distance based on the target feature group and the anchor point feature group of the first scene may include: calculating each feature in the target feature group and the anchor point feature group respectively.
  • the modulus of the difference of, as the feature distance between the target feature group and each feature in the anchor feature group; according to the feature distance between the target feature group and each feature in the anchor feature group, the target feature group and the anchor point are determined
  • the feature distance of the feature group can be abbreviated as the target feature group distance.
  • S407 Determine whether the target object is a living object according to the target feature group distance and the target probability.
  • the above-mentioned living object may be a real person's face, or a real person's iris, etc., instead of non-real person props such as a photo of a human face or iris, a mask, etc.
  • the target feature group and the target probability by comprehensively using the target feature group and the target probability, to take into account the specific characteristics of the first scene and the difference from the second scene before, using the preset living detection model trained in the second scene, Accurately judge whether the target object in the target image data collected in the first scene is a living object.
  • the foregoing determination of whether the target object is a living object based on the distance of the target feature group and the target probability may include the following content: determining the first score according to the distance of the target feature group ; Determine the second score according to the target probability.
  • the first score can be determined by comparing the distance of the target feature group with a preset distance threshold. If the target feature group distance is less than the preset distance threshold, a relatively high first score can be obtained. On the contrary, if the distance of the target feature group is greater than the preset distance threshold, the first score obtained will be relatively low.
  • the second score can be determined by comparing the target probability with a preset ratio threshold.
  • the target probability is less than the preset ratio threshold, a relatively high second score can be obtained. On the contrary, if the aforementioned target probability is greater than the preset ratio threshold, the second score obtained will also be relatively low.
  • the above-mentioned preset distance threshold and preset ratio threshold can be set according to specific conditions in combination with specific accuracy requirements. The specific values of the preset distance threshold and the preset ratio threshold are not limited in this specification.
  • a weighted sum of the first score and the second score may be performed according to a preset weighting rule to obtain a third score.
  • the first weight corresponding to the first score and the second weight corresponding to the second score can be determined according to a preset weight rule, and the product of the first score and the first weight is then multiplied by the second score
  • the sum obtained by adding the product given by the second weight is used as the above-mentioned third score.
  • the above-mentioned third score can be specifically understood as an evaluation score obtained by comprehensively considering the two reference data of target probability and target feature group distance.
  • the third score may be compared with a preset score threshold to obtain a comparison result. According to the comparison result, it is determined whether the target object is a living object. Specifically, for example, if it is determined according to the comparison result that the third score is less than or equal to the preset score threshold, it can be determined that the target object in the target image data collected in the first scene is not a living object. On the contrary, if it is determined that the third score is greater than the preset score threshold according to the comparison result, it can be determined that the target object in the target image data collected in the first scene is a living object.
  • the living body detection method provided by the embodiment of this specification can effectively use the preset living body detection model trained and established in the second scene, and efficiently analyze the target object in the image data collected in the first scene. Perform more accurate live detection.
  • the anchor point feature group of the first scene may be specifically established in the following manner: collecting image data containing living objects in the first scene as the positive sample data of the first scene; calling a preset living body detection The model extracts the sample feature from the positive sample data; determines the center point feature according to the sample feature, wherein the center point feature; calculates the feature distance between the sample feature and the center point feature; according to the sample feature , And the feature distance between the sample feature and the center point feature to establish the anchor point feature group of the first scene.
  • an anchor point feature group that can more comprehensively cover the data characteristics in different situations in the first scene, so as to compensate for the direct use of the preset living detection model, without considering the environment between the first scene and the second scene. Errors caused by differences in conditions, processing accuracy requirements, etc.
  • the environmental characteristics at the time of collection can be recorded from the time when the image data in the first scene is collected.
  • the lighting conditions of the photo can be recorded.
  • the image data within a period of time is collected in the first scene, and the image data containing the living object can be filtered from the above image data as the positive sample data.
  • a photo containing a human face of a real person can be selected from the aforementioned photos as the positive sample data of the first scene.
  • the image data containing living objects corresponding to different environmental characteristics can be screened out as positive sample data in a targeted manner In this way, the acquired positive sample data of the first scene can more comprehensively cover the data characteristics of the first scene in different situations.
  • the positive sample data of the first scene obtained above may be respectively input into the called preset living body detection model. It should be noted that in this embodiment, it is not necessary to use the above-mentioned preset living body detection model to detect whether the target object in the positive sample data is a living object, but only need to use the above-mentioned preset living body detection model from the above The image features corresponding to each positive sample data are extracted from the positive sample data as sample features.
  • the corresponding center point feature can be determined based on the above-mentioned sample feature. Specifically, the above-mentioned center point characteristic can be obtained by adding and averaging the above-mentioned sample characteristics. Furthermore, the central point feature can be used as a reference, and the modulus of the difference between each of the sample features and the central point feature can be calculated as the feature distance of the sample feature. According to the feature distance of the sample feature, the sample feature with a larger distance from the center point feature is selected from the multiple sample features as the sample feature that meets the requirements, so that the sample feature that meets the requirements can better cover the first scene The data characteristics of the image data collected under different conditions.
  • the above-mentioned establishment of the anchor point feature group of the first scene according to the sample feature and the feature distance between the sample feature and the center point feature may include the following content during specific implementation: Among the sample features, the sample features whose feature distance from the center point feature is greater than the feature distance threshold are selected as the sample features that meet the requirements; based on the center point feature and the sample features that meet the requirements, the anchor point of the first scene is established Feature group.
  • the sample features can be sorted according to the feature distance from the largest to the smallest according to the feature distance between the sample feature and the center point, and the preset number of sample features with the highest ranking can be selected as the above-mentioned meeting requirements.
  • Sample characteristics It is also possible to compare the feature distance between the sample feature and the center point feature with the feature distance threshold, and screen out the sample feature whose feature distance between the sample feature and the center point feature is greater than the feature distance threshold as the above-mentioned sample feature that meets the requirements.
  • the above-mentioned method of screening out the sample characteristics that meet the requirements is only a schematic illustration. During specific implementation, other suitable methods can also be used to screen out the sample characteristics that meet the requirements according to the specific situation. In this regard, this manual is not limited.
  • a feature set can be further established based on the sample features that meet the requirements and the center point features as the anchor point feature group for the first scene.
  • the anchor point feature group may specifically include a sample feature that meets the requirements, and a center point feature.
  • corresponding feature processing can also be performed on the sample features obtained above.
  • the corresponding average feature can be determined according to the overall numerical value of the sample feature; and then the sample feature can be obtained by subtracting the average feature from the sample feature to obtain the processed sample feature. Subsequently, the processed sample features can be used to replace the originally used sample features to determine an anchor point feature group with better accuracy.
  • the method may further include the following content: perform the analysis on the features in the anchor point feature group of the first scene respectively. Fuman encoding to obtain the anchor point feature group of the compressed first scene; and save the anchor point feature group of the compressed first scene.
  • the anchor point feature group of the first scene can be compressed by Huffman coding, and the compressed anchor point feature group can be saved and managed, which effectively reduces the resource occupation and management of the anchor point feature group when saving and managing the anchor point feature group. Consumption.
  • Huffman numbers to compress the anchor point feature group is only a schematic illustration.
  • other suitable compression methods may also be used to compress the anchor point feature group. In this regard, this manual is not limited.
  • the extracted sample feature in addition to compressing the anchor point feature group, after extracting the sample feature, the extracted sample feature can be compressed and saved by Huffman coding, which can further reduce the resource cost. Occupation and consumption.
  • the foregoing determination of whether the target object is a living object based on the distance of the target feature group and the target probability may include the following content: determining the first score according to the distance of the target feature group Determine the second score according to the target probability; perform a weighted summation of the first score and the second score according to a preset weighting rule to obtain a third score; combine the third score with a preset score threshold The comparison is performed to obtain a comparison result; according to the comparison result, it is determined whether the target object is a living object.
  • two reference data of target probability and target feature group distance can be comprehensively used, that is, there is no need to re-establish and use the living detection model corresponding to the first scene, and the specific characteristics of the first scene can be taken into account, so that the first scene can be accurately
  • the target object in the image data collected in the image data is detected in vivo.
  • the method may further include the following content when the method is specifically implemented: The permission application request corresponding to the image data.
  • the target object in the target image to be detected is not a living object
  • subsequent further identification and determination of the target object can be stopped, and the permission application request corresponding to the target image data can be rejected.
  • the permission application request corresponding to the target image data can be rejected.
  • the recognition of the face in the face photo and the matching of identity information can be stopped, and the payment application request initiated by the user can be rejected to protect the safety of other people's property.
  • the method when the method is specifically implemented, it may further include the following content: counting the error ratio within a preset time period; comparing the error ratio with a preset ratio threshold; determining that the error ratio is greater than the preset ratio threshold.
  • the ratio threshold value the anchor point feature group of the first scene is re-determined.
  • the rate of error in the live body detection in the most recent week can be counted.
  • the above-mentioned error ratio can be specifically obtained by dividing the number of errors in the detection of a living body within the preset time period by the total number of detections of a living body processed within the preset time period. Further, the error ratio can be compared with a preset ratio threshold to obtain the corresponding comparison result. According to the comparison result, it can be determined whether the anchor point feature group currently used for living body detection conforms to the specific situation of the current scene.
  • the error ratio is greater than the preset ratio threshold
  • the group is updated.
  • the group is updated regularly to improve the accuracy of detecting live objects and reduce the error rate. Therefore, in a relatively long period of time, the target image data collected in the first scene can be detected in vivo more accurately.
  • the living body detection method processes the target image data collected in the first scene by calling a preset living body detection model trained on the second scene, extracting the corresponding target feature group, and The above model determines the target probability that the target object in the target image data belongs to the non-living object based on the target feature group; at the same time, the anchor point feature for the first scene determined based on the positive sample data of the first scene is introduced and used Group to determine the feature distance between the target feature group and the anchor point feature group; and then combine the target probability and the target feature group distance to more accurately determine whether the target object in the target image data collected in the first scene is a living object.
  • the preset living detection model trained and established in the second scene can be effectively used to efficiently perform relatively accurate living detection of the target object in the image data collected in the first scene. Since there is no need to additionally train the corresponding living body detection model for the first scene, the processing cost and processing time of living body detection are effectively reduced.
  • the embodiment of the present specification also provides a server, including a processor and a memory for storing executable instructions of the processor.
  • the processor can execute the following steps according to the instructions during specific implementation: acquiring target image data, wherein the target image
  • the data includes the image data that contains the target object collected in the first scene; the preset living detection model is called, the target feature group is extracted from the target image data, and the preset living detection model is used to determine The probability value that the target object is a non-living object is used as the target probability, wherein the preset living detection model includes a model trained using sample data of the second scene; according to the target feature group and the anchor of the first scene Point feature group, determine the target feature group distance, wherein the anchor point feature group of the first scene is determined according to the sample data of the first scene; according to the target feature group distance and the target probability, it is determined whether the target object It is a living object.
  • the embodiment of this specification also provides another specific server, where the server includes a network communication port 701, a processor 702, and a memory 703.
  • the server includes a network communication port 701, a processor 702, and a memory 703.
  • the above structure Internal cables are connected so that each structure can carry out specific data interactions.
  • the network communication port 701 may be specifically used to obtain target image data, where the target image data includes image data including the target object collected in the first scene.
  • the processor 702 may be specifically configured to call a preset living body detection model, extract a target feature group from the target image data, and determine that the target object is a non-living body through the preset living body detection model
  • the probability value of the object is used as the target probability
  • the preset liveness detection model includes a model trained using sample data of the second scene
  • the target feature is determined according to the target feature group and the anchor feature group of the first scene
  • the group distance wherein the anchor point feature group of the first scene is determined according to the sample data of the first scene; according to the target feature group distance and the target probability, it is determined whether the target object is a living object.
  • the memory 703 may be specifically used to store corresponding instruction programs.
  • the network communication port 701 may be a virtual port that is bound to different communication protocols, so that different data can be sent or received.
  • the network communication port may be port 80 responsible for web data communication, port 21 responsible for FTP data communication, or port 25 responsible for mail data communication.
  • the network communication port may also be a physical communication interface or a communication chip.
  • it can be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it can also be a Bluetooth chip.
  • the processor 702 may be implemented in any suitable manner.
  • the processor may take the form of a microprocessor or a processor and a computer readable medium, logic gates, switches, application specific integrated circuits ( Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller form, etc. This manual is not limited.
  • the memory 703 may include multiple levels.
  • any memory that can store binary data can be a memory; in an integrated circuit, a circuit with a storage function without a physical form is also called a memory. , Such as RAM, FIFO, etc.; in the system, storage devices in physical form are also called memory, such as memory sticks, TF cards, etc.
  • the embodiment of the present specification also provides a computer storage medium based on the above-mentioned living body detection method.
  • the computer storage medium stores computer program instructions. When the computer program instructions are executed, it is realized: acquiring target image data, wherein the The target image data includes image data including the target object collected in the first scene;
  • the preset living body detection model includes a model trained using sample data of the second scene; the target feature group distance is determined according to the target feature group and the anchor point feature group of the first scene, wherein The anchor point feature group of is determined according to the sample data of the first scene; according to the distance of the target feature group and the target probability, it is determined whether the target object is a living object.
  • the aforementioned storage medium includes but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), cache (Cache), and hard disk (Hard Disk Drive, HDD). Or memory card (Memory Card).
  • the memory can be used to store computer program instructions.
  • the network communication unit may be an interface set up in accordance with a standard stipulated by the communication protocol and used for network connection communication.
  • This specification also provides a face recognition device, where the face recognition device at least includes a camera and a processor.
  • the aforementioned camera is specifically used to obtain target image data, wherein the target image data includes image data including the target object collected in the first scene.
  • the above-mentioned processor is specifically configured to call a preset life detection model, extract a target feature group from the target image data, and determine the probability value that the target object is a non-living object through the preset life detection model
  • the preset liveness detection model includes a model trained using sample data of the second scene; the target feature group distance is determined according to the target feature group and the anchor point feature group of the first scene, where , The anchor point feature group of the first scene is determined according to the sample data of the first scene; according to the distance of the target feature group and the target probability, it is determined whether the target object is a living object.
  • the processor determines that the target object is not a living object, it determines that the face recognition has failed, and no further face recognition is performed on the target image data; in the case of determining that the target object is a living object, the target image can be Further face recognition is performed to determine the identity information of the user who matches the face in the target image.
  • the embodiment of this specification also provides a living body detection device, which may specifically include the following structural modules.
  • the obtaining module 801 may be specifically used to obtain target image data, where the target image data includes image data including the target object collected in the first scene;
  • the using module 803 can be specifically used to extract a target feature group from the target image data using a preset life detection model, and determine that the target object is a non-living object through the preset life detection model
  • the probability value is used as the target probability, where the preset living detection model includes a model trained by using sample data of the second scene;
  • the first determining module 805 may be specifically configured to determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene, wherein the anchor point feature group of the first scene is based on the sample of the first scene Data determination;
  • the second determining module 807 may be specifically configured to determine whether the target object is a living object according to the target feature group distance and the target probability.
  • the device may specifically further include an establishment module, and the module may specifically include the following structural units:
  • the collecting unit may be specifically used to collect image data containing a living object in the first scene as the positive sample data of the first scene;
  • the calling unit may be specifically used to call a preset living body detection model to extract sample features from the positive sample data
  • the first determining unit may be specifically configured to determine the center point feature according to the sample feature
  • the calculation unit may be specifically used to calculate the feature distance between the sample feature and the center point feature
  • the establishing unit may be specifically configured to establish the anchor point feature group of the first scene according to the sample feature and the feature distance between the sample feature and the center point feature.
  • the establishment unit may specifically include the following structural sub-units:
  • the screening subunit can be specifically used to screen out the sample features whose feature distance from the center point feature is greater than the feature distance threshold from the sample features as the sample feature that meets the requirements;
  • the establishment of the subunit may be specifically used to establish the anchor point feature group of the first scene according to the central point feature and the qualified sample feature.
  • the establishment module may specifically further include the following units:
  • the coding unit may be specifically used to perform Huffman coding on the features in the anchor point feature group of the first scene respectively to obtain the compressed anchor point feature group of the first scene;
  • the storage unit may be specifically used to save the compressed anchor point feature group of the first scene.
  • the second determining module may specifically include the following structural units:
  • the scoring unit may be specifically configured to determine a first score according to the distance of the target feature group; determine a second score according to the target probability; and perform a weighted summation of the first score and the second score according to a preset weighting rule , Get the third score;
  • the first comparison unit may be specifically configured to compare the third score with a preset score threshold to obtain a comparison result
  • the second determining unit may be specifically configured to determine whether the target object is a living object according to the comparison result.
  • the device may specifically further include a processing module, which may be specifically configured to reject the permission application corresponding to the target image data in the case that the target object is determined to be not a living object according to the second determining module request.
  • a processing module which may be specifically configured to reject the permission application corresponding to the target image data in the case that the target object is determined to be not a living object according to the second determining module request.
  • the device may further include an update module, and the module may specifically include the following structural units:
  • the statistical unit which can be specifically used to calculate the error ratio within a preset time period
  • the second comparison unit may be specifically used to compare the error ratio with a preset ratio threshold
  • the third determining unit may be specifically configured to re-determine the anchor point feature group of the first scene when it is determined that the error ratio is greater than a preset ratio threshold.
  • the units, devices, or modules described in the foregoing embodiments may be specifically implemented by computer chips or entities, or implemented by products with certain functions.
  • the functions are divided into various modules and described separately.
  • the functions of each module can be implemented in the same one or more software and/or hardware, or a module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the living body detection device uses the module to call the preset living body detection model obtained by training based on the second scene to process the target image data collected in the first scene to obtain the corresponding target feature group. , And determine the target probability that the target object in the target image data belongs to the non-living object based on the target feature group through the above model; at the same time, the target object determined by the positive sample data based on the first scene is introduced and used through the first determination module.
  • the anchor point feature group of the first scene is used to determine the feature distance between the target feature group and the anchor point feature group; then the second determination module is used to synthesize the target probability and the target feature group distance to more accurately determine the collection of the first scene Whether the target object in the target image data is a living object. Therefore, the preset living detection model trained and established in the second scene can be effectively used to efficiently perform relatively accurate living detection of the target object in the image data collected in the first scene.
  • controllers in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to program the method steps to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded logic.
  • the same function can be realized in the form of a microcontroller, etc. Therefore, such a controller can be regarded as a hardware component, and the devices included in the controller for realizing various functions can also be regarded as a structure within the hardware component. Or even, the device for realizing various functions can be regarded as both a software module for realizing the method and a structure within a hardware component.
  • program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types.
  • This specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

Provided are a living body testing method and apparatus, a server and a facial recognition device. In one embodiment, the method comprises: by calling a preset living body testing model obtained on the basis of second scenario training, processing target image data collected from a first scenario; extracting and obtaining a corresponding target feature group; determining, by means of the model and on the basis of the target feature group, a probability value of a target object in the target image data being a non-living object, and taking the probability value as a target probability; meanwhile, introducing and using an anchor point feature group of the first scenario that is determined on the basis of sample data of the first scenario, so as to determine a target feature group distance between the target feature group and the anchor point feature group; and by synthesizing the target probability and the target feature group distance, accurately determining whether the target object in the target image data collected from the first scenario is a living body object.

Description

活体检测方法、装置、服务器和人脸识别设备Living body detection method, device, server and face recognition equipment 技术领域Technical field
本说明书属于互联网技术领域,尤其涉及一种活体检测方法、装置、服务器和人脸识别设备。This specification belongs to the field of Internet technology, and in particular relates to a living body detection method, device, server and face recognition equipment.
背景技术Background technique
随着技术的发展,人脸识别的应用越来越广泛。在许多应用场景中,经常使用人脸识别技术通过对所采集到的图像数据进行人脸识别,来确定用户的身份,进而为用户提供对应的服务,或者开通相应的权限。With the development of technology, the application of face recognition becomes more and more extensive. In many application scenarios, face recognition technology is often used to determine the identity of the user by performing face recognition on the collected image data, and then provide the user with the corresponding service or open the corresponding authority.
但是,目前出现了许多通过使用包含有他人人脸的照片、视频,或者套用他人的人脸面具等方式来伪装成他人,以蒙混通过人脸识别,对他人的权益安全产生威胁的现象。因此,在一些实施例通常会在进行人脸识别之前,还会先利用针对所处的具体场景训练对应的活体检测模型进行活体检测,以确定所要识别的图像数据中的人脸对象是否是真实的人类的脸,而不是照片、视频或者面具等。又由于不同场景所对应的环境条件、识别要求等会存在差异,导致针对不同的场景,往往需要分别单独训练建立对应的活体检测模型来进行活体检测。However, there have been many phenomena that pretend to be other people by using photos and videos containing other people's faces, or applying other people's face masks, etc., in order to confuse and threaten the rights and security of others through face recognition. Therefore, in some embodiments, before face recognition is usually performed, a living detection model corresponding to the specific scene is trained to perform living detection to determine whether the face object in the image data to be recognized is real. Human faces instead of photos, videos, or masks. In addition, due to differences in environmental conditions and recognition requirements corresponding to different scenarios, it is often necessary to separately train and establish corresponding live detection models for live detection for different scenarios.
因此,亟需一种能够高效地进行活体检测的方法。Therefore, there is an urgent need for a method that can efficiently perform living body detection.
发明内容Summary of the invention
本说明书提供了活体检测方法、装置、服务器和人脸识别设备,以便可以有效地利用在第二场景中训练建立的预设的活体检测模型,来对在第一场景所采集到的图像数据中的目标对象进行较为高效、准确的活体检测。This manual provides a living body detection method, device, server, and face recognition equipment, so that the preset living body detection model trained and established in the second scene can be effectively used to compare the image data collected in the first scene The target object is more efficient and accurate live detection.
本说明书提供的一种活体检测方法、装置、服务器和人脸识别设备是这样实现的:The living body detection method, device, server and face recognition equipment provided in this manual are implemented as follows:
一种活体检测方法,包括:获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;调用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;根据所述目标特征组和第一场景的锚点特征组,确定目标特 征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。A living body detection method includes: acquiring target image data, wherein the target image data includes image data including a target object collected in a first scene; calling a preset living body detection model to obtain data from the target image The target feature group is extracted from the, and the probability value of the target object being a non-living object is determined as the target probability through the preset live detection model, wherein the preset live detection model includes the use of the second scene A model trained on sample data; determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene, wherein the anchor point feature group of the first scene is determined according to the sample data of the first scene; According to the target feature group distance and the target probability, it is determined whether the target object is a living object.
一种活体检测装置,包括:获取模块,用于获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;使用模块,用于使用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;第一确定模块,用于根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;第二确定模块,用于根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。A living body detection device includes: an acquisition module for acquiring target image data, wherein the target image data includes image data including a target object acquired in a first scene; a use module for using preset A living body detection model, extracting a target feature group from the target image data, and determining the probability value of the target object being a non-living body object through the preset living body detection model as the target probability, wherein the preset The living body detection model includes a model trained using sample data of the second scene; a first determining module is used to determine the target feature group distance according to the target feature group and the anchor point feature group of the first scene, wherein the The anchor point feature group of the first scene is determined according to the sample data of the first scene; the second determining module is configured to determine whether the target object is a living object according to the distance of the target feature group and the target probability.
一种服务器,包括处理器以及用于存储处理器可执行指令的存储器,所述处理器执行所述指令时实现获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;使用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。A server includes a processor and a memory for storing executable instructions of the processor. When the processor executes the instructions, the target image data is obtained, wherein the target image data includes data collected in a first scene. Image data of a target object; using a preset living body detection model to extract a target feature group from the target image data, and determining the probability that the target object is a non-living body object through the preset living body detection model Value as the target probability, wherein the preset liveness detection model includes a model trained using sample data of the second scene; the target feature group distance is determined according to the target feature group and the anchor point feature group of the first scene, Wherein, the anchor point feature group of the first scene is determined according to the sample data of the first scene; according to the distance of the target feature group and the target probability, it is determined whether the target object is a living object.
一种计算机可读存储介质,其上存储有计算机指令,所述指令被执行时实现获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;使用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。A computer-readable storage medium, on which computer instructions are stored, which realize acquisition of target image data when the instructions are executed, wherein the target image data includes image data including a target object collected in a first scene; Using a preset life detection model, extract a target feature group from the target image data, and determine the probability value of the target object being a non-living object through the preset life detection model as the target probability, wherein, The preset living detection model includes a model trained using sample data of the second scene; the target feature group distance is determined according to the target feature group and the anchor point feature group of the first scene, wherein the first scene The anchor point feature group of is determined according to the sample data of the first scene; according to the distance of the target feature group and the target probability, it is determined whether the target object is a living object.
一种人脸识别设备,包括处理器以及用于存储处理器可执行指令的存储器,所述处理器执行所述指令时实现上述活体检测方法,以确定用于进行人脸识别的目标图像数据中的目标对象是否为活体对象;在确定所述目标对象不是活体对象的情况下,确定人脸识别失败。A face recognition device includes a processor and a memory for storing executable instructions of the processor. When the processor executes the instructions, the above-mentioned living body detection method is implemented to determine the target image data used for face recognition. Whether the target object of is a living object; in the case where it is determined that the target object is not a living object, it is determined that the face recognition fails.
本说明书提供的活体检测方法、装置、服务器和人脸识别设备,通过使用基于第二场景训练得到的预设的活体检测模型对第一场景采集的目标图像数据进行处理,提取得到对应的目标特征组,并通过上述模型基于该目标特征组确定出目标图像数据中的目标对象属于非活体对象的目标概率;同时,又引入并利用基于第一场景的样本数据所确定的第一场景的锚点特征组,来确定目标特征组与锚点特征组之间的目标特征组距离;再综合上述目标概率和目标特征组距离来较为准确地确定出第一场景中采集到的目标图像数据中的目标对象是否为活体对象。从而可以不用再针对第一场景另外单独训练对应的活体检测模型,能有效地利用在其他场景中已经训练好的活体检测模型,高效地对第一场景中所采集的目标图像数据中的目标对象进行活体检测。The living body detection method, device, server, and face recognition equipment provided in this manual process the target image data collected in the first scene by using a preset living body detection model trained on the second scene to extract the corresponding target features According to the target feature group, the above model determines the target probability that the target object in the target image data belongs to the non-living object; at the same time, the anchor point of the first scene determined based on the sample data of the first scene is introduced and used The feature group is used to determine the target feature group distance between the target feature group and the anchor point feature group; then the above-mentioned target probability and the target feature group distance are combined to more accurately determine the target in the target image data collected in the first scene Whether the object is a living object. Therefore, there is no need to separately train the corresponding living detection model for the first scene, and the living detection model that has been trained in other scenes can be effectively used to efficiently analyze the target objects in the target image data collected in the first scene. Perform a live test.
附图说明Description of the drawings
为了更清楚地说明本说明书实施例,下面将对实施例中所需要使用的附图作简单地介绍,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of this specification more clearly, the following will briefly introduce the drawings needed in the embodiments. The drawings in the following description are only some of the embodiments recorded in this specification. In other words, other drawings can be obtained based on these drawings without creative labor.
图1是应用本说明书实施例提供的活体检测方法的系统结构组成的一个实施例的示意图;FIG. 1 is a schematic diagram of an embodiment of the system structure composition of the living body detection method provided by the embodiment of this specification;
图2是在一个场景示例中,应用本说明书实施例提供的活体检测方法的一种实施例的示意图;FIG. 2 is a schematic diagram of an embodiment of applying the living body detection method provided in the embodiment of this specification in an example of a scene;
图3是在一个场景示例中,应用本说明书实施例提供的活体检测方法的一种实施例的示意图;FIG. 3 is a schematic diagram of an embodiment of applying the living body detection method provided by the embodiment of this specification in an example of a scene;
图4是本说明书的一个实施例提供的活体检测方法的流程示意图;4 is a schematic flowchart of a living body detection method provided by an embodiment of this specification;
图5是本说明书的一个实施例提供的活体检测方法的一个实施例示意图;FIG. 5 is a schematic diagram of an embodiment of a living body detection method provided by an embodiment of this specification;
图6是本说明书的一个实施例提供的活体检测方法的一个实施例示意图;FIG. 6 is a schematic diagram of an embodiment of a living body detection method provided by an embodiment of this specification;
图7是本说明书的一个实施例提供的服务器的结构组成示意图;FIG. 7 is a schematic diagram of the structural composition of a server provided by an embodiment of this specification;
图8是本说明书的一个实施例提供的活体检测装置的结构组成示意图。FIG. 8 is a schematic diagram of the structural composition of a living body detection device provided by an embodiment of this specification.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书 实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification in conjunction with the drawings in the embodiments of this specification. Obviously, the described The embodiments are only a part of the embodiments in this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this specification.
本说明书实施例提供了活体检测方法,该活体检测方法具体可以应用于包含有服务器和采集终端的系统架构中。具体可以参阅图1所示,其中,所述采集终端布设于第一场景中,所述采集终端通过有线或无线的方式与服务器耦合,以便进行数据交互。通过该系统可以不用再针对当前场景训练对应的活体检测模型,而是可以调用在其他场景中已经训练好的活体检测模型,高效地对当前场景中所采集的图像数据中的目标对象进行活体检测。The embodiments of the present specification provide a living body detection method, and the living body detection method can be specifically applied to a system architecture including a server and a collection terminal. For details, please refer to FIG. 1, where the collection terminal is arranged in the first scenario, and the collection terminal is coupled with the server in a wired or wireless manner to facilitate data interaction. Through this system, it is no longer necessary to train the corresponding live detection model for the current scene, but can call the live detection model that has been trained in other scenes, and efficiently perform the live detection of the target object in the image data collected in the current scene .
具体的,所述采集终端具体可以用于采集第一场景的目标图像数据,并将所述目标图像数据发送至服务器。其中,所述目标图像数据包括在第一场景中采集得到的包含有目标对象(例如人脸等)的图像数据。所述服务器具体可以用于调用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型根据所述目标特征确定出所述目标对象为非活体对象的概率值作为目标概率。其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型。根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离。其中,所述第一场景的锚点特征组根据第一场景的样本数据确定。根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。Specifically, the collection terminal may be specifically used to collect the target image data of the first scene, and send the target image data to the server. Wherein, the target image data includes image data including a target object (for example, a human face, etc.) collected in the first scene. The server may be specifically configured to call a preset life detection model, extract a target feature group from the target image data, and determine that the target object is based on the target feature through the preset life detection model The probability value of the non-living object is used as the target probability. Wherein, the preset living body detection model includes a model obtained by training using sample data of the second scene. Determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene. Wherein, the anchor point feature group of the first scene is determined according to the sample data of the first scene. According to the target feature group distance and the target probability, it is determined whether the target object is a living object.
在本实施例中,所述服务器可以是一种应用于数据处理平台一侧,能够实现数据传输、数据处理等功能的后台业务服务器。具体的,所述服务器可以为一个具有数据运算、存储功能以及网络交互功能的电子设备;也可以为运行于该电子设备中,为数据处理、存储和网络交互提供支持的软件程序。在本实施方式中,并不具体限定所述服务器的数量。所述服务器具体可以为一个服务器,也可以为几个服务器,或者,由若干服务器形成的服务器集群。In this embodiment, the server may be a background service server that is applied to the side of the data processing platform and can implement functions such as data transmission and data processing. Specifically, the server may be an electronic device with data operation, storage functions, and network interaction functions; it may also be a software program that runs in the electronic device and provides support for data processing, storage, and network interaction. In this embodiment, the number of the servers is not specifically limited. The server may specifically be one server, or several servers, or a server cluster formed by several servers.
在本实施例中,所述采集终端可以是一种应用于具体的场景区域一侧,能够实现数据采集、数据传输等功能的前端设备。具体地,所述采集终端例如可以为监控摄像头,也可以是安装有摄像头的其他电子设备,例如平板电脑、笔记本电脑、智能手机等。In this embodiment, the collection terminal may be a front-end device that is applied to the side of a specific scene area and can implement functions such as data collection and data transmission. Specifically, the collection terminal may be, for example, a surveillance camera, or other electronic equipment equipped with a camera, such as a tablet computer, a notebook computer, a smart phone, and the like.
在一个场景示例中,A公司可以应用本说明书实施例提供的活体检测方法对公司门禁系统所采集到的人脸图像进行活体检测。In an example of a scenario, company A can apply the living body detection method provided in the embodiment of this specification to perform living body detection on the face image collected by the company's access control system.
在本场景示例中,A公司之前就在公司内部设置有考勤系统,在该考勤系统中布设有一套人脸识别设备(记为第一人脸识别设备),该人脸设备包括有摄像头和处理器。员工在进入公司打卡时,考勤系统可以调用上述第一人脸识别设备根据摄像头所拍摄的人脸照片进行人脸识别,以对打卡员工的身份信息进行识别确认。参阅图2所示。In this scenario example, company A has set up an attendance system inside the company before, and a set of face recognition equipment (recorded as the first face recognition device) is deployed in the attendance system. The face equipment includes a camera and processing Device. When an employee enters the company to check in, the attendance system can call the above-mentioned first face recognition device to perform face recognition based on the face photo taken by the camera to identify and confirm the identity information of the employee who checks in. Refer to Figure 2.
具体的,为了避免出现员工代打卡的情况,上述第一人脸识别设备在通过摄像头采集到打卡员工的人脸照片后,处理器会先调用已经训练好的第一活体检测模型对该人脸照片中的人脸对象进行活体检测,以确定所采集到的人脸照片中的人脸对象是否为活体对象。如果通过上述第一活体检测模型确定该人脸照片中的人脸为活体对象的人脸,则通过活体检测,进而人脸识别设备才会对上述人脸照片进行进一步的人脸识别,确定出该人脸所对应的员工的身份信息,并将所确定出的员工的身份信息反馈给考勤系统,以完成该员工的考勤记录。Specifically, in order to avoid the situation of employees checking in on behalf of employees, after the aforementioned first face recognition device collects the face photos of the employees who check in through the camera, the processor will first call the trained first live detection model for the face. The face object in the photo is subject to live detection to determine whether the face object in the collected face photo is a living object. If it is determined by the above-mentioned first live body detection model that the face in the face photo is the face of a live object, then the face recognition device will perform further face recognition on the above-mentioned face photo through live body detection, and determine The identity information of the employee corresponding to the face, and the determined identity information of the employee is fed back to the attendance system to complete the attendance record of the employee.
其中,上述第一活体检测模型具体应用时,可以先从人脸照片提取出对应的特征,再根据所提取的特征来判断该人脸照片的人脸对象是否为活体对象。如果通过上述第一活体检测模型确定该人脸照片中给的人脸不是活体对象的人脸,则未通过活体检测,这时人脸识别设备会判断有人正在通过使用包含有他人的人脸的照片、视频或者面具冒充他人进行代打卡,进而不会再对该人脸照片进行进一步的人脸识别,而是可以会发出警报提示,并停止考勤记录,提示用户打开失败。Wherein, in the specific application of the above-mentioned first living body detection model, the corresponding feature can be extracted from the face photo first, and then it is determined whether the face object of the face photo is a living object according to the extracted features. If it is determined by the above-mentioned first liveness detection model that the face given in the face photo is not the face of a live object, then the liveness detection is not passed. At this time, the face recognition device will judge that someone is using a face that contains other people’s faces. The photo, video or mask pretends to be another person to punch in on behalf of the card, and then no further face recognition will be performed on the face photo, but an alarm will be issued and the attendance record will stop, prompting the user to open the failure.
当前,A公司计划在公司外布设一套包含有人脸识别设备(记为第二人脸识别设备)的门禁系统。可以参阅图3所示。其中,上述第二人脸识别设备包含有摄像头和处理器。具体的,上述摄像头可以布设于公司外的大门位置的上方,用于采集准备进入公司的人的人脸照片。第二人脸识别设备中的处理器也需要利用活体检测模型先对摄像头所采集到的人脸照片进行活体检测,在检测通过确定所采集到的人脸照片中的人脸对象为活体对象后,才会对该人脸照片中的人脸进行进一步的人脸识别,以确定该人脸对象所对应的身份信息是否为A公司的员工,再将确定结果反馈给门禁系统。门禁系统根据该确定结果,在确定人脸照片中的人脸对象所对应的身份信息为A公司的员工后才会自动打开公司的大门,该员工才能顺利地进入公司。Currently, Company A plans to deploy a set of access control systems that include facial recognition equipment (denoted as the second facial recognition equipment) outside the company. You can refer to Figure 3. Wherein, the above-mentioned second face recognition device includes a camera and a processor. Specifically, the above-mentioned camera may be arranged above the gate position outside the company to collect face photos of people who are about to enter the company. The processor in the second face recognition device also needs to use the live body detection model to first perform live body detection on the face photos collected by the camera, and after the detection determines that the face objects in the collected face photos are live objects , Then further face recognition will be performed on the face in the face photo to determine whether the identity information corresponding to the face object is an employee of company A, and then the determination result will be fed back to the access control system. According to the determination result, the access control system will automatically open the door of the company after determining that the identity information corresponding to the face object in the face photo is an employee of company A, so that the employee can enter the company smoothly.
但是目前并没有针对门禁系统的应用场景的活体检测模型,通常需要先耗费大量的时间和资源训练得到针对门禁系统的应用场景的活体检测模型。However, there is currently no live detection model for the application scenario of the access control system, and it usually takes a lot of time and resources to train to obtain the live detection model for the application scenario of the access control system.
虽然,当前A公司拥有已经训练好的第一活体检测模型。但是,由于该模型是针对第一人脸识别设备所对应的考勤系统这一应用场景设计、训练得到的。因此,该模型并 不适用于第二人脸识别设备所对应的门禁系统的应用场景。如果直接将第一活体检测模型应用于门禁系统场景,往往容易出现识别误差。Although, company A currently has the first live detection model that has been trained. However, because the model is designed and trained for the application scenario of the attendance system corresponding to the first face recognition device. Therefore, this model is not suitable for the application scenario of the access control system corresponding to the second face recognition device. If the first living body detection model is directly applied to the scene of the access control system, recognition errors are often prone to occur.
具体的,例如,在第一人脸识别设备所针对的考勤系统的应用场景中,摄像头通常设置室内,环境条件较为稳定,采集人脸照片时外界的光线相对较为充足,所得到的人脸照片通常会相对较为清晰。此外,在考勤系统的应用场景中,员工打卡过程中往往相对较为配合摄像头采集人脸照片。因此,在考勤系统的应用场景中活体检测模型所要处理的人脸照片的图像质量会相对较高。进一步,又由于A公司对公司考勤系统的精度要求较高,活体检测模型在具体检测过程中也会相对较为严格。Specifically, for example, in the application scenario of the attendance system targeted by the first face recognition device, the camera is usually set indoors and the environmental conditions are relatively stable. When the face photos are collected, the outside light is relatively sufficient, and the resulting face photos It is usually relatively clear. In addition, in the application scenario of the attendance system, employees often cooperate with the camera to collect facial photos during the clock-in process. Therefore, in the application scenario of the attendance system, the image quality of the face photos to be processed by the living body detection model will be relatively high. Furthermore, because company A has high requirements for the accuracy of the company's attendance system, the living body detection model will be relatively strict in the specific detection process.
而在第二人脸识别设备所针对的门禁系统的应用场景中,由于摄像头通常设置在室外,环境条件较为复杂多变、不够稳定,导致采集人脸照片时外界的光线也不够稳定,例如,中午光照太强,晚上光照太弱,导致所采集得到的人脸照片可能不够清晰。此外,在门禁系统的应用场景中,员工在进入公司的过程中通常习惯上不会配合摄像头采集人脸照片。因此,导致在门禁系统的应用场景中所采集到的,活体检测模型所要处理的人脸照片的图像质量通常会相对较低。进一步,又由于A公司对门禁系统的精度要求没有考勤系统的高。In the application scenario of the access control system targeted by the second face recognition device, because the camera is usually set outdoors, the environmental conditions are more complex and changeable and not stable enough, resulting in insufficient light from outside when taking face photos, for example, The light is too strong at noon, and the light at night is too weak, so the collected face photos may not be clear enough. In addition, in the application scenario of the access control system, employees usually do not cooperate with the camera to collect facial photos when entering the company. Therefore, the image quality of the face photos collected in the application scenarios of the access control system and processed by the living body detection model is usually relatively low. Furthermore, because A company's requirements for the accuracy of the access control system are not as high as that of the attendance system.
因此,如果直接在第二人脸识别设备中套用针对于考勤系统的应用场景的第一活体检测模型来确定第二人脸识别设备所采集的人脸照片中的人脸对象是否为活体对象,往往会很容易出现检测误差。例如,可能经常出现无法识别出本公司的员工,导致不能及时为本公司员工开门的情况。Therefore, if the first live detection model for the application scenario of the attendance system is directly applied to the second face recognition device to determine whether the face object in the face photo collected by the second face recognition device is a live object, Detection errors are often prone to occur. For example, it may often happen that the employees of the company cannot be identified, resulting in failure to open the door for the employees of the company in time.
在一些实施例中,通常会针对门禁系统的应用场景,耗费大量资源和时间重新训练建立一个活体检测模型。或者,针对门禁系统应用场景采集对应的样本数据,再利用上述样本数据,对第一活体检测模型进行训练和调整,得到不同于第一活体检测模型的,能够适用于门禁系统的应用场景的调整后的活体检测模型。In some embodiments, it usually takes a lot of resources and time to retrain and establish a living body detection model for the application scenario of the access control system. Or, collect corresponding sample data for the application scenario of the access control system, and then use the above sample data to train and adjust the first living body detection model to obtain a different model from the first living body detection model, which is suitable for the adjustment of the application scenario of the access control system After the live detection model.
而在本场景示例中,基于本说明书实施例所提供的活体检测方法,可以不需要针对门禁系统的应用场景单独重新训练,或调整得到新的活体检测模型。In this scenario example, based on the living body detection method provided in the embodiment of this specification, there is no need to separately retrain for the application scenario of the access control system, or adjust to obtain a new living body detection model.
具体实施时,第二人脸设备的处理器可以先直接调用已经训练好的适用于考勤系统的应用场景第一活体检测模型对第二人脸设备的摄像头在室外所采集到的包含有人脸对象的人脸照片进行特征提取,得到对应的目标特征组。进一步,可以通过第一活体检测模型基于上述目标特征组进行确定出该人脸对象为非活体对象的概率值作为目标概 率。需要说明的是,由于上述使用的第一活体检测模型是针对考勤系统的应用场景训练得到的,在将第一活体检测模型应用于门禁系统的场景中对所采集到的人脸照片中的人脸对象进行活体检测判断时,没有考虑到门禁系统的应用场景在环境条件、精度要求等方面的具体特点,因此所得到目标概率值并不一定完全准确,但可以作为一种判断活体对象的参考依据。通常,目标概率值的数值越大,所对应的人脸对象越有可能不是活体对象,而是非活体对象。During specific implementation, the processor of the second face device can first directly call the trained application scenario that is suitable for the attendance system. The first living body detection model checks the camera of the second face device that contains human face objects collected outdoors. Feature extraction is performed on the face photos of, and the corresponding target feature group is obtained. Further, the probability value of determining that the face object is a non-living object based on the target feature group by the first living body detection model may be used as the target probability. It should be noted that, since the first living body detection model used above is trained for the application scenario of the attendance system, in the scene where the first living body detection model is applied to the access control system, the person in the collected face photos is When the face object is judged in vivo, it does not take into account the specific characteristics of the application scenario of the access control system in terms of environmental conditions and accuracy requirements. Therefore, the target probability value obtained may not be completely accurate, but it can be used as a reference for judging living objects. in accordance with. Generally, the larger the value of the target probability value, the more likely the corresponding face object is not a living object, but a non-living object.
进一步,处理器可以将基于第一活体检测模型提取出的目标特征组与预先确定出的门禁系统的应用场景的锚点特征组进行比较,计算出目标特征组与上述锚点特征组之间的特征距离。Further, the processor may compare the target feature group extracted based on the first living body detection model with a predetermined anchor point feature group of the application scenario of the access control system, and calculate the difference between the target feature group and the aforementioned anchor point feature group. Characteristic distance.
其中,上述锚点特征组具体可以理解为一种包括了门禁系统的应用场景中的不同情况(例如不同环境条件)下的正样本的典型特点的特征集合。具体的,上述锚点特征组可以预先根据门禁系统的应用场景中的样本数据中的正样本数据确定。上述正样本具体可以包括包含有真人人脸的图像数据。Among them, the aforementioned anchor point feature group can be specifically understood as a feature set that includes typical features of positive samples in different situations (for example, different environmental conditions) in the application scenario of the access control system. Specifically, the aforementioned anchor point feature group may be determined in advance according to the positive sample data in the sample data in the application scenario of the access control system. The above-mentioned positive samples may specifically include image data containing real human faces.
上述目标特征组与锚点特征组之间的特征距离具体可以用于衡量目标特征组与不同情况(例如不同光照条件、不同的采集角度等)下的门禁系统的应用场景的正样本特征的差异程度。该数据也可以作为一种判断活体对象的参考依据。但需要说明的是,该数据是一种已经考虑并兼顾到了门禁系统应用场景的环境条件、精度要求等方面特点的参考数据。通常,目标特征组与锚点特征组的特征距离越大,所对应的人脸对象越有可能不是活体对象。The feature distance between the target feature group and the anchor point feature group can be specifically used to measure the difference between the target feature group and the positive sample feature of the application scenario of the access control system under different conditions (for example, different lighting conditions, different acquisition angles, etc.) degree. The data can also be used as a reference basis for judging living objects. However, it should be noted that this data is a kind of reference data that has considered and took into account the environmental conditions and accuracy requirements of the application scenario of the access control system. Generally, the larger the feature distance between the target feature group and the anchor point feature group, the more likely the corresponding face object is not a living object.
在本场景示例中,具体计算目标特征组与锚点特征组的特征距离时,可以分别计算目标特征组与锚点特征组中的各个特征的差值的模作为目标特征组与锚点特征组中的各个特征的特征距离,再根据目标特征组与锚点特征组中的各个特征的特征距离来确定出目标特征组与锚点特征组的特征距离,可以记为目标特征组距离。In this scenario example, when specifically calculating the feature distance between the target feature group and the anchor point feature group, the difference between the target feature group and the anchor point feature group can be calculated separately as the target feature group and the anchor point feature group. The feature distance of each feature in, then the feature distance between the target feature group and the anchor feature group is determined according to the feature distance of each feature in the target feature group and the anchor feature group, which can be recorded as the target feature group distance.
具体的,上述特征距离可以按照以下算式确定:Specifically, the above characteristic distance can be determined according to the following formula:
Dis tan ce={D center,D 1,D 2,...,D K}={||f-f center|| 2,||f-f a1|| 2,||f-f a2|| 2,...,||f-f aK|| 2} Dis tan ce={D center ,D 1 ,D 2 ,...,D K }={||ff center || 2 ,||ff a1 || 2 ,||ff a2 || 2 ,... ,||ff aK || 2 }
其中,上述Dis tan ce具体可以用于表示目标特征组与锚点特征组的特征距离,D center具体可以用于表示目标特征组与锚点特征组中的中心点特征的特征距离,D K具体可以用于表示目标特征组与锚点特征组中的编号为K的特征的特征距离,f具体可以表示为 目标特征组,f center具体可以表示为锚点特征组中的中心点特征,f aK具体可以表示为锚点特征组中的编号为K的特征,|||| 2具体可以表示为一种求模运算。 Among them, the above Dis tan ce can be specifically used to represent the feature distance between the target feature group and the anchor point feature group, D center can specifically be used to represent the feature distance between the target feature group and the center point feature in the anchor feature group, and D K specifically It can be used to represent the feature distance between the target feature group and the feature numbered K in the anchor feature group, f can be specifically represented as the target feature group, f center can be specifically represented as the center point feature in the anchor feature group, f aK Specifically, it can be expressed as the feature numbered K in the anchor point feature group, and |||| 2 can be expressed as a modulo operation.
在按照上述方式分别确得到了目标概率,以及考虑了门禁系统的应用场景的环境条件、精度要求等具体特点的目标特征组与锚点特征组的特征距离后,可以同时综合上述两种数据来针对当前的门禁系统的应用场景,较为准确、高效地判断该场景中所采集的人脸照片中的人脸对象是否为活体对象。After confirming the target probability and the characteristic distance between the target feature group and the anchor point feature group considering the environmental conditions and accuracy requirements of the application scenario of the access control system according to the above method, the above two data can be synthesized at the same time. In view of the application scenario of the current access control system, it is more accurate and efficient to determine whether the face object in the face photo collected in the scene is a living object.
具体的,先根据所述目标特征组与锚点特征组的特征距离确定第一评分;根据所述目标概率确定第二评分。例如,可以通过比较目标特征组与锚点特征组的特征距离,与预设的距离阈值的大小来确定第一评分。如果上述特征距离小于预设的距离阈值,则可以得到相对较高的第一评分。相反,如果上述特征距离大于预设的距离阈值得到的第一评分会相对较低。类似的,可以通过比较目标概率与预设的比率阈值的大小来确定第二评分。如果目标概率小于预设的比率阈值,则可以得到相对较高的第二评分。相反,如果上述目标概率大于预设的比率阈值,得到的第二评分也会相对较低。Specifically, the first score is first determined according to the feature distance between the target feature group and the anchor point feature group; the second score is determined according to the target probability. For example, the first score can be determined by comparing the feature distance between the target feature group and the anchor point feature group and the preset distance threshold. If the above characteristic distance is less than the preset distance threshold, a relatively high first score can be obtained. On the contrary, if the above characteristic distance is greater than the preset distance threshold, the first score obtained will be relatively low. Similarly, the second score can be determined by comparing the target probability with a preset ratio threshold. If the target probability is less than the preset ratio threshold, a relatively high second score can be obtained. On the contrary, if the aforementioned target probability is greater than the preset ratio threshold, the second score obtained will also be relatively low.
其中,上述预设的距离阈值和预设的比率阈值可以根据具体情况结合具体的精度要求设置。对于预设的距离阈值和预设的比率阈值的具体数值,本说明书不作限定。Wherein, the above-mentioned preset distance threshold and preset ratio threshold can be set according to specific conditions in combination with specific accuracy requirements. The specific values of the preset distance threshold and the preset ratio threshold are not limited in this specification.
进一步,可以根据预设的权重规则,对所述第一评分和第二评分进行加权求和,得到第三评分。具体的,可以根据预设的权重规则确定出第一评分的所对应的第一权重,以及第二评分所对应的第二权重,再将第一评分和第一权重的乘积,与第二评分和第二权重给的乘积相加得到的和作为上述第三评分。Further, a weighted sum of the first score and the second score may be performed according to a preset weighting rule to obtain a third score. Specifically, the first weight corresponding to the first score and the second weight corresponding to the second score can be determined according to a preset weight rule, and the product of the first score and the first weight is then multiplied by the second score The sum obtained by adding the product given by the second weight is used as the above-mentioned third score.
上述第三评分可以理解为一种综合考虑了目标概率以及目标特征组距离两种参考依据得到的一种评价分数。进而可以根据第三评分较为准确地确定出所检测的人脸照片中的人脸对象是否为活体对象。The above-mentioned third score can be understood as an evaluation score obtained by comprehensively considering the two reference basis of target probability and target feature group distance. Furthermore, it can be determined more accurately whether the face object in the detected face photo is a living object according to the third score.
具体的,可以将所述第三评分与预设的评分阈值进行比较,得到比较结果。根据所述比较结果,确定所述目标对象是否为活体对象。Specifically, the third score may be compared with a preset score threshold to obtain a comparison result. According to the comparison result, it is determined whether the target object is a living object.
例如,如果根据比较结果确定第三评分小于等于上述预设的评分阈值,则可以判断该人脸对象不是活体对象,进而可以直接确定人脸识别失败,不再进行进一步的人脸识别。并且第二人脸识别设备会将人脸识别失败的识别结果反馈给门禁系统。这时,门禁系统根据该人脸识别结果,不会为该人开门。如果根据比较结果确定第三评分大于预设的评分阈值,则可以判断该人脸对象是活体对象,进而可以再进行进一步的人脸识别。 如果通过进一步的人脸识别确定该人脸对象所对应的身份信息为A公司的某个员工后,确定人脸识别成功。并且第二人脸识别设备会将人脸识别成功的识别结果反馈给门禁系统。这时,门禁系统根据该人脸识别结果,会自动为该人开门。For example, if it is determined according to the comparison result that the third score is less than or equal to the aforementioned preset score threshold, it can be determined that the face object is not a living object, and then it can be directly determined that the face recognition fails, and no further face recognition is performed. And the second face recognition device will feed back the recognition result of the face recognition failure to the access control system. At this time, the access control system will not open the door for the person based on the face recognition result. If it is determined according to the comparison result that the third score is greater than the preset score threshold, it can be determined that the face object is a living object, and further face recognition can be performed. If it is determined through further face recognition that the identity information corresponding to the face object is an employee of company A, it is determined that the face recognition is successful. And the second face recognition device will feed back the recognition result of successful face recognition to the access control system. At this time, the access control system will automatically open the door for the person based on the face recognition result.
这样可以在不需要另外针对门禁系统的应用场景重新训练,或修改调整得到新的活体检测模型的情况下,能够直接调用已经训练好的但适用于考勤系统的应用场景的第一活体检测模型,结合门禁系统的应用场景的锚点特征组,来快速、准确地对门禁系统的应用场景中所采集到的照片中的人脸对象进行活体检测。In this way, it is possible to directly call the first living detection model that has been trained but suitable for the application scenario of the attendance system without the need to retrain for the application scenario of the access control system, or modify and adjust to obtain a new living detection model. Combining the anchor point feature group of the application scenario of the access control system to quickly and accurately detect the face objects in the photos collected in the application scenario of the access control system.
在另一个场景示例中,A公司可以预先通过布设在门禁系统中的第二人脸设备的摄像头采集多种户外环境条件下的包含有真人人脸的照片作为正样本数据,组成一个正样本数据集,可以记为X。其中,该正样本数据集中包括了多个包含有真人人脸的照片。具体的,例如,可以表示为X={x 1,x 2,...,x i,...,x N}。其中,x i具体可以用于表示正样本数据集中编号为i的照片。 In another scenario example, company A can collect photos containing real human faces under a variety of outdoor environmental conditions through the camera of the second face device deployed in the access control system in advance as positive sample data to form a positive sample data Set, can be denoted as X. Among them, the positive sample data set includes multiple photos containing real human faces. Specifically, for example, it can be expressed as X={x 1 ,x 2 ,...,x i ,...,x N }. Among them, x i can be specifically used to represent the photo numbered i in the positive sample data set.
在获取上述正样本数据时,为了使得所获取的正样本数据能够较为全面的覆盖门禁系统的应用场景中的不同环境条件情况。具体在采集人脸照片时,可以记录下采集时间以及采集时的天气数据。进一步,可以根据采集时间以及采集时的天气数据,从所采集的大量人脸照片中针对性地筛选出对应有不同采集时间和天气数据组合的人脸照片作为正样本数据。When acquiring the above-mentioned positive sample data, in order to enable the acquired positive sample data to more comprehensively cover different environmental conditions in the application scenario of the access control system. Specifically, when collecting face photos, the time of collection and the weather data at the time of collection can be recorded. Further, according to the collection time and the weather data at the time of collection, the face photos corresponding to different collection time and weather data combinations can be selected from the large number of collected face photos as positive sample data.
在得到上述正样本数据后,可以将上述正样本数据集中的各个正样本数据分别输入至已经训练好的第一活体检测模型,通过第一活体检测模型提取得到对应的样本特征。其中,每一个样本特征与一个正样本数据对应。根据多个样本特征建立一个样本特征集,可以记为F。具体的,例如,该样本特征集可以表示为F={f 1,f 2,...,f i,...,f N}。其中,f i具体可以用于表示与编号为i的照片对应的样本特征。 After the positive sample data is obtained, each positive sample data in the positive sample data set can be input to the trained first living body detection model, and the corresponding sample feature can be extracted through the first living body detection model. Among them, each sample feature corresponds to a positive sample data. Create a sample feature set based on multiple sample features, which can be denoted as F. Specifically, for example, the sample feature set can be expressed as F={f 1 ,f 2 ,...,f i ,...,f N }. Among them, f i can be specifically used to represent the sample feature corresponding to the photo numbered i.
进一步可以先对上述样本特征分别进行相应的特征处理。具体的,例如,可以根据具体情况确定出平均特征(可以记为f mean);再将上述多个样本特征中的各个样本特征分别减去上述平均特征,得到处理后的样本特征。这样可以对上述样本特征进行归一化,使得上述样本特征的数值统一在一个数值范围内,以减少后续处理过程中的误差。再根据处理后的样板特征建立对应的处理后的样本特征集,可以记为F′。具体的,例如,上述处理后的样本特征集可以表示为:F′={f 1′,f′ 2,...,f i′,...,f′ N}。其中,f i′具体可以用于表示与编号为i的照片对应的处理后的样本特征。 Further, corresponding feature processing can be performed on the above-mentioned sample features respectively. Specifically, for example, an average feature (may be denoted as f mean ) can be determined according to specific conditions; then, the average feature is subtracted from each of the multiple sample features to obtain the processed sample feature. In this way, the above-mentioned sample characteristics can be normalized, so that the values of the above-mentioned sample characteristics are unified within a numerical range, so as to reduce errors in the subsequent processing. Then build a corresponding processed sample feature set based on the processed template features, which can be denoted as F'. Specifically, for example, the above-mentioned processed sample feature set can be expressed as: F′={f 1 ′, f′ 2 ,..., f i ′,..., f′ N }. Among them, f i ′ can be specifically used to represent the processed sample feature corresponding to the photo numbered i.
根据上述处理后的样本特征可以通过计算上述处理后的样本特征集的特征平均值来确定出中心点特征。具体的,例如,上述中心点特征可以按照以下算式确定:
Figure PCTCN2020103962-appb-000001
其中,f center具体可以表示为上述中心点特征。
According to the above-mentioned processed sample characteristics, the central point characteristic can be determined by calculating the characteristic average value of the above-mentioned processed sample characteristic set. Specifically, for example, the above-mentioned center point feature can be determined according to the following formula:
Figure PCTCN2020103962-appb-000001
Among them, f center can be specifically expressed as the above-mentioned center point feature.
分别计算处理后的各个样本特征与中心点特征的特征距离,并根据特征距离,从多个处理后的样本特征中筛选出距离中心点特征的特征距离大于特征距离阈值的处理后的样本特征作为符合要求的样本特征,从而可以使得所筛选出的样本特征对于所针对的门禁系统的应用场景具有相对较全面的覆盖范围。Calculate the feature distances between the processed sample features and the central point feature separately, and screen out the processed sample features whose feature distance from the central point feature is greater than the feature distance threshold from the multiple processed sample features based on the feature distance. The sample features that meet the requirements can enable the selected sample features to have a relatively comprehensive coverage for the targeted application scenarios of the access control system.
当然,上述所列举的确定符合要求的样本特征的方式只是一种示意性说明。具体实施时,还可以根据处理后的样本特征与中心点特征的特征距离,按照距离由大到小对处理后的样本特征进行排序;获取排序靠前的预设个数的处理后的样本特征作为符合要求的样本特征。具体的,例如,还可以按照以下方式确定出符合要求的样本特征:Of course, the methods for determining the characteristics of the samples that meet the requirements listed above are merely illustrative. In specific implementation, the processed sample features can also be sorted according to the characteristic distance between the processed sample features and the center point feature in descending distance; the preset number of processed sample features at the top of the ranking can be obtained As a sample feature that meets the requirements. Specifically, for example, the sample characteristics that meet the requirements can also be determined in the following manner:
{f a1,f a2,...,f at,...,f aK}=TopK(||f i′-f center||) {f a1 ,f a2 ,...,f at ,...,f aK }=TopK(||f i ′-f center ||)
其中,上述f at具体可以用于表示编号为t的符合要求的样本特征,K具体可以表示预设个数,TopK()具体可以表示为一种获取数值排序靠前的K个数据的运算。 Wherein, the above f at can be specifically used to represent the characteristics of the sample with the number t that meet the requirements, K can specifically represent a preset number, and TopK() can specifically be represented as an operation to obtain the top K data in numerical order.
进而可以根据上述中心点特征和所筛选出的符合要求的样本特征建立得到对应的于门禁系统的应用场景的锚点特征组。其中,该锚点特征组具体可以包括中心点特征和符合要求的样本特征。具体的,上述锚点特征组可以记为
Figure PCTCN2020103962-appb-000002
从而得到了能够有效、全面地反映门禁系统的应用场景的环境特点的锚点特征组。
Furthermore, the anchor point feature group corresponding to the application scenario of the access control system can be established according to the above-mentioned center point feature and the selected sample feature that meets the requirements. Wherein, the anchor point feature group may specifically include a center point feature and a sample feature that meets the requirements. Specifically, the above anchor point feature group can be denoted as
Figure PCTCN2020103962-appb-000002
Thus, an anchor point feature group that can effectively and comprehensively reflect the environmental characteristics of the application scenario of the access control system is obtained.
第二人脸识别设备在综合利用针对考勤系统的应用场景的第一活体检测模型和上述针对门禁系统的应用场景的锚点特征组对摄像头所采集的人脸照片进行活体检测的同时,还会记录并统计每一个预设时间段内的误差比率。其中,上述误差比率具体可以理解为预设时间段活体检测错误的数量与该时间段内所执行的活体检测总数的比值。The second face recognition device comprehensively utilizes the first living body detection model for the application scenario of the attendance system and the above-mentioned anchor feature group for the application scenario of the access control system to perform living detection on the face photos collected by the camera. Record and count the error rate within each preset time period. Wherein, the above error ratio can be specifically understood as the ratio of the number of in-vivo detection errors in a preset period of time to the total number of in-vivo detections performed in the period.
具体实施时,第二人脸识别设备的处理器会将上述误差比率与预设的比率阈值进行比较,在确定误差比率大于上述预设的比率阈值的情况下,可以判断当前门禁系统的应用场景中所要处理的数据特点出现了变化,如果继续基于之前所确定的锚点特征组在进行活体检测的检测误差会相对较大。这时可以重新确定与门禁系统的应用场景的最新情况对应的锚点特征组,来替换当前使用的锚点特征组,进行锚点特征组的更新,以降低 检测误差。During specific implementation, the processor of the second face recognition device will compare the above error ratio with a preset ratio threshold, and if it is determined that the error ratio is greater than the above preset ratio threshold, it can determine the application scenario of the current access control system The characteristics of the data to be processed have changed, and the detection error of live detection based on the previously determined anchor point feature group will be relatively large. At this time, the anchor point feature group corresponding to the latest situation of the application scenario of the access control system can be re-determined to replace the currently used anchor point feature group, and update the anchor point feature group to reduce detection errors.
例如,可以获取距离当前时间较近的一个时间段(例如,最近一周)内的正样本数据,再根据上述正样本数据重新确定出新的锚点特征组,并利用上述新的锚点特征组替换之前使用的锚点特征组,使得第二人脸识别设备可以基于新的锚点特征组对当前的门禁系统的应用场景中的人脸照片进行活体检测时仍然具有较高的准确率。For example, it is possible to obtain the positive sample data within a period of time (for example, the last week) that is relatively close to the current time, and then re-determine a new anchor point feature group based on the above positive sample data, and use the above new anchor point feature group Replacing the previously used anchor point feature group, so that the second face recognition device can still have a high accuracy rate when performing live body detection on the face photo in the application scenario of the current access control system based on the new anchor point feature group.
由上述场景示例可见,本说明书提供的活体检测方法,可以有效地利用在其他应用场景中已经训练好的活体检测模型,高效地对在当前的应用场景中所采集到的人脸照片中的人脸对象进行较为准确的活体检测。It can be seen from the above scene examples that the living body detection method provided in this manual can effectively use the living body detection model that has been trained in other application scenarios, and efficiently detect people in the face photos collected in the current application scene. The face object performs a more accurate live body detection.
参阅图4所示,本说明书实施例提供了一种活体检测方法,其中,该方法具体应用于服务器一侧。具体实施时,该方法可以包括以下内容。Referring to FIG. 4, an embodiment of the present specification provides a living body detection method, wherein the method is specifically applied to the server side. In specific implementation, the method may include the following content.
S401:获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据。S401: Acquire target image data, where the target image data includes image data including the target object collected in the first scene.
在一些实施例中,上述目标图像数据具体可以理解为在第一场景中采集的包含有待检测的目标对象的图像数据。具体的,上述目标图像数据具体可以是照片、图像数据等。对于上述目标图像数据的具体形式类型,本说明书不作限定。In some embodiments, the above-mentioned target image data can be specifically understood as the image data collected in the first scene and containing the target object to be detected. Specifically, the aforementioned target image data may specifically be photos, image data, and the like. This specification does not limit the specific form type of the above-mentioned target image data.
具体实施时,还可以从视频影像等多媒体数据中截取上述目标图像数据。例如,可以从监控视频中截取包含有目标对象的图像帧作为上述目标图像数据等。During specific implementation, the above-mentioned target image data can also be intercepted from multimedia data such as video images. For example, the image frame containing the target object can be intercepted from the surveillance video as the above-mentioned target image data.
在一些实施例中,上述目标对象具体可以根据所对应的应用场景确定。例如,对于刷脸支付的应用场景,上述目标对象可以是用户的人脸数据。对于虹膜打卡的应用场景,上述目标对象可以是用户的虹膜数据。当然,需要说明的是,上述所列举的目标对象只是一种示意性说明。具体实施时,根据具体情况,上述目标对象还可以是其他类型内容的对象数据。对此,本说明书不作限定。In some embodiments, the aforementioned target object may be specifically determined according to the corresponding application scenario. For example, for the application scenario of face-swiping payment, the above-mentioned target object may be the face data of the user. For the application scenario of iris punch card, the above-mentioned target object may be the user's iris data. Of course, it should be noted that the target objects listed above are only schematic illustrations. During specific implementation, according to specific circumstances, the aforementioned target object may also be object data of other types of content. In this regard, this manual is not limited.
在一些实施例中,上述第一场景具体可以理解为该活体检测方法所针对的具体的应用场景。具体的,上述第一场景可以是门禁系统通过人脸识别为识别通过的用户自动开门,以允许该类用户进入的业务场景。也可以是人脸支付系统通过人脸识别对付款用户的身份进行认证,在认证同的情况的下,响应该付款用户的付款指示,调用该用户的账户中资金数据对交易订单进行核销的应用场景。还可以是身份确定系统通过对所采集的用户虹膜与身份信息数据库中所保存的虹膜进行匹配,以识别确定出用户的身份信息的应用场景等等。当然,上述所列举的第一场景只是一种示意性说明。具体实施时,根据 具体情况和业务需求,还可以引入其他形式或类型的应用场景作为上述第一场景。对此,本说明书不作限定。In some embodiments, the above-mentioned first scenario may be specifically understood as a specific application scenario targeted by the living body detection method. Specifically, the above-mentioned first scenario may be a business scenario in which the access control system automatically opens the door for a user who has passed through facial recognition to allow this type of user to enter. It can also be that the face payment system verifies the identity of the paying user through face recognition. If the authentication is the same, it responds to the payment instruction of the paying user and calls the funds data in the user’s account to write off the transaction order. Application scenarios. It can also be that the identity determination system matches the collected iris of the user with the iris stored in the identity information database to identify the application scenarios for determining the identity information of the user, and so on. Of course, the first scenario listed above is only a schematic illustration. During specific implementation, according to specific conditions and business requirements, other forms or types of application scenarios can also be introduced as the first scenario described above. In this regard, this manual is not limited.
对于上述所列举的第一场景,可以先对目标图像数据中的目标对象进行活体检测,以确定出目标对象是否为活体对象。如果通过活体检测发现目标对象不是活体对象,则目标图像数据中的目标对象可能是包含有他人人脸的照片或面具,或者是包含有他人虹膜的图片等,进而可以判断目标影像中的目标对象不是真人,而可能是一种伪装攻击,这时可以停止对该目标对象的进一步识别。For the first scenario listed above, the target object in the target image data may be subjected to live detection to determine whether the target object is a live object. If it is found that the target object is not a living object through live detection, the target object in the target image data may be a photo or mask containing the face of another person, or a picture containing the iris of another person, etc., and then the target object in the target image can be judged It is not a real person, but may be a disguised attack. At this time, further identification of the target object can be stopped.
在一些实施例中,具体实施时,可以通过摄像头等影像采集设备采集第一场景中的包含有目标对象的图像数据作为上述目标图像数据。当然,需要说明的是,上述所列举获取目标图像数据的方式只是一种示意性说明。具体实施时,根据具体情况,还可以采用其他合适的方式来获取第一场景中的包含有目标对象的目标图像数据。对此,本说明书不作限定。In some embodiments, during specific implementation, image data including the target object in the first scene may be collected by an image acquisition device such as a camera as the target image data. Of course, it should be noted that the above-mentioned manners for obtaining target image data are merely schematic illustrations. During specific implementation, according to specific circumstances, other suitable methods may also be used to obtain the target image data containing the target object in the first scene. In this regard, this manual is not limited.
S403:调用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型。S403: Invoking a preset living body detection model, extracting a target feature group from the target image data, and determining the probability value of the target object being a non-living body object through the preset living body detection model as the target probability, Wherein, the preset living body detection model includes a model obtained by training using sample data of the second scene.
在一些实施例中,上述目标特征组具体可以包括从目标图像数据中提取出的用于判断目标对象是否为活体对象的图像特征数据。例如,图像数据中是否存在手机边框的反光,或者照片纸面的反光等特征。又例如,视频数据中连续的两帧图片中目标对象的关键点(例如,人脸中的嘴角位置点)之间的位移变化特征等等。当然,上述所列举的目标特征组只是一种示意性说明。具体实施时,根据具体的应用场景,还可以使用其他类型的特征数据作为目标特征组。对此,本说明书不作限定。其中,上述活体对象具体可以理解为一种真人的特征对象,例如,真人的人脸、真人的虹膜等。相对的,非活体对象具体可以理解为一种伪装成真人的特征对象的数据对象,例如,包含有真人人脸的图片或者人脸面具等。In some embodiments, the aforementioned target feature group may specifically include image feature data extracted from target image data for determining whether the target object is a living object. For example, whether there are features such as the reflection of the frame of the mobile phone or the reflection of the photo paper in the image data. For another example, the feature of the displacement change between the key points of the target object (for example, the position of the corner of the mouth in the face) in two consecutive frames of pictures in the video data, and so on. Of course, the target feature group listed above is only a schematic illustration. During specific implementation, according to specific application scenarios, other types of feature data can also be used as the target feature group. In this regard, this manual is not limited. Among them, the above-mentioned living object can be specifically understood as a characteristic object of a real person, for example, a real person's face, a real person's iris, and so on. In contrast, a non-living object can be specifically understood as a data object disguised as a characteristic object of a real person, for example, a picture containing a real person's face or a face mask.
在一些实施例中,上述目标概率具体可以包括用于反映目标图像数据中的目标对象不是活体对象的概率值。通常,如果目标概率的数值越大,相应的,目标影像中的目标对象越有可能不是活体对象。相反,如果目标概率的数值越小,相应的,目标影像中的目标对象越有可能是活体对象。In some embodiments, the aforementioned target probability may specifically include a probability value used to reflect that the target object in the target image data is not a living object. Generally, if the value of the target probability is larger, correspondingly, the target object in the target image is more likely to be not a living object. On the contrary, if the value of the target probability is smaller, correspondingly, the target object in the target image is more likely to be a living object.
在一些实施例中,上述预设的活体检测模型具体可以包括一种事先已经训练好的针 对第二场景的图像数据进行活体检测的模型。其中,上述第二场景可以是与第一场景不同的应用场景,所涉及的环境条件,和/或,对检测的精度要求等方面存在差异。当然,上述第二场景也可以是与第一场景相同或相近的应用场景。In some embodiments, the aforementioned preset living body detection model may specifically include a pre-trained model for living body detection on the image data of the second scene. Wherein, the foregoing second scenario may be a different application scenario from the first scenario, the environmental conditions involved, and/or the accuracy requirements for detection are different. Of course, the foregoing second scenario may also be an application scenario that is the same or similar to the first scenario.
上述预设的活体检测模型是针对第二场景的环境条件、检测的精度要求等方面的特点,利用第二场景中的样本数据训练建立的,能够较为准确地对第二场景中采集的包含有的目标对象的图像数据进行活体检测,以确定出待识别的图像数据中的目标对象是否为活体对象。The above-mentioned preset living body detection model is based on the characteristics of the environmental conditions and detection accuracy requirements of the second scene, and is established using the sample data in the second scene. In order to determine whether the target object in the image data to be recognized is a living object.
在第二场景中,具体实施时,将待识别的目标图像数据输入至上述预设的活体检测模型。预设的活体检测模型具体运行时,可以先从所输入的图像数据中提取出对应的图像特征;再根据该图像特征确定该图像特征所对应的目标对象为非活体对象的概率值;进而可以将上述概率值与预设的判定阈值进行比较,当上述概率值大于预设的判定阈值时,则可以判断该目标对象不是活体对象。In the second scenario, during specific implementation, the target image data to be recognized is input to the above-mentioned preset living body detection model. When the preset living detection model is running, it can first extract the corresponding image feature from the input image data; then determine the probability value of the target object corresponding to the image feature as a non-living object according to the image feature; The aforementioned probability value is compared with a preset judgment threshold value, and when the aforementioned probability value is greater than the preset judgment threshold value, it can be judged that the target object is not a living object.
由于第二场景与第一场景在环境条件、处理的精度要求等方面存在差异,如果直接将对应于第二场景的预设的活体检测模型应用于第一场景,对第一场景所采集的目标图像数据中的目标对象进行活体检测,可能会出现检测的准确度不高,容易出现检测误差的情况。但是,由于应用预设的活体检测模型在第一场景中所要处理的问题和第二场景是相同的,通过上述预设的活体检测模型可以对第一场景中所采集的到的目标图像数据进行处理,从中提取出相应的图像特征;同时,也可以根据该图像特征对目标图像数据中的目标对象是否为活体对象进行判断,给出对应的概率值,虽然这个概率值准确度不高,但也具有一定的参考价值。Due to the differences between the second scene and the first scene in terms of environmental conditions and processing accuracy requirements, if the preset living body detection model corresponding to the second scene is directly applied to the first scene, the target collected in the first scene If the target object in the image data is detected in vivo, the accuracy of the detection may not be high, and the detection error is prone to occur. However, because the application of the preset life detection model in the first scene has to deal with the same problems as the second scene, the preset life detection model can be used to perform the target image data collected in the first scene. Processing to extract the corresponding image features; at the same time, it can also judge whether the target object in the target image data is a living object based on the image feature, and give the corresponding probability value. Although the accuracy of this probability value is not high, but It also has a certain reference value.
因此,在本实施例中,可以参阅图5所示,直接调用在第二场景中已经训练好的预设的活体检测模型,将在第一场景中采集的包含有目标对象的目标图像数据输入至上述预设的活体检测模型中,通过运行该活体检测模型可以先从上述目标图像数据中提取出对应的图像特征作为目标特征组。进一步,还可以通过上述预设的活体检测模型根据所提取的目标特征组,对目标图像数据中的目标对象是否为活体对象进行判断,得到目标对象不是活体对象的概率值作为上述目标概率。其中,上述目标概率值可以作为后续用于判断目标对象是否为活体对象的参考数据的一种。Therefore, in this embodiment, referring to Figure 5, the preset living detection model that has been trained in the second scene can be directly called, and the target image data collected in the first scene containing the target object is input In the above-mentioned preset living body detection model, by running the living body detection model, the corresponding image feature can be extracted from the above-mentioned target image data as the target feature group. Furthermore, it is also possible to judge whether the target object in the target image data is a living object according to the extracted target feature group through the above preset living detection model, and obtain the probability value of the target object not being a living object as the target probability. Wherein, the aforementioned target probability value can be used as a type of subsequent reference data used to determine whether the target object is a living object.
这样可以不需要针对第一场景另外训练或调整得到对应于第一场景的活体检测模型,降低了处理成本和处理周期,而是可以通过直接调用在其他应用场景中已经训练好的活体检测模型对第一场景的目标图像数据进行特征提取,得到所需要的目标特征组。并通 过该模型根据上述目标特征组,对目标对象是否为活体对象进行判断,给出基于该模型所确定的目标概率,作为后续最终判断第一场景中所采集的目标图像数据中的目标对象是否为活体对象的一种参考数据。In this way, there is no need to separately train or adjust for the first scene to obtain the live detection model corresponding to the first scene, which reduces the processing cost and processing cycle. Instead, it can directly call the live detection model that has been trained in other application scenarios. Feature extraction is performed on the target image data of the first scene to obtain the required target feature group. And through the model according to the above target feature group, it is judged whether the target object is a living object, and the target probability determined based on the model is given as the subsequent final judgment whether the target object in the target image data collected in the first scene is It is a kind of reference data for living objects.
S405:根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定。S405: Determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene, where the anchor point feature group of the first scene is determined according to the sample data of the first scene.
在一些实施例中,上述锚点特征组具体可以理解为一种包括了第一场景中不同情况下的正样本的图像特点的特征集合。其中,上述不同情况下的正样本具体可以包括不同的环境条件(例如,不同的光照强度、拍摄角度、拍摄距离等)下采集的包含有活体对象的图像数据。In some embodiments, the aforementioned anchor point feature group can be specifically understood as a feature set that includes image features of positive samples in different situations in the first scene. Among them, the positive samples in the above different situations may specifically include image data containing living objects collected under different environmental conditions (for example, different light intensity, shooting angles, shooting distances, etc.).
在本实施例中,具体实施时,可以预先针对第一场景采集不同情况下的包含有活体对象的图像数据作为正样本数据,再根据上述正样本数据建立得到上述锚点特征组。In this embodiment, during specific implementation, image data containing living objects under different conditions can be collected in advance for the first scene as positive sample data, and then the anchor point feature group can be established based on the positive sample data.
在一些实施例中,除了可以按照上述方式采集使用正样本数据来建立锚点特征组外,还可以在建立锚点特征组的过程中采集使用部分负样本数据。具体的,可以在正样本数据中掺入所采集到的部分负样本数据,再根据上述包含有负样本数据和正本数据的样本数据来建立上述锚点特征组。这样能够引入场景中的负样本所造成的噪声,使得所建立的锚点特征组能够更好地反映真实场景中的图像特点,具有更好的效果。其中,上述负样本数据具体可以包括不同的环境条件(例如,不同的光照强度、拍摄角度、拍摄距离等)下采集的不包含有活体对象的图像数据。In some embodiments, in addition to collecting and using positive sample data in the above manner to establish an anchor point feature group, part of the negative sample data can also be collected and used in the process of establishing an anchor point feature group. Specifically, the positive sample data may be mixed with part of the collected negative sample data, and then the above-mentioned anchor point feature group can be established based on the above-mentioned sample data including the negative sample data and the original data. In this way, the noise caused by the negative samples in the scene can be introduced, so that the established anchor point feature group can better reflect the image characteristics in the real scene and have better effects. Wherein, the above-mentioned negative sample data may specifically include image data that does not contain living objects collected under different environmental conditions (for example, different light intensity, shooting angle, shooting distance, etc.).
在一些实施例中,上述目标特征组距离具体可以理解为目标特征组与上述锚点特征组的距离。上述目标特征组与锚点特征组之间的特征距离具体可以用于衡量目标特征组与不同情况下的第一场景的正样本特征的差异程度。上述特征距离也可以作为一种结合了第一场景的具体特点的用于后续判断目标对象是否为活体对象的参考数据。该参考数据通过联系第一场景的正样本数据,已经考虑并兼顾到了第一场景的环境条件、精度要求等方面特点,弥补了之前确定的目标概率没有考虑到第一场景的具体特点所存在的不足。通常,如果上述目标特征组距离的数值越大,相应的,目标特征组与锚点特征组的特征的近似度也就越低,所对应的目标对象越有可能不是活体对象。相反,如果上述目标特征组距离的数值越小,相应的,目标特征组与锚点特征组的近似度也就越高,所对应的目标对象越有可能是活体对象。In some embodiments, the aforementioned target feature group distance can be specifically understood as the distance between the target feature group and the aforementioned anchor point feature group. The feature distance between the target feature group and the anchor point feature group can be specifically used to measure the degree of difference between the target feature group and the positive sample features of the first scene in different situations. The above-mentioned characteristic distance may also be used as a kind of reference data combined with the specific characteristics of the first scene for subsequent determination of whether the target object is a living object. By contacting the positive sample data of the first scene, the reference data has considered and took into account the characteristics of the first scene’s environmental conditions and accuracy requirements, and made up for the previously determined target probability that did not take into account the specific characteristics of the first scene. insufficient. Generally, if the distance value of the target feature group is larger, correspondingly, the similarity between the features of the target feature group and the anchor point feature group is also lower, and the corresponding target object is more likely to be not a living object. On the contrary, if the distance value of the target feature group is smaller, the similarity between the target feature group and the anchor point feature group is correspondingly higher, and the corresponding target object is more likely to be a living object.
在一些实施例中,上述根据所述目标特征组和第一场景的锚点特征组,确定目标特 征组距离,具体实施时,可以包括:分别计算目标特征组与锚点特征组中的各个特征的差值的模,作为目标特征组分别与锚点特征组中的各个特征的特征距离;根据目标特征组分别与锚点特征组中的各个特征的特征距离,确定出目标特征组与锚点特征组的特征距离,可以简记为目标特征组距离。In some embodiments, the foregoing determination of the target feature group distance based on the target feature group and the anchor point feature group of the first scene may include: calculating each feature in the target feature group and the anchor point feature group respectively. The modulus of the difference of, as the feature distance between the target feature group and each feature in the anchor feature group; according to the feature distance between the target feature group and each feature in the anchor feature group, the target feature group and the anchor point are determined The feature distance of the feature group can be abbreviated as the target feature group distance.
S407:根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。S407: Determine whether the target object is a living object according to the target feature group distance and the target probability.
在一些实施例中,根据所针对的应用场景,上述活体对象具体可以是真人的人脸,也可以是真人的虹膜等,而不是包含有人脸或虹膜的照片、面具等非真人的道具。In some embodiments, according to the targeted application scenario, the above-mentioned living object may be a real person's face, or a real person's iris, etc., instead of non-real person props such as a photo of a human face or iris, a mask, etc.
在一些实施例中,通过综合利用目标特征组和目标概率,以兼顾到第一场景的具体特点,以及与第二场景之前的差异,利用在第二场景中训练的预设的活体检测模型,准确地对第一场景中所采集的目标图像数据中的目标对象是否为活体对象进行判断。In some embodiments, by comprehensively using the target feature group and the target probability, to take into account the specific characteristics of the first scene and the difference from the second scene before, using the preset living detection model trained in the second scene, Accurately judge whether the target object in the target image data collected in the first scene is a living object.
在一些实施例中,上述根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象,具体实施时,可以包括以下内容:根据所述目标特征组距离确定第一评分;根据所述目标概率确定第二评分。例如,可以通过比较目标特征组距离与预设的距离阈值的大小来确定第一评分。如果上述目标特征组距离小于预设的距离阈值,则可以得到相对较高的第一评分。相反,如果上述目标特征组距离大于预设的距离阈值得到的第一评分会相对较低。类似的,可以通过比较目标概率与预设的比率阈值的大小来确定第二评分。如果目标概率小于预设的比率阈值,则可以得到相对较高的第二评分。相反,如果上述目标概率大于预设的比率阈值,得到的第二评分也会相对较低。其中,上述预设的距离阈值和预设的比率阈值可以根据具体情况结合具体的精度要求设置。对于预设的距离阈值和预设的比率阈值的具体数值,本说明书不作限定。In some embodiments, the foregoing determination of whether the target object is a living object based on the distance of the target feature group and the target probability may include the following content: determining the first score according to the distance of the target feature group ; Determine the second score according to the target probability. For example, the first score can be determined by comparing the distance of the target feature group with a preset distance threshold. If the target feature group distance is less than the preset distance threshold, a relatively high first score can be obtained. On the contrary, if the distance of the target feature group is greater than the preset distance threshold, the first score obtained will be relatively low. Similarly, the second score can be determined by comparing the target probability with a preset ratio threshold. If the target probability is less than the preset ratio threshold, a relatively high second score can be obtained. On the contrary, if the aforementioned target probability is greater than the preset ratio threshold, the second score obtained will also be relatively low. Wherein, the above-mentioned preset distance threshold and preset ratio threshold can be set according to specific conditions in combination with specific accuracy requirements. The specific values of the preset distance threshold and the preset ratio threshold are not limited in this specification.
进一步,可以根据预设的权重规则,对所述第一评分和第二评分进行加权求和,得到第三评分。具体的,可以根据预设的权重规则确定出第一评分的所对应的第一权重,以及第二评分所对应的第二权重,再将第一评分和第一权重的乘积,与第二评分和第二权重给的乘积相加得到的和作为上述第三评分。其中,上述第三评分具体可以理解为一种综合考虑了目标概率以及目标特征组距离两种参考数据得到的一种评价分数。Further, a weighted sum of the first score and the second score may be performed according to a preset weighting rule to obtain a third score. Specifically, the first weight corresponding to the first score and the second weight corresponding to the second score can be determined according to a preset weight rule, and the product of the first score and the first weight is then multiplied by the second score The sum obtained by adding the product given by the second weight is used as the above-mentioned third score. Among them, the above-mentioned third score can be specifically understood as an evaluation score obtained by comprehensively considering the two reference data of target probability and target feature group distance.
由于上述第三评分有效地兼顾并反映出了第一场景的具体特点,因此,可以根据第三评分较为准确地确定出所检测的目标图像数据中的目标对象是否为活体对象。具体的,可以将所述第三评分与预设的评分阈值进行比较,得到比较结果。根据所述比较结果, 确定所述目标对象是否为活体对象。具体的,例如,如果根据比较结果,确定上述第三评分小于等于所述预设的评分阈值,则可以判断第一场景中所采集的目标图像数据中的目标对象不是活体对象。相反,如果根据比较结果,确定上述第三评分大于所述预设的评分阈值,则可以判断第一场景中所采集的目标图像数据中的目标对象是活体对象。Since the aforementioned third score effectively takes into account and reflects the specific characteristics of the first scene, it can be determined more accurately whether the target object in the detected target image data is a living object according to the third score. Specifically, the third score may be compared with a preset score threshold to obtain a comparison result. According to the comparison result, it is determined whether the target object is a living object. Specifically, for example, if it is determined according to the comparison result that the third score is less than or equal to the preset score threshold, it can be determined that the target object in the target image data collected in the first scene is not a living object. On the contrary, if it is determined that the third score is greater than the preset score threshold according to the comparison result, it can be determined that the target object in the target image data collected in the first scene is a living object.
由上可见,本说明书实施例提供的活体检测方法,可以有效地利用在第二场景中训练建立的预设的活体检测模型,高效地对在第一场景所采集到的图像数据中的目标对象进行较为准确的活体检测。It can be seen from the above that the living body detection method provided by the embodiment of this specification can effectively use the preset living body detection model trained and established in the second scene, and efficiently analyze the target object in the image data collected in the first scene. Perform more accurate live detection.
在一些实施例中,所述第一场景的锚点特征组具体可以按照以下方式建立:采集第一场景中包含有活体对象的图像数据作为第一场景的正样本数据;调用预设的活体检测模型从所述正样本数据中提取出样本特征;根据所述样本特征,确定中心点特征,其中,所述中心点特征;计算所述样本特征与中心点特征的特征距离;根据所述样本特征,以及所述样本特征与中心点特征的特征距离,建立所述第一场景的锚点特征组。这样可以得到能够较为全面地覆盖第一场景中不同情况下的数据特点的锚点特征组,以弥补直接使用预设的活体检测模型时,没有考虑到第一场景与第二场景之间在环境条件、处理精度要求等方面所存在的差异导致的误差。In some embodiments, the anchor point feature group of the first scene may be specifically established in the following manner: collecting image data containing living objects in the first scene as the positive sample data of the first scene; calling a preset living body detection The model extracts the sample feature from the positive sample data; determines the center point feature according to the sample feature, wherein the center point feature; calculates the feature distance between the sample feature and the center point feature; according to the sample feature , And the feature distance between the sample feature and the center point feature to establish the anchor point feature group of the first scene. In this way, it is possible to obtain an anchor point feature group that can more comprehensively cover the data characteristics in different situations in the first scene, so as to compensate for the direct use of the preset living detection model, without considering the environment between the first scene and the second scene. Errors caused by differences in conditions, processing accuracy requirements, etc.
在一些实施例中,具体实施时,可以参阅图6所示,可以从在采集第一场景中的图像数据时记录下采集时的环境特点。例如,在通过布设在第一场景中的摄像头拍摄照片时,可以记录下拍摄该照片的光照情况。按照上述方式,在第一场景中采集得到一个时间段内的图像数据,进一步可以从上述图像数据中筛选出包含有活体对象的图像数据作为正样本数据。例如,可以从上述照片中筛选出包含有真人的人脸的照片作为第一场景的正样本数据。在具体筛选上述第一场景的正样本数据时,可以根据第一场景的图像数据所记录的环境特点,有针对性地筛选出分别对应不同环境特点的包含有活体对象的图像数据作为正样本数据,从而可以使得所获取的第一场景的正样本数据可以较为全面地覆盖第一场景中不同情况下的数据特点。In some embodiments, during specific implementation, refer to FIG. 6, and the environmental characteristics at the time of collection can be recorded from the time when the image data in the first scene is collected. For example, when a photo is taken through a camera arranged in the first scene, the lighting conditions of the photo can be recorded. According to the above method, the image data within a period of time is collected in the first scene, and the image data containing the living object can be filtered from the above image data as the positive sample data. For example, a photo containing a human face of a real person can be selected from the aforementioned photos as the positive sample data of the first scene. When specifically screening the positive sample data of the above first scene, according to the environmental characteristics recorded by the image data of the first scene, the image data containing living objects corresponding to different environmental characteristics can be screened out as positive sample data in a targeted manner In this way, the acquired positive sample data of the first scene can more comprehensively cover the data characteristics of the first scene in different situations.
在一些实施例中,可以将上述得到的第一场景的正样本数据分别输入所调用的预设的活体检测模型中。需要说明的是,在本实施例中,不需要使用上述预设的活体检测模型对正样本数据中的目标对象是否是活体对象进行检测判断,而只需要使用上述预设的活体检测模型从上述正样本数据中分别提取出各个正样本数据所对应的图像特征作为样本特征。In some embodiments, the positive sample data of the first scene obtained above may be respectively input into the called preset living body detection model. It should be noted that in this embodiment, it is not necessary to use the above-mentioned preset living body detection model to detect whether the target object in the positive sample data is a living object, but only need to use the above-mentioned preset living body detection model from the above The image features corresponding to each positive sample data are extracted from the positive sample data as sample features.
进一步,可以根据上述样本特征确定出对应的中心点特征。具体的,可以通过 对上述样本特征进行加和求平均,得到上述中心点特征。进而,可以以中心点特征作为参照,分别计算样本特征中的各个样本特征与中心点特征的差值的模作为该样本特征的特征距离。根据样本特征的特征距离,从多个样本特征中筛选出与中心点特征的特征距离较大的样本特征作为符合要求的样本特征,这样得到的符合要求的样本特征能够更好地覆盖第一场景中不同情况下采集的图像数据的数据特点。Further, the corresponding center point feature can be determined based on the above-mentioned sample feature. Specifically, the above-mentioned center point characteristic can be obtained by adding and averaging the above-mentioned sample characteristics. Furthermore, the central point feature can be used as a reference, and the modulus of the difference between each of the sample features and the central point feature can be calculated as the feature distance of the sample feature. According to the feature distance of the sample feature, the sample feature with a larger distance from the center point feature is selected from the multiple sample features as the sample feature that meets the requirements, so that the sample feature that meets the requirements can better cover the first scene The data characteristics of the image data collected under different conditions.
在一些实施例中,上述根据所述样本特征,以及所述样本特征与中心点特征的特征距离,建立所述第一场景的锚点特征组,具体实施时,可以包括以下内容:从所述样本特征中筛选出与中心点特征的特征距离大于特征距离阈值的样本特征作为符合要求的样本特征;根据所述中心点特征和所述符合要求的样本特征,建立所述第一场景的锚点特征组。In some embodiments, the above-mentioned establishment of the anchor point feature group of the first scene according to the sample feature and the feature distance between the sample feature and the center point feature may include the following content during specific implementation: Among the sample features, the sample features whose feature distance from the center point feature is greater than the feature distance threshold are selected as the sample features that meet the requirements; based on the center point feature and the sample features that meet the requirements, the anchor point of the first scene is established Feature group.
在一些实施例中,具体实施时,可以根据样本特征与中心点的特征距离将样本特征按照特征距离从大到小进行排序,选取排序靠前的预设个数的样本特征作为上述符合要求的样本特征。也可以将样本特征与中心点特征的特征距离与特征距离阈值进行比较,筛选出将样本特征与中心点特征的特征距离大于特征距离阈值的样本特征作为上述符合要求的样本特征。当然,需要说明的是,上述所列举的筛选出符合要求的样本特征的方式只是一种示意性说明。具体实施时,根据具体情况,还可以采用其他合适的方式来筛选出符合要求的样本特征。对此,本说明书不作限定。In some embodiments, during specific implementation, the sample features can be sorted according to the feature distance from the largest to the smallest according to the feature distance between the sample feature and the center point, and the preset number of sample features with the highest ranking can be selected as the above-mentioned meeting requirements. Sample characteristics. It is also possible to compare the feature distance between the sample feature and the center point feature with the feature distance threshold, and screen out the sample feature whose feature distance between the sample feature and the center point feature is greater than the feature distance threshold as the above-mentioned sample feature that meets the requirements. Of course, it should be noted that the above-mentioned method of screening out the sample characteristics that meet the requirements is only a schematic illustration. During specific implementation, other suitable methods can also be used to screen out the sample characteristics that meet the requirements according to the specific situation. In this regard, this manual is not limited.
在确定出符合要求的样本特征后,进一步可以根据符合要求的样本特征,以及中心点特征建立一个特征集合作为上述针对于第一场景的锚点特征组。其中,上述锚点特征组具体可以包括符合要求的样本特征,以及中心点特征。After the sample features that meet the requirements are determined, a feature set can be further established based on the sample features that meet the requirements and the center point features as the anchor point feature group for the first scene. Wherein, the anchor point feature group may specifically include a sample feature that meets the requirements, and a center point feature.
在一些实施例中,还可以对上述得到的样本特征进行相应的特征处理。具体的,可以现根据样本特征的整体数值情况,确定出对应的平均特征;再通过将上述样本特征分别减去上述平均特征对上述样本特征进行他做出来,从而得到处理后的样本特征。后续可以使用处理后的样本特征替换原本使用的样本特征来确定出准确度更好的锚点特征组。In some embodiments, corresponding feature processing can also be performed on the sample features obtained above. Specifically, the corresponding average feature can be determined according to the overall numerical value of the sample feature; and then the sample feature can be obtained by subtracting the average feature from the sample feature to obtain the processed sample feature. Subsequently, the processed sample features can be used to replace the originally used sample features to determine an anchor point feature group with better accuracy.
在一些实施例中,在建立所述第一场景的锚点特征组后,所述方法具体实施时,还可以包括以下内容:对所述第一场景的锚点特征组中的特征分别进行哈夫曼编码,得到压缩后的第一场景的锚点特征组;保存所述压缩后的第一场景的锚点特征组。这样可以通过哈夫曼编码对第一场景的锚点特征组进行压缩,并将压缩后的锚点特征组进行保存、管理,有效地降低了保存、管理锚点特征组时对资源的占用和消耗。当然,需要说 明的是,上述采用哈夫曼编号对锚点特征组进行压缩只是一种示意性说明。具体实施时,根据具体情况和处理要求,还可以采用其他合适的压缩方式对锚点特征组进行压缩。对此,本说明书不作限定。In some embodiments, after the anchor point feature group of the first scene is established, when the method is specifically implemented, the method may further include the following content: perform the analysis on the features in the anchor point feature group of the first scene respectively. Fuman encoding to obtain the anchor point feature group of the compressed first scene; and save the anchor point feature group of the compressed first scene. In this way, the anchor point feature group of the first scene can be compressed by Huffman coding, and the compressed anchor point feature group can be saved and managed, which effectively reduces the resource occupation and management of the anchor point feature group when saving and managing the anchor point feature group. Consumption. Of course, it needs to be clarified that the above-mentioned use of Huffman numbers to compress the anchor point feature group is only a schematic illustration. During specific implementation, according to specific conditions and processing requirements, other suitable compression methods may also be used to compress the anchor point feature group. In this regard, this manual is not limited.
在一些实施例中,除了对锚点特征组进行压缩处理外,还可以在提取得到样本特征后,通过哈夫曼编码对所提取到的样本特征先进行压缩保存,从而能够进一步降低对资源的占用和消耗。In some embodiments, in addition to compressing the anchor point feature group, after extracting the sample feature, the extracted sample feature can be compressed and saved by Huffman coding, which can further reduce the resource cost. Occupation and consumption.
在一些实施例中,上述根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象,具体实施时,可以包括以下内容:根据所述目标特征组距离确定第一评分;根据所述目标概率确定第二评分;根据预设的权重规则,对所述第一评分和第二评分进行加权求和,得到第三评分;将所述第三评分与预设的评分阈值进行比较,得到比较结果;根据所述比较结果,确定所述目标对象是否为活体对象。这样可以综合利用目标概率和目标特征组距离两种参考数据,即不需要重新建立使用对应于第一场景的活体检测模型,又可以兼顾到第一场景的具体特点,从而能够准确地第一场景中采集到的图像数据中的目标对象进行活体检测。In some embodiments, the foregoing determination of whether the target object is a living object based on the distance of the target feature group and the target probability may include the following content: determining the first score according to the distance of the target feature group Determine the second score according to the target probability; perform a weighted summation of the first score and the second score according to a preset weighting rule to obtain a third score; combine the third score with a preset score threshold The comparison is performed to obtain a comparison result; according to the comparison result, it is determined whether the target object is a living object. In this way, two reference data of target probability and target feature group distance can be comprehensively used, that is, there is no need to re-establish and use the living detection model corresponding to the first scene, and the specific characteristics of the first scene can be taken into account, so that the first scene can be accurately The target object in the image data collected in the image data is detected in vivo.
在一些实施例中,在根据所述目标特征组距离和所述目标概率,确定所述目标对象不是活体对象的情况下,所述方法具体实施时,还可以包括以下内容:拒绝与所述目标图像数据对应的权限申请请求。In some embodiments, when it is determined that the target object is not a living object according to the target feature group distance and the target probability, the method may further include the following content when the method is specifically implemented: The permission application request corresponding to the image data.
在本实施例中,在确定待检测的目标影像中的目标对象不是活体对象的情况下,可以停止后续对目标对象进行进一步的识别确定,并拒绝与该目标图像数据所对应的权限申请请求。例如,在刷脸支付的应用场景中,在确定待检测的人脸照片中人脸不是活体对象时,可以判断有用户正通过使用包含有他人人脸的图片或者人脸面具等冒充他人身份进行支付,这时可以停止对人脸照片中的人脸的识别和身份信息匹配,并拒绝该用户发起的支付申请请求,以保护他人的财产安全。In this embodiment, when it is determined that the target object in the target image to be detected is not a living object, subsequent further identification and determination of the target object can be stopped, and the permission application request corresponding to the target image data can be rejected. For example, in the application scenario of swiping face payment, when it is determined that the face in the face photo to be detected is not a living object, it can be judged that a user is pretending to be another person by using a picture containing the face of another person or a face mask. Payment, at this time, the recognition of the face in the face photo and the matching of identity information can be stopped, and the payment application request initiated by the user can be rejected to protect the safety of other people's property.
在一些实施例中,所述方法具体实施时,还可以包括以下内容:统计预设时间段内的误差比率;比较所述误差比率和预设的比率阈值;在确定所述误差比率大于预设的比率阈值的情况下,重新确定第一场景的锚点特征组。In some embodiments, when the method is specifically implemented, it may further include the following content: counting the error ratio within a preset time period; comparing the error ratio with a preset ratio threshold; determining that the error ratio is greater than the preset ratio threshold. In the case of the ratio threshold value, the anchor point feature group of the first scene is re-determined.
具体的,可以每隔一个预设时间段,例如每隔一周,统计最近这一周内在活体检测时出现的误差比率。其中,上述误差比率具体可以通过将该预设时间段内活体检测的错误数量,与该预设时间段内所处理的活体检测的总数量相除得到。进一步,可以将 误差比率与预设的比率阈值进行比较,得到对应的比较结果。根据该比较结果,可以判断当前用于活体检测的锚点特征组是否符合当前场景的具体情况。例如,如果根据比较结果,确定误差比率大于上述预设的比率阈值,则可以判断当前所对应的场景情况可能出现了变化,导致基于之前所确定的锚点特征组进行活体检测时的检测误差相对较大。这时,可以获取最近一段时间内的正样本数据,根据最近一段时间内的正样本数据重新确定该场景的锚点特征组,并利用新确定的锚点特征组更新之前使用的锚点特征组,利用新确定的锚点特征结合预设的活体检测模型对该场景中所采集的图像数据进行活体检测。如果根据比较结果,确定误差比率小于等于上述预设的比率阈值,则可以判断当前所使用的锚点特征组还是能够较好地覆盖当前场景情况的,因此,可以不用对当前使用的锚点特征组进行更新。通过统计预设时间段内的误差比率,并根据误差比率与预设的比率阈值的数值比较结果,确定是否重新确定第一场景的锚点特征组,从而能定期对第一场景的锚点特征组进行定期更新,以提高检测活体对象的准确率,减少误差比率。使得在较长的一段时间内,都能够较为准确地对第一场景中所采集的目标图像数据进行活体检测。Specifically, every preset time period, for example, every other week, the rate of error in the live body detection in the most recent week can be counted. Wherein, the above-mentioned error ratio can be specifically obtained by dividing the number of errors in the detection of a living body within the preset time period by the total number of detections of a living body processed within the preset time period. Further, the error ratio can be compared with a preset ratio threshold to obtain the corresponding comparison result. According to the comparison result, it can be determined whether the anchor point feature group currently used for living body detection conforms to the specific situation of the current scene. For example, if according to the comparison result, it is determined that the error ratio is greater than the preset ratio threshold, it can be judged that the current situation of the corresponding scene may have changed, resulting in a relative detection error when performing live detection based on the previously determined anchor point feature group. Larger. At this time, you can obtain the positive sample data in the most recent period of time, re-determine the anchor point feature group of the scene based on the positive sample data in the most recent period of time, and update the previously used anchor point feature group with the newly determined anchor point feature group , Use the newly determined anchor point feature combined with the preset living detection model to perform living detection on the image data collected in the scene. If according to the comparison result, it is determined that the error ratio is less than or equal to the above preset ratio threshold, it can be judged that the currently used anchor point feature group can better cover the current scene situation. Therefore, it is not necessary to check the currently used anchor point feature The group is updated. By counting the error ratio in the preset time period, and according to the numerical comparison result of the error ratio and the preset ratio threshold, it is determined whether to re-determine the anchor point feature group of the first scene, so that the anchor point feature of the first scene can be periodically checked The group is updated regularly to improve the accuracy of detecting live objects and reduce the error rate. Therefore, in a relatively long period of time, the target image data collected in the first scene can be detected in vivo more accurately.
由上可见,本说明书实施例提供的活体检测方法,通过调用基于第二场景训练得到的预设的活体检测模型对第一场景采集的目标图像数据进行处理,提取得到对应的目标特征组,并通过上述模型基于该目标特征组确定出目标图像数据中的目标对象属于非活体对象的目标概率;同时,又引入并利用基于第一场景的正样本数据所确定的针对第一场景的锚点特征组,来确定目标特征组与锚点特征组之间的特征距离;再综合上述目标概率和目标特征组距离来较为准确地确定第一场景采集的目标图像数据中的目标对象是否为活体对象。从而可以有效地利用在第二场景中训练建立的预设的活体检测模型,高效地对在第一场景所采集到的图像数据中的目标对象进行较为准确的活体检测。由于不需要再针对第一场景另外训练对应的活体检测模型,有效地降低了活体检测的处理成本和处理耗时。As can be seen from the above, the living body detection method provided by the embodiment of this specification processes the target image data collected in the first scene by calling a preset living body detection model trained on the second scene, extracting the corresponding target feature group, and The above model determines the target probability that the target object in the target image data belongs to the non-living object based on the target feature group; at the same time, the anchor point feature for the first scene determined based on the positive sample data of the first scene is introduced and used Group to determine the feature distance between the target feature group and the anchor point feature group; and then combine the target probability and the target feature group distance to more accurately determine whether the target object in the target image data collected in the first scene is a living object. Therefore, the preset living detection model trained and established in the second scene can be effectively used to efficiently perform relatively accurate living detection of the target object in the image data collected in the first scene. Since there is no need to additionally train the corresponding living body detection model for the first scene, the processing cost and processing time of living body detection are effectively reduced.
本说明书实施例还提供一种服务器,包括处理器以及用于存储处理器可执行指令的存储器,所述处理器具体实施时可以根据指令执行以下步骤:获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;调用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第 一场景的样本数据确定;根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。The embodiment of the present specification also provides a server, including a processor and a memory for storing executable instructions of the processor. The processor can execute the following steps according to the instructions during specific implementation: acquiring target image data, wherein the target image The data includes the image data that contains the target object collected in the first scene; the preset living detection model is called, the target feature group is extracted from the target image data, and the preset living detection model is used to determine The probability value that the target object is a non-living object is used as the target probability, wherein the preset living detection model includes a model trained using sample data of the second scene; according to the target feature group and the anchor of the first scene Point feature group, determine the target feature group distance, wherein the anchor point feature group of the first scene is determined according to the sample data of the first scene; according to the target feature group distance and the target probability, it is determined whether the target object It is a living object.
为了能够更加准确地完成上述指令,参阅图7所示,本说明书实施例还提供了另一种具体的服务器,其中,所述服务器包括网络通信端口701、处理器702以及存储器703,上述结构通过内部线缆相连,以便各个结构可以进行具体的数据交互。In order to be able to complete the above instructions more accurately, referring to FIG. 7, the embodiment of this specification also provides another specific server, where the server includes a network communication port 701, a processor 702, and a memory 703. The above structure Internal cables are connected so that each structure can carry out specific data interactions.
其中,所述网络通信端口701,具体可以用于获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据。The network communication port 701 may be specifically used to obtain target image data, where the target image data includes image data including the target object collected in the first scene.
所述处理器702,具体可以用于调用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。The processor 702 may be specifically configured to call a preset living body detection model, extract a target feature group from the target image data, and determine that the target object is a non-living body through the preset living body detection model The probability value of the object is used as the target probability, wherein the preset liveness detection model includes a model trained using sample data of the second scene; and the target feature is determined according to the target feature group and the anchor feature group of the first scene The group distance, wherein the anchor point feature group of the first scene is determined according to the sample data of the first scene; according to the target feature group distance and the target probability, it is determined whether the target object is a living object.
所述存储器703,具体可以用于存储相应的指令程序。The memory 703 may be specifically used to store corresponding instruction programs.
在本实施例中,所述网络通信端口701可以是与不同的通信协议进行绑定,从而可以发送或接收不同数据的虚拟端口。例如,所述网络通信端口可以是负责进行web数据通信的80号端口,也可以是负责进行FTP数据通信的21号端口,还可以是负责进行邮件数据通信的25号端口。此外,所述网络通信端口还可以是实体的通信接口或者通信芯片。例如,其可以为无线移动网络通信芯片,如GSM、CDMA等;其还可以为Wifi芯片;其还可以为蓝牙芯片。In this embodiment, the network communication port 701 may be a virtual port that is bound to different communication protocols, so that different data can be sent or received. For example, the network communication port may be port 80 responsible for web data communication, port 21 responsible for FTP data communication, or port 25 responsible for mail data communication. In addition, the network communication port may also be a physical communication interface or a communication chip. For example, it can be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it can also be a Bluetooth chip.
在本实施例中,所述处理器702可以按任何适当的方式实现。例如,处理器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式等等。本说明书并不作限定。In this embodiment, the processor 702 may be implemented in any suitable manner. For example, the processor may take the form of a microprocessor or a processor and a computer readable medium, logic gates, switches, application specific integrated circuits ( Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller form, etc. This manual is not limited.
在本实施例中,所述存储器703可以包括多个层次,在数字系统中,只要能保存二进制数据的都可以是存储器;在集成电路中,一个没有实物形式的具有存储功能的电路也叫存储器,如RAM、FIFO等;在系统中,具有实物形式的存储设备也叫存储器,如内存条、TF卡等。In this embodiment, the memory 703 may include multiple levels. In a digital system, any memory that can store binary data can be a memory; in an integrated circuit, a circuit with a storage function without a physical form is also called a memory. , Such as RAM, FIFO, etc.; in the system, storage devices in physical form are also called memory, such as memory sticks, TF cards, etc.
本说明书实施例还提供了一种基于上述活体检测方法的计算机存储介质,所述计算机存储介质存储有计算机程序指令,在所述计算机程序指令被执行时实现:获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;The embodiment of the present specification also provides a computer storage medium based on the above-mentioned living body detection method. The computer storage medium stores computer program instructions. When the computer program instructions are executed, it is realized: acquiring target image data, wherein the The target image data includes image data including the target object collected in the first scene;
使用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。Using a preset life detection model, extract a target feature group from the target image data, and determine the probability value of the target object being a non-living object through the preset life detection model as the target probability, wherein, The preset living body detection model includes a model trained using sample data of the second scene; the target feature group distance is determined according to the target feature group and the anchor point feature group of the first scene, wherein The anchor point feature group of is determined according to the sample data of the first scene; according to the distance of the target feature group and the target probability, it is determined whether the target object is a living object.
在本实施例中,上述存储介质包括但不限于随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、缓存(Cache)、硬盘(Hard Disk Drive,HDD)或者存储卡(Memory Card)。所述存储器可以用于存储计算机程序指令。网络通信单元可以是依照通信协议规定的标准设置的,用于进行网络连接通信的接口。In this embodiment, the aforementioned storage medium includes but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), cache (Cache), and hard disk (Hard Disk Drive, HDD). Or memory card (Memory Card). The memory can be used to store computer program instructions. The network communication unit may be an interface set up in accordance with a standard stipulated by the communication protocol and used for network connection communication.
在本实施例中,该计算机存储介质存储的程序指令具体实现的功能和效果,可以与其它实施方式对照解释,在此不再赘述。In this embodiment, the specific functions and effects realized by the program instructions stored in the computer storage medium can be explained in comparison with other embodiments, and will not be repeated here.
本说明书还提供了一种人脸识别设备,其中,该人脸识别设备至少包括摄像头和处理器。其中,上述摄像头具体用于获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据。上述处理器具体用于调用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。上述处理器在确定所述目标对象不是活体对象的情况下,确定人脸识别失败,不再对目标图像数据进行进一步的人脸识别;在确定目标对象是活体对象的情况下,可以对目标影像进行进一步的人脸识别,以确定出与目标影像中的人脸匹配的用户的身份信息。This specification also provides a face recognition device, where the face recognition device at least includes a camera and a processor. Wherein, the aforementioned camera is specifically used to obtain target image data, wherein the target image data includes image data including the target object collected in the first scene. The above-mentioned processor is specifically configured to call a preset life detection model, extract a target feature group from the target image data, and determine the probability value that the target object is a non-living object through the preset life detection model As the target probability, the preset liveness detection model includes a model trained using sample data of the second scene; the target feature group distance is determined according to the target feature group and the anchor point feature group of the first scene, where , The anchor point feature group of the first scene is determined according to the sample data of the first scene; according to the distance of the target feature group and the target probability, it is determined whether the target object is a living object. In the case that the above-mentioned processor determines that the target object is not a living object, it determines that the face recognition has failed, and no further face recognition is performed on the target image data; in the case of determining that the target object is a living object, the target image can be Further face recognition is performed to determine the identity information of the user who matches the face in the target image.
参阅图8所示,在软件层面上,本说明书实施例还提供了一种活体检测装置, 该装置具体可以包括以下的结构模块。Referring to FIG. 8, at the software level, the embodiment of this specification also provides a living body detection device, which may specifically include the following structural modules.
获取模块801,具体可以用于获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;The obtaining module 801 may be specifically used to obtain target image data, where the target image data includes image data including the target object collected in the first scene;
使用模块803,具体可以用于使用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;The using module 803 can be specifically used to extract a target feature group from the target image data using a preset life detection model, and determine that the target object is a non-living object through the preset life detection model The probability value is used as the target probability, where the preset living detection model includes a model trained by using sample data of the second scene;
第一确定模块805,具体可以用于根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;The first determining module 805 may be specifically configured to determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene, wherein the anchor point feature group of the first scene is based on the sample of the first scene Data determination;
第二确定模块807,具体可以用于根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。The second determining module 807 may be specifically configured to determine whether the target object is a living object according to the target feature group distance and the target probability.
在一些实施例中,所述装置具体还可以包括建立模块,该模块具体可以包括以下结构单元:In some embodiments, the device may specifically further include an establishment module, and the module may specifically include the following structural units:
采集单元,具体可以用于采集第一场景中包含有活体对象的图像数据作为第一场景的正样本数据;The collecting unit may be specifically used to collect image data containing a living object in the first scene as the positive sample data of the first scene;
调用单元,具体可以用于调用预设的活体检测模型从所述正样本数据中提取出样本特征;The calling unit may be specifically used to call a preset living body detection model to extract sample features from the positive sample data;
第一确定单元,具体可以用于根据所述样本特征,确定中心点特征;The first determining unit may be specifically configured to determine the center point feature according to the sample feature;
计算单元,具体可以用于计算所述样本特征与中心点特征的特征距离;The calculation unit may be specifically used to calculate the feature distance between the sample feature and the center point feature;
建立单元,具体可以用于根据所述样本特征,以及所述样本特征与中心点特征的特征距离,建立所述第一场景的锚点特征组。The establishing unit may be specifically configured to establish the anchor point feature group of the first scene according to the sample feature and the feature distance between the sample feature and the center point feature.
在一些实施例中,所述建立单元具体可以包括以下结构子单元:In some embodiments, the establishment unit may specifically include the following structural sub-units:
筛选子单元,具体可以用于从所述样本特征中筛选出与中心点特征的特征距离大于特征距离阈值的样本特征作为符合要求的样本特征;The screening subunit can be specifically used to screen out the sample features whose feature distance from the center point feature is greater than the feature distance threshold from the sample features as the sample feature that meets the requirements;
建立子单元,具体可以用于根据所述中心点特征和所述符合要求的样本特征,建立所述第一场景的锚点特征组。The establishment of the subunit may be specifically used to establish the anchor point feature group of the first scene according to the central point feature and the qualified sample feature.
在一些实施例中,所述建立模块具体还可以包括以下单元:In some embodiments, the establishment module may specifically further include the following units:
编码单元,具体可以用于对所述第一场景的锚点特征组中的特征分别进行哈夫曼编码,得到压缩后的第一场景的锚点特征组;The coding unit may be specifically used to perform Huffman coding on the features in the anchor point feature group of the first scene respectively to obtain the compressed anchor point feature group of the first scene;
存储单元,具体可以用于保存所述压缩后的第一场景的锚点特征组。The storage unit may be specifically used to save the compressed anchor point feature group of the first scene.
在一些实施例中,所述第二确定模块具体可以包括以下结构单元:In some embodiments, the second determining module may specifically include the following structural units:
评分单元,具体可以用于根据所述目标特征组距离确定第一评分;根据所述目标概率确定第二评分;根据预设的权重规则,对所述第一评分和第二评分进行加权求和,得到第三评分;The scoring unit may be specifically configured to determine a first score according to the distance of the target feature group; determine a second score according to the target probability; and perform a weighted summation of the first score and the second score according to a preset weighting rule , Get the third score;
第一比较单元,具体可以用于将所述第三评分与预设的评分阈值进行比较,得到比较结果;The first comparison unit may be specifically configured to compare the third score with a preset score threshold to obtain a comparison result;
第二确定单元,具体可以用于根据所述比较结果,确定所述目标对象是否为活体对象。The second determining unit may be specifically configured to determine whether the target object is a living object according to the comparison result.
在一些实施例中,所述装置具体还可以包括处理模块,该模块具体可以用于根据第二确定模块确定所述目标对象不是活体对象的情况下,拒绝与所述目标图像数据对应的权限申请请求。In some embodiments, the device may specifically further include a processing module, which may be specifically configured to reject the permission application corresponding to the target image data in the case that the target object is determined to be not a living object according to the second determining module request.
在一些实施例中,所述装置具体还可以包括更新模块,该模块具体可以包括以下结构单元:In some embodiments, the device may further include an update module, and the module may specifically include the following structural units:
统计单元,具体可以用于统计预设时间段内的误差比率;The statistical unit, which can be specifically used to calculate the error ratio within a preset time period;
第二比较单元,具体可以用于比较所述误差比率和预设的比率阈值;The second comparison unit may be specifically used to compare the error ratio with a preset ratio threshold;
第三确定单元,具体可以用于在确定所述误差比率大于预设的比率阈值的情况下,重新确定第一场景的锚点特征组。The third determining unit may be specifically configured to re-determine the anchor point feature group of the first scene when it is determined that the error ratio is greater than a preset ratio threshold.
需要说明的是,上述实施例阐明的单元、装置或模块等,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合 或通信连接,可以是电性,机械或其它的形式。It should be noted that the units, devices, or modules described in the foregoing embodiments may be specifically implemented by computer chips or entities, or implemented by products with certain functions. For the convenience of description, when describing the above device, the functions are divided into various modules and described separately. Of course, when implementing this specification, the functions of each module can be implemented in the same one or more software and/or hardware, or a module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
由上可见,本说明书实施例提供的活体检测装置,通过使用模块调用基于第二场景训练得到的预设的活体检测模型提取对第一场景采集的目标图像数据进行处理,得到对应的目标特征组,并通过上述模型基于该目标特征组确定出目标图像数据中的目标对象属于非活体对象的目标概率;同时,又通过第一确定模块引入并利用基于第一场景的正样本数据所确定的针对第一场景的锚点特征组,来确定目标特征组与锚点特征组之间的特征距离;再通过第二确定模块综合上述目标概率和目标特征组距离来较为准确地确定第一场景采集的目标图像数据中的目标对象是否为活体对象。从而可以有效地利用在第二场景中训练建立的预设的活体检测模型,高效地对在第一场景所采集到的图像数据中的目标对象进行较为准确的活体检测。As can be seen from the above, the living body detection device provided by the embodiment of this specification uses the module to call the preset living body detection model obtained by training based on the second scene to process the target image data collected in the first scene to obtain the corresponding target feature group. , And determine the target probability that the target object in the target image data belongs to the non-living object based on the target feature group through the above model; at the same time, the target object determined by the positive sample data based on the first scene is introduced and used through the first determination module. The anchor point feature group of the first scene is used to determine the feature distance between the target feature group and the anchor point feature group; then the second determination module is used to synthesize the target probability and the target feature group distance to more accurately determine the collection of the first scene Whether the target object in the target image data is a living object. Therefore, the preset living detection model trained and established in the second scene can be effectively used to efficiently perform relatively accurate living detection of the target object in the image data collected in the first scene.
虽然本说明书提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或客户端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。Although this specification provides method operation steps as described in the embodiments or flowcharts, conventional or non-innovative methods may include more or fewer operation steps. The sequence of steps listed in the embodiment is only one way of the execution order of many steps, and does not represent the only execution order. When the actual device or client product is executed, it can be executed sequentially or in parallel according to the methods shown in the embodiments or drawings (for example, a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, product, or device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed. Elements, or also include elements inherent to such processes, methods, products, or equipment. If there are no more restrictions, it does not exclude that there are other identical or equivalent elements in the process, method, product, or device including the elements. Words such as first and second are used to denote names, but do not denote any specific order.
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内部包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to program the method steps to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded logic. The same function can be realized in the form of a microcontroller, etc. Therefore, such a controller can be regarded as a hardware component, and the devices included in the controller for realizing various functions can also be regarded as a structure within the hardware component. Or even, the device for realizing various functions can be regarded as both a software module for realizing the method and a structure within a hardware component.
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构、类等等。也可以在分布式计算环境中实践本说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算 环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. This specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
通过以上的实施例的描述可知,本领域的技术人员可以清楚地了解到本说明书可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书的技术方案本质上可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,移动终端,服务器,或者网络设备等)执行本说明书各个实施例或者实施例的某些部分所述的方法。It can be known from the description of the above embodiments that those skilled in the art can clearly understand that this specification can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of this specification can essentially be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., including several instructions to make a A computer device (which may be a personal computer, a mobile terminal, a server, or a network device, etc.) executes the methods described in each embodiment or some parts of the embodiment in this specification.
本说明书中的各个实施例采用递进的方式描述,各个实施例之间相同或相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。本说明书可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. This manual can be used in many general-purpose or special-purpose computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, small computers, large computers, including the above Distributed computing environment of any system or device, etc.
虽然通过实施例描绘了本说明书,本领域普通技术人员知道,本说明书有许多变形和变化而不脱离本说明书的精神,希望所附的权利要求包括这些变形和变化而不脱离本说明书的精神。Although this specification has been described through the embodiments, those of ordinary skill in the art know that there are many variations and changes in this specification without departing from the spirit of this specification, and it is hoped that the appended claims include these variations and changes without departing from the spirit of this specification.

Claims (16)

  1. 一种活体检测方法,包括:A living body detection method, including:
    获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;Acquiring target image data, where the target image data includes image data including the target object collected in the first scene;
    使用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;Using a preset life detection model, extract a target feature group from the target image data, and determine the probability value of the target object being a non-living object through the preset life detection model as the target probability, wherein, The preset living body detection model includes a model trained by using sample data of the second scene;
    根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;Determining the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene, wherein the anchor point feature group of the first scene is determined according to the sample data of the first scene;
    根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。According to the target feature group distance and the target probability, it is determined whether the target object is a living object.
  2. 根据权利要求1所述的方法,所述第一场景的锚点特征组按照以下方式确定:According to the method of claim 1, the anchor point feature group of the first scene is determined in the following manner:
    采集第一场景中包含有活体对象的图像数据作为第一场景的正样本数据;Collecting image data containing living objects in the first scene as positive sample data of the first scene;
    使用预设的活体检测模型从所述正样本数据中提取出样本特征;Extracting sample features from the positive sample data using a preset living body detection model;
    根据所述样本特征,确定中心点特征;Determine the center point feature according to the sample feature;
    计算所述样本特征与中心点特征的特征距离;Calculating the feature distance between the sample feature and the center point feature;
    根据所述样本特征,以及所述样本特征与中心点特征的特征距离,建立所述第一场景的锚点特征组。The anchor point feature group of the first scene is established according to the sample feature and the feature distance between the sample feature and the center point feature.
  3. 根据权利要求2所述的方法,根据所述样本特征,以及所述样本特征与中心点特征的特征距离,建立所述第一场景的锚点特征组,包括:The method according to claim 2, wherein establishing the anchor point feature group of the first scene according to the sample feature and the feature distance between the sample feature and the center point feature, comprising:
    从所述样本特征中筛选出与中心点特征的特征距离大于特征距离阈值的样本特征作为符合要求的样本特征;From the sample features, select the sample features whose feature distance from the center point feature is greater than the feature distance threshold as the sample feature that meets the requirements;
    根据所述中心点特征和所述符合要求的样本特征,建立所述第一场景的锚点特征组。The anchor point feature group of the first scene is established according to the center point feature and the sample feature that meets the requirements.
  4. 根据权利要求2所述的方法,在建立所述第一场景的锚点特征组后,所述方法还包括:The method according to claim 2, after the anchor point feature group of the first scene is established, the method further comprises:
    对所述第一场景的锚点特征组中的特征分别进行哈夫曼编码,得到压缩后的第一场景的锚点特征组;Huffman coding is performed on the features in the anchor point feature group of the first scene respectively to obtain the compressed anchor point feature group of the first scene;
    保存所述压缩后的第一场景的锚点特征组。The anchor point feature group of the compressed first scene is saved.
  5. 根据权利要求1所述的方法,根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象,包括:The method according to claim 1, determining whether the target object is a living object according to the target feature group distance and the target probability, comprising:
    根据所述目标特征组距离确定第一评分;根据所述目标概率确定第二评分;Determine a first score according to the distance of the target feature group; determine a second score according to the target probability;
    根据预设的权重规则,对所述第一评分和第二评分进行加权求和,得到第三评分;Performing a weighted summation of the first score and the second score according to a preset weighting rule to obtain a third score;
    将所述第三评分与预设的评分阈值进行比较,得到比较结果;Comparing the third score with a preset score threshold to obtain a comparison result;
    根据所述比较结果,确定所述目标对象是否为活体对象。According to the comparison result, it is determined whether the target object is a living object.
  6. 根据权利要求1所述的方法,在根据所述目标特征组距离和所述目标概率,确定所述目标对象不是活体对象的情况下,所述方法还包括:The method according to claim 1, in the case where it is determined that the target object is not a living object according to the target feature group distance and the target probability, the method further comprises:
    拒绝与所述目标图像数据对应的权限申请请求。Reject the permission application request corresponding to the target image data.
  7. 根据权利要求6所述的方法,所述方法还包括:The method according to claim 6, further comprising:
    统计预设时间段内的误差比率;Calculate the error ratio within the preset time period;
    比较所述误差比率和预设的比率阈值;Comparing the error ratio with a preset ratio threshold;
    在确定所述误差比率大于预设的比率阈值的情况下,重新确定第一场景的锚点特征组。In the case where it is determined that the error ratio is greater than the preset ratio threshold, the anchor point feature group of the first scene is re-determined.
  8. 一种活体检测装置,包括:A living body detection device includes:
    获取模块,用于获取目标图像数据,其中,所述目标图像数据包括在第一场景中采集的包含有目标对象的图像数据;An acquisition module for acquiring target image data, wherein the target image data includes image data including the target object collected in the first scene;
    使用模块,用于使用预设的活体检测模型,从所述目标图像数据中提取出目标特征组,并通过所述预设的活体检测模型确定出所述目标对象为非活体对象的概率值作为目标概率,其中,所述预设的活体检测模型包括利用第二场景的样本数据训练得到的模型;The use module is used to extract a target feature group from the target image data using a preset liveness detection model, and determine the probability value that the target object is a non-living object through the preset liveness detection model as Target probability, wherein the preset liveness detection model includes a model trained by using sample data of the second scene;
    第一确定模块,用于根据所述目标特征组和第一场景的锚点特征组,确定目标特征组距离,其中,所述第一场景的锚点特征组根据第一场景的样本数据确定;The first determining module is configured to determine the distance of the target feature group according to the target feature group and the anchor point feature group of the first scene, wherein the anchor point feature group of the first scene is determined according to the sample data of the first scene;
    第二确定模块,用于根据所述目标特征组距离和所述目标概率,确定所述目标对象是否为活体对象。The second determining module is configured to determine whether the target object is a living object according to the target feature group distance and the target probability.
  9. 根据权利要求8所述的装置,所述装置还包括建立模块,包括:The device according to claim 8, the device further comprising an establishment module, comprising:
    采集单元,用于采集第一场景中包含有活体对象的图像数据作为第一场景的正样本数据;An acquisition unit, configured to acquire image data containing living objects in the first scene as positive sample data of the first scene;
    调用单元,用于调用预设的活体检测模型从所述正样本数据中提取出样本特征;A calling unit for calling a preset living body detection model to extract sample features from the positive sample data;
    第一确定单元,用于根据所述样本特征,确定中心点特征;The first determining unit is configured to determine the center point feature according to the sample feature;
    计算单元,用于计算所述样本特征与中心点特征的特征距离;A calculation unit for calculating the feature distance between the sample feature and the center point feature;
    建立单元,用于根据所述样本特征,以及所述样本特征与中心点特征的特征距离,建立所述第一场景的锚点特征组。The establishment unit is configured to establish the anchor point feature group of the first scene according to the sample feature and the feature distance between the sample feature and the center point feature.
  10. 根据权利要求9所述的装置,所述建立单元包括:The device according to claim 9, wherein the establishing unit comprises:
    筛选子单元,用于从所述样本特征中筛选出与中心点特征的特征距离大于特征距离阈值的样本特征作为符合要求的样本特征;The screening subunit is used to screen out the sample features whose feature distance from the center point feature is greater than the feature distance threshold from the sample features as the sample feature that meets the requirements;
    建立子单元,用于根据所述中心点特征和所述符合要求的样本特征,建立所述第一场景的锚点特征组。The establishment subunit is used to establish the anchor point feature group of the first scene according to the center point feature and the sample feature that meets the requirements.
  11. 根据权利要求9所述的装置,所述建立模块还包括:The apparatus according to claim 9, wherein the establishment module further comprises:
    编码单元,用于对所述第一场景的锚点特征组中的特征分别进行哈夫曼编码,得到压缩后的第一场景的锚点特征组;An encoding unit, configured to perform Huffman encoding on the features in the anchor point feature group of the first scene respectively to obtain the compressed anchor point feature group of the first scene;
    存储单元,用于保存所述压缩后的第一场景的锚点特征组。The storage unit is configured to store the anchor point feature group of the compressed first scene.
  12. 根据权利要求8所述的装置,所述第二确定模块包括:The apparatus according to claim 8, wherein the second determining module comprises:
    评分单元,用于根据所述目标特征组距离确定第一评分;根据所述目标概率确定第二评分;根据预设的权重规则,对所述第一评分和第二评分进行加权求和,得到第三评分;The scoring unit is configured to determine a first score according to the distance of the target feature group; determine a second score according to the target probability; and perform a weighted summation of the first score and the second score according to a preset weighting rule to obtain Third score
    第一比较单元,用于将所述第三评分与预设的评分阈值进行比较,得到比较结果;The first comparison unit is configured to compare the third score with a preset score threshold to obtain a comparison result;
    第二确定单元,用于根据所述比较结果,确定所述目标对象是否为活体对象。The second determining unit is configured to determine whether the target object is a living object according to the comparison result.
  13. 根据权利要求8所述的装置,所述装置还包括处理模块,用于根据第二确定模块确定所述目标对象不是活体对象的情况下,拒绝与所述目标图像数据对应的权限申请请求。The device according to claim 8, further comprising a processing module, configured to reject the permission application request corresponding to the target image data in the case that the target object is determined to be not a living object according to the second determining module.
  14. 根据权利要求13所述的装置,所述装置还包括更新模块,包括:The device according to claim 13, the device further comprising an update module, comprising:
    统计单元,用于统计预设时间段内的误差比率;The statistical unit is used to calculate the error ratio within the preset time period;
    第二比较单元,用于比较所述误差比率和预设的比率阈值;A second comparison unit, configured to compare the error ratio with a preset ratio threshold;
    第三确定单元,用于在确定所述误差比率大于预设的比率阈值的情况下,重新确定第一场景的锚点特征组。The third determining unit is configured to re-determine the anchor point feature group of the first scene when it is determined that the error ratio is greater than the preset ratio threshold.
  15. 一种服务器,包括处理器以及用于存储处理器可执行指令的存储器,所述处理器执行所述指令时实现权利要求1至7中任一项所述方法的步骤。A server includes a processor and a memory for storing executable instructions of the processor, and the processor implements the steps of the method according to any one of claims 1 to 7 when the processor executes the instructions.
  16. 一种人脸识别设备,包括处理器以及用于存储处理器可执行指令的存储器,所述处理器执行所述指令时实现权利要求1至7中任一项所述方法的步骤,以确定用于进行人脸识别的目标图像数据中的目标对象是否为活体对象;在确定所述目标对象不是活体对象的情况下,确定人脸识别失败。A face recognition device, comprising a processor and a memory for storing executable instructions of the processor, and when the processor executes the instructions, the steps of the method according to any one of claims 1 to 7 are implemented to determine the use of Whether the target object in the target image data for face recognition is a living object; if it is determined that the target object is not a living object, it is determined that the face recognition fails.
PCT/CN2020/103962 2019-10-28 2020-07-24 Living body testing method and apparatus, server and facial recognition device WO2021082548A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911029215.5A CN111091047B (en) 2019-10-28 2019-10-28 Living body detection method and device, server and face recognition equipment
CN201911029215.5 2019-10-28

Publications (1)

Publication Number Publication Date
WO2021082548A1 true WO2021082548A1 (en) 2021-05-06

Family

ID=70393044

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/103962 WO2021082548A1 (en) 2019-10-28 2020-07-24 Living body testing method and apparatus, server and facial recognition device

Country Status (2)

Country Link
CN (1) CN111091047B (en)
WO (1) WO2021082548A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114241544A (en) * 2021-11-15 2022-03-25 北京百度网讯科技有限公司 Image recognition method and device, electronic equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111091047B (en) * 2019-10-28 2021-08-27 支付宝(杭州)信息技术有限公司 Living body detection method and device, server and face recognition equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130127827A1 (en) * 2011-11-22 2013-05-23 Derek Shiell Multiview Face Content Creation
CN109670452A (en) * 2018-12-20 2019-04-23 北京旷视科技有限公司 Method for detecting human face, device, electronic equipment and Face datection model
CN110084113A (en) * 2019-03-20 2019-08-02 阿里巴巴集团控股有限公司 Biopsy method, device, system, server and readable storage medium storing program for executing
CN111091047A (en) * 2019-10-28 2020-05-01 支付宝(杭州)信息技术有限公司 Living body detection method and device, server and face recognition equipment

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608450B (en) * 2016-03-01 2018-11-27 天津中科智能识别产业技术研究院有限公司 Heterogeneous face identification method based on depth convolutional neural networks
CN106874857B (en) * 2017-01-19 2020-12-01 腾讯科技(上海)有限公司 Living body distinguishing method and system based on video analysis
US10970648B2 (en) * 2017-08-30 2021-04-06 International Business Machines Corporation Machine learning for time series using semantic and time series data
CN108038456B (en) * 2017-12-19 2024-01-26 中科视拓(北京)科技有限公司 Anti-deception method in face recognition system
CN109255322B (en) * 2018-09-03 2019-11-19 北京诚志重科海图科技有限公司 A kind of human face in-vivo detection method and device
CN109583342B (en) * 2018-11-21 2022-11-04 重庆邮电大学 Human face living body detection method based on transfer learning
CN109858381A (en) * 2019-01-04 2019-06-07 深圳壹账通智能科技有限公司 Biopsy method, device, computer equipment and storage medium
CN109934204A (en) * 2019-03-22 2019-06-25 重庆邮电大学 A kind of facial expression recognizing method based on convolutional neural networks
CN110378219B (en) * 2019-06-13 2021-11-19 北京迈格威科技有限公司 Living body detection method, living body detection device, electronic equipment and readable storage medium
CN110211604A (en) * 2019-06-17 2019-09-06 广东技术师范大学 A kind of depth residual error network structure for voice deformation detection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130127827A1 (en) * 2011-11-22 2013-05-23 Derek Shiell Multiview Face Content Creation
CN109670452A (en) * 2018-12-20 2019-04-23 北京旷视科技有限公司 Method for detecting human face, device, electronic equipment and Face datection model
CN110084113A (en) * 2019-03-20 2019-08-02 阿里巴巴集团控股有限公司 Biopsy method, device, system, server and readable storage medium storing program for executing
CN111091047A (en) * 2019-10-28 2020-05-01 支付宝(杭州)信息技术有限公司 Living body detection method and device, server and face recognition equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114241544A (en) * 2021-11-15 2022-03-25 北京百度网讯科技有限公司 Image recognition method and device, electronic equipment and storage medium
CN114241544B (en) * 2021-11-15 2023-06-27 北京百度网讯科技有限公司 Image recognition method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111091047B (en) 2021-08-27
CN111091047A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN107742100B (en) A kind of examinee's auth method and terminal device
WO2020083111A1 (en) Liveness detection method and device, electronic apparatus, storage medium and related system using the liveness detection method
WO2021036436A1 (en) Facial recognition method and apparatus
US20170262472A1 (en) Systems and methods for recognition of faces e.g. from mobile-device-generated images of faces
KR20200006987A (en) Access control method, access control device, system and storage medium
CN108038176B (en) Method and device for establishing passerby library, electronic equipment and medium
CN109670441A (en) A kind of realization safety cap wearing knows method for distinguishing, system, terminal and computer readable storage medium
CN108269333A (en) Face identification method, application server and computer readable storage medium
CN111191532B (en) Face recognition method and device based on construction area and computer equipment
WO2022062379A1 (en) Image detection method and related apparatus, device, storage medium, and computer program
US20200042772A1 (en) People-Credentials Comparison Authentication Method, System and Camera
CN105426869A (en) Face recognition system and recognition method based on railway security check
WO2020083183A1 (en) Living body detection method and apparatus, electronic device, storage medium and related system using living body detection method
CN111861240A (en) Suspicious user identification method, device, equipment and readable storage medium
WO2021082548A1 (en) Living body testing method and apparatus, server and facial recognition device
CN111161206A (en) Image capturing method, monitoring camera and monitoring system
CN111160202A (en) AR equipment-based identity verification method, AR equipment-based identity verification device, AR equipment-based identity verification equipment and storage medium
CN110991231B (en) Living body detection method and device, server and face recognition equipment
CN112199530B (en) Multi-dimensional face library picture automatic updating method, system, equipment and medium
WO2021082045A1 (en) Smile expression detection method and apparatus, and computer device and storage medium
CN105574498A (en) Face recognition system and recognition method based on customs security check
CN111104917A (en) Face-based living body detection method and device, electronic equipment and medium
CN109815839A (en) Hover personal identification method and Related product under micro services framework
CN112560683A (en) Method and device for identifying copied image, computer equipment and storage medium
CN108764153A (en) Face identification method, device, system and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20883432

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20883432

Country of ref document: EP

Kind code of ref document: A1