Face image quality scoring method, model training method, and electronic device

By performing quality degradation processing on face images and training a generative adversarial network, the problem of low efficiency in face image quality scoring under unlabeled datasets is solved, and fast and accurate quality scoring is achieved.

CN115376180BActive Publication Date: 2026-04-17HEFEI DILUSENSE TECH CORP
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEFEI DILUSENSE TECH CORP
Filing Date
2022-07-05
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies struggle to quickly assess the quality of facial images, especially when labeled datasets are unavailable, resulting in inefficient facial image quality scoring.

Method used

By degrading the quality of the previous batch of face images to generate the next batch of face images, and training the quality scoring model based on the score loss between adjacent batches, a feature encoding and image generation model is constructed using a generative adversarial network to achieve unsupervised quality scoring.

Benefits of technology

This enables rapid and accurate evaluation of face image quality without the need for manually labeled datasets, improving model training efficiency and scoring accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115376180B_ABST
    Figure CN115376180B_ABST
Patent Text Reader

Abstract

This invention relates to the field of face image processing, and discloses a face image quality scoring method, a model training method, and an electronic device. The face image quality scoring model training method includes: inputting a previous batch of face images into a quality scoring model to be trained to obtain the score values ​​for the previous batch; performing quality degradation processing on the previous batch of face images to generate a subsequent batch of face images; inputting the subsequent batch of face images into the quality scoring model to be trained to obtain the score values ​​for the subsequent batch; and training the quality scoring model based on the score loss between adjacent batches of score values ​​obtained from multiple batches of face images to obtain the trained quality scoring model. This face image quality scoring model training method can achieve rapid face image quality scoring without requiring quality annotation of sample images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of facial image processing, and in particular to a method for quality scoring of facial images, a model training method, and an electronic device. Background Technology

[0002] Machine learning is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory, among others. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. It is the core of artificial intelligence and the fundamental way to endow computers with intelligence.

[0003] Training data refers to the data used to train algorithm models in the machine learning process. The algorithm learns from the training data, finding relationships, forming understanding, making decisions, and assessing confidence. The better the quality of the training data, the better the model's performance.

[0004] Facial image quality is affected by factors such as illumination, facial pose angle, facial contrast, facial completeness, facial blur, degree of facial expression exaggeration, and makeup intensity. Therefore, some methods employ multiple sub-modules corresponding to these factors, such as sub-modules that separately detect facial blur, completeness, and pose angle. Industry experts then provide a comprehensive facial image quality score based on the outputs of each sub-module. However, collecting and labeling the datasets required for this method is time-consuming and labor-intensive, making it difficult to achieve rapid facial image quality scoring. Summary of the Invention

[0005] The purpose of this invention is to provide a method for scoring the quality of face images, a model training method, and an electronic device that can achieve rapid scoring of face image quality without the need to label the quality of sample images.

[0006] To address the aforementioned technical problems, embodiments of the present invention provide a method for training a quality scoring model for face images, comprising: inputting a previous batch of face images into a quality scoring model to be trained to obtain the score values ​​of the previous batch; performing quality degradation processing on the previous batch of face images to generate a subsequent batch of face images; inputting the subsequent batch of face images into the quality scoring model to be trained to obtain the score values ​​of the subsequent batch; and training the quality scoring model based on the score loss between the score values ​​of each adjacent batch obtained from multiple batches of face images to obtain the trained quality scoring model.

[0007] The embodiments of the present invention also provide a method for quality scoring of face images, comprising: inputting the face image to be evaluated into a quality scoring model trained by the above-described face image quality scoring model training method to obtain a first score value; and determining the quality of the face image to be evaluated based on the first score value.

[0008] Embodiments of the present invention also provide an electronic device, comprising: at least one processor; a memory communicatively connected to the at least one processor; the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a face image quality scoring model training method as described above, or a face image quality scoring method.

[0009] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the face image quality scoring model training method described above, or a face image quality scoring method.

[0010] The face image quality scoring model training method of this application involves inputting a previous batch of face images into the quality scoring model to be trained, obtaining the score values ​​of the previous batch, performing quality degradation processing on the previous batch of face images to generate a subsequent batch of face images. Since the quality of face images decreases after quality degradation processing, the score values ​​of the subsequent batch of face images input into the quality scoring model to be trained will inevitably be lower than the score values ​​of the previous batch. By repeating the face quality degradation processing and obtaining the score values ​​of the batches obtained after degradation processing, face images with progressively decreasing quality can be obtained, i.e., face images with decreasing quality. This allows for the quantification of the face image scoring criteria. Therefore, based on the score loss between the score values ​​of each adjacent batch of face images obtained from these batches of face images, the quality scoring model is trained to obtain the trained quality scoring model. This trained quality scoring model can then be used to measure the image quality of the image to be scored, realizing unsupervised model training for face image quality scoring.

[0011] In addition, the quality of the previous batch of face images is degraded to generate the next batch of face images. This process includes: inputting the face images of the previous batch into a feature encoding model in sequence to obtain face feature vectors for each face image. The elements in the face feature vectors are decoupled from each other and each represents a face feature of one dimension. The element value of at least one element in the face feature vector is adjusted to degrade the face feature of the dimension represented by that element. The degraded face feature vectors are then input into an image generation model in sequence to obtain the degraded face images of the previous batch as the face images of the next batch. The feature encoding model and the image generation model are constructed based on generative adversarial networks. In this application, by sequentially inputting the previous batch of face images into the feature encoding model, face feature vectors of each face image are obtained. Since the elements in the face feature vector are decoupled from each other and each represents a face feature of a certain dimension, modifying the values ​​of each element in the face feature vector can obtain face features with different quality in a certain dimension, thus achieving face feature degradation. Then, by sequentially inputting the degraded face feature vectors into the image generation model, the previous batch of face images after feature degradation can be used as the face images of the next batch.

