CN112800847A - Face acquisition source detection method, device, equipment and medium - Google Patents

Face acquisition source detection method, device, equipment and medium Download PDF

Info

Publication number
CN112800847A
CN112800847A CN202011628160.2A CN202011628160A CN112800847A CN 112800847 A CN112800847 A CN 112800847A CN 202011628160 A CN202011628160 A CN 202011628160A CN 112800847 A CN112800847 A CN 112800847A
Authority
CN
China
Prior art keywords
image
face
mask
detected
detection
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.)
Granted
Application number
CN202011628160.2A
Other languages
Chinese (zh)
Other versions
CN112800847B (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.)
Guangzhou Radio & Television Express Information Technology Co ltd
Guangzhou Grg Vision Intelligent Technology Co ltd
Original Assignee
Guangzhou Radio & Television Express Information Technology Co ltd
Guangzhou Grg Vision Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Radio & Television Express Information Technology Co ltd, Guangzhou Grg Vision Intelligent Technology Co ltd filed Critical Guangzhou Radio & Television Express Information Technology Co ltd
Priority to CN202011628160.2A priority Critical patent/CN112800847B/en
Publication of CN112800847A publication Critical patent/CN112800847A/en
Application granted granted Critical
Publication of CN112800847B publication Critical patent/CN112800847B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/165Detection; Localisation; Normalisation using facial parts and geometric relationships
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Abstract

The application provides a face acquisition source detection method and device, computer equipment and a storage medium. The method comprises the following steps: the method comprises the steps of obtaining an image of a face to be detected, obtaining the image type of the image through a first detection model, segmenting the image if the image is of a worn mask type, inputting a face image region which is obtained by segmentation and is not shielded by a mask into a second detection model to obtain an acquisition source detection result of the face to be detected, determining the wearing state of the mask through the first detection model, and determining the acquisition source detection result through the second detection model under the condition that the mask is determined to be worn, so that the accuracy of the acquisition source detection result for identifying the face to be detected is improved.

Description

