Live detection method, apparatus, device, and storage medium

By collecting before-and-after facial images of the target object during consumer transactions, performing differential feature extraction and micro-expression analysis, the problem of insufficient efficiency and accuracy of traditional liveness detection methods is solved, achieving efficient and accurate liveness detection, which is suitable for scenarios such as self-service shopping.

CN116524608BActive Publication Date: 2026-01-20ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310415930.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2026-01-20
Estimated Expiration
2043-04-14

AI Technical Summary

Technical Problem

Existing liveness detection methods struggle to achieve both high efficiency and high accuracy when facing liveness attacks. Traditional methods require active user interaction, resulting in a poor user experience; while methods that do not require user interaction suffer from reduced security.

Method used

By collecting facial images of the target object before and after the consumption transaction, and using the consumption object's display page as an external stimulus, facial differential features are extracted to generate liveness detection results. The model is then trained by combining deep learning algorithms and micro-expression feature extraction to improve detection accuracy.

Benefits of technology

It improves the efficiency and accuracy of liveness detection, effectively prevents photo and video attacks, and is suitable for security assurance in high-efficiency consumption scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116524608B_ABST
    Figure CN116524608B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a kind of live detection method, device, equipment and storage medium, the method includes: by gathering the first face image of target detection object for consumption transaction, show the consumption object display page corresponding to consumption transaction, then gather the second face image of target detection object after showing consumption object display page, the feature extraction of first face image and second face image is carried out to obtain face difference feature, based on face difference feature, generate the live detection result of target detection object.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of computer technology, and particularly relates to a living body detection method, device, equipment and storage medium. BACKGROUND

[0002] Face recognition technology provides convenience for people's production and life, but also brings additional risks. Among them, the typical one is living body attack, that is, an attack method trying to impersonate a user through photos, mobile phones and other media. Living body attack is also the most threatening security risk that the current face recognition system faces. The method to solve the above problem is usually called living body detection, and the purpose is to judge whether the obtained biological feature comes from a living, on-site and real person.

[0003] In order to solve the problem of living body attack detection, various living body detection methods have been proposed, but there are still great challenges in developing high experience and high precision living body detection algorithms. Therefore, it is urgent to propose an efficient and effective living body detection method to cope with living body attack events. SUMMARY

[0004] The main purpose of the present specification is to provide a living body detection method, device, equipment and storage medium, aiming to improve the efficiency and precision of living body detection. The technical solution is as follows:

[0005] In a first aspect, the embodiments of the present specification provide a living body detection method, comprising:

[0006] Collecting a first face image of a target detection object for a consumption transaction;

[0007] Displaying a consumption object display page corresponding to the consumption transaction;

[0008] Collecting a second face image of the target detection object after displaying the consumption object display page;

[0009] Performing feature extraction on the first face image and the second face image to obtain face difference features;

[0010] Generating a living body detection result of the target detection object based on the face difference features.

[0011] In a second aspect, the embodiments of the present specification provide a training method of a basic living body detection model, comprising:

[0012] Initializing a first initial structure parameter in a basic living body detection model;

[0013] Obtaining sample face images of sample detection objects; the sample face images include a first sample face image and a second sample face image before and after the same sample detection object watches a consumption object display page;

[0014] inputting the first sample face image and the second sample face image into a basic feature coding module to obtain a basic face feature; the basic face feature comprises a first basic face feature and a second basic face feature;

[0015] inputting the basic face feature into a living body detection module to obtain a sample living body feature and a corresponding sample living body detection result;

[0016] inputting the first basic face feature and the second basic face feature into a micro-expression feature extraction module to obtain a first sample micro-expression feature corresponding to the first basic face feature and a second sample micro-expression feature corresponding to the second basic face feature;

[0017] calculating a living body classification loss value corresponding to the sample living body detection result and a living body identity label pre-labeled for the sample detection object;

[0018] calculating a micro-expression feature learning loss value corresponding to the first sample micro-expression feature and the second sample micro-expression feature;

[0019] adjusting the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generating the trained basic living body detection model based on the first target structure parameter.

[0020] In a third aspect, an embodiment of the present specification provides a method for training an intelligent display model, comprising:

[0021] initializing a fourth structure parameter in the intelligent display model;

[0022] obtaining a sample default consumer display page for a consumer transaction;

[0023] inputting the sample default consumer display page into a page layout parameter generator to obtain a sample updated page layout parameter;

[0024] inputting the sample updated page parameter into a page layout module to obtain a sample updated page layout image;

[0025] inputting the sample updated page layout image into a saliency prediction module to obtain a saliency map corresponding to the sample updated page layout image;

[0026] calculating a saliency score mean value of the saliency map;

[0027] adjusting the fourth initial structure parameter based on the saliency score mean value to obtain a fourth target structure parameter, and generating the trained intelligent display model based on the fourth target structure parameter.

[0028] In a fourth aspect, the embodiments of the present specification provide a method for training a living body detection model, comprising:

[0029] initializing a sixth initial structure parameter in the living body detection model;

[0030] obtaining a sample face feature of a sample detection object; the sample face feature is obtained by inputting a sample face image of the sample detection object into a basic living body detection model; the sample face image comprises a first sample face image and a second sample face image of the same sample detection object before and after viewing a consumption object display page;

[0031] inputting the sample face feature into a feature difference module to obtain a sample feature difference feature;

[0032] inputting the first sample face image and the second sample face image into an image difference module to obtain a sample image difference feature;

[0033] inputting the sample feature difference feature and the sample image difference feature into a fusion detection module to output a sample living body detection result;

[0034] calculating a corresponding living body detection loss value based on a sample identity label of the sample detection object and the sample living body detection result;

[0035] adjusting the sixth initial structure parameter based on the living body detection loss value to obtain a sixth target structure parameter, and generating the living body detection model after training based on the sixth target structure parameter.

[0036] In a fifth aspect, the embodiments of the present specification provide a living body detection device, comprising:

[0037] a first face collection module configured to collect a first face image of a target detection object for a consumption transaction;

[0038] a display module configured to display a consumption object display page corresponding to the consumption transaction;

[0039] a second face collection module configured to collect a second face image of the target detection object after displaying the consumption object display page;

[0040] a difference feature extraction module configured to extract features of the first face image and the second face image to obtain a face difference feature;

[0041] a result generation module configured to generate a living body detection result of the target detection object based on the face difference feature.

[0042] In a sixth aspect, the embodiments of the present specification provide a living body detection device, comprising:

[0043] The first parameter setting module is configured to initialize a first initial structure parameter in a basic living body detection model.

[0044] The first sample acquisition module is configured to acquire a sample face image of a sample detection object; the sample face image includes a first sample face image and a second sample face image before and after the sample detection object views a consumption object display page;

[0045] The first feature extraction module is configured to input the first sample face image and the second sample face image into a basic feature coding module to obtain a basic face feature; the basic face feature includes a first basic face feature and a second basic face feature;

[0046] The sample living body detection module is configured to input the basic face feature into a living body detection module to obtain a sample living body feature and a corresponding sample living body detection result;

[0047] The sample micro-expression detection module is configured to input the first basic face feature and the second basic face feature into a micro-expression feature extraction module to obtain a first sample micro-expression feature corresponding to the first basic face feature and a second sample micro-expression feature corresponding to the second basic face feature;

[0048] The living body classification loss calculation module is configured to calculate a living body classification loss value corresponding to the sample living body detection result and a living body identity label pre-labeled by the sample detection object;

[0049] The micro-expression feature loss calculation module is configured to calculate a micro-expression feature learning loss value corresponding to the first sample micro-expression feature and the second sample micro-expression feature;

[0050] The first training module is configured to adjust the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generate the basic living body detection model after training based on the first target structure parameter.

[0051] In a seventh aspect, an embodiment of the present specification provides a living body detection device, comprising:

[0052] The second parameter setting module is configured to initialize a fourth structure parameter in an intelligent display model.

[0053] The second sample acquisition module is configured to acquire a sample default consumption object display page for a consumption transaction;

[0054] The page parameter generation module is configured to input the sample default consumption object display page into a page layout parameter generator to obtain a sample updated page layout parameter;

[0055] a page layout generation module, configured to input the sample update page parameter into a page layout module to obtain a sample update page layout image;

[0056] a saliency detection module, configured to input the sample update page layout image into a saliency prediction module to obtain a saliency map corresponding to the sample update page layout image;

[0057] a saliency score calculation module, configured to calculate a saliency score mean of the saliency map;

[0058] a second training module, configured to adjust the fourth initial structure parameter based on the saliency score mean to obtain a fourth target structure parameter, and generate the trained intelligent display model based on the fourth target structure parameter.

[0059] In an eighth aspect, an embodiment of the present specification provides a living body detection device, comprising:

[0060] a third parameter setting module, configured to initialize a sixth initial structure parameter in a living body detection model;

[0061] a third sample acquisition module, configured to acquire a sample face feature of a sample detection object; the sample face feature is obtained by inputting a sample face image of the sample detection object into a basic living body detection model; the sample face image comprises a first sample face image and a second sample face image of the same sample detection object before and after viewing a consumption object display page;

[0062] a face feature difference processing module, configured to input the sample face feature into a feature difference module to obtain a sample feature difference feature;

[0063] an image difference feature processing module, configured to input the first sample face image and the second sample face image into an image difference module to obtain a sample image difference feature;

[0064] a sample result generation module, configured to input the sample feature difference feature and the sample image difference feature into a fusion detection module to output a sample living body detection result;

[0065] a living body detection loss calculation module, configured to calculate a corresponding living body detection loss value based on a sample identity label of the sample detection object and the sample living body detection result;

[0066] a third training module, configured to adjust the sixth initial structure parameter based on the living body detection loss value to obtain a sixth target structure parameter, and generate a trained living body detection model based on the sixth target structure parameter.

[0067] In a ninth aspect, an electronic device is provided, and the device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, which, when executed by the processor, implements the steps of the method described above.

[0068] In a tenth aspect, a storage medium is provided, and the storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described above.

[0069] In an eleventh aspect, a computer program product is provided, and the computer program product includes a computer program, which, when executed by a processor of an electronic device, causes the processor to implement at least the method of the first aspect to the fourth aspect.

[0070] In the embodiments of the present specification, by collecting a first face image of a target detection object for a consumption transaction, displaying a consumption object display page corresponding to the consumption transaction, and then collecting a second face image of the target detection object after displaying the consumption object display page, feature extraction is performed on the first face image and the second face image to obtain face difference features, and based on the face difference features, a live body detection result of the target detection object is generated. By using the consumption object display page as an external stimulus to the user, the live body detection is performed based on the reaction of the user to the external stimulus, that is, by collecting the face images of the target detection object before and after watching the consumption object display page, the differential stimulus perception is performed according to the face images of the user before and after watching the consumption object display page, and the live body detection is performed using the differential stimulus perception result. The user does not need to cooperate to complete a series of actions, which can improve the efficiency of live body detection, and the live body detection based on differential stimulus improves the accuracy of live body detection, thereby ensuring the security of the consumption transaction. BRIEF DESCRIPTION OF DRAWINGS

[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present specification, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0072] Figure 1 is a scene schematic diagram of a live body detection method provided by the embodiments of the present specification;

[0073] Figure 2 is a flowchart schematic diagram of a live body detection method provided by the embodiments of the present specification;

[0074] Figure 3is a flowchart of a live body detection method provided by an embodiment of the present specification;

[0075] Figure 4 is a display page optimization schematic diagram of a live body detection method provided by an embodiment of the present specification;