[0012] Furthermore, the training process for the feature encoding model and the image generation model includes: labeling the input face image of the feature encoding model as a real face image; inputting the face feature vector obtained from the feature encoding model into the input face image, and then inputting the resulting face feature vector into the image generation model to obtain the generated face image; and forming a sample pair by corresponding input and output face images for the same real face image; using the face feature vector obtained from the feature encoding model as a random variable, the image generation model as the generation model, and a binary classification model used to distinguish between real and generated face images as the discriminant model to form a generative adversarial network (GAN); and having the face feature vector as a sample follow a first normal distribution; and performing initial joint training of the feature encoding model and the GAN based on multiple batches of sample pairs and a first loss constructed based on the binary classification values ​​output by the binary classification model. A trained binary classification model is obtained. Based on the trained binary classification model, the binary classification value of each face image in another batch of sample pairs is obtained, and a second loss is constructed based on the second classification value and the image difference between two face images in each sample pair in another batch. The order of each element in the face feature vector obtained by inputting real face images from another batch of samples into the feature encoding model is randomly adjusted to obtain the face feature adjustment vector. The face feature adjustment vector, as a sample, follows a first adjusted normal distribution. A third loss is constructed based on the distribution difference between the first normal distribution and the first adjusted normal distribution, and a fourth loss is constructed based on the distribution difference between the first normal distribution and the standard normal distribution. The feature encoding model and the image generation model are trained based on the second loss, the third loss, and the fourth loss to obtain the trained feature encoding model and the image generation model. In this application, the input face image of the labeled feature encoding model is a real face image, and the face feature vector obtained by inputting the input face image into the feature encoding model is then input into the image generation model to obtain the output face image, which is the generated face image. A sample pair is formed by using the same real face image as the corresponding input face image and output face image. The face feature vector obtained by the feature encoding model is used as a random variable, the image generation model is used as the generation model, and the binary classification model used to distinguish between real face images and generated face images is used as the discriminant model to form a generative adversarial network. Thus, the feature encoding model, the image generation model, and the binary classification model are jointly trained using each sample pair. The joint training can obtain a trained binary classification model through the initial joint training, and then the feature encoding model and the image generation model can be trained based on the trained binary classification model. This makes the face images generated by the image generation model closer to real face images, resulting in different batches of face image samples that are more conducive to the training of the quality scoring model.

[0013] In addition, the rating loss is constructed using the following formula:

[0014]

[0015] Where loss is the rating loss, k = 0, 1, 2, ..., (H-2) / 2, and H is the number of batches. The rating values ​​are for batches 2k, 2k+1, and 2k+2, respectively, where b = 1, 2, ..., B, B is the batch size, and β1 and β2 are hyperparameters. In this application, by splitting the rating loss into loss calculations for adjacent odd-numbered batches and even-numbered batches, and between adjacent even-numbered batches and odd-numbered batches, the situation where values ​​from the same batch cancel each other out during loss calculation, thus preventing the calculation of review loss, can be avoided. Attached Figure Description

[0016] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0017] Figure 1 This is a schematic diagram of a face image quality scoring model training method according to an embodiment of the present invention;

[0018] Figure 2 This is a schematic flowchart of a face image quality degradation processing method according to an embodiment of the present invention;

[0019] Figure 3 This is a schematic flowchart of a method for training a feature encoding model and an image generation model according to an embodiment of the present invention;

[0020] Figure 4 This is a schematic flowchart of a face image quality scoring method according to an embodiment of the present invention;

[0021] Figure 5 This is a schematic diagram of an electronic device structure provided in one embodiment of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details are presented in the various embodiments of the present invention to facilitate a better understanding of this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for ease of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with and referenced by each other without contradiction.

[0023] Embodiments of the present invention relate to a method for training a quality scoring model for face images. The specific process is as follows: Figure 1 As shown, it includes:

[0024] Step 101: Input the face images from the previous batch into the quality scoring model to be trained to obtain the score values ​​of the previous batch.

[0025] Step 102: Perform quality degradation processing on the previous batch of face images to generate the next batch of face images;

[0026] Step 103: Input the next batch of face images into the quality scoring model to be trained to obtain the score value of the next batch.

[0027] Step 104: Based on the score loss between the score values ​​of each adjacent batch in the score values ​​obtained from multiple batches of face images, train the quality scoring model to obtain the trained quality scoring model.

[0028] This embodiment of the face image quality scoring model training method is used in electronic devices capable of machine learning, such as computers, tablets, and mobile phones. Since training data refers to the data used to train algorithm models during machine learning, obtaining good training data is a crucial issue. In face image processing algorithms, face image quality is affected by factors such as illumination, face pose angle, face contrast, face completeness, face blur, degree of facial expression exaggeration, and makeup intensity. Therefore, some methods employ multiple sub-modules corresponding to factors affecting face image quality, such as sub-modules detecting face image blur, completeness, and pose angle magnitude. Industry experts then provide a comprehensive face image quality score based on the outputs of each sub-module. However, collecting and labeling the datasets required for this method is time-consuming and labor-intensive. Other methods label face images according to human subjective perception scores, construct deep learning networks for supervised training, and directly obtain a scoring model that conforms to human subjective perception. However, since many factors influence face image quality, accurately labeling quality scores is very difficult, even impossible, thus hindering rapid face image quality scoring.

[0029] The face image quality scoring model training method of this application performs quality degradation processing and scoring on the input face image, and trains the quality scoring model with the face images and score values ​​of each adjacent batch of degradation processing. This can effectively save the workload of data annotation and improve the model training efficiency.

[0030] The following is a detailed explanation of the implementation details of the face image quality scoring model training method in this embodiment. The following content is only for the convenience of understanding and is not necessary for implementing this solution.

[0031] In step 101, the face images from the previous batch are input into the quality scoring model to be trained to obtain the score values ​​for the previous batch. The first batch of face images consists of unlabeled face images. The image quality of these face images can be the same or different; for example, the quality of the face images in the first batch can vary, or they can all be of good quality. To achieve the best training effect, the first batch of face images can be a high-quality set of face images, specifically face images with uniform and moderate illumination intensity, small facial pose angles, moderate facial contrast, complete faces, clear faces, no facial expression or minimal facial expression, and no or light makeup.

[0032] The quality scoring model can be a deep learning network S, whose input is a face image and whose output is a score of the face image quality. The score can be a floating-point number in the range of 0 to 1.

[0033] In step 102, the face images from the previous batch are subjected to quality degradation processing to generate the face images for the next batch. Quality degradation processing can refer to degrading the image quality of at least one feature dimension of the face image, such as reducing the sharpness, orientation, integrity, or contrast of the face image. Of course, in actual processing, quality degradation processing can also be applied to multiple feature dimensions of the face image simultaneously.

[0034] In step 103, the face images of the next batch are input into the quality scoring model to be trained to obtain the score values ​​of the next batch.

