Face image detection model training method, face image detection method and device
By assigning blurred scores to the face image dataset and performing blurred processing, a blurred picture is generated for training the face image detection model, which solves the problem that traditional detection methods are difficult to accurately judge the blurredness of face images, and achieves more accurate and comprehensive face image detection.
Patent Information
- Application Number
- CN202210324547.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-03-29
AI Technical Summary
Traditional face image detection methods are difficult to accurately determine whether the entire face image is blurred, and they rely solely on edge information.
By obtaining the clear face area data set, the face area image is assigned a blur score based on the preset blur information, and the corresponding blur method is called for processing, and the blurred picture is generated to train the face image detection model.
The trained face image detection model can more accurately and comprehensively detect the blur of face images, improving the generalization performance of the detection model.
Smart Images

Figure CN114708633B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the field of image processing technology, and more specifically, to a face image detection model training method, a face image detection method and a face image detection device. Background Art
[0002] At present, the application fields of face image detection are becoming more and more extensive. Face images can be presented in the form of pictures, photos and other carriers. Considering whether the image is clear, caution is required when applying these face images. It is necessary to detect the face image before application to determine whether the face image is blurred.
[0003] In traditional face image detection methods, methods such as the Laplacian operator are usually used to determine whether a face is blurred using only edges. These methods usually cannot accurately determine whether the entire face image is blurred. Summary of the invention
[0004] In order to at least partially solve the technical problems mentioned in the background technology, the solution of the present disclosure provides a face image detection model training method, a face image detection method and a device.
[0005] According to a first aspect of the present disclosure, the present disclosure provides a method for training a face image detection model, wherein the method comprises: obtaining a first clear face area data set; assigning a fuzzification score to a face area picture in the first clear face area data set according to preset fuzzification information, and calling a fuzzification method to fuzzify the face area picture according to the fuzzification score to obtain a blurred picture, wherein the preset fuzzification information comprises a plurality of fuzzification scores, a plurality of fuzzification parameters corresponding to each fuzzification score, and a fuzzification method corresponding to each fuzzification parameter, the fuzzification score is a score after the picture is blurred, the fuzzification method is a method for blurring the picture, and the fuzzification parameter is a fuzzification parameter used by the fuzzification method to obtain the blurred score; the face image detection model is trained through the blurred picture.
[0006] Optionally, acquiring the first clear face area data set includes: acquiring a preset clear portrait data set; and obtaining the first clear face area data set by using a face detection algorithm according to the preset clear portrait data set.
[0007] Optionally, the preset clear portrait data set includes a self-built data set.
[0008] Optionally, obtaining the first clear face area data set through a face detection algorithm based on the preset clear portrait data set includes: detecting a face frame of each portrait in the preset clear portrait data set through the face detection algorithm; and capturing all of the face frames as the first clear face area data set.
[0009] Optionally, according to the preset blur information, a blur score is assigned to the face area image in the first clear face area data set, and a blur method is called according to the blur score to blur the face area image, and obtaining the blurred image includes: for the face area image, randomly selecting one of the blur scores according to the preset blur information; randomly selecting a blur parameter from a plurality of blur parameters corresponding to the randomly selected blur score; and configuring a corresponding blur method according to the randomly selected blur parameter to blur the face area image to obtain the blurred image.
[0010] Optionally, before assigning a fuzzification score to the face area image in the first clear face area data set according to preset fuzzification information, and calling a fuzzification method to fuzzify the face area image according to the fuzzification score to obtain the blurred image, the method also includes: creating the preset fuzzification information.
[0011] Optionally, the creation of the preset blur information includes: obtaining a second clear face area data set; determining a plurality of blur methods for blurring the second clear face area data set; using any one of the plurality of blur methods to blur the second clear face area data set to obtain a blurred image as a benchmark blurred image; according to preset scoring rules, determining a picture to be scored in the benchmark blurred image and scoring it to obtain a benchmark scored image; according to the benchmark scored image, determining parameters used by any one of the blur methods in obtaining the benchmark scored image as benchmark parameters; using unused blur methods among the plurality of blur methods to obtain a benchmark scored image. The method performs blurring processing on the second clear face area data set to obtain a blurred image as a relative blurred image; taking the benchmark scored image as a benchmark, determining in the relative blurred image an image with the same blur as the benchmark scored image and giving the same score to obtain a relative scored image; according to the relative scored image, determining the parameters used by the corresponding blurring method when obtaining the relative scored image as relative parameters; taking the score of the benchmark scored image as the blurring score, taking the benchmark parameters and the relative parameters as blurring parameters, and determining the preset blurring information according to the blurring score, the blurring parameters and the corresponding blurring method.
[0012] Optionally, the fuzzification method includes a downsampling fuzzification method, a neural network fuzzification method, a Gaussian fuzzification method, a median filtering fuzzification method and a mosaic fuzzification method.
[0013] Optionally, the neural network fuzzy method includes a fuzzy method using a preset image generation model.
[0014] According to a second aspect of the present disclosure, the present disclosure provides a face image detection method, wherein the method comprises: obtaining a face image to be detected; obtaining face area data based on the face image to be detected; inputting the face area data into a face image detection model to obtain a face image detection result of the face image to be detected, wherein the face image detection model is trained by the above-mentioned face image detection model training method.
[0015] Optionally, the facial image detection method further includes: refining the scoring according to the scoring in the facial image detection result and the confidence value corresponding to the scoring.
[0016] According to a third aspect of the present disclosure, the present disclosure provides a face image detection model training device, wherein the device includes: a first acquisition module, which is used to acquire a first clear face area data set; a blurring module, which is used to assign a blurring score to a face area picture in the first clear face area data set according to preset blurring information, and call a blurring method to blur the face area picture according to the blurring score to obtain a blurred picture, wherein the preset blurring information includes multiple blurring scores, multiple blurring parameters corresponding to each blurring score, and a blurring method corresponding to each blurring parameter, the blurring score is the score after the picture is blurred, the blurring method is a method for blurring the picture, and the blurring parameter is the blurring parameter used by the blurring method to obtain the blurred score; a training module, which is used to train the face image detection model through the blurred picture.
[0017] Optionally, the first acquisition module is used to acquire the first clear face area data set in the following manner: acquiring a preset clear portrait data set; and obtaining the first clear face area data set through a face detection algorithm based on the preset clear portrait data set.
[0018] Optionally, the preset clear portrait data set includes a self-built data set.
[0019] Optionally, the first acquisition module is used to obtain the first clear face area data set according to the preset clear portrait data set through a face detection algorithm in the following manner: detect the face frame of each portrait in the preset clear portrait data set through the face detection algorithm; and capture all of the face frames as the first clear face area data set.
[0020] Optionally, the blurring module is used to assign a blurring score to the face area image in the first clear face area data set according to preset blurring information in the following manner, and call a blurring method to blur the face area image according to the blurring score to obtain a blurred image: for the face area image, randomly select one of the blurring scores according to the preset blurring information; randomly select a blurring parameter from a plurality of blurring parameters corresponding to the randomly selected blurring score; configure a corresponding blurring method according to the randomly selected blurring parameter to blur the face area image to obtain the blurred image.
[0021] Optionally, the face image detection model training device also includes: a creation module, which is used to create the preset blurring information.
[0022] Optionally, the creation module is used to create the preset blur information in the following manner: obtain a second clear face area data set; determine a plurality of blur methods for blurring the second clear face area data set; use any one of the plurality of blur methods to blur the second clear face area data set to obtain a blurred image as a benchmark blurred image; according to preset scoring rules, determine a picture to be scored in the benchmark blurred image and score it to obtain a benchmark scored image; according to the benchmark scored image, determine the parameters used by any one of the blur methods when obtaining the benchmark scored image as benchmark parameters; use an unused one of the plurality of blur methods The second clear face area data set is fuzzified by a fuzzification method to obtain a blurred image as a relative blurred image; taking the benchmark scored image as a benchmark, determining an image with the same blur as the benchmark scored image in the relative blurred image and giving the same score to obtain a relative scored image; according to the relative scored image, determining the parameters used by the corresponding fuzzification method when obtaining the relative scored image as relative parameters; taking the score of the benchmark scored image as the fuzzification score, taking the benchmark parameters and the relative parameters as fuzzification parameters, and determining the preset fuzzification information according to the fuzzification score, the fuzzification parameters and the corresponding fuzzification method.
[0023] Optionally, the fuzzification method includes a downsampling fuzzification method, a neural network fuzzification method, a Gaussian fuzzification method, a median filtering fuzzification method and a mosaic fuzzification method.
[0024] Optionally, the neural network fuzzy method includes a fuzzy method using a preset image generation model.
[0025] According to a fourth aspect of the present disclosure, the present disclosure provides a face image detection device, wherein the device includes: a second acquisition module, which is used to acquire a face image to be detected; a third acquisition module, which is used to acquire face area data based on the face image to be detected; a detection module, which is used to input the face area data into a face image detection model to obtain a face image detection result of the face image to be detected, wherein the face image detection model is trained by the above-mentioned face image detection model training device.
[0026] Optionally, the face image detection device further includes: a refined scoring module, which is used to refine the scoring according to the score in the face image detection result and the confidence value corresponding to the score.
[0027] According to the fifth aspect of the present disclosure, the present disclosure provides an electronic device, wherein the electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the method of the first aspect of the present disclosure or the method of the second aspect of the present disclosure.
[0028] According to a sixth aspect of the present disclosure, the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed, it implements the method of the first aspect of the present disclosure or implements the method of the second aspect of the present disclosure.
[0029] Through the face image detection model training method disclosed in the present invention, a large number of clear face images can be assigned different scores and different blurring methods can be used to perform different blurring processes to obtain diversified blurred images, and the face image detection model can be trained using the blurred images obtained online, thereby training a face image detection model that can perform more accurate and comprehensive blurriness detection on the entire face image, effectively improving the generalization performance of the face image blurriness detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0031] Figure 1 is a flowchart showing a method for training a face image detection model according to an embodiment of the present disclosure;
[0032] Figure 2 is a flowchart illustrating a method for training a face image detection model according to another embodiment of the present disclosure;
[0033] Figure 3 is an architectural diagram showing a preset image generation model according to an embodiment of the present disclosure;
[0034] Figure 4 is a diagram showing an architecture of a detail feature encryption unit in a preset image generation model according to an embodiment of the present disclosure;
[0035] Figure 5 is an architectural diagram showing a general feature encryption unit in a preset image generation model according to an embodiment of the present disclosure;
[0036] Figure 6 is a flow chart showing a method for detecting a face image according to an embodiment of the present disclosure;
[0037] Figure 7 is a flow chart showing a face image detection method according to another embodiment of the present disclosure;
[0038] Figure 8 is a schematic block diagram showing a face image detection model training device according to an embodiment of the present disclosure;
[0039] Fig. 9 is a schematic block diagram showing a face image detection model training device according to another embodiment of the present disclosure;
[0040] Fig.10 is a schematic block diagram showing a face image detection device according to an embodiment of the present disclosure;
[0041] Fig.11 is a schematic block diagram showing a face image detection device according to another embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0043] The specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0044] The present disclosure provides a method for training a face image detection model. Figure 1 , Figure 1 FIG. 1 is a flowchart showing a method for training a face image detection model according to an embodiment of the present disclosure. Figure 1 As shown in , the face image detection model training method includes the following steps S101-S103. Step S101: Obtain a first clear face area data set. Step S102: According to the preset blurring information, assign a blurring score to the face area picture in the first clear face area data set, and call a blurring method to blur the face area picture according to the blurring score to obtain a blurred picture. The preset blurring information includes multiple blurring scores, multiple blurring parameters corresponding to each blurring score, and a blurring method corresponding to each blurring parameter. The blurring score is the score after the picture is blurred, the blurring method is a method for blurring the picture, and the blurring parameter is the blurring parameter used by the blurring method to obtain the blurred score. Step S103: Train the face image detection model through the blurred picture.
[0045] Through the face image detection model training method disclosed in the present invention, a large number of clear face images can be assigned different scores and different blurring methods can be used to perform different blurring processes to obtain diversified blurred images, and the face image detection model can be trained using the blurred images obtained online, thereby training a face image detection model that can perform more accurate and comprehensive blurriness detection on the entire face image, effectively improving the generalization performance of the face image detection model.
[0046] In step S101, a first clear face region data set may be acquired.
[0047] According to an embodiment of the present disclosure, the face image detection model is a classification model for detecting face blur. Before using the model to detect face blur, the model needs to be trained. In order to train the face image detection model, it is first necessary to obtain a clear face area dataset, which can be, for example, a high-definition picture dataset.
[0048] In one embodiment, obtaining the first clear face area data set may include: obtaining a preset clear portrait data set; obtaining the first clear face area data set through a face detection algorithm according to the preset clear portrait data set. The preset clear portrait data set may include a self-built data set, and the size of the self-built data set may be, for example, about 50,000 images, and of course, may also include any other applicable data sets. In addition, the portraits in the preset clear portrait data set may include photos and pictures containing facial images. After obtaining the preset clear portrait data set, the face area may be extracted from each portrait through a face detection algorithm to form a face area data set. It is worth noting that the self-built data set in the preset clear portrait data set is a clear picture data set, for example, a high-definition picture data set, and the face area data set extracted by the face detection algorithm is a clear picture data set, for example, a high-definition picture data set.
[0049] Specifically, the method of obtaining the first clear face area data set through a face detection algorithm according to the preset clear portrait data set includes: detecting the face frame of each portrait in the preset clear portrait data set through the face detection algorithm; and intercepting all the face frames as the first clear face area data set. Among them, the face detection algorithm may include a general target detection algorithm, such as the yolo series algorithm, CenterNet, etc., or a special face detection algorithm, such as MTCNN, CenterFace, PCN, etc., which are not limited here. By detecting the preset clear portrait data set using a face detection algorithm, the face frame of each portrait in the data set can be obtained, and then all the face frames can be directly intercepted as the face area data set.
[0050] In another embodiment, a pre-prepared clear face region dataset may be directly called. The clear face region dataset may be obtained in advance by the method of the above embodiment, or by any other applicable method. The clear face region dataset may be, for example, a high-definition picture dataset.
[0051] In step S102, a fuzzification score can be assigned to the face area image in the first clear face area data set according to the preset fuzzification information, and a fuzzification method can be called according to the fuzzification score to perform fuzzification processing on the face area image to obtain a fuzzified image. The preset fuzzification information includes a plurality of fuzzification scores, a plurality of fuzzification parameters corresponding to each fuzzification score, and a fuzzification method corresponding to each fuzzification parameter. The fuzzification score is the score after the image is blurred, the fuzzification method is a method for blurring the image, and the fuzzification parameter is a fuzzification parameter used by the fuzzification method to obtain the fuzzified score.
[0052] According to an embodiment of the present disclosure, after obtaining a clear face region data set, the face region image to be blurred can be given a blurred score according to the fuzzy score in the preset fuzzy information, and then the fuzzy method is called to obtain a blurred image corresponding to the given score through the correspondence between the fuzzy score, fuzzy parameter and fuzzy method in the preset fuzzy information, so that the blurred image and the corresponding score can be obtained. The correspondence includes: each fuzzy score corresponds to a plurality of fuzzy parameters, and each fuzzy parameter corresponds to a fuzzy method. It should be understood that the types of fuzzy parameters corresponding to different fuzzy scores are the same and the parameter values of the same fuzzy parameter corresponding to different fuzzy scores are different. For example, one score corresponds to 5 different fuzzy parameters, and other scores also correspond to these 5 different fuzzy parameters, while the specific parameter value of a fuzzy parameter corresponding to one score is different from the specific parameter value of the same fuzzy parameter corresponding to another score.
[0053] The fuzzy score is a gradient score, for example, it can include n+1 score levels from 0 to n, where n is a positive integer, and 0 represents the maximum fuzziness, and n represents clarity. It is worth noting that when the fuzzy score is full, the corresponding relationship between the fuzzy score, fuzzy parameters and fuzzification method still exists, but the various fuzzy parameters corresponding to the full fuzzy score are all specific values, such as 0.
[0054] And the fuzzification method may include downsampling fuzzification method, neural network fuzzification method, Gaussian fuzzification method, median filtering fuzzification method and mosaic fuzzification method, etc.
[0055] In one embodiment, according to the preset blurring information, a blurring score is assigned to the face area image in the first clear face area data set, and a blurring method is called according to the blurring score to blur the face area image. Obtaining the blurred image may include: for the face area image, randomly selecting one of the blurring scores according to the preset blurring information; randomly selecting a blurring parameter from a plurality of blurring parameters corresponding to the randomly selected blurring score; and configuring a corresponding blurring method according to the randomly selected blurring parameter to blur the face area image to obtain the blurred image.
[0056] According to this embodiment, different blurring processes can be performed on the clear picture to be blurred according to the expected blurring score through different blurring methods. Due to different blurring parameters, each blurring method can obtain a blurred picture with different blurring degrees. And if the expected blurring score is full score, since a corresponding blurring parameter randomly selected according to the score is a specific value, the corresponding blurring method can be configured according to the specific value, so that the blurring process of the blurring method is equivalent to no process, that is, invalid process. For example, configuring the corresponding blurring method according to the specific value may include: when the blurring parameter is a specific value, selecting a parameter that makes the blurring process of the blurring method invalid according to the specific value, such as selecting parameter 0; configuring the blurring method using the invalid parameter, such as weighting with 0, etc., so that a clear picture can be obtained as a blurred picture after blurring. Therefore, through this scheme, a clear picture and blurred pictures with different blurring degrees and different blurring types can be obtained, thereby obtaining a variety of face area pictures.
[0057] For example, the preset blur information may include a blur score of 11 levels, for example, 0-10 points, where 0 points indicates the most blurry and 10 points indicates clear. Each blur score corresponds to, for example, 5 blur parameters, each blur parameter corresponds to a blur method, where the blur parameter corresponding to 10 points is a specific value, for example, 0. The 5 blur parameters are, for example, parameters of a downsampling blur method, parameters of a neural network blur method, parameters of a Gaussian blur method, parameters of a median filter blur method, and parameters of a mosaic blur method.
[0058] After obtaining a clear face area data set, a score can be randomly selected from 11 blur scores of 0-10 for the face area images in the data set, for example, 3 points are randomly selected, and then a blur parameter is randomly selected from the above 5 blur parameters corresponding to 3 points, such as a downsampling blur method parameter, and then the downsampling blur method is called according to the downsampling blur method parameter and configured using the parameter, so that the downsampling blur method configured with the parameter can obtain a picture with a blur degree of 3 points after blurring the picture. When the randomly selected score is 10 points, a fuzzification parameter is randomly selected from the above 5 fuzzification parameters corresponding to 10 points, such as the downsampling fuzzification method parameter. Since the parameter value of the fuzzification parameter corresponding to 10 points is a specific value, a parameter that makes the fuzzification processing of the downsampling fuzzification method invalid can be selected according to the specific value, such as the sampling number is the total number of pixels of the image, and then the downsampling fuzzification method is configured using the parameter, so that the sampling number of the downsampling fuzzification method is the total number of pixels of the image. Therefore, the downsampling fuzzification method can be called according to the downsampling fuzzification method parameter and configured using the parameter, so that the downsampling fuzzification method configured with the parameter samples all pixels of the image and restores them, thereby obtaining the original image.
[0059] In another embodiment, the selection of the fuzzification score and the fuzzification parameter may not be random, but may be selected in turn according to a preset order of the fuzzification score and a preset order of the fuzzification parameter.
[0060] The downsampling fuzzy method and the neural network fuzzy method in the fuzzification method will be described below.
[0061] Regarding the downsampling blur method, the downsampling blur method can be to obtain sampling data after sampling the face area image according to the preset sampling rule, and restore the sampling data to the original image size, thereby obtaining the sampled image. The preset sampling rule may include the number of sampling times and the number of pixels for each sampling. Since the sampling data is not complete data, the sampled image obtained after restoration naturally has a certain degree of blur, and the blur of the restored sampled image is different with the different number of pixel sampling.
[0062] Regarding the neural network fuzzy method, the present disclosure adopts a method for blurring an image using a preset image generation model. The task of the preset image generation model is image restoration, that is, inputting an image, and the model outputs an image that is as identical to the input as possible. The image restoration task is different from the image classification task. The purpose of the image classification task is to obtain the most distinguishing features of the same category from other categories, and classify them based on the features; while the purpose of the image restoration task is to obtain the features of an image, which can fully represent the pixel information of the image, and the image can be restored based on the features.
[0063] Specifically, the preset image generation model can be trained using clear pictures. At different training stages, the pictures output by the model will have a certain degree of blur. As the model is continuously trained, the pictures output by the model become closer and closer to the input pictures, so the blurriness will become smaller and smaller.
[0064] The following will refer to Figures 3 to 5 Specifically describe the architecture of the preset image generation model. Figure 3 is an architectural diagram showing a preset image generation model according to an embodiment of the present disclosure; Figure 4 is a diagram showing an architecture of a detail feature encryption unit in a preset image generation model according to an embodiment of the present disclosure; Figure 5 is an architectural diagram showing a general feature encryption unit in a preset image generation model according to an embodiment of the present disclosure.
[0065] like Figure 3 As shown in FIG, the preset image generation model includes two main parts: an image encryption network and an image decryption network. The image encryption network is responsible for encrypting the input image into a set of hidden codes, and the image decryption network is responsible for restoring the hidden codes into an image.
[0066] According to the embodiment of the image encryption network disclosed in the present invention, the task of the image encryption network is mainly to encrypt the face. The face area image in the above-mentioned paired data subset is used as input, first passes through 4 groups of serial face detail feature extraction modules, then passes through 2 groups of serial face general feature extraction modules, and finally performs 1×1 convolution to change the number of channels to map the image features, that is, to generate a hidden code.
[0067] Specifically, the high-resolution layer of the network has more image detail information, such as facial wrinkles, eyebrows and other features, so four groups of facial detail feature extraction modules are first used to extract detail information from the face. In each group of facial detail feature extraction modules, facial detail features are first extracted by the detail feature encryption unit, and then these detail features are downsampled by 3×3 convolution. For example, after extracting detail information from a 512×512 image, it is downsampled to 32×32 pixels, and then normalized using InstanceNorm, and finally activated by the LeakyReLU activation function. The output of the first group of facial detail feature extraction modules is used as the input of the second group of facial detail feature extraction modules, and this is executed serially until the fourth group of facial detail feature extraction modules.
[0068] Reference Figure 4In the detail feature encryption unit, 3×3 convolution is first used to extract features, and then a branch is separated to use 1×1 convolution to change the number of channels. After average pooling, linear convolution and sigmoid, attention is calculated for each feature channel, and then the attention output is multiplied by the 3×3 convolution extracted feature. Since InstanceNorm can effectively extract the features of a single image without mixing the features of other images in the dataset, it is suitable for extracting facial detail features, so InstanceNorm is used for normalization, and finally activated by the LeakyReLU activation function.
[0069] As the image resolution decreases, facial details gradually disappear. For example, we can only find that a face has two eyes, a nose, a mouth, etc., so two groups of universal face feature extraction modules are used to extract universal features, and the output image size is, for example, 8×8 pixels. The universal face feature module follows the basic convolutional neural network design method (convolution layer + normalization layer + activation layer). In each group of universal face feature extraction modules, universal face features are first extracted through the universal feature encryption unit, and then these detail features are downsampled through 3×3 convolution, and then normalized using BatchNorm as the normalization layer, and finally activated through the LeakyReLU activation function. The output of the first group of universal face feature extraction modules is used as the input of the second group of universal face feature extraction modules.
[0070] Reference Figure 5 In the general feature encryption unit, 1×1 convolution, 3×3 convolution and 1×1 convolution are used to extract features, and then BatchNorm is used as the normalization layer for normalization, and finally activated by the LeakyReLU activation function.
[0071] After general feature extraction using two sets of face general feature extraction modules, a 256×8×8 hidden code is generated through 1×1 convolution.
[0072] According to the embodiment of the image decryption network disclosed in the present invention, the image decryption network design is similar to the image encryption network, which is the reverse process of the encryption network. The task of the image decryption network is mainly to encrypt the output generated by the image encryption network, that is, the hidden code. Therefore, the hidden code is used as the input of the image decryption network. It first passes through 2 groups of serial face general feature interpretation modules, and then passes through 4 groups of serial face detail feature interpretation modules. In addition to the output of the last group of face general feature interpretation modules as the input of the first group of face detail feature interpretation modules in the 4 groups of serial face detail feature interpretation modules, the output of the last group of face detail feature extraction modules in the 4 groups of serial face detail feature extraction modules in the image encryption network will also be used as the input of the first group of face detail feature interpretation modules. Finally, the image is generated through 3×3 convolution.
[0073] Specifically, the only difference between the construction of the image decryption network and the construction of the image encryption network is that the 3×3 downsampling convolution in each module of the image encryption network is replaced by the nearest neighbor upsampling layer, and the last 1×1 convolution layer of the image encryption network is modified to a 3×3 convolution layer. The architecture of the detail feature decryption unit in the image decryption network is the same as that of the detail feature encryption unit in the image encryption network, and the architecture of the general feature decryption unit in the image decryption network is the same as that of the general feature encryption unit in the image encryption network, so it is no longer shown in the figure.
[0074] According to an embodiment of the preset image generation model, a blurred image of a special blur type can be generated by the preset image generation model, thereby enriching the style of the blurred image.
[0075] In step S103, the face image detection model may be trained using the blurred image.
[0076] According to an embodiment of the present disclosure, blurred images can be continuously obtained through the above step S102. Once a predetermined number of blurred images are obtained, the face image detection model is directly trained. The predetermined number can be one or a batch of multiple images. The face image detection model can be any applicable classification network model, such as resnet, ghostnet, etc. The output of the face image detection model is a classification score corresponding to the blurriness of the face image. In particular, the face image detection model can classify and score images with different blurriness and clear images.
[0077] Specifically, for example, the Adam optimizer can be used to train the face image detection model, wherein the initial learning rate can be set to 0.001, the loss function can be, for example, the cross entropy, and the training is performed until the loss is stable. Of course, any other applicable optimizer can also be used, the initial learning rate can also be set manually, and the loss function can also be any applicable loss function.
[0078] The blurred image obtained by the above method can have a variety of blur types and blur degrees, so that the face image detection model can be trained more comprehensively and accurately, thereby improving the comprehensiveness and accuracy of face image blur detection.
[0079] The present disclosure also provides a method for training a face image detection model. Figure 2 , Figure 2 FIG. 1 is a flowchart showing a method for training a face image detection model according to another embodiment of the present disclosure. Figure 2 As shown in , the face image detection model training method also includes the following steps S201.
[0080] In step S201, the preset fuzzy information may be created.
[0081] According to the embodiment of the present disclosure, when training the face image detection model, the preset blur information can be created first, and of course, it can also be used as shown in the reference Figure 1 In the embodiment of the face image detection model training method described, pre-created preset blur information is directly obtained when training the face image detection model.
[0082] Furthermore, the creation of the preset blur information includes: obtaining a second clear face area data set; determining a plurality of blur methods for blurring the second clear face area data set; using any one of the plurality of blur methods to blur the second clear face area data set to obtain a blurred image as a benchmark blurred image; according to preset scoring rules, determining a picture to be scored in the benchmark blurred image and scoring it to obtain a benchmark scored image; according to the benchmark scored image, determining parameters used by any one of the blur methods when obtaining the benchmark scored image as benchmark parameters; using unused blur methods among the plurality of blur methods to obtain a benchmark scored image. The method performs blurring processing on the second clear face area data set to obtain a blurred image as a relative blurred image; taking the benchmark scored image as a benchmark, determining in the relative blurred image an image with the same blur as the benchmark scored image and giving the same score to obtain a relative scored image; according to the relative scored image, determining the parameters used by the corresponding blurring method when obtaining the relative scored image as relative parameters; taking the score of the benchmark scored image as the blurring score, taking the benchmark parameters and the relative parameters as blurring parameters, and determining the preset blurring information according to the blurring score, the blurring parameters and the corresponding blurring method.
[0083] According to the embodiments of the present disclosure, at least two blurring methods can be selected to create preset blurring information. First, a method is selected to blur the face area image in the clear face area data set, and the required images with gradient blur are selected and scored according to the preset scoring rules, and the method parameters used to obtain the corresponding scored images are saved. Then, other blurring methods are used to process the face area images respectively, and the required images with gradient blur are selected according to the same standard and given the same score as the score in the first selected method, and the method parameters used to obtain the corresponding scored images are saved. In this way, different blurring methods can obtain images with the same gradient blur and unified scoring standards. Therefore, the corresponding relationship between the above fuzzy scores, fuzzy parameters and fuzzy methods can be obtained through the logical relationship between the three, thereby determining the fuzzy information.
[0084] The method for obtaining the second clear face area data set can be similar to that described in reference Figure 1 The method for obtaining the first clear face area data set in the face image detection model training method is the same. The number of pictures required to create the preset blur information is very small, for example, 10 clear pictures, so the second clear face area data set is part of the first clear face area data set. Of course, a more effective method is to directly use a small number of clear portrait pictures, for example, 10 pictures, and use the face detection algorithm to obtain the second face image area data set. The multiple blurring methods include, for example, downsampling blurring, neural network blurring, Gaussian blurring, median filtering blurring, and mosaic blurring. The neural network blurring method may include a blurring method using a preset image generation model. The preset scoring rules may include the number, gradient, and score of specific blurring scores, and the blurring score may include a total of n+1 scoring levels from 0 to n, where n is a positive integer, and 0 represents the maximum blur, and n represents full marks for clarity, and the corresponding blurring degree pictures can be manually selected as blurring pictures and given blurring scores.
[0085] It is worth noting that when determining and scoring the pictures to be scored according to the preset scoring rules, the corresponding pictures will be determined for all scoring levels except the full score, because the full score corresponds to a clear picture, and there is no clear picture after the picture processed by the blurring method. However, the blurring information related to the full score can still be set separately according to the blurring score, the blurring parameters and the corresponding blurring method. Each blurring method corresponds to a type of parameter, and each parameter can have a different parameter value. According to the blurring score and the blurring method, the parameter value used for the blurring score can be obtained, and the parameter type corresponding to each blurring score and the value of each parameter can be determined. Since each fuzzification score is obtained by the same multiple fuzzification methods, the parameter types corresponding to each fuzzification score are the same, but the parameter values are different. For example, for example, the downsampling fuzzification method and the fuzzification method using the preset image generation model are used. Taking 3 points and 5 points as examples, the final corresponding relationship is that both 3 points and 5 points correspond to two types of parameters, namely the downsampling fuzzification method parameters and the preset image generation model parameters, but the values of the downsampling fuzzification method parameters and the preset image generation model parameters corresponding to 3 points are different from the values of the downsampling fuzzification method parameters and the preset image generation model parameters corresponding to 5 points. Therefore, the full score can be set to correspond to the same parameter type, but the value of each parameter is set to a specific value, such as 0, and each parameter corresponds to a fuzzification method. Thus, the preset fuzzification information can be determined based on the fuzzification score, the fuzzification parameter and the corresponding fuzzification method. In addition, the fuzzification information can usually be created using 1 clear picture. In order to make the fuzzification information more accurate, a very small-scale data set as described above is used.
[0086] In addition, the relevant contents about downsampling blurring and blurring method using preset image generation model can refer to the description in the above-mentioned face image detection model training method, which will not be repeated here.
[0087] The present disclosure also provides a method for detecting a face image. Figure 6 , Figure 6 FIG. 1 is a flow chart showing a method for detecting a face image according to an embodiment of the present disclosure. Figure 6 As shown in , the face image detection method includes the following steps S301-S303. Step S301: Acquire a face image to be detected. Step S302: Acquire face region data according to the face image to be detected. Step S303: Input the face region data into a face image detection model to obtain a face image detection result of the face image to be detected, wherein the face image detection model is trained by the above-mentioned face image detection model training method.
[0088] Through the face image detection method disclosed in the present invention, the blurriness of the entire face image can be detected more comprehensively and accurately through the face image detection model.
[0089] In step S301, a face image to be detected may be obtained.
[0090] According to the embodiment of the present disclosure, in order to detect the blurriness of a face image, a face image to be detected should be first obtained. The face image to be detected can be prepared in advance or can be an image currently captured by a photographic device.
[0091] In step S302, face region data may be acquired according to the face image to be detected.
[0092] According to the embodiments of the present disclosure, after obtaining the face image to be detected, the face region data can be obtained by using the face detection algorithm as in the embodiment of the face image detection model training method described above. Of course, the face region data can also be obtained by any other applicable method.
[0093] In step S303, the face region data may be input into a face image detection model to obtain a face image detection result of the face image to be detected.
[0094] According to an embodiment of the present disclosure, after obtaining the face region data, the face region data is directly used as the input of the face image detection model to obtain the face image detection result. Specifically, the detection result includes the scores of all levels of the blurriness of the face region and the corresponding confidence levels, wherein the score corresponding to the confidence level with the largest value is the score of the detected face image. The score corresponds to the score level and specific score in the preset scoring rules used in the above-mentioned face image detection model training method. The score can be used to know the blurriness of the corresponding face region, and then any required subsequent processing or application can be performed based on the result.
[0095] The present disclosure also provides a method for detecting a face image. Figure 7 , Figure 7 FIG. 4 is a flowchart showing a method for detecting a face image according to another embodiment of the present disclosure. Figure 7 As shown in, the face image detection method is Figure 6 The facial image detection method shown further includes the following step S304 after step S203.
[0096] In step S304, the scoring may be refined according to the scoring in the face image detection result and the confidence value corresponding to the scoring.
[0097] According to an embodiment of the present disclosure, the detection result obtained by the face image detection model includes a score and a corresponding confidence level, for example, please refer to the following Table 1 for details.
[0098] 0 1 2 3 4 5 6 7 8 9 10 0.00 0.01 0.02 0.81 0.10 0.03 0.01 0.01 0.01 0.00 0.00
[0099] Table 1
[0100] The first line shows the scores of 11 rating levels, and the second line shows the corresponding confidence levels. Since the confidence level corresponding to 3 points is the largest, the face image detection result is 3 points. It can be seen that this detection result is actually a discretized fuzzy classification result.
[0101] In order to make the facial blur scoring more granular, that is, more continuous, the results output by the facial image detection model can be refined and scored, so that a more accurate facial blur scoring result can be obtained and the degree of facial blur can be better distinguished.
[0102] Thus, the final score can be obtained by refining the score according to the score in the face image detection result and the confidence value corresponding to the score. The final score can be, for example, a floating point score between 0 and 1, including 0 and 1, wherein the precision of the floating point score can be set manually, and the higher the precision, the better the continuity of the score.
[0103] Specifically, in order to refine the score, first, the score with the highest confidence value in the test result is taken as the current score, and the three adjacent scores including the current score are obtained in the test result and the center score is determined. When the current score is the lowest score (that is, the confidence value corresponding to the lowest score is the largest), the lowest score and the scores of the two scoring levels adjacent to the lowest score can be taken, and the score adjacent to the lowest score can be taken as the center score; when the current score is the highest score (that is, the confidence value corresponding to the highest score is the largest), the highest score and the scores of the two scoring levels adjacent to the highest score can be taken, and the score adjacent to the highest score can be taken as the center score; when the current score is an intermediate score other than the lowest score and the highest score, the intermediate score and the score of the upper level of the intermediate score (less than the intermediate score) and the score of the next level (greater than the intermediate score) can be taken, and the intermediate score can be taken as the center score.
[0104] Then, the offset score can be obtained according to the confidence corresponding to the three scores obtained by the following formula:
[0105]
[0106] Among them, S represents the offset score, a represents the confidence level corresponding to the center score, and a - Indicates the confidence level corresponding to the score that is less than the center score, a + Indicates the confidence level corresponding to the score that is greater than the center score.
[0107] Subsequently, the final score can be obtained based on the offset score, center score and number of rating levels.
[0108] Specifically, when a - >a + The final score can be obtained by the following formula:
[0109] R = (arg(a) - S) / (N - 1)
[0110] Among them, R represents the final score, arg(a) represents the central score, and N represents the number of rating levels.
[0111] when a - <a + The final score can be obtained by the following formula:
[0112] R = (arg(a) + S) / (N-1)
[0113] Among them, R represents the final score, arg(a) represents the central score, and N represents the number of rating levels.
[0114] For example, according to the test result example given in Table 1 above, it can be seen that 3 points correspond to the highest confidence, and 3 points are not the lowest score or the highest score. Therefore, 2 points, 3 points, and 4 points are taken and 3 points are taken as the central score. According to the confidence of these three scores, the final score after the refined scoring is:
[0115]
[0116] The score is taken to four decimal places, and of course any decimal place can be taken as needed. It is worth noting that when the final score calculated by the above method is less than 0, 0 is taken as the final score; when the final score calculated by the above method is greater than 1, 1 is taken as the final score. Therefore, the image input to the face image detection model can be refined to obtain an accurate score of a floating point type between 0 and 1.
[0117] According to an embodiment of the present disclosure, for example, the face image detection result is shown in Table 2 below:
[0118] 0 1 2 3 4 5 6 7 8 9 10 0.81 0.01 0.02 0.00 0.10 0.03 0.01 0.01 0.01 0.00 0.00
[0119] Table 2
[0120] The first line shows the scores of 11 rating levels, and the second line shows the corresponding confidence levels. Since the confidence level corresponding to 0 is the largest, the face image detection result is 0. In this case, the current score is 0, which is the lowest score. 1, 2 and 0 can be used to form the three scores required by the above method, and 1 is used as the center score. Thus, the refined final score can be calculated according to the above method.
[0121] According to an embodiment of the present disclosure, for example, the face image detection result is shown in Table 3 below:
[0122] 0 1 2 3 4 5 6 7 8 9 10 0.00 0.01 0.02 0.00 0.10 0.03 0.01 0.01 0.01 0.00 0.81
[0123] Table 3
[0124] The first line shows the scores of the 11 rating levels, and the second line shows the corresponding confidence levels. Since the confidence level corresponding to 10 points is the largest, the face image detection result is 10 points. In this case, the current score is 10 points, which is the highest score. 8 points, 9 points and 10 points can be used to form the three scores required by the above method, and 9 points can be used as the center score. Thus, the refined final score can be calculated according to the above method.
[0125] According to the embodiment of the refined scoring, by performing refined scoring on the detection results of the face image detection model, the score of the face blurriness of the input image can have a finer granularity, thereby better distinguishing the blurriness of the image.
[0126] The present disclosure also provides a face image detection model training device. The device is used to perform the above combination Figure 1 The steps in an embodiment of a facial image detection model training method are described.
[0127] Reference Figure 8 , Figure 8 FIG. 1 is a schematic block diagram showing a face image detection model training device 100 according to an embodiment of the present disclosure. Figure 8 As shown, the face image detection model training device 100 includes a first acquisition module 101, a fuzzification module 102 and a training module 103. The first acquisition module 101 is used to obtain a first clear face area data set. The fuzzification module 102 is used to assign a fuzzification score to the face area image in the first clear face area data set according to the preset fuzzification information, and call a fuzzification method to fuzzify the face area image according to the fuzzification score to obtain a fuzzified image, wherein the preset fuzzification information includes multiple fuzzification scores, multiple fuzzification parameters corresponding to each fuzzification score, and a fuzzification method corresponding to each fuzzification parameter, the fuzzification score is the score after the image is blurred, the fuzzification method is a method for blurring the image, and the fuzzification parameter is the fuzzification parameter used by the fuzzification method to obtain the fuzzified score. The training module 103 is used to train the face image detection model through the fuzzified image.
[0128] According to an embodiment of the present disclosure, the first acquisition module 101 is used to acquire the first clear face area data set in the following manner: acquire a preset clear portrait data set; and obtain the first clear face area data set through a face detection algorithm based on the preset clear portrait data set.
[0129] According to an embodiment of the present disclosure, the preset clear portrait data set includes a self-built data set.
[0130] According to an embodiment of the present disclosure, the first acquisition module 101 is used to obtain the first clear face area data set through a face detection algorithm based on the preset clear portrait data set in the following manner: detect the face frame of each portrait in the preset clear portrait data set through the face detection algorithm; and capture all of the face frames as the first clear face area data set.
[0131] According to an embodiment of the present disclosure, the blurring module 102 is used to assign a blurring score to the face area image in the first clear face area data set according to preset blurring information in the following manner, and call a blurring method to blur the face area image according to the blurring score to obtain a blurred image: for the face area image, randomly select one of the blurring scores according to the preset blurring information; randomly select a blurring parameter from a plurality of blurring parameters corresponding to the randomly selected blurring score; configure a corresponding blurring method according to the randomly selected blurring parameter to blur the face area image to obtain the blurred image.
[0132] The fuzzification methods include sampling fuzzification method, neural network fuzzification method, Gaussian fuzzification method, median filtering fuzzification method and mosaic fuzzification method.
[0133] The present disclosure also provides a face image detection model training device. The device is used to perform the above combination Figure 2 The steps in an embodiment of a facial image detection model training method are described.
[0134] Reference Fig. 9 , Fig. 9 Detailed description is a schematic block diagram of a face image detection model training device according to another embodiment of the present disclosure. Fig. 9 The face image detection model training device 200 shown in FIG. Figure 8 The difference between the face image detection model training device 100 shown is that the face image detection model training device 200 further includes a creation module 201. The creation module 201 is used to create the preset fuzzy information.
[0135] According to an embodiment of the present disclosure, the creation module 201 is used to create the preset blur information in the following manner: obtain a second clear face area data set; determine a plurality of blur methods for blurring the second clear face area data set; use any one of the plurality of blur methods to blur the second clear face area data set to obtain a blurred image as a benchmark blurred image; according to a preset scoring rule, determine a picture to be scored in the benchmark blurred image and score it to obtain a benchmark scored image; according to the benchmark scored image, determine the parameters used by any one of the blur methods when obtaining the benchmark scored image as benchmark parameters; use any one of the plurality of blur methods to obtain the benchmark scored image. The unused blurring method is used to blur the second clear face area data set to obtain a blurred image as a relative blurred image; taking the benchmark scored image as a benchmark, determining in the relative blurred image an image with the same blur as the benchmark scored image and giving the same score to obtain a relative scored image; based on the relative scored image, determining the parameters used by the corresponding blurring method when obtaining the relative scored image as relative parameters; using the score of the benchmark scored image as the blurring score, using the benchmark parameters and the relative parameters as blurring parameters, and determining the preset blurring information based on the blurring score, the blurring parameters and the corresponding blurring method.
[0136] According to an embodiment of the present disclosure, the neural network fuzzy method includes a fuzzy method using a preset image generation model.
[0137] It is understandable that the above reference Fig. 9 In the embodiment described, the face image detection model training device, in which the specific way in which each module performs the operation has been described in conjunction with Figure 2 The described face image detection model training method is described in detail in the embodiment and will not be elaborated here.
[0138] The present disclosure also provides a face image detection device. The device is used to perform the above combination Figure 6 The steps in an embodiment of a face image detection method are described.
[0139] Reference Fig.10 , Fig.10 FIG. 3 is a schematic block diagram showing a face image detection device 300 according to an embodiment of the present disclosure. Fig.10As shown, the face image detection device 300 includes a second acquisition module 301, a third acquisition module 302 and a detection module 303. The second acquisition module 301 is used to acquire a face image to be detected. The third acquisition module 302 is used to acquire face region data according to the face image to be detected. The detection module 303 is used to input the face region data into a face image detection model to obtain a face image detection result of the face image to be detected, wherein the face image detection model is trained by the face image detection model training device 100 or the face image detection model training device 200.
[0140] It is understandable that the above reference Fig.10 In the embodiment of the face image detection device described, the specific way in which each module performs operations has been described in conjunction with Figure 6 The face image detection method has been described in detail in the embodiments, and will not be elaborated here.
[0141] The present disclosure also provides a face image detection device. The device is used to perform the above combination Fig.11 The steps in an embodiment of a face image detection method are described.
[0142] Reference Fig.11 , Fig.11 is a schematic block diagram showing a face image detection device 400 according to another embodiment of the present disclosure. Fig.11 The face image detection device 400 shown in FIG. Fig.10 The difference between the facial image detection device 300 shown is that the facial image detection device 400 further includes a refinement scoring module 304. The refinement scoring module 304 is used to perform refinement scoring according to the score in the facial image detection result and the confidence value corresponding to the score.
[0143] It is understandable that the above reference Fig.11 In the embodiment of the face image detection device described, the specific way in which each module performs operations has been described in conjunction with Figure 7 The face image detection method has been described in detail in the embodiments, and will not be elaborated here.
[0144] The present disclosure also provides an electronic device, wherein the electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the Figure 1 or Figure 2 The face image detection model training method described, or the implementation as combined Figure 6 or Figure 7 The described method for detecting face images.
[0145] It can be understood that the steps implemented when the processor executes the computer program are basically consistent with the implementation methods of the various steps in the above method. The specific methods have been described in detail in the embodiments of the face image detection model training method and the face image detection method, and will not be elaborated here.
[0146] In another aspect, the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed, the Figure 1 or Figure 2 The face image detection model training method described, or the implementation as combined Figure 6 or Figure 7 The described method for detecting face images.
[0147] It can be understood that the steps implemented when the processor executes the computer program are basically consistent with the implementation methods of the various steps in the above method. The specific methods have been described in detail in the embodiments of the face image detection model training method and the face image detection method, and will not be elaborated here.
[0148] The embodiments of the present disclosure are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core idea. At the same time, for those skilled in the art, according to the idea of the present disclosure, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
[0149] It should be understood that the terms "first" and "second", etc. in the claims, specifications and drawings of the present disclosure are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specifications and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.
[0150] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.
[0151] The embodiments of the present disclosure are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of the present disclosure. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present disclosure, the specific implementation methods and the scope of application of the present disclosure, all belong to the scope of protection of the present disclosure. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A method for training a face image detection model, wherein: The method comprises: Acquire a first clear face region data set; According to the preset blurring information, a blurring score is assigned to the face area image in the first clear face area data set, and a blurring method is called according to the blurring score to perform blurring processing on the face area image to obtain a blurred image. The preset blurring information includes a plurality of blurring scores, a plurality of blurring parameters corresponding to each blurring score, and a blurring method corresponding to each blurring parameter, wherein the blurring score is a score after blurring the image, the blurring method is a method for blurring the image, and the blurring parameter is a blurring parameter used by the blurring method to obtain the blurring score; The face image detection model is trained by using the blurred image. Before allocating a fuzzification score to the face area image in the first clear face area data set according to the preset fuzzification information, and performing fuzzification processing on the face area image by calling a fuzzification method according to the fuzzification score to obtain a fuzzified image, the method further includes: creating the preset fuzzification information, The step of creating the preset fuzzy information includes: Acquire a second clear face area data set; Determining a plurality of fuzzification methods for fuzzifying the second clear face region data set; Using any one of the plurality of blurring methods to perform blurring processing on the second clear face area data set to obtain a blurred image as a reference blurred image; According to a preset scoring rule, a picture to be scored is determined in the benchmark blurred picture and scored to obtain a benchmark scored picture; According to the benchmark-scored picture, determining the parameters used by any one of the fuzzification methods when obtaining the benchmark-scored picture as benchmark parameters; Using an unused blurring method among the plurality of blurring methods to perform blurring processing on the second clear face area data set to obtain a blurred image as a relatively blurred image; Taking the benchmark scored picture as a benchmark, determining a picture with the same blur as the benchmark scored picture in the relatively blurred picture and giving the same score to the picture, so as to obtain a relatively scored picture; According to the relatively scored picture, determining the parameters used by the corresponding fuzzification method when obtaining the relatively scored picture as relative parameters; The score of the image after the benchmark score is used as the fuzzy score, the benchmark parameter and the relative parameter are used as fuzzy parameters, and the preset fuzzy information is determined according to the fuzzy score, the fuzzy parameters and the corresponding fuzzy method.
2. The face image detection model training method according to claim 1, wherein: The obtaining of the first clear face area data set comprises: Get a preset clear portrait dataset; According to the preset clear portrait data set, the first clear face area data set is obtained by using a face detection algorithm.
3. The face image detection model training method according to claim 2, wherein: The preset clear portrait data set includes a self-built data set.
4. The facial image detection model training method according to claim 2, wherein: The obtaining the first clear face area data set by using a face detection algorithm according to the preset clear portrait data set comprises: Detecting the face frame of each portrait in the preset clear portrait data set by the face detection algorithm; All of the face frames are captured as the first clear face region data set.
5. The face image detection model training method according to claim 1, wherein: The step of assigning a fuzzification score to the face area image in the first clear face area data set according to the preset fuzzification information, and calling a fuzzification method to perform fuzzification processing on the face area image according to the fuzzification score to obtain the fuzzified image comprises: For the face area picture, randomly selecting one of the fuzzy scores according to the preset fuzzy information; A fuzzy parameter is randomly selected from a plurality of fuzzy parameters corresponding to the randomly selected fuzzy score; According to the randomly selected blurring parameters, a corresponding blurring method is configured to blur the face area image to obtain the blurred image.
6. The facial image detection model training method according to claim 1, wherein: The fuzzification methods include downsampling fuzzification method, neural network fuzzification method, Gaussian fuzzification method, median filtering fuzzification method and mosaic fuzzification method.
7. The facial image detection model training method according to claim 6, wherein: The neural network fuzzy method includes a fuzzy method using a preset image generation model.
8. A method for detecting a face image, wherein: The method comprises: Get the face image to be detected; Acquiring face region data according to the face image to be detected; The face area data is input into a face image detection model to obtain a face image detection result of the face image to be detected, wherein the face image detection model is trained by the face image detection model training method described in any one of claims 1 to 7.
9. The facial image detection method according to claim 8, wherein: The face image detection method also includes: The score is refined according to the score in the face image detection result and the confidence value corresponding to the score.
10. A facial image detection model training device, wherein: The device comprises: A first acquisition module, which is used to acquire a first clear face area data set; a fuzzification module, which is used to assign a fuzzification score to the face area picture in the first clear face area data set according to preset fuzzification information, and call a fuzzification method to perform fuzzification processing on the face area picture according to the fuzzification score to obtain a fuzzified picture, The preset blurring information includes a plurality of blurring scores, a plurality of blurring parameters corresponding to each blurring score, and a blurring method corresponding to each blurring parameter, wherein the blurring score is a score after blurring the image, the blurring method is a method for blurring the image, and the blurring parameter is a blurring parameter used by the blurring method to obtain the blurring score; A training module, which is used to train the face image detection model through the blurred image, The face image detection model training device further comprises: a creation module, which is used to create the preset fuzzy information, The creation module is used to create the preset blur information in the following manner: obtain a second clear face area data set; determine a plurality of blur methods for blurring the second clear face area data set; use any one of the plurality of blur methods to blur the second clear face area data set to obtain a blurred image as a benchmark blurred image; according to a preset scoring rule, determine a picture to be scored in the benchmark blurred image and score it to obtain a benchmark scored image; according to the benchmark scored image, determine the parameters used by any one of the blur methods when obtaining the benchmark scored image as benchmark parameters; use an unused module among the plurality of blur methods to obtain a benchmark scored image; and The blurring method blurs the second clear face area data set to obtain a blurred image as a relative blurred image; taking the benchmark scored image as a benchmark, determining in the relative blurred image an image with the same blur as the benchmark scored image and giving it the same score to obtain a relative scored image; based on the relative scored image, determining the parameters used by the corresponding blurring method when obtaining the relative scored image as relative parameters; using the score of the benchmark scored image as the blurring score, using the benchmark parameters and the relative parameters as blurring parameters, and determining the preset blurring information based on the blurring score, the blurring parameters and the corresponding blurring method.
11. A facial image detection device, wherein: The device comprises: A second acquisition module, which is used to acquire a face image to be detected; A third acquisition module, which is used to acquire face area data according to the face image to be detected; A detection module, which is used to input the face area data into a face image detection model to obtain a face image detection result of the face image to be detected, wherein the face image detection model is trained by the face image detection model training device according to claim 10.
12. An electronic device, wherein: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the face image detection model training method as described in any one of claims 1 to 7, or implements the face image detection method as described in claim 8 or 9.
13. A computer-readable storage medium, wherein: The storage medium stores a computer program, and when the computer program is executed, it implements the face image detection model training method as described in any one of claims 1 to 7, or implements the face image detection method as described in claim 8 or 9.
Citation Information
Patent Citations
Face detection method and device
CN107644209A
Face image screening method and device
CN110059642A