Face acquisition source detection method, device, equipment and medium
Technical Field
The present application relates to the field of face recognition technologies, and in particular, to a method and an apparatus for detecting a face acquisition source, a computer device, and a storage medium.
Background
With the wide application of the face detection and identification technology, the face living body detection becomes a key link for guaranteeing the safety of the face identification technology, and has important application value. In the case of human face live body detection, it is generally determined whether a human face is a live body by means of motion detection, texture detection, or the like.
In the prior art, when the face of a detected person is shielded, the face cannot be normally detected and identified, and the accuracy of identification and detection is influenced.
Disclosure of Invention
Therefore, it is necessary to provide a method and an apparatus for detecting a face acquisition source, a computer device, and a storage medium for solving the technical problem existing in the prior art that detection accuracy is affected when a face is occluded.
A face acquisition source detection method, the method comprising:
acquiring an image of a face to be detected;
inputting the image into a first detection model trained in advance, and acquiring the image type of the image; the first detection model is used for outputting the image type of the image according to the probability of mask classification in each pixel point of the image; the image type is a worn mask type or an unworn mask type;
if the image is of a type of a worn mask, segmenting the image, inputting a segmented face image region which is not shielded by the mask into a pre-trained second detection model, and obtaining an acquisition source detection result of the face to be detected; the second detection model is used for determining whether the face to be detected is acquired from a target acquisition source or not according to the image characteristics of the local face region and outputting a detection result.
In one embodiment, the method further comprises:
if the image is of a type without a mask, inputting the image into a third detection model for detection to obtain a detection result of an acquisition source of the face to be detected; and the third detection model is used for obtaining an acquisition source detection result of the face to be detected according to the image characteristics of the complete face region.
In one embodiment, the method further comprises:
if the acquisition source of the face to be detected is real person acquisition, first early warning information is sent to an early warning terminal; the first early warning information is used for prompting wearing of the mask.
In one embodiment, the processing of the image by the first detection model includes:
coding the image through a Retina face algorithm, inputting the coded image into a VGGNet neural network for processing, and obtaining a probability matrix of the coded image; the probability matrix comprises the probability that each pixel point in the image belongs to a preset characteristic classification; the preset feature classification at least comprises a facial organ classification and a mask classification;
classifying the characteristic with the highest probability in the preset characteristic classifications corresponding to each pixel point as the characteristic classification of the pixel point;
and acquiring the image type of the image according to the feature classification statistical value of each pixel point.
In one embodiment, the method further comprises:
if the ratio of the number of the pixels belonging to the mask classification in the total number of the pixels is larger than or equal to a preset threshold value, the image is judged to be the type of the worn mask.
In one embodiment, the second detection model is a facebag model; the image segmentation is carried out, and the segmented face image area which is not shielded by the mask is input into a pre-trained second detection model to obtain the acquisition source detection result of the face to be detected, and the acquisition source detection result comprises the following steps:
segmenting the image to obtain a first segmented image; the first segmentation image comprises a face image area which is shielded by a mask and a face image area which is not shielded by the mask;
adjusting the face image area blocked by the mask in the first segmentation image to be a fixed size to obtain a second segmentation image;
and coding the second segmentation image according to the input rule of the faceBagNet model, and inputting the second segmentation image into the faceBagNet model to obtain the acquisition source detection result of the face to be detected.
In one embodiment, after the image is segmented, and a segmented face image region that is not covered by a mask is input into a second detection model trained in advance to obtain an acquisition source detection result of the face to be detected, the method further includes:
if the acquisition source of the face to be detected is non-real person acquisition, sending second early warning information to an early warning terminal; the second early warning information is used for prompting false detection.
A face acquisition source detection apparatus, the apparatus comprising:
the image acquisition module is used for acquiring an image of a face to be detected;
the first detection module is used for inputting the image to a first detection model trained in advance and acquiring the image type of the image; the first detection model is used for outputting the image type of the image according to the probability of mask classification in each pixel point of the image; the image type is a worn mask type or an unworn mask type;
the second detection module is used for segmenting the image if the image is of a type of a worn mask, inputting a face image region which is obtained by segmentation and is not shielded by the mask into a second detection model trained in advance, and obtaining an acquisition source detection result of the face to be detected; the second detection model is used for determining whether the face to be detected is acquired from a target acquisition source or not according to the image characteristics of the local face region and outputting a detection result.
A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the face acquisition source detection method in any of the above embodiments when executing the computer program.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the face acquisition source detection method in any of the above embodiments.
According to the face acquisition source detection method, the face acquisition source detection device, the computer equipment and the storage medium, the image of the face to be detected is obtained, the image type of the image is obtained through the first detection model, if the image is of the type of the worn mask, the image is segmented, the segmented face image area which is not shielded by the mask is input into the second detection model, the acquisition source detection result of the face to be detected is obtained, the mask wearing state is determined through the first detection model, and under the condition that the worn mask is determined, the acquisition source detection result is determined through the second detection model, so that the accuracy of the acquisition source detection result for identifying the face to be detected is improved.
Drawings
FIG. 1 is a schematic flow chart of a face acquisition source detection method in one embodiment;
FIG. 2 is a schematic flow chart of a first inspection model in one embodiment;
FIG. 3 is a schematic flow chart of a first detection model in another embodiment;
FIG. 4 is a schematic flow chart of a first detection model in another embodiment;
FIG. 5 is a flow chart illustrating a method for detecting a face acquisition source in another embodiment;
FIG. 6 is a flow chart illustrating a method for detecting a face acquisition source in another embodiment;
FIG. 7 is a flow chart illustrating a method for detecting a face acquisition source in another embodiment;
FIG. 8 is a block diagram of an embodiment of a face detection apparatus;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that the term "first \ second" related to the embodiments of the present invention merely distinguishes similar objects, and does not represent a specific ordering for the objects, and it should be understood that specific orders or sequences may be interchanged in the case of "first \ second \ third". It should be understood that the terms first, second, and third, as used herein, are interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or otherwise described herein.
In an embodiment, as shown in fig. 1, a method for detecting a face acquisition source is provided, and this embodiment is illustrated by applying the method to a terminal, it is to be understood that the method may also be applied to a server, may also be applied to a system including a terminal and a server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step S101, obtaining an image of a face to be detected.
The images can be acquired in real time through a camera or acquired from other ways. Generally, when a human face image is collected, a camera may collect an image from a real person, such as taking a picture, taking a video, or performing secondary collection on the image, or collecting a scene including an image held by the real person. When the face to be detected is detected, the acquisition source of the face to be detected needs to be identified, so that the accuracy of the detection result caused by the problem of the acquisition source is avoided, and the accuracy of the detection result is ensured.
In specific implementation, the terminal may obtain the image of the face to be detected through the camera device or from the image library.
Step S102, inputting the image into a first detection model trained in advance, and acquiring the image type of the image.
The first detection model can be a pre-trained model such as a neural network model, and can be used for outputting the image type of the image according to the probability of mask classification in each pixel point of the image; the image type may include a worn mask type or an unworn mask type. That is, or, the first detection model may be used to identify whether the face to be detected wears the mask.
In specific implementation, the terminal may input the acquired image of the face to be detected into the first detection model to identify the image type of the face to be detected in the image, for example, the type of the worn mask or the type of the unworn mask.
And S103, if the image is of a type of the worn mask, segmenting the image, inputting the segmented face image area which is not shielded by the mask into a pre-trained second detection model, and obtaining an acquisition source detection result of the face to be detected.
Wherein, to the face image who has worn the gauze mask type, the gauze mask usually has relatively fixed position, and the terminal can be with the image segmentation back, obtains wherein by the part that the gauze mask sheltered from, gathers the source and detect. The second detection model may be a model trained in advance according to a face sample picture with a mask, for example, a FaceBagNet model, and may be used to determine whether a face to be detected is collected from a target set source and output a detection result according to image features of a local face region. The acquisition source may indicate whether the image was acquired from a real person or not, and the case of non-acquisition from a real person may include acquisition from an image, acquisition from a scene in which the real person holds an image, and the like. The terminal can confirm whether the type of the worn mask accords with the established rule according to the collected original detection result. For example, the terminal may set the target acquisition source to be real person acquisition, that is, the image needs to satisfy the type of wearing the mask and the image is acquired from a real person, and it is determined that the face to be detected meets the detection standard.
In specific implementation, when the image is of a type of wearing a mask, the terminal can segment the image to obtain a face image area which is contrary to the mask shielding, and input the face image area into the second detection model to obtain an acquisition source detection result of the face to be detected.
According to the face acquisition source detection method, the image of the face to be detected is acquired, the image type of the image is acquired through the first detection model, if the image is of the type of the worn mask, the image is segmented, the segmented face image area which is not shielded by the mask is input into the second detection model, the acquisition source detection result of the face to be detected is acquired, the mask wearing state is determined through the first detection model, and under the condition that the worn mask is determined, the acquisition source detection result is determined through the second detection model, so that the accuracy of the acquisition source detection result for identifying the face to be detected is improved.
In one embodiment, the method further comprises:
and if the image is of a type without wearing a mask, inputting the image into a third detection model for detection to obtain a detection result of the acquisition source of the face to be detected.
In this embodiment, the third detection model may be configured to obtain an acquisition source detection result of the face to be detected according to the image feature of the complete face region. The third detection model may be a pre-trained Zero-Shot Face Anti-spiofing model (ZSFA, Anti-Face fraud model). When the mask is not worn by the face to be detected of the image obtained by the terminal through the first detection model, the image can be input into the third detection model for detection, and the acquisition source detection result of the face to be detected is obtained. The terminal can be configured with a value detection passing rule, for example, an image collected from a real person wearing the mask can pass the detection, and the state of not wearing the mask is a non-passing state. The terminal can further carry out different early warning treatments according to the acquisition source detection result of the image of the non-worn mask state.
In some embodiments, if the acquisition source of the face to be detected is real person acquisition, the terminal may send first early warning information to the early warning terminal to prompt a detection object corresponding to the face to be detected to wear the mask. The early warning terminal can be a prompting device arranged on the terminal, and can also be audio playing equipment, alarm equipment and the like connected with the terminal.
In some embodiments, if the acquisition source of the face to be detected is non-human acquisition, the terminal may send second early warning information to the early warning terminal to prompt that the detection object corresponding to the face to be detected is false detection.
According to the scheme of the embodiment, the face to be detected of the type without wearing the mask is detected to obtain the detection result of the acquisition source, whether the acquisition source is collected by a real person or not is respectively configured with the corresponding early warning modes, the situations of not wearing the mask and false detection are timely found, and the efficiency and the accuracy of the response of the mask wearing state and the detection result of the acquisition source of the face to be detected are improved.
In one embodiment, the step of determining the processing procedure of the image by the first detection model in step S102 includes:
step S201, the image is coded through a RetinaFace algorithm, and the coded image is input into a VGGNet neural network for processing to obtain a probability matrix of the coded image.
The retinaFace algorithm is a face detection algorithm, and can be a single-step (one stage) inference face detector, and simultaneously outputs face frame and 5 pieces of face key point information. The VGGNet neural network can construct a convolutional neural network with 16-19 layers of depth by repeatedly stacking 3 × 3 small convolutional kernels and 2 × 2 maximum pooling layers, as shown in fig. 2. The method can adopt a VGGNet-16 model, sequentially carry out convolution and pooling on the coded image for multiple times, output the feature vector, and sequentially carry out deconvolution and anti-pooling calculation on the feature vector for multiple times to obtain a probability matrix of the coded image. The probability matrix may include the probability that each pixel in the image belongs to a preset feature classification, and the preset feature classification may include a facial feature classification and a mask classification. As shown in fig. 3, the size of the probability matrix may be the image length multiplied by the image width, the elements of the matrix are probability vectors with a sum of 1, each element of the vector representing a probability of belonging to a certain class. A certain pixel point of the probability matrix is [0.1, 0.0, 0.0, 0.1, 0.0, 0.8], where the first is a probability of belonging to the eye class, the second is a probability of belonging to the mouth, the third is a probability of belonging to the nose, the fourth is a probability of belonging to the eyebrow, the fifth is a probability of the cheek, and the sixth is a probability of belonging to the mask.
Step S202, classifying the characteristic with the highest probability in the preset characteristic classifications corresponding to each pixel point as the characteristic classification of the pixel point;
the terminal can generate a classification matrix of the image according to the probability matrix, and when a certain pixel point of the probability matrix is [0.1, 0.0, 0.0, 0.1, 0.0, 0.8], and the probability value of the sixth element 0.8 is the maximum, the specific classification value of the pixel point can be 6, which indicates that the pixel point belongs to the mask classification. This in turn results in the classification matrix for the image shown in fig. 4.
Step S203, obtaining the image type of the image according to the statistical value of the feature classification of each pixel point.
The terminal can obtain the characteristic classification statistical value of each pixel according to the classification matrix, and determine whether the mask is worn by the detection object according to the proportion of the sum of the number of pixels belonging to the mask classification in the classification matrix to the sum of the number of all pixels in the classification matrix.
According to the scheme of the embodiment, the image is input into the VGGNet neural network for processing, the characteristic classification of the image is obtained, the image type of the face to be detected wearing the mask is obtained according to the statistical value of the characteristic classification of each pixel point, and the efficiency of obtaining the image type of the face to be detected wearing the mask is improved.
In one embodiment, the step of determining the processing procedure of the image by the first detection model in step S102 further includes:
if the ratio of the number of the pixels belonging to the mask classification in the total number of the pixels is larger than or equal to a preset threshold value, the image is judged to be the type of the worn mask.
In this embodiment, the preset threshold may be a percentage, for example, 30%, and the threshold may be determined according to a ratio of the mask area to the face area.
In some cases, if the ratio of the number of pixels belonging to the mask classification to the total number of pixels is smaller than the threshold, it may be determined that the image is of a type without a mask.
According to the technical scheme of the embodiment, the image type of the image is judged by obtaining the statistical value of the number of the pixel points belonging to the mask classification in each pixel point, and the efficiency of obtaining the image type that the detection object is a wearing mask is improved.
In an embodiment, the processing of the image by the first detection model may include encoding the image by an encoding algorithm, and inputting the encoded image into the neural network model for processing to obtain a probability matrix of the encoded image, where the probability matrix includes a probability that each pixel of the image belongs to a preset feature classification, and the preset feature classification at least includes a facial feature classification and a mask classification. And classifying the characteristic with the maximum probability in the preset characteristic classifications corresponding to each pixel point as the characteristic classification of the pixel point. If the ratio of the number of the pixel points belonging to the mask classification in the total number of the pixel points is larger than or equal to a preset threshold value, the image type of the image is judged to be the worn mask type. The coding algorithm may be a face detection algorithm, and may be used to identify key point information of a face. The neural network model may be a convolutional neural network.
Further, the terminal can also obtain a face region image shielded by the mask according to the distribution of the pixel points belonging to the mask classification, and the face region image is input into the mask region identification model to obtain a detection result of whether the face image region is worn by the mask or not. If the ratio of the number of the pixel points belonging to the mask classification in the total pixel point number in the image is larger than or equal to the preset threshold value, and the mask is worn according to the face region image obtained by the distribution of the pixel points belonging to the mask classification, the type of the image can be determined to be the type of the worn mask. The mask region identification model can be a model obtained by training local images of a mask covering region when a face normally wears the mask, and can be used for eliminating the situation that other shelters which are not masks cover the face.
In one embodiment, the second detection model may be a FaceBagNet model, the step S103 is to segment the image, and input the segmented face image region not covered by the mask into the second detection model trained in advance, and the step of obtaining the detection result of the acquisition source of the face to be detected includes:
in step S301, the image is divided to obtain a first divided image.
Specifically, the terminal can be used when the face to be detected is in a worn mask state, and the face is partially shielded, so that the terminal is not suitable for a full-face recognition model. The terminal can divide the image, and the obtained first divided image can contain a face image area shielded by the mask and a face image area not shielded by the mask.
Step S302, adjusting the face image area blocked by the mask in the first segmentation image to a fixed size to obtain a second segmentation image.
Specifically, the terminal may change the size of the face image blocked by the mask, for example, perform resize operation to adjust the image to a fixed size, so as to obtain a second divided image.
And step S303, after the second segmentation image is coded according to the input rule of the faceBagNet model, the second segmentation image is input into the faceBagNet model, and the acquisition source detection result of the face to be detected is obtained.
Specifically, the FaceBagNet model may be a model obtained by training using a face image that is not covered by a mask as training data. The terminal can encode the second segmentation image according to the input rule of the FaceBagNet model to obtain a processed image, input the processed image into the FaceBagNet model, and calculate to obtain an acquisition source detection result of the face to be detected, such as acquisition from a real person or non-acquisition from a real person.
According to the scheme of the embodiment, when the state that the mask is worn is detected, the image is processed and then input into the faceBagNet model for calculation, so that the acquisition source detection result of the face to be detected is obtained, and the efficiency of acquiring the acquisition source detection result is improved.
In one embodiment, in a state of wearing the mask, the feature points of the five sense organs in the face image region which is not blocked by the mask are consistent in each face image. Therefore, the second detection model may be a local recognition model that can be trained from a local region of the human face that includes a specific feature point, where the specific feature point may include at least one of feature points such as an eye and an eyebrow. The terminal can divide the obtained image to obtain a first divided image, the face area which is not shielded by the mask in the first divided image is adjusted to be a fixed size to obtain a second divided image, and the second divided image is used for obtaining an acquisition source detection result of the face to be detected according to the local recognition model, namely whether the face is acquired from a real person or not. In some cases, the second detection model may also be a local recognition model trained from randomly intercepted local regions of the face.
In an embodiment, after the step S103 of segmenting the image, and inputting the segmented face image region that is not covered by the mask into a second detection model trained in advance, and obtaining the acquisition source detection result of the face to be detected, the method further includes:
if the acquisition source of the face to be detected is non-real person acquisition, sending second early warning information to the early warning terminal; the second warning information is used for prompting false detection.
In this embodiment, when the state that the mask is worn is detected, the terminal further detects that the acquisition source of the face to be detected is non-real person acquisition, and the terminal may send second early warning information to the early warning terminal to prompt that the detection object corresponding to the face to be detected is false detection.
In some embodiments, when the state that the mask is worn is detected, the terminal further detects that the acquisition source of the face to be detected is real person acquisition, and the terminal can prompt that the detection is passed.
According to the scheme of the embodiment, the mask wearing type face to be detected is detected to obtain the detection result of the acquisition source, corresponding early warning modes are respectively configured according to whether the acquisition source is acquired by a real person, the false detection situation is found in time, and the mask wearing state and the response efficiency and accuracy of the detection result of the acquisition source of the face to be detected are improved.
In one embodiment, as shown in fig. 5, a face acquisition source detection method is provided, and the method includes:
step S501, obtaining an image of a face to be detected.
Step S502, encoding the image through a RetinaFace algorithm, inputting the encoded image into a VGGNet neural network for processing, and obtaining a probability matrix of the encoded image; the probability matrix comprises the probability of each pixel point in the image belonging to the preset characteristic classification; the preset feature classification at least comprises a facial organ classification and a mask classification; and classifying the characteristic with the highest probability in the preset characteristic classifications corresponding to the pixel points as the characteristic classification of the pixel points.
In step S503, if the ratio of the number of pixels belonging to the mask classification to the total number of pixels is greater than or equal to the preset threshold value, it is determined that the image is of the worn mask type.
Step S5031, segmenting the image to obtain a first segmented image; the first segmentation image comprises a face image area which is shielded by a mask and a face image area which is not shielded by the mask; adjusting the face image area blocked by the mask in the first segmentation image into a fixed size to obtain a second segmentation image; and coding the second segmentation image according to the input rule of the faceBagNet model, and inputting the second segmentation image into the faceBagNet model to obtain the acquisition source detection result of the face to be detected.
Step S5032, if the acquisition source of the face to be detected is real person acquisition, the detection of the face acquisition source is passed; if the acquisition source of the face to be detected is non-real person acquisition, sending second early warning information to the early warning terminal; the second early warning information is used for prompting false detection.
In step S504, if the ratio of the number of pixels belonging to the mask classification to the total number of pixels is smaller than a preset threshold value, it is determined that the image is of a type without a mask.
Step S5041, if the image is of a type without a mask, inputting the image into a ZSFA model for detection to obtain a detection result of a collection source of the face to be detected; the ZSFA model is used for obtaining the acquisition source detection result of the face to be detected according to the image characteristics of the complete face area.
Step S5042, if the acquisition source of the face to be detected is real person acquisition, first early warning information is sent to an early warning terminal; the first early warning information is used for prompting wearing of the mask; if the acquisition source of the face to be detected is non-real person acquisition, sending second early warning information to the early warning terminal; the second early warning information is used for prompting false detection.
In the embodiment, the image of the face to be detected is obtained, the image type of the image is obtained through the first detection model, if the image is of a type of wearing a mask, the image is segmented, and the segmented face image region which is not shielded by the mask is input into the FaceBagNet model, so that the acquisition source detection result of the face to be detected is obtained; if the image is of a type without wearing the mask, the image is input into a ZSFA model to obtain an acquisition source detection result of the face to be detected, the wearing state of the mask is determined through a first detection model, and the acquisition source detection result is determined through a faceBagNet model or the ZSFA model respectively for different states, so that the accuracy of identifying the acquisition source detection result of the face to be detected is improved, different early warning strategies are provided for the wearing state of the mask and the acquisition source detection result, and the detection practicability is further improved.
It should be understood that although the various steps in the flow charts of fig. 1-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-5 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In order to more clearly illustrate the solution provided by the present application, the following describes an application of the face acquisition source detection method according to the above embodiment of the present application, as shown in fig. 6 and fig. 7:
the terminal can acquire a face image of a detection object through the camera when the detection starts, and an image containing a face is obtained. The image is input to a deconvolution neural network model for mask wearing detection.
And if the image is detected to be in a mask wearing state, inputting the image into a faceBagNet model for detection, and determining whether the image is acquired from a real person. And if the image is detected to be in a state of not wearing the mask, inputting the image into an ASFA model for detection, and determining whether the image is acquired from a real person or not.
In one embodiment, as shown in fig. 8, there is provided a face acquisition source detection apparatus 800, the apparatus comprising:
the image acquisition module 801 is used for acquiring an image of a face to be detected;
a first detection module 802, configured to input an image to a first detection model trained in advance, and obtain an image type of the image; the first detection model is used for outputting the image type of the image according to the probability of belonging to the mask classification in each pixel point of the image; the image type is a worn mask type or an unworn mask type;
the second detection module 803 is configured to, if the image is of a type that a mask is worn, segment the image, and input a face image region obtained by segmentation and not blocked by the mask into a second detection model trained in advance to obtain an acquisition source detection result of a face to be detected; the second detection model is used for determining whether the face to be detected is collected in the target collection source or not according to the image characteristics of the local face region and outputting a detection result.
In one embodiment, the apparatus 800 further comprises: the third detection module is used for inputting the image into a third detection model for detection if the image is of a type without wearing a mask, so as to obtain a detection result of an acquisition source of the face to be detected; and the third detection model is used for obtaining an acquisition source detection result of the face to be detected according to the image characteristics of the complete face region.
In one embodiment, the third detection module further comprises: the first early warning unit is used for sending first early warning information to the early warning terminal if the acquisition source of the face to be detected is real person acquisition; the first early warning information is used for prompting wearing of the mask.
In one embodiment, the first detection module 802, comprises: the first detection unit is used for coding the image through a RetinaFace algorithm, inputting the coded image into a VGGNet neural network for processing, and obtaining a probability matrix of the coded image; the probability matrix comprises the probability of each pixel point in the image belonging to the preset characteristic classification; the preset feature classification at least comprises a facial organ classification and a mask classification; classifying the characteristic with the highest probability in the preset characteristic classifications corresponding to each pixel point as the characteristic classification of the pixel point; and acquiring the image type of the image according to the feature classification statistical value of each pixel point.
In one embodiment, the first detection module 802, comprises: and the mask type judging unit is used for judging that the image is the type of the worn mask if the proportion of the number of the pixels belonging to the mask classification in the total number of the pixels is greater than or equal to a preset threshold value.
In one embodiment, the second detection model is a facebag model, and the second detection module 803 includes: the second detection unit is used for segmenting the image to obtain a first segmented image; the first segmentation image comprises a face image area which is shielded by a mask and a face image area which is not shielded by the mask; adjusting the face image area blocked by the mask in the first segmentation image into a fixed size to obtain a second segmentation image; and coding the second segmentation image according to the input rule of the faceBagNet model, and inputting the second segmentation image into the faceBagNet model to obtain the acquisition source detection result of the face to be detected.
In one embodiment, the second detection module 803 further includes: the second early warning unit is used for sending second early warning information to the early warning terminal if the acquisition source of the face to be detected is non-real person acquisition; the second early warning information is used for prompting false detection.
For specific limitations of the face acquisition source detection apparatus 800, reference may be made to the above limitations on the face acquisition source detection method, which is not described herein again. All or part of the modules in the face acquisition source detection device 800 can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
The face acquisition source detection method provided by the application can be applied to computer equipment, the computer equipment can be a terminal, and the internal structure diagram can be shown in fig. 9. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a face acquisition source detection method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the above-described method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A face acquisition source detection method is characterized by comprising the following steps:
acquiring an image of a face to be detected;
inputting the image into a first detection model trained in advance, and acquiring the image type of the image; the first detection model is used for outputting the image type of the image according to the probability of mask classification in each pixel point of the image; the image type is a worn mask type or an unworn mask type;
if the image is of a type of a worn mask, segmenting the image, inputting a segmented face image region which is not shielded by the mask into a pre-trained second detection model, and obtaining an acquisition source detection result of the face to be detected; the second detection model is used for determining whether the face to be detected is acquired from a target acquisition source or not according to the image characteristics of the local face region and outputting a detection result.
2. The method of claim 1, further comprising:
if the image is of a type without a mask, inputting the image into a third detection model for detection to obtain a detection result of an acquisition source of the face to be detected; and the third detection model is used for obtaining an acquisition source detection result of the face to be detected according to the image characteristics of the complete face region.
3. The method of claim 2, further comprising:
if the acquisition source of the face to be detected is real person acquisition, first early warning information is sent to an early warning terminal; the first early warning information is used for prompting wearing of the mask.
4. The method of claim 1, wherein the processing of the image by the first detection model comprises:
coding the image through a Retina face algorithm, inputting the coded image into a VGGNet neural network for processing, and obtaining a probability matrix of the coded image; the probability matrix comprises the probability that each pixel point in the image belongs to a preset characteristic classification; the preset feature classification at least comprises a facial organ classification and a mask classification;
classifying the characteristic with the highest probability in the preset characteristic classifications corresponding to each pixel point as the characteristic classification of the pixel point;
and acquiring the image type of the image according to the feature classification statistical value of each pixel point.
5. The method of claim 4, further comprising:
if the ratio of the number of the pixels belonging to the mask classification in the total number of the pixels is larger than or equal to a preset threshold value, the image is judged to be the type of the worn mask.
6. The method of claim 1, wherein the second detection model is a FaceBagNet model; the image segmentation is carried out, and the segmented face image area which is not shielded by the mask is input into a pre-trained second detection model to obtain the acquisition source detection result of the face to be detected, and the acquisition source detection result comprises the following steps:
segmenting the image to obtain a first segmented image; the first segmentation image comprises a face image area which is shielded by a mask and a face image area which is not shielded by the mask;
adjusting the face image area blocked by the mask in the first segmentation image to be a fixed size to obtain a second segmentation image;
and coding the second segmentation image according to the input rule of the faceBagNet model, and inputting the second segmentation image into the faceBagNet model to obtain the acquisition source detection result of the face to be detected.
7. The method according to any one of claims 1 to 6, wherein the image is segmented, and after the segmented face image region which is not covered by the mask is input into a second detection model trained in advance to obtain the detection result of the acquisition source of the face to be detected, the method further comprises:
if the acquisition source of the face to be detected is non-real person acquisition, sending second early warning information to an early warning terminal; the second early warning information is used for prompting false detection.
8. A face acquisition source detection apparatus, the apparatus comprising:
the image acquisition module is used for acquiring an image of a face to be detected;
the first detection module is used for inputting the image to a first detection model trained in advance and acquiring the image type of the image; the first detection model is used for outputting the image type of the image according to the probability of mask classification in each pixel point of the image; the image type is a worn mask type or an unworn mask type;
the second detection module is used for segmenting the image if the image is of a type of a worn mask, inputting a face image region which is obtained by segmentation and is not shielded by the mask into a second detection model trained in advance, and obtaining an acquisition source detection result of the face to be detected; the second detection model is used for determining whether the face to be detected is acquired from a target acquisition source or not according to the image characteristics of the local face region and outputting a detection result.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202011628160.2A 2020-12-30 2020-12-30 Face acquisition source detection method, device, equipment and medium Active CN112800847B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011628160.2A CN112800847B (en) 2020-12-30 2020-12-30 Face acquisition source detection method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011628160.2A CN112800847B (en) 2020-12-30 2020-12-30 Face acquisition source detection method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112800847A true CN112800847A (en) 2021-05-14
CN112800847B CN112800847B (en) 2023-03-24