[0035] Since the subsequent batch of face images is obtained by degrading the quality of the previous batch of face images, the score of the subsequent batch should theoretically be lower than that of the previous batch. This is the target effect that a well-trained quality scoring model should achieve.

[0036] In the actual training process, steps 101 to 103 can be executed multiple times to obtain multiple batches of face images. By inputting these different batches of face images into the quality scoring model to be trained, the score values ​​of different batches of face images can be obtained. Theoretically, the score values ​​of each batch of face images should decrease sequentially, that is, the image quality becomes lower and lower.

[0037] In step 104, the quality scoring model is trained based on the scoring loss between adjacent batches of scores obtained from multiple batches of face images, resulting in a trained quality scoring model. Specifically, the scoring values ​​obtained from multiple batches of face images are mapped to the multiple batches of face images, with the quality of the face images decreasing batch by batch. Constraints are applied to the scoring values ​​between corresponding batches; that is, the quality scoring model is trained by calculating the scoring loss between adjacent batches.

[0038] In one example, the deep learning network S constructed above can be used as a quality scoring model, and the trainable parameters of S are denoted as w. S The input to S is a face image, and the last layer of the network is a regular sigmoid layer. Therefore, the output of S is a floating-point number in the range of 0 to 1. The closer the value is to 1, the higher the image quality.

[0039] In one example, the above rating loss can be constructed using the following formula:

[0040]

[0041] Where loss is the rating loss, k = 0, 1, 2, ..., (H-2) / 2, and H is the number of batches. The scores are for batches 2k, 2k+1, and 2k+2, respectively, where b = 1, 2, ..., B, B is the batch size, and β1 and β2 are hyperparameters.

[0042] In this embodiment, by splitting the scoring loss into two cases—the scoring loss between a later odd-numbered batch and an earlier even-numbered batch in adjacent batches, and the scoring loss between a later even-numbered batch and an earlier odd-numbered batch in adjacent batches—the impact of score values ​​in the same intermediate batch being canceled out when calculating the scoring loss based on the scores of multiple adjacent batches can be avoided, thus preventing the achievement of the scoring loss constraint. In one example, the parameters of S can be optimized using conventional deep learning gradient descent optimization methods:

[0043]

[0044] Thus, the trained S is obtained.

[0045] Another embodiment of the present invention relates to a method for training a quality scoring model for face images. This embodiment is largely the same as the above embodiment, except that step 102 is refined in this embodiment. For example... Figure 2 As shown, step 102 above may include the following sub-steps:

[0046] Sub-step 1021: Input the face images from the previous batch into the feature encoding model in sequence to obtain the face feature vector of each face image. The elements in the face feature vector are decoupled from each other and each represents a face feature of one dimension.

[0047] Sub-step 1022: Adjust the element value of at least one element in the face feature vector to degrade the face feature of the dimension represented by that element;

[0048] Sub-step 1023 involves sequentially inputting the degraded facial feature vectors into the image generation model to obtain the degraded facial images of the previous batch as the facial images of the next batch. The feature encoding model and the image generation model are constructed based on generative adversarial networks.

[0049] In sub-step 1021, the feature encoding model is a model capable of encoding features in a face image, that is, extracting features from the face image and representing each feature of the face as a face feature vector. Unlike traditional face feature vectors that use strong coupling to express facial features in different dimensions, the elements in the face feature vector generated by the feature encoding model in this embodiment are decoupled from each other, and each element can independently represent a facial feature in one dimension. Therefore, by adjusting the value of at least one element in the face feature vector, the facial feature dimension represented by that element can be changed. For example, increasing the value of the element representing the facial pose angle makes the facial pose angle larger, thereby adjusting the expression of facial features in the facial pose angle dimension.

[0050] In sub-step 1022, since the elements in the face feature vector generated by the feature encoding model are decoupled from each other and each represents a dimension of face features, the value of at least one element in the face feature vector can be adjusted to change the face feature of the dimension represented by that element in a direction of quality degradation, thereby causing the overall face feature expressed by the adjusted face feature vector to degrade. How to adjust the value of at least one element in the face feature vector to degrade the face feature of the dimension represented by that element can be achieved through a preset method or through empirical values; this embodiment does not limit the specific adjustment method.

[0051] In sub-step 1023, the image generation model is a model that can reconstruct face images from input vectors. The face images generated by the image generation model should conform to the face features expressed by the input face feature vectors. The degraded face feature vectors are sequentially input into the image generation model to obtain the corresponding degraded face images, i.e., the previous batch of face images after feature degradation. These previous batch of degraded face images can be used as training samples for the next batch of face images to train the quality scoring model.

[0052] In this embodiment, two auxiliary models are applied: a feature encoding model and an image generation model. The feature encoding model encodes features from a face image, ensuring that the encoded face feature vector is decoupled between its elements and that each element represents a single dimension of the face feature. The image generation model should accurately reconstruct the face image corresponding to the face feature vector. Therefore, the feature encoding model and image generation model can be trained using a generative adversarial network (GAN).

[0053] Generative Adversarial Networks (GANs) are deep learning models primarily composed of a generator model and a discriminator model. In this application, the image generation model is considered a single generator model, where the input to the generator model is the facial feature vector obtained from the feature encoding model. Here, only a discriminator model capable of judging the quality of facial images needs to be constructed for joint training of the feature encoding model and the image generation model. The loss function used for joint training can be flexibly set according to actual needs.

[0054] In this embodiment, by sequentially inputting the previous batch of face images into the feature encoding model, face feature vectors of each face image are obtained. Since the elements in the face feature vector are decoupled from each other and each represents a face feature of a certain dimension, modifying the value of each element in the face feature vector can obtain face features with changes in a certain dimension of feature expression, thus achieving face feature degradation. The degraded face feature vectors are then sequentially input into the image generation model to obtain the face images of the previous batch after feature degradation as the face images of the next batch.

[0055] This invention provides a method for training a feature encoding model and an image generation model. The trained feature encoding model and image generation model in this embodiment can be applied to the aforementioned embodiments. For example... Figure 3 As shown, the method for training the feature encoding model and the image generation model may include the following steps:

[0056] Step 201: The input face image of the labeled feature encoding model is a real face image, the face feature vector obtained by inputting the input face image into the feature encoding model is then input into the image generation model to obtain the output face image, which is the generated face image. The input face image and the output face image corresponding to the same real face image form a sample pair.

