CN116778585A - Living body detection method and device, storage medium and electronic equipment - Google Patents

Living body detection method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116778585A
CN116778585A CN202310277108.4A CN202310277108A CN116778585A CN 116778585 A CN116778585 A CN 116778585A CN 202310277108 A CN202310277108 A CN 202310277108A CN 116778585 A CN116778585 A CN 116778585A
Authority
CN
China
Prior art keywords
image
sample
polarization
living body
target object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310277108.4A
Other languages
Chinese (zh)
Inventor
曹佳炯
丁菁汀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202310277108.4A priority Critical patent/CN116778585A/en
Publication of CN116778585A publication Critical patent/CN116778585A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The specification discloses a living body detection method, a living body detection device, a storage medium and electronic equipment, wherein the living body detection method comprises the following steps: and acquiring a target object image of a target object in a target environment, determining a target object polarization state image aiming at the target object, and combining the target object image and the target object polarization state image to perform living body attack detection processing.

Description

Living body detection method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a living body detection method, a living body detection device, a storage medium, and an electronic device.
Background
With the rapid development of computer technology, the biometric technology is widely applied to the production and life of people. For example, face-brushing payment, face access control, face attendance and face-entering technologies all need to rely on biological recognition, but with the wider application of biological recognition technologies, living body detection requirements under biological recognition scenes are also more and more protruded, and biological recognition scenes such as face attendance, face-brushing entering and face-brushing payment are widely applied, so that biological recognition provides convenience for people and brings new risk challenges. The most common means of threatening the security of biometric systems is a living attack, i.e. a technique that attempts to bypass image biometric authentication by means of a device screen, printing a photograph, etc., so that in biometric scenes, living detection is particularly important.
Disclosure of Invention
The specification provides a living body detection method, a living body detection device, a storage medium and electronic equipment, wherein the technical scheme is as follows:
in a first aspect, the present specification provides a method of in vivo detection, the method comprising:
collecting a target object image of a target object in a target environment;
determining a target object polarization state image for the target object based on the target object image;
and performing living body attack detection processing based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
In a second aspect, the present specification provides a living body detection apparatus, the apparatus comprising:
the object image acquisition module is used for acquiring a target object image of a target object in a target environment;
a polarization image determining module for determining a target object polarization state image for the target object based on the target object image;
the living body attack detection module is used for carrying out living body attack detection processing based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
In a third aspect, the present description provides a computer storage medium storing at least one instruction adapted to be loaded by a processor and to perform the method steps of one or more embodiments of the present description.
In a fourth aspect, the present description provides a computer program product storing at least one instruction adapted to be loaded by a processor and to perform the method steps of one or more embodiments of the present description.
In a fifth aspect, the present description provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of one or more embodiments of the present description.
The technical scheme provided by some embodiments of the present specification has the following beneficial effects:
in one or more embodiments of the present disclosure, an electronic device acquires a target object image of a target object in a target environment, then determines a target object polarization state image of the target object, and performs living attack detection processing by combining the target object image and the target object polarization state image, so that the living attack security capability of the target object can be improved by combining the polarization state image in a living detection scene, the living attack security detection effect is improved, the security performance is ensured, and meanwhile, the living detection method related to the application of the present disclosure can be applied in various scenes without adding related polarization imaging hardware, and has better universality.
Drawings
In order to more clearly illustrate the technical solutions of the present specification or the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the prior art descriptions, it is obvious that the drawings in the following description are only some embodiments of the present specification, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of a living body detection system provided in the present specification;
FIG. 2 is a schematic flow chart of a living body detection method provided in the present specification;
FIG. 3 is a schematic flow chart of a polarization state image determination provided in the present specification;
FIG. 4 is a schematic diagram of a model training of a polarization diffusion model provided herein;
FIG. 5 is a schematic illustration of a model process provided herein;
FIG. 6 is a schematic flow chart of a polarization angle prediction provided in the present specification;
FIG. 7 is a model training schematic of a polarization angle prediction model provided herein;
fig. 8 is a schematic structural view of a living body detection apparatus provided in the present specification;
fig. 9 is a schematic structural view of an electronic device provided in the present specification;
FIG. 10 is a schematic diagram of the architecture of the operating system and user space provided herein;
FIG. 11 is an architecture diagram of the android operating system of FIG. 10;
FIG. 12 is an architecture diagram of the IOS operating system of FIG. 10.
Detailed Description
The following description of the embodiments of the present invention will be made apparent from, and elucidated with reference to, the drawings of the present specification, in which embodiments described are only some, but not all, embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
In the description of the present specification, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present specification, it should be noted that, unless expressly specified and limited otherwise, "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus. The specific meaning of the terms in this specification will be understood by those of ordinary skill in the art in the light of the specific circumstances. In addition, in the description of the present specification, unless otherwise indicated, "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
In the related art, a common living detection method is a silent living detection method that does not require additional interaction. The silence living body detection method carries out biological recognition and living body detection based on the collected user image under the natural state of the user, and does not need additional action interaction of the user. The method is easy to deploy and scale, and has good user experience, but in an actual application scene, the safety performance of the user image acquired in a silent state in living body detection is poor, and the method is difficult to apply to scenes with high safety requirements, such as financial scenes.
The present specification is described in detail below with reference to specific examples.
Please refer to fig. 1, which is a schematic diagram of a living body detection system provided in the present specification. As shown in fig. 1, the in-vivo detection system may include at least a client cluster and a service platform 100.
The client cluster may include at least one client, as shown in fig. 1, specifically including a client 1 corresponding to a user 1, a client 2 corresponding to a user 2, …, and a client n corresponding to a user n, where n is an integer greater than 0.
Each client in the client cluster may be a communication-enabled electronic device including, but not limited to: wearable devices, handheld devices, personal computers, tablet computers, vehicle-mounted devices, smart phones, computing devices, or other processing devices connected to a wireless modem, etc. Electronic devices in different networks may be called different names, for example: a user equipment, an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent or user equipment, a cellular telephone, a cordless telephone, a personal digital assistant (personal digital assistant, PDA), an electronic device in a 5G network or future evolution network, and the like.
The service platform 100 may be a separate server device, such as: rack-mounted, blade, tower-type or cabinet-type server equipment or hardware equipment with stronger computing capacity such as workstations, mainframe computers and the like is adopted; the server cluster may also be a server cluster formed by a plurality of servers, and each server in the server cluster may be formed in a symmetrical manner, wherein each server is functionally equivalent and functionally equivalent in a transaction link, and each server may independently provide services to the outside, and the independent provision of services may be understood as no assistance of another server is needed.
In one or more embodiments of the present disclosure, the service platform 100 may establish a communication connection with at least one client in the client cluster, and complete data interaction in a living body detection process based on the communication connection, such as online transaction data interaction, for example, the client may collect a target object image of a target object in an environment where the client is located, send the target object image to the service platform 100, and execute a living body attack prevention method corresponding to one or more embodiments of the present disclosure by the service platform 100 to perform a living body attack detection process; if the service platform 100 can instruct the client to execute the living body attack detection processing of the living body attack prevention method corresponding to one or more embodiments of the present specification;
It should be noted that, the service platform 100 establishes a communication connection with at least one client in the client cluster through a network for interactive communication, where the network may be a wireless network, or may be a wired network, where the wireless network includes, but is not limited to, a cellular network, a wireless local area network, an infrared network, or a bluetooth network, and the wired network includes, but is not limited to, an ethernet network, a universal serial bus (universal serial bus, USB), or a controller area network. In one or more embodiments of the specification, techniques and/or formats including HyperText Mark-up Language (HTML), extensible markup Language (Extensible Markup Language, XML), and the like are used to represent data exchanged over a network (e.g., target compression packages). All or some of the links may also be encrypted using conventional encryption techniques such as secure socket layer (Secure Socket Layer, SSL), transport layer security (Transport Layer Security, TLS), virtual private network (Virtual Private Network, VPN), internet protocol security (Internet Protocol Security, IPsec), and the like. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of or in addition to the data communication techniques described above.
The embodiment of the living body detection system provided in the present specification and the living body detection method in one or more embodiments belong to the same concept, and an execution subject corresponding to the living body detection method related in one or more embodiments in the present specification may be an electronic device, and the electronic device may be the service platform 100 described above; the execution subject corresponding to the living body detection method in one or more embodiments of the specification may also be an electronic device corresponding to a client, which is specifically determined based on an actual application environment. The implementation process of the embodiment of the living body detection system may be described in detail in the following method embodiments, which are not described herein.
Based on the schematic view of the scenario shown in fig. 1, the living body detection method provided in one or more embodiments of the present specification is described in detail below.
Referring to fig. 2, a flow diagram of a biopsy method that may be implemented in dependence on a computer program and that may be run on a von neumann system-based biopsy device is provided for one or more embodiments of the present description. The computer program may be integrated in the application or may run as a stand-alone tool class application. The living body detection device may be a service platform.
Specifically, the living body detection method comprises the following steps:
s102: collecting a target object image of a target object in a target environment;
it can be understood that the living body detection is a detection manner of determining the real physiological characteristics of the object in the scenes of some target environments such as an authentication scene, and in the image living body detection application, the image living body detection needs to verify whether the image is a real living body object operation based on the acquired target living body detection image. The image living body detection needs to effectively resist common living body attack means such as photos, face changing, masks, shielding, screen flipping and the like, so that the user is helped to discriminate fraudulent behaviors, and the rights and interests of the user are ensured;
the target object image may be understood as object image data corresponding to a certain mode type collected for a target object (such as a user, an animal, etc.) in an image living body detection scene;
the target environment may be understood as a physical environment in which a target object of the electronic device is located.
It can be appreciated that the several target object images acquired for the target object may have different image modality types in practical applications, and the image modality types may be a fitting of one or more of image modality types such as a video modality type carrying object information, a color picture modality (rgb) type, a small video modality type, an animation modality type, a depth image (depth) modality type, an infrared image (ir) modality type, a near infrared modality (NIR) type, and the like.
Illustratively, the target object image may be a color picture modality (rgb) type rgb image;
illustratively, in an actual application scenario, a target object image of a target object under a current target environment to be identified or detected may be acquired through a camera such as an RGB camera, a monocular camera, an infrared camera, etc. based on a corresponding living body detection task.
S104: determining a target object polarization state image for the target object based on the target object image;
illustratively, visible light is generally polarized at all angles, and in this specification the image of the target object is an image based on imaging the target object with visible light, and the image of the target object may be referred to as an unpolarized normal state image with respect to polarized light.
Further, the polarized light is light polarized in only one direction, and generally polarized light can be obtained by inputting visible light into a polarizer in a certain direction, and it is understood that an image obtained by imaging a target object based on polarized light can be referred to as a target object polarized state image or a target object polarized light image.
In the related art, for any object, polarized light imaging hardware support is required to acquire a polarized state image of the object, which clearly increases hardware cost; in this specification, it is possible to optimize such a manner that a polarized light imaging hardware is not used but a polarized state image of a target object is generated based on a visible light-based target object in a normal state
In this specification, a polarization diffusion model may be trained based on a machine learning model, and a target object polarization state image is generated based on a target object image or a target object image and a polarization angle as inputs of the polarization diffusion model.
From the imaging principle of visible light and polarized light, polarized light is a polarized image of visible light after polarized imaging, so that the polarized image corresponds to polarized images of a plurality of reference angles relative to a normal image based on the visible light;
alternatively, the input desired polarization angle and the target object image may indicate a diffuse polarization image to assist in generating a target object polarization state image of a specified polarization angle;
optionally, the input target object image is processed by a polarization diffusion model, and a target object polarization state image with a specified polarization angle or all polarization angles can be generated.
S106: performing in-vivo attack detection processing based on the target object image and the target object polarization state image to obtain a target detection type for the target object
Wherein the target detection type is one of a living body type and an attack type.
It can be understood that in the case of the target object image acquired based on the image acquisition device, the target object image is used as a normal state image, the target object polarization state image is generated based on the normal state target object image, the target object image of the normal state of the visible light and the target object polarization state image of the visible light polarization state are combined to form a multi-mode image combination, the multi-mode image combination can fully utilize the corresponding self-mode imaging characteristics of the normal state of the visible light and the visible light polarization state, the living body attack separability characteristics brought by two different light mode images can be exerted, the polarized state image is helpful for living body attack classification and identification of the living body detection of the image, and no additional polarized imaging component is needed to generate the polarized image, so that the safety performance is improved.
It should be noted that the machine learning Model according to one or more embodiments of the present disclosure includes, but is not limited to, fitting of one or more of a convolutional neural network (Convolutional Neural Network, CNN) Model, a deep neural network (Deep Neural Network, DNN) Model, a recurrent neural network (Recurrent Neural Networks, RNN), a Model, an embedding (embedding) Model, a gradient lifting decision tree (Gradient Boosting Decision Tree, GBDT) Model, a logistic regression (Logistic Regression, LR) Model, a Diffusion Model (DM) and the like.
In one or more embodiments of the present disclosure, an electronic device acquires a target object image of a target object in a target environment, then determines a target object polarization state image of the target object, and performs living attack detection processing by combining the target object image and the target object polarization state image, so that the living attack security capability of the target object can be improved by combining the polarization state image in a living detection scene, the living attack security detection effect is improved, the security performance is ensured, and meanwhile, the living detection method related to the application of the present disclosure can be applied in various scenes without adding related polarization imaging hardware, and has better universality.
Optionally, referring to fig. 3, fig. 3 is a schematic image of a polarization state image determination related to the present specification, where determining, based on the target object image, a target object polarization state image for the target object includes:
s2002: determining a recommended polarization angle for the target object;
the recommended polarization angle is an angle of polarized light which is easy to be detected by living bodies in the environment, and the effect of living bodies detection by using the polarized state image indicated by the recommended polarization angle is better than that of other polarization angles.
Optionally, one or more specified polarization angles may be set in advance as recommended polarization angles based on the living body detection environment, so that in practical application, one or more recommended polarization angles θ may be directly obtained;
alternatively, the preferred polarization angle can be predicted based on the environmental analysis of the target object image to determine the recommended polarization angle for the target object in the environment.
In one or more embodiments of the present disclosure, since the number of polarization angles of visible light is greater, in order to save living body detection time and improve the effect, the number of times of generating polarized images may be reduced by recommending the polarization angles.
S2004: and carrying out polarization imaging processing by adopting a polarization diffusion model based on the recommended polarization angle and the target object image to obtain a target object polarization state image corresponding to the recommended polarization angle.
It can be understood that the polarization diffusion model is trained by a machine learning model in advance, model deployment is performed after the training is completed, the recommended polarization angle and the target object image are used as the input of the diffusion polarization image in the actual application scene, and the polarization imaging processing is performed by adopting the polarization diffusion model, so that the target object polarization state image corresponding to the recommended polarization angle is output.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating a model training of a polarization diffusion model according to one or more embodiments of the present disclosure. Specific:
s202: creating an initial polarization diffusion model;
specifically, a machine learning model is used to create an initial polarization diffusion model based on the polarization image generation task, and illustratively, a diffusion model may be used to create an initial polarization diffusion model.
Illustratively, the diffusion model is used for model creation and training, compared with other machine learning models using the countermeasure generation network GAN, the machine learning model using the countermeasure generation network GAN is more effective and easier to implement in polarized image generation tasks, the mode collapse facing higher probability (namely, one image for all inputs and outputs) and quality instability are often detailed, and the initial polarized diffusion model is built by using the diffusion model creatively based on the link for generating polarized images, so that high-quality polarized images can be reconstructed.
S204: collecting a sample normal state image of a sample object and sample polarization state label images corresponding to a plurality of reference polarization angles;
the number of the sample objects can be multiple, namely, sample normal state images of the multiple sample objects and sample polarization state label images corresponding to different reference polarization angles are collected;
further, the image acquisition stage before model training:
collecting normal state images of a plurality of sample objects as sample normal state images, wherein the sample normal state images are images directly generated based on a visible light image generation principle, and collecting polarization state images of a plurality of polarization angles corresponding to the sample objects at the same time of collecting the sample normal state images, and the angle ranges are generally as follows: 1-360 degrees, collecting every i degrees (such as 5 degrees);
schematically, the normal state image of the sample and its corresponding sample polarization state image with a polarization angle θ are denoted as (x, x) 6 );
S206: training an initial polarization diffusion model based on the sample normal state image, the reference polarization angle and the sample polarization state label image corresponding to the reference polarization angle until the initial polarization diffusion model is trained, and obtaining a trained polarization diffusion model.
Specifically, for a polarized image generation task, how to generate a polarized image based on a normal image is needed to be considered without based on a training thought of an countermeasure generation network GAN, and for achieving the purpose, an initial polarization diffusion model is creatively used and a model processing architecture is built in the link;
illustratively, the training the initial polarization diffusion model based on the sample normal image, the reference polarization angle, and the sample polarization state label image corresponding to the reference polarization angle includes:
a2: performing at least one time of preamble noise processing by adopting the initial polarization diffusion model based on the sample normal state image and the sample polarization state label image to obtain a forward sample image sequence, wherein a queue head image of the forward sample image sequence is the sample normal state image, and a queue tail image of the forward sample image sequence is the sample polarization state label image;
further, the link model processing architecture concept at least can be: regarding the "generating a polarized image of a certain polarization angle based on a normal state image" as an optical noise processing process, the polarized image generating task is to acquire polarized light based on one angle direction to image to obtain the polarized image, while the imaging of a sample normal state image based on visible light retains optical imaging information of all the polarized light angles, that is, only retains any desired polarization angle for a certain sample object and optical imaging information of other polarization angles except the desired polarization angle can be regarded as optical noise information, for which, the model training structure idea of the initial polarization diffusion model can be converted into how to filter optical noise information of an undesired polarization angle from a sample normal state image retaining the optical information of all the polarization angles, so as to obtain optical polarization effective information of the desired polarization angle in the sample normal state image.
Further, in the image acquisition stage, a sample normal image x and a sample polarization state image x with a corresponding polarization angle theta are obtained 6 . Based on the sample normal state image x and the sample polarization state image x 6 To construct a forward sample image sequence of the initial polarization diffusion model; through the process of
The forward sample image sequence is defined herein as the secondary sample polarization state image x 6 A sequence of several images up to the sample normal state image x; defining a sample polarization state image x at a certain polarization angle θ 6 The sample normal state image x can be finally obtained through adding noise to the sample normal state image x (namely simulating the noise adding process of the optical noise information) by T times of accumulation, the image obtained by adding noise every time is taken as the middle noise adding image of the forward sample image sequence, the quantity of the middle noise adding images is T-2, T is a positive integer, and thus the sample polarization state label image x which is formed by taking the first image as the sample normal state image x+T-2 middle noise adding images and taking the last image as the sample polarization state label image x is obtained 6 "sequence of forward sample images.
Referring to FIG. 5, schematically, FIG. 5 is an illustration of a model process according to the present specificationThe intention is to determine the top image x of the team using the initial polarization diffusion model, as shown in FIG. 5 0 For the sample normal state image x and the end-of-queue image x T For the sample polarization state label image x 6 Then, taking the sample normal state image x as a starting signal and the sample polarization state label image x 6 To finish at least one preamble noise processing process of the signal, each preamble noise processing is performed to obtain an intermediate noise image { x } 1 ...x t-1 、x t 、x t+1 -a }; visual interpretation of model processing of the initial polarization diffusion model: in a sample polarization state image x at a certain polarization angle theta 6 Continuously adding noise to accumulate optical noise information until the optical noise information is integrated with a sample polarization state label image x 6 Consistent;
it will be appreciated that the amount of noise added per time during the forward noise adding process is based on the sample polarization state label image x known as the start signal 6 And the sample normal image x of the end signal. The noise adding amount of each round can be random, and the method only needs to meet the condition that the image after the accumulated optical noise information is equal to the sample normal state image x when the noise adding is finished, for example, the method can be used for constructing the noise adder based on the sample polarization state label image x 6 And taking the sample normal state image x as the input of the noise adder, outputting a plurality of intermediate noise adding images, and obtaining a forward sample image sequence.
A4: controlling the initial polarization diffusion model to perform inverse denoising processing on the forward sample image sequence based on the reference polarization angle to obtain a sample polarization state prediction image of the reference polarization angle corresponding to each sequence image in the forward sample image sequence;
Illustratively, the internal structure of the initial polarization diffusion model constructed based on the diffusion model can be regarded as at least one denoising encoder, and the structure of the denoising encoder can be UNET type, for example;
further, the model training process of the initial polarization diffusion model is that the denoising encoder performs inverse denoising on the images in the forward sample image sequence, and each sequence image and the reference (corresponding to the sample polarization state label image) in the forward sample image sequencePolarization angle (theta) i ) Is an input processing object of each round of model training process, and controls a denoising encoder of an initial polarization diffusion model to perform T times of inverse denoising encoding processing on each sequence image in a forward sample image sequence, so as to obtain a reference polarization angle (theta) corresponding to each sequence image i ) The corresponding sample polarization state prediction images are assumed to be m (m is smaller than or equal to T), m sample polarization state prediction images are obtained, and the m sample polarization state prediction images are used as monitoring signals for model training based on first model loss in each model training process until a polarization diffusion model with complete training is obtained;
alternatively, in the model training process, the sample polarization state label image x of the head of the queue in the forward sample image sequence of each round can be used for 6 Performing removal processing based on the removed sample polarization state label image x 6 Forward of the T-1 sequence images later.
A6: calculating a first model loss for the forward sample image sequence based on the sample polarization state prediction image and the sample polarization state label image, and parameter adjustment of the initial polarization diffusion model using the first model loss
Specifically, the calculating the first model loss for the forward sample image sequence based on the sample polarization state prediction image and the sample polarization state label image may be:
and calculating first Euclidean distance loss of the sample polarization state prediction image and the sample polarization state label image corresponding to each sequence image in the forward sample image sequence, and determining a first model loss based on the first Euclidean distance loss.
The first Euclidean distance loss satisfies the following formula:
Loss s=L 2 (x,x_recovery)
wherein the Loss s represents a first Euclidean distance Loss, the L 2 Representing Euclidean distance operation processing, wherein x is the sample polarization state label image, and x_recovery is a sample polarization state prediction image corresponding to the sequence image;
alternatively, the sum of all the first euclidean distance losses may be taken as the first model loss.
It can be understood that the initial polarization diffusion model is subjected to network training based on the model structure and the first model loss to adjust model parameters until the model finishing training condition is met, and a trained polarization diffusion model can be obtained.
Alternatively, the model-ending training condition may include, for example, the value of the loss function being less than or equal to a preset loss function threshold, the number of iterations reaching a preset number of times threshold, and so on. The specific model end training conditions may be determined based on actual conditions and are not specifically limited herein.
In one or more embodiments of the present disclosure, using the foregoing method to optimize the traditional pattern collapse (one image for all inputs and outputs) and quality instability caused by the countermeasure generation network (GAN), a high quality polarized image can be reconstructed by creating an initial polarization diffusion model using the diffusion model in the polarized image generation for polarized image generation.
Optionally, the electronic device performing the determining the recommended polarization angle for the target object may be:
and carrying out polarization angle prediction processing by adopting a polarization angle prediction model based on the target object image to obtain a recommended polarization angle for the target object.
Specifically, the environment adopts a polarization angle prediction model to perform environment analysis and prediction on the optimal polarization angle based on the target object image so as to determine the recommended polarization angle for the target object in the environment.
It can be understood that the polarization angle prediction model is trained in advance based on the machine learning model, model deployment is performed after training is completed, a target object image is used as input of the polarization angle prediction model in an actual application scene, and polarization angle prediction processing is performed by adopting the polarization angle prediction model, so that a recommended polarization angle for the target object is output.
Referring to fig. 6, fig. 6 is a schematic flow chart of polarization angle prediction, specifically:
s302: creating an initial polarization angle prediction model;
specifically, a machine learning model is adopted to create an initial polarization diffusion model based on a polarization angle prediction task;
it can be understood that in the generation of the polarized image, the polarized images of various polarized angles can be generated based on the normal state image, and here, the optimal polarized angle is judged according to the environment by training the polarized angle prediction model, so that the generation times in the generation of the polarized image are reduced, and the efficiency is improved.
S304: collecting a sample normal state image of a sample object, and labeling a recommended polarization angle label of the sample normal state image in a sample environment;
the sample normal state image can be training data of the polarization diffusion model in a model training stage, and a recommended polarization angle label of the sample normal state image in a sample environment is marked at the same time, namely, an expert terminal service can be adopted to analyze the recommended polarization angle of the sample normal state image in the sample environment as the recommended polarization angle label.
S306: and training the initial polarization angle prediction model based on the sample normal state image and the recommended polarization angle label until the initial polarization angle prediction model is trained, so as to obtain a trained polarization angle prediction model.
Illustratively, an internal model structure of an initial polarization angle prediction model, e.g., an initial polarization angle prediction model such as a ResNet50 model structure, may be constructed based on a machine learning model/network;
illustratively, training the initial polarization angle prediction model based on the sample normal image and the recommended polarization angle label may be:
b2, inputting the sample normal state image into the initial polarization angle prediction model, and performing recommended polarization angle prediction processing by the initial polarization angle prediction model, wherein the initial polarization angle prediction model can predict a better polarization angle under the environment where the object is located by environment image information in the sample normal state image so as to obtain a predicted recommended polarization angle under the sample environment;
And B4, calculating a second model loss based on the predicted recommended polarization angle and the recommended polarization angle label, and carrying out parameter adjustment on the initial polarization angle prediction model by adopting the second model loss.
The second model loss is the model loss of the initial polarization angle prediction model in the model training stage;
further, the calculating a second model loss based on the predicted recommended polarization angle and the recommended polarization angle label may be:
and calculating a second Euclidean distance loss of the predicted recommended polarization angle and the recommended polarization angle label, and taking the second Euclidean distance loss as a second model loss.
The second Euclidean distance loss satisfies the following formula:
Loss m=L 2 (p,theta)
wherein the Loss m represents a second Euclidean distance Loss, the L 2 Representing Euclidean distance operation processing, wherein p is the predicted recommended polarization angle, and theta is the recommended polarization angle label;
schematically, the second Euclidean distance loss is used as a monitoring signal to monitor model training in each model training process, and the model parameters of the initial polarization angle prediction model are reversely transmitted and adjusted by combining the second model loss until the model finishing training condition is met, so that the trained polarization angle prediction model can be obtained.
In one or more embodiments of the present disclosure, in the generation of the polarized image, polarized images of various types of polarized angles may be generated based on the normal image, where by training the polarized angle prediction model, it is achieved that a preferred polarized angle for the object is determined according to environmental information indicated by the normal image, and the number of times of generation in the generation of the polarized image is reduced based on the recommended polarized angle, thereby improving efficiency.
Optionally, the performing, by the electronic device, the living body attack detection processing based on the target object image and the target object polarization state image to obtain a target detection type for the target object may be:
and performing living body attack detection processing by adopting a living body attack prevention model based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
Referring to fig. 7, fig. 7 is a schematic diagram of model training of a polarization angle prediction model, specifically:
s402: creating an initial living body anti-attack model;
schematically, an initial living body anti-attack model for living body detection based on a normal state image and a polarized state image is created in advance based on a machine learning model, and an internal model structure of the initial living body anti-attack model is built;
S404: acquiring a sample normal state image and a sample polarization state image of a sample object, and labeling a sample living body classification result label of the sample object;
the sample normal state image and the sample polarization state image can be sample training data of the one or more models in a model training stage, and sample living body classification result labels aiming at sample objects are marked at the same time;
illustratively, the sample in-vivo classification result label is typically a sample in-vivo classification probability P;
s406: training the initial living body anti-attack model based on the sample normal state image, the sample polarization state image and the sample living body classification result label until the initial living body anti-attack model is trained, and obtaining a trained living body anti-attack model.
Illustratively, the training the initial living body anti-attack model based on the sample normal state image, the sample polarization state image and the sample living body classification result label may be:
inputting the sample normal state image and the sample polarized state image into an initial living body anti-attack model to determine sample normal state image characteristics and normal state living body classification results based on the sample normal state image, sample polarized state image characteristics and polarized state living body classification results based on the sample polarized state image, sample image residual characteristics and residual state classification results based on the sample polarized state image and the sample polarized state image, and sample fusion image characteristics and fusion state classification results based on the sample normal state image characteristics, sample polarized state image characteristics and sample image residual characteristics;
Illustratively, an internal model structure of an initial in-vivo anti-attack model of a corresponding reference modality type may be constructed based on a machine learning model/network, e.g., the initial in-vivo anti-attack model may include at least four parts, as follows:
the first part is a normal state feature coding module, the processing object is a sample normal state image feature, the normal state feature coding module performs feature extraction coding on the sample normal state image feature and performs living body attack detection to obtain a sample normal state image feature and a normal state living body classification result, namely, the processing result of the normal state feature coding module is the sample normal state image feature and the normal state living body classification result (for example, the processing result can be a living body attack probability);
the second part is a polarization state feature coding module, the processing object of the polarization state feature coding module is a sample polarization state image feature, the polarization state feature coding module performs feature extraction coding on the sample polarization state image feature and performs living body attack detection to obtain a sample polarization state image feature and a polarization state living body classification result, namely the processing result of the polarization state feature coding module is the sample polarization state image feature and the polarization state living body classification result (for example, the processing result can be a living body attack probability);
The third part is a residual feature coding module, the processing object of the residual feature coding module is a sample normal state image feature and a sample polarization state image feature, the residual feature coding module obtains a sample image residual feature by carrying out difference matching on the sample normal state image feature and the sample polarization state image feature, and then living body detection is carried out based on the sample image residual feature to obtain a residual state classification result (such as living body attack probability);
the fourth part is a feature fusion module, wherein the processing object of the feature fusion module is a sample normal state image feature, a sample polarization state image feature and a sample image residual feature, the feature fusion module is used for carrying out feature fusion on the sample normal state image feature, the sample polarization state image feature and the sample image residual feature to obtain a sample fusion image feature, and living body detection is carried out on the sample fusion image feature to obtain a fusion state classification result (such as living body attack probability);
illustratively, in the model training process of the initial living body anti-attack model of each round, a plurality of sample classification results (for example, a living body attack probability) are output based on the model training process, and in the actual application deployment stage, the trained living body anti-attack model outputs a comprehensive classification result (for example, a comprehensive classification result is obtained by carrying out average calculation processing on the plurality of sample classification results) based on the plurality of sample classification results;
And C4, calculating a third model loss based on the normal living body classification result, the polarized living body classification result, the residual state classification result, the fusion state classification result and the sample living body classification result label, and carrying out parameter adjustment on the initial living body anti-attack model by adopting the third model loss.
Illustratively, the calculating the third model loss based on the normal living body classification result, the polarized living body classification result, the residual state classification result, the fusion state classification result, and the sample living body classification result label may be:
specifically, calculating normal living body classification loss based on the normal living body classification result and the sample living body classification result label; calculating a polarization state living body classification loss based on the polarization state living body classification result and the sample living body classification result label; calculating residual living body classification loss based on the residual state classification result and the sample living body classification result label; calculating fusion living body classification loss based on the fusion state classification result and the sample living body classification result label;
alternatively, the used relevant classification Loss function such as the "Cross Entropy Loss" cross entropy Loss function, the "Hinge Loss function, etc. may be the" Hinge Loss "function, the" Loss of polarization "living body classification Loss, the residual living body classification Loss, the fusion living body classification Loss, etc.
For example, taking the classification loss function as an example of the cross entropy loss function, the normal living body classification loss, the polarization state living body classification loss, the residual living body classification loss, and the fusion living body classification loss can be expressed as follows:
the normal living body classification loss is obtained based on the following calculation formula:
Loss normal =CrossEntropy(p1,y)
further, the living body classification loss is obtained based on the following calculation formula, as follows:
Loss polar =CrossEntropy(p2,y)
further, the living body classification loss is obtained based on the following calculation formula, as follows:
Loss residual =CrossEntropy(p3,y)
further, the living body classification loss is obtained based on the following calculation formula, as follows:
Loss fusion =CrossEntropy(p4,y)
wherein, p1 is: normal living body classification result, p2 is: the polarization state living body classification result, p3 is: residual state classification results, p4 is: fusion state classification result, y is: a sample living body classification result label;
specifically, a third model loss is obtained based on the normal-state living organism classification loss, the polarization-state living organism classification loss, the residual living organism classification loss, and the fusion living organism classification loss.
Further, the third model loss may be calculated based on the following equation:
wherein the Loss is total Is the third model Loss, the Loss normal Is the normal living body classification Loss, the Loss polar Is the living body classification Loss of the polarization state, the Loss residual Is the residual living body classification Loss, the Loss fusion Is the fusion living body classification loss;
it can be understood that the initial living body anti-attack model is subjected to network training based on the model structure and the third model loss to adjust model parameters until the model finishing training condition is met, and then the trained living body anti-attack model can be obtained.
In one or more embodiments of the present disclosure, the normal-state image and the polarized-state image have higher living body attack separability, and the imaging characteristics of the optical image between the visible light and the polarized light are fully utilized, so that the image living body detection performed on the target object can have a good characteristic characterization effect, the accurate living body detection classification can be realized, the better living body attack detection effect is achieved, and the generalization capability of the image living body detection is improved;
the living body detection apparatus provided in the present specification will be described in detail with reference to fig. 8. The living body detection apparatus shown in fig. 8 is used to perform the method according to the embodiment shown in fig. 1 to 7 of the present specification, and for convenience of explanation, only the portion relevant to the present specification is shown, and specific technical details are not disclosed, and reference is made to the embodiment shown in fig. 1 to 7 of the present specification.
Referring to fig. 8, a schematic structural diagram of the living body detection apparatus of the present specification is shown. The living body detection apparatus 1 may be implemented as all or a part of the user terminal by software, hardware, or a combination of both. According to some embodiments, the living body detection apparatus 1 includes an object image acquisition module 11, a polarized image determination module 12, and a living body attack detection module 13, specifically for:
the object image acquisition module 11 is used for acquiring a target object image of a target object in a target environment;
a polarization image determination module 12 for determining a target object polarization state image for the target object based on the target object image;
the living body attack detection module 13 is configured to perform living body attack detection processing based on the target object image and the target object polarization state image, so as to obtain a target detection type for the target object.
Optionally, the polarized image determining module 12 is configured to:
determining a recommended polarization angle for the target object;
and carrying out polarization imaging processing by adopting a polarization diffusion model based on the recommended polarization angle and the target object image to obtain a target object polarization state image corresponding to the recommended polarization angle.
Optionally, the polarized image determining module 12 is configured to: creating an initial polarization diffusion model;
collecting a sample normal state image of a sample object and sample polarization state label images corresponding to a plurality of reference polarization angles;
training an initial polarization diffusion model based on the sample normal state image, the reference polarization angle and the sample polarization state label image corresponding to the reference polarization angle until the initial polarization diffusion model is trained, and obtaining a trained polarization diffusion model.
Optionally, the polarized image determining module 12 is configured to:
performing at least one time of preamble noise processing by adopting the initial polarization diffusion model based on the sample normal state image and the sample polarization state label image to obtain a forward sample image sequence, wherein a queue head image of the forward sample image sequence is the sample normal state image, and a queue tail image of the forward sample image sequence is the sample polarization state label image;
controlling the initial polarization diffusion model to perform inverse denoising processing on the forward sample image sequence based on the reference polarization angle to obtain a sample polarization state prediction image of the reference polarization angle corresponding to each sequence image in the forward sample image sequence;
And calculating a first model loss for the forward sample image sequence based on the sample polarization state prediction image and the sample polarization state label image, and carrying out parameter adjustment on the initial polarization diffusion model by adopting the first model loss.
Optionally, the polarized image determining module 12 is configured to:
and calculating first Euclidean distance loss of the sample polarization state prediction image and the sample polarization state label image corresponding to each sequence image in the forward sample image sequence, and determining a first model loss based on the first Euclidean distance loss.
Optionally, the polarized image determining module 12 is configured to:
and carrying out polarization angle prediction processing by adopting a polarization angle prediction model based on the target object image to obtain a recommended polarization angle for the target object.
Optionally, the polarized image determining module 12 is configured to:
creating an initial polarization angle prediction model;
collecting a sample normal state image of a sample object, and labeling a recommended polarization angle label of the sample normal state image in a sample environment;
and training the initial polarization angle prediction model based on the sample normal state image and the recommended polarization angle label until the initial polarization angle prediction model is trained, so as to obtain a trained polarization angle prediction model.
Optionally, the polarized image determining module 12 is configured to:
inputting the sample normal state image into the initial polarization angle prediction model to obtain a predicted recommended polarization angle in a sample environment;
and calculating a second model loss based on the predicted recommended polarization angle and the recommended polarization angle label, and carrying out parameter adjustment on the initial polarization angle prediction model by adopting the second model loss.
Optionally, the polarized image determining module 12 is configured to:
and calculating a second Euclidean distance loss of the predicted recommended polarization angle and the recommended polarization angle label, and taking the second Euclidean distance loss as a second model loss.
Optionally, the living body attack detection module 13 is configured to:
and performing living body attack detection processing by adopting a living body attack prevention model based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
Optionally, the living body attack detection module 13 is configured to:
creating an initial living body anti-attack model;
acquiring a sample normal state image and a sample polarization state image of a sample object, and labeling a sample living body classification result label of the sample object;
Training the initial living body anti-attack model based on the sample normal state image, the sample polarization state image and the sample living body classification result label until the initial living body anti-attack model is trained, and obtaining a trained living body anti-attack model.
Optionally, the living body attack detection module 13 is configured to:
inputting the sample normal state image and the sample polarization state image into an initial living body anti-attack model to determine a sample normal state image feature and a normal state living body classification result based on the sample normal state image, and a sample polarization state image feature and a polarization state living body classification result based on the sample polarization state image, and a sample image residual feature and a residual state classification result based on the sample polarization state image and the sample polarization state image, and a sample fusion image feature and a fusion state classification result based on the sample normal state image feature, the sample polarization state image feature and the sample image residual feature;
and calculating a third model loss based on the normal living body classification result, the polarization state living body classification result, the residual state classification result, the fusion state classification result and the sample living body classification result label, and adopting the third model loss to carry out parameter adjustment on the initial living body anti-attack model.
Optionally, the living body attack detection module 13 is configured to:
calculating normal living body classification loss based on the normal living body classification result and the sample living body classification result label; calculating a polarization state living body classification loss based on the polarization state living body classification result and the sample living body classification result label; calculating residual living body classification loss based on the residual state classification result and the sample living body classification result label; calculating fusion living body classification loss based on the fusion state classification result and the sample living body classification result label;
and obtaining a third model loss based on the normal-state living body classification loss, the polarization-state living body classification loss, the residual living body classification loss and the fusion living body classification loss.
It should be noted that, when the living body detection apparatus provided in the foregoing embodiment performs the living body detection method, only the division of the foregoing functional modules is exemplified, and in practical application, the foregoing functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the living body detection device and the living body detection method provided in the foregoing embodiments belong to the same concept, which embody the implementation process in detail with reference to the method embodiment, and are not described herein again.
The foregoing description is provided for the purpose of illustration only and does not represent the advantages or disadvantages of the embodiments.
In one or more embodiments of the present disclosure, an electronic device acquires a target object image of a target object in a target environment, then determines a target object polarization state image of the target object, and performs living attack detection processing by combining the target object image and the target object polarization state image, so that the living attack security capability of the target object can be improved by combining the polarization state image in a living detection scene, the living attack security detection effect is improved, the security performance is ensured, and meanwhile, the living detection method related to the application of the present disclosure can be applied in various scenes without adding related polarization imaging hardware, so that the living attack security detection method has better universality.
The present disclosure further provides a computer storage medium, where a plurality of instructions may be stored, where the instructions are adapted to be loaded by a processor and executed by the living body detection method according to the embodiment shown in fig. 1 to 7, and the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to 7, which is not repeated herein.
The present disclosure further provides a computer program product, where at least one instruction is stored, where the at least one instruction is loaded by the processor and executed by the processor, where the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to 7, and details are not repeated herein.
Referring to fig. 9, a block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown. The electronic device in this specification may include one or more of the following: processor 110, memory 120, input device 130, output device 140, and bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and lines to connect various portions of the overall electronic device, perform various functions of the electronic device 100, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in at least one hardware form of digital signal processing (digital signal processing, DSP), field-programmable gate array (field-programmable gate array, FPGA), programmable logic array (programmable logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processor (central processing unit, CPU), an image processor (graphics processing unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The memory 120 may include a random access memory (random Access Memory, RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, which may be an Android (Android) system, including an Android system-based deep development system, an IOS system developed by apple corporation, including an IOS system-based deep development system, or other systems, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the electronic device in use, such as phonebooks, audiovisual data, chat log data, and the like.
Referring to FIG. 10, the memory 120 may be divided into an operating system space in which the operating system is running and a user space in which native and third party applications are running. In order to ensure that different third party application programs can achieve better operation effects, the operating system allocates corresponding system resources for the different third party application programs. However, the requirements of different application scenarios in the same third party application program on system resources are different, for example, under the local resource loading scenario, the third party application program has higher requirement on the disk reading speed; in the animation rendering scene, the third party application program has higher requirements on the GPU performance. The operating system and the third party application program are mutually independent, and the operating system often cannot timely sense the current application scene of the third party application program, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third party application program.
In order to enable the operating system to distinguish specific application scenes of the third-party application program, data communication between the third-party application program and the operating system needs to be communicated, so that the operating system can acquire current scene information of the third-party application program at any time, and targeted system resource adaptation is performed based on the current scene.
Taking an operating system as an Android system as an example, as shown in fig. 11, a program and data stored in the memory 120 may be stored in the memory 120 with a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360 and an application layer 380, where the Linux kernel layer 320, the system runtime library layer 340 and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space. The Linux kernel layer 320 provides the underlying drivers for various hardware of the electronic device, such as display drivers, audio drivers, camera drivers, bluetooth drivers, wi-Fi drivers, power management, and the like. The system runtime layer 340 provides the main feature support for the Android system through some C/c++ libraries. For example, the SQLite library provides support for databases, the OpenGL/ES library provides support for 3D graphics, the Webkit library provides support for browser kernels, and the like. Also provided in the system runtime library layer 340 is a An Zhuoyun runtime library (Android run) which provides mainly some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used in building applications, which developers can also build their own applications by using, for example, campaign management, window management, view management, notification management, content provider, package management, call management, resource management, location management. At least one application program is running in the application layer 380, and these application programs may be native application programs of the operating system, such as a contact program, a short message program, a clock program, a camera application, etc.; and may also be a third party application developed by a third party developer, such as a game-like application, instant messaging program, photo beautification program, etc.
Taking an operating system as an IOS system as an example, the program and data stored in the memory 120 are shown in fig. 12, the IOS system includes: core operating system layer 420 (Core OS layer), core service layer 440 (Core Services layer), media layer 460 (Media layer), and touchable layer 480 (Cocoa Touch Layer). The core operating system layer 420 includes an operating system kernel, drivers, and underlying program frameworks that provide more hardware-like functionality for use by the program frameworks at the core services layer 440. The core services layer 440 provides system services and/or program frameworks required by the application, such as a Foundation (Foundation) framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a sports framework, and the like. The media layer 460 provides an interface for applications related to audiovisual aspects, such as a graphics-image related interface, an audio technology related interface, a video technology related interface, an audio video transmission technology wireless play (AirPlay) interface, and so forth. The touchable layer 480 provides various commonly used interface-related frameworks for application development, with the touchable layer 480 being responsible for user touch interactions on the electronic device. Such as a local notification service, a remote push service, an advertisement framework, a game tool framework, a message User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
Among the frameworks illustrated in fig. 9, frameworks related to most applications include, but are not limited to: the infrastructure in core services layer 440 and the UIKit framework in touchable layer 480. The infrastructure provides many basic object classes and data types, providing the most basic system services for all applications, independent of the UI. While the class provided by the UIKit framework is a basic UI class library for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides the infrastructure for applications to build user interfaces, draw, process and user interaction events, respond to gestures, and so on.
The manner and principle of implementing data communication between the third party application program and the operating system in the IOS system may refer to the Android system, and this description is not repeated here.
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 used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are a touch display screen for receiving a touch operation thereon or thereabout by a user using a finger, a touch pen, or any other suitable object, and displaying a user interface of each application program. Touch display screens are typically provided on the front panel of an electronic device. The touch display screen may be designed as a full screen, a curved screen, or a contoured screen. The touch display screen can also be designed to be a combination of a full screen and a curved screen, and a combination of a special-shaped screen and a curved screen is not limited in this specification.
In addition, those skilled in the art will appreciate that the configuration of the electronic device shown in the above-described figures does not constitute a limitation of the electronic device, and the electronic device may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the electronic device further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (wireless fidelity, wiFi) module, a power supply, and a bluetooth module, which are not described herein.
In this specification, the execution subject of each step may be the electronic device described above. Optionally, the execution subject of each step is an operating system of the electronic device. The operating system may be an android system, an IOS system, or other operating systems, which is not limited in this specification.
The electronic device of the present specification may further have a display device mounted thereon, and the display device may be various devices capable of realizing a display function, for example: cathode ray tube displays (cathode ray tubedisplay, CR), light-emitting diode displays (light-emitting diode display, LED), electronic ink screens, liquid crystal displays (liquid crystal display, LCD), plasma display panels (plasma display panel, PDP), and the like. A user may utilize a display device on electronic device 101 to view displayed text, images, video, etc. The electronic device may be a smart phone, tablet computer, gaming device, AR (Augmented Reality ) device, automobile, data storage, audio playback, video playback, notebook, desktop computing device, server device, wearable device (such as electronic watch, electronic glasses, electronic helmet, electronic bracelet, electronic necklace, electronic clothing), etc.
In the electronic device shown in fig. 9, where the electronic device may be a terminal, the processor 110 may be configured to invoke an application program stored in the memory 120 and specifically perform the following operations:
collecting a target object image of a target object in a target environment;
determining a target object polarization state image for the target object based on the target object image;
and performing living body attack detection processing based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
In one embodiment, the processor 110, in performing the determining a target object polarization state image for the target object based on the target object image, performs the steps of:
determining a recommended polarization angle for the target object;
and carrying out polarization imaging processing by adopting a polarization diffusion model based on the recommended polarization angle and the target object image to obtain a target object polarization state image corresponding to the recommended polarization angle.
In one embodiment, the processor 110, when executing the living body detection method, further performs the steps of:
creating an initial polarization diffusion model;
Collecting a sample normal state image of a sample object and sample polarization state label images corresponding to a plurality of reference polarization angles;
training an initial polarization diffusion model based on the sample normal state image, the reference polarization angle and the sample polarization state label image corresponding to the reference polarization angle until the initial polarization diffusion model is trained, and obtaining a trained polarization diffusion model.
In one embodiment, the processor 110 performs the following steps in performing the training of the initial polarization diffusion model based on the sample normal image, the reference polarization angle, and the sample polarization state label image corresponding to the reference polarization angle:
performing at least one time of preamble noise processing by adopting the initial polarization diffusion model based on the sample normal state image and the sample polarization state label image to obtain a forward sample image sequence, wherein a queue head image of the forward sample image sequence is the sample normal state image, and a queue tail image of the forward sample image sequence is the sample polarization state label image;
controlling the initial polarization diffusion model to perform inverse denoising processing on the forward sample image sequence based on the reference polarization angle to obtain a sample polarization state prediction image of the reference polarization angle corresponding to each sequence image in the forward sample image sequence;
And calculating a first model loss for the forward sample image sequence based on the sample polarization state prediction image and the sample polarization state label image, and carrying out parameter adjustment on the initial polarization diffusion model by adopting the first model loss.
In one embodiment, the processor 110, in performing the calculating the first model loss for the forward sample image sequence based on the sample polarization state prediction image and the sample polarization state label image, performs the steps of:
and calculating first Euclidean distance loss of the sample polarization state prediction image and the sample polarization state label image corresponding to each sequence image in the forward sample image sequence, and determining a first model loss based on the first Euclidean distance loss.
In one embodiment, the processor 110, in performing the determining the recommended polarization angle for the target object, performs the steps of:
and carrying out polarization angle prediction processing by adopting a polarization angle prediction model based on the target object image to obtain a recommended polarization angle for the target object.
In one embodiment, the processor 110, when executing the living body detection method, further performs the steps of:
Creating an initial polarization angle prediction model;
collecting a sample normal state image of a sample object, and labeling a recommended polarization angle label of the sample normal state image in a sample environment;
and training the initial polarization angle prediction model based on the sample normal state image and the recommended polarization angle label until the initial polarization angle prediction model is trained, so as to obtain a trained polarization angle prediction model.
In one embodiment, the processor 110 performs the following steps in performing the training of the initial polarization angle prediction model based on the sample normal image and the recommended polarization angle label:
inputting the sample normal state image into the initial polarization angle prediction model to obtain a predicted recommended polarization angle in a sample environment;
and calculating a second model loss based on the predicted recommended polarization angle and the recommended polarization angle label, and carrying out parameter adjustment on the initial polarization angle prediction model by adopting the second model loss.
In one embodiment, the processor 110, in performing the calculating a second model loss based on the predicted and the recommended polarization angle labels, performs the steps of:
And calculating a second Euclidean distance loss of the predicted recommended polarization angle and the recommended polarization angle label, and taking the second Euclidean distance loss as a second model loss.
In one embodiment, the processor 110 performs the in-vivo attack detection process based on the target object image and the target object polarization state image to obtain a target detection type for the target object, including:
and performing living body attack detection processing by adopting a living body attack prevention model based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
In one embodiment, the processor 110, when executing the living body detection method, further performs the steps of:
creating an initial living body anti-attack model;
acquiring a sample normal state image and a sample polarization state image of a sample object, and labeling a sample living body classification result label of the sample object;
training the initial living body anti-attack model based on the sample normal state image, the sample polarization state image and the sample living body classification result label until the initial living body anti-attack model is trained, and obtaining a trained living body anti-attack model.
In one embodiment, the processor 110 performs the following steps in performing the training of the initial in-vivo anti-attack model based on the sample normal image, the sample polarization state image, and the sample in-vivo classification result label:
inputting the sample normal state image and the sample polarization state image into an initial living body anti-attack model to determine a sample normal state image feature and a normal state living body classification result based on the sample normal state image, and a sample polarization state image feature and a polarization state living body classification result based on the sample polarization state image, and a sample image residual feature and a residual state classification result based on the sample polarization state image and the sample polarization state image, and a sample fusion image feature and a fusion state classification result based on the sample normal state image feature, the sample polarization state image feature and the sample image residual feature;
and calculating a third model loss based on the normal living body classification result, the polarization state living body classification result, the residual state classification result, the fusion state classification result and the sample living body classification result label, and adopting the third model loss to carry out parameter adjustment on the initial living body anti-attack model.
In one embodiment, the processor 110 performs the following steps in performing the calculation of a third model loss based on the normal state living body classification result, the polarization state living body classification result, the residual state classification result, the fusion state classification result, and the sample living body classification result label:
calculating normal living body classification loss based on the normal living body classification result and the sample living body classification result label; calculating a polarization state living body classification loss based on the polarization state living body classification result and the sample living body classification result label; calculating residual living body classification loss based on the residual state classification result and the sample living body classification result label; calculating fusion living body classification loss based on the fusion state classification result and the sample living body classification result label;
and obtaining a third model loss based on the normal-state living body classification loss, the polarization-state living body classification loss, the residual living body classification loss and the fusion living body classification loss.
In one or more embodiments of the present disclosure, an electronic device acquires a target object image of a target object in a target environment, then determines a target object polarization state image of the target object, and performs living attack detection processing by combining the target object image and the target object polarization state image, so that the living attack security capability of the target object can be improved by combining the polarization state image in a living detection scene, the living attack security detection effect is improved, the security performance is ensured, and meanwhile, the living detection method related to the application of the present disclosure can be applied in various scenes without adding related polarization imaging hardware, and has better universality.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.
It should be noted that, information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals according to the embodiments of the present disclosure are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, object features, interactive behavior features, user information, and the like referred to in this specification are all acquired with sufficient authorization.
The foregoing disclosure is only illustrative of the preferred embodiments of the present invention and is not to be construed as limiting the scope of the claims, which follow the meaning of the claims of the present invention.

Claims (17)

1. A method of in vivo detection, the method comprising:
collecting a target object image of a target object in a target environment;
determining a target object polarization state image for the target object based on the target object image;
and performing living body attack detection processing based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
2. The method of claim 1, the determining a target object polarization state image for the target object based on the target object image, comprising:
determining a recommended polarization angle for the target object;
and carrying out polarization imaging processing by adopting a polarization diffusion model based on the recommended polarization angle and the target object image to obtain a target object polarization state image corresponding to the recommended polarization angle.
3. The method of claim 2, the method further comprising:
creating an initial polarization diffusion model;
collecting a sample normal state image of a sample object and sample polarization state label images corresponding to a plurality of reference polarization angles;
training an initial polarization diffusion model based on the sample normal state image, the reference polarization angle and the sample polarization state label image corresponding to the reference polarization angle until the initial polarization diffusion model is trained, and obtaining a trained polarization diffusion model.
4. The method of claim 3, the training an initial polarization diffusion model based on the sample normal image, the reference polarization angle, and a sample polarization state label image corresponding to the reference polarization angle, comprising:
performing at least one time of preamble noise processing by adopting the initial polarization diffusion model based on the sample normal state image and the sample polarization state label image to obtain a forward sample image sequence, wherein a queue head image of the forward sample image sequence is the sample normal state image, and a queue tail image of the forward sample image sequence is the sample polarization state label image;
controlling the initial polarization diffusion model to perform inverse denoising processing on the forward sample image sequence based on the reference polarization angle to obtain a sample polarization state prediction image of the reference polarization angle corresponding to each sequence image in the forward sample image sequence;
and calculating a first model loss for the forward sample image sequence based on the sample polarization state prediction image and the sample polarization state label image, and carrying out parameter adjustment on the initial polarization diffusion model by adopting the first model loss.
5. The method of claim 4, the calculating a first model loss for the sequence of forward sample images based on the sample polarization state prediction image and the sample polarization state label image, comprising:
and calculating first Euclidean distance loss of the sample polarization state prediction image and the sample polarization state label image corresponding to each sequence image in the forward sample image sequence, and determining a first model loss based on the first Euclidean distance loss.
6. The method of claim 2, the determining a recommended polarization angle for the target object comprising:
and carrying out polarization angle prediction processing by adopting a polarization angle prediction model based on the target object image to obtain a recommended polarization angle for the target object.
7. The method of claim 6, the method further comprising:
creating an initial polarization angle prediction model;
collecting a sample normal state image of a sample object, and labeling a recommended polarization angle label of the sample normal state image in a sample environment;
and training the initial polarization angle prediction model based on the sample normal state image and the recommended polarization angle label until the initial polarization angle prediction model is trained, so as to obtain a trained polarization angle prediction model.
8. The method of claim 7, the training the initial polarization angle prediction model based on the sample normal image and the recommended polarization angle label comprising:
inputting the sample normal state image into the initial polarization angle prediction model to obtain a predicted recommended polarization angle in a sample environment;
and calculating a second model loss based on the predicted recommended polarization angle and the recommended polarization angle label, and carrying out parameter adjustment on the initial polarization angle prediction model by adopting the second model loss.
9. The method of claim 8, the calculating a second model loss based on the predicted recommended polarization angle and the recommended polarization angle label, comprising:
and calculating a second Euclidean distance loss of the predicted recommended polarization angle and the recommended polarization angle label, and taking the second Euclidean distance loss as a second model loss.
10. The method according to claim 1, wherein the performing the living body attack detection process based on the target object image and the target object polarization state image to obtain a target detection type for the target object includes:
and performing living body attack detection processing by adopting a living body attack prevention model based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
11. The method of claim 10, the method further comprising:
creating an initial living body anti-attack model;
acquiring a sample normal state image and a sample polarization state image of a sample object, and labeling a sample living body classification result label of the sample object;
training the initial living body anti-attack model based on the sample normal state image, the sample polarization state image and the sample living body classification result label until the initial living body anti-attack model is trained, and obtaining a trained living body anti-attack model.
12. The method of claim 11, the training the initial in-vivo anti-attack model based on the sample normal image, the sample polarization state image, and the sample in-vivo classification result label, comprising:
inputting the sample normal state image and the sample polarization state image into an initial living body anti-attack model to determine a sample normal state image feature and a normal state living body classification result based on the sample normal state image, and a sample polarization state image feature and a polarization state living body classification result based on the sample polarization state image, and a sample image residual feature and a residual state classification result based on the sample polarization state image and the sample polarization state image, and a sample fusion image feature and a fusion state classification result based on the sample normal state image feature, the sample polarization state image feature and the sample image residual feature;
And calculating a third model loss based on the normal living body classification result, the polarization state living body classification result, the residual state classification result, the fusion state classification result and the sample living body classification result label, and adopting the third model loss to carry out parameter adjustment on the initial living body anti-attack model.
13. The method of claim 12, the calculating a third model loss based on the normal state living body classification result, the polarization state living body classification result, the residual state classification result, the fusion state classification result, and the sample living body classification result label, comprising:
calculating normal living body classification loss based on the normal living body classification result and the sample living body classification result label; calculating a polarization state living body classification loss based on the polarization state living body classification result and the sample living body classification result label; calculating residual living body classification loss based on the residual state classification result and the sample living body classification result label; calculating fusion living body classification loss based on the fusion state classification result and the sample living body classification result label;
and obtaining a third model loss based on the normal-state living body classification loss, the polarization-state living body classification loss, the residual living body classification loss and the fusion living body classification loss.
14. A living body detection apparatus, the apparatus comprising:
the object image acquisition module is used for acquiring a target object image of a target object in a target environment;
a polarization image determining module for determining a target object polarization state image for the target object based on the target object image;
the living body attack detection module is used for carrying out living body attack detection processing based on the target object image and the target object polarization state image to obtain a target detection type aiming at the target object.
15. A computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method steps of any one of claims 1 to 13.
16. A computer program product storing at least one instruction for loading by a processor and performing the method steps of any one of claims 1 to 13.
17. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1-13.
CN202310277108.4A 2023-03-16 2023-03-16 Living body detection method and device, storage medium and electronic equipment Pending CN116778585A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310277108.4A CN116778585A (en) 2023-03-16 2023-03-16 Living body detection method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310277108.4A CN116778585A (en) 2023-03-16 2023-03-16 Living body detection method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116778585A true CN116778585A (en) 2023-09-19

Family

ID=87991965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310277108.4A Pending CN116778585A (en) 2023-03-16 2023-03-16 Living body detection method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116778585A (en)

Similar Documents

Publication Publication Date Title
US11455830B2 (en) Face recognition method and apparatus, electronic device, and storage medium
CN109993150B (en) Method and device for identifying age
CN111767554B (en) Screen sharing method and device, storage medium and electronic equipment
CN110059623B (en) Method and apparatus for generating information
CN111125663B (en) Control method and device for child mode, storage medium and terminal
CN112839223B (en) Image compression method, image compression device, storage medium and electronic equipment
CN110046571B (en) Method and device for identifying age
CN115131603A (en) Model processing method and device, storage medium and electronic equipment
CN114004905B (en) Method, device, equipment and storage medium for generating character style pictogram
CN115049068A (en) Model processing method and device, storage medium and electronic equipment
CN116798129A (en) Living body detection method and device, storage medium and electronic equipment
CN116129534A (en) Image living body detection method and device, storage medium and electronic equipment
CN116228391A (en) Risk identification method and device, storage medium and electronic equipment
CN116596748A (en) Image stylization processing method, apparatus, device, storage medium, and program product
CN116823537A (en) Insurance report processing method and device, storage medium and electronic equipment
CN115620111A (en) Image identification method and device, storage medium and electronic equipment
CN116778585A (en) Living body detection method and device, storage medium and electronic equipment
CN116246014B (en) Image generation method and device, storage medium and electronic equipment
CN116152403B (en) Image generation method and device, storage medium and electronic equipment
CN116343350A (en) Living body detection method and device, storage medium and electronic equipment
CN116246322A (en) Living body anti-attack method and device, storage medium and electronic equipment
CN116071527B (en) Object processing method and device, storage medium and electronic equipment
CN116168451A (en) Image living body detection method and device, storage medium and electronic equipment
CN116229585A (en) Image living body detection method and device, storage medium and electronic equipment
CN115937338B (en) Image processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination