Face image processing method and device, equipment, storage medium and product
By updating the initial synthetic image set by calculating the first and second deviation features in the face dataset, the problem of poor performance of general data distillation algorithms on face datasets is solved, and more efficient and accurate data distillation results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-10-09
- Publication Date
- 2026-04-10
AI Technical Summary
Existing general-purpose data distillation algorithms perform poorly on face datasets, struggling to effectively distinguish face categories, resulting in ineffective data distillation.
By acquiring image features of the initial synthetic image set, determining initial statistical features, and calculating the first and second deviation features based on the target statistical features of the face dataset, the initial synthetic image set is updated to generate the target synthetic image set, which mimics the integrity and class information of the face dataset.
It improves the data distillation effect of face datasets, reduces the amount of training data for models, and enhances model training efficiency and accuracy.
Smart Images

Figure CN121838221A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a face image processing method and device, equipment, storage medium and product. BACKGROUND
[0002] Data distillation is a method of simulating a large face data set by a small amount of synthetic data. Training a model using a small amount of synthetic data after data distillation can achieve similar results to training a model using a large face data set.
[0003] The current data distillation method generally uses a general data distillation algorithm to distill data on a general data set. However, when directly applying a general data distillation algorithm to a face data set for data distillation, the classification of a face data set is more detailed and has more categories than a general data set, making it more difficult to distinguish different face categories. For example, it is more difficult to distinguish two people than a person and a cat. Therefore, directly applying a general data distillation algorithm to a face data set for data distillation will result in poor data distillation results for a face data set. Therefore, how to improve the data distillation results for a face data set is a problem to be solved. SUMMARY
[0004] The embodiments of the present application provide a face image processing method, device, equipment, storage medium and product, which can improve the data distillation results for a face data set.
[0005] In a first aspect, the present application provides a face image processing method, comprising:
[0006] obtaining image features of an initial synthetic image set, and determining initial statistical features of the image features of the initial synthetic image set; each initial synthetic image in the initial synthetic image set corresponds to a category;
[0007] determining first deviation features for the initial synthetic image set based on the initial statistical features and target statistical features of image features of each face real image in a face data set;
[0008] determining second deviation features of the initial synthetic image set based on image features of initial synthetic images of each category in the initial synthetic image set, and image features of face real images having the same category as the initial synthetic images of each category;
[0009] updating the initial synthetic image set based on the first deviation features and the second deviation features to obtain a target synthetic image set.
[0010] In a second aspect, the present application provides a face image processing device, comprising:
[0011] The feature acquisition unit is used to acquire image features of the initial synthesized image set and determine the initial statistical features of the image features of the initial synthesized image set; each initial synthesized image in the initial synthesized image set corresponds to a category;
[0012] The first deviation determination unit is used to determine the first deviation feature for the initial synthetic image set based on the target statistical features of the image features of each real face image in the face dataset and the initial statistical features.
[0013] The second deviation determination unit is used to determine the second deviation features of the initial synthesized image set based on the image features of the initial synthesized image of each category in the initial synthesized image set, and the image features of the real face image of the same category as the initial synthesized image of each category.
[0014] The image update unit is used to update the initial synthetic image set based on the first deviation feature and the second deviation feature to obtain the target synthetic image set.
[0015] Thirdly, this application provides a computer device including a processor and a memory, wherein the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer program executes the above-described face image processing method.
[0016] Fourthly, this application provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having the processor performs the above-described face image processing method.
[0017] Fifthly, this application provides a computer program product, which includes a computer program / instructions that, when executed by a processor, can implement the above-described face image processing method.
[0018] In this embodiment, image features of an initial synthesized image set are obtained, and initial statistical features of these features are determined. Each initial synthesized image in the initial synthesized image set corresponds to a category. Based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset, a first deviation feature is determined for the initial synthesized image set. Based on the image features of each category of the initial synthesized image in the initial synthesized image set, and the image features of real face images belonging to the same category as the initial synthesized images of each category, a second deviation feature is determined for the initial synthesized image set. The initial synthesized image set is updated based on the first and second deviation features to obtain a target synthesized image set. Since the first deviation feature reflects the difference in overall information between the initial synthesized image set and all categories of real face images in the face dataset, updating the initial synthesized image set using the first deviation feature can achieve overall information imitation of the face dataset by the initial synthesized image set. Since the second deviation feature reflects the difference in internal information between initial synthesized images of the same category and each category of real face images, updating the initial synthesized image set using the second deviation feature can guide the initial synthesized images to imitate information of real face images of the same category. Therefore, the initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, as well as the facial features of real face images of each category. This means that a small initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, which can improve the effect of data distillation on the face dataset. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the network architecture of a face image processing system provided in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram illustrating an application scenario of a face image processing method provided in an embodiment of this application;
[0022] Figure 3 This is a schematic flowchart of a face image processing method provided in an embodiment of this application;
[0023] Figure 4This is a flowchart illustrating another face image processing method provided in an embodiment of this application;
[0024] Figure 5 This is a schematic diagram of the composition structure of a face image processing device provided in an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of the composition structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0027] For ease of understanding, the terms used in the embodiments of this application are explained below:
[0028] Data distillation is a task that extracts and condenses knowledge from a raw set of face data to create a smaller dataset. The goal is to train a model on the synthesized dataset with similar test accuracy to a model trained on the original set of face data. Data distillation can reduce the costs of storing, transmitting, and preprocessing training data for the model.
[0029] Facial recognition: This involves identifying and verifying the identity category of faces in images. Facial recognition compares detected facial features with a known facial database to determine the identity category of a face in an image. It can be used in various application scenarios, such as smart retail, smart communities, smart buildings, and online identity authentication.
[0030] The CIFAR-10 dataset (a general-purpose image dataset) contains 60,000 32x32 color images, divided into 10 categories, each containing 6,000 images. These categories include airplanes, cars, birds, cats, dogs, deer, frogs, boats, and trucks. The CIFAR-10 dataset is widely used in deep learning image classification tasks, especially in computer vision, and is one of the standard datasets for evaluating and comparing the performance of different image classification algorithms.
[0031] The CIFAR-100 dataset (another general-purpose image dataset): Its structure is similar to CIFAR-10, but it has 100 categories. Each category has 600 images, with 500 used for training and 100 for testing. Compared to CIFAR-10, CIFAR-100 has more categories and smaller differences between images.
[0032] ImageNet dataset (another general-purpose image dataset): ImageNet is a large-scale image dataset containing over 14 million images across more than 20,000 categories. In this application, the ImageNet dataset may refer to its subset, ImageNet-1000, which contains approximately 1000 images across 1000 different categories. The images in the ImageNet dataset were organized and selected based on manual annotations. These annotations include the main object categories and location information in the images, providing accurate training and testing standards for computer vision algorithms.
[0033] General datasets, such as the CIFAR and ImageNet series, contain a wide range of object categories. In other words, general datasets include not only people but also animals and other categories. In general datasets, "people" are treated as a single, unified category, without individual classification. Face datasets, on the other hand, assign a unique category to each human individual. For example, two different people might both be classified as "people" in a general dataset, but as two separate categories in a face dataset.
[0034] The CASIA dataset (a large-scale facial dataset): This dataset contains approximately 490,000 facial images, covering 10,575 different individuals, primarily sourced from publicly available images on the internet. This application's technical solution utilizes the CASIA dataset for data distillation, aiming to advance research in areas such as facial recognition and facial analysis.
[0035] SOTA (state of the art): refers to the current optimal data distillation method under the given data distillation task settings.
[0036] BN layer: The Batch Normalization layer in a neural network normalizes the input data. Specifically, it standardizes the mean and variance of the input data, making the mean 0 and the variance 1. Since the input data to the neural network each time is only a small portion of the face dataset, the BN layer progressively calculates the mean and variance of the entire face dataset, ultimately obtaining more accurate statistics such as the mean and variance of the entire face dataset for normalization.
[0037] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0038] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained model technology, operating / interactive systems, and mechatronics. Among these, pre-trained models, also known as large-scale models or foundational models, can be widely applied to downstream tasks across various AI fields after fine-tuning. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0039] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. 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. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and pre-trained learning. Pre-trained models are the latest development in deep learning, integrating all of these techniques.
[0040] For example, in this application, an artificial neural network in machine learning technology can be used to determine the first deviation feature for the initial synthesized image set based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset; a second deviation feature can also be determined based on the image features of each category of the initial synthesized image in the initial synthesized image set, and the image features of real face images of the same category as each category of the initial synthesized image; the initial synthesized image set can also be updated based on the first deviation feature and the second deviation feature to obtain the target synthesized image set, and so on.
[0041] The design concept of the embodiments of this application is described below:
[0042] This technical solution is applicable to scenarios involving data distillation of any dataset. By synthesizing a small amount of data to learn the complete information of the dataset, the learned small amount of data possesses the complete information of the dataset. This allows the model to be trained using the learned small amount of data, reducing the amount of training data, improving training efficiency, and ensuring training accuracy. For example, it can be applied to scenarios involving data distillation of general datasets or face datasets. Taking the application to face datasets as an example, by synthesizing a small amount of data to learn information from the face dataset, the learned small amount of data possesses all the information of the face dataset. Using this learned small amount of data to train the model reduces the amount of training data compared to training the model using the entire face dataset, thus improving training efficiency and ensuring training accuracy. This technical solution can also be applied to various scenarios, such as general model training scenarios, face model training scenarios, face recognition model training scenarios, face analysis model training scenarios, or other model training scenarios related to face processing.
[0043] Please see Figure 1 , Figure 1 This is a schematic diagram of the network architecture of a face image processing system provided in an embodiment of this application, such as... Figure 1 As shown, the computer device can interact with the terminal device, and the number of terminal devices can be one or at least two. For example, when there are multiple terminal devices, the terminal devices may include... Figure 1 The system includes terminal devices 101a, 101b, and 101c. Taking terminal device 101a as an example, computer device 102 can acquire image features of an initial synthesized image set and determine initial statistical features of those features. Further, computer device 102 can determine a first deviation feature for the initial synthesized image set based on the initial statistical features and target statistical features of image features of real face images in the face dataset. Additionally, computer device 102 can determine a second deviation feature for the initial synthesized image set based on image features of each category of initial synthesized images in the initial synthesized image set and image features of real face images belonging to the same category as each category of initial synthesized images. Further, computer device 102 can update the initial synthesized image set based on the first and second deviation features to obtain a target synthesized image set. Optionally, computer device 102 can send the target synthesized image set to terminal device 101a, enabling terminal device 101a to train any model based on the target synthesized image set, etc.
[0044] It is understood that the computer equipment mentioned in the embodiments of this application includes, but is not limited to, terminal devices or servers. In other words, the computer equipment can be a server or a terminal device, or a system composed of a server and a terminal device. The terminal device mentioned above can be an electronic device, including but not limited to mobile phones, tablets, desktop computers, laptops, PDAs, in-vehicle devices, intelligent voice interaction devices, augmented reality / virtual reality (AR / VR) devices, head-mounted displays, wearable devices, smart speakers, smart home appliances, aircraft, digital cameras, webcams, and other mobile internet devices (MIDs) with network access capabilities. The server mentioned above can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, vehicle-to-everything (V2X) communication, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0045] It should be noted that the collection and processing of relevant data (such as the initial synthesized images in the initial synthesized image set, the real face images in the face data set, the initial images, etc.) in the embodiments of this application should strictly comply with the requirements of relevant local laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0046] Further, please see Figure 2 , Figure 2 This is a schematic diagram illustrating an application scenario of a face image processing method provided in an embodiment of this application; for example... Figure 2As shown, the computer device can acquire a face dataset 21 and an initial face recognition model 22. It trains the initial face recognition model 22 using the face dataset 21 to obtain a target model deviation feature 23. Based on the target model deviation feature 23, it updates the initial face recognition model 22 until it converges. The converged initial face recognition model 22 is then determined as the target face recognition model 24. Further, the computer device can acquire an initial synthetic image set 25. It inputs the initial synthetic image set 25 into the target face recognition model 24 to extract initial image features 26 from the image features of the initial synthetic image set, and determines the initial statistical features of the initial image features 26. Based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset 21, it determines the first deviation feature 27 of the target face recognition model 24 for the initial synthetic image set 25. Furthermore, the computer device can determine the second deviation feature 29 of the target face recognition model 24 for the initial synthetic image set 25 based on the initial image features 26 of each category of the initial synthetic image in the initial synthetic image set 25 and the target image features 28 of the real face image with the same category as each category of the initial synthetic image. The initial synthetic image set 25 is then updated based on the first deviation feature 27 and the second deviation feature 29 to obtain the target synthetic image set.
[0047] Further, please see Figure 3 , Figure 3 This is a flowchart illustrating a face image processing method provided in an embodiment of this application; as shown... Figure 3 As shown, this face image processing method can be applied to computer devices, and the face image processing method includes, but is not limited to, the following steps:
[0048] S101, Obtain the image features of the initial synthesized image set, and determine the initial statistical features of the image features of the initial synthesized image set.
[0049] In some scenarios, data distillation typically employs general data distillation algorithms on common datasets such as CIFAR-10, CIFAR-100, and ImageNet. However, face datasets, compared to general datasets, have much more detailed classifications of people and a significantly larger number of categories. This makes it much more difficult to distinguish between different person categories when using general datasets—distinguishing between two people is more difficult than distinguishing between a person and a cat. Furthermore, the number of person categories can reach tens of thousands, hundreds of thousands, millions, or even tens of millions. Therefore, directly applying general data distillation algorithms to face datasets is ineffective. The resulting synthetic images exhibit poor distinguishability between different categories, ultimately rendering the distilled synthetic data unusable for model training. The trained model struggles to recognize different face categories in face recognition tasks.
[0050] Therefore, this application provides a face image processing method, mainly designed for face recognition tasks and the characteristics of face datasets. Its distillation effect is significantly better than various general data distillation algorithms in academia, greatly narrowing the performance difference between the distilled data and the face dataset. First, this application utilizes the statistical characteristics of the entire face dataset to constrain the synthetic data and the face dataset to obtain as consistent statistical characteristics as possible within the same model, thereby achieving a holistic imitation of the entire face dataset by the synthetic data. Simultaneously, it guides the consistency of information between the synthetic data and the real face data of the same category within the face dataset. This improves the quality of the synthetic data from both the holistic information of the entire category and the internal information of each category, effectively combining data distillation with information from both the entire face dataset and the categories within it, thus improving the accuracy of data distillation for the face dataset. This application significantly narrows the performance difference between the synthetic data and the face dataset, allowing for model training with a small amount of synthetic data instead of a large face dataset, reducing resource consumption during model training.
[0051] In this embodiment, a computer device can acquire an initial composite image set. By extracting features from each initial composite image in the set, image features of the initial composite image set are obtained. These image features can include the image features of each initial composite image. The image features of each initial composite image can reflect the main image information in that image, such as facial features like the size and shape of the eyes, the size and shape of the nose, and the presence of moles on the nose. Each initial composite image in the set corresponds to a category, and these categories can be the same or different. For example, a category can refer to a face category; one person can correspond to one face category. That is, the initial composite image set can include multiple initial composite images of one person, or initial composite images of multiple people, with each person's initial composite image corresponding to a different category.
[0052] The initial composite image set can refer to a batch of initial composite images, or a combination of initial composite images, i.e., a group of initial composite images, etc. The form of the initial composite image set is not limited in this embodiment. The number of images in the initial composite image set can be multiple. Taking a batch of initial composite images as an example, a portion of the initial composite images can be selected each time as a batch of initial composite images. Subsequently, processing can be performed on each batch of initial composite images, such as calculating the first deviation feature of the batch of initial composite images. That is, the first deviation feature of the batch of initial composite images is calculated as a whole. The first and second deviation features of the batch of initial composite images can then be combined to update the batch of initial composite images to obtain a batch of target composite images. Optionally, a batch of initial composite images can include multiple categories of initial composite images. By processing multiple categories of initial composite images in a batch each time, the categories of the initial composite images in this batch can be dispersed, thereby ensuring the accuracy and effectiveness of the initial composite image update. It is understandable that when obtaining the initial synthetic image set, the category corresponding to each initial synthetic image in the initial synthetic image set can be obtained separately, which is convenient for determining the real face image of the same category based on the category corresponding to each initial synthetic image.
[0053] In one embodiment, a computer device may acquire multiple initial images, and perform noise processing on each of the multiple initial images to obtain multiple initial composite images; one initial image corresponds to one initial composite image, and each initial composite image has a category.
[0054] The initial image can be any image, such as a face image, an image other than a face image, or even a blank image. The computer device acquires multiple initial images and processes each initial image with noise to obtain multiple initial composite images, which can be noisy images. Noise processing of the initial images involves initializing the pixel values of each pixel in the initial image with random values, i.e., random assignment, so that the noisy image fits the category of the real face image. Therefore, the category corresponding to the initial composite image obtained after noise processing can determine the category of the real face image it fits. Since the initial composite images are subsequently used to learn the features of real face images of the same category, the multiple initial composite images can be fitted to different categories as much as possible. That is, the initial composite images obtained after assigning values to each initial image belong to different categories. This allows subsequent learning of the internal information of real face images of the same category based on the initial composite images of each category, so that the synthesized data obtained after data distillation has the internal information of the same category as the face dataset. The internal information of the same category can be used to reflect the commonalities and correlations between facial features in real face images of the same category.
[0055] In this embodiment, multiple initial images are acquired and noise-processed to obtain multiple initial synthetic images. Since the initial synthetic images are noisy images, when learning information from real face images in a face dataset using these noisy images, the initial differences between the image information in the noisy images and the image information in the real face images are significant. Subsequently, by updating the pixel values of the pixels in the noisy images, the differences between the noisy images and the real face images can be gradually reduced, allowing the noisy images to learn the image information from the real face images. This improves the accuracy of image updates and, consequently, the accuracy of data distillation of face data. Furthermore, an initial synthetic image set can be selected from the multiple initial synthetic images, and the image features of the initial synthetic image set can be extracted for initial statistical feature calculation.
[0056] Alternatively, after performing noise processing on multiple initial images to obtain multiple initial composite images, at least one initial composite image can be selected from the multiple initial composite images to obtain a set of initial composite images.
[0057] The initial synthesized image set includes at least one initial synthesized image. The computer device can randomly select at least one initial synthesized image from multiple initial synthesized images to obtain the initial synthesized image set, or it can select initial synthesized images of different categories from multiple initial synthesized images to obtain the initial synthesized image set. It is understood that when selecting at least one initial synthesized image from multiple initial synthesized images, the initial synthesized image set can be obtained by selecting initial synthesized images of various categories. This results in a more dispersed distribution of categories among the initial synthesized images in the initial synthesized image set, allowing subsequent initial synthesized image sets to learn more category information contained in the face dataset.
[0058] In this embodiment, by acquiring the image features of the initial synthesized image set, initial statistical features of the image features of the initial synthesized image set can be determined based on these features. The initial statistical features may include the image features of each initial synthesized image in the initial synthesized image set. The image features of each initial synthesized image can be obtained by feature extraction, which extracts the image information contained in each initial synthesized image. The image features of each initial synthesized image can be represented in the form of a feature vector or a feature matrix. The initial statistical features of the image features of the initial synthesized image set can be used to reflect the overall information of the initial synthesized image set, such as which categories of initial synthesized images are included in the initial synthesized image set, the number of initial synthesized images in each category, the correlation and differences between the initial synthesized images in each category, and so on.
[0059] By comparing the differences in statistical features between the image features of two image sets and updating one of the image sets based on these differences, the updated image set can have statistical features equal to or similar to those of the unupdated image set. For example, by comparing the initial statistical features of the image features of the initial synthesized image set with the target statistical features of the image features of each real face image in the face dataset, the differences between the overall information of the initial synthesized image set and the face dataset can be determined. Then, based on these differences, each initially synthesized image in the initial synthesized image set can be updated, making the statistical features of the updated target synthesized image set equal to or similar to the target statistical features of the image features of each real face image in the face dataset. This achieves the mimicry of the overall information of the entire face dataset from the image information of the initial synthesized image set, essentially replacing the face dataset with the target synthesized image set, thus achieving data distillation—equivalent to distilling the face dataset into the target synthesized image set.
[0060] Optionally, the initial statistical features of the image features of the initial synthesized image set may include, for example, at least one of the mean, variance, standard deviation, and other statistical features of the image features of the initial synthesized image set. Since the mean, variance, and standard deviation can all reflect the overall information of the image features of the initial synthesized image set, by obtaining the statistical features of the image features of the initial synthesized image set, the difference between the overall information of the image features of the initial synthesized image set and the overall information of the image features of the face dataset can be determined by combining the target statistical features of the image features of the face dataset, thereby guiding the initial synthesized image set to imitate the overall information of the entire face dataset.
[0061] For example, if the initial statistical characteristic of the image features of the initial synthesized image set is the mean of the image features of the initial synthesized image set, then the average value of the image features of all the initial synthesized images in the initial synthesized image set can be calculated to obtain the mean of the image features of the initial synthesized image set. If the initial statistical characteristic of the image features of the initial synthesized image set is the variance of the image features of the initial synthesized image set, then the difference between the image features of each initial synthesized image and the mean of the image features of the initial synthesized image set can be calculated, and the average value of the squared differences can be obtained as the variance of the image features of the initial synthesized image set. If the initial statistical characteristic of the image features of the initial synthesized image set is the standard deviation of the image features of the initial synthesized image set, then the square root of the variance of the image features of the initial synthesized image set can be taken to obtain the standard deviation of the image features of the initial synthesized image set.
[0062] In this embodiment, since each initial synthesized image in the initial synthesized image set is a noisy image, by extracting the initial statistical features of the image features of each noisy image in the initial synthesized image set, the initial statistical features of the image features of each noisy image in the initial synthesized image set can subsequently be used to mimic the target statistical features corresponding to the face dataset, thereby enabling each noisy image in the initial synthesized image set to learn the overall information of the entire face dataset. The overall information of the entire face dataset can reflect the correlation between the various real face images in the face dataset.
[0063] S102, based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset, determine the first deviation feature for the initial synthetic image set.
[0064] In this embodiment, the first deviation feature of the initial synthesized image set is used to reflect the difference between the image features of the initial synthesized image set and the image features of the face data set. The first deviation feature of the initial synthesized image set can be obtained, for example, through pre-configuration, or obtained from other terminal devices, or obtained from similar scenes. This embodiment does not limit the method of obtaining the first deviation feature of the initial synthesized image set.
[0065] In one embodiment, since initial statistical features of image features of an initial synthesized image set are calculated, the computer device can acquire target statistical features of image features of each real face image in the face dataset. Based on the initial statistical features and the target statistical features of image features of each real face image in the face dataset, a first deviation feature for the initial synthesized image set is determined. Here, the face dataset can refer to a face recognition dataset used for face recognition to distinguish different people, and the face dataset includes multiple images of the same or different people. The target statistical features can reflect the overall information of various categories in the face dataset. For example, the overall information of various categories can reflect which categories of real face images are included in the face dataset, the number of real face images of each category, the correlation and differences between real face images of various categories, etc. The target statistical features can refer to at least one of the mean, variance, standard deviation, and other statistical features of each real face image in the face dataset.
[0066] It is understood that the initial statistical features of the image features of the initial synthesized image set in this embodiment are of the same type as the target statistical features of the image features of each real face image in the face dataset. For example, if the initial statistical feature of the image features of the initial synthesized image set is the mean of the image features of the initial synthesized image set, then the target statistical feature of the image features of each real face image in the face dataset can refer to the mean of each real face image in the face dataset. Alternatively, if the initial statistical feature of the image features of the initial synthesized image set is the variance of the image features of the initial synthesized image set, then the target statistical feature of the image features of each real face image in the face dataset can refer to the variance of each real face image in the face dataset. Or, if the initial statistical feature of the image features of the initial synthesized image set is the standard deviation of the image features of the initial synthesized image set, then the target statistical feature of the image features of each real face image in the face dataset can refer to the standard deviation of each real face image in the face dataset. For example, if the initial statistical features of the image features in the initial synthesized image set are the mean and variance of the image features in the initial synthesized image set, then the target statistical features of the image features of each real face image in the face dataset can refer to the mean and variance of the image features of each real face image in the face dataset.
[0067] Optionally, the computer device may obtain the target statistical features of the image features of each real face image in the face dataset by: obtaining the image features of each real face image in the face dataset, and calculating the target statistical features of the image features of each real face image in the face dataset based on the image features of each real face image in the face dataset.
[0068] The image features of each real face image can reflect the main image information in each real face image, such as the facial features, like the size and shape of the eyes, the size and shape of the nose, and the presence of moles on the nose. The face dataset can refer to any face dataset, such as the publicly available CASIA dataset, or other publicly available or unavailable face datasets; this application does not limit this. The target statistical features of the image features of each real face image in the face dataset can refer to the target statistical features of the image features of all real face images in the face dataset. The image features of each real face image can be obtained by feature extraction, which extracts the image information contained in each real face image. The image features of each real face image can be represented in the form of a feature vector or a feature matrix.
[0069] The specific method for calculating the target statistical features of image features of each real face image in the face dataset can refer to the aforementioned method for calculating the initial statistical features of image features of the initial synthetic image set, and will not be repeated here.
[0070] In one embodiment, if the initial statistical feature of the image features of the initial synthesized image set is the mean of the image features of the initial synthesized image set, then the target statistical feature of the image features of each real face image in the face dataset can refer to the mean of each real face image in the face dataset. The first deviation feature for the initial synthesized image set can then be determined in the following way:
[0071] Based on the initial mean of image features of the initial synthesized image set and the target mean of image features of each real face image in the face dataset, the mean deviation feature of the initial synthesized image set is determined; based on the mean deviation feature of the initial synthesized image set, the first deviation feature for the initial synthesized image set is determined.
[0072] The first deviation feature of the initial synthesized image set reflects the difference between the image features of the initial synthesized image set and the image features of each real face image in the face dataset. The mean deviation feature of the initial synthesized image set reflects the difference between the initial mean of the image features of the initial synthesized image set and the target mean of the image features of each real face image in the face dataset; that is, it reflects the overall difference between the image features of the initial synthesized image set and the image features of all categories in the face dataset. Determining the first deviation feature for the initial synthesized image set based on the mean deviation feature can mean that the mean deviation feature of the initial synthesized image set is defined as the first deviation feature for the initial synthesized image set. The first deviation feature can be, for example, a loss function, such as Batch Normalization (BN) loss or other losses. Since the mean deviation feature is determined by the difference between the initial mean of the image features of the initial synthesized image set and the target mean of the image features of each real face image in the face dataset, the mean deviation feature can be defined as the first deviation feature for the initial synthesized image set. Therefore, when updating the initial synthetic image set based on the first deviation feature, the initial synthetic image set can be updated based on the difference between the means of the two sets, so that the mean of the updated target synthetic image is equal to the mean of the face data set, thus making the updated target synthetic image more similar to the face data set as a whole.
[0073] In another embodiment, if the initial statistical feature of the image features of the initial synthesized image set is the variance of the image features of the initial synthesized image set, then the target statistical feature of the image features of each real face image in the face dataset can refer to the variance of each real face image in the face dataset. The first bias feature for the initial synthesized image set can then be determined in the following way:
[0074] Based on the initial variance of the image features of the initial synthesized image set and the target variance of the image features of each real face image in the face dataset, the variance bias feature of the initial synthesized image set is determined; based on the variance bias feature of the initial synthesized image set, the first bias feature for the initial synthesized image set is determined.
[0075] The variance bias feature of the initial synthesized image set reflects the difference between the initial variance of the image features of the initial synthesized image set and the target variance of the image features of each real face image in the face dataset. In other words, it reflects the overall difference between the image features of the initial synthesized image set and the overall image features of all categories in the face dataset. Determining the first bias feature for the initial synthesized image set based on its variance bias feature can mean defining the variance bias feature of the initial synthesized image set as the first bias feature for the initial synthesized image set. The variance bias feature can be a type of loss, such as Batch Normalization (BN) loss or other losses. Since the variance bias feature is determined by the difference between the initial variance of the image features of the initial synthesized image set and the target variance of the image features of each real face image in the face dataset, it can be defined as the first bias feature for the initial synthesized image set. Therefore, when updating the initial synthetic image set based on the first deviation feature, the initial synthetic image set can be updated based on the difference between the variances of the two sets, so that the variance of the updated target synthetic image is equal to the variance of the face data set, thus making the updated target synthetic image more similar to the face data set as a whole.
[0076] In another embodiment, if the initial statistical features of the image features of the initial synthesized image set are the mean and variance of the image features of the initial synthesized image set, then the target statistical features of the image features of each real face image in the face dataset can refer to the mean and variance of each real face image in the face dataset. The first bias feature for the initial synthesized image set can then be determined in the following way:
[0077] Based on the initial mean of the image features of the initial synthesized image set and the target mean of the image features of each real face image in the face dataset, the mean deviation feature of the initial synthesized image set is determined; based on the initial variance of the image features of the initial synthesized image set and the target variance of the image features of each real face image in the face dataset, the variance deviation feature of the initial synthesized image set is determined; based on the mean deviation feature and the variance deviation feature of the initial synthesized image set, the first deviation feature for the initial synthesized image set is determined.
[0078] In this embodiment, by calculating the mean deviation feature and the variance deviation feature of the initial synthesized image set respectively, a first deviation feature for the initial synthesized image set can be determined based on these two features. For example, the sum of the mean deviation feature and the variance deviation feature of the initial synthesized image set can be used as the first deviation feature. By using both the mean deviation feature and the variance deviation feature of the initial synthesized image set to determine the first deviation feature, it is equivalent to determining the first deviation feature from both the mean and variance perspectives, which improves the accuracy of determining the first deviation feature.
[0079] S103, based on the image features of the initial synthesized images of each category in the initial synthesized image set, and the image features of real face images of the same category as the initial synthesized images of each category, determine the second deviation features of the initial synthesized image set.
[0080] In this embodiment, the second deviation feature of the initial synthesized image set is used to reflect the difference between the image features of each category of the initial synthesized image and the image features of the real face image. The second deviation feature of the initial synthesized image set can be obtained, for example, through pre-configuration, or obtained from other terminal devices, or obtained from similar scenes. This embodiment does not limit the method of obtaining the second deviation feature of the initial synthesized image set.
[0081] In one embodiment, since the category of each initial synthesized image in the initial synthesized image set is obtained when the initial synthesized image set is acquired, each category of the initial synthesized image in the initial synthesized image set can learn image information of real face images of the same category in the face dataset. Therefore, the computer device can obtain real face images of the same category as each category of the initial synthesized image from the face dataset, and determine a second deviation feature of the initial synthesized image set by combining the image features of the real face images of the same category as each category of the initial synthesized image. The second deviation feature can be used to reflect the difference between the internal information of the initial synthesized images of the same category and the real face images. Therefore, updating the initial synthesized image set based on the second deviation feature can achieve the imitation of the initial synthesized images of each category of real face images from the internal information level of each category.
[0082] In an optional implementation, since the category corresponding to each real face image in the face dataset can be obtained when the face dataset is acquired, real face images of the same category can be grouped into the same category. Thus, a category includes one or more real face images, and all real face images in a category belong to the same person. For example, when acquiring the face dataset, the face ID (Identity Document) to which each real face image belongs can be obtained. Since multiple real face images of a single person belong to the same face ID, all real face images in the face dataset can be classified based on the face ID. Each category obtained corresponds to one or more real face images. Furthermore, real face images belonging to the same category as the initial synthesized image of each category can be identified from the real face images of each category after classification, thereby extracting the image features of these real face images for calculating the second deviation feature.
[0083] Since the category of each initial synthesized image in the initial synthesized image set has been determined and the image features of the initial synthesized image set have been obtained when acquiring the initial synthesized image set, and the category of each real face image in the face dataset and the image features of each real face image in the face dataset have been determined, the image features of real face images with the same category as each category of initial synthesized images in the initial synthesized image set can be selected from the face dataset for each category of initial synthesized images. Therefore, based on the image features of each category of initial synthesized images and the image features of real face images with the same category as each category of initial synthesized images, the second deviation feature of the initial synthesized image set can be determined.
[0084] The second bias feature of the initial synthetic image set reflects the difference between the image features of each category of the initial synthetic image set and the image features of the real face images of the same category. The second bias feature can be a type of loss, such as the Maximum Mean Discrepancy (M3D) loss or other losses.
[0085] In this embodiment, by calculating the differences between the image features of the initial synthesized image of each category and the image features of the real face image of the same category as the initial synthesized image of each category, the differences between the image features of the initial synthesized images of each category and the image features of the real face image of the corresponding category in the initial synthesized image set can be determined. This is equivalent to determining the differences between the internal information between the initial synthesized images of each category and the real face image. Then, based on the differences between the image features of the initial synthesized images of each category and the image features of the real face image of the corresponding category in the initial synthesized image set, each initial synthesized image in the initial synthesized image set is updated, so that the target synthesized images of each category in the updated target synthesized image set learn the features of the real face image of the corresponding category, that is, learn the internal information between the same category, making the initial synthesized images of the same category more similar to the real face images.
[0086] In one embodiment, a computer device can determine a second deviation feature of the initial synthetic image set by combining the difference between the feature mean of image features of initial synthetic images of each category and the feature mean of image features of real face images of the same category. Specifically, the computer device can obtain a first feature mean of image features of initial synthetic images of each category; obtain a second feature mean of image features of at least two real face images of the same category as the initial synthetic images of each category; determine a category deviation feature of the initial synthetic images of each category based on the first and second feature mean; and obtain the average value among the category deviation features of the initial synthetic images of various categories in the initial synthetic image set, and determine the average value as the second deviation feature for the initial synthetic image set.
[0087] The first feature mean of the image features of the initial synthesized image for each category can be obtained by averaging the image features of the initial synthesized image for each category. If there is only one initial synthesized image for each category, the first feature mean of the image features of the initial synthesized image for each category is the image feature of that single initial synthesized image. If there are multiple initial synthesized images for each category, the first feature mean of the image features of the initial synthesized image for each category is the average of the image features of the multiple initial synthesized images. Obtaining the second feature mean of the image features of at least two real face images of the same category as the initial synthesized image for each category can be achieved by: obtaining at least two real face images of the same category as the initial synthesized image for each category from the face dataset, extracting image features from these at least two real face images, and then calculating the average of the image features of these at least two real face images of the same category as the initial synthesized image for each category. Since there are multiple real face images of each category in the face dataset, all or part of the real face images of each category can be randomly selected from the multiple real face images of each category as at least two real face images of the same category as the initial synthesized image for each category. A second feature mean is obtained by calculating the average of the image features of all or part of the selected real face images. The first feature mean reflects the image features of the initial synthetic image of each category, while the second feature mean reflects the image features of at least two real face images of the same category as the initial synthetic image of each category. By comparing the difference between the first feature mean and the second feature mean, the difference in internal information between the initial synthetic image of the same category and at least two real face images can be determined. This allows the determination of the difference between the initial synthetic images of each category in the initial synthetic image set and the real face images of the corresponding category. Furthermore, the initial synthetic image set is updated based on the difference between the initial synthetic images of each category in the initial synthetic image set and the real face images of the corresponding category, so that the target synthetic images of each category in the updated target synthetic image set can learn the features of the real face images of the corresponding category in the face dataset.
[0088] Understandably, the number of initial synthesized images in the initial synthesized image set is much smaller than the number of real face images in the face dataset. Furthermore, the number of initial synthesized images of each category in the initial synthesized image set is less than the number of at least two real face images of the same category obtained from the face dataset. This is equivalent to using a small number of initial synthesized image sets to learn information from the entire face dataset, and using a few initial synthesized images to learn the same category features of multiple real face images of the same category in the face dataset. This allows for the synthesis of a small dataset, namely the target synthesized image set, so that the small dataset obtained from data distillation contains all the information from the face dataset.
[0089] In this embodiment, M3D loss is a statistical method for measuring the difference between two probability distributions. Therefore, in this technical solution, M3D loss is used to measure the difference between the image features of the initial synthesized image of the same category and the image features of the real face image. The main idea of M3D is to measure the difference between the two distributions by comparing the mean of the samples in the feature space, that is, by comparing the mean of the image features of the initial synthesized image of the same category and the image features of the real face image. Optionally, an advantage of M3D is that it can handle non-parametric distributions without assuming a specific probability density function form.
[0090] The definition of M3D is based on a reproducing kernel Hilbert space (RKHS). For example, given two probability distributions P and Q, and a kernel function k (such as a Gaussian kernel, Laplace kernel, etc.), the definition of M3D is shown in equation (1-1):
[0091] M3D(P,Q)=‖E P [k(x, .)]-E Q [k(y, .)]‖ H (1-1)
[0092] Where M3D(P,Q) refers to the difference between probability distributions P and Q, x and y are samples drawn from P and Q respectively, P is used to indicate the image features of the initial synthesized image, Q is used to indicate the image features of the real face images in the face dataset, and E P and E Q Let P and Q represent the expected values respectively, and ||·|| H This represents the norm in the RKHS space.
[0093] Since it is impossible for computer devices to draw an infinite number of samples from this distribution in practical applications, the upper bound mean difference (i.e., the maximum mean difference) obtained by the Cauchy-Schwarz inequality can be used to simplify M3D in this embodiment. The simplified M3D loss calculation formula used in this embodiment is shown in formula (1-2):
[0094]
[0095] Among them, Loss M3D This refers to the second bias feature of the initial synthesized image, i.e., the M3D loss of the initial synthesized image; C refers to the total number of categories included in the initial synthesized image; x k and y k These are the initial synthetic image and the real face image of category k, respectively. f() is the operation of extracting the image features from the image of category k and calculating the mean, such as f(x k ) is the mean value of the image features extracted from the initial synthetic image of category k, f(y) k ) is the mean of the features extracted from at least two real face images of category k. ‖·‖2 represents the 2-norm calculation.
[0096] S104, the initial synthetic image set is updated based on the first deviation feature and the second deviation feature to obtain the target synthetic image set.
[0097] In this embodiment, the first deviation feature of the initial synthesized image set reflects the difference between the image features of the initial synthesized image set and the image features of each real face image in the face dataset, i.e., the difference between the image features of the initial synthesized image set and the overall information of all categories in the face dataset. The second deviation feature of the initial synthesized image set reflects the difference between the image features of each category of the initial synthesized image set and the image features of the real face images of the same category, i.e., the difference between the internal information of the initial synthesized images of the same category and the real face images. Therefore, updating the initial synthesized image set based on the first and second deviation features to obtain the target synthesized image set is equivalent to updating the initial synthesized image set by combining the differences between the overall information of all categories and the differences between the internal information of each category. Therefore, the initial synthesized image set can learn the overall information of the face dataset from the holistic information of the entire category, and the initial synthesized images of each category can learn the internal information of the real face images from the internal information level of each category. This makes the target synthesized image set have both the holistic information of the entire face dataset and the internal information of each category of the target synthesized image set. As a result, the information contained in the target synthesized image is closer to the entire face dataset, thereby improving the quality of face data distillation.
[0098] The target synthetic image set is used to train any model, such as a general model, a face model, a face recognition model, a face analysis model, or other models related to face processing. A general model, for example, can be used to identify people, animals, plants, or various other categories.
[0099] In one possible implementation, a computer device can train a face recognition model with the same structure as described above based on a target synthetic image set. When the face recognition model converges, a face recognition model is obtained. Then, the face recognition model trained on the target synthetic image set and the target face recognition model trained on the face data set are used to perform image recognition processing on the target face data set, respectively, to obtain the predicted face categories of the face recognition model and the target face recognition model for the target face data set. By combining the actual face categories of the target face data set, the recognition accuracy of the face recognition model and the target face recognition model is determined. Then, the difference between the target synthetic image set obtained by data distillation and the face data set can be determined based on the recognition accuracy of the face recognition model and the target face recognition model for the target face data set.
[0100] The target face dataset refers to the dataset consisting of any face images other than those used to train the initial face recognition model, as described above. For example, if the difference in recognition accuracy is less than the accuracy threshold, the difference between the target synthetic image set obtained by data distillation and the face dataset is considered small, and the data distillation effect is good. If the difference in recognition accuracy is greater than or equal to the accuracy threshold, the difference between the target synthetic image set obtained by data distillation and the face dataset is considered large, and the data distillation effect is poor.
[0101] In another possible implementation, once the initial model to be trained is obtained, the computer device can use the target synthetic image set to train the initial model to obtain the target model, and perform image prediction processing on the face image to be processed based on the target model to obtain the prediction result of the face image to be processed.
[0102] The initial model can refer to any model related to face processing, such as a model for recognizing key features of different faces or other models. By training the initial model using a set of target synthetic images, the target model can recognize different categories of faces, and then extract different key features for each category, and so on. By training the initial model using a set of target synthetic images, the trained target model can be applied to various scenarios requiring face recognition. Furthermore, because a small set of target synthetic images is used to train the initial model, it can achieve similar results to training an initial model using a large set of face data, thereby improving model training efficiency.
[0103] In this embodiment, updating the initial synthesized image set based on the first deviation feature and the second deviation feature to obtain the target synthesized image set can refer to updating the pixel values of each pixel in the initial synthesized image set based on the first deviation feature and the second deviation feature, and determining the initial synthesized image corresponding to the pixel with the updated pixel value as the target synthesized image. The target synthesized image set is obtained by updating each initial synthesized image in the initial synthesized image set. One initial synthesized image is updated to one target synthesized image, and the number of initial synthesized images in the initial synthesized image set can be equal to the number of target synthesized images in the target synthesized image set.
[0104] Understandably, the number of initial synthesized images in the initial synthesized image set is much smaller than the number of real face images in the face dataset. Therefore, it is possible to use a small initial synthesized image set to learn the full category information and individual category information of the face dataset. The resulting target synthesized image set contains all the information of the face dataset, so the target synthesized image set can replace the entire face dataset. Subsequently, when training any model using the face dataset, the target synthesized image set can be used directly to train any model, which is equivalent to reducing the amount of training data for the model and reducing the cost of data storage, transmission, and preprocessing, without reducing the information contained in the training data. This improves the model training efficiency and saves resource costs, thereby improving the quality of data distillation of the face dataset.
[0105] In an optional implementation, to further improve the effect of data distillation, multiple initial synthetic image sets can be obtained. Each initial synthetic image set can include initial synthetic images of different categories as much as possible. This allows the facial information of the real face images in the face dataset learned in each initial synthetic image set to be different and more dispersed and richer in categories, so that as many categories of initial synthetic images as possible can learn more categories of facial information in the face dataset.
[0106] In this embodiment, the initial synthesized image set can be one or more. The above example mainly uses any one initial synthesized image set. For other initial synthesized image sets among multiple initial synthesized image sets, the method of calculating the first deviation feature and the second deviation feature of the initial synthesized image set can be used to update the initial synthesized image set based on the first deviation feature and the second deviation feature to obtain the target synthesized image set. This embodiment will not elaborate further on this. If there are multiple initial synthesized image sets, each initial synthesized image set can be updated to obtain a target synthesized image set in the above manner. The resulting multiple target synthesized image sets can more accurately and comprehensively reflect the information of the entire face dataset. It is understood that the total number of target synthesized images in the multiple target synthesized image sets is less than the number of real face images in the face dataset.
[0107] The face image processing method in this embodiment can effectively reduce the storage space occupied by the model's training data and the resource consumption of subsequent model training. For example, in a CASIA dataset with 490,623 face images, the data size of the target synthetic image set after data distillation is reduced to 42,288 images. That is, using 42,288 target synthetic images, all the information of the 490,623 face images can be learned. This makes the size of the target synthetic dataset after data distillation less than one-tenth of the face dataset, reducing the data storage space by more than 90%, significantly reducing the resource consumption of model training, and simultaneously reducing the subsequent training time by more than 90%, thus significantly reducing the model training cost.
[0108] In this embodiment, image features of an initial synthesized image set are obtained, and initial statistical features of these features are determined. Each initial synthesized image in the initial synthesized image set corresponds to a category. Based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset, a first deviation feature is determined for the initial synthesized image set. Based on the image features of each category of the initial synthesized image in the initial synthesized image set, and the image features of real face images belonging to the same category as the initial synthesized images of each category, a second deviation feature is determined for the initial synthesized image set. The initial synthesized image set is updated based on the first and second deviation features to obtain a target synthesized image set. Since the first deviation feature reflects the difference in overall information between the initial synthesized image set and all categories of real face images in the face dataset, updating the initial synthesized image set using the first deviation feature can achieve overall information imitation of the face dataset by the initial synthesized image set. Since the second deviation feature reflects the difference in internal information between initial synthesized images of the same category and each category of real face images, updating the initial synthesized image set using the second deviation feature can guide the initial synthesized images to imitate information of real face images of the same category. Therefore, the initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, as well as the facial features of real face images of each category. This means that a small initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, which can improve the effect of data distillation on the face dataset.
[0109] Further, please see Figure 4 , Figure 4 This is a schematic flowchart of another face image processing method provided in an embodiment of this application. This face image processing method can be applied to computer devices; such as... Figure 4As shown, the face image processing method includes, but is not limited to, the following steps:
[0110] S201, Obtain the initial face recognition model and face data set.
[0111] In this embodiment, the initial face recognition model refers to the face recognition model that needs to be trained. The face dataset includes a large number of real face images. The computer device acquires the initial face recognition model and the face dataset, and trains the initial face recognition model using the face dataset. This enables the trained initial face recognition model to predict the category of face images. Subsequently, the trained initial face recognition model can be used to predict the category of face images and extract image features from the initial synthetic image set and the real face images in the face dataset.
[0112] Optionally, the initial face recognition model may include, but is not limited to, deep neural network models (DNN), recurrent neural network models (RNN), residual neural network models (ResNet), improved residual neural network models (iResNet), convolutional neural network models (CNN), or other models with batch normalization (BN) layers, etc.
[0113] S202, Obtain a set of real face images from the face dataset, perform image recognition processing on the set of real face images based on the initial face recognition model, and obtain the predicted face category of each real face image in the set of real face images.
[0114] In this embodiment, since the face dataset contains a large number of face images, the initial face recognition model has a limited number of images to input each time. If the number of images input to the initial face recognition model exceeds its upper limit, it may cause memory errors in the computer device, making it impossible to process the input images. Therefore, the face dataset can be divided into multiple batches, with each batch representing a set of real face images. Each time, a set of real face images is input into the initial face recognition model for image recognition processing, thereby reducing the risk of memory errors. The number of images in the initial synthesized image set of a batch can be equal to or unequal to the number of images in the set of real face images; that is, the number of images in the initial synthesized image set and the set of real face images can be equal to or unequal. This embodiment does not limit this.
[0115] Optionally, the real face images in the set of real face images can refer to one or more images randomly selected from the face dataset, and each set of real face images contains different real face images. Alternatively, the real face images in the set of real face images can be obtained by selecting one or more real face images from face clusters corresponding to multiple categories. A batch of real face image sets can correspond to one category of real face images, or a batch of real face image sets can include real face images from multiple categories. Face clusters can be obtained by clustering real face images from multiple categories in the face dataset. The specific clustering process is described in step S204 below and will not be explained in detail here. The resulting set of real face images can include real face images from multiple categories, thereby improving the training effect when training the initial face recognition model based on real face images with richer categories. For example, each batch of real face images input to the initial face recognition model includes real face images from multiple categories, making the categories richer. When training the initial face recognition model based on each batch, the initial face recognition model can learn information from real face images from more categories. It is understood that the number of real face images in the real face image set may be equal to or unequal to the number of initially synthesized images in the initial synthesized image set. The number of real face images contained in each real face image set may also be equal or unequal; this embodiment of the application does not limit this.
[0116] The image recognition processing based on an initial face recognition model for a set of real face images can refer to performing image recognition processing on each real face image included in the set based on the initial face recognition model, thereby obtaining a predicted face category for each real face image. Specifically, feature extraction is performed on each real face image using the initial face recognition model to extract image features for each real face image. These image features are then matched against multiple preset categories in the initial face recognition model, and the predicted face category for each real face image is determined based on the matching probabilities among these preset categories. For example, the preset category corresponding to the highest probability among the matching probabilities of each real face image's image features with multiple preset categories can be determined as the predicted face category for each real face image. The predicted face category for each real face image refers to the face category obtained by performing image recognition processing on each real face image based on the initial face recognition model.
[0117] Optionally, when determining the set of real face images, the real face images in the face dataset can be divided into multiple sets of real face images, taking into account the amount of input data for the initial face recognition model. The amount of input data for the initial face recognition model refers to the maximum number of images that can be input into the initial face recognition model for processing each time. It is understood that the number of face images input into the initial face recognition model each time should be less than or equal to the amount of input data for the initial face recognition model. A set of real face images can refer to a batch. By dividing the face dataset into multiple batches, the images can be input into the initial face recognition model in batches for processing. By inputting one batch of real face images into the initial face recognition model for image recognition processing each time, the model's robustness can be ensured while improving the model's training efficiency.
[0118] S203, obtain the real face category of each real face image in the real face image set, and train the initial face recognition model based on the real face category and the predicted face category of each real face image in the real face image set to obtain the target face recognition model.
[0119] The predicted face category for each real face image refers to the category obtained by image recognition processing of each real face image based on the initial face recognition model, i.e., the model prediction result. The true face category for each real face image refers to the category obtained by pre-labeling each real face image, i.e., the sample true result. The purpose of training the initial face recognition model is to make the model prediction result for each real face image as consistent as possible with the sample true result. When the model prediction result for each real face image is inconsistent with the sample true result, the initial face recognition model is trained again, and the model parameters such as model weights in the initial face recognition model are adjusted until the initial face recognition model converges. When the model prediction result for each real face image is consistent with the sample true result, the initial face recognition model is considered to have converged, the model parameters in the initial face recognition model at this time are saved, and the initial face recognition model with these model parameters is determined as the target face recognition model.
[0120] In one embodiment, the initial face recognition model can be trained to obtain the target face recognition model in the following way: based on the difference between the real face category of each real face image and the predicted face category of each real face image, the initial model deviation features of the initial face recognition model for each real face image are determined; based on the initial model deviation features of each real face image in the set of real face images, the target model deviation features of the initial face recognition model for the set of real face images are determined; when the target model deviation features are less than the deviation threshold, the initial face recognition model is determined as the target face recognition model.
[0121] The initial model bias feature can refer to the model bias feature of the initial face recognition model for each real face image, while the target model bias feature can refer to the model bias feature of the initial face recognition model for the set of real face images. Both the initial model bias feature and the target model bias feature can belong to the same type of loss, such as Cross Entropy Loss (CE Loss), Additive Angular Margin Loss (ArcFace Loss), or other losses, etc. This application does not limit this specific loss method.
[0122] Because the initial face recognition model is trained by inputting each set of real face images (i.e., each batch of real face images) into the model, the initial model bias features of each real face image in the set are obtained. Therefore, the target model bias features of the initial face recognition model for the set of real face images can be calculated based on these initial model bias features. For example, the mean of the initial model bias features of each real face image in the set can be used as the target model bias feature of the initial face recognition model for the set of real face images. By calculating the target model bias features for each set of real face images, the model parameters of the initial face recognition model can be updated using these features to ensure convergence. When the target model bias feature is greater than or equal to a bias threshold, the initial face recognition model is considered not to have converged, and other sets of real face images are used to train the initial face recognition model to reduce the target bias feature. When the deviation feature of the target model is less than the deviation threshold, the initial face recognition model can be considered to have converged. Then, the initial face recognition model at this time can be saved and the saved initial face recognition model can be determined as the target face recognition model.
[0123] In an optional implementation, the computer device may also consider the initial face recognition model to have converged when the initial face recognition model reaches the convergence condition or when the number of iterations of the initial face recognition model reaches the target number, and then the initial face recognition model at this time can be determined as the target face recognition model.
[0124] In one possible implementation, during the training of the target face recognition model, the initial face recognition model can extract features from each input real face image to obtain the image features of the real face image. Therefore, the initial face recognition model can statistically analyze the target statistical features of each real face image in each input set of real face images based on the image features of the real face images, and obtain the target statistical features of the image features of each real face image. This leads to at least one of the target mean and target variance of the image features of each real face image in the face dataset. Consequently, when calculating the first bias feature, the target statistical features of the image features of each real face image in the face dataset can be directly obtained, improving data distillation efficiency.
[0125] Optionally, the target model bias feature can refer to the recognition loss of the initial face recognition model, i.e., the base loss during the training of the initial face recognition model. This bias can be used to guide the initial face recognition model to obtain as similar feature representations as possible for faces of the same identity (i.e., the same person), while amplifying the feature differences between faces of different identities (different people). For a batch of real face images (i.e., all real face images in a set of real face images) input into the initial face recognition model, the initial face recognition model first extracts the features x of each of the batch of real face images. i , where i represents the true category of each real face image in this batch. Next, calculate x. i The recognition head y corresponding to each preset category in the initial face recognition model j cosine similarity cos(θ) j Finally, the formula for calculating the recognition loss generated by the real face images in this batch can be shown in formula (1-3):
[0126]
[0127] Among them, Loss arcface This refers to the target bias features of the initial face recognition model against a set of real face images (i.e., a batch of real face images). N refers to the total number of images in the set of real face images. n refers to the total number of all categories in the face dataset, i.e., the total number of preset categories in the initial face recognition model. j refers to the category of the real face image. cos(θ) i The cosine similarity (c) between a real face image and the i-th category out of n categories is calculated after extracting the image features. m is a hyperparameter set to further reduce the feature differences between faces of the same category; s is a hyperparameter set to further increase the feature differences between faces of different categories.
[0128] As can be seen, by using the above formulas (1-3), the recognition loss of each batch of real face images input to the initial face recognition model can be calculated. Therefore, the model parameters of the initial face recognition model can be updated using the recognition loss of each batch of real face images until the initial face recognition model converges to obtain the target face recognition model. Subsequently, when using the target face recognition model to extract image features from the initial synthetic image set, the accuracy of image feature extraction can be improved.
[0129] In this embodiment of the application, when the target face recognition model is trained, the computer device can determine a first deviation feature of the initial synthesized image set based on the target face recognition model. For example, the target face recognition model can use the target statistical features based on the initial statistical features and the image features of each real face image in the face dataset to determine the first deviation feature for the initial synthesized image set. Further, a second deviation feature of the initial synthesized image set can be determined based on the target face recognition model. For example, the target face recognition model can use the image features of each category of the initial synthesized image in the initial synthesized image set and the image features of real face images of the same category as each category of the initial synthesized image to determine the second deviation feature of the initial synthesized image set.
[0130] In this embodiment, the computer device can further fix the target statistical features of the image features of each real face image in the face dataset during the training of the target face recognition model. Here, the target statistical features refer to at least one of the mean and variance. Therefore, this means fixing at least one of the target mean and target variance of the image features of all real face images in the face dataset. The fixed target statistical features are defined as the ground truth (GT) of the target face recognition model, i.e., the ground truth (GT) in deep learning. Then, when the initial synthesized image set is input into the target face recognition model, the initial statistical features of the image features of the initial synthesized image set can be calculated. Here, the initial statistical features also refer to at least one of the mean and variance. That is, at least one of the initial mean and initial variance of the image features of the initial synthesized image set. Then, the first deviation feature is calculated by combining the initial statistical features and GT. Thus, the initial synthesized image set can be updated based on the first deviation feature to improve the consistency between the initial synthesized image set and the overall information of the entire face dataset.
[0131] In one embodiment, the target face recognition model may include at least one network layer. If the target face recognition model includes a network layer, this network layer may refer to a layer used for normalizing the input image features. By processing the image features of the initial synthetic image set input by the network layer in the target face recognition model, the initial mean and initial variance of the network layer for the initial synthetic image set can be obtained. Therefore, by combining the target mean and target variance of the network layer for all real face images in the face dataset, the first bias feature of the network layer for the initial synthetic image set can be determined.
[0132] Furthermore, if the target face recognition model includes multiple network layers, each network layer can have a different role. Therefore, each network layer processes different image features; that is, each network layer needs to process different image features from the input face image. Consequently, each network layer has different target statistical features for the image features of each real face image in the face dataset. Here, the target statistical feature refers to at least one of the target mean and target variance. For example, each network layer may have a different target mean for the image features of each real face image in the face dataset, or a different target variance for the image features of each real face image in the face dataset, or both a different target mean and a different target variance for the image features of each real face image in the face dataset. Each network layer has different initial statistical features for the image features of the initial synthesized image set. Here, the initial statistical features refer to at least one of the initial mean and the initial variance. For example, each network layer has a different initial mean for the image features of the initial synthesized image set, or each network layer has a different initial variance for the image features of the initial synthesized image set, or each network layer has a different initial mean for the image features of the initial synthesized image set and a different initial variance for the image features of the initial synthesized image set.
[0133] In this context, the multiple network layers in the target face recognition model refer to those layers that need to normalize the input image features. These layers may include, but are not limited to, convolutional layers, pooling layers, activation layers, and batch normalization (BN) layers. Multiple network layers, such as convolutional, pooling, activation, and BN layers, all have the ability to normalize the input image features. Some convolutional layers can also be used for other operations; for example, they can be used to extract image features from the initial synthesized image. Pooling layers can be used to downsample and compress the image features in the target face recognition model and reduce the number of parameters in the image. Activation layers can be used to perform linear mapping on the output results. BN layers can be used to normalize image features. The different target statistical features of each network layer for the image features of each real face image in the face dataset refer to the different target mean and the different target variance of the image features of each real face image in the face dataset for each network layer. The different initial statistical features of each network layer for the initial synthesized image set mean that the initial mean of each network layer for the initial synthesized image set is different, and / or the initial variance of each network layer for the initial synthesized image set is different. Since each network layer uses different image features for the same face image, the initial mean of each network layer for the same face image is calculated from the image features of that face image using the image features of each network layer. Because the image features used by each network layer are different, the initial mean calculated by each network layer for the same face image is different. Similarly, the initial variance calculated by each network layer for each initial synthesized image is different, the target mean calculated by each network layer for each real face image is different, and the target variance calculated by each network layer for each real face image is different.
[0134] Understandably, during the training of the target face recognition model, the target statistical features of the image features of each real face image in the fixed face dataset include the target statistical features of multiple network layers for each real face image in the face dataset. That is, the true values in deep learning include the true values of multiple network layers. Then, when the initial synthetic image set is input into the target face recognition model, the initial statistical features of each network layer for the image features of the initial synthetic image set can be calculated. Then, the first deviation feature is calculated by combining the initial statistical features of each network layer for the image features of the initial synthetic image set and the true values of each network layer. Subsequently, the initial synthetic image set can be updated based on the first deviation feature, thereby improving the consistency between the initial synthetic image set and the overall information of the entire face dataset.
[0135] In this embodiment, the target face recognition model includes multiple network layers, each with a different function. Each network layer processes different image features in the input face image, resulting in different target statistical features for the image features of the face dataset. Therefore, when obtaining the initial synthesized image set, each network layer in the target face recognition model can calculate initial statistical features for the initial synthesized image set. Based on the target statistical features of each network layer for the face dataset and the initial statistical features of each network layer for the initial synthesized image set, a first deviation feature of the target face recognition model for the initial synthesized image set is calculated. This first deviation feature is then used to update the initial synthesized image set, resulting in the target synthesized image set and improving the accuracy of image updates.
[0136] S204, perform clustering processing on real face images of at least two categories in the face dataset to obtain at least two face clusters.
[0137] In this embodiment, since the face dataset includes multiple categories of real face images, and some categories of real face images may be quite similar, for example, two categories of real face images may be images of twins with extremely similar appearances, or two categories of real face images may have two people with similar appearances, such as wearing the same black-rimmed glasses, having the same eyebrow shape, the same hair color, the same nose shape, the same mouth shape, etc. Therefore, the computer device can perform clustering processing on at least two categories of real face images in the face dataset to obtain at least two face clusters. Clustering processing can refer to grouping two or more similar categories of real face images into one category. Categories in different face clusters are not similar. For example, clustering processing can group multiple categories of twins or triplets with extremely similar appearances into one face cluster. A face cluster includes two or more similar categories of real face images.
[0138] In one implementation, face images of at least two categories can be clustered by calculating the similarity between them. The similarity can be calculated by comparing the similarity between the two categories of face images, or by calculating the average of all face images in each category, and determining the similarity based on the similarity between the averages for the two categories. A higher similarity between two categories indicates a greater probability that the face images belong to the same face cluster. Conversely, a lower similarity indicates a lower probability that the face images belong to the same face cluster. Determining whether any two categories of face images belong to the same face cluster by calculating the similarity between any two categories can improve the accuracy of face clustering.
[0139] Optionally, the computer device may perform clustering processing on at least two categories of real face images by: obtaining the mean feature value of real face images in each of the at least two categories in the face dataset; determining the face similarity between at least two categories of real face images based on the mean feature value of real face images in the at least two categories; performing clustering processing on real face images in any two categories whose face similarity is greater than the target similarity to obtain at least two face clusters; real face images in the same face cluster correspond to the same category.
[0140] The mean feature value of each category of real face images can be obtained by averaging the image features of all real face images in each category. By calculating the mean feature value of real face images in each category separately, and then calculating the face similarity between the mean feature values of real face images in at least two categories, real face images from any two categories with a face similarity greater than the target similarity can be clustered to obtain at least two face clusters. For example, the face similarity calculation methods can include, but are not limited to, cosine distance, Euclidean distance, Manhattan distance, Hamming distance, Chebyshev distance, and other similarity calculation methods.
[0141] In this embodiment, by calculating the facial similarity between at least two categories of real face images using the feature mean of at least two categories of real face images, similar categories can be determined. This allows for the clustering of real face images of similar categories into the same face cluster, facilitating subsequent processing of real face images of the same category and classifying the initial synthesized image based on the category of the face cluster. This avoids the situation where, if similar categories are not clustered into a single face cluster, the facial information within similar categories is too similar, and the number of categories is too large. Consequently, when classifying the initial synthesized image based on the clustering results of the face dataset, the resulting initial synthesized image set has too many categories, making it easy to select initial synthesized images from similar categories. This results in an insufficiently dispersed category distribution in the selected initial synthesized image set, thus allowing the initial synthesized image set to learn image information from fewer categories of real face images.
[0142] Understandably, when training a target face recognition model using a face dataset, the model can calculate the mean feature value of each category of real face images in the dataset. This mean feature value is then used as the preset category corresponding to the recognition head in the target face recognition model. Subsequently, when using the target face recognition model to recognize any face image, it can predict the probability of any face image belonging to each preset category, thus determining the category of any face image. Therefore, when clustering real face images of at least two categories, the mean feature value of each category of real face images corresponding to the recognition head can be directly obtained as the mean feature value of the corresponding category of real face images in the face dataset. This mean feature value can then be used to calculate face similarity, thereby improving image clustering efficiency.
[0143] In another implementation, to obtain the most unbiased statistical features possible, the computer device can use the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm to cluster the real face images in the face dataset. Based on the clustering results, the initial synthesized images in the initial synthesized image set are then categorized, ensuring that the categories of the initial synthesized images input into the target face recognition model are as dispersed as possible. Compared to traditional distance-based clustering algorithms, the DBSCAN algorithm can cluster images of any category and can handle noisy data. The DBSCAN algorithm mainly relies on two parameters: the neighborhood radius (Eps) and the minimum number of points (MinPts).
[0144] Specifically, the DBSCAN algorithm can be implemented through the following steps:
[0145] 1. For each point in the face dataset (i.e., each real face image), calculate the number of points in its neighborhood (including the point itself). The neighborhood is defined by the parameter Eps, which is all points within a distance of Eps from the current point; that is, all points whose similarity to the current point is greater than a similarity threshold. It can be seen that the smaller the distance between two points, the greater the similarity between the two points.
[0146] Here, a point refers to a real face image in the face dataset, and the distance between two points can refer to the distance between the image features of the real face images indicated by the two points. That is, if the distance between the image features of two real face images is less than Eps, then the similarity between the image features of the two real face images is greater than the similarity threshold, indicating that the two points indicated by the two real face images are within the neighborhood.
[0147] 2. If the number of points in the neighborhood of a point is greater than or equal to MinPts, then it is marked as a core point. Core points represent regions with higher density.
[0148] 3. For each core point, group each core point and all its directly density-reachable points (points within a distance of no more than Eps) into a new cluster. For each core point in the new cluster, add all its directly density-reachable points (including other core points) to that cluster, until all core points have been processed.
[0149] In other words, if the number of real face images within the neighborhood of a real face image is greater than or equal to the neighborhood radius, then that real face image is a core face image, and the real face images within its neighborhood can be clustered into the same face cluster. Optionally, if any point belongs to the neighborhood of two different core points, the distances between that point and the two different core points can be calculated, and the point can be clustered into the cluster containing the nearest core point. A cluster is represented as a face cluster.
[0150] Optionally, if the number of real face images in the neighborhood of any real face image is less than the neighborhood radius, then that real face image can be marked as a core point, meaning that the real face image is clustered into a face cluster. For example, if there is only one real face image of a certain category, and the category of that real face image is dissimilar to the categories of other real face images, then that real face image can be identified as a separate category.
[0151] In an optional implementation, since the recognition head of the face recognition model can store an average face feature for each category (i.e., the average face feature is the average value of all real face images in each category), in this embodiment, when clustering real face images in the face dataset, the average face features of each category can be used for DBSCAN clustering. For example, the similarity between the average face features of any two categories is calculated. If the similarity is greater than a similarity threshold, then all real face images in those two categories are clustered into one face cluster. Therefore, when the face dataset includes real face images of 1000 categories, if each training batch uses a maximum of 50 categories, the DBSCAN algorithm can cluster these 1000 categories into 50 face clusters. Then, each time, one category can be selected from each of these 50 clusters to form a batch, so that each real face image in a batch belongs to a different category, thereby making the real face images input to the target face recognition model as dispersed as possible.
[0152] In this embodiment, to ensure better data distillation results, it is desirable to use all real face images in the face dataset to calculate the target statistical features of the Batch Normalization (BN) layer. However, the data volume of a face recognition dataset is typically in the hundreds of thousands, millions, or even tens of millions, necessitating batch input into the target face recognition model for loss calculation. To obtain statistical features that are as unbiased as possible, the DBSCAN algorithm can be used to cluster the real face images of each category in the face dataset, ensuring that the categories of the real face images input into the target face recognition model each time are as dispersed as possible, thereby fitting the category distribution of the entire face dataset as closely as possible.
[0153] S205, classify multiple initial synthetic images into categories based on the categories corresponding to at least two face clusters, and obtain an initial synthetic image of at least one category.
[0154] Here, by dividing the face dataset into at least two face clusters, each face cluster representing a category, and since the category of each initial synthesized image is already known when acquiring multiple initial synthesized images, the categories of the multiple initial synthesized images can be classified by referring to the categories of each face cluster, resulting in initial synthesized images of at least one category. For example, if the category of any two or more initial synthesized images is the same as the category of the real face images contained in the face cluster, then the two or more initial synthesized images are classified into the same category. For instance, if the face cluster includes categories corresponding to twins, and the multiple initial synthesized images include initial synthesized images of these twins, then the initial synthesized images of these twins can be classified into the same category.
[0155] For example, after clustering a face dataset, at least two face clusters are obtained, including face cluster A1 (category a1), face cluster A2 (category a2), and face cluster A3 (category a3). Multiple initial composite images are also included, including initial composite image B1 (category b1), initial composite image B2 (category b2), initial composite image B3 (category b3), initial composite image B4 (category b4), and initial composite image B5 (category b5). If the category b1 of the initial synthesized image is the same as the category a1 corresponding to the face cluster A1, the categories b2 and b5 of the initial synthesized image are the same as the category a2 corresponding to the face cluster A2, and the categories b3 and b4 of the initial synthesized image are the same as the category a3 corresponding to the face cluster A3, then after classifying the multiple initial synthesized images based on the categories corresponding to at least two face clusters, three categories of initial synthesized images are obtained. The initial synthesized images of the first category include the initial synthesized image B1, the initial synthesized images of the second category include the initial synthesized images B2 and B5, and the initial synthesized images of the third category include the initial synthesized images B3 and B4.
[0156] In this embodiment, since clustering is performed by combining the feature mean of real face images of each category, it is not necessary to calculate the similarity between image features for any two real face images in the face dataset for clustering, which can improve the clustering efficiency of real face images. By combining the face similarity between real face images of at least two categories to cluster real face images, the accuracy of image clustering can be improved. Subsequently, the clustering results of real face images can be used to classify multiple initial synthetic images, which can improve the accuracy of category classification. Furthermore, this method can cluster similar categories in the face dataset into one category, reducing the total number of categories. Therefore, when classifying multiple initial synthetic images, initial synthetic images that belong to different categories but are similar can be classified into one category. Initial synthetic images that belong to different categories but are similar can refer to images of different people in multiple initial synthetic images, but the faces in the multiple initial synthetic images are similar or they all wear the same glasses, hats, etc. This avoids the problem of numerous initially synthesized images belonging to similar categories, leading to a set of initially synthesized images with similar image information selected from multiple similar categories. This results in an insufficiently dispersed distribution of the initially synthesized images input into the target face recognition model, ultimately learning fewer categories of real face images. Furthermore, since the initial synthesized images are noisy images, their image information is obtained by initializing with random values, making it difficult for noisy images to accurately represent their corresponding categories. Therefore, combining the clustering results of real face images in the face dataset to classify the initial synthesized images can improve the accuracy of category classification for the initial synthesized image set.
[0157] In an optional implementation, the computer device may also perform clustering processing on multiple initial synthetic images to obtain at least one synthetic image cluster, and determine the at least one synthetic image cluster as an initial synthetic image of at least one category. One synthetic image cluster corresponds to one category of initial synthetic images.
[0158] Specifically, the computer device can extract image features from multiple initial synthesized images, calculate the similarity between the image features of any two initial synthesized images, and cluster any two initial synthesized images with a similarity greater than a similarity threshold to obtain at least one synthesized image cluster; each synthesized image cluster corresponds to a different category. The similarity calculation method here can refer to the aforementioned face similarity calculation method, and will not be described in detail here. By combining the similarity between any two initial synthesized images to determine whether any two initial synthesized images belong to the same category, the accuracy of category classification can be improved.
[0159] Optionally, the category of each initial synthesized image can be obtained when acquiring each initial synthesized image, thereby classifying the initial synthesized images into at least one category based on their respective categories. Directly obtaining the category of the initial synthesized images for category classification can improve the efficiency of category classification.
[0160] In this embodiment of the application, by determining the categories of multiple initial synthetic images, the initial synthetic images can be selected from the multiple categories to obtain an initial synthetic image set (i.e., a batch of initial synthetic images), making the categories of the images in the initial synthetic image set more dispersed. In this way, a batch of initial synthetic images can be input into the target face recognition model to learn more information about real face images of different categories.
[0161] S206, select initial composite images from at least one category of initial composite images to obtain an initial composite image set.
[0162] In this embodiment, the initial synthesized images in the initial synthesized image set correspond to different categories. Since the multiple initial synthesized images are divided into at least one category, one or more initial synthesized images can be selected from each of the at least one category to obtain the initial synthesized image set. Selecting one or more initial synthesized images from at least one category can mean selecting one or more initial synthesized images from each category, or selecting one initial synthesized image from a subset of the at least one category.
[0163] For example, if the number of categories in the initial synthesized image set is less than the number of initial synthesized image sets required, multiple initial synthesized images can be selected from one or more categories to form the initial synthesized image set. Alternatively, if the number of categories in the initial synthesized image set is equal to the number of initial synthesized image sets required, one initial synthesized image can be selected from each category. Or, if the number of categories in the initial synthesized image set is greater than the number of initial synthesized image sets required, one initial synthesized image can be selected from a subset of categories. The number of initial synthesized image sets required can be determined based on the upper limit of the number of images input to the target face recognition model each time. For example, the number of initial synthesized image sets required can be equal to or less than the upper limit of the number of images input to the target face recognition model each time. Since the target face recognition model has an upper limit on the number of images input each time, inputting initial synthesized images less than or equal to the upper limit into the target face recognition model for processing each time ensures the stability of the model's processing.
[0164] In this embodiment of the application, an initial synthetic image set is selected from multiple categories of initial synthetic images. Therefore, the initial synthetic image set can include images of various different categories, which makes the categories in the initial synthetic image set as dispersed as possible, thereby enabling the initial synthetic image set to learn information from more categories of real face images.
[0165] Furthermore, by using the aforementioned method of clustering the face dataset, the clustering results can be combined to classify multiple initial synthetic images into categories, resulting in at least one category of initial synthetic images. This allows for the selection of as many initial synthetic images as possible from at least one category to form an initial synthetic image set, ensuring that the categories of the initial synthetic images in each initial synthetic image set input to the target face recognition model are dispersed, thereby improving the accuracy and effectiveness of initial synthetic image updates.
[0166] S207, Obtain the image features of the initial synthesized image set, and determine the initial statistical features of the image features of the initial synthesized image set.
[0167] In this embodiment of the application, the computer device can determine the initial statistical features of the image features of the initial synthetic image set in the following way: inputting the images in the initial synthetic image set as a batch of images into the target face recognition model to obtain the image features extracted by the target face recognition model; determining the initial statistical features of the image features of the initial synthetic image set based on the image features extracted by the target face recognition model; the first deviation feature of the initial synthetic image set is determined based on the initial statistical features and target statistical features of the image features of a batch of images.
[0168] Specifically, determining the initial statistical features of the image features of the initial synthetic image set based on the image features extracted by the target face recognition model can refer to: calculating the initial statistical features of the image features of a batch of images based on the image features extracted by the target face recognition model, and determining the initial statistical features of the image features of this batch of images as the initial statistical features of the image features of the initial synthetic image set. Here, a batch of images refers to a batch of initial synthetic images, i.e., an initial synthetic image set. In other words, when determining the initial statistical features of the image features of the initial synthetic image set, the images in the initial synthetic image set are input into the target face recognition model as a batch of images. The target face recognition model extracts the image features of this batch of images (i.e., the image features extracted by the target face recognition model) from the initial synthetic image set (i.e., a batch of images) as a whole. Here, the image features extracted by the target face recognition model can refer to the image features of all images in a batch. Furthermore, the target face recognition model can calculate at least one of the initial statistical features of the image features of this batch of images, such as the initial mean and the initial variance. This initial statistical feature of the image features of this batch of images is then determined as the initial statistical feature of the image features of the initial synthesized image set. Based on the target statistical features and the initial statistical features of the image features of this batch of images, the first deviation feature of this batch of images is calculated, serving as the first deviation feature of the initial synthesized image set. This is done instead of further batching the initial synthesized image set to obtain multiple batches of images, calculating the initial statistical features for each batch, and then calculating the first deviation feature for each batch. In other words, the first deviation feature of the initial synthesized image set refers to the first deviation feature of a single batch of initial synthesized images.
[0169] Understandably, if there are multiple initial synthetic images for at least one category, initial synthetic images can be selected from at least one category each time to obtain an initial synthetic image set. This results in multiple initial synthetic image sets, each containing different images and encompassing multiple categories. An initial synthetic image set refers to a batch of images, which can be input into the target face recognition model in batches for processing. That is, one batch of images is input into the target face recognition model each time for processing, obtaining the initial statistical features of each batch of initial synthetic images. Then, combined with the target statistical features, the first deviation feature of each batch of initial synthetic images is calculated. Each batch corresponds to a first deviation feature, and the first deviation feature of the initial synthetic image set refers to the first deviation feature of the initial synthetic images in one batch. If there are multiple batches of images, the first deviation feature of the initial synthetic image set refers to the first deviation feature of each batch of initial synthetic images. Since each batch of images (i.e., the initial synthetic image set) is selected from initial synthetic images of at least one category, it can be guaranteed that the categories of the images in each batch are dispersed, thus ensuring that the categories of the images input into the target face recognition model in batches are evenly distributed, thereby guaranteeing the accuracy and effectiveness of updating the initial synthetic image set.
[0170] In this embodiment, if the target face recognition model includes multiple network layers, and each network layer processes different image features in each initial synthesized image in the initial synthesized image set, then the initial statistical features output by each network layer for each initial synthesized image are different. Specifically, the initial mean output by each network layer for each initial synthesized image is different, or the initial variance output by each network layer for each initial synthesized image is different, or both the initial mean and initial variance output by each network layer for each initial synthesized image are different. Therefore, when calculating the initial statistical features of the image features in the initial synthesized image set, the initial statistical features of the image features in the initial synthesized image set at each network layer can be calculated separately. Subsequently, the initial statistical features of the initial synthesized image set at each network layer and the target statistical features of the face data set at each network layer are combined to calculate the first deviation feature for the initial synthesized image set.
[0171] S208, using a target face recognition model, based on the initial statistical features and the image features of each real face image in the face dataset, the target statistical features are used to determine the first deviation feature for the initial synthetic image set.
[0172] In this embodiment of the application, if the target face recognition model includes a network layer, the initial statistical features and the target statistical features of the image features of each real face image in the face dataset can be obtained for the network layer. Based on the initial statistical features corresponding to the network layer and the target statistical features of the image features of each real face image in the face dataset, the first deviation feature of the network layer for the initial synthesized image set is determined, and the first deviation feature of the network layer for the initial synthesized image set is determined as the first deviation feature for the initial synthesized image set.
[0173] If the target face recognition model includes multiple network layers, with each layer corresponding to a first bias feature (meaning each layer has a first bias feature for the initial synthesized image set), then for each network layer, initial statistical features for the initial synthesized image set and target statistical features of image features from each real face image in the face dataset can be obtained. Based on these initial statistical features and target statistical features of image features from each real face image in the face dataset, the first bias feature of each network layer for the initial synthesized image set can be determined. Since the initial statistical features and target statistical features of image features from each real face image in the face dataset differ for each network layer, the first bias feature corresponding to each network layer is different; that is, the first bias feature of each network layer for the initial synthesized image set is different.
[0174] Since the initial synthesized image set is input into the target face recognition model as a batch of images, the first bias feature of the initial synthesized image set is determined by using the initial statistical features and target statistical features of the image features of a batch of images from at least one network layer in the target face recognition model. Each network layer calculates the first bias feature for each batch of images, and multiple network layers calculate multiple first bias features for a batch of images; that is, one network layer corresponds to one first bias feature for one batch of images. If there are multiple initial synthesized image sets, each initial synthesized image set can be input into the target face recognition model as a batch of images, i.e., input into the target face recognition model in batches to obtain the first bias feature for each batch of images.
[0175] Optionally, if the initial statistical features of the image features in the initial synthesized image set include the initial mean and initial variance of the image features in the initial synthesized image set, then the target statistical features of the image features of each real face image in the face dataset include the target mean and target variance of the image features of each real face image in the face dataset. In this case, the first bias feature of the initial synthesized image set is obtained based on the mean bias feature and the variance bias feature of each network layer for the initial synthesized image set. The mean bias feature of each network layer for the initial synthesized image set is obtained based on the initial mean and target mean of the image features of each network layer for the initial synthesized image set. For example, it can be obtained by summing the differences between the initial mean and target mean of the image features of each network layer for the initial synthesized image set. The variance bias feature of each network layer for the initial synthesized image set is obtained based on the initial variance and target variance of the image features of each network layer for the initial synthesized image set. For example, it can be obtained by summing the differences between the initial variance and target variance of the image features of each network layer for the initial synthesized image set.
[0176] In this embodiment, if the target face recognition model includes multiple network layers, each with a different function, and each layer processes different image features in the input face image, the target mean and target variance of the image features for the face dataset will differ for each layer. Therefore, when obtaining the initial synthesized image set, each network layer in the target face recognition model can calculate the initial mean and initial variance for the initial synthesized image set. Based on the target mean and initial mean of the image features for the face dataset for each network layer, the difference between the initial synthesized image set and the face dataset can be calculated. Furthermore, by combining the target variance and initial variance of the image features for the face dataset for each network layer, the difference between the initial synthesized image set and the face dataset can be calculated. Finally, the initial synthesized image set can be updated based on the difference between the initial synthesized image set and the face dataset for each network layer, resulting in the target synthesized image set and improving the accuracy of image updates.
[0177] Optionally, taking the iResNet (Improved Residual Network) series of networks as an example, the backbone of the target face recognition model is iResNet-18. This model includes multiple network layers such as BN layers. When a batch of initial synthesized images (i.e., the initial synthesized image set) passes through the backbone, the method for determining the first bias feature for the initial synthesized image set based on the initial mean of the multiple network layers for the initial synthesized image set and the target mean of the multiple network layers for the face data set, as well as the initial variance of the multiple network layers for the initial synthesized image set and the target variance of the multiple network layers for the face data set, can refer to the following formula (1-4):
[0178]
[0179] Among them, Loss BN It can refer to the first bias feature for the initial set of synthesized images (i.e., the initial synthesized images of the current batch), L refers to the number of network layers in the target face recognition model, and μ l This represents the initial mean of the initial synthesized image set in the l-th BN layer. This represents the initial variance of the initial synthesized image set in the l-th BN layer. This represents the target running mean of each BN layer in the target face recognition model trained on the face dataset. This represents the running variance of each BN layer in the target face recognition model trained on the face dataset.
[0180] In this embodiment, the true mean and variance of the input face data set are statistically analyzed during the training of the initial face recognition model to obtain the target face recognition model. When the target face recognition model is trained, the mean and variance of each network layer (i.e., BN layer) in the target face recognition model are fixed. Therefore, when the initial synthetic image set is processed by the target face recognition model, the mean and variance of each network layer for the initial synthetic image set can be directly obtained. Then, the first deviation feature is calculated by combining the mean and variance of each network layer (i.e., BN layer) in the target face recognition model with the mean and variance of the initial synthetic image set. The initial synthetic image set is then updated with the first deviation feature to obtain the target synthetic image set.
[0181] S209, using a target face recognition model, based on the image features of the initial synthesized images of each category in the initial synthesized image set, and the image features of real face images of the same category as the initial synthesized images of each category, to determine the second deviation features of the initial synthesized image set.
[0182] In this embodiment of the application, the specific method for determining the second deviation feature of the initial synthetic image set in step S209 can refer to the specific implementation of step S103 mentioned above, and will not be repeated here.
[0183] S210, the target face recognition model is used to update the initial synthetic image set based on the first deviation feature and the second deviation feature to obtain the target synthetic image set.
[0184] In this embodiment, since a first deviation feature and a second deviation feature for the initial synthesized image set are obtained respectively, the initial synthesized image set can be updated by combining the first and second deviation features to obtain a target synthesized image set. Updating the initial synthesized image set can refer to updating the pixel value of each pixel in the initial synthesized image set, making the target synthesized images in the updated target synthesized image set more similar to the features of the entire face dataset. Therefore, the target synthesized image set can be used to replace the face dataset, reducing the amount of training data for the model. Subsequently, the target synthesized image set can be used to train any model, improving model training efficiency.
[0185] In one embodiment, if at least one network layer refers to a single network layer, the pixels in each initial synthesized image in the initial synthesized image set can be updated based on the second bias feature and the first bias feature of the network layer for the initial synthesized image set to obtain the target synthesized image set. The first bias feature of the network layer for the initial synthesized image set is determined based on the initial statistical features of the network layer for the initial synthesized image set and the target statistical features of the network layer for the image features of each real face image in the face dataset.
[0186] In this embodiment, the target face recognition model includes a network layer. When calculating the first deviation feature for the initial synthesized image set, this network layer extracts image features corresponding to pixels in each initial synthesized image in the initial synthesized image set. Based on the extracted image features, it calculates the initial statistical features of the image features of the initial synthesized image set. The first deviation feature is then obtained based on the difference between the initial statistical features and the target statistical features of the face data set. Therefore, when updating the pixel values of the pixels corresponding to the image features of each initial synthesized image in the initial synthesized image set based on the first and second deviation features, it means updating the pixel values of the pixels from which the image features are extracted in each initial synthesized image. This makes the images in the target synthesized image set composed of the updated pixel values more similar to the pixel values in the real images in the real face image set, thereby enabling the target synthesized image to learn the image information from the face data set.
[0187] In another embodiment, if at least one network layer refers to multiple network layers, and each network layer corresponds to a first deviation feature, then when updating the initial synthesized image set based on the first deviation feature and the second deviation feature to obtain the target synthesized image set, the initial synthesized image set can be updated based on the first deviation feature and the second deviation feature of each network layer to obtain the target synthesized image set. The first deviation feature of each network layer for the initial synthesized image set is determined based on the initial statistical features of each network layer for the initial synthesized image set, and the target statistical features of each network layer for the image features of each real face image in the face dataset.
[0188] For example, a computer device can determine the first deviation feature of each network layer for the initial synthesized image set based on the initial statistical features of each network layer for the initial synthesized image set, and the target statistical features of each network layer for the image features of each real face image in the face dataset. Based on the second deviation feature and the first deviation features of each network layer for the initial synthesized image set, the pixel values of each pixel in the initial synthesized image set are updated to obtain the target synthesized image set.
[0189] Updating the pixel values of pixels in each initial synthesized image within the initial synthesized image set can be achieved by updating the pixel values of the pixels corresponding to the image features of each initial synthesized image passed through each network layer. The pixels corresponding to the image features can be those associated with the image features, which are the image features extracted from the pixels in the initial synthesized images. Since the image features extracted from different pixels in the initial synthesized images can be different, the update is performed on the pixel values of the pixels whose image features were extracted from each initial synthesized image. Because the image features input to each network layer in each initial synthesized image may differ, the pixels corresponding to the image features passed through each network layer in each initial synthesized image may also differ. By updating the pixel values of the pixels corresponding to the image features passed through each network layer based on the second bias feature and the first bias feature of each network layer for the initial synthesized image set, the updated target synthesized image can be made closer to the face dataset, thereby improving the accuracy of data distillation.
[0190] In one embodiment, if the initial statistical features include an initial mean, then the first deviation feature is the mean deviation feature for the initial synthesized image set. Then, based on the mean deviation feature and the second deviation feature for the initial synthesized image set of each network layer, the pixel values of each pixel in the initial synthesized image set can be updated to obtain the target synthesized image set.
[0191] In this embodiment, by updating the initial synthesized image set using the difference between the initial mean of the initial synthesized image set and the target mean of the face data set, the updated target synthesized image set can be made more similar to the face data set in terms of overall information across categories, thereby improving the data distillation effect.
[0192] In one embodiment, if the initial statistical features include the initial variance, then the first bias feature is the variance bias feature for the initial synthesized image set. Then, based on the variance bias feature and the second bias feature for the initial synthesized image set of each network layer, the pixel values of each pixel in the initial synthesized image set can be updated to obtain the target synthesized image set.
[0193] In this embodiment, by updating the initial synthesized image set using the difference between the initial variance of the initial synthesized image set and the target variance of the face data set, the updated target synthesized image set can be made more similar to the face data set in terms of overall information across categories, thereby improving the data distillation effect.
[0194] In one embodiment, if the initial statistical features include an initial mean and an initial variance, and the first deviation feature of the initial synthesized image set is obtained based on the mean deviation feature and the variance deviation feature of each network layer for the initial synthesized image set, then the computer device can update the pixel values of each pixel in the initial synthesized image set based on the second deviation feature, as well as the mean deviation feature and variance deviation feature of each network layer for the initial synthesized image set, to obtain the target synthesized image set.
[0195] In this embodiment, updating the initial synthesized image set by using the difference between the initial mean of the initial synthesized image set and the target mean of the face data set, and updating the initial synthesized image set by using the difference between the initial variance of the initial synthesized image set and the target variance of the face data set, can further make the updated target synthesized image set more similar to the face data set in terms of overall information across categories, thereby improving the data distillation effect.
[0196] In a specific implementation, the computer device can describe the process of updating the initial synthesized image set based on the second bias feature and the first bias feature of the initial synthesized image set by multiple network layers to obtain the target synthesized image set:
[0197] Based on the second deviation feature and the first deviation feature of the z-th network layer in the multiple network layers for the initial synthesized image set, the pixel values of the pixels corresponding to the image features of the z-th network layer in the image features of each initial synthesized image are updated to obtain each first intermediate image corresponding to the z-th network layer; one initial synthesized image corresponds to one first intermediate image, and z is a positive integer greater than or equal to 2; based on the second deviation feature and the first deviation feature of the (z-1)-th network layer in the multiple network layers for the initial synthesized image set, the pixel values of the pixels corresponding to the image features of the (z-1)-th network layer in the image features of each first intermediate image are updated to obtain each second intermediate image corresponding to the (z-1)-th network layer; one first intermediate image corresponds to one second intermediate image; if the (z-1)-th network layer is the target network layer in the multiple network layers, then each second intermediate image is added to the target synthesized image set.
[0198] The first deviation feature of each network layer for the initial synthesized image set can be calculated based on the target statistical features of the face data set fixed by each network layer and the initial statistical features of each network layer for the initial synthesized images. For example, when the initial statistical features of the initial synthesized images are the initial mean of the initial synthesized images, the first deviation feature of each network layer for the initial synthesized image set can refer to the mean deviation feature of each network layer for the initial synthesized image set. For example, when the initial statistical features of the initial synthesized images are the initial variance of the initial synthesized images, the first deviation feature of each network layer for the initial synthesized image set can refer to the variance deviation feature of each network layer for the initial synthesized image set. For example, when the initial statistical features of the initial synthesized images include the initial mean and the initial variance of the initial synthesized images, the first deviation feature of each network layer for the initial synthesized image set can refer to the sum of the mean deviation feature and the variance deviation feature of each network layer for the initial synthesized image set.
[0199] Because the target statistical features of the face data set fixed by each network layer are different, the initial statistical features calculated by each network layer for the initial synthesized image set are different, and consequently, the first bias feature of each network layer for the initial synthesized image set is different. One initial synthesized image set corresponds to one second bias feature, meaning the second bias features corresponding to multiple network layers are all equal. The z-th network layer can refer to the last network layer among multiple network layers, i.e., the output network layer of the target face recognition model, which is used to output the model's recognition result. The (z-1)-th network layer can refer to the network layer preceding the z-th network layer, such as the network layer preceding the output network layer of the target face recognition model. The target network layer can refer to the first network layer among multiple network layers, i.e., the input network layer of the target face recognition model, which is used to receive the image input to the target face recognition model.
[0200] In this embodiment, when the target face recognition model processes the initial synthesized image, it processes the image features of the initial synthesized image sequentially, starting from the input network layer. The processing result of the image features by the previous network layer is input to the next network layer for processing. Therefore, the processing result of the image features by the previous network layer will affect the processing result of the image features by the next network layer. That is, the image feature result of the next network layer inputting to the initial network layer for the initial synthesized image will be affected by the processing result of the input network layer. Therefore, when updating the initial synthesized image set based on the first and second deviation features of each network layer for the initial synthesized image set, the pixel values of the pixels corresponding to the image features passed through each network layer are updated layer by layer from back to front, thereby improving the accuracy of the pixel value update of the pixels in the initial synthesized image. When updating to the first network layer, that is, the first network layer of the target face recognition model, that is, the input network layer of the target face recognition model, the intermediate image corresponding to the first network layer can be determined as the target synthesized image. By updating the pixels of each initial synthesized image in the initial synthesized image set in the above manner, the target synthesized image corresponding to each initial synthesized image can be obtained, and thus the target synthesized image set can be obtained.
[0201] For example, consider a network with three layers: the first, second, and third. The first layer is the last layer in the composite image; the second layer is the layer preceding the first (intermediate layer); and the third layer is the first layer preceding the second. The first layer processes the image features corresponding to the first type of pixels in the initial composite image. The second layer processes the image features corresponding to the second type of pixels in the initial composite image. The third layer processes the image features corresponding to the third type of pixels in the initial composite image. All three types of pixels are pixels in the initial composite image. It's understood that if each layer processes the image features extracted from the same pixel in the initial composite image, then the first, second, and third types of pixels will be identical. If each network layer processes the image features extracted from different pixels in the initial synthesized image, then the first type of pixels, the second type of pixels, and the third type of pixels will be different.
[0202] Specifically, based on the second deviation feature and the first deviation feature of the first network layer for the initial synthesized image set, the pixel values of the pixels corresponding to the image features input to the first network layer in the image features of the initial synthesized image (i.e., the first pixels) are updated to obtain the first intermediate image corresponding to the first network layer; based on the second deviation feature and the first deviation feature of the second network layer for the image features of the initial synthesized image, the pixel values of the pixels corresponding to the image features input to the second network layer in the image features of the first intermediate image (i.e., the second pixels) are updated to obtain the second intermediate image corresponding to the second network layer; based on the second deviation feature and the first deviation feature of the third network layer for the initial synthesized image, the pixel values of the pixels corresponding to the image features input to the third network layer in the image features of the second intermediate image (i.e., the third pixels) are updated to obtain the third intermediate image corresponding to the third network layer, and the third intermediate image is added to the target synthesized image set.
[0203] In one alternative implementation, the computer device may use a target face recognition model to update the pixel values of each pixel in the initial synthetic image in the initial synthetic image set based on a first deviation feature, thereby obtaining the target synthetic image set.
[0204] In this embodiment, updating the initial synthesized image set using the first deviation feature is equivalent to updating the initial synthesized image set using the difference between the initial synthesized image set and the entire face data set. This allows the updated target synthesized image set to learn the overall information of the entire face data set, enabling the initial synthesized image set to mimic the overall information of the entire face data set, thereby achieving data distillation.
[0205] In another alternative implementation, the computer device may also use a target face recognition model to update the pixel values of each pixel in the initial synthetic image in the initial synthetic image set based on the second deviation feature, thereby obtaining the target synthetic image set.
[0206] In this embodiment, updating the initial synthetic image set using the second deviation feature is equivalent to updating the initial synthetic image set with the difference between the corresponding categories in the initial synthetic image set and the face data set. This allows the updated target synthetic image set to learn the internal information of each category in the face data set, enabling the initial synthetic image set to mimic the internal information of the corresponding category in the face data set, thereby achieving data distillation.
[0207] In this embodiment of the application, the specific implementation methods not mentioned in steps S201 to S210 can be referred to the implementation methods in steps S101 to S104 above, and will not be repeated here.
[0208] In this embodiment, an initial face recognition model is trained using a face dataset to obtain a target face recognition model. This allows for further clustering of the face dataset, classifying multiple initial synthetic images based on the clustering results. This ensures that the initial synthetic images in the subsequent input set to the target face recognition model (each batch of initial synthetic images) are distributed as dispersedly as possible, thereby better fitting the category distribution of the entire face dataset. By calculating a first bias feature (BN loss) and a second bias feature (M3D loss) for each initial synthetic image set, each initial synthetic image set can be updated based on these two bias features to obtain the target synthetic image set.
[0209] To demonstrate that the distilled data obtained in this application's embodiments, i.e., the target synthetic dataset, can effectively train the model, the same model was used on the CASIA dataset. Data obtained through data distillation using this application's embodiments and other general data distillation methods was also used for training, and the accuracy of the trained model was compared. For example, extensive testing was conducted on three datasets: AgeDB30 (a cross-age face recognition dataset), CFP-FP (Celebrities in Frontal-Profile in the Wild, a face detection dataset), and LFW (Labled Faces in the Wild, a face recognition dataset). The test results are shown in Table 1.
[0210] Table 1
[0211] Method LFW CFP_FP AGEDB30 Mean accuracy CASIA dataset 85.62 62.80 66.43 71.62 Data distillation method 1 67.57 59.14 52.32 59.68 Data distillation method 2 65.48 59.26 50.18 58.31 The present application 78.43 62.23 60.65 67.10
[0212] As shown in Table 1, after directly training the model using the CASIA dataset, the recognition accuracies of the trained model on the three face datasets (LFW, CFP-FP, and AgeDB30) are 85.62, 62.80, and 66.43, respectively, with an average recognition accuracy of 71.62. However, after using the academic SOTA (i.e., superior data distillation methods such as data distillation method 1 and data distillation method 2) to distill the CASIA dataset, the recognition accuracies of the two models trained on the LFW, CFP-FP, and AgeDB30 face datasets are significantly lower than those of the model trained using the data distillation method described in this embodiment of the application. Furthermore, the data distillation method described in this embodiment of the application significantly narrows the performance gap between the distilled data and the real data in the face datasets. Optionally, the model used in the experiment in Table 1 can be the iResnet-18 model. The number of target synthetic images for each category in the target synthetic image set obtained after data distillation can be controlled to 4, so that the distillation data for each category can be guaranteed while reducing the amount of distilled data. The image size of the target synthetic image can be selected as 112*112 or other sizes.
[0213] Furthermore, compared to the complete set of face data, the target synthetic image set obtained by the data distillation method in this application reduces the storage space occupied by the target synthetic image set by 90%, and the training cost of the subsequent model on the target synthetic image set is also reduced by 90%, which has great research and application value.
[0214] The embodiments in this application are primarily designed for conventional models such as the ResNet series. Therefore, the effectiveness is limited by the capabilities of the model itself; that is, the model needs to have Batch Normalization (BN) layers to perform data distillation using the data distillation method described in this application. If the model is extended to more complex and larger series such as Transformer (a neural network architecture model based on self-attention mechanism) and Diffusion (a diffusion model), it can be optimized and improved by combining the specific structure of the model. For example, corresponding processing can be performed on other network layers in the model to achieve similar effects, thereby utilizing more information and stronger model generation capabilities to improve the distillation effect.
[0215] In this embodiment, image features of an initial synthesized image set are obtained, and initial statistical features of these features are determined. Each initial synthesized image in the initial synthesized image set corresponds to a category. Based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset, a first deviation feature is determined for the initial synthesized image set. Based on the image features of each category of the initial synthesized image in the initial synthesized image set, and the image features of real face images belonging to the same category as the initial synthesized images of each category, a second deviation feature is determined for the initial synthesized image set. The initial synthesized image set is updated based on the first and second deviation features to obtain a target synthesized image set. Since the first deviation feature reflects the difference in overall information between the initial synthesized image set and all categories of real face images in the face dataset, updating the initial synthesized image set using the first deviation feature can achieve overall information imitation of the face dataset by the initial synthesized image set. Since the second deviation feature reflects the difference in internal information between initial synthesized images of the same category and each category of real face images, updating the initial synthesized image set using the second deviation feature can guide the initial synthesized images to imitate information of real face images of the same category. Therefore, the initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, as well as the facial features of real face images of each category. This means that a small initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, which can improve the effect of data distillation on the face dataset.
[0216] The methods of the embodiments of this application have been described above, and the apparatus of the embodiments of this application will be described below.
[0217] See Figure 5 , Figure 5 This is a schematic diagram of the structural composition of a face image processing device provided in an embodiment of this application. The face image processing device can be applied to computer equipment; it can be used to execute corresponding steps in the face image processing method provided in this embodiment. The face image processing device 50 includes:
[0218] The feature acquisition unit 501 is used to acquire image features of the initial synthesized image set and determine the initial statistical features of the image features of the initial synthesized image set; each initial synthesized image in the initial synthesized image set corresponds to a category;
[0219] The first deviation determination unit 502 is used to determine the first deviation feature for the initial synthetic image set based on the target statistical features of the image features of each real face image in the face data set and the initial statistical features.
[0220] The second deviation determination unit 503 is used to determine the second deviation features of the initial synthesized image set based on the image features of the initial synthesized image of each category in the initial synthesized image set, and the image features of the real face image of the same category as the initial synthesized image of each category.
[0221] The image update unit 504 is used to update the initial synthetic image set based on the first deviation feature and the second deviation feature to obtain the target synthetic image set.
[0222] Optionally, the initial statistical features of the image features of the initial synthesized image set include the initial mean and initial variance of the image features of the initial synthesized image set, and the target statistical features include the target mean and target variance of the image features of each real face image in the face dataset; the first deviation determination unit 502 is specifically used for:
[0223] Based on the initial mean of the image features of the initial synthesized image set and the target mean of the image features of each real face image in the face dataset, the mean deviation feature of the initial synthesized image set is determined.
[0224] Based on the initial variance of the image features of the initial synthesized image set and the target variance of the image features of each real face image in the face dataset, the variance bias characteristics of the initial synthesized image set are determined.
[0225] Based on the mean deviation feature and the variance deviation feature of the initial synthesized image set, a first deviation feature is determined for the initial synthesized image set.
[0226] Optionally, the second deviation determining unit 503 is specifically used for:
[0227] Obtain the first feature mean of the image features of the initial synthesized image for each category;
[0228] Obtain the mean of the second features of image features from at least two real face images that belong to the same category as the initial synthetic image of each category;
[0229] The class bias feature of the initial synthetic image for each category is determined based on the mean of the first feature and the mean of the second feature;
[0230] The average value among the category bias features of the initial synthesized images of various categories in the initial synthesized image set is obtained, and this average value is determined as the second bias feature for the initial synthesized image set.
[0231] Optionally, the feature acquisition unit 501 is specifically used for:
[0232] The images in the initial synthetic image set are input as a batch into the target face recognition model to obtain the image features extracted by the target face recognition model;
[0233] The initial statistical features of the image features of the initial synthetic image set are determined based on the image features extracted by the target face recognition model; the first deviation feature of the initial synthetic image set is determined based on the initial statistical features of the image features of the batch of images and the target statistical features.
[0234] Optionally, the second bias feature of the initial synthesized image set is determined based on a target face recognition model, which includes at least one network layer. The first bias feature of the initial synthesized image set is determined using the initial statistical features and target statistical features of the image features of the batch of images obtained by the at least one network layer. Each network layer corresponds to one first bias feature. The first bias feature of each network layer for the initial synthesized image set is determined based on the initial statistical features of each network layer for the initial synthesized image set and the target statistical features of each network layer for the image features of each real face image in the face dataset. The image update unit 504 is specifically used for:
[0235] Based on the second deviation feature and the first deviation feature of each network layer in the at least one network layer for the initial synthesized image set, the pixels in each initial synthesized image in the initial synthesized image set are updated to obtain the target synthesized image set.
[0236] Optionally, the face image processing device 50 further includes: a model training unit 505, which is used for:
[0237] Obtain the initial face recognition model and the set of face data;
[0238] Obtain a set of real face images from the face dataset, and perform image recognition processing on the set of real face images based on the initial face recognition model to obtain the predicted face category of each real face image in the set of real face images;
[0239] Obtain the true face category of each true face image in the set of true face images. Based on the true face category and the predicted face category of each true face image in the set of true face images, train the initial face recognition model to obtain the target face recognition model.
[0240] Optionally, the model training unit 505 is specifically used for:
[0241] Based on the difference between the real face category and the predicted face category of each real face image, the initial model bias characteristics of the initial face recognition model for each real face image are determined.
[0242] Based on the initial model bias characteristics of each real face image in the set of real face images, the target model bias characteristics of the initial face recognition model for the set of real face images are determined.
[0243] When the deviation feature of the target model is less than the deviation threshold, the initial face recognition model is determined as the target face recognition model.
[0244] Optionally, the number of at least one network layer may be multiple; the image update unit 504 is specifically used for:
[0245] Based on the second deviation feature and the first deviation feature of the z-th network layer in the multiple network layers for the initial synthesized image set, the pixel values of the pixels corresponding to the image features of the z-th network layer in the image features of each initial synthesized image are updated to obtain each first intermediate image corresponding to the z-th network layer; one initial synthesized image corresponds to one first intermediate image, and z is a positive integer greater than or equal to 2;
[0246] Based on the second deviation feature, and the first deviation feature of the (z-1)th network layer in the multiple network layers for the initial synthesized image set, the pixel values of the pixels corresponding to the image features of the (z-1)th network layer in the image features of each first intermediate image are updated to obtain each second intermediate image corresponding to the (z-1)th network layer; one first intermediate image corresponds to one second intermediate image;
[0247] If the (z-1)th network layer is the target network layer among the multiple network layers, then each of the second intermediate images is added to the target synthesized image set.
[0248] Optionally, the face image processing device 50 further includes: a category segmentation unit 506, which is used for:
[0249] Obtain the mean feature values of real face images from at least two categories in the face dataset for each category;
[0250] Based on the mean features of at least two categories of real face images, determine the face similarity between the at least two categories of real face images;
[0251] Clustering is performed on real face images of any two categories where the face similarity is greater than the target similarity to obtain at least two face clusters; real face images in the same face cluster correspond to the same category;
[0252] Based on the categories corresponding to the at least two face clusters, the initial synthetic images are classified into categories to obtain an initial synthetic image of at least one category;
[0253] Initial composite images are selected from the initial composite images of at least one category to obtain the initial composite image set; the multiple initial composite images in the initial composite image set correspond to different categories.
[0254] Optionally, the feature acquisition unit 501 is further configured to:
[0255] Acquire multiple initial images;
[0256] Each of the multiple initial images is subjected to noise processing to obtain the multiple initial composite images; one initial image corresponds to one initial composite image, and each initial composite image has a category.
[0257] In this embodiment, image features of an initial synthesized image set are obtained, and initial statistical features of these features are determined. Each initial synthesized image in the initial synthesized image set corresponds to a category. Based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset, a first deviation feature is determined for the initial synthesized image set. Based on the image features of each category of the initial synthesized image in the initial synthesized image set, and the image features of real face images belonging to the same category as the initial synthesized images of each category, a second deviation feature is determined for the initial synthesized image set. The initial synthesized image set is updated based on the first and second deviation features to obtain a target synthesized image set. Since the first deviation feature reflects the difference in overall information between the initial synthesized image set and all categories of real face images in the face dataset, updating the initial synthesized image set using the first deviation feature can achieve overall information imitation of the face dataset by the initial synthesized image set. Since the second deviation feature reflects the difference in internal information between initial synthesized images of the same category and each category of real face images, updating the initial synthesized image set using the second deviation feature can guide the initial synthesized images to imitate information of real face images of the same category. Therefore, the initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, as well as the facial features of real face images of each category. This means that a small initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, which can improve the effect of data distillation on the face dataset.
[0258] See Figure 6 , Figure 6 This is a schematic diagram of the structural composition of a computer device provided in an embodiment of this application. For example... Figure 6 As shown, the computer device 60 described above may include a processor 601 and a memory 602. The processor 601 is connected to the memory 602, for example, the processor 601 can be connected to the memory 602 via a bus. Optionally, the computer device 60 may further include a network interface 603, wherein the network interface 603 is connected to the processor 601 and the memory 602, for example, the processor 601 can be connected to the memory 602 and the network interface 603 via a bus. The computer device may be a terminal device or a server.
[0259] The processor 601 is configured to support the face image processing apparatus in performing the corresponding functions of the face image processing method described above. The processor 601 may be a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0260] Memory 602 is used to store program code, etc. Memory 602 may include volatile memory (VM), such as random access memory (RAM); memory 602 may also include non-volatile memory (NVM), such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); memory 602 may also include combinations of the above types of memory.
[0261] Network interface 603 is used to provide network communication functions.
[0262] Processor 601 can call this program code to perform the following operations:
[0263] Obtain the image features of the initial synthesized image set and determine the initial statistical features of the image features of the initial synthesized image set; each initial synthesized image in the initial synthesized image set corresponds to a category;
[0264] Based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset, a first deviation feature is determined for the initial synthetic image set;
[0265] Based on the image features of the initial synthesized images of each category in the initial synthesized image set, and the image features of real face images of the same category as the initial synthesized images of each category, a second deviation feature of the initial synthesized image set is determined;
[0266] The initial synthetic image set is updated based on the first deviation feature and the second deviation feature to obtain the target synthetic image set.
[0267] It should be understood that the computer device 60 described in the embodiments of this application can perform the foregoing... Figure 3 and Figure 4 The description of the face image processing method in the corresponding embodiments can also be performed as described above. Figure 5 The description of the face image processing apparatus in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.
[0268] In this embodiment, image features of an initial synthesized image set are obtained, and initial statistical features of these features are determined. Each initial synthesized image in the initial synthesized image set corresponds to a category. Based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset, a first deviation feature is determined for the initial synthesized image set. Based on the image features of each category of the initial synthesized image in the initial synthesized image set, and the image features of real face images belonging to the same category as the initial synthesized images of each category, a second deviation feature is determined for the initial synthesized image set. The initial synthesized image set is updated based on the first and second deviation features to obtain a target synthesized image set. Since the first deviation feature reflects the difference in overall information between the initial synthesized image set and all categories of real face images in the face dataset, updating the initial synthesized image set using the first deviation feature can achieve overall information imitation of the face dataset by the initial synthesized image set. Since the second deviation feature reflects the difference in internal information between initial synthesized images of the same category and each category of real face images, updating the initial synthesized image set using the second deviation feature can guide the initial synthesized images to imitate information of real face images of the same category. Therefore, the initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, as well as the facial features of real face images of each category. This means that a small initial synthetic image set can learn the facial features of real face images of all categories in the face dataset, which can improve the effect of data distillation on the face dataset.
[0269] Optionally, when the program instructions are executed by the processor, other steps of the method in the above embodiments can also be implemented, which will not be described in detail here.
[0270] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program. When a processor executes this computer program, it can perform the facial image processing methods described in the various embodiments of this application; therefore, they will not be repeated here. Additionally, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer storage medium involved in this application, please refer to the description of the method embodiments of this application.
[0271] As an example, the aforementioned computer program can be deployed and executed on a single computer device, or deployed and executed on multiple computer devices located in one location, or executed on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can form a blockchain network.
[0272] The aforementioned computer-readable storage medium can be an internal storage unit of the computer device, such as a hard drive or memory. It can also be an external storage device, such as a plug-in hard drive, smart media card (SMC), secure digital card (SD) card, or flash card. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. This computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. It can also be used to temporarily store data that has been output or will be output.
[0273] This application provides a computer program product comprising a computer program / instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program / instructions from the computer-readable storage medium and executes the computer program / instructions, causing the computer device to perform the face image processing methods described in the embodiments of this application; therefore, these will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application.
[0274] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0275] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0276] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0277] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.
[0278] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0279] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A face image processing method, characterized in that, The method includes: Image features of an initial set of synthesized images are obtained, and initial statistical features of the image features of the initial set of synthesized images are determined; each initial synthesized image in the initial set of synthesized images corresponds to a category; Based on the initial statistical features and the target statistical features of the image features of each real face image in the face dataset, a first deviation feature is determined for the initial synthesized image set; Based on the image features of the initial synthesized images of each category in the initial synthesized image set, and the image features of real face images of the same category as the initial synthesized images of each category, a second deviation feature of the initial synthesized image set is determined; The initial synthetic image set is updated based on the first deviation feature and the second deviation feature to obtain the target synthetic image set.
2. The method according to claim 1, characterized in that, The initial statistical features of the image features of the initial synthesized image set include the initial mean and initial variance of the image features of the initial synthesized image set, and the target statistical features include the target mean and target variance of the image features of each real face image in the face dataset; The determination of a first deviation feature for the initial synthesized image set based on the target statistical features of the initial statistical features and the image features of each real face image in the face dataset includes: Based on the initial mean of the image features of the initial synthesized image set and the target mean of the image features of each real face image in the face dataset, the mean deviation feature of the initial synthesized image set is determined. Based on the initial variance of the image features of the initial synthesized image set and the target variance of the image features of each real face image in the face dataset, the variance bias characteristics of the initial synthesized image set are determined. Based on the mean deviation feature and the variance deviation feature of the initial synthesized image set, a first deviation feature is determined for the initial synthesized image set.
3. The method according to claim 1, characterized in that, The determination of the second deviation feature of the initial synthesized image set based on the image features of the initial synthesized image of each category in the initial synthesized image set, and the image features of real face images of the same category as the initial synthesized image of each category, includes: Obtain the first feature mean of the image features of the initial synthesized image for each category; Obtain the mean of the second features of image features from at least two real face images that belong to the same category as the initial synthetic image of each category; The class bias features of the initial synthesized image for each category are determined based on the mean of the first feature and the mean of the second feature; The average value among the category deviation features of the initial synthesized images of various categories in the initial synthesized image set is obtained, and the average value is determined as the second deviation feature for the initial synthesized image set.
4. The method according to claim 1, characterized in that, The step of acquiring image features of the initial synthesized image set and determining the initial statistical features of the image features of the initial synthesized image set includes: The images in the initial synthetic image set are input as a batch into the target face recognition model to obtain the image features extracted by the target face recognition model; The initial statistical features of the image features of the initial synthetic image set are determined based on the image features extracted by the target face recognition model. The first deviation feature of the initial synthetic image set is determined based on the initial statistical features of the image features of the batch of images and the target statistical features.
5. The method according to claim 4, characterized in that, The second bias feature of the initial synthesized image set is determined based on the target face recognition model, which includes at least one network layer. The first bias feature of the initial synthesized image set is determined by using the initial statistical features of the image features of the batch of images based on the at least one network layer and the target statistical features. One network layer corresponds to one first bias feature. The first bias feature of each network layer for the initial synthesized image set is determined based on the initial statistical features of each network layer for the initial synthesized image set and the target statistical features of each network layer for the image features of each real face image in the face dataset. The step of updating the initial synthesized image set based on the first deviation feature and the second deviation feature to obtain the target synthesized image set includes: Based on the second deviation feature and the first deviation feature of each network layer in the at least one network layer for the initial synthesized image set, the pixels in each initial synthesized image in the initial synthesized image set are updated to obtain the target synthesized image set.
6. The method according to claim 4, characterized in that, The method further includes: Obtain the initial face recognition model and the face data set; Obtain a set of real face images from the face dataset, perform image recognition processing on the set of real face images based on the initial face recognition model, and obtain the predicted face category of each real face image in the set of real face images; Obtain the true face category of each true face image in the set of true face images, and train the initial face recognition model based on the true face category of each true face image in the set of true face images and the predicted face category of each true face image in the set of true face images to obtain the target face recognition model.
7. The method according to claim 6, characterized in that, The process of training the initial face recognition model based on the real face category of each real face image in the set of real face images and the predicted face category of each real face image in the set of real face images to obtain the target face recognition model includes: Based on the difference between the real face category and the predicted face category of each real face image, the initial model bias characteristics of the initial face recognition model for each real face image are determined. Based on the initial model deviation features of each real face image in the set of real face images, the target model deviation features of the initial face recognition model for the set of real face images are determined. When the deviation feature of the target model is less than the deviation threshold, the initial face recognition model is determined as the target face recognition model.
8. The method according to claim 5, characterized in that, The number of the at least one network layer is multiple; The step of updating the pixels in each initial synthesized image in the initial synthesized image set based on the second deviation feature and the first deviation feature of each network layer in the at least one network layer for the initial synthesized image set to obtain the target synthesized image set includes: Based on the second deviation feature and the first deviation feature of the z-th network layer in the plurality of network layers for the initial synthesized image set, the pixel values of the pixels corresponding to the image features of the z-th network layer in the image features of each initial synthesized image are updated to obtain each first intermediate image corresponding to the z-th network layer; one initial synthesized image corresponds to one first intermediate image, and z is a positive integer greater than or equal to 2; Based on the second deviation feature and the first deviation feature of the (z-1)th network layer in the plurality of network layers for the initial synthesized image set, the pixel values of the pixels corresponding to the image features of the (z-1)th network layer in the image features of each first intermediate image are updated to obtain each second intermediate image corresponding to the (z-1)th network layer; one first intermediate image corresponds to one second intermediate image; If the (z-1)th network layer is the target network layer among the plurality of network layers, then each of the second intermediate images is added to the target synthesized image set.
9. The method according to claim 4, characterized in that, The method further includes: Obtain the mean feature value of real face images in at least two categories in the face dataset for each category; Based on the feature mean of the at least two categories of real face images, determine the face similarity between the at least two categories of real face images; Clustering is performed on real face images of any two categories whose face similarity is greater than the target similarity to obtain at least two face clusters; real face images in the same face cluster correspond to the same category; Based on the categories corresponding to the at least two face clusters, the initial synthesized images are classified into categories to obtain an initial synthesized image of at least one category; Initial composite images are selected from the initial composite images of at least one category to obtain the initial composite image set; the multiple initial composite images in the initial composite image set correspond to different categories.
10. The method according to claim 9, characterized in that, The method further includes: Acquire multiple initial images; Each of the plurality of initial images is subjected to noise processing to obtain the plurality of initial composite images; one initial image corresponds to one initial composite image, and each initial composite image has a category.
11. A face image processing device, characterized in that, The device includes: The feature acquisition unit is used to acquire image features of the initial synthesized image set and determine the initial statistical features of the image features of the initial synthesized image set; each initial synthesized image in the initial synthesized image set corresponds to a category; The first deviation determination unit is used to determine the first deviation feature for the initial synthesized image set based on the target statistical features of the image features of each real face image in the face data set and the initial statistical features. The second deviation determination unit is used to determine the second deviation feature of the initial synthesized image set based on the image features of the initial synthesized image of each category in the initial synthesized image set, and the image features of the real face image of the same category as the initial synthesized image of each category; An image update unit is used to update the initial synthetic image set based on the first deviation feature and the second deviation feature to obtain a target synthetic image set.
12. A computer device, characterized in that, The device includes a processor and a memory, wherein the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to invoke the computer program so that the computer program performs the method according to any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-10.
14. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-10.