[0057] Step 202: A generative adversarial network is formed by using the face feature vector obtained by the feature encoding model as a random variable, the image generation model as the generation model, and the binary classification model used to distinguish between real face images and generated face images as the discriminant model. The face feature vector as a sample follows the first normal distribution.

[0058] Step 203: Based on multiple batches of sample pairs and the first loss constructed based on the binary classification values ​​output by the binary classification model, perform initial joint training on the feature encoding model and the generative adversarial network to obtain the trained binary classification model;

[0059] Step 204: Based on the trained binary classification model, obtain the binary classification value of each face image in another batch of sample pairs, and construct a second loss based on the second classification value and the image difference between the two face images in each batch of sample pairs.

[0060] Step 205: Randomly adjust the order of elements in the face feature vector obtained by inputting real face images from another batch of samples into the feature encoding model to obtain the face feature adjustment vector. The face feature adjustment vector, as a sample, follows the first adjusted normal distribution. Based on the distribution difference between the first normal distribution and the first adjusted normal distribution, a third loss is constructed, and based on the distribution difference between the first normal distribution and the standard normal distribution, a fourth loss is constructed.

[0061] Step 206: Train the feature encoding model and image generation model based on the second loss, third loss and fourth loss to obtain the trained feature encoding model and image generation model.

[0062] In step 201, during the training of the feature encoding model, the input face image is assumed to be a real face image. The face feature vector obtained by inputting this input face image into the feature encoding model is then input into the image generation model to obtain the output face image, which is the generated face image. Furthermore, the input face image (the real face image) and the output face image corresponding to the same real face image form a sample pair. It should be noted that the real face image and the generated face image can be considered a relative concept. In fact, the generated face image can also be input into the feature encoding model again to generate a face feature vector. This face feature vector can then be input into the image generation model to generate a new generated face image. In this case, the original generated face image can also be considered a real face image relative to the current generated face image, and has the same status as the original real face image.

[0063] In step 202, an image generation model is used as the generative model in the generative adversarial network (GAN) to generate non-realistic face images, i.e., generated face images. A feature encoding model is used to generate random variables (face feature vectors) based on real face images (or generated face images) as input to the image generation model. A binary classification model is constructed as the discriminative model in the GAN to determine whether the input face image is a real face image or a generated face image. Through initial joint training of the feature encoding model and the GAN, a trained binary classification model can be obtained. This trained binary classification model can determine whether the face image generated by the image generation model and the original real face image are real or generated face images. During training, the training parameters of the feature encoding model, image generation model, and binary classification model can be continuously adjusted based on the constructed classification loss to form an adversarial relationship. That is, for the feature encoding model and image generation model, the training objective is to make it difficult for the binary classification model to distinguish between the generated face image and the original real face image; for the binary classification model, the training objective is to achieve clear distinction between the generated face image and the original real face image.

[0064] To facilitate better mathematical calculations of the facial feature vectors later, in this embodiment, the facial feature vectors output by the feature encoding model are set to follow a first normal distribution as samples. That is, the facial feature vector can be a sample obtained from a certain normal distribution.

[0065] In one example, the feature encoding model may include a feature encoding network and a first generation module; correspondingly, the process of obtaining a face feature vector through the feature encoding model includes: inputting the face image to be processed into the feature encoding network to obtain a first mean vector and a first standard deviation vector; sampling from a standard normal distribution through the first generation module to obtain a first sampled value vector, and obtaining a face feature vector using the following formula, wherein the face feature vector, as a sample, follows a first normal distribution:

[0066]

[0067] Among them, z n (b) For facial feature vectors; s n (b) Let mu be the first sampled value vector. n (b) Let var be the first mean vector. n (b) Let b be the first standard deviation vector, where b = 1, 2, ..., B; B is the batch size of the training samples, and n is the vector length. ⊕ denotes element-wise addition. This indicates element-wise multiplication.

[0068] In this implementation, the process of treating the face feature vector as a sample to follow the first normal distribution is not limited. For example, the feature encoding network can also generate one or more vectors, use these vectors to determine the first normal distribution, and calculate the face feature vector based on the sampled values ​​in the first normal distribution.

[0069] By inputting the face image to be processed into the feature encoding network, a first mean vector and a first standard deviation vector are obtained. A first sampled value vector is obtained by sampling from the standard normal distribution through the first generation module. Based on the first mean vector, the first standard deviation vector and the first sampled value vector, the face feature vector is obtained, which can reduce the dimensionality of the face image features and realize the face feature vector obtained by encoding the face image as a normal distribution.

[0070] In step 203, during the initial joint training of the feature encoding model and the generative adversarial network, a first loss can be constructed based on multiple batches of sample pairs (real face images and generated face images formed after the real face images are input into the image generation model) and the binary classification values ​​output by the binary classification model, so as to train a well-trained binary classification model.

[0071] Specifically, during the initial joint training, B different face images can be randomly selected from the dataset, denoted as x. (b) Where b = 1, 2, 3, ..., B, B is a positive integer hyperparameter, set empirically; for example, B = 64. Then x... (b) The inputs are sequentially fed into the feature encoding network E, and the resulting first mean vector can be denoted as mu. n (b) and the first standard deviation vector var n (b) .

[0072] After obtaining the sampled value vector by sampling in the standard normal distribution, the facial feature vector is determined to be a sample in the first normal distribution based on the sampled value vector.

[0073] Specifically, the binary classification model can be denoted as J, and the trainable parameters of J can be denoted as w. J The input of J is a face image, and the output is a one-dimensional vector of length 2. The original image in the preset face image training set is denoted as the real face image, and the processed image is denoted as the generated face image. For example, the output of the image generation model G is the generated face image. The two values ​​output by J represent the classification values ​​of the input image as a real face image and the generated face image, respectively. The larger the value, the stronger the probability of the corresponding category. For example, if the output (generated face image classification value, real face image classification value,) is (50, 30), then the input face image is finally determined to be a generated face image.

[0074] The training process for the binary classification model is as follows: x is a real face image... (b) The data is sequentially input into the binary classification model J, and the output is the binary classification value of the real face image, denoted as jx. m (b) The generated face image dx (b) The data is sequentially input into a binary classification model J, and the output is the binary classification value of the generated face image, denoted as jdx. m (b) , where m = 1, 2, which correspond to the two categories of binary classification, m = 1 represents the generated face image category, and m = 2 represents the real face image category.