[0076] Figure 5 is a flowchart of a live body detection method provided by an embodiment of the present specification;

[0077] Figure 6 is a flowchart of a live body detection model provided by an embodiment of the present specification;

[0078] Figure 7 is a flowchart of training of a basic live body detection model provided by an embodiment of the present specification;

[0079] Figure 8 is a flowchart of training of an intelligent display model provided by an embodiment of the present specification;

[0080] Figure 9 is a flowchart of training of a live body detection model provided by an embodiment of the present specification;

[0081] Figure 10 is a structural schematic diagram of a live body detection device provided by an embodiment of the present specification;

[0082] Figure 11 is a structural schematic diagram of a live body detection device provided by an embodiment of the present specification;

[0083] Figure 12 is a structural schematic diagram of a live body detection device provided by an embodiment of the present specification;

[0084] Figure 13 is a structural schematic diagram of a live body detection device provided by an embodiment of the present specification;

[0085] Figure 14 is a structural schematic diagram of a live body detection device provided by an embodiment of the present specification;

[0086] Figure 15 is a structural schematic diagram of a live body detection device provided by an embodiment of the present specification. DETAILED DESCRIPTION

[0087] The technical solutions in the embodiments of the present specification will be described clearly and completely below with reference to the drawings in the embodiments of the present specification. Obviously, the described embodiments are only part of the embodiments of the present specification, rather than all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present specification.

[0088] In addition, it should be noted that the data acquisition, storage, use, processing, etc. involved in the face recognition and living body detection in the embodiments of the present specification comply with relevant provisions of national laws and regulations.

[0089] The living body detection device can be a terminal device such as a mobile phone, a computer, a tablet computer, a smart watch, or a vehicle-mounted device, or a module for implementing the living body detection method in the terminal device. The living body detection device can acquire a first face image of a target detection object for a consumption transaction, display a consumption object display page corresponding to the consumption transaction, acquire a second face image of the target detection object after displaying the consumption object display page, perform feature extraction on the first face image and the second face image to obtain face difference features, and generate a living body detection result of the target detection object based on the face difference features.

[0090] Optionally, the living body detection device can also train a basic living body detection model. The living body detection device can initialize a first initial structure parameter in the basic living body detection model, acquire a sample face image of a sample detection object, input the first sample face image and a second sample face image of the sample detection object before and after viewing a consumption object display page into a basic feature encoding module to obtain basic face features, input the basic face features into a living body detection module to obtain sample living body features and a corresponding sample living body detection result, input the first basic face features and the second basic face features into a micro-expression feature extraction module to obtain a first sample micro-expression feature corresponding to the first basic face features and a second sample micro-expression feature corresponding to the second basic face features, calculate a living body classification loss value corresponding to a living body identity label pre-labeled for the sample detection object, calculate a micro-expression feature learning loss value corresponding to the first sample micro-expression feature and the second sample micro-expression feature, adjust the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generate a trained basic living body detection model based on the first target structure parameter.

[0091] Optionally, the living body detection apparatus can also train the intelligent display model. The living body detection apparatus can initialize a fourth structure parameter in the intelligent display model, obtain a sample default consumption object display page for a consumption transaction, input the sample default consumption object display page into a page layout parameter generator, obtain sample updated page layout parameters, input the sample updated page parameters into a page layout module, obtain a sample updated page layout image, input the sample updated page layout image into a saliency prediction module, obtain a saliency map corresponding to the sample updated page layout image, calculate a saliency score mean value of the saliency map, adjust the fourth initial structure parameter based on the saliency score mean value to obtain a fourth target structure parameter, and generate a trained intelligent display model based on the fourth target structure parameter.

[0092] Optionally, the living body detection apparatus can also train the living body detection model. The living body detection apparatus can initialize a sixth initial structure parameter in the living body detection model, obtain a sample face feature of a sample detection object; the sample face feature is obtained by inputting a sample face image of the sample detection object into the basic living body detection model; the sample face image includes a first sample face image and a second sample face image of the same sample detection object before and after viewing a consumption object display page, input the sample face feature into a feature difference module to obtain a sample feature difference feature, input the first sample face image and the second sample face image into an image difference module to obtain a sample image difference feature, input the sample feature difference feature and the sample image difference feature into a fusion detection module to output a sample living body detection result, calculate a corresponding living body detection loss value based on a sample identity label of the sample detection object and the sample living body detection result, adjust the sixth initial structure parameter based on the living body detection loss value to obtain a sixth target structure parameter, and generate a trained living body detection model based on the sixth target structure parameter.

[0093] It should be noted that the living body detection apparatus for living body detection and the living body detection apparatus for training the basic living body detection model, the intelligent display model and the living body detection model can be the same apparatus or different apparatuses, and preferably, the living body detection method and the training method of the living body detection model are implemented on different living body detection apparatuses.

[0094] Please refer to Figure 1 A scene schematic diagram of a living body detection method is provided for the embodiments of the present specification, and a self-service shopping scene is taken as an example. The living body detection apparatus can be an electronic device with an image acquisition function. When an operation initiated by a target detection object for a consumption transaction is detected on a start page, a first face image of the target detection object is acquired, and then a consumption object display page is displayed. A second face image of the target detection object after viewing the consumption object display page is obtained, a face difference feature is extracted based on the first face image and the second face image, and a living body detection result is obtained based on the face difference feature.

[0095] The living body detection method provided in the specification will be described in detail below in combination with specific examples.

[0096] Please refer to Figure 2 A flowchart of a living body detection method is provided for the embodiments of the specification. As Figure 2 indicated, the method of the embodiments of the specification can include the following steps S102-S110.

[0097] S102, collecting a first face image of a target detection object for a consumption transaction;

[0098] S104, displaying a consumption object display page corresponding to the consumption transaction;

[0099] S106, collecting a second face image of the target detection object after displaying the consumption object display page;

[0100] S108, performing feature extraction on the first face image and the second face image to obtain face difference features;

[0101] S110, generating a living body detection result of the target detection object based on the face difference features.

[0102] The living body detection method provided in the embodiments of the specification can be applied to cash register, shopping, and other consumption transactions. Common living body detection algorithms can be divided into two different types according to their different interaction modes. The first type is a living body detection method based on active interaction. This type of method requires the user to cooperate to complete a series of actions, such as “wink”, “shake head”, and “open mouth”, etc. The living body detection algorithm judges whether there is a living body attack risk by detecting the degree of completion of the user's action and the naturalness when the action is completed. This method often requires the user to spend a lot of time to cooperate, and the experience is poor, which is not suitable for deployment in scenarios such as cash register that require high efficiency. The second type is a passive and silent living body detection method. This type of method does not require the user to actively cooperate, but only needs to collect the user's face image in a natural state to complete the living body detection. The experience of this type of method is improved compared to the first type, but the improvement of the experience brings a decline in security. Since the images under various actions of the user cannot be collected, the amount of information used for living body detection decreases, and its performance also decreases. In order to design a living body detection method with high experience and high security, the living body detection method in the embodiments of the specification is proposed.

[0103] Each step will be described in detail below:

[0104] S102, collecting a first face image of a target detection object for a consumption transaction;

[0105] It can be understood that, since the consumption behavior and the stimulation response to the consumption object display page need to be made by a person, the target detection object in the embodiments of the present specification is preferably a person. In addition, in the present specification, the target detection object is referred to as a user, and the two can be replaced with each other, which will not be described later. Specifically, when the target detection object starts a consumption transaction, a face image of the target detection object is collected by a living body detection device. The living body detection device can be a self-service shopping device, a cash register device arranged in a supermarket, or a terminal device such as a user's mobile phone. For example, the start of the consumption transaction can be that the electronic device recognizes that the user appears within a preset range in front of the electronic device, and automatically starts the consumption transaction; or the user actively starts the consumption transaction by touching a virtual button on the screen of the electronic device or an entity button on the electronic device; or the merchant side confirms the consumption amount of the user, and provides a payment page to the user on the electronic device, and the user face image is collected when the payment page is displayed on the electronic device. The timing of collecting the face image of the target detection object can be set according to the actual situation of the consumption transaction.

[0106] S104, displaying a consumption object display page corresponding to the consumption transaction;

[0107] Specifically, after the first face image of the target detection object is collected, the device displays the consumption object display page. The consumption object can be a commodity, consumption activity information, or a virtual object related to the user consumption transaction. According to different consumption transactions, the content contained in the consumption object display page can be different. In one possible implementation, the consumption object display page can be a commodity recommendation page. It can be understood that, when the user selects and purchases, the user is usually provided with this commodity recommendation page for the user to select, so that the commodity recommendation page is directly used as a stimulation, and no additional design process is needed. Of course, other pages related to the consumption transaction, such as advertisements, can also be displayed.

[0108] For example, in a cash register transaction, the consumption object display page can display goods that the user is expected to purchase by hand, or promotion information of the merchant; in a consumption transaction, the consumption object display page can display a commodity selection page.

[0109] It should be noted that the content contained in the consumption object display page can be static or dynamic, for example, displayed in the form of a video or an animation.

[0110] S106, collecting a second face image of the target detection object after the consumption object display page is displayed;

[0111] Specifically, after the display of the consumption object display page, the face image of the target detection object can be collected again to obtain a second face image. It should be noted that the second collection of the face image of the target detection object does not need to be triggered by the user again or the user needs to make relevant operations, that is, the collection is automatic. For example, the system can be set to automatically collect when the display time of the consumption object display page exceeds the preset time. Of course, the user can also actively trigger it, for example, the user clicks to pay or leave the consumption object display page, that is, the second face image of the user is collected.

[0112] S108, feature extraction is performed on the first face image and the second face image to obtain a face difference feature;

[0113] It can be understood that after the user's senses are stimulated through the consumption object display page, the facial expression of the user will change, that is, the first face image and the second face image will be different, and therefore, by performing feature extraction and comparison on the first face image and the second face image, the difference between the user before and after watching the consumption object display page is obtained, that is, the face difference feature. Exemplarily, the difference image can be directly calculated from the first face image and the second face image, that is, the corresponding pixel values of the two images are subtracted to weaken the similar parts of the images and highlight the changed parts of the images, and the feature extraction is performed on the difference image to obtain the face difference feature of the target detection object.

[0114] S110, based on the face difference feature, a live detection result of the target detection object is generated.

[0115] Specifically, the face difference feature is detected according to the pre-trained deep learning algorithm, the attack probability of this live detection is predicted, and the predicted attack probability p is compared with the probability threshold T. If p is greater than T, it is judged as an attack, and the live detection result of the target detection object. It can be understood that if a mobile phone photo is used to "pretend" to be a real person to perform live detection, since the mobile phone photo does not make a real reaction to the consumption object display page, the face difference feature extracted from the real person and the face difference feature of the attack object are actually different. By obtaining the face sample image pair of the real person before and after watching the recommended page display, the live detection model is trained, which can enable the model to learn the face features of the real person when facing the consumption object display page, thereby realizing live detection.

[0116] In the embodiment of the present specification, by collecting a first face image of a target detection object for a consumption transaction, a consumption object display page corresponding to the consumption transaction is displayed, and then a second face image of the target detection object after displaying the consumption object display page is collected. Feature extraction is performed on the first face image and the second face image to obtain face difference features. Based on the face difference features, a live body detection result of the target detection object is generated. By obtaining the face images of the current target detection object before and after watching the consumption object display page for differential stimulation perception, the live body detection is performed according to the differential stimulation perception result, i.e. the face difference features, without the target detection object making additional authentication actions. The live body detection efficiency in the consumption scene can be improved, and the attack of photos and videos can be effectively prevented, greatly improving the accuracy of live body detection.