Family

ID=75807948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011628160.2A Active CN112800847B (en) 2020-12-30 2020-12-30 Face acquisition source detection method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112800847B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807332A (en) * 2021-11-19 2021-12-17 珠海亿智电子科技有限公司 Mask robust face recognition network, method, electronic device and storage medium
CN114255517A (en) * 2022-03-02 2022-03-29 中运科技股份有限公司 Scenic spot tourist behavior monitoring system and method based on artificial intelligence analysis

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016370A (en) * 2017-04-10 2017-08-04 电子科技大学 One kind is based on the enhanced partial occlusion face identification method of data
US20190095764A1 (en) * 2017-09-26 2019-03-28 Panton, Inc. Method and system for determining objects depicted in images
CN111340014A (en) * 2020-05-22 2020-06-26 支付宝(杭州)信息技术有限公司 Living body detection method, living body detection device, living body detection apparatus, and storage medium
CN111428671A (en) * 2020-03-31 2020-07-17 杭州博雅鸿图视频技术有限公司 Face structured information identification method, system, device and storage medium
CN111428559A (en) * 2020-02-19 2020-07-17 北京三快在线科技有限公司 Method and device for detecting wearing condition of mask, electronic equipment and storage medium
CN111797773A (en) * 2020-07-07 2020-10-20 广州广电卓识智能科技有限公司 Method, device and equipment for detecting occlusion of key parts of human face
CN111967296A (en) * 2020-06-28 2020-11-20 北京中科虹霸科技有限公司 Iris living body detection method, entrance guard control method and entrance guard control device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016370A (en) * 2017-04-10 2017-08-04 电子科技大学 One kind is based on the enhanced partial occlusion face identification method of data
US20190095764A1 (en) * 2017-09-26 2019-03-28 Panton, Inc. Method and system for determining objects depicted in images
CN111428559A (en) * 2020-02-19 2020-07-17 北京三快在线科技有限公司 Method and device for detecting wearing condition of mask, electronic equipment and storage medium
CN111428671A (en) * 2020-03-31 2020-07-17 杭州博雅鸿图视频技术有限公司 Face structured information identification method, system, device and storage medium
CN111340014A (en) * 2020-05-22 2020-06-26 支付宝(杭州)信息技术有限公司 Living body detection method, living body detection device, living body detection apparatus, and storage medium
CN111967296A (en) * 2020-06-28 2020-11-20 北京中科虹霸科技有限公司 Iris living body detection method, entrance guard control method and entrance guard control device
CN111797773A (en) * 2020-07-07 2020-10-20 广州广电卓识智能科技有限公司 Method, device and equipment for detecting occlusion of key parts of human face

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李奇林等: "基于扫描聚类的人脸跟踪算法", 《计算机与数字工程》 *
王志一等: "人脸识别中发型遮挡检测方法研究", 《微型机与应用》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113807332A (en) * 2021-11-19 2021-12-17 珠海亿智电子科技有限公司 Mask robust face recognition network, method, electronic device and storage medium
CN114255517A (en) * 2022-03-02 2022-03-29 中运科技股份有限公司 Scenic spot tourist behavior monitoring system and method based on artificial intelligence analysis