[0075] The first loss can then be calculated using the following formula:

[0076]

[0077] Where, loss d The first loss, The binary classification value is obtained by inputting a real face image into the binary classification model. The generated face image is input into the binary classification model to obtain the binary classification value. m=1 represents the category of the generated face image, m=2 represents the category of the real face image, b=1,2,…,B, where B is the batch size and α1 is the hyperparameter.

[0078] In this embodiment, by constructing the first loss, the trained binary classification model can be made capable of distinguishing whether the input face image is a real face image or a generated face image.

[0079] In one example, the parameters of J are optimized using the conventional deep learning gradient descent optimization method:

[0080]

[0081] Thus, the trained J can be obtained.

[0082] In step 204, based on the trained binary classification model, another batch of sample pairs is obtained to further train the feature encoding model and the image generation model: the image generation model is denoted as G, and the trainable parameters of G are denoted as w. G The input to G is a one-dimensional feature vector of length N, i.e., the face feature vector, and the output is a tensor of the image shape, denoted as dx, used to assist in the training of model E. Then, the face feature vector z... n (b) Inputting the image into the image generation model G will yield z. n (b) The corresponding image tensor dx (b) .

[0083] The second loss is calculated using the following formula:

[0084]

[0085] Where, loss r This is the second loss. For the sample pair, the real face image x (b) The binary classification value obtained by inputting into the trained binary classification model. Generate face images dx from sample pairs (b) The binary classification values ​​are input into the trained binary classification model, where m=1 represents the category of generated face images, m=2 represents the category of real face images, b=1,2,…,B, where B is the batch size and α2 is a hyperparameter.

[0086] In this embodiment, by constructing the second loss, the loss can be calculated based on the classification output of the binary classification model and the difference between the generated face image and the real face image in the sample pair. This allows the feature encoding model and image generation model constrained by the second loss to generate more realistic face images.

[0087] In step 205, the order of elements in the face feature vector obtained by inputting real face images from another batch of samples into the feature encoding model is randomly adjusted to obtain the face feature adjustment vector. The purpose of the adjustment is to decouple the elements in the face feature vector, so that each element can independently represent a face feature dimension. Each element in the adjusted face feature vector still satisfies the original normal distribution, only the order of the normal distribution has changed, hence it is called the first adjusted normal distribution. The purpose of training is to make the first normal distribution and the first adjusted normal distribution similar (i.e., the normal distribution corresponding to the elements in the face feature vector does not change much after adjustment). At the same time, it is expected that the first normal distribution approximates the standard normal distribution, which is more conducive to maintaining that the elements in the face feature vector still follow a certain normal distribution as samples when calculating, that is, the feature distribution is stable.

[0088] In one example, the third loss, constructed from the difference between the first normal distribution and the first adjusted normal distribution, can be calculated using the following formula:

[0089]

[0090] Where, loss p As the third loss, for The probability distribution, The sample follows a first mean vector of mu. n (b)The first standard deviation vector is var n (b) The first normal distribution, for The probability distribution, As samples, they follow a first adjusted mean vector of muc. n (b) The first adjusted standard deviation vector is varc n (b) The first adjusted normal distribution is given, where n is the vector length, b = 1, 2, ..., B, B is the batch size, and α5 is the hyperparameter.

[0091] In this embodiment, by constructing the third loss, the elements in the face feature vector output by the feature encoding model are decoupled from each other, so that each element can express a face feature of one dimension alone. This makes it convenient to generate a face image with degraded feature quality by adjusting the size of the elements in the face feature vector when training the quality scoring model later.

[0092] In one example, the fourth loss is calculated using the following formula:

[0093]

[0094] Where, loss z As the fourth loss, mu n (b) var n (b) The vectors are the first mean vector and the first standard deviation vector of the first normal distribution, respectively. n is the vector length, b = 1, 2, ..., B, B is the batch size, and α6 is the hyperparameter.

[0095] In this embodiment, by constructing the fourth loss, the first normal distribution that the face feature vector as a sample follows can be constrained to be close to the standard normal distribution. Since the probability distribution of the standard normal distribution is relatively stable, it is still a normal distribution after general logical calculation. Therefore, it can satisfy the requirement that the face feature vector as a sample still follows a normal distribution even when the elements in the face feature vector are shuffled and the values ​​are changed. This maintains the distribution type of the sample distribution, that is, it ensures the stability of the face features expressed by the face feature vector.

[0096] In step 206, based on the second loss r Third loss p and the fourth loss z The feature encoding model and the image generation model are trained to obtain the trained feature encoding model E and the image generation model G.

[0097] In one example, loss1 = loss can be calculated.r +loss p +loss z The model is trained using a comprehensive loss, and the parameters of E and G are optimized using conventional deep learning gradient descent optimization methods.

[0098]

[0099] This yields the trained E and G values.

[0100] Ultimately, the resulting feature encoding model and image generation model can generate face images that are indistinguishable from real face images.

[0101] In this embodiment, the input face image of the labeled feature encoding model is a real face image, and the face feature vector obtained by inputting the input face image into the feature encoding model is then input into the image generation model to obtain the output face image, which is the generated face image. A sample pair is formed by using the same real face image as the corresponding input and output face images. The face feature vector obtained by the feature encoding model is used as a random variable, the image generation model is used as the generation model, and the binary classification model used to distinguish between real and generated face images is used as the discriminant model to form a generative adversarial network. This allows for joint training of the feature encoding model, image generation model, and binary classification model using these sample pairs. The joint training can begin with an initial joint training to obtain a trained binary classification model. Subsequently, based on this trained binary classification model, the feature encoding model and image generation model can be further trained, making the face images generated by the image generation model more closely resemble real face images, thus obtaining different batches of face image samples that are more conducive to training the quality scoring model.

[0102] Based on the previous method embodiment, in sub-step 1022 above, adjusting the element value of at least one element in the face feature vector to degrade the face feature dimension represented by that element may include:

[0103] The face feature vector is determined to follow a first normal distribution as a sample. The element value of at least one element in the first mean vector of this first normal distribution is increased. A first adjusted normal distribution is determined based on the increased first mean vector and the first standard deviation vector of the first normal distribution. A second sample value vector is obtained by sampling from the first adjusted normal distribution, and the adjusted face feature vector is obtained using the following formula. This adjusted face feature vector, as a sample, follows the first adjusted normal distribution:

[0104]

[0105] Among them, zc n (b) The adjusted facial feature vector; scn (b) For the second sampled value vector, muc n (b) The first mean vector after enlargement, var n (b) Let b be the first standard deviation vector, where b = 1, 2, ..., B; B is the batch size of the training samples, and n is the vector length. The increasing element value in the first mean vector can be increased with a fixed step size or a variable step size.

[0106] Specifically, an integer q can be randomly selected from the range 1 to N, and the first mean vector mu can be used as the reference vector. n (b) The q-th value mu q (b) Let p (b) That is, p (b) =mu q (b) Then perform the following assignment operation:

[0107] Where γ is a hyperparameter greater than 1.0, selected empirically, for example, γ = 1.1; that is, p (b) The vector multiplied by a factor greater than 1 is then assigned back to mu. q (b) This increases the value of a certain element in the mean vector.

[0108] By adjusting the mean vector and the original standard deviation vector, a new normal distribution can be determined, which is the first adjusted normal distribution. The vector determined based on this first adjusted normal distribution is denoted as the adjusted face feature vector.

[0109] It's important to note that by selectively determining the specific values ​​of each element in the second sample value vector, the number of pixels that change in the facial feature vector can be adjusted. For example, the mean of the second adjusted normal distribution can be directly used as the adjusted facial feature vector.

[0110] In this embodiment, by determining the first normal distribution followed by the facial feature vector as a sample, the element value of at least one element in the first mean vector of the first normal distribution is increased. A first adjusted normal distribution is determined using the increased first mean vector and the first standard deviation vector of the first normal distribution. A second sampled value vector is obtained from the first adjusted normal distribution, generating an adjusted facial feature vector. This achieves the degradation of the facial features represented by the element. Furthermore, since the first adjusted normal distribution is determined based on the increased first mean vector and the first standard deviation vector of the first normal distribution, facial feature degradation can be controlled by modifying only the element values ​​in the first mean vector without changing the first standard deviation vector. This reduces the number of variables used for facial feature degradation while simultaneously using different batches of facial images required for image generation model training, simplifying model training calculations and improving model training efficiency.

[0111] Another embodiment of the present invention relates to a method for quality scoring of face images. The specific process is as follows: Figure 4 As shown, it includes:

[0112] Step 301: Input the face image to be evaluated into the quality scoring model trained by the above face image quality scoring model training method to obtain the first score value;

[0113] Step 302: Determine the quality of the face image to be evaluated based on the first score.

[0114] In this embodiment, the face image quality scoring method is implemented based on the face image quality scoring model training method. The training and application process of the scoring model will be fully described below.

[0115] First, a deep learning network needs to be built:

[0116] 1. Construct a deep learning convolutional network E as the feature encoding network, and denote the trainable parameters of E as w. E The input to E is a face image, and the output is two one-dimensional feature vectors of length N, denoted as the first mean vector mu. n and the first standard deviation vector var n , where n = 1, 2, 3, ..., N, N is a hyperparameter greater than 2, set based on experience, for example, N = 128;

[0117] 2. Construct a deep learning convolutional network G as an image generation model. The trainable parameters of G are denoted as w. G The input of G is a one-dimensional feature vector of length N, i.e., the face feature vector, and the output is a tensor of the image shape, denoted as dx;

[0118] 3. Construct a deep learning network J as a binary classification model. The trainable parameters of J are denoted as w. J The input is a face image, and the output is a one-dimensional vector of length 2. The preset image training set images, i.e., the original images, are denoted as real face images, and the processed images are denoted as generated face images. For example, G outputs the generated face image. J outputs two values, which represent the classification values ​​of the input image as a real face image and the generated face image, respectively (the larger the value, the stronger the probability of belonging to the corresponding category). For example, if the output (generated face image classification value, real face image classification value) is (50, 30), then the input face image is determined to be a generated face image.

[0119] 4. Construct a deep learning network S as a quality scoring model. The trainable parameters of S are denoted as w. S The input is a face image, and the last layer is a regular sigmoid layer. Therefore, the output of S is a floating-point number in the range of 0 to 1 (the closer to 1, the higher the image quality).

[0120] The training process of the face image quality scoring model is divided into two stages. The first stage uses model J as an auxiliary model to train the feature encoding network E and the image generation model G. The training steps include:

[0121] Step 1: Randomly select B different face images from dataset D, denoted as x. (b) (i.e., real human face image), where b = 1, 2, 3, ..., B, B is a hyperparameter, set according to experience, for example, B = 64;

[0122] Step 2, x (b) The inputs are sequentially fed into the feature encoding network E to obtain the first mean vector mu. n (b) and the first standard deviation vector var n (b) ;

[0123] Step 3: Sample B (corresponding to B images of a single sample) times from the standard normal distribution, sampling n values ​​each time, denoted as the first sample value s. n (b) According to the first mean vector mu n (b) The first standard deviation vector var n (b) and the first sampled value s n (b) Calculate the intermediate vector z n (b) As a facial feature vector:

[0124]

[0125] Among them ⊕ and These represent element-wise addition and element-wise multiplication, respectively.

[0126] Step 4: Transfer the intermediate vector z n (b) The input is fed into the image generation model G to obtain the intermediate vector z. n (b) The corresponding image tensor dx (b) (i.e., generating facial images);

[0127] Step 5, x (b) The data is sequentially input into the binary classification model J, and the output is the binary classification value of the real face image, denoted as jx. m (b) dx (b) The data is sequentially input into a binary classification model J, and the output is the binary classification value of the generated face image, denoted as jdx. m (b) , where m = 1, 2, which correspond to the two categories of binary classification, m = 1 represents the generated face image category, and m = 2 represents the real face image category;

[0128] Step 6: Apply the first loss to the binary classification model J using the classification values ​​from the binary classification. d )calculate:

[0129]

[0130] Where α1 is a hyperparameter greater than zero, set according to experience, for example, α1 = 10.0;

[0131] Step 7: Optimize the parameters of J using the conventional deep learning gradient descent optimization method (after step 7, model J is a pre-trained fixed model and will not participate in further training; it can be used directly):

[0132] w J =argmin J (loss d );