[0117] Please refer to Figure 3 A flowchart of a live body detection method is provided for the embodiment of the present specification. As shown in Figure 3 The method of the embodiment of the present specification can include the following steps S202-S206.

[0118] S202, obtaining a default consumption object display page corresponding to the consumption transaction;

[0119] In the embodiment of the present specification, the visual stimulation given to the user by the traditional consumption object display page is limited, and cannot form effective stimulation for all users to cause micro-expression changes. In order to enhance the stimulation to the user, a layout optimization method for the consumption object display page is proposed. Specifically, a default consumption object display page for a consumption transaction is obtained. The default consumption object display page can be a consumption object display page initially set for the consumption transaction.

[0120] S204, generating update layout parameters of the default consumption object display page based on page materials corresponding to the default consumption object display page;

[0121] It can be understood that when generating a consumption object display page, usually some materials are first obtained, and then the page obtained by splicing the materials, for example, the materials can be logo, goods, background, text, etc. First, according to the default consumption object display page, it is confirmed that the consumption object display page can use or contain page materials, and the update layout parameters of the page materials are confirmed according to the recombination of the page materials. By optimizing the layout parameters of the default consumption object display page, the updated consumption object display page can attract more attention of the user. Among them, the update of the layout parameters can be realized by training an intelligent display model based on the saliency constraint. That is, by identifying the saliency of the consumption object display page image under different layout parameters, the saliency mean of the obtained consumption object display page is constrained to be the highest, so as to train the intelligent display model until the model converges, and the intelligent display model is obtained. For different consumption transactions, a default recommended object display page can be input into the intelligent display model to obtain a recommended consumption object display page that is best for visual stimulation of the user.

[0122] S206, generating a recommended consumption object display page based on the updated layout parameters, determining the recommended consumption object display page as the consumption object display page, and displaying the consumption object display page.

[0123] Specifically, after obtaining the updated layout parameters, the page materials are combined based on the updated layout parameters to generate a recommended consumption object display page, and the recommended consumption object display page is confirmed as the consumption object display page to be displayed to the target recommended object.

[0124] Please refer to Figure 4 , a display page optimization schematic diagram of a living body detection method provided in the embodiment of the present specification. Figure 4 The left is a default consumption object display page, and the recommended consumption object display page Figure 4 on the right can be obtained by optimizing the default consumption object display page. The figure mainly shows which parts in the display page can be adjusted. Usually, the position and size of the materials can be adjusted through the page parameters, such as Figure 4 the size of the product image in , the arrangement position of the product, the background color, and the position of the text area.

[0125] In the embodiment of the present specification, by obtaining a default consumption object display page corresponding to a consumption transaction, generating update layout parameters of the default consumption object display page based on page materials corresponding to the default consumption object display page, generating a recommended consumption object display page based on the updated layout parameters, and determining the recommended consumption object display page as the consumption object display page. By adjusting the page layout, the stimulation to the user is maximized.

[0126] Please refer to Figure 5A flowchart of a live detection method is provided for the embodiments of the present specification. As shown in Figure 5 The method of the embodiments of the present specification can include the following steps S302-S308.

[0127] S302, feature extraction is performed on the first face image and the second face image to obtain a first face feature corresponding to the first face image and a second face feature corresponding to the second face image;

[0128] In one or more embodiments of the present specification, the face difference feature can include a feature difference feature and an image difference feature. When the face difference feature is obtained based on the first face image and the second face image, feature extraction can be performed on the first face image and the second face image to obtain a first face feature corresponding to the first face image and a second face feature corresponding to the second face image. Feature extraction is to abstract a specific image into a number through a matrix, so the obtained first face feature and second face feature can be a feature matrix. For example, a convolutional neural network can be used for feature extraction, and the specific network structure of the convolutional neural network is not limited as long as it can realize feature extraction of the face image.

[0129] S304, generating a feature difference feature based on the first face feature and the second face feature;

[0130] Specifically, after obtaining the first face feature and the second face feature, a feature difference feature is generated based on the first face feature and the second face feature. For example, the feature difference value of the first face feature and the second face feature can be calculated by subtraction to obtain the feature difference feature.

[0131] S306, generating a difference image based on the first face image and the second face image;

[0132] Specifically, the first face image and the second face image are processed to obtain a difference image. The difference image is an image obtained by subtracting images of a target scene at consecutive time points, and the difference image is defined in a broad sense as the difference between images of the target scene at time points tk and tk+L. The difference image is obtained by subtracting images of the target scene at adjacent time points, so that the transformation of the target scene over time can be obtained.

[0133] S308, feature extraction is performed on the difference image to obtain an image difference feature.

[0134] After obtaining the difference image, feature extraction is performed on the difference image to obtain an image difference feature. The method of feature extraction on the difference image can refer to the method of feature extraction on the first face image and the second face image, which is not described here.

[0135] Please refer to Figure 6 A flowchart of a living body detection method is provided for an embodiment of the present specification. As shown in Figure 6 The method of the present specification can include the following steps S402-S404.

[0136] S402, calculating a first feature difference value between the first micro-expression feature and the second micro-expression feature to obtain a micro-expression differential feature;

[0137] S404, calculating a second feature difference value between the first living body feature and the second living body feature to obtain a living body differential feature.

[0138] In one or more embodiments of the present specification, the first facial feature includes the first micro-expression feature and the first living body feature, and the second facial feature includes the second micro-expression feature and the second living body feature. That is, the facial feature includes two parts, the first part is the living body feature of the user, and the second part is the micro-expression feature of the user. The living body feature is a feature map obtained by further transforming the basic facial feature obtained by feature extraction on the facial image through some convolutional layers and fully connected layers, and so does the micro-expression feature. The living body feature and the micro-expression feature are obtained by feature processing modules trained based on different supervision signals. The corresponding supervision signals can be set for the living body detection module and the micro-expression module, and the convolutional layer parameters are adjusted through the supervision task, so as to obtain the features meeting the task requirements.

[0139] Specifically, the basic facial feature of the first facial image is input into the living body detection module for feature processing to obtain the corresponding first living body feature; the basic facial feature of the second facial image is processed in the same way to obtain the second living body feature, and the difference value between the first living body feature and the second living body feature is calculated to obtain the living body differential feature. Then the first micro-expression feature is extracted according to the basic facial feature of the first facial image, the second micro-expression feature is extracted according to the basic facial feature of the second facial image, the difference value between the first micro-expression feature and the second micro-expression feature is calculated to obtain the micro-expression differential feature.

[0140] In the embodiment of the present specification, by performing feature extraction on the first face image and the second face image, a first face feature corresponding to the first face image and a second face feature corresponding to the second face image are obtained, a feature difference feature is generated based on the first face feature and the second face feature, a difference image is generated based on the first face image and the second face image, feature extraction is performed on the difference image to obtain an image difference feature. Further, a first feature difference value between the first micro-expression feature and the second micro-expression feature is calculated to obtain a micro-expression difference feature, and a second feature difference value between the first living body feature and the second living body feature is calculated to obtain a living body difference feature. The living body detection is performed through the micro-expression difference feature and the living body difference feature, which can improve the accuracy of the living body detection.

[0141] Please refer to Figure 7 A flowchart of a training method of a basic living body detection model is provided for the embodiment of the present specification. As shown in Figure 7 The method of the embodiment of the present specification can include the following steps S502-S516.

[0142] S502, initializing a first initial structure parameter in the basic living body detection model;

[0143] It can be understood that the traditional living body detection model lacks the perception ability of micro-expression; therefore, it cannot capture the micro-expression changes before and after the user watches the product recommendation, and it cannot perform living body detection based on these small external stimuli. In order to overcome this problem, a basic living body detection model training method based on micro-expression perception is proposed, which enhances the perception ability of the model for micro-expression while performing living body detection, thereby laying a foundation for subsequent capture of micro-expression changes before and after the product recommendation stimulus.

[0144] Specifically, the initial structure parameters of the basic living body detection model are set first, such as the network structure parameters of the model and the loss function, etc. The model structure includes three parts, the first part is a basic feature encoding module, the second part is a living body detection module, and the third part is a micro-expression feature extraction module.

[0145] S504, obtaining a sample face image of a sample detection object; the sample face image includes a first sample face image and a second sample face image before and after the same sample detection object watches a consumption object display page;

[0146] Specifically, in the sample collection link, sample face images of different sample detection objects can be collected, for example, face images before and after a user watches a product recommendation page (one image before watching and one image after watching are collected for each user to form a group of image pairs).

[0147] S506, input the first sample face image and the second sample face image into a basic feature encoding module to obtain a basic face feature; the basic face feature includes a first basic face feature and a second basic face feature;

[0148] S508, input the basic face feature into a living body detection module to obtain a sample living body feature and a corresponding sample living body detection result;

[0149] S510, input the first basic face feature and the second basic face feature into a micro-expression feature extraction module to obtain a first sample micro-expression feature corresponding to the first basic face feature and a second sample micro-expression feature corresponding to the second basic face feature;

[0150] Specifically, the input of the basic feature encoding module is a sample face image, and the output is a basic face feature; the input of the living body detection module is a basic face feature, and the output is a sample living body feature and a sample living body detection result; the input of the micro-expression feature extraction module is a basic face feature corresponding to a pair of face images before and after a user views a commodity recommendation page, and the output is a micro-expression feature corresponding to the two.

[0151] S512, calculate a living body classification loss value corresponding to the sample living body detection result and a living body identity label pre-labeled by the sample detection object;

[0152] It can be understood that after obtaining the sample living body detection result through the model, the training effect of the model is evaluated by comparing the sample living body detection result with the true identity label of the sample detection object, that is, calculating the living body classification loss value. The living body classification loss value can be a deviation value of the sample living body detection result and the living body identity label; the living body classification loss value can also be represented by accuracy, such as the probability that the probability of predicting a living body attack in the sample living body detection result is consistent with the probability of labeling a living body attack in the true identity label.

[0153] S514, calculate a micro-expression feature learning loss value corresponding to the first sample micro-expression feature and the second sample micro-expression feature;

[0154] It can be understood that since the micro-expression perception ability of the model needs to be trained, the micro-expression feature learning loss value is calculated for the extracted first sample micro-expression feature and the second sample micro-expression feature, and whether the micro-expression extraction ability of the model meets the expectation is confirmed through the micro-expression feature learning loss value. Exemplarily, the difference between the first sample micro-expression feature and the second sample micro-expression feature can be calculated, and when the difference is large enough, it indicates that the model can perceive the micro-expression change before and after the user views the commodity recommendation.

[0155] S516, adjusting the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generating the trained basic living body detection model based on the first target structure parameter.

[0156] Specifically, the loss function of the basic living body detection model is: Loss total =Loss cls +Loss micro , wherein Loss cls is the living body classification loss value, and Loss micro is the micro-expression feature learning loss value. Network training is performed based on the above model structure and loss function until the basic living body detection model converges, and the trained basic living body detection model is obtained.

[0157] Optionally, in an embodiment, the adjusting the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generating the trained basic living body detection model based on the first target structure parameter comprises:

[0158] If the living body classification loss value does not converge to a first preset value, the second initial structure parameter of the living body detection module is adjusted based on the living body classification loss value, and the step of inputting the basic face feature into the living body detection module to obtain the sample living body feature and the corresponding sample living body detection result is performed until the living body classification loss value converges to the first preset value, and a second target structure parameter is obtained.

