CN113657327B - Non-living body attack discrimination method, device, equipment and medium suitable for image - Google Patents

Non-living body attack discrimination method, device, equipment and medium suitable for image Download PDF

Info

Publication number
CN113657327B
CN113657327B CN202110975577.4A CN202110975577A CN113657327B CN 113657327 B CN113657327 B CN 113657327B CN 202110975577 A CN202110975577 A CN 202110975577A CN 113657327 B CN113657327 B CN 113657327B
Authority
CN
China
Prior art keywords
image
sub
parameter estimation
calculation
living body
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.)
Active
Application number
CN202110975577.4A
Other languages
Chinese (zh)
Other versions
CN113657327A (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202110975577.4A priority Critical patent/CN113657327B/en
Publication of CN113657327A publication Critical patent/CN113657327A/en
Application granted granted Critical
Publication of CN113657327B publication Critical patent/CN113657327B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to the technical field of artificial intelligence, and discloses a non-living attack discrimination method, device, equipment and medium suitable for images, wherein the method comprises the following steps: calculating a local nonlinear normalized image, dividing sub-images, fitting asymmetric generalized Gaussian distribution and calculating parameter estimation on an initial face image to obtain a first parameter estimation value set; calculating a local nonlinear normalized image, dividing the image, fitting an asymmetric generalized Gaussian distribution and calculating parameter estimation on the downsampled face image to obtain a second parameter estimation value set; and inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to predict mole lines and reflection, and obtaining a non-living body attack discrimination result according to the classification prediction result. And whether the moire and/or the reflection of the non-living body attack exist or not is found by utilizing local statistical characteristics, so that the use of a binocular camera is avoided. The application is applicable to intelligent government affairs, digital medical treatment, science and technology finance and the like.

Description

Non-living body attack discrimination method, device, equipment and medium suitable for image
Technical Field
The present disclosure relates to the field of artificial intelligence, and in particular, to a method, an apparatus, a device, and a medium for discriminating a non-living attack applicable to an image.
Background
With the development of face recognition technology based on images, non-living body attack has become a common identity fraud, and accurate recognition of non-living body attack has become an important factor for whether the face recognition technology can be widely applied. In the prior art, the binocular cameras are adopted to avoid the influence of non-living body attack on the accuracy of face recognition results, namely, two calibrated cameras are adopted to shoot, then the face depth is judged according to the shot results, and a good effect is achieved on the accurate recognition of the non-living body attack. However, the cost of the binocular camera is high, and for some application scenarios where the binocular camera cannot be set, for example, the mobile electronic device is used for shooting to perform face recognition, the influence of non-living attack on the accuracy of the face recognition result cannot be avoided.
Disclosure of Invention
The main purpose of the application is to provide a non-living body attack discrimination method, device, equipment and medium suitable for images, and aims to solve the technical problems that the cost is high and the application scene of which the binocular camera cannot be arranged is not suitable when the binocular camera is adopted to discriminate the depth of the face in the non-living body attack discrimination in the prior art.
In order to achieve the above object, the present application proposes a non-living attack discrimination method applicable to an image, the method comprising:
acquiring an initial face image and a downsampled face image corresponding to the initial face image;
respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of divided sub-images and calculation of parameter estimation according to the initial face image to obtain a first parameter estimation value set;
respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of the divided sub-images and calculation of parameter estimation according to the downsampled face image to obtain a second parameter estimation value set;
inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to predict mole lines and reflection, so as to obtain a classification prediction result;
and judging the non-living body attack according to the classification prediction result to obtain a non-living body attack judgment result.
Further, the step of obtaining a first parameter estimation value set by respectively performing calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, and calculation of asymmetric generalized gaussian distribution fitting and parameter estimation of the divided sub-images according to the initial face image includes:
Filtering the initial face image to obtain a first filtered face image;
respectively carrying out local variance calculation and local nonlinear normalization image calculation according to the initial face image and the first filter face image to obtain a first normalization image;
dividing the first normalized image by adopting a sub-image dividing rule to obtain a plurality of initial sub-images;
and carrying out asymmetric generalized Gaussian distribution fitting and parameter estimation calculation on each initial sub-image to obtain the first parameter estimation value set.
Further, the step of dividing the first normalized image by using a sub-image dividing rule to obtain a plurality of initial sub-images includes:
adopting a preset segmentation model and a target object of the sub-image segmentation rule to carry out image segmentation and image region acquisition on the first normalized image to obtain a first target image;
dividing the first target image by adopting a preset sub-image size and a preset edge overlapping proportion of the sub-image dividing rule to obtain a sub-image set to be selected;
and acquiring sub-images from the sub-image set to be selected by adopting a sub-image selection rule of the sub-image division rule to obtain a plurality of initial sub-images.
Further, the step of obtaining a second parameter estimation value set by respectively performing calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, and calculation of asymmetric generalized gaussian distribution fitting and parameter estimation of the divided sub-images according to the downsampled face image includes:
filtering the downsampled face image to obtain a second filtered face image;
respectively carrying out local variance calculation and local nonlinear normalization image calculation according to the downsampled face image and the second filtered face image to obtain a second normalization image;
dividing the second normalized image by adopting the sub-image dividing rule to obtain a plurality of downsampled sub-images;
and carrying out asymmetric generalized Gaussian distribution fitting and parameter estimation calculation on each downsampled sub-image to obtain the second parameter estimation value set.
Further, the step of performing non-living body attack discrimination according to the classification prediction result to obtain a non-living body attack discrimination result includes:
when the classification prediction result is that no mole lines and no reflection exist, acquiring a merged image size, updating the preset sub-image size of the division rule of the initial sub-image and the preset sub-image size of the division rule of the downsampled sub-image according to the merged image size, and repeatedly executing the steps of respectively carrying out calculation of the local nonlinear normalized image, the division of the local nonlinear normalized image and the calculation of the asymmetric generalized Gaussian distribution fitting and the parameter estimation of the divided sub-image according to the initial face image until the iteration times reach preset times;
When the classification prediction result is that the moire and/or the reflection exists, determining that the non-living body attack discrimination result is that the non-living body attack exists;
and when the classification prediction result is that no mole lines and no reflection exist, determining that the non-living body attack discrimination result is that no non-living body attack exists.
Further, when the classification prediction result is that no mole line and no reflection exist, determining that the non-living body attack discrimination result is that no non-living body attack exists includes:
when the classification prediction result is that no mole lines and no reflection exist, a preset three-dimensional imaging model is obtained, the initial face image is input into the preset three-dimensional imaging model to carry out three-dimensional surface reconstruction, and a three-dimensional surface image is obtained;
adopting a preset concave-convex judging rule to judge the concave-convex of the three-dimensional surface image to obtain a three-dimensional surface concave-convex judging result;
when the three-dimensional surface concave-convex judging result is that concave-convex exists, determining that the non-living attack judging result is that non-living attack exists;
and when the three-dimensional surface concave-convex judging result is concave-convex, determining that the non-living body attack judging result is non-living body attack.
Further, the step of performing three-dimensional surface concave-convex judgment on the three-dimensional surface image by adopting a preset concave-convex judgment rule to obtain a three-dimensional surface concave-convex judgment result comprises the following steps:
carrying out light source direction calculation of each point on the three-dimensional surface image to obtain a light source direction calculation result;
adopting a minimum energy functional method, and respectively carrying out normal calculation of pixel points on the three-dimensional surface image according to the light source direction calculation result to obtain a normal data set;
and adopting a preset concave-convex judging rule, and carrying out three-dimensional surface concave-convex judgment on the three-dimensional surface image according to the normal data set to obtain a three-dimensional surface concave-convex judging result.
The application also provides a non-living body attack distinguishing device suitable for the image, which comprises:
the image acquisition module is used for acquiring an initial face image and a downsampled face image corresponding to the initial face image;
the first parameter estimation value set determining module is used for respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of divided sub-images and calculation of parameter estimation according to the initial face image to obtain a first parameter estimation value set;
The second parameter estimation value set determining module is used for respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of the divided sub-images and calculation of parameter estimation according to the downsampled face image to obtain a second parameter estimation value set;
the classification prediction result determining module is used for inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to predict mole lines and reflection, so as to obtain a classification prediction result;
and the non-living body attack discrimination result determining module is used for carrying out non-living body attack discrimination according to the classification prediction result to obtain a non-living body attack discrimination result.
The present application also proposes a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the processor executes the computer program.
The present application also proposes a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method of any of the above.
According to the method, firstly, a first parameter estimation value set is obtained through respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of divided sub-images and calculation of parameter estimation according to the initial face image, and a second parameter estimation value set is obtained through respectively carrying out calculation of the local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of divided sub-images and calculation of parameter estimation according to the downsampled face image, then the first parameter estimation value set and the second parameter estimation value set are input into a target classification prediction model to carry out prediction of mole marks and reflection, a classification prediction result is obtained, finally, non-living attack discrimination is carried out according to the classification prediction result, and accordingly whether the mole marks and/or reflection of the non-living attack exist or not is found according to the local statistical characteristics, binocular cameras are avoided, and the method is suitable for setting up binocular cameras.
Drawings
Fig. 1 is a flow chart of a non-living body attack discrimination method applicable to an image according to an embodiment of the present application;
fig. 2 is a block diagram schematically illustrating a configuration of a non-living body attack discrimination apparatus applied to an image according to an embodiment of the present application;
fig. 3 is a block diagram schematically illustrating a structure of a computer device according to an embodiment of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Referring to fig. 1, an embodiment of the present application provides a non-living attack discrimination method applicable to an image, where the method includes:
s1: acquiring an initial face image and a downsampled face image corresponding to the initial face image;
s2: respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of divided sub-images and calculation of parameter estimation according to the initial face image to obtain a first parameter estimation value set;
S3: respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of the divided sub-images and calculation of parameter estimation according to the downsampled face image to obtain a second parameter estimation value set;
s4: inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to predict mole lines and reflection, so as to obtain a classification prediction result;
s5: and judging the non-living body attack according to the classification prediction result to obtain a non-living body attack judgment result.
According to the method, a first parameter estimation value set is obtained by respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided sub-images according to the initial face image, respectively carrying out calculation of the local nonlinear normalized image, division of the local nonlinear normalized image and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided sub-images according to the downsampled face image to obtain a second parameter estimation value set, then inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to carry out prediction of mole marks and prediction of reflection of light to obtain a classification prediction result, and finally carrying out non-living attack discrimination according to the classification prediction result to obtain a non-living attack discrimination result, so that whether the mole marks and/or the reflection of light of non-living attack exist or not is found according to the local statistical characteristics, the application scene of the non-living attack is avoided, the cost of the binocular camera is reduced, and the method is suitable for the application scene of the binocular camera.
In general, a camera is used to capture a photo, a printed photo or a recorded video, which are taken in advance, so that the camera is different from a real image taken by a living body in nature from an image taken by a non-living body attack scene: moire can occur, light reflection can occur, planar imaging is not three-dimensional object imaging and there is a disparity between shadows and real objects.
Moire is a stripe of high-frequency interference which occurs on a photosensitive element in equipment such as a digital camera or a scanner, and is a stripe of high-frequency irregularity which can cause a picture to be colored.
The light source emits reflected light which is incident on the surface of the substance and is reflected by changing the direction.
For S1, an initial face image input by the user may be acquired, or the initial face image may be acquired from a database, or the initial face image may be acquired from a third party application system.
The initial face image is an image containing a face and shot by a camera.
The downsampled face image is an image containing a face obtained by downsampling the initial face image.
The method comprises the steps of acquiring a downsampled face image corresponding to the initial face image, which is input by a user, from a database, and acquiring the downsampled face image corresponding to the initial face image from a third party application system.
And the initial face image is downsampled by adopting a preset image downsampling module, and the downsampled image is taken as a downsampled face image. Downsampling is the process of downscaling the image.
The preset image downsampling module is a model obtained based on convolutional neural network training.
And downsampling the initial face image by adopting a preset image downsampling module, namely reducing the initial face image to a preset proportion.
Alternatively, the preset ratio is set to 0.5, that is, the size of the downsampled face image is half of the size of the original face image. It is understood that the preset ratio may be set to other values greater than 0 and less than 1, which are not limited herein.
For S2, it was found statistically: the real world image gray scale distribution is a steeper distribution than gaussian distribution; however, the Gaussian distribution is satisfied by certain nonlinear transformation on a general natural image (an image directly shot on a living body or an object); however, even though the images are subjected to nonlinear transformation, the gaussian distribution is not satisfied for images whose light and natural images are very different (i.e., images taken of non-living attack scenes). Therefore, the local nonlinear normalization processing can be performed on the initial face image, and a basis is provided for judging the non-living body attack based on Gaussian distribution.
The method comprises the steps of firstly carrying out filtering processing on an initial face image, calculating local variance according to the filtered image and the initial face image, carrying out calculation on a local nonlinear normalized image according to the local variance, the filtered image and the initial face image, then carrying out initial sub-image division on the calculated local nonlinear normalized image by adopting a sub-image division rule, carrying out asymmetric generalized Gaussian distribution fitting on each initial sub-image, carrying out parameter estimation calculation when carrying out asymmetric generalized Gaussian distribution fitting, and taking data obtained by parameter estimation as a first parameter estimation value set. That is, each initial sub-image corresponds to a first parameter estimation value.
The sub-image division rule includes: the sub-image size is preset. The length of the initial sub-image is less than or equal to the length of the preset sub-image size, and the height of the initial sub-image is less than or equal to the height of the preset sub-image size.
And S3, firstly, carrying out filtering processing on the downsampled face image, calculating local variance according to the filtered image and the downsampled face image, carrying out calculation on a local nonlinear normalized image according to the local variance, the filtered image and the downsampled face image, then carrying out division on the downsampled sub-image on the calculated local nonlinear normalized image by adopting a sub-image division rule, carrying out asymmetric generalized Gaussian distribution fitting on each downsampled sub-image, carrying out calculation on parameter estimation when carrying out asymmetric generalized Gaussian distribution fitting, and taking data obtained by parameter estimation as a second parameter estimation value set. That is, each downsampled sub-image corresponds to a second parameter estimate.
The length of the downsampled sub-image is less than or equal to the length of the preset sub-image size, and the height of the downsampled sub-image is less than or equal to the height of the preset sub-image size.
It can be understood that the calculation methods of S2 and S3 are the same, and the input images are different, where the input image of S2 is the initial face image, and the input image of S3 is the downsampled face image obtained by downsampling according to the initial face image.
And S4, splicing a first parameter estimated value corresponding to an initial sub-image at the same position of the initial face image with a second parameter estimated value corresponding to a downsampled sub-image to obtain parameter estimated value splicing data, inputting the parameter estimated value splicing data into a target classification prediction model to perform prediction of moire and reflection of light, and obtaining a classification prediction result. That is, each sub-image (initial sub-image) corresponds to one classification prediction result.
The classification prediction result comprises: moire predictions and glistenings predictions. The Moire prediction result has two values, and the Moire prediction result can be the Moire or the Moire is not present. The reflection prediction result has two values, and can be reflection or no reflection.
The target classification prediction model is a model obtained based on multi-classifier training. The number of label values predicted by the target classification prediction model is 2, and the 2 label values are respectively: moire, light reflection.
For S5, when the classification prediction result is that there is a moire and/or there is a reflection, it is determined that the non-living attack discrimination result is that there is a non-living attack, that is, the initial face image at this time is an image captured by the camera for a non-living attack scene.
In one embodiment, the step of obtaining the first parameter estimation value set by performing calculation of the local nonlinear normalized image, division of the local nonlinear normalized image, and calculation of asymmetric generalized gaussian distribution fitting and parameter estimation of the divided sub-images according to the initial face image respectively includes:
s21: filtering the initial face image to obtain a first filtered face image;
s22: respectively carrying out local variance calculation and local nonlinear normalization image calculation according to the initial face image and the first filter face image to obtain a first normalization image;
s23: dividing the first normalized image by adopting a sub-image dividing rule to obtain a plurality of initial sub-images;
S24: and carrying out asymmetric generalized Gaussian distribution fitting and parameter estimation calculation on each initial sub-image to obtain the first parameter estimation value set.
In the embodiment, filtering processing is performed first, local variance is calculated according to the filtered image and the initial face image, local nonlinear normalized image calculation is performed according to the local variance, the filtered image and the initial face image, then sub-image division rules are adopted to divide the calculated local nonlinear normalized image into initial sub-images, asymmetric generalized Gaussian distribution fitting is performed on each initial sub-image, parameter estimation calculation is performed during the asymmetric generalized Gaussian distribution fitting, and therefore a basis is provided for non-living attack discrimination based on Gaussian distribution.
And S21, filtering the initial face image by adopting a Gaussian filter, and taking the filtered image as the first filtered face image.
The calculation formula μ (i, j) of the first filtered face image is:
wherein G is 7×7 Is a parameter of the gaussian filter and,is convolution operation, I (I, j) is the initial face image, I is the transverse coordinate of the pixel point of the image, and j is the longitudinal coordinate of the pixel point of the image.
It will be appreciated that the parameters of the gaussian filter may also be set to other values, not limited herein.
For S22, first, local variance calculation is performed according to the initial face image and the first filtered face image, then local nonlinear normalized image calculation is performed according to the local variance, the initial face image and the first filtered face image, and the calculated image is used as a first normalized image.
It is understood that the local variance of the present application is the calculated local variance of the image.
The calculation formula sigma (i, j) of the local variance is:
wherein I is 2 (I, j) is the square calculation of the initial face image I (I, j), μ 2 (i, j) is a square calculation of the first filtered face image μ (i, j), G 7×7 Is a parameter of the gaussian filter and,is a convolution operation.
Calculation formula of local nonlinear normalized imageThe method comprises the following steps:
wherein I (I, j) is the initial face image, μ (I, j) is the first filtered face image, σ (I, j) is the local variance.
And S23, carrying out sub-image division on the first normalized image by adopting a preset sub-image size of a sub-image division rule, and determining a plurality of initial sub-images according to the sub-images obtained by division.
It will be appreciated that each sub-image obtained by sub-image division of the first normalized image may be taken as one of the initial sub-images.
And S24, adopting an asymmetric generalized Gaussian distribution fitting method to fit the initial sub-image, adopting a moment estimation method to estimate three parameters of the asymmetric generalized Gaussian distribution fitting, and taking the estimated values of the three parameters as first parameter estimated values.
For example, assume that the initial sub-image satisfies the following probability distribution:
wherein w is the pixel value of the initial sub-image, alpha, beta l 、β r Is the three parameters that need to be estimated, exp is an exponential function based on a natural constant e,Γ (a) is the integral in the calculation of the calculus, Γ (a) is the transcendental function, t is the argument, a is expressed as +.>
It will be appreciated that when w.ltoreq.0,when w is>At 0, the +>
That is, the first parameter estimate represents α, β l 、β r Is used for the estimation of the estimated value of (a).
The specific steps of estimating the three parameters of the asymmetric generalized Gaussian distribution fitting by adopting the moment estimation method are not described herein.
In one embodiment, the step of dividing the first normalized image by using a sub-image division rule to obtain a plurality of initial sub-images includes:
S231: adopting a preset segmentation model and a target object of the sub-image segmentation rule to carry out image segmentation and image region acquisition on the first normalized image to obtain a first target image;
s232: dividing the first target image by adopting a preset sub-image size and a preset edge overlapping proportion of the sub-image dividing rule to obtain a sub-image set to be selected;
s233: and acquiring sub-images from the sub-image set to be selected by adopting a sub-image selection rule of the sub-image division rule to obtain a plurality of initial sub-images.
The embodiment presets the segmentation model, performs image segmentation and image region acquisition on the first normalized image, so that the image of the region of important attention is obtained, the number of initial sub-images required to be calculated is reduced, the calculation amount of non-living attack discrimination is reduced, and the calculation efficiency of the application is improved; dividing the acquired image area by adopting a preset sub-image size and a preset edge overlapping proportion, and determining a plurality of initial sub-images from each sub-image obtained by dividing by adopting a sub-image selection rule, thereby further reducing the number of the initial sub-images to be calculated, further reducing the calculation amount of non-living attack discrimination and further improving the calculation efficiency of the application.
For S231, inputting the first normalized image into a preset segmentation model for image segmentation, and selecting an image region from a plurality of image regions obtained by image segmentation according to the target object of the sub-image segmentation rule as a first target image.
It can be understood that the preset segmentation model of the sub-image division rule is a preset segmentation model corresponding to the target object.
For example, if the target object is a tongue, the preset segmentation model segments the first normalized image into a tongue image area and a non-tongue image area, and the tongue image area is used as the first target image, which is not specifically limited herein.
The preset segmentation model is a model obtained based on UNet neural network training. UNet is a full convolution network comprising 4 layers of downsampling, 4 layers of upsampling and similar jump connection structures, and is characterized in that the convolution layers are completely symmetrical in downsampling and upsampling parts, and a feature map of a downsampling end can skip deep sampling and be spliced to a corresponding upsampling end.
And S232, dividing the first target image by adopting a preset sub-image size, and taking each sub-image to be selected obtained by dividing as a sub-image set to be selected, wherein the overlapping proportion of the edges of two adjacent sub-images to be selected is equal to the preset edge overlapping proportion.
For example, the sub-image to be selected T1 and the sub-image to be selected T2 are adjacent, the preset edge overlapping ratio is 10%, the number of the same pixels of the sub-image to be selected T1 and the sub-image to be selected T2 is taken as the number to be analyzed, and when the sizes of the sub-image to be selected T1 and the sub-image to be selected T2 are equal to the preset sub-image sizes, the number to be analyzed divided by the preset sub-image size is equal to the preset edge overlapping ratio, which is not limited specifically herein. It will be appreciated that when the sizes of the sub-image T1 to be selected and the sub-image T2 to be selected are both smaller than the preset sub-image size, the number to be analyzed divided by the preset sub-image size is smaller than or equal to the preset edge overlap ratio, and the number to be analyzed divided by the preset sub-image size is smaller than the preset edge overlap ratio.
For S233, carrying out pixel value summation calculation on each sub-image to be selected to obtain a pixel total value of each sub-image to be selected; and acquiring a sub-image with the maximum pixel total value (namely the sub-image to be selected) from the sub-image set to be selected by adopting a preset proportion of a sub-image selection rule, and taking each acquired sub-image as one initial sub-image. For example, if the preset proportion of the sub-image selection rule is 10%, a sub-image (i.e., a sub-image to be selected) with a maximum pixel total value of 10% is obtained from the set of sub-images to be selected as a plurality of the initial sub-images, which is not specifically limited herein.
In one embodiment, the step of obtaining the second parameter estimation value set by performing calculation of the local nonlinear normalized image, division of the local nonlinear normalized image, and calculation of asymmetric generalized gaussian distribution fitting and parameter estimation of the divided sub-images according to the downsampled face image respectively includes:
s31: filtering the downsampled face image to obtain a second filtered face image;
s32: respectively carrying out local variance calculation and local nonlinear normalization image calculation according to the downsampled face image and the second filtered face image to obtain a second normalization image;
s33: dividing the second normalized image by adopting the sub-image dividing rule to obtain a plurality of downsampled sub-images;
s34: and carrying out asymmetric generalized Gaussian distribution fitting and parameter estimation calculation on each downsampled sub-image to obtain the second parameter estimation value set.
In this embodiment, filtering processing is performed first, local variance is calculated according to the filtered image and the downsampled face image, local nonlinear normalized image calculation is performed according to the local variance, the filtered image and the downsampled face image, then the downsampled sub-image is divided by adopting a sub-image division rule for the calculated local nonlinear normalized image, asymmetric generalized gaussian distribution fitting is performed for each downsampled sub-image, and parameter estimation calculation is performed during the asymmetric generalized gaussian distribution fitting, so that a basis is provided for non-living attack discrimination based on gaussian distribution.
And S31, filtering the downsampled face image by adopting a Gaussian filter, and taking the filtered image as the second filtered face image.
For S32, first, local variance calculation is performed according to the downsampled face image and the second filtered face image, then, local nonlinear normalization image calculation is performed according to the local variance, the downsampled face image and the second filtered face image, and the calculated image is used as a second normalization image.
And for S33, adopting a preset sub-image size of a sub-image dividing rule, dividing the sub-image of the second normalized image, and determining a plurality of downsampled sub-images according to the sub-images obtained by dividing.
It will be appreciated that each sub-image obtained by sub-image division of the second normalized image may be referred to as one of the downsampled sub-images.
Optionally, the step of dividing the second normalized image by using the sub-image dividing rule to obtain a plurality of sub-sampled sub-images includes: adopting a preset segmentation model and a target object of the sub-image segmentation rule to carry out image segmentation and image region acquisition on the second normalized image to obtain a second target image; dividing the second target image by adopting a preset sub-image size and a preset edge overlapping proportion of the sub-image dividing rule to obtain a sub-image set to be processed; and acquiring sub-images from the sub-image set to be processed by adopting a sub-image selection rule of the sub-image division rule to obtain a plurality of sub-sampled sub-images.
And for S34, an asymmetric generalized Gaussian distribution fitting method is adopted to fit the downsampled sub-images, three parameters of the asymmetric generalized Gaussian distribution fitting are estimated by adopting a moment estimation method, and estimated values of the three parameters are used as second parameter estimated values.
In one embodiment, the step of performing the non-living body attack discrimination according to the classification prediction result to obtain a non-living body attack discrimination result includes:
s51: when the classification prediction result is that no mole lines and no reflection exist, acquiring a merged image size, updating the preset sub-image size of the division rule of the initial sub-image and the preset sub-image size of the division rule of the downsampled sub-image according to the merged image size, and repeatedly executing the steps of respectively carrying out calculation of the local nonlinear normalized image, the division of the local nonlinear normalized image and the calculation of the asymmetric generalized Gaussian distribution fitting and the parameter estimation of the divided sub-image according to the initial face image until the iteration times reach preset times;
s52: when the classification prediction result is that the moire and/or the reflection exists, determining that the non-living body attack discrimination result is that the non-living body attack exists;
S53: and when the classification prediction result is that no mole lines and no reflection exist, determining that the non-living body attack discrimination result is that no non-living body attack exists.
In this embodiment, when the classification prediction result is that no moire and no reflection exist, in order to avoid that the moire and/or the reflection are divided into a plurality of sub-modules, the prediction of the moire and the prediction of the reflection are determined again for the sub-image, so that the accuracy of the non-living body attack discrimination result is improved.
For S51, when the classification prediction result indicates that no moire and no reflection exist, which means that no initial sub-image with non-living attack is identified, the merged image size may be obtained from the database, or may be written into a program for implementing the present application, and the preset sub-image size of the division rule of the initial sub-image and the preset sub-image size of the division rule of the downsampled sub-image are updated according to the merged image size, so as to increase the sizes of the sub-images (i.e., the initial sub-image and the downsampled sub-image), and steps S2 to S51 are repeatedly performed until the number of iterations reaches the preset number.
That is, the combined image size is larger than the preset sub-image size of the division rule of the initial sub-image (i.e., the sub-image division rule), and the combined image size is larger than the preset sub-image size of the division rule of the downsampled sub-image (i.e., the sub-image division rule).
The preset times are greater than or equal to 1. It can be understood that when the preset number of times is equal to 1, it means that there is no need to increase the size of the sub-image for prediction of moire and prediction of reflection; when the preset number of times is equal to 2, this means that the size of the sub-image needs to be increased once for prediction of moire and prediction of glistening.
With S52, when any one of the classification prediction results is the presence of moire and/or the presence of reflection, it is determined that the non-living attack discrimination result is the presence of a non-living attack.
For S53, when the classification prediction result is that there is no moire and there is no reflection, it is determined that there is no non-living attack when it is found whether there is moire and/or reflection of non-living attack by using local statistical characteristics, and thus it is determined that the non-living attack discrimination result is that there is no non-living attack.
In one embodiment, the step of determining that the non-living attack discrimination result is that the non-living attack is not present when the classification prediction result is that neither the moire nor the reflection exists, includes:
s531: when the classification prediction result is that no mole lines and no reflection exist, a preset three-dimensional imaging model is obtained, the initial face image is input into the preset three-dimensional imaging model to carry out three-dimensional surface reconstruction, and a three-dimensional surface image is obtained;
S532: adopting a preset concave-convex judging rule to judge the concave-convex of the three-dimensional surface image to obtain a three-dimensional surface concave-convex judging result;
s533: when the three-dimensional surface concave-convex judging result is that concave-convex exists, determining that the non-living attack judging result is that non-living attack exists;
s534: and when the three-dimensional surface concave-convex judging result is concave-convex, determining that the non-living body attack judging result is non-living body attack.
In the embodiment, when whether the mole line of the non-living body attack exists or not and/or the reflection of light is determined to not exist by utilizing the local statistical characteristics, firstly, three-dimensional surface reconstruction is carried out on an initial face image, then three-dimensional surface concave-convex judgment is carried out, finally, whether the non-living body attack exists or not is determined according to the three-dimensional surface concave-convex judgment result, so that whether the face is a real three-dimensional face is judged, and the accuracy of the non-living body attack judgment result is further improved.
A common attack method is to simulate a real person by replaying a shot photo or video by using an electronic playing device, so that a three-dimensional object included near a three-dimensional face is a plane instead of a three-dimensional curved surface with concave and convex surfaces; in another common attack method, the printed photo is rolled up or approximately attached to the face of another person, but the curvature of the three-dimensional curved surface is more consistent at the moment, unlike the true face which has a concave and a convex; therefore, contradictory anomalies of these three-dimensional information can be used to make decisions of non-living attacks.
For S531, when the classification prediction result indicates that no mole lines and no reflection exist, a preset three-dimensional imaging model input by the user may be obtained, a preset three-dimensional imaging model may be obtained from the database, or a preset three-dimensional imaging model may be obtained from a third party application system.
The three-dimensional imaging model, that is, the model that generates the three-dimensional surface image from the two-dimensional image, is preset.
Inputting the initial face image into the preset three-dimensional imaging model to reconstruct a three-dimensional surface, and taking the data of the three-dimensional surface obtained by reconstruction as a three-dimensional surface image.
Wherein the surface shape of the three-dimensional surface image is Z (x, y), then the normal line at the coordinates (g, h) of the surface shapeThe method comprises the following steps:
wherein Z is Z (x, y);
because, the skin of the face has the condition of more consistent texture and color, an imaging model is adopted:
that is, the brightness of the skin of a human faceAffected by only one point light source ρ d Is the reflectivity ρ d Is constant, I p Is irradiance, the light source direction is +>
Optionally, the ρ is set according to the skin characteristics of the face d Set to 1.
And S532, calculating the light source direction of the three-dimensional surface image, then calculating the normal line of the pixel point according to the result of the light source direction calculation by adopting a minimized energy functional method, and finally carrying out three-dimensional surface concave-convex judgment according to the data of the normal line calculation by adopting a preset concave-convex judgment rule, thereby obtaining a three-dimensional surface concave-convex judgment result.
When the product of normals of two adjacent points on the three-dimensional surface image is larger than the product of preset normals, the three-dimensional surface image is relatively flat and has no concave-convex condition, so that the three-dimensional surface concave-convex judgment result is determined to be that concave-convex exists; when the product of normals of two adjacent points on the three-dimensional surface image is smaller than or equal to the product of the preset normals, the curve change of the two adjacent points of the three-dimensional surface image is indicated, and the concave-convex condition exists, so that the three-dimensional surface concave-convex judging result is determined to be concave-convex.
Optionally, the preset normal product is set to 0.9. It will be appreciated that the predetermined normal product may be other values, such as 0.8, and is not specifically limited herein.
With S533, when the three-dimensional surface unevenness determination result is that there is no unevenness, it means that the three-dimensional face is not a three-dimensional curved surface of unevenness, and therefore, it can be determined that the non-living attack determination result is that there is a non-living attack.
In S534, when the three-dimensional surface unevenness determination result is that unevenness exists, it means that the three-dimensional face is a three-dimensional curved surface of unevenness, and therefore, it is determined that the non-living attack determination result is that no non-living attack exists.
In one embodiment, the step of performing three-dimensional surface concave-convex judgment on the three-dimensional surface image by using a preset concave-convex judgment rule to obtain a three-dimensional surface concave-convex judgment result includes:
s5321: carrying out light source direction calculation of each point on the three-dimensional surface image to obtain a light source direction calculation result;
s5322: adopting a minimum energy functional method, and respectively carrying out normal calculation of pixel points on the three-dimensional surface image according to the light source direction calculation result to obtain a normal data set;
s5323: and adopting a preset concave-convex judging rule, and carrying out three-dimensional surface concave-convex judgment on the three-dimensional surface image according to the normal data set to obtain a three-dimensional surface concave-convex judging result.
The embodiment is pushed to provide support for determining whether the non-living body attack exists according to the three-dimensional surface concave-convex judging result by carrying out light source direction calculation on the three-dimensional surface image, then carrying out normal line calculation on the pixel points according to the light source direction calculating result and finally carrying out three-dimensional surface concave-convex judgment according to the normal line data set.
For S5321, the three-dimensional surface image is segmented by using a superpixel segmentation method, so that the number of pixels in each superpixel is not less than the number of preset pixels, and the superpixels can be regarded as blocks with more uniform brightness, so that the change of the normal direction of the pixels on the superpixel is small, but slow change exists.
From the imaging model, it can be known that the superpixels of the three-dimensional surface image i Luminance calculation formula of (2)The method comprises the following steps:
where n is the number of superpixels adjacent to each other, s i Is the ith superpixel, ρ d Is the reflectivity ρ d Is constant, I p Is the irradiance of the light to be irradiated,is the ith superpixel s of the three-dimensional surface image i Is the normal of (1), the direction of the light source is->
Since the normal direction change of the point on the super-pixel is small, the super-pixel s of the three-dimensional surface image is estimated by adopting a least square method by adding that the product of the normal lines of two adjacent super-pixels is larger than a preset constraint value i The light source direction of (2) isIt will be appreciated that superpixels s may be superpixel i Is taken as super-pixel s i The light source direction of each pixel point in the array.
Optionally, the preset number of pixels is set to 90. It is understood that the number of preset pixels may be set to other values, which are not limited herein.
Optionally, the preset constraint value is set to 0.9. It is understood that the preset constraint value may also be set to other values, such as 0.85, which is not limited herein.
For S5322, according to the light source direction calculation result, the surface shape of the three-dimensional surface image can be calculated as Z (x, y) by using the method of minimizing the energy function, and the calculation formula E of the energy function is:
Solving this energy function requires the use of the Euler-Lagrange (Euler-Lagrange) formula:
wherein J (x, y) is the brightness of the pixel point (x, y) of the initial face image,the brightness of the pixel point (x, y) which is the surface shape of the three-dimensional surface image, and p is the partial derivative of the curved surface corresponding to the three-dimensional surface image x Is p calculates the partial derivative for x, p y Is p calculates partial derivative for y, q is partial derivative of curved surface corresponding to three-dimensional surface image, q x Is q calculates the partial derivative for x, q y Is q calculates the partial derivative for y, dxdy is the integral variable, ++>Is a derivative calculation of x->Is a derivative calculation of y, λ is a constant, where +.>
Imaging modelWherein the normal of the pixel point at the coordinates (g, h) of the surface shape +.>ρ is d Is the reflectivity, I p Is irradiance, light source direction->Substituting the calculation formula E and the Euler-Lagrange formula of the energy functional function to iteratively solve the normal line of each pixel point on the surface shape of the three-dimensional surface image
Alternatively, λ may have a value ranging from 1 to 5, and may include 1 or 5.
For S5323, when the product of normals of two adjacent points on the three-dimensional surface image is greater than the preset normals, it is indicated that the three-dimensional surface image is relatively flat and has no concave-convex condition, so that it is determined that the three-dimensional surface concave-convex judgment result is that no concave-convex exists; when the product of normals of two adjacent points on the three-dimensional surface image is smaller than or equal to the product of the preset normals, the curve change of the two adjacent points of the three-dimensional surface image is indicated, and the concave-convex condition exists, so that the three-dimensional surface concave-convex judging result is determined to be concave-convex.
Referring to fig. 2, the present application further proposes a non-living attack discrimination apparatus suitable for an image, the apparatus comprising:
an image acquisition module 100, configured to acquire an initial face image and a downsampled face image corresponding to the initial face image;
the first parameter estimation value set determining module 200 is configured to perform calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized gaussian distribution fitting of the divided sub-images, and calculation of parameter estimation according to the initial face image, respectively, to obtain a first parameter estimation value set;
the second parameter estimation value set determining module 300 is configured to perform calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized gaussian distribution fitting of the divided sub-images, and calculation of parameter estimation according to the downsampled face image, respectively, to obtain a second parameter estimation value set;
the classification prediction result determining module 400 is configured to input the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to perform prediction of moire and prediction of reflection, so as to obtain a classification prediction result;
And the non-living body attack discrimination result determining module 500 is used for performing non-living body attack discrimination according to the classification prediction result to obtain a non-living body attack discrimination result.
According to the method, a first parameter estimation value set is obtained by respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided sub-images according to the initial face image, respectively carrying out calculation of the local nonlinear normalized image, division of the local nonlinear normalized image and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided sub-images according to the downsampled face image to obtain a second parameter estimation value set, then inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to carry out prediction of mole marks and prediction of reflection of light to obtain a classification prediction result, and finally carrying out non-living attack discrimination according to the classification prediction result to obtain a non-living attack discrimination result, so that whether the mole marks and/or the reflection of light of non-living attack exist or not is found according to the local statistical characteristics, the application scene of the non-living attack is avoided, the cost of the binocular camera is reduced, and the method is suitable for the application scene of the binocular camera.
It will be appreciated that the non-living-body attack discrimination apparatus applied to an image may also perform other method steps of the non-living-body attack discrimination method applied to an image.
Referring to fig. 3, a computer device is further provided in the embodiment of the present application, where the computer device may be a server, and the internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer is configured to provide computing and control capabilities. The memory of the computer device includes a storage medium, an internal memory. The storage medium stores an operating system, computer programs, and a database. The memory provides an environment for the operating system and computer programs in the storage media to run. The database of the computer device is used for storing data such as a non-living body attack discrimination method applicable to the image. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a non-living attack discrimination method applicable to an image. The non-living body attack discrimination method suitable for the image comprises the following steps: acquiring an initial face image and a downsampled face image corresponding to the initial face image; respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of divided sub-images and calculation of parameter estimation according to the initial face image to obtain a first parameter estimation value set; respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of the divided sub-images and calculation of parameter estimation according to the downsampled face image to obtain a second parameter estimation value set; inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to predict mole lines and reflection, so as to obtain a classification prediction result; and judging the non-living body attack according to the classification prediction result to obtain a non-living body attack judgment result. It will be appreciated that the computer program of the computer device may also perform other method steps of the non-living attack discrimination method applicable to the image when executed by the processor.
According to the method, a first parameter estimation value set is obtained by respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided sub-images according to the initial face image, respectively carrying out calculation of the local nonlinear normalized image, division of the local nonlinear normalized image and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided sub-images according to the downsampled face image to obtain a second parameter estimation value set, then inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to carry out prediction of mole marks and prediction of reflection of light to obtain a classification prediction result, and finally carrying out non-living attack discrimination according to the classification prediction result to obtain a non-living attack discrimination result, so that whether the mole marks and/or the reflection of light of non-living attack exist or not is found according to the local statistical characteristics, the application scene of the non-living attack is avoided, the cost of the binocular camera is reduced, and the method is suitable for the application scene of the binocular camera.
An embodiment of the present application further provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements a non-living attack discrimination method applicable to an image, including the steps of: acquiring an initial face image and a downsampled face image corresponding to the initial face image; respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of divided sub-images and calculation of parameter estimation according to the initial face image to obtain a first parameter estimation value set; respectively carrying out calculation of a local nonlinear normalized image, division of the local nonlinear normalized image, asymmetric generalized Gaussian distribution fitting of the divided sub-images and calculation of parameter estimation according to the downsampled face image to obtain a second parameter estimation value set; inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to predict mole lines and reflection, so as to obtain a classification prediction result; and judging the non-living body attack according to the classification prediction result to obtain a non-living body attack judgment result. It will be appreciated that the computer program of the computer readable storage medium may also perform other method steps of the non-living attack discrimination method applicable to the image when executed by the processor.
According to the method for judging the non-living body attack of the image, firstly, a first parameter estimation value set is obtained through respectively carrying out calculation of a local non-linear normalized image, division of the local non-linear normalized image, asymmetric generalized Gaussian distribution fitting of divided sub-images and calculation of parameter estimation according to the initial face image, and then a second parameter estimation value set is obtained through respectively carrying out calculation of the local non-linear normalized image, division of the local non-linear normalized image, asymmetric generalized Gaussian distribution fitting of the divided sub-images and calculation of parameter estimation, then the first parameter estimation value set and the second parameter estimation value set are input into a target classification prediction model to carry out prediction of mole lines and reflection, a classification prediction result is obtained, finally, non-living body attack judgment is carried out according to the classification prediction result, and the non-living body attack judgment result is obtained, so that whether the mole lines and/or the reflection of the non-living body attack exist or not is found according to the down-sampled face image, the cost is reduced, and the method is suitable for an application scene where the binocular camera cannot be set.
Those skilled in the art will appreciate that implementing all or part of the above-described methods 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. Any reference to memory, storage, database, or other medium provided herein and used in embodiments may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (8)

1. A non-living body attack discrimination method suitable for an image, the method comprising:
acquiring an initial face image and a downsampled face image corresponding to the initial face image;
Respectively carrying out calculation of a local nonlinear normalized image, a plurality of initial sub-images obtained by dividing the local nonlinear normalized image, and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided initial sub-images according to the initial face image to obtain a first parameter estimation value set;
respectively carrying out calculation of a local nonlinear normalized image, a plurality of downsampled sub-images obtained by dividing the local nonlinear normalized image, and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided downsampled sub-images according to the downsampled face image to obtain a second parameter estimation value set;
inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to predict mole lines and reflection, so as to obtain a classification prediction result;
judging the non-living body attack according to the classification prediction result to obtain a non-living body attack judgment result;
the step of judging the non-living body attack according to the classification prediction result to obtain a non-living body attack judgment result comprises the following steps:
when the classification prediction result is that no mole lines and no reflection exist, acquiring a merged image size, updating the preset sub-image size of the division rule of the initial sub-image and the preset sub-image size of the division rule of the downsampled sub-image according to the merged image size, and repeatedly executing the steps of respectively carrying out calculation of the local nonlinear normalized image, the division of the local nonlinear normalized image and the calculation of the asymmetric generalized Gaussian distribution fitting and the parameter estimation of the divided sub-image according to the initial face image until the iteration times reach preset times;
When the classification prediction result is that the moire and/or the reflection exists, determining that the non-living body attack discrimination result is that the non-living body attack exists;
when the classification prediction results are that no mole lines and no reflection exist, determining that the non-living body attack discrimination result is that no non-living body attack exists;
and when the classification prediction result is that no mole lines and no reflection exist, determining that the non-living body attack discrimination result is that no non-living body attack exists, wherein the method comprises the following steps:
when the classification prediction result is that no mole lines and no reflection exist, a preset three-dimensional imaging model is obtained, the initial face image is input into the preset three-dimensional imaging model to carry out three-dimensional surface reconstruction, and a three-dimensional surface image is obtained;
adopting a preset concave-convex judging rule to judge the concave-convex of the three-dimensional surface image to obtain a three-dimensional surface concave-convex judging result;
when the three-dimensional surface concave-convex judging result is that concave-convex exists, determining that the non-living attack judging result is that non-living attack exists;
and when the three-dimensional surface concave-convex judging result is concave-convex, determining that the non-living body attack judging result is non-living body attack.
2. The method for discriminating non-living body attack applicable to an image according to claim 1 wherein said step of obtaining a first set of parameter estimation values by performing calculation of a local non-linear normalized image, calculation of a plurality of initial sub-images obtained by dividing the local non-linear normalized image, and calculation of asymmetric generalized gaussian distribution fitting and parameter estimation for the divided initial sub-images, respectively, based on said initial face image includes:
filtering the initial face image to obtain a first filtered face image;
respectively carrying out local variance calculation and local nonlinear normalization image calculation according to the initial face image and the first filter face image to obtain a first normalization image;
dividing the first normalized image by adopting a sub-image dividing rule to obtain a plurality of initial sub-images;
and carrying out asymmetric generalized Gaussian distribution fitting and parameter estimation calculation on each initial sub-image to obtain the first parameter estimation value set.
3. The non-living body attack discrimination method applied to an image according to claim 2, wherein said step of dividing said first normalized image by using a sub-image division rule to obtain a plurality of said initial sub-images includes:
Adopting a preset segmentation model and a target object of the sub-image segmentation rule to carry out image segmentation and image region acquisition on the first normalized image to obtain a first target image;
dividing the first target image by adopting a preset sub-image size and a preset edge overlapping proportion of the sub-image dividing rule to obtain a sub-image set to be selected;
and acquiring sub-images from the sub-image set to be selected by adopting a sub-image selection rule of the sub-image division rule to obtain a plurality of initial sub-images.
4. The method according to claim 2, wherein the step of obtaining the second parameter estimation value set by performing calculation of local nonlinear normalized images, a plurality of sub-sampled sub-images obtained by dividing the local nonlinear normalized images, and calculation of asymmetric generalized gaussian distribution fitting and parameter estimation for the divided sub-sampled sub-images, respectively, based on the sub-sampled face images, comprises:
filtering the downsampled face image to obtain a second filtered face image;
respectively carrying out local variance calculation and local nonlinear normalization image calculation according to the downsampled face image and the second filtered face image to obtain a second normalization image;
Dividing the second normalized image by adopting the sub-image dividing rule to obtain a plurality of downsampled sub-images;
and carrying out asymmetric generalized Gaussian distribution fitting and parameter estimation calculation on each downsampled sub-image to obtain the second parameter estimation value set.
5. The method for judging whether an image is a living body attack according to claim 1, wherein the step of performing three-dimensional surface roughness judgment on the three-dimensional surface image using a preset roughness judgment rule to obtain a three-dimensional surface roughness judgment result comprises:
carrying out light source direction calculation of each point on the three-dimensional surface image to obtain a light source direction calculation result;
adopting a minimum energy functional method, and respectively carrying out normal calculation of pixel points on the three-dimensional surface image according to the light source direction calculation result to obtain a normal data set;
and adopting a preset concave-convex judging rule, and carrying out three-dimensional surface concave-convex judgment on the three-dimensional surface image according to the normal data set to obtain a three-dimensional surface concave-convex judging result.
6. A non-living-body attack discrimination apparatus adapted to an image for implementing the method of any one of claims 1 to 5, the apparatus comprising:
The image acquisition module is used for acquiring an initial face image and a downsampled face image corresponding to the initial face image;
the first parameter estimation value set determining module is used for respectively carrying out calculation of a local nonlinear normalized image according to the initial face image, a plurality of initial sub-images obtained by dividing the local nonlinear normalized image, and calculation of asymmetric generalized Gaussian distribution fitting and parameter estimation of the divided initial sub-images to obtain a first parameter estimation value set;
the second parameter estimation value set determining module is used for respectively calculating a local nonlinear normalized image according to the downsampled face image, a plurality of downsampled sub-images obtained by dividing the local nonlinear normalized image, and asymmetric generalized Gaussian distribution fitting and parameter estimation calculation of the divided downsampled sub-images to obtain a second parameter estimation value set;
the classification prediction result determining module is used for inputting the first parameter estimation value set and the second parameter estimation value set into a target classification prediction model to predict mole lines and reflection, so as to obtain a classification prediction result;
and the non-living body attack discrimination result determining module is used for carrying out non-living body attack discrimination according to the classification prediction result to obtain a non-living body attack discrimination result.
7. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
CN202110975577.4A 2021-08-24 2021-08-24 Non-living body attack discrimination method, device, equipment and medium suitable for image Active CN113657327B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110975577.4A CN113657327B (en) 2021-08-24 2021-08-24 Non-living body attack discrimination method, device, equipment and medium suitable for image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110975577.4A CN113657327B (en) 2021-08-24 2021-08-24 Non-living body attack discrimination method, device, equipment and medium suitable for image

Publications (2)

Publication Number Publication Date
CN113657327A CN113657327A (en) 2021-11-16
CN113657327B true CN113657327B (en) 2024-03-08

Family

ID=78481807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110975577.4A Active CN113657327B (en) 2021-08-24 2021-08-24 Non-living body attack discrimination method, device, equipment and medium suitable for image

Country Status (1)

Country Link
CN (1) CN113657327B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558794A (en) * 2018-10-17 2019-04-02 平安科技(深圳)有限公司 Image-recognizing method, device, equipment and storage medium based on moire fringes
WO2020199577A1 (en) * 2019-03-29 2020-10-08 北京市商汤科技开发有限公司 Method and device for living body detection, equipment, and storage medium
CN112329612A (en) * 2020-11-03 2021-02-05 北京百度网讯科技有限公司 Living body detection method and device and electronic equipment
CN112861588A (en) * 2019-11-28 2021-05-28 杭州萤石软件有限公司 Living body detection method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558794A (en) * 2018-10-17 2019-04-02 平安科技(深圳)有限公司 Image-recognizing method, device, equipment and storage medium based on moire fringes
WO2020199577A1 (en) * 2019-03-29 2020-10-08 北京市商汤科技开发有限公司 Method and device for living body detection, equipment, and storage medium
CN112861588A (en) * 2019-11-28 2021-05-28 杭州萤石软件有限公司 Living body detection method and device
CN112329612A (en) * 2020-11-03 2021-02-05 北京百度网讯科技有限公司 Living body detection method and device and electronic equipment

Also Published As

Publication number Publication date
CN113657327A (en) 2021-11-16

Similar Documents

Publication Publication Date Title
CN110163235B (en) Training of image enhancement model, image enhancement method, device and storage medium
CN109190581B (en) Image sequence target detection and identification method
CN111080628A (en) Image tampering detection method and device, computer equipment and storage medium
US8325993B2 (en) Standoff and mobile fingerprint collection
JP2015011717A (en) Ghost artifact detection and removal methods in hdr image processing using multi-scale normalized cross-correlation
Cao et al. Boosting structure consistency for multispectral and multimodal image registration
CN111968134B (en) Target segmentation method, device, computer readable storage medium and computer equipment
CN110276831B (en) Method and device for constructing three-dimensional model, equipment and computer-readable storage medium
CN109711419A (en) Image processing method, device, computer equipment and storage medium
CN111145106B (en) Image enhancement method, device, medium and equipment
US20220076119A1 (en) Device and method of training a generative neural network
CN113689578A (en) Human body data set generation method and device
Puthussery et al. Wdrn: A wavelet decomposed relightnet for image relighting
Wu et al. Reflectance-guided histogram equalization and comparametric approximation
CN109447942B (en) Image ambiguity determining method, apparatus, computer device and storage medium
CN112991159B (en) Face illumination quality evaluation method, system, server and computer readable medium
CN112204957A (en) White balance processing method and device, movable platform and camera
CN113657327B (en) Non-living body attack discrimination method, device, equipment and medium suitable for image
CN116798041A (en) Image recognition method and device and electronic equipment
CN117115632A (en) Underwater target detection method, device, equipment and medium
CN115564639A (en) Background blurring method and device, computer equipment and storage medium
CN115482159A (en) Image enhancement method and apparatus
Panwar et al. Inception-based CNN for low-light image enhancement
CN117475357B (en) Monitoring video image shielding detection method and system based on deep learning
Kojima et al. Fast and Effective Scene Segmentation Method for Luminance Adjustment of Multi-Exposure Image

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
GR01 Patent grant
GR01 Patent grant