[0133] Step 8: Process the generated face image dx obtained after processing by models E and G again. (b) The data is sequentially input into the trained binary classification model J, and the output is the binary classification value corresponding to the generated face image, denoted as jdx2. m (b) x (b) The binary classification value obtained by inputting into the trained binary classification model is denoted as . Using jdx2 m (b) The second loss for model G rPerform the calculation:

[0134]

[0135] Here, α2, α3, and α4 are hyperparameters greater than zero, set empirically; for example, α2 = 0.01, α3 = 0.05, and α4 = 1.0.

[0136] Step 9, record idx n = [1,2,3,4,…,N], shuffle idx randomly, and denote it as c. n Calculate the third loss:

[0137]

[0138] express The probability distribution, The sample follows a first mean vector of mu. n (b) The first standard deviation vector is var n (b) The first normal distribution, for The probability distribution, The samples follow a first mean adjustment vector of muc. n (b) The first adjusted standard deviation vector is varc n (b) The first adjustment follows a normal distribution, where n is the vector length, b = 1, 2, ..., B, B is the batch size, and α5 is a hyperparameter. Here, α5 and α5 are hyperparameters greater than zero, set empirically; for example, α5 = 2.0 can be taken.

[0139] Step 10: The purpose of this step is to... The normal distribution it follows approximates the standard normal distribution, which has a mean of 0 and a variance of 1. Therefore, the fourth loss... z The calculation is as follows:

[0140]

[0141] Where α6 is a hyperparameter greater than zero, set according to experience, for example, α6 = 1.0;

[0142] Step 11: Calculate loss1 = loss r +loss p +loss z The parameters of E and G are optimized using the conventional deep learning gradient descent optimization method:

[0143]

[0144] Step 12: Determine whether E and G have converged, for example, whether the training has reached the specified number of times, or whether the loss no longer decreases significantly. If E and G have converged, proceed to step 13; otherwise, proceed to step 1.

[0145] Step 13: Output the trained E and G.

[0146] The second stage of training is used to train the quality scoring model S using the trained E and G:

[0147] Step 1: Load E and G after the first training phase is completed;

[0148] Step 2: Randomly select B different face images from dataset D, denoted as x. (b) , will x (b) Inputting into S, we obtain the face image quality score for person B, denoted as s0. (b) ;

[0149] Step 3, x (b) The input is fed into the pre-trained feature encoding network E to obtain mu. n (b) ;

[0150] Step 4: Randomly select an integer from 1 to N, denoted as q, and calculate the mean vector mu. n (b) The q-th value mu q (b) Let p (b) ), that is, p (b) =mu q (b) Then perform the following assignment operation:

[0151] Where γ is a hyperparameter greater than 1.0, selected empirically, for example, γ = 1.1; (i.e., p) (b) The vector multiplied by a factor greater than 1 is then reassigned back to the original value mu. q (b) The essential operation of this step is to increase the value of a certain element in the mean vector.

[0152] The assigned value mu n (b) (Where, the value of one element has been increased) This is input into the pre-trained image generation model G to obtain dx. (b) ;

[0153] Step 5: Iterate through step 4 H times to obtain H sets of dx. (b) The images are sequentially input into S to obtain H groups of face image quality scores, denoted as s.h (b) Where h = 0, 1, 2, 3, ..., H, H is a positive integer hyperparameter set based on experience, for example, H = 4; h = 0 indicates that step 4 was not executed, corresponding to s0 (b) To score the quality of a real human face image; h=1 indicates that step 4 is executed once, corresponding to s1 (b) For the first adjustment of the mean vector mu q (b) The quality score corresponding to the generated face image; h=2 indicates that step 4 is performed twice, corresponding to s2 (b) The second adjustment (adjusting again based on the first adjustment) of the mean vector mu q (b) The quality score corresponding to the generated face image is then calculated, and so on.

[0154] Step 6, Calculation

[0155]

[0156] Where k = 0, 1, 2, ..., (H-2) / 2, β1 and β2 are hyperparameters greater than zero, set according to experience, for example, β1 = 1.0 and β2 = 0.5, and max(A,B) means taking the maximum value of A and B;

[0157] Step 7: Optimize the parameters of S using the conventional deep learning gradient descent optimization method:

[0158] w S =argmin s (loss);

[0159] Step 8: Determine whether S has converged using conventional methods, such as whether it has been trained to the specified number of times or whether the loss no longer decreases significantly. If S has converged, proceed to step 9; otherwise, proceed to step 2.

[0160] Step 9: Output the trained S.

[0161] At this point, the training of the face image quality scoring model is complete.

[0162] Correspondingly, a method for scoring the quality of facial images may include the following steps:

[0163] Step 1: Load S, the output of the second training phase, and denote the two-dimensional face image to be scored as x.

[0164] Step 2: Input the face image x into S to obtain the quality score s;

[0165] Step 3: Output s.

[0166] In this application, by inputting the previous batch of face images into the quality scoring model to be trained, the score values ​​of the previous batch are obtained. The face images of the previous batch are then subjected to quality degradation processing to generate the face images of the next batch. Since the quality of the face images will decrease after the quality degradation processing, the score values ​​of the next batch of face images will inevitably be lower than those of the previous batch when inputting them into the quality scoring model to be trained. By repeating the face quality degradation processing and obtaining the score values ​​of the batches obtained after degradation processing, face images with progressively decreasing quality can be obtained, i.e., face images with decreasing quality. This allows for the quantification of the scoring criteria for face images. Therefore, based on the score loss between the score values ​​of each adjacent batch of face images obtained from these batches of face images, the quality scoring model is trained to obtain the trained quality scoring model. This trained quality scoring model can then be used to measure the image quality of the image to be scored, realizing unsupervised model training for face image quality scoring.

[0167] It is not difficult to see that this embodiment is an embodiment corresponding to the above embodiments, and this embodiment can be implemented in conjunction with the above embodiments. The relevant technical details mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.

[0168] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.

[0169] Embodiments of the present invention also relate to an electronic device, such as... Figure 5 As shown, it includes: at least one processor 501; and a memory 502 communicatively connected to the at least one processor; wherein the memory 502 stores instructions executable by the at least one processor 501, the instructions being executed by the at least one processor 501 to perform the method of any of the above embodiments.

[0170] The memory 502 and processor 501 are connected via a bus, which can include any number of interconnecting buses and bridges. The bus connects various circuits of one or more processors 501 and memory 502 together. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Information processed by processor 501 is transmitted over a wireless medium via an antenna, which further receives information and transmits it to processor 501.