[0159] If the micro-expression feature learning loss value is not greater than a second preset value, the third initial structure parameter of the micro-expression feature extraction module is adjusted based on the micro-expression feature learning loss value, and the step of inputting the first basic face feature and the second basic face feature into the micro-expression feature extraction module to obtain the first sample micro-expression feature corresponding to the first basic face feature and the second sample micro-expression feature corresponding to the second basic face feature is performed until the micro-expression feature learning loss value is greater than the second preset value, and a third target structure parameter is obtained.

[0160] The first target structure parameter is obtained based on the second target structure parameter and the third target structure parameter, and the trained basic living body detection model is generated based on the first target structure parameter.

[0161] It can be understood that, when the model is trained, if the living body classification loss value does not converge to the first preset value, it indicates that the performance of the model does not achieve the expected effect, and the parameter of the living body detection module is updated based on the living body classification loss value. Correspondingly, if the micro-expression feature learning loss value is not greater than the second preset value, the parameter of the micro-expression feature extraction module is updated based on the micro-expression feature learning loss value, and the training is iterated until the living body classification loss value and the micro-expression feature learning loss value both reach the corresponding preset value condition, and the training of the model is completed. The first preset value and the second preset value can be set according to actual needs.

[0162] In the embodiment of the present specification, by initializing the first initial structure parameter in the basic living body detection model, obtaining the sample face image of the sample detection object, inputting the first sample face image and the second sample face image into the basic feature encoding module to obtain the basic face feature, inputting the basic face feature into the living body detection module to obtain the sample living body feature and the corresponding sample living body detection result, inputting the first basic face feature and the second basic face feature into the micro-expression feature extraction module to obtain the first sample micro-expression feature corresponding to the first basic face feature and the second sample micro-expression feature corresponding to the second basic face feature, calculating the living body classification loss value corresponding to the sample living body detection result and the living body identity label pre-labeled by the sample detection object, calculating the micro-expression feature learning loss value corresponding to the first sample micro-expression feature and the second sample micro-expression feature, adjusting the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain the first target structure parameter, and generating the trained basic living body detection model based on the first target structure parameter. By training the basic living body detection model sensitive to micro-expression, a foundation is laid for subsequent extraction of user's reaction to stimulation of the consumption object display page.

[0163] Please refer to Figure 8 , a flowchart of training of an intelligent display model is provided for the embodiment of the present specification. As Figure 8 shown, the method of the embodiment of the present specification can include the following steps S602-S614.

[0164] S602, initializing the fourth structure parameter in the intelligent display model;

[0165] Since the visual stimulation given to users by traditional consumer object display pages is limited, it cannot effectively stimulate all users to cause micro-expression changes. In order to enhance the stimulation to users, an intelligent page layout adjustment method is proposed, which adjusts the page layout of the consumer object display according to the saliency score of the page image. First, initialize the fourth structure parameter in the intelligent display model, which includes the network parameter and the loss function in the intelligent display model, such as the number of convolution layers, the size of the convolution kernel, etc. The model structure includes three parts, the first part is the page layout parameter generator, the second is the page layout module, and the third part is the saliency prediction module. It should be noted that the saliency prediction module is a pre-trained model, and the parameters are not updated during training.

[0166] S604, obtaining a sample default consumer object display page for a consumer transaction;

[0167] In one or more embodiments of the present specification, the training sample uses a sample default consumer object display page for a consumer transaction. A plurality of sample default consumer object display pages can be obtained, for example, a display page for a consumer object of food, a display page for a consumer object of daily necessities, and a display page for a consumer object of clothing. By learning the training sample of the rich model, the model can learn the best display page of various consumer objects.

[0168] S606, inputting the sample default consumer object display page into the page layout parameter generator to obtain sample updated page layout parameters;

[0169] Specifically, based on the sample default consumer object display page, the corresponding page material can be obtained, and then the sample updated page layout parameters are generated by the page layout parameter generator according to the page material. It should be noted that when the model is just starting to train, a random parameter generation method can be used to generate page layout parameters, and after training for several times, the model can learn how to set the parameters to better attract the attention of users.

[0170] S608, inputting the sample updated page parameters into the page layout module to obtain a sample updated page layout image;

[0171] Specifically, the page layout module can combine the page material to generate a sample updated page layout image according to the sample updated page parameters. It can be understood that the sample updated page layout image is an updated consumer object display page image generated according to the sample updated page parameters. The actual display page may have dynamic display effects when displayed to users, but when training the intelligent display model, the saliency prediction is performed according to the image of the updated consumer object display page, so as to judge the interest degree of users to the page.

[0172] S610, input the sample updated page layout image into the saliency prediction module to obtain a saliency map corresponding to the sample updated page layout image;

[0173] In an available embodiment, after obtaining the sample updated page layout image, the saliency of the sample updated page layout image is scored by the saliency prediction module to obtain the saliency score of each pixel point in the sample updated page layout image, and a saliency map is generated. For example, the saliency prediction module can be trained by using an existing saliency recognition algorithm, such as the GBVS algorithm.

[0174] S612, calculate the average saliency score of the saliency map;

[0175] After obtaining the saliency map corresponding to the sample updated page layout image, the average saliency score of the saliency map is calculated, that is, the saliency scores of the entire image are added and the average is calculated. Since the purpose of the intelligent display model is to obtain the sample updated page layout image that can attract the most attention of the user, the average saliency score of the entire image is used as an index for evaluating the attractiveness of the sample updated page layout image to the user.

[0176] S614, adjust the fourth initial structure parameter based on the average saliency score to obtain a fourth target structure parameter, and generate the trained intelligent display model based on the fourth target structure parameter.

[0177] Specifically, after obtaining the average saliency score of the sample updated page layout image, the average saliency score is constrained by using a loss function, and the fourth initial structure parameter of the intelligent display model is adjusted according to the average saliency score calculated in each iteration. Based on the above method and loss function, the model is trained until the model converges, the fourth target structure parameter is obtained, and the trained intelligent display model is generated.

[0178] When the model is trained, the default consumer display page is input into the trained intelligent display model to obtain a new consumer display page; the page is the consumer display page with the best stimulation effect, which can be displayed to the user.

[0179] Optionally, in an embodiment, the adjusting the fourth initial structure parameter based on the average saliency score to obtain a fourth target structure parameter, and generating the trained intelligent display model based on the fourth target structure parameter, comprises:

[0180] If the average of the saliency scores is not greater than a third preset value, a fifth initial structure parameter of the page layout parameter generator is adjusted based on the average of the saliency scores, and the step of inputting a sample default consumer object display page into the page layout parameter generator to obtain a sample updated page layout parameter is performed until the average of the saliency scores is greater than the third preset value, and a fifth target structure parameter is obtained;

[0181] A fourth target structure parameter is obtained based on the fifth target structure parameter, and the trained intelligent display model is generated based on the fourth target structure parameter.

[0182] In a feasible implementation, the loss function is a saliency map maximization loss, that is, the average of the saliency scores is maximized. By constraining the average of the saliency scores to be greater than a third preset value, the fifth initial structure parameter of the page layout parameter generator is optimized, and through continuous iterative training, the average of the saliency scores of the generated sample updated page layout image can be greater than the third preset value, and the fifth target structure parameter is obtained. A fourth target structure parameter is generated based on the initial structure parameters of the original page layout module and the saliency prediction module, and a trained intelligent display model is obtained. The third preset value can be set according to actual needs.

[0183] Please refer to Figure 9 , a flowchart of training of a living body detection model provided by an embodiment of the present specification. As Figure 9 indicated, the method of the embodiment of the present specification can include the following steps S702-S714.

[0184] S702, initializing a sixth initial structure parameter in the living body detection model;

[0185] In the embodiment of the present specification, based on the facial images of the user before and after watching the best consumer object display page and the trained basic living body model, further living body detection model training based on differential stimulation perception is performed for the final living body detection prediction based on commodity recommendation.

[0186] Specifically, the initial structure parameters of the simulation action video generation model are first set, such as the network structure parameters of the model and the loss function. The model structure includes three parts, the first part is a feature difference module, the second part is an image difference module, and the third part is a fusion detection module. The loss function is a living body detection loss.

[0187] S704, obtaining a sample facial feature of a sample detection object; the sample facial feature is obtained by inputting a sample facial image of the sample detection object into a basic living body detection model; the sample facial image includes a first sample facial image and a second sample facial image of the same sample detection object before and after watching a consumer object display page;

[0188] Specifically, in the training of the living body detection model, the sample face features used are obtained by the trained basic living body detection model, that is, the first sample face image and the second sample face image before and after the sample detection object views the consumption object display page are input into the basic living body detection model, and the corresponding sample face features are obtained.

[0189] S706, input the sample face features into the feature difference module to obtain sample feature difference features;

[0190] Specifically, the input of the feature difference module is the sample face features obtained by the basic living body detection model, and the output is the feature based on the feature difference, that is, the sample feature difference features. The specific way of feature difference can refer to the living body detection method in the above embodiment, which is not described here.

[0191] S708, input the first sample face image and the second sample face image into the image difference module to obtain sample image difference features;

[0192] Specifically, the input of the image difference module is the difference image of the image before and after the user views the best consumption object display page, and the output is the image difference feature. That is, by performing feature extraction and difference processing on the first sample face image and the second sample face image, the sample image difference features are obtained.

[0193] S710, input the sample feature difference features and the sample image difference features into the fusion detection module to output sample living body detection results;

[0194] Specifically, the input of the fusion detection module is the feature based on the feature difference and the image difference feature, and the output is the living body detection result. Based on the sample feature difference features and the sample image difference features of the sample detection object, the two difference features are fused for fusion detection, so as to improve the accuracy of living body detection. The sample living body detection result can be the probability that the sample detection object is a real person sample or an attack sample, and then the living body can be judged based on the attack probability p. For the threshold T set in advance, if p is greater than T, it is judged as an attack; otherwise, it is judged as a living body.

[0195] S712, based on the sample identity label of the sample detection object and the sample living body detection result, calculate the corresponding living body detection loss value;

[0196] Specifically, after obtaining the sample living body detection result, the sample identity label of the corresponding sample detection object is used to calculate the living body detection loss value. That is, the difference between the real sample identity label of the target detection object and the sample living body detection result is calculated.

[0197] S714, adjusting the sixth initial structure parameter based on the living body detection loss value to obtain a sixth target structure parameter, and generating the trained living body detection model based on the sixth target structure parameter.

[0198] Specifically, after obtaining the living body detection loss value, the sixth initial structure parameter is adjusted, and the living body detection model is iteratively trained until the living body detection loss value meets the preset condition. The trained sixth target structure parameter is used as the parameter of the living body detection model in actual application.

[0199] When the living body detection model is trained, the collected face image is input into the differential stimulation perception model obtained in the third step to obtain the attack probability p and the corresponding living body detection result.

[0200] Optionally, in an embodiment, the sample face features include first sample living body features, second sample living body features, first sample micro-expression features, and the second sample micro-expression features; the sample feature difference features include sample micro-expression difference features and sample living body difference features; and the inputting the sample face features into the feature difference module to obtain the sample feature difference features includes:

[0201] The first sample living body features, the second sample living body features, the first sample micro-expression features, and the second sample micro-expression features are input into the feature difference module, a first sample feature difference value between the first sample micro-expression features and the second sample micro-expression features is calculated to obtain sample micro-expression difference features, and a second sample feature difference value between the first living body features and the second living body features is calculated to obtain sample living body difference features.

