CN112507903B - False face detection method, false face detection device, electronic equipment and computer readable storage medium - Google Patents

False face detection method, false face detection device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN112507903B
CN112507903B CN202011473875.5A CN202011473875A CN112507903B CN 112507903 B CN112507903 B CN 112507903B CN 202011473875 A CN202011473875 A CN 202011473875A CN 112507903 B CN112507903 B CN 112507903B
Authority
CN
China
Prior art keywords
face
image
probability value
false
region
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
CN202011473875.5A
Other languages
Chinese (zh)
Other versions
CN112507903A (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
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202011473875.5A priority Critical patent/CN112507903B/en
Publication of CN112507903A publication Critical patent/CN112507903A/en
Application granted granted Critical
Publication of CN112507903B publication Critical patent/CN112507903B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to an image processing technology, and discloses a false face detection method, which comprises the following steps: performing frequency domain conversion and high-pass filtering on the original face image to obtain an initial face image and calculating to obtain a first false face probability value; the method comprises the steps of performing face detection on an original face image to obtain a face frame, performing expansion or contraction operation on the face frame by using a preset proportion to obtain a face intercepted image set, performing fine granularity classification treatment to obtain a fine granularity probability value set, and fusing to obtain a second false face probability value; and carrying out weighted fusion on the two probability values to obtain a face detection probability value, comparing the face detection probability value with a preset detection threshold value, and judging whether the original face image is a false face judgment result. The invention also relates to blockchain techniques, the decision results, etc. may be stored in blockchain nodes. The invention also discloses a fake face detection device, electronic equipment and a storage medium. The invention can solve the problems of insufficient detection precision and long time consumption of the detection algorithm of the existing detection method.

Description

False face detection method, false face detection device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for detecting a false face, an electronic device, and a computer readable storage medium.
Background
Along with the wide application of face recognition and face unlocking technologies in various large fields, various academia and industry are increasingly concerned about face anti-counterfeiting and face living detection. At present, a large amount of black products are synthesized into faces through high-end technology to attack various large face recognition systems, the fidelity of face synthesis is higher and higher, and the attack success rate is greatly improved. In particular, the defenses of the matched living body detection in front of the face synthesis are not strong.
The false face synthesis detection method at the present stage is to calculate the gradient amplitude and texture contrast of the edge of the face and judge the face synthesis by analyzing the chromaticity and saturation of the skin color. When the method is used for extracting the facial features, the problem that the extracted features cannot well express the characteristics of the synthesized facial features exists, so that the feature characterization capability is insufficient, the detection precision is insufficient, and the detection algorithm consumes a long time.
Disclosure of Invention
The invention provides a false face detection method, a false face detection device, electronic equipment and a computer readable storage medium, which mainly aim to solve the problem that characteristics extracted by the existing detection method cannot well express characteristics of a synthetic face.
In order to achieve the above object, the present invention provides a method for detecting a false face, including:
Acquiring an original face image, and performing frequency domain conversion and high-pass filtering treatment on the original face image to obtain an original face image;
Calculating the initial face image by using a pre-constructed lightweight deep learning model to obtain a first false face probability value;
Performing face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and performing expansion or contraction operation on the face frame to obtain face truncated image sets with different sizes;
Carrying out fine granularity classification processing on the face truncated image set by using a pre-constructed fine granularity classification model to obtain a fine granularity probability value set corresponding to the face screenshot image set, and fusing the fine granularity probability value set to obtain a second false face probability value;
Carrying out weighted fusion processing on the first false face probability value and the second false face probability value to obtain a human face detection probability value;
detecting whether the original face is a false face or not according to the face detection probability value, and obtaining a detection result;
And when the detection result is a false face, sending the judgment result to a preset terminal.
Optionally, the calculating the initial face image by using the pre-constructed lightweight deep learning model to obtain a first false face probability value includes:
extracting features of the initial face image by using the lightweight deep learning model to obtain initial image features;
and carrying out probability calculation on the initial image features according to the classification function in the lightweight deep learning model to obtain a first false face probability value.
Optionally, the detecting the face contour of the original face image by using a preset face detection algorithm to obtain a face frame, and performing expansion or contraction operation on the face frame to obtain a face truncated image set with different sizes, including:
Performing face detection processing on the original face image by using a preset face detection algorithm to obtain one or more face frames;
performing expansion or contraction operation on the face frame by using a preset proportion to obtain a face expansion frame and a face contraction frame;
The original face image is intercepted by the face enlarging frame and the face reducing frame respectively, so that a face area image set is obtained;
and scaling the face region image set according to a preset size to obtain face truncated image sets with different sizes.
Optionally, the performing fine granularity classification processing on the face truncated image set by using a pre-constructed fine granularity classification model to obtain a fine granularity probability value set corresponding to the face screenshot image set, and fusing the fine granularity probability value set to obtain a second false face probability value, including:
Extracting features of the face truncated images in the face truncated image set to obtain truncated image features;
carrying out probability calculation on the intercepted image features by using a preset classification function to obtain a first fine granularity probability value;
Performing region information extraction processing on the intercepted image features through a preset first region target network, and cutting the intercepted image according to the extracted region information to obtain a first region diagram;
Scaling the first region map according to a preset scaling size, inputting the first region map into a preset second region target network to obtain a second region map, and performing probability calculation on the second region map by using a classification layer in the second region target network to obtain a second fine-grained probability value;
taking the second region diagram as input of a preset third region target network to obtain a third region diagram and a third fine-grained probability value, and taking the third region diagram as input of a preset fourth region target network to obtain a fourth region diagram and a fourth fine-grained probability value;
And summarizing the first fine granularity probability value, the second fine granularity probability value, the third fine granularity probability value and the fourth fine granularity probability value to obtain a second false face probability value.
Optionally, the performing frequency domain conversion and high-pass filtering on the original face image to obtain an initial face image includes:
carrying out space rapid conversion on the original face image to obtain a rapid frequency domain image;
filtering the rapid frequency domain image by using a preset filtering function to obtain a filtered image;
And carrying out frequency domain inverse transformation on the filtered image to obtain an initial face image.
Optionally, the performing spatial fast conversion on the original face image to obtain a fast frequency domain image includes:
Carrying out space rapid conversion on the original face image by using a preset first conversion formula to obtain a pixel value F (u, v) of a rapid frequency domain image:
Where F (x, y) represents the pixel value of the original face image, F (u, v) represents the pixel value of the fast frequency domain image, M, N represents the width and height of the original face image, and j is a fixed parameter in the fast fourier transform function.
Optionally, the filtering processing is performed on the fast frequency domain image by using a preset filtering function to obtain a filtered image, including:
and filtering the rapid frequency domain image by using the following filtering function to obtain a filtered image:
where H (u, v) is the pixel value of the filtered image, F (u, v) is the pixel value of the fast frequency domain image, and D 0 and n are fixed parameters.
In order to solve the above-mentioned problems, the present invention also provides a false face detection apparatus, the apparatus comprising:
The device comprises an initial face image acquisition module, a processing module and a processing module, wherein the initial face image acquisition module is used for acquiring an initial face image, and performing frequency domain conversion and high-pass filtering processing on the initial face image to obtain the initial face image;
the first false face probability value calculation module is used for calculating the initial face image by utilizing a pre-constructed lightweight deep learning model to obtain a first false face probability value;
The face intercepting image set acquisition module is used for carrying out face contour detection on the original face image by utilizing a preset face detection algorithm to obtain a face frame, and carrying out expansion or contraction operation on the face frame to obtain face intercepting image sets with different sizes;
The second false face probability value calculation module is used for carrying out fine granularity classification processing on the face interception image set by utilizing a pre-constructed fine granularity classification model to obtain a fine granularity probability value set corresponding to the face screenshot image set, and fusing the fine granularity probability value set to obtain a second false face probability value;
The weighted fusion module is used for carrying out weighted fusion processing on the first false face probability value and the second false face probability value to obtain a face detection probability value;
and the false face judging module is used for comparing the human face detection probability value with a preset detection threshold value to obtain a judging result of whether the original human face image is a false face or not, and transmitting the judging result to a preset terminal.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the above-described face detection method.
In order to solve the above-described problems, the present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described false face detection method.
According to the embodiment of the invention, an original face image is firstly obtained, frequency domain conversion and high-pass filtering processing are carried out on the original face image, so that an original face image is obtained, the face image is converted to a spatial domain by utilizing the frequency domain conversion, and low-frequency components in the image can be filtered out by the high-pass filtering processing. Calculating the initial face image by using a pre-constructed lightweight deep learning model to obtain a first false face probability value; and carrying out face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and carrying out expansion or contraction operation on the face frame to obtain face truncated image sets with different sizes, wherein the face truncated image sets comprise pictures with different sizes, so that the robustness of subsequent model training is improved. Carrying out fine granularity classification processing on the face truncated image set by using a pre-constructed fine granularity classification model to obtain a fine granularity probability value set corresponding to the face screenshot image set, and fusing the fine granularity probability value set to obtain a second false face probability value; carrying out weighted fusion processing on the first false face probability value and the second false face probability value to obtain a human face detection probability value; and comparing the face detection probability value with a preset detection threshold value to obtain a judging result of whether the original face image is a false face or not, and transmitting the judging result to a preset terminal. Therefore, the false face detection method, the false face detection device and the computer readable storage medium can improve the efficiency of the false face detection method and solve the problem that the characteristics extracted by the existing detection method can not well express the characteristics of the synthetic face.
Drawings
Fig. 1 is a schematic flow chart of a false face detection method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating one of the steps in the face detection method shown in FIG. 1;
fig. 3 is a schematic block diagram of a false face detection device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an internal structure of an electronic device for implementing a false face detection method according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a false face detection method, and an execution subject of the false face detection method comprises, but is not limited to, at least one of a server, a terminal and the like which can be configured to execute the method provided by the embodiment of the application. In other words, the face detection method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to fig. 1, a flow chart of a face detection method according to an embodiment of the present invention is shown. In this embodiment, the method for detecting a false face includes:
s1, acquiring an original face image, and performing frequency domain conversion and high-pass filtering processing on the original face image to obtain an initial face image.
The embodiment of the invention synthesizes the face through a high-end technology to acquire the original face image.
Further, referring to fig. 2, in the embodiment of the present invention, performing frequency domain conversion and high-pass filtering on the original face image to obtain an initial face image includes:
S11, performing space rapid conversion on the original face image to obtain a rapid frequency domain image;
s12, filtering the rapid frequency domain image by using a preset filtering function to obtain a filtered image;
S13, performing frequency domain inverse transformation on the filtered image to obtain an initial face image.
Specifically, the performing spatial fast conversion on the original face image to obtain a fast frequency domain image includes:
Carrying out space rapid conversion on the original face image by using a preset first conversion formula to obtain a pixel value F (u, v) of a rapid frequency domain image:
Where F (x, y) represents the pixel value of the original face image, F (u, v) represents the pixel value of the fast frequency domain image, M, N represents the width and height of the original face image, and j is a fixed parameter in the fast fourier transform function.
In detail, light interference such as ambient light exists in the fast frequency domain image, so a filtering function needs to be designed to perform filtering processing on the fast frequency domain image, so as to filter low-frequency components in the fast frequency domain image.
Further, the embodiment of the invention utilizes a preset filtering function to carry out filtering processing on the rapid frequency domain image to obtain a filtered image:
where H (u, v) is the pixel value of the filtered image, F (u, v) is the pixel value of the fast frequency domain image, and D 0 and n are fixed parameters.
Preferably, n takes 3 and D0 takes 130.
Specifically, the performing frequency domain inverse transformation on the filtered image to obtain an initial face image includes:
Performing frequency domain inverse conversion on the filtered image by using a preset second conversion formula to obtain a pixel value L (a, b) of the initial face image:
Wherein L (a, b) is a pixel value of the initial face image, X, Y represents a width and a height of the filtered image, and j is a fixed parameter in the fast fourier transform function.
S2, calculating the initial face image by using a pre-constructed lightweight deep learning model to obtain a first false face probability value.
In the embodiment of the present invention, the calculating the initial face image by using the pre-constructed lightweight deep learning model to obtain a first false face probability value includes:
extracting features of the initial face image by using the lightweight deep learning model to obtain initial image features;
And carrying out probability calculation on the initial image features according to a classification function, such as a softmax function, in the lightweight deep learning model to obtain a first false face probability value.
The embodiment of the invention firstly converts the image on the space domain into the frequency domain, filters light and other interferences through high-pass filtering and restores the light and other interferences into an RGB image, inputs the RGB image into the lightweight model master_se_ resnet and outputs the classification probability of the first model.
S3, carrying out face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and carrying out expansion or contraction operation on the face frame to obtain face intercepted image sets with different sizes.
In the embodiment of the present invention, the preset face detection algorithm may be an existing lightweight face detector centerface.
In detail, in the embodiment of the present invention, the step of performing face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and performing expansion or contraction operation on the face frame to obtain a face truncated image set with different sizes includes:
Performing face detection processing on the original face image by using a preset face detection algorithm to obtain one or more face frames;
performing expansion or contraction operation on the face frame by using a preset proportion to obtain a face expansion frame and a face contraction frame;
The original face image is intercepted by the face enlarging frame and the face reducing frame respectively, so that a face area image set is obtained;
and scaling the face region image set according to a preset size to obtain face truncated image sets with different sizes.
Further, in the embodiment of the invention, a scaling (resolution) module in TensorFlow is adopted to perform scaling processing on the screenshot image set, so as to obtain the face-truncated image sets with different sizes.
And S4, carrying out fine granularity classification processing on the face truncated image set by utilizing a pre-constructed fine granularity classification model to obtain a fine granularity probability value set corresponding to the face screenshot image set, and fusing the fine granularity probability value set to obtain a second false face probability value.
In the embodiment of the invention, the fine-grained classification model can be a master_RA-CNN model.
Specifically, the performing fine-granularity classification processing on the face truncated image set by using a pre-constructed fine-granularity classification model to obtain a fine-granularity probability value set corresponding to the face screenshot image set, and fusing the fine-granularity probability value set to obtain a second false face probability value, including:
Extracting features of the face truncated images in the face truncated image set to obtain truncated image features;
carrying out probability calculation on the intercepted image features by using a preset classification function to obtain a first fine granularity probability value;
performing region information extraction processing on the intercepted image features through a preset first region target network, and cutting the intercepted image according to the extracted region information to obtain a first region diagram;
Scaling the first region map according to a preset scaling size, inputting the first region map into a preset second region target network to obtain a second region map, and performing probability calculation on the second region map by using a classification layer in the second region target network to obtain a second fine-grained probability value;
taking the second region diagram as input of a preset third region target network to obtain a third region diagram and a third fine-grained probability value, and taking the third region diagram as input of a preset fourth region target network to obtain a fourth region diagram and a fourth fine-grained probability value;
And summarizing the first fine granularity probability value, the second fine granularity probability value, the third fine granularity probability value and the fourth fine granularity probability value to obtain a second false face probability value.
In detail, the feature extraction is performed on the face truncated image by using a preset master_se_ resnet basic network, so as to obtain the feature of the truncated image.
Preferably, the classification function may be a softmax function.
Specifically, the extracting the region information from the intercepted image feature through a preset first region target network, and cutting the intercepted image according to the extracted region information to obtain a first region map, which includes:
Performing connection calculation on the intercepted image features by using a preset full connection layer to obtain an output value set;
Normalizing the output value set to obtain a coordinate set;
and cutting out the intercepted image according to the coordinate set to obtain a first area diagram.
In detail, the output value set includes 3 values, respectively: tx, ty, tl, from which a square region can be determined, tx, ty being the center point representing the region and tl representing the side length of the region.
Specifically, 3 values in the output value set are multiplied by the size of the input graph, tx, ty, tl are restored to the original image, and the finally obtained coordinates are obtained: att_x=tx 244, att_y=ty 244, att_l=tl 244, a first region map cut out from the cut-out image can be obtained according to the coordinates.
Further, the summarizing the first fine granularity probability value, the second fine granularity probability value, the third fine granularity probability value and the fourth fine granularity probability value to obtain a second false face probability value includes:
Wherein RA cls is a second pseudo-face probability value, cls1, cls2, cls3, cls4 are a first fine granularity probability value, a second fine granularity probability value, a third fine granularity probability value, and a fourth fine granularity probability value, respectively.
And S5, carrying out weighted fusion processing on the first false face probability value and the second false face probability value to obtain a face detection probability value.
In the embodiment of the present invention, the weighted fusion processing is performed on the first false face probability value and the second false face probability value, and the obtained face detection probability value is weighted fusion processing by using a preset weighted formula, including:
P(cls)=0.625*RAcls+0.375*Recls
Wherein P (cls) is a face detection probability value, re cls is a first false face probability value, and RA cls is a second false face probability value.
S6, detecting whether the original face is a false face or not according to the face detection probability value, and obtaining a detection result; and when the detection result is a false face, sending the judgment result to a preset terminal.
In the embodiment of the present invention, the comparison between the face detection probability value and the preset detection threshold value is performed by combining a preset decision formula to obtain a decision result of whether the original face image is a false face, including:
The judging formula is as follows:
Wherein y is a judgment result, and N is a preset detection threshold.
Preferably, in the embodiment of the present invention, N is 0.65.
Fig. 3 is a schematic block diagram of a false face detection device according to an embodiment of the present invention.
The fake face detection apparatus 100 according to the present invention may be mounted in an electronic device. Depending on the implemented functions, the false face detection device 100 may include an initial face image acquisition module 101, a first false face probability value calculation module 102, a face truncated image set acquisition module 103, a second false face probability value calculation module 104, a weighted fusion module 105, and a false face determination module 106. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
The initial face image obtaining module 101 is configured to obtain an original face image, and perform frequency domain conversion and high-pass filtering on the original face image to obtain an initial face image;
the first false face probability value calculation module 102 is configured to calculate the initial face image by using a pre-constructed lightweight deep learning model to obtain a first false face probability value;
the face truncated image set obtaining module 103 is configured to perform face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and perform expansion or contraction operation on the face frame to obtain face truncated image sets with different sizes;
The second false face probability value calculation module 104 is configured to perform fine-grained classification processing on the face truncated image set by using a pre-built fine-grained classification model to obtain a fine-grained probability value set corresponding to the face screenshot image set, and fuse the fine-grained probability value set to obtain a second false face probability value;
the weighted fusion module 105 is configured to perform weighted fusion processing on the first false face probability value and the second false face probability value to obtain a face detection probability value;
the false face judging module 106 is configured to compare the face detection probability value with a preset detection threshold value to obtain a judging result of whether the original face image is a false face, and transmit the judging result to a preset terminal.
In detail, the specific embodiments of the modules of the face detection apparatus 100 are as follows:
step one, the initial face image obtaining module 101 obtains an original face image, and performs frequency domain conversion and high-pass filtering processing on the original face image to obtain an initial face image.
The embodiment of the invention synthesizes the face through a high-end technology to acquire the original face image.
Further, in the embodiment of the present invention, the initial face image obtaining module 101 performs frequency domain conversion and high-pass filtering processing on the original face image to obtain an initial face image, including:
carrying out space rapid conversion on the original face image to obtain a rapid frequency domain image;
filtering the rapid frequency domain image by using a preset filtering function to obtain a filtered image;
And carrying out frequency domain inverse transformation on the filtered image to obtain an initial face image.
Specifically, the performing spatial fast conversion on the original face image to obtain a fast frequency domain image includes:
Carrying out space rapid conversion on the original face image by using a preset first conversion formula to obtain a pixel value F (u, v) of a rapid frequency domain image:
Where F (x, y) represents the pixel value of the original face image, F (u, v) represents the pixel value of the fast frequency domain image, M, N represents the width and height of the original face image, and j is a fixed parameter in the fast fourier transform function.
In detail, light interference such as ambient light exists in the fast frequency domain image, so a filtering function needs to be designed to perform filtering processing on the fast frequency domain image, so as to filter low-frequency components in the fast frequency domain image.
Further, the embodiment of the invention utilizes a preset filtering function to carry out filtering processing on the rapid frequency domain image to obtain a filtered image:
where H (u, v) is the pixel value of the filtered image, F (u, v) is the pixel value of the fast frequency domain image, and D 0 and n are fixed parameters.
Preferably, n takes 3 and D0 takes 130.
Specifically, the performing frequency domain inverse transformation on the filtered image to obtain an initial face image includes:
Performing frequency domain inverse conversion on the filtered image by using a preset second conversion formula to obtain a pixel value L (a, b) of the initial face image:
Wherein L (a, b) is a pixel value of the initial face image, X, Y represents a width and a height of the filtered image, and j is a fixed parameter in the fast fourier transform function.
And step two, the first false face probability value calculation module 102 calculates the initial face image by using a pre-constructed lightweight deep learning model to obtain a first false face probability value.
In the embodiment of the present invention, the first false face probability value calculating module 102 calculates the initial face image by using a pre-constructed lightweight deep learning model, so as to obtain a first false face probability value, including:
extracting features of the initial face image by using the lightweight deep learning model to obtain initial image features;
And carrying out probability calculation on the initial image features according to a classification function, such as a softmax function, in the lightweight deep learning model to obtain a first false face probability value.
The embodiment of the invention firstly converts the image on the space domain into the frequency domain, filters light and other interferences through high-pass filtering and restores the light and other interferences into an RGB image, inputs the RGB image into the lightweight model master_se_ resnet and outputs the classification probability of the first model.
Step three, the face truncated image set obtaining module 103 performs face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and performs expansion or contraction operation on the face frame to obtain face truncated image sets with different sizes.
In the embodiment of the present invention, the preset face detection algorithm may be an existing lightweight face detector centerface.
In detail, in the embodiment of the present invention, the face truncated image set obtaining module 103 performs face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, performs expansion or contraction operation on the face frame to obtain face truncated image sets with different sizes, including:
Performing face detection processing on the original face image by using a preset face detection algorithm to obtain one or more face frames;
performing expansion or contraction operation on the face frame by using a preset proportion to obtain a face expansion frame and a face contraction frame;
The original face image is intercepted by the face enlarging frame and the face reducing frame respectively, so that a face area image set is obtained;
and scaling the face region image set according to a preset size to obtain face truncated image sets with different sizes.
Further, in the embodiment of the invention, a scaling (resolution) module in TensorFlow is adopted to perform scaling processing on the screenshot image set, so as to obtain the face-truncated image sets with different sizes.
And step four, the second false face probability value calculation module 104 performs fine granularity classification processing on the face truncated image set by using a pre-built fine granularity classification model to obtain a fine granularity probability value set corresponding to the face truncated image set, and fuses the fine granularity probability value set to obtain a second false face probability value.
In the embodiment of the invention, the fine-grained classification model can be a master_RA-CNN model.
Specifically, the second false face probability value calculation module 104 performs fine granularity classification processing on the face truncated image set by using a pre-constructed fine granularity classification model to obtain a fine granularity probability value set corresponding to the face screenshot image set, and fuses the fine granularity probability value set to obtain a second false face probability value, which includes:
Extracting features of the face truncated images in the face truncated image set to obtain truncated image features;
carrying out probability calculation on the intercepted image features by using a preset classification function to obtain a first fine granularity probability value;
performing region information extraction processing on the intercepted image features through a preset first region target network, and cutting the intercepted image according to the extracted region information to obtain a first region diagram;
Scaling the first region map according to a preset scaling size, inputting the first region map into a preset second region target network to obtain a second region map, and performing probability calculation on the second region map by using a classification layer in the second region target network to obtain a second fine-grained probability value;
taking the second region diagram as input of a preset third region target network to obtain a third region diagram and a third fine-grained probability value, and taking the third region diagram as input of a preset fourth region target network to obtain a fourth region diagram and a fourth fine-grained probability value;
And summarizing the first fine granularity probability value, the second fine granularity probability value, the third fine granularity probability value and the fourth fine granularity probability value to obtain a second false face probability value.
In detail, the feature extraction is performed on the face truncated image by using a preset master_se_ resnet basic network, so as to obtain the feature of the truncated image.
Preferably, the classification function may be a softmax function.
Specifically, the extracting the region information from the intercepted image feature through a preset first region target network, and cutting the intercepted image according to the extracted region information to obtain a first region map, which includes:
Performing connection calculation on the intercepted image features by using a preset full connection layer to obtain an output value set;
Normalizing the output value set to obtain a coordinate set;
and cutting out the intercepted image according to the coordinate set to obtain a first area diagram.
In detail, the output value set includes 3 values, respectively: tx, ty, tl, from which a square region can be determined, tx, ty being the center point representing the region and tl representing the side length of the region.
Specifically, 3 values in the output value set are multiplied by the size of the input graph, tx, ty, tl are restored to the original image, and the finally obtained coordinates are obtained: att_x=tx 244, att_y=ty 244, att_l=tl 244, a first region map cut out from the cut-out image can be obtained according to the coordinates.
Further, the summarizing the first fine granularity probability value, the second fine granularity probability value, the third fine granularity probability value and the fourth fine granularity probability value to obtain a second false face probability value includes:
Wherein RA cls is a second pseudo-face probability value, cls1, cls2, cls3, cls4 are a first fine granularity probability value, a second fine granularity probability value, a third fine granularity probability value, and a fourth fine granularity probability value, respectively.
And step five, the weighted fusion module 105 performs weighted fusion processing on the first false face probability value and the second false face probability value to obtain a face detection probability value.
In the embodiment of the present invention, the weighted fusion module 105 performs weighted fusion processing on the first false face probability value and the second false face probability value, so as to obtain a face detection probability value, where the weighted fusion processing is performed by using a preset weighted formula, and the weighted fusion processing includes:
P(cls)=0.625*RAcls+0.375*Recls
Wherein P (cls) is a face detection probability value, re cls is a first false face probability value, and RA cls is a second false face probability value.
Step six, the false face judging module 106 detects whether the original face is a false face according to the face detection probability value, and obtains a detection result; and when the detection result is a false face, sending the judgment result to a preset terminal.
In the embodiment of the present invention, the false face determining module 106 compares the face detection probability value with a preset detection threshold value in combination with a preset determining formula to obtain a determination result of whether the original face image is a false face, including:
The judging formula is as follows:
Wherein y is a judgment result, and N is a preset detection threshold.
Preferably, in the embodiment of the present invention, N is 0.65.
Fig. 4 is a schematic structural diagram of an electronic device implementing the method for detecting a false face according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a false face detection program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of the false face detection program 12, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects respective components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device 1 and processes data by running or executing programs or modules (for example, executing a false face detection program or the like) stored in the memory 11, and calling data stored in the memory 11.
The bus may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
Fig. 4 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
Further, the electronic device 1 may also comprise a network interface, optionally the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
The electronic device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The false face detection program 12 stored in the memory 11 in the electronic device 1 is a combination of a plurality of instructions, which when executed in the processor 10, may implement:
Acquiring an original face image, and performing frequency domain conversion and high-pass filtering treatment on the original face image to obtain an original face image;
Calculating the initial face image by using a pre-constructed lightweight deep learning model to obtain a first false face probability value;
Performing face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and performing expansion or contraction operation on the face frame to obtain face truncated image sets with different sizes;
Carrying out fine granularity classification processing on the face truncated image set by using a pre-constructed fine granularity classification model to obtain a fine granularity probability value set corresponding to the face screenshot image set, and fusing the fine granularity probability value set to obtain a second false face probability value;
Carrying out weighted fusion processing on the first false face probability value and the second false face probability value to obtain a human face detection probability value;
detecting whether the original face is a false face or not according to the face detection probability value, and obtaining a detection result;
And when the detection result is a false face, sending the judgment result to a preset terminal.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile, for example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
Acquiring an original face image, and performing frequency domain conversion and high-pass filtering treatment on the original face image to obtain an original face image;
Calculating the initial face image by using a pre-constructed lightweight deep learning model to obtain a first false face probability value;
Performing face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and performing expansion or contraction operation on the face frame to obtain face truncated image sets with different sizes;
Carrying out fine granularity classification processing on the face truncated image set by using a pre-constructed fine granularity classification model to obtain a fine granularity probability value set corresponding to the face screenshot image set, and fusing the fine granularity probability value set to obtain a second false face probability value;
Carrying out weighted fusion processing on the first false face probability value and the second false face probability value to obtain a human face detection probability value;
detecting whether the original face is a false face or not according to the face detection probability value, and obtaining a detection result;
And when the detection result is a false face, sending the judgment result to a preset terminal.
Further, the computer-usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying diagram representation in the claims should not be considered as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (9)

1. A method of false face detection, the method comprising:
Acquiring an original face image, and performing frequency domain conversion and high-pass filtering treatment on the original face image to obtain an original face image;
Calculating the initial face image by using a pre-constructed lightweight deep learning model to obtain a first false face probability value;
Performing face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and performing expansion or contraction operation on the face frame to obtain face truncated image sets with different sizes;
extracting features of the face truncated images in the face truncated image set by using a pre-constructed fine-granularity classification model to obtain truncated image features;
Carrying out probability calculation on the intercepted image features by using a classification function of the fine granularity classification model to obtain a first fine granularity probability value;
Performing region information extraction processing on the intercepted image features through a first region target network of the fine-granularity classification model, and cutting the intercepted image according to the extracted region information to obtain a first region diagram, wherein the method comprises the following steps of: performing connection calculation on the intercepted image features by using a preset full connection layer to obtain an output value set, performing normalization processing on the output value set to obtain a coordinate set, and cutting the intercepted image according to the coordinate set to obtain a first region diagram;
scaling the first region map according to a preset scaling size, inputting the first region map into a second region target network of the fine-granularity classification model to obtain a second region map, and performing probability calculation on the second region map by using a classification layer in the second region target network to obtain a second fine-granularity probability value;
Taking the second region diagram as the input of a third region target network of the fine-grained classification model to obtain a third region diagram and a third fine-grained probability value, and taking the third region diagram as the input of a fourth region target network of the fine-grained classification model to obtain a fourth region diagram and a fourth fine-grained probability value;
summarizing the first fine granularity probability value, the second fine granularity probability value, the third fine granularity probability value and the fourth fine granularity probability value to obtain a second false face probability value;
Carrying out weighted fusion processing on the first false face probability value and the second false face probability value to obtain a human face detection probability value;
Detecting whether the original face is a false face or not according to the face detection probability value, and obtaining a judging result; and when the judging result is a false face, sending the judging result to a preset terminal.
2. The method of claim 1, wherein the calculating the initial face image using the pre-constructed lightweight deep learning model to obtain the first false face probability value comprises:
extracting features of the initial face image by using the lightweight deep learning model to obtain initial image features;
and carrying out probability calculation on the initial image features according to the classification function in the lightweight deep learning model to obtain a first false face probability value.
3. The false face detection method as set forth in claim 1, wherein the step of performing face contour detection on the original face image by using a preset face detection algorithm to obtain a face frame, and performing expansion or contraction operation on the face frame to obtain a face truncated image set with different sizes includes:
Performing face detection processing on the original face image by using a preset face detection algorithm to obtain one or more face frames;
performing expansion or contraction operation on the face frame by using a preset proportion to obtain a face expansion frame and a face contraction frame;
The original face image is intercepted by the face enlarging frame and the face reducing frame respectively, so that a face area image set is obtained;
and scaling the face region image set according to a preset size to obtain face truncated image sets with different sizes.
4. The method of claim 1, wherein performing frequency domain conversion and high pass filtering on the original face image to obtain an initial face image comprises:
carrying out space rapid conversion on the original face image to obtain a rapid frequency domain image;
filtering the rapid frequency domain image by using a preset filtering function to obtain a filtered image;
And carrying out frequency domain inverse transformation on the filtered image to obtain an initial face image.
5. The method of claim 4, wherein the performing spatial fast transformation on the original face image to obtain a fast frequency domain image comprises:
Carrying out space rapid conversion on the original face image by using a preset first conversion formula to obtain a pixel value F (u, v) of a rapid frequency domain image:
Where F (x, y) represents the pixel value of the original face image, F (u, v) represents the pixel value of the fast frequency domain image, M, N represents the width and height of the original face image, and j is a fixed parameter in the fast fourier transform function.
6. The method of claim 4, wherein filtering the fast frequency domain image with a predetermined filter function to obtain a filtered image comprises:
and filtering the rapid frequency domain image by using the following filtering function to obtain a filtered image:
where H (u, v) is the pixel value of the filtered image, F (u, v) is the pixel value of the fast frequency domain image, and D 0 and n are fixed parameters.
7. A false face detection apparatus, the apparatus comprising:
The device comprises an initial face image acquisition module, a processing module and a processing module, wherein the initial face image acquisition module is used for acquiring an initial face image, and performing frequency domain conversion and high-pass filtering processing on the initial face image to obtain the initial face image;
the first false face probability value calculation module is used for calculating the initial face image by utilizing a pre-constructed lightweight deep learning model to obtain a first false face probability value;
The face intercepting image set acquisition module is used for carrying out face contour detection on the original face image by utilizing a preset face detection algorithm to obtain a face frame, and carrying out expansion or contraction operation on the face frame to obtain face intercepting image sets with different sizes;
The second false face probability value calculation module is used for carrying out feature extraction on the face truncated images in the face truncated image set by utilizing the pre-constructed fine-granularity classification model to obtain truncated image features; carrying out probability calculation on the intercepted image features by using a classification function of the fine granularity classification model to obtain a first fine granularity probability value; performing region information extraction processing on the intercepted image features through a first region target network of the fine-granularity classification model, and cutting the intercepted image according to the extracted region information to obtain a first region diagram, wherein the method comprises the following steps of: performing connection calculation on the intercepted image features by using a preset full connection layer to obtain an output value set, performing normalization processing on the output value set to obtain a coordinate set, and cutting the intercepted image according to the coordinate set to obtain a first region diagram; scaling the first region map according to a preset scaling size, inputting the first region map into a second region target network of the fine-granularity classification model to obtain a second region map, and performing probability calculation on the second region map by using a classification layer in the second region target network to obtain a second fine-granularity probability value; taking the second region diagram as the input of a third region target network of the fine-grained classification model to obtain a third region diagram and a third fine-grained probability value, and taking the third region diagram as the input of a fourth region target network of the fine-grained classification model to obtain a fourth region diagram and a fourth fine-grained probability value; summarizing the first fine granularity probability value, the second fine granularity probability value, the third fine granularity probability value and the fourth fine granularity probability value to obtain a second false face probability value;
The weighted fusion module is used for carrying out weighted fusion processing on the first false face probability value and the second false face probability value to obtain a face detection probability value;
and the false face judging module is used for comparing the human face detection probability value with a preset detection threshold value to obtain a judging result of whether the original human face image is a false face or not, and transmitting the judging result to a preset terminal.
8. An electronic device, the electronic device comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the face detection method of any one of claims 1 to 6.
9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method of false face detection as claimed in any one of claims 1 to 6.
CN202011473875.5A 2020-12-15 False face detection method, false face detection device, electronic equipment and computer readable storage medium Active CN112507903B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011473875.5A CN112507903B (en) 2020-12-15 False face detection method, false face detection device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011473875.5A CN112507903B (en) 2020-12-15 False face detection method, false face detection device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112507903A CN112507903A (en) 2021-03-16
CN112507903B true CN112507903B (en) 2024-05-10

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705392A (en) * 2019-09-17 2020-01-17 Oppo广东移动通信有限公司 Face image detection method and device and storage medium
CN110781770A (en) * 2019-10-08 2020-02-11 高新兴科技集团股份有限公司 Living body detection method, device and equipment based on face recognition
CN112052876A (en) * 2020-08-04 2020-12-08 烽火通信科技股份有限公司 Improved RA-CNN-based fine-grained image detection method and system
WO2020244151A1 (en) * 2019-06-05 2020-12-10 平安科技(深圳)有限公司 Image processing method and apparatus, terminal, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020244151A1 (en) * 2019-06-05 2020-12-10 平安科技(深圳)有限公司 Image processing method and apparatus, terminal, and storage medium
CN110705392A (en) * 2019-09-17 2020-01-17 Oppo广东移动通信有限公司 Face image detection method and device and storage medium
CN110781770A (en) * 2019-10-08 2020-02-11 高新兴科技集团股份有限公司 Living body detection method, device and equipment based on face recognition
CN112052876A (en) * 2020-08-04 2020-12-08 烽火通信科技股份有限公司 Improved RA-CNN-based fine-grained image detection method and system

Similar Documents

Publication Publication Date Title
US8792722B2 (en) Hand gesture detection
TW201627917A (en) Method and device for face in-vivo detection
CN112507922B (en) Face living body detection method and device, electronic equipment and storage medium
CN111898538B (en) Certificate authentication method and device, electronic equipment and storage medium
CN112507934A (en) Living body detection method, living body detection device, electronic apparatus, and storage medium
CN105405130B (en) License image highlight detection method and device based on cluster
CN112651953B (en) Picture similarity calculation method and device, computer equipment and storage medium
CN109508636A (en) Vehicle attribute recognition methods, device, storage medium and electronic equipment
CN109816694A (en) Method for tracking target, device and electronic equipment
CN111639704A (en) Target identification method, device and computer readable storage medium
CN112347526A (en) Information security protection method and device based on anti-shooting screen, electronic equipment and medium
CN112132812A (en) Certificate checking method and device, electronic equipment and medium
CN109657543A (en) Flow of the people monitoring method, device and terminal device
CN111695615A (en) Vehicle damage assessment method and device based on artificial intelligence, electronic equipment and medium
CN112037235B (en) Injury picture automatic auditing method and device, electronic equipment and storage medium
CN112528903B (en) Face image acquisition method and device, electronic equipment and medium
CN112862703B (en) Image correction method and device based on mobile photographing, electronic equipment and medium
CN106845520B (en) A kind of image processing method and terminal
CN112507903B (en) False face detection method, false face detection device, electronic equipment and computer readable storage medium
CN115690615B (en) Video stream-oriented deep learning target recognition method and system
CN112633183B (en) Automatic detection method and device for image shielding area and storage medium
CN115601684A (en) Emergency early warning method and device, electronic equipment and storage medium
CN113792671A (en) Method and device for detecting face synthetic image, electronic equipment and medium
US20220222967A1 (en) Retrieval device, control method, and non-transitory storage medium
CN114049676A (en) Fatigue state detection method, device, equipment and storage medium

Legal Events

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