Also Published As

Publication number Publication date
CN112800847B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
CN108921159B (en) Method and device for detecting wearing condition of safety helmet
CN110826519B (en) Face shielding detection method and device, computer equipment and storage medium
CN108537152B (en) Method and apparatus for detecting living body
CN109101923B (en) Method and device for detecting mask wearing condition of person
CN108805828B (en) Image processing method, device, computer equipment and storage medium
CN109299658B (en) Face detection method, face image rendering device and storage medium
CN112800847B (en) Face acquisition source detection method, device, equipment and medium
CN112580660B (en) Image processing method, image processing device, computer equipment and readable storage medium
CN111754396A (en) Face image processing method and device, computer equipment and storage medium
CN111259815A (en) Method, system, equipment and medium for evaluating quality of face image
CN111339813A (en) Face attribute recognition method and device, electronic equipment and storage medium
CN112528764A (en) Facial expression recognition method, system and device and readable storage medium
CN112989910A (en) Power target detection method and device, computer equipment and storage medium
Balasubramaniam Facemask detection algorithm on COVID community spread control using EfficientNet algorithm
CN113705294A (en) Image identification method and device based on artificial intelligence
CN113179421B (en) Video cover selection method and device, computer equipment and storage medium
CN112364846B (en) Face living body identification method and device, terminal equipment and storage medium
CN111488779A (en) Video image super-resolution reconstruction method, device, server and storage medium
CN113963162A (en) Helmet wearing identification method and device, computer equipment and storage medium
CN115191004A (en) Information processing method, information processing system, and information processing apparatus
CN113947795B (en) Mask wearing detection method, device, equipment and storage medium
CN115830381A (en) Improved YOLOv 5-based detection method for mask not worn by staff and related components
KR20200072586A (en) Deep learning-based image on personal information image processing apparatus and method therefor
CN111353330A (en) Image processing method, image processing device, electronic equipment and storage medium
CN115424001A (en) Scene similarity estimation method and device, computer equipment and storage medium

Legal Events

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