[0202] Specifically, the sample micro-expression features and the sample living body features of the sample detection object can be obtained by the basic living body detection model. When the first sample living body features, the second sample living body features, the first sample micro-expression features, and the second sample micro-expression features corresponding to the first sample face image and the second sample face image before and after the viewing consumer object display page are obtained by the basic living body detection model, the sample micro-expression difference features are obtained based on the first sample feature difference value between the first sample micro-expression features and the second sample micro-expression features, the second sample feature difference value between the first living body features and the second living body features is calculated to obtain the sample living body difference features. The sample micro-expression difference features and the sample living body difference features are used as the sample feature difference features. The sample difference features can be obtained based on the extracted sample living body features and sample micro-expression features, the difference before and after the user views the sample consumer object display page is perceived, and the living body detection is realized.

[0203] Optionally, in an embodiment, the inputting the first sample face image and the second sample face image into the image difference module to obtain the sample image difference features includes:

[0204] generating a sample difference image based on the first sample face image and the second sample face image;

[0205] performing feature extraction on the sample difference image to obtain a sample image difference feature.

[0206] Specifically, the first sample face image and the second sample face image are subtracted to obtain a sample difference image, and feature extraction is performed based on the sample difference image to obtain a sample image difference feature.

[0207] Optionally, in an embodiment, the calculating of the corresponding living body detection loss value based on the sample identity label and the sample living body detection result pre-set for the sample detection object comprises:

[0208] obtaining a real attack probability in the sample identity label and a sample attack probability in the sample living body detection result;

[0209] calculating an attack probability difference value between the real attack probability and the sample attack probability as the living body detection loss value.

[0210] Specifically, in the calculation of the living body detection loss value, an attack probability difference value is calculated according to the real attack probability labeled in the sample identity label and the sample attack probability in the sample living body detection result, and the living body detection loss value is obtained.

[0211] Optionally, in an embodiment, the adjusting of the sixth initial structure parameter of the living body detection model based on the living body detection loss value to obtain a sixth target structure parameter, and the generating of the trained living body detection model based on the sixth target structure parameter comprise:

[0212] If the living body detection loss value does not converge to a fourth preset value, the sixth initial structure parameter of the living body detection model is adjusted based on the living body detection loss value, and the step of inputting the sample face feature into the feature difference module to obtain the sample feature difference feature is executed until the living body detection loss value converges to the fourth preset value, and the sixth target structure parameter is obtained.

[0213] The trained living body detection model is generated based on the sixth target structure parameter.

[0214] Specifically, the fourth preset value is set, and if the living body detection loss value does not converge to the fourth preset value, that is, is greater than the fourth preset value, the sixth initial structure parameter of the living body detection model, that is, the structure parameters of the feature difference module, the image difference module and the fusion detection module, is adjusted, and the model is iteratively trained until the living body detection loss value converges to the fourth preset value, the sixth target structure parameter is obtained, the trained living body detection model is generated, and is deployed to a terminal or a cloud server application.

[0215] In the embodiment of the present specification, by initializing the sixth initial structure parameter in the living body detection model, the sample face feature of the sample detection object is obtained, the sample face feature is input into the feature difference module to obtain the sample feature difference feature, the first sample face image and the second sample face image are input into the image difference module to obtain the sample image difference feature, the sample feature difference feature and the sample image difference feature are input into the fusion detection module to output the sample living body detection result, the corresponding living body detection loss value is calculated based on the sample identity label and the sample living body detection result of the sample detection object pre-set, the sixth target structure parameter is obtained by adjusting the sixth initial structure parameter based on the living body detection loss value, and the trained living body detection model is generated based on the sixth target structure parameter. By using the face images before and after the user watches the best consumption object display page and the pre-trained basic living body model, further difference stimulation perception model training is performed, and the living body detection is realized by using the difference stimulation perception result.

[0216] The embodiments of the present specification will be described below in conjunction with the accompanying drawings Figures 10-14 The living body detection device provided by the embodiments of the present specification will be described in detail. It should be noted that the living body detection device in the embodiments of the present specification is used to execute the method of the embodiments of the present specification shown in the present specification Figure 9 For the convenience of description, only the parts related to the embodiments of the present specification are shown, and the specific technical details not disclosed are described with reference to the embodiments shown in the present specification. Figures 2-6 Figures 2-6

[0217] Please refer to Figure 10 , which shows the structure schematic diagram of the living body detection device provided by an example embodiment of the present specification. The living body detection device can be realized by software, hardware or combination of the two to become all or part of the device. The device 1 includes a first face collection module 11, a display module 12, a second face collection module 13, a difference feature extraction module 14 and a result generation module 15.

[0218] The first face collection module 11 is used to collect the first face image of the target detection object for the consumption transaction;

[0219] The display module 12 is used to display the consumption object display page corresponding to the consumption transaction;

[0220] The second face collection module 13 is used to collect the second face image of the target detection object after displaying the consumption object display page;

[0221] The difference feature extraction module 14 is used to extract features from the first face image and the second face image to obtain face difference features;

[0222] ​​The result generation module 15 is configured to generate a living body detection result of the target detection object based on the face difference feature.

[0223] Optionally, referring to Figure 11 , a structural schematic diagram of a living body detection device provided by the embodiments of the present specification is shown. As shown in the figure, the living body detection device further includes a display page confirmation module 16, which is specifically configured to obtain a default consumption object display page corresponding to the consumption transaction. Figure 11

[0224] Generate an updated layout parameter of the default consumption object display page based on the page material corresponding to the default consumption object display page.

[0225] Generate a recommended consumption object display page based on the updated layout parameter, determine the recommended consumption object display page as the consumption object display page, and display the consumption object display page.

[0226] Optionally, the difference feature extraction module 14 is specifically configured to perform feature extraction on the first face image and the second face image to obtain a first face feature corresponding to the first face image and a second face feature corresponding to the second face image.

[0227] Generate a feature difference feature based on the first face feature and the second face feature.

[0228] Generate a difference image based on the first face image and the second face image.

[0229] Perform feature extraction on the difference image to obtain an image difference feature.

[0230] Optionally, the difference feature extraction module 14 is specifically configured to perform feature extraction on the registration action video to obtain a corresponding registration video feature.

[0231] Calculate a first feature difference value between the first micro-expression feature and the second micro-expression feature to obtain a micro-expression difference feature.

[0232] Calculate a second feature difference value between the first living body feature and the second living body feature to obtain a living body difference feature.

[0233] Further, referring to the living body detection device shown in Figure 12 , the living body detection device in Figure 12 is configured to execute the method of the embodiments of the present specification. For ease of illustration, only parts related to the embodiments of the present specification are shown, and specific technical details are not disclosed. Please refer to the embodiments shown in the present specification. Figure 7 Figure 7 For ease of illustration, only parts related to the embodiments of the present specification are shown, and specific technical details are not disclosed. Please refer to the embodiments shown in the present specification. ​​

[0234] See Figure 12 Fig. 1 shows a structural diagram of a living body detection device provided by an example embodiment of the present specification. The living body detection device can be realized as all or part of the device by software, hardware, or a combination of both. The device 2 includes a first parameter setting module 21, a first sample acquisition module 22, a first feature extraction module 23, a sample living body detection module 24, a sample micro-expression detection module 25, a living body classification loss calculation module 26, a micro-expression feature loss calculation module 27, and a first training module 28.

[0235] The first parameter setting module 21 is configured to initialize a first initial structure parameter in a basic living body detection model.

[0236] The first sample acquisition module 22 is configured to acquire a sample face image of a sample detection object; the sample face image includes a first sample face image and a second sample face image before and after the same sample detection object watches a display page of a consumption object.

[0237] The first feature extraction module 23 is configured to input the first sample face image and the second sample face image into a basic feature encoding module to obtain a basic face feature; the basic face feature includes a first basic face feature and a second basic face feature.

[0238] The sample living body detection module 24 is configured to input the basic face feature into a living body detection module to obtain a sample living body feature and a corresponding sample living body detection result.

[0239] The sample micro-expression detection module 25 is configured to input the first basic face feature and the second basic face feature into a micro-expression feature extraction module to obtain a first sample micro-expression feature corresponding to the first basic face feature and a second sample micro-expression feature corresponding to the second basic face feature.

[0240] The living body classification loss calculation module 26 is configured to calculate a living body classification loss value corresponding to the sample living body detection result and a living body identity label pre-labeled by the sample detection object.

[0241] The micro-expression feature loss calculation module 27 is configured to calculate a micro-expression feature learning loss value corresponding to the first sample micro-expression feature and the second sample micro-expression feature.

[0242] The first training module 28 is configured to adjust the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generate a trained basic living body detection model based on the first target structure parameter.

[0243] Optionally, the first training module 28 is specifically used to adjust the second initial structural parameters of the liveness detection module based on the liveness classification loss value if the liveness classification loss value does not converge to the first preset value, and then proceed to the step of inputting the basic face features into the liveness detection module to obtain sample liveness features and corresponding sample liveness detection results, until the liveness classification loss value converges to the first preset value, and the second target structural parameters are obtained.

[0244] If the micro-expression feature learning loss value is not greater than the second preset value, then the third initial structure parameter of the micro-expression feature extraction module is adjusted based on the micro-expression feature learning loss value, and the process proceeds to the step of inputting the first basic face feature and the second basic face feature into the micro-expression feature extraction module to obtain the first sample micro-expression feature corresponding to the first basic face feature and the second sample micro-expression feature corresponding to the second basic face feature, until the micro-expression feature learning loss value is greater than the second preset value, and the third target structure parameter is obtained.

[0245] The first target structure parameter is obtained based on the second target structure parameter and the third target structure parameter, and the trained basic liveness detection model is generated based on the first target structure parameter.

[0246] Further, refer to the appendix Figure 13 The liveness detection device shown is equipped with... Figure 13 The liveness detection device described herein is used to perform the functions described in this manual. Figure 7 The methods shown in the embodiments are illustrated for ease of explanation, showing only the parts related to the embodiments of this specification. For specific technical details not disclosed, please refer to this specification. Figure 8 The example shown.

[0247] Please see Figure 13 This diagram illustrates a structural schematic of a liveness detection device provided in an exemplary embodiment of this specification. The liveness detection device can be implemented as all or part of a device through software, hardware, or a combination of both. The device 3 includes a second parameter setting module 31, a second sample acquisition module 32, a page parameter generation module 33, a page layout generation module 34, a saliency detection module 35, a saliency score calculation module 36, and a second training module 37.

[0248] The second parameter setting module 31 is used to initialize the fourth structural parameter in the intelligent display model;

[0249] The second sample acquisition module 32 is used to acquire the sample default consumer object display page for the consumer transaction;

[0250] The page parameter generation module 33 is configured to input the sample default consumption object display page into a page layout parameter generator to obtain sample updated page layout parameters.

[0251] The page layout generation module 34 is configured to input the sample updated page parameters into a page layout module to obtain a sample updated page layout image.

[0252] The saliency detection module 35 is configured to input the sample updated page layout image into a saliency prediction module to obtain a saliency map corresponding to the sample updated page layout image.

[0253] The saliency score calculation module 36 is configured to calculate a saliency score mean value of the saliency map.

[0254] The second training module 37 is configured to adjust the fourth initial structure parameter based on the saliency score mean value to obtain a fourth target structure parameter, and generate the trained intelligent display model based on the fourth target structure parameter.