[0171] Processor 501 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory 502 can be used to store information used by the processor during operation.

[0172] Embodiments of the present invention relate to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the above-described method embodiments.

[0173] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

Claims

1. A method for training a quality scoring model for facial images, characterized in that, include: The face images from the previous batch are input into the quality scoring model to be trained to obtain the score values ​​of the previous batch. The previous batch of face images is subjected to quality degradation processing to generate the next batch of face images; The next batch of face images is input into the quality scoring model to be trained to obtain the score value of the next batch. The quality scoring model is trained based on the score loss between adjacent batches of scores obtained from multiple batches of face images to obtain the trained quality scoring model. The step of performing quality degradation processing on the previous batch of face images to generate the next batch of face images includes: The face images from the previous batch are sequentially input into the feature encoding model to obtain the face feature vector of each face image. The elements in the face feature vector are decoupled from each other and each represents a face feature of one dimension. Adjust the value of at least one element in the face feature vector to degrade the face feature of the dimension represented by that element; The degraded facial feature vectors are sequentially input into the image generation model to obtain the degraded facial images of the previous batch as the facial images of the next batch. The feature encoding model and the image generation model are constructed based on generative adversarial networks. The process of training the feature encoding model and the image generation model includes: The input face image of the feature encoding model is labeled as a real face image, and the face feature vector obtained by inputting the input face image into the feature encoding model and then inputting it into the image generation model is labeled as a generated face image. The same real face image corresponds to the input face image and the output face image to form a sample pair. The generative adversarial network is formed by using the facial feature vector obtained by the feature encoding model as a random variable, the image generation model as a generation model, and a binary classification model used to distinguish between real facial images and generated facial images as a discriminant model. The facial feature vector, as a sample, follows a first normal distribution. Based on multiple batches of sample pairs and the first loss constructed based on the binary classification values ​​output by the binary classification model, the feature encoding model and the generative adversarial network are jointly trained for the first time to obtain the trained binary classification model. Based on the trained binary classification model, the binary classification value of each face image in another batch of sample pairs is obtained, and a second loss is constructed based on the binary classification value and the image difference between the two face images in each of the other batches of sample pairs. The order of elements in the face feature vector obtained by inputting real face images from another batch of samples into the feature encoding model is randomly adjusted to obtain a face feature adjustment vector. The face feature adjustment vector, as a sample, follows a first adjusted normal distribution. A third loss is constructed based on the distribution difference between the first normal distribution and the first adjusted normal distribution, and a fourth loss is constructed based on the distribution difference between the first normal distribution and the standard normal distribution. The feature encoding model and the image generation model are trained based on the second loss, the third loss, and the fourth loss to obtain the trained feature encoding model and the image generation model; The scoring loss is constructed using the following formula: ; in, loss For the aforementioned scoring loss, k =0,1,2,…,( H -2) / 2, H For batch number, 、 、 The order is number 1 2k, 2k+1, 2k+2 Batch score, b =1,2,…, B , B For batch size, , This is a hyperparameter.

2. The method according to claim 1, characterized in that, The feature encoding model includes a feature encoding network and a first generation module; the process of obtaining a facial feature vector through the feature encoding model includes: The face image to be processed is input into the feature encoding network to obtain the first mean vector and the first standard deviation vector; The first generation module samples a first sample value vector from a standard normal distribution, and then obtains the face feature vector using the following formula. This face feature vector, as a sample, follows the first normal distribution: ; in, The facial feature vector; For the first sampled value vector, Let the first mean vector be... Let the first standard deviation vector be... n This is the length of the vector.

3. The method according to claim 1, characterized in that, The first loss is calculated using the following formula: in, For the first loss, The binary classification value is obtained by inputting a real face image into the binary classification model. The binary classification value is obtained by inputting the face image into the binary classification model. m=1 Indicates the category of generated face image, m=2 Indicates the category of real human face images. This is a hyperparameter.

4. The method according to claim 1, characterized in that, The second loss is calculated using the following formula: in, For the second loss, For the real face images in the sample pair The binary classification values ​​obtained by inputting them into the trained binary classification model. Generate face images for the sample pairs. The binary classification values ​​obtained by inputting them into the trained binary classification model. m=1 Indicates the category of generated face image, m=2 Indicates the category of real human face images. This is a hyperparameter.

5. The method according to claim 1, characterized in that, The third loss is calculated using the following formula: ; in, For the third loss, for The probability distribution, The sample follows a first mean vector. The first standard deviation vector is The first normal distribution, for The probability distribution, The sample follows the first mean adjustment vector as follows: The first adjusted standard deviation vector is The first adjusted normal distribution, n The length of the vector. This is a hyperparameter.

6. The method according to claim 1, characterized in that, The fourth loss is calculated using the following formula: ; in, For the fourth loss, , The vectors are, in order, the first mean vector and the first standard deviation vector of the first normal distribution. n The length of the vector. This is a hyperparameter.

7. The method according to claim 1, characterized in that, Adjusting the value of at least one element in the facial feature vector to degrade the facial features of the dimension represented by that element includes: Determine the first normal distribution that the face feature vector follows as a sample, and increase the element value of at least one element in the first mean vector of the first normal distribution; The first adjusted normal distribution is determined based on the increased first mean vector and the first standard deviation vector of the first normal distribution; A second sample value vector is obtained by sampling from the first adjusted normal distribution, and the adjusted face feature vector is obtained by the following formula, wherein the adjusted face feature vector, as a sample, follows the first adjusted normal distribution: ; in, zc n (b) The adjusted facial feature vector; This is the second sampled value vector. The first mean vector after the increase. Let the first standard deviation vector be... n This is the length of the vector.

8. A method for quality scoring of facial images, characterized in that, include: The face image to be evaluated is input into the quality scoring model trained by the face image quality scoring model training method according to any one of claims 1-7 to obtain the first score value; The quality of the face image to be evaluated is determined based on the first score.

9. An electronic device, characterized in that, include: At least one processor; A memory that is communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the face image quality scoring model training method as described in any one of claims 1 to 7, or the face image quality scoring method as described in claim 8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the face image quality scoring model training method as described in any one of claims 1 to 7, or the face image quality scoring method as described in claim 8.

Citation Information

Patent Citations

  • Image quality processing system, method, equipment and medium

    CN112365551A