[0255] Optionally, the second training module 37 is specifically configured to, if the saliency score mean value is not greater than a third preset value, adjust a fifth initial structure parameter of the page layout parameter generator based on the saliency score mean value, and return to execute the step of inputting the sample default consumption object display page into the page layout parameter generator to obtain the sample updated page layout parameters until the saliency score mean value is greater than the third preset value, and obtain a fifth target structure parameter.

[0256] The fourth target structure parameter is obtained based on the fifth target structure parameter, and the trained intelligent display model is generated based on the fourth target structure parameter.

[0257] Further, refer to the living body detection device shown in the accompanying drawings, the living body detection device in the accompanying drawings is used for executing the method of the embodiments shown in the accompanying drawings. Figure 13 The living body detection device shown in the accompanying drawings, the living body detection device in the accompanying drawings is used for executing the method of the embodiments shown in the accompanying drawings. Figure 13 The method of the embodiments shown in the accompanying drawings is used for executing the method of the embodiments shown in the accompanying drawings. Figure 9 The specific technical details are not disclosed, please refer to the embodiments shown in the accompanying drawings. Figure 9 The embodiments shown in the accompanying drawings.

[0258] Please refer to Figure 13 , which shows the structure schematic diagram of the living body detection device provided by one example embodiment of the present disclosure. The living body detection device can be realized by software, hardware or combination of the two to become all or part of the device. The device 4 includes a third parameter setting module 41, a third sample acquisition module 42, a face feature difference processing module 43, an image difference feature processing module 44, a sample result generation module 45, a living body detection loss calculation module 46, and a third training module 47.

[0259] The third parameter setting module 41 is configured to initialize a sixth initial structure parameter in the living body detection model.

[0260] The third sample acquisition module 42 is configured to acquire sample facial features of a sample detection object; the sample facial features are obtained by inputting a sample facial image of the sample detection object into a basic living body detection model; the sample facial image includes a first sample facial image and a second sample facial image of the same sample detection object before and after viewing a consumption object display page.

[0261] The facial feature difference processing module 43 is configured to input the sample facial features into a feature difference module to obtain sample feature difference features.

[0262] The image difference feature processing module 44 is configured to input the first sample facial image and the second sample facial image into an image difference module to obtain sample image difference features.

[0263] The sample result generation module 45 is configured to input the sample feature difference features and the sample image difference features into a fusion detection module to output a sample living body detection result.

[0264] The living body detection loss calculation module 46 is configured to calculate a corresponding living body detection loss value based on a sample identity label of the sample detection object and the sample living body detection result.

[0265] The third training module 47 is configured to adjust the sixth initial structure parameter based on the living body detection loss value to obtain a sixth target structure parameter, and generate the living body detection model after training based on the sixth target structure parameter.

[0266] Optionally, the facial feature difference processing module 43 is specifically configured to input the first sample living body features, the second sample living body features, the first sample micro-expression features and the second sample micro-expression features into a feature difference module, calculate a first sample feature difference value between the first sample micro-expression features and the second sample micro-expression features to obtain sample micro-expression difference features, and calculate a second sample feature difference value between the first living body features and the second living body features to obtain sample living body difference features.

[0267] Optionally, the image difference feature processing module 44 is specifically configured to generate a sample difference image based on the first sample facial image and the second sample facial image.

[0268] Feature extraction is performed on the sample difference image to obtain sample image difference features.

[0269] Optionally, the living body detection loss calculation module 46 is specifically configured to obtain a real attack probability in the sample identity label and a sample attack probability in the sample living body detection result.

[0270] The attack probability difference between the real attack probability and the sample attack probability is calculated as the living body detection loss value.

[0271] Optionally, the third training module 47 is specifically configured to, if the living body detection loss value does not converge to a fourth preset value, adjust a sixth initial structure parameter of the living body detection model based on the living body detection loss value, and return to execute the step of inputting the sample face feature into the feature difference calculation module to obtain the sample feature difference feature until the living body detection loss value converges to the fourth preset value, and obtain a sixth target structure parameter.

[0272] The trained living body detection model is generated based on the sixth target structure parameter.

[0273] It should be noted that the living body detection apparatus provided in the above embodiments is used to execute the living body detection method, the training of the basic living body detection model, the training of the intelligent display model, and the training method of the living body detection model, and only the division of the above functional modules is used as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the living body detection apparatus and the living body detection method provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.

[0274] The above embodiment numbers in the specification are only for description, and do not represent the advantages or disadvantages of the embodiments. In some cases, the actions or steps recited in the claims can be executed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.

[0275] The embodiment of the specification also provides a storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the living body detection method of the above Figures 2-9 embodiment. The specific implementation process can be referred to the specific description of the above Figures 2-9 embodiment, which will not be repeated here.

[0276] Please refer to Figure 15Fig. 1 shows a structural schematic diagram of an electronic device provided by one exemplary embodiment of the present specification. The living body detection device in the present specification can include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 can be connected through the bus 150.

[0277] The processor 110 can include one or more processing cores. The processor 110 connects various parts within the entire living body detection device through various interfaces and lines, executes various functions of the terminal 100 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Alternatively, the processor 110 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 110 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU is mainly used to process operating systems, user pages, and application programs; the GPU is used to be responsible for rendering and drawing display content; and the modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 110, but be implemented separately through a communication chip.

[0278] The memory 120 can include a random access memory (RAM) and can also include a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like. The operating system can be an Android system, an IOS system developed by Apple Inc., a system developed based on the Android system or the IOS system, or other systems.

[0279] The memory 120 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve good running effects, the operating system allocates corresponding system resources to different third-party applications. However, there are also differences in the demand for system resources in different application scenarios in the same third-party application. For example, in the local resource loading scenario, the third-party application has a higher requirement for the disk reading speed; in the animation rendering scenario, the third-party application has a higher requirement for the GPU performance. However, the operating system and the third-party application are independent of each other, and the operating system often cannot timely perceive the current application scenario of the third-party application, resulting in that the operating system cannot perform targeted system resource adaptation according to the specific application scenario of the third-party application.

[0280] In order to enable the operating system to distinguish the specific application scenario of the third-party application, it is necessary to open up the data communication between the third-party application and the operating system, so that the operating system can obtain the current scenario information of the third-party application at any time, and then perform targeted system resource adaptation based on the current scenario.

[0281] The input device 130 is configured to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is configured to output instructions or data, and the output device 140 includes but is not limited to a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are a touch display screen.

[0282] The touch display screen can be designed as a full screen, a curved screen, or a special-shaped screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, and the present application does not limit this.

[0283] In addition, those skilled in the art can understand that the structure of the living body detection device shown in the above-mentioned drawings does not constitute a limitation on the living body detection device, and the living body detection device can include more or fewer components than the drawings, or combine certain components, or different component arrangements. For example, the living body detection device also includes radio frequency circuit, input unit, sensor, audio circuit, WiFi module, power supply, Bluetooth module and other components, which will not be described here.

[0284] In Figure 15 In the electronic device shown, the processor 110 can be used to invoke a computer application stored in the memory 120, and specifically perform the following operations:

[0285] Collecting a first face image of the target detection object for a consumption transaction;

[0286] Displaying a consumption object display page corresponding to the consumption transaction;

[0287] Collecting a second face image of the target detection object after displaying the consumption object display page;

[0288] Feature extraction is performed on the first face image and the second face image to obtain face difference features;

[0289] Based on the face difference features, a living body detection result of the target detection object is generated.

[0290] In one embodiment, before the processor 110 performs the operation of displaying the consumption object display page corresponding to the consumption transaction, it also performs the following operation:

[0291] Obtaining a default consumption object display page corresponding to the consumption transaction;

[0292] Based on the page material corresponding to the default consumption object display page, an update layout parameter of the default consumption object display page is generated;

[0293] Based on the update layout parameter, a recommended consumption object display page is generated, the recommended consumption object display page is determined as the consumption object display page, and the consumption object display page is displayed.

[0294] In one embodiment, when the processor 110 performs the operation of feature extraction on the first face image and the second face image to obtain the difference features, it specifically performs the following operation:

[0295] perform feature extraction on the first face image and the second face image to obtain a first face feature corresponding to the first face image and a second face feature corresponding to the second face image;

[0296] generate a feature difference feature based on the first face feature and the second face feature;

[0297] generate a difference image based on the first face image and the second face image;

[0298] perform feature extraction on the difference image to obtain an image difference feature.

[0299] In one embodiment, the processor 110, when performing the operation of generating a feature difference feature based on the first face feature and the second face feature, specifically performs the following operations:

[0300] calculate a first feature difference value between the first micro-expression feature and the second micro-expression feature to obtain a micro-expression difference feature;

[0301] calculate a second feature difference value between the first living body feature and the second living body feature to obtain a living body difference feature.

[0302] The processor 110 can also be configured to call a computer application stored in the memory 120 and specifically perform the following operations:

[0303] initialize a first initial structure parameter in a basic living body detection model;

[0304] obtain a sample face image of a sample detection object; the sample face image includes a first sample face image and a second sample face image of the same sample detection object before and after viewing a consumption object display page;

[0305] input the first sample face image and the second sample face image into a basic feature encoding module to obtain a basic face feature; the basic face feature includes a first basic face feature and a second basic face feature;

[0306] input the basic face feature into a living body detection module to obtain a sample living body feature and a corresponding sample living body detection result;

[0307] input the first basic face feature and the second basic face feature into a micro-expression feature extraction module to obtain a first sample micro-expression feature corresponding to the first basic face feature and a second sample micro-expression feature corresponding to the second basic face feature;

[0308] calculate a living body classification loss value corresponding to a living body identity label pre-labeled by the sample detection object;

[0309] compute a micro-expression feature learning loss value corresponding to the first sample micro-expression feature and the second sample micro-expression feature;

[0310] adjust the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generate the trained basic living body detection model based on the first target structure parameter.

[0311] In one embodiment, when the processor 110 performs adjustment of the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generates the trained basic living body detection model based on the first target structure parameter, the following operations are specifically performed:

[0312] If the living body classification loss value does not converge to a first preset value, the second initial structure parameter of the living body detection module is adjusted based on the living body classification loss value, and the step of inputting the basic face feature into the living body detection module to obtain the sample living body feature and the corresponding sample living body detection result is performed until the living body classification loss value converges to the first preset value, and a second target structure parameter is obtained.

[0313] If the micro-expression feature learning loss value is not greater than a second preset value, the third initial structure parameter of the micro-expression feature extraction module is adjusted based on the micro-expression feature learning loss value, and the step of inputting the first basic face feature and the second basic face feature into the micro-expression feature extraction module to obtain the first sample micro-expression feature corresponding to the first basic face feature and the second sample micro-expression feature corresponding to the second basic face feature is performed until the micro-expression feature learning loss value is greater than the second preset value, and a third target structure parameter is obtained.

[0314] obtain a first target structure parameter based on the second target structure parameter and the third target structure parameter, and generate the trained basic living body detection model based on the first target structure parameter.

[0315] The processor 110 can also be configured to invoke a computer application stored in the memory 120, and specifically perform the following operations:

[0316] Initialize a fourth structure parameter in the intelligent display model;

[0317] Obtain a sample default consumption object display page for a consumption transaction;

[0318] Input the sample default consumption object display page into a page layout parameter generator to obtain a sample updated page layout parameter;

[0319] inputting the sample updated page parameter into a page layout module to obtain a sample updated page layout image;

[0320] inputting the sample updated page layout image into a saliency prediction module to obtain a saliency map corresponding to the sample updated page layout image;

[0321] calculating a saliency score mean value of the saliency map;

[0322] adjusting the fourth initial structure parameter based on the saliency score mean value to obtain a fourth target structure parameter, and generating the trained intelligent display model based on the fourth target structure parameter.

[0323] In one embodiment, when the processor 110 performs adjusting the fourth initial structure parameter based on the saliency score mean value to obtain a fourth target structure parameter, and generating the trained intelligent display model based on the fourth target structure parameter, the processor 110 specifically performs the following operations:

[0324] If the saliency score mean value is not greater than a third preset value, adjusting a fifth initial structure parameter of the page layout parameter generator based on the saliency score mean value, and returning to the step of inputting a sample default consumer object display page into the page layout parameter generator to obtain a sample updated page layout parameter until the saliency score mean value is greater than the third preset value to obtain a fifth target structure parameter;

[0325] obtaining a fourth target structure parameter based on the fifth target structure parameter, and generating the trained intelligent display model based on the fourth target structure parameter.

[0326] The processor 110 can also be configured to invoke a computer application stored in the memory 120 and specifically perform the following operations:

[0327] initializing a sixth initial structure parameter in the living body detection model;

[0328] obtaining a sample face feature of a sample detection object; the sample face feature is obtained by inputting a sample face image of the sample detection object into a basic living body detection model; the sample face image includes a first sample face image and a second sample face image of the same sample detection object before and after viewing a consumer object display page;

[0329] inputting the sample face feature into a feature difference module to obtain a sample feature difference feature;

[0330] inputting the first sample face image and the second sample face image into an image difference module to obtain a sample image difference feature;

[0331] input the sample feature difference feature and the sample image difference feature into a fusion detection module, and output a sample living body detection result;

[0332] calculate a corresponding living body detection loss value based on a sample identity label of the sample detection object and the sample living body detection result;

[0333] adjust the sixth initial structure parameter based on the living body detection loss value to obtain a sixth target structure parameter, and generate the trained living body detection model based on the sixth target structure parameter.

[0334] In one embodiment, when the processor 110 performs the inputting of the sample face feature into the feature difference module to obtain the sample feature difference feature, the following operations are specifically performed:

[0335] input the first sample living body feature, the second sample living body feature, the first sample micro-expression feature and the second sample micro-expression feature into a feature difference module, calculate a first sample feature difference value between the first sample micro-expression feature and the second sample micro-expression feature to obtain a sample micro-expression difference feature, and calculate a second sample feature difference value between the first living body feature and the second living body feature to obtain a sample living body difference feature.

[0336] In one embodiment, when the processor 110 performs the inputting of the first sample face image and the second sample face image into the image difference module to obtain the sample image difference feature, the following operations are specifically performed:

[0337] generate a sample difference image based on the first sample face image and the second sample face image;

[0338] perform feature extraction on the sample difference image to obtain a sample image difference feature.

[0339] In one embodiment, when the processor 110 performs the calculation of the corresponding living body detection loss value based on the sample identity label of the sample detection object and the sample living body detection result, the following operations are specifically performed:

[0340] obtain a real attack probability in the sample identity label and a sample attack probability in the sample living body detection result;

[0341] calculate an attack probability difference value between the real attack probability and the sample attack probability as the living body detection loss value.

[0342] In an embodiment, the processor 110, when performing the adjusting the sixth initial structure parameter of the living body detection model based on the living body detection loss value to obtain a sixth target structure parameter and generating the trained living body detection model based on the sixth target structure parameter, specifically performs the following operations:

[0343] If the living body detection loss value does not converge to a fourth preset value, the sixth initial structure parameter of the living body detection model is adjusted based on the living body detection loss value, and the step of inputting the sample face feature into the feature difference module to obtain the sample feature difference feature is performed until the living body detection loss value converges to the fourth preset value, and the sixth target structure parameter is obtained.

[0344] The trained living body detection model is generated based on the sixth target structure parameter.

[0345] In the embodiments of the present specification, by collecting a first face image of a target detection object for a consumption transaction, displaying a consumption object display page corresponding to the consumption transaction, and then collecting a second face image of the target detection object after displaying the consumption object display page, feature extraction is performed on the first face image and the second face image to obtain face difference features, and based on the face difference features, a living body detection result of the target detection object is generated. By using the consumption object display page as an external stimulus to the user, the living body detection is performed based on the reaction of the user to the external stimulus, that is, by collecting the face images of the target detection object before and after watching the consumption object display page, the difference stimulation perception is performed according to the face images of the user before and after watching the consumption object display page, and the living body detection is performed using the difference stimulation perception result. The user does not need to cooperate to complete a series of actions, which can improve the efficiency of the living body detection, and the living body detection based on the difference stimulation improves the accuracy of the living body detection, thereby ensuring the safety of the consumption transaction.

[0346] Further, in the embodiments of the present specification, by obtaining a default consumption object display page corresponding to a consumption transaction, generating an updated layout parameter of the default consumption object display page based on page materials corresponding to the default consumption object display page, generating a recommended consumption object display page based on the updated layout parameter, and determining the recommended consumption object display page as the consumption object display page. The page layout is adjusted to maximize the stimulation to the user.

[0347] Further, by performing feature extraction on the first face image and the second face image, a first face feature corresponding to the first face image and a second face feature corresponding to the second face image are obtained, a feature difference feature is generated based on the first face feature and the second face feature, a difference image is generated based on the first face image and the second face image, feature extraction is performed on the difference image to obtain an image difference feature. Further, a first feature difference value between the first micro-expression feature and the second micro-expression feature is calculated to obtain a micro-expression difference feature, and a second feature difference value between the first living body feature and the second living body feature is calculated to obtain a living body difference feature. By using the micro-expression difference feature and the living body difference feature for living body detection, the accuracy of living body detection can be improved.

[0348] Further, by initializing a first initial structure parameter in the basic living body detection model, obtaining a sample face image of a sample detection object, inputting the first sample face image and the second sample face image into the basic feature encoding module to obtain a basic face feature, inputting the basic face feature into the living body detection module to obtain a sample living body feature and a corresponding sample living body detection result, inputting the first basic face feature and the second basic face feature into the micro-expression feature extraction module to obtain a first sample micro-expression feature corresponding to the first basic face feature and a second sample micro-expression feature corresponding to the second basic face feature, calculating a living body classification loss value corresponding to a living body identity label pre-labeled by the sample detection object, calculating a micro-expression feature learning loss value corresponding to the first sample micro-expression feature and the second sample micro-expression feature, adjusting the first initial structure parameter based on the living body classification loss value and the micro-expression feature learning loss value to obtain a first target structure parameter, and generating a trained basic living body detection model based on the first target structure parameter. By training the basic living body detection model sensitive to micro-expression, a foundation is laid for subsequent extraction of user's reaction to stimulation of a consumption object display page.

[0349] Further, by initializing the sixth initial structure parameter in the living body detection model, sample face features of a sample detection object are obtained, the sample face features are input into the feature difference module to obtain sample feature difference features, the first sample face image and the second sample face image are input into the image difference module to obtain sample image difference features, the sample feature difference features and the sample image difference features are input into the fusion detection module to output sample living body detection results, a corresponding living body detection loss value is calculated based on a sample identity label of the sample detection object and the sample living body detection results, the sixth initial structure parameter is adjusted based on the living body detection loss value to obtain a sixth target structure parameter, and the trained living body detection model is generated based on the sixth target structure parameter. By using the face images before and after the user watches the best consumption object display page and the pre-trained basic living body model, further difference stimulation perception model training is performed, and the living body detection is realized by using the difference stimulation perception result.

[0350] In addition, the embodiments of the present specification provide a computer program product, which comprises a computer program. When the computer program is executed by a processor of an electronic device, the processor can at least implement the method provided in the foregoing Figures 1 to 8 embodiments.

[0351] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM), a random access memory (RAM), or the like.

[0352] The above only describes the preferred embodiments of the present specification, and of course cannot limit the scope of the rights of the present specification. Therefore, equivalent changes made according to the claims of the present specification still fall within the scope of the present specification.

Claims

1. A method for detecting liveness, comprising: Collect the first facial image of the target object in the consumer transaction; Display the consumer object display page corresponding to the aforementioned consumer transaction; Collect the second face image of the target detection object after displaying the consumer object display page; Feature extraction is performed on the first face image and the second face image to obtain face difference features. It includes feature difference features and image difference features. The feature difference features include micro-expression difference features and liveness difference features. The micro-expression difference features are used to reflect the feature differences of micro-expression features in the first face image and the second face image. The liveness difference features are used to reflect the feature differences of liveness features in the first face image and the second face image. The image difference features are used to reflect the image differences between the first face image and the second face image. Based on the micro-expression difference features, the liveness difference features, and the image difference features, a liveness detection result for the target detection object is generated.

2. The method as described in claim 1, further comprising, before displaying the consumer object display page corresponding to the consumption transaction: Get the default consumer object display page corresponding to the consumption transaction; Based on the page materials corresponding to the default consumer object display page, generate the updated layout parameters for the default consumer object display page; A recommended consumer object display page is generated based on the updated layout parameters, the recommended consumer object display page is determined as the consumer object display page, and the consumer object display page is displayed.

3. The method as described in claim 1, wherein the step of extracting features from the first face image and the second face image to obtain differential features includes: Feature extraction is performed on the first face image and the second face image to obtain the first face feature corresponding to the first face image and the second face feature corresponding to the second face image; Feature difference features are generated based on the first facial features and the second facial features; A difference image is generated based on the first face image and the second face image; Feature extraction is performed on the difference image to obtain image difference features.

4. The method as described in claim 3, wherein the first facial feature includes a first micro-expression feature and a first liveness feature; and the second facial feature includes a second micro-expression feature and a second liveness feature; The feature difference features include micro-expression difference features and liveness difference features; The generation of feature difference features based on the first facial features and the second facial features includes: Calculate the first feature difference between the first micro-expression feature and the second micro-expression feature to obtain the micro-expression difference feature; Calculate the second feature difference between the first live feature and the second live feature to obtain the live differential feature.

5. The method of claim 1, further comprising: Initialize the fourth initial structural parameter in the intelligent display model; Get the sample default consumer object display page for the consumption transaction; Input the sample default consumer object display page into the page layout parameter generator to obtain the sample updated page layout parameters; Input the sample updated page parameters into the page layout module to obtain the sample updated page layout image; Input the updated page layout image of the sample into the saliency prediction module to obtain the saliency map corresponding to the updated page layout image of the sample; Calculate the mean significance score of the significance map; The fourth initial structural parameter is adjusted based on the mean saliency score to obtain the fourth target structural parameter, and the trained intelligent display model is generated based on the fourth target structural parameter.

6. The method of claim 5, wherein adjusting the fourth initial structural parameter based on the mean saliency score to obtain the fourth target structural parameter, and generating the trained intelligent display model based on the fourth target structural parameter, comprises: If the average significance score is not greater than the third preset value, then the fifth initial structural parameter of the page layout parameter generator is adjusted based on the average significance score, and the process proceeds to the step of inputting the sample default consumer object display page into the page layout parameter generator to obtain the sample updated page layout parameters, until the average significance score is greater than the third preset value, and the fifth target structural parameter is obtained. The fourth target structural parameter is obtained based on the fifth target structural parameter, and the trained intelligent display model is generated based on the fourth target structural parameter.

7. A training method for a basic liveness detection model, comprising: Initialize the first initial structural parameters in the basic liveness detection model; Acquire sample face images of the sample detection object; the sample face images include a first sample face image and a second sample face image of the same sample detection object before and after viewing the consumer object display page; The first sample face image and the second sample face image are input into the basic feature encoding module to obtain basic face features; the basic face features include a first basic face feature and a second basic face feature; The basic facial features are input into the liveness detection module to obtain the sample liveness features and the corresponding sample liveness detection results; The first basic facial features and the second basic facial features are input into the micro-expression feature extraction module to obtain the first sample micro-expression features corresponding to the first basic facial features and the second sample micro-expression features corresponding to the second basic facial features. Calculate the liveness classification loss value corresponding to the liveness detection result of the sample and the pre-labeled liveness identity tag of the sample detection object; Calculate the micro-expression feature learning loss values ​​corresponding to the micro-expression features of the first sample and the micro-expression features of the second sample; The first initial structural parameters are adjusted based on the liveness classification loss value and the micro-expression feature learning loss value to obtain the first target structural parameters, and the trained basic liveness detection model is generated based on the first target structural parameters. The basic liveness detection model is used to extract features from the first face image of the target detection object in relation to a consumer transaction and the second face image of the target detection object after the consumer object's display page is shown, to obtain feature difference features; The feature difference features include micro-expression difference features and liveness difference features. The micro-expression difference features are used to reflect the feature differences of micro-expression features in the first face image and the second face image. The liveness difference features are used to reflect the feature differences of liveness features in the first face image and the second face image. The micro-expression difference features and the liveness difference features are used with the image difference features between the first face image and the second face image to generate the liveness detection result of the target detection object.

8. The method of claim 7, wherein adjusting the first initial structural parameters based on the liveness classification loss value and the micro-expression feature learning loss value to obtain first target structural parameters, and generating the trained basic liveness detection model based on the first target structural parameters, comprises: If the liveness classification loss value does not converge to the first preset value, the second initial structural parameters of the liveness detection module are adjusted based on the liveness classification loss value, and the process proceeds to the step of inputting the basic face features into the liveness detection module to obtain sample liveness features and corresponding sample liveness detection results, until the liveness classification loss value converges to the first preset value and the second target structural parameters are obtained. If the micro-expression feature learning loss value is not greater than the second preset value, then the third initial structure parameter of the micro-expression feature extraction module is adjusted based on the micro-expression feature learning loss value, and the process proceeds to the step of inputting the first basic face feature and the second basic face feature into the micro-expression feature extraction module to obtain the first sample micro-expression feature corresponding to the first basic face feature and the second sample micro-expression feature corresponding to the second basic face feature, until the micro-expression feature learning loss value is greater than the second preset value, and the third target structure parameter is obtained. The first target structure parameter is obtained based on the second target structure parameter and the third target structure parameter, and the trained basic liveness detection model is generated based on the first target structure parameter.

9. A method for training a liveness detection model, comprising: Initialize the sixth initial structural parameter in the liveness detection model; Obtain the facial features of the sample detection object; The sample face features are obtained by inputting the sample face image of the sample detection object into the basic liveness detection model; the sample face image includes the first sample face image and the second sample face image of the same sample detection object before and after viewing the consumer object display page; The sample facial features are input into the feature difference module to obtain the sample feature difference features; The sample feature difference features include sample micro-expression difference features and sample liveness difference features; The sample micro-expression difference feature is used to reflect the feature difference of sample micro-expression features in the first sample face image and the second sample face image, and the sample liveness difference feature is used to reflect the feature difference of sample liveness features in the first sample face image and the second sample face image; The first sample face image and the second sample face image are input into the image difference module to obtain sample image difference features; the sample image difference features are used to reflect the image differences between the first sample face image and the second sample face image. The sample feature difference features and the sample image difference features are input into the fusion detection module, and the sample liveness detection result is output. Calculate the corresponding liveness detection loss value based on the sample identity label pre-set for the sample detection object and the sample liveness detection result; The sixth initial structural parameter is adjusted based on the liveness detection loss value to obtain the sixth target structural parameter, and the trained liveness detection model is generated based on the sixth target structural parameter.

10. The method as described in claim 9, wherein the sample facial features include a first sample liveness feature, a second sample liveness feature, a first sample micro-expression feature, and a second sample micro-expression feature; The step of inputting the sample facial features into the feature difference module to obtain sample feature difference features includes: The first sample liveness feature, the second sample liveness feature, the first sample micro-expression feature, and the second sample micro-expression feature are input into the feature difference module. The first sample feature difference between the first sample micro-expression feature and the second sample micro-expression feature is calculated to obtain the sample micro-expression difference feature. The second sample feature difference between the first sample liveness feature and the second sample liveness feature is calculated to obtain the sample liveness difference feature.

11. The method of claim 9, wherein inputting the first sample face image and the second sample face image into an image difference module to obtain sample image difference features includes: A sample difference image is generated based on the first sample face image and the second sample face image; Feature extraction is performed on the sample difference image to obtain the sample image difference features.

12. The method of claim 9, wherein calculating the corresponding liveness detection loss value based on the sample identity label pre-set for the sample detection object and the sample liveness detection result includes: Obtain the true attack probability in the sample identity label and the sample attack probability in the sample liveness detection result; The difference between the actual attack probability and the sample attack probability is calculated and used as the liveness detection loss value.

13. The method of claim 9, wherein adjusting the sixth initial structural parameter based on the liveness detection loss value to obtain the sixth target structural parameter, and generating the trained liveness detection model based on the sixth target structural parameter, comprises: If the liveness detection loss value does not converge to the fourth preset value, the sixth initial structural parameter of the liveness detection model is adjusted based on the liveness detection loss value, and the process proceeds to the step of inputting the sample face features into the feature difference module to obtain the sample feature difference features, until the liveness detection loss value converges to the fourth preset value and the sixth target structural parameter is obtained. Based on the sixth target structural parameters, the trained liveness detection model is generated.

14. A liveness detection device, the device comprising: The first face acquisition module is used to acquire the first face image of the target detection object in relation to the consumption transaction; The display module is used to display the consumer object display page corresponding to the consumption transaction; The second face acquisition module is used to acquire the second face image of the target detection object after the consumer object display page is displayed; The differential feature extraction module is used to extract features from the first face image and the second face image to obtain face differential features. The face differential features include feature differential features and image differential features. The feature differential features include micro-expression differential features and liveness differential features. The micro-expression differential features are used to reflect the feature differences of micro-expression features in the first face image and the second face image. The liveness differential features are used to reflect the feature differences of liveness features in the first face image and the second face image. The image differential features are used to reflect the image differences between the first face image and the second face image. The result generation module is used to generate the liveness detection result of the target detection object based on the micro-expression difference features, the liveness difference features, and the image difference features.

15. The apparatus of claim 14, wherein the apparatus comprises: The second parameter setting module is used to initialize the fourth initial structure parameter in the intelligent display model; The second sample acquisition module is used to obtain the sample default consumer object display page for the consumer transaction; The page parameter generation module is used to input the sample default consumer object display page into the page layout parameter generator to obtain the sample updated page layout parameters. The page layout generation module is used to input the sample updated page parameters into the page layout module to obtain the sample updated page layout image. The saliency detection module is used to input the sample updated page layout image into the saliency prediction module to obtain the saliency map corresponding to the sample updated page layout image; A significance score calculation module is used to calculate the mean significance score of the significance map; The second training module is used to adjust the fourth initial structural parameter based on the mean saliency score to obtain the fourth target structural parameter, and to generate the trained intelligent display model based on the fourth target structural parameter.

16. A liveness detection device, the device comprising: The first parameter setting module is used to initialize the first initial structural parameters in the basic liveness detection model. The first sample acquisition module is used to acquire sample face images of the sample detection object; the sample face images include first sample face images and second sample face images of the same sample detection object before and after viewing the consumer object display page; The first feature extraction module is used to input the first sample face image and the second sample face image into the basic feature encoding module to obtain basic face features; the basic face features include first basic face features and second basic face features; The sample liveness detection module is used to input the basic facial features into the liveness detection module to obtain the sample liveness features and the corresponding sample liveness detection results; The sample micro-expression detection module is used to input the first basic facial features and the second basic facial features into the micro-expression feature extraction module to obtain the first sample micro-expression features corresponding to the first basic facial features and the second sample micro-expression features corresponding to the second basic facial features. The liveness classification loss calculation module is used to calculate the liveness classification loss value corresponding to the liveness detection result of the sample and the liveness identity label pre-labeled on the sample detection object; The micro-expression feature loss calculation module is used to calculate the micro-expression feature learning loss value corresponding to the micro-expression features of the first sample and the micro-expression features of the second sample. The first training module is used to adjust the first initial structural parameters based on the liveness classification loss value and the micro-expression feature learning loss value to obtain the first target structural parameters, and to generate the trained basic liveness detection model based on the first target structural parameters. The basic liveness detection model is used to extract features from the first face image of the target detection object in relation to a consumer transaction and the second face image of the target detection object after the consumer object's display page is shown, to obtain feature difference features; The feature difference features include micro-expression difference features and liveness difference features. The micro-expression difference features are used to reflect the feature differences of micro-expression features in the first face image and the second face image. The liveness difference features are used to reflect the feature differences of liveness features in the first face image and the second face image. The micro-expression difference features and the liveness difference features are used with the image difference features between the first face image and the second face image to generate the liveness detection result of the target detection object.

17. A liveness detection device, the device comprising: The third parameter setting module is used to initialize the sixth initial structural parameter in the liveness detection model; The third sample acquisition module is used to acquire the sample facial features of the sample detection object; the sample facial features are obtained by inputting the sample facial image of the sample detection object into the basic liveness detection model; the sample facial image includes the first sample facial image and the second sample facial image of the same sample detection object before and after viewing the consumer object display page; The face feature difference processing module is used to input the sample face features into the feature difference module to obtain sample feature difference features; The sample feature difference features include sample micro-expression difference features and sample liveness difference features; The sample micro-expression difference feature is used to reflect the feature difference of sample micro-expression features in the first sample face image and the second sample face image, and the sample liveness difference feature is used to reflect the feature difference of sample liveness features in the first sample face image and the second sample face image; The image difference feature processing module is used to input the first sample face image and the second sample face image into the image difference module to obtain the sample image difference features; The sample image difference feature is used to reflect the image differences between the first sample face image and the second sample face image; The sample result generation module is used to input the sample feature difference features and the sample image difference features into the fusion detection module and output the sample liveness detection result; The liveness detection loss calculation module is used to calculate the corresponding liveness detection loss value based on the sample identity label pre-set for the sample detection object and the sample liveness detection result; The third training module is used to adjust the sixth initial structural parameter based on the liveness detection loss value to obtain the sixth target structural parameter, and to generate the trained liveness detection model based on the sixth target structural parameter.

18. An electronic device comprising: Processor and memory; The memory stores a computer program adapted to be loaded by the processor and to execute the steps of the method as described in any one of claims 1 to 13.

19. A storage medium storing a computer program that, when executed by a processor, implements the steps of the method as claimed in any one of claims 1 to 13.

20. A computer program product comprising: A computer program, when executed by a processor of an electronic device, causes the processor to perform the steps of the method as described in any one of claims 1 to 13.

Citation Information

Patent Citations

  • Living body detection method and device, electronic equipment and storage medium

    CN112749603A

  • Visual content optimization system using artificial intelligence (AI) based design generation and validation

    US20200242195A1