Method and system for automatically generating high-quality annotation data by using generative adversarial network

By automatically generating high-quality labeled data by generating adversarial networks, the problem of time-consuming and costly acquisition of manual labeled data in traditional technology is solved, and efficient and low-cost labeled data generation is realized, which is suitable for high-precision application scenarios of complex data types.

CN119810557AActive Publication Date: 2025-04-11SHANDONG INSPUR SCI RES INST CO LTD

Patent Information

Application Number
CN202510013219.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-04-11
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

Traditional machine learning and deep learning models rely on a large amount of manual annotation data, especially in complex data types applications. The acquisition of annotation data is time-consuming and costly, especially in high-precision application scenarios such as medical imaging and autonomous driving.

Method used

Generative adversarial network (GAN) is used to automatically generate high-quality labeling data. By building generator and discriminator models, preliminary training is used for small-scale labeling data, alternating the generator and discriminator, and labeling optimization is performed according to the discriminator evaluation to generate labeling data close to manual labeling quality.

Benefits of technology

It greatly reduces the demand for manual data labeling, reduces data labeling costs, improves model training efficiency, is suitable for various application scenarios, and meets the needs of high-quality and large-scale data labeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810557A_ABST
    Figure CN119810557A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for automatically generating high-quality annotation data by using a generative adversarial network, and relates to the technical field of data annotation. Constructing a generative adversarial network; preliminarily training a generator and a discriminator of the generative adversarial network by using the small-scale annotation data; the generator and the discriminator are circularly and alternately trained, annotation optimization is carried out according to evaluation of annotation accuracy of generated data by the discriminator, and the generator and the discriminator gradually reach a balance state in the training process by continuously adjusting network parameters and optimizing a loss function; and marking the acquired data by using the trained generative adversarial network, and training a downstream machine learning model by using the marked data. According to the method, high-quality annotation data close to manual annotation quality can be generated, the requirement for manual annotation data is reduced, and the method is not limited to the fields with large-scale data annotation requirements such as automatic driving, medical image analysis and intelligent monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data annotation, and in particular to a method and system for automatically generating high-quality annotated data using a generative adversarial network. Background Art

[0002] Traditional machine learning and deep learning models rely on a large amount of manually annotated data for training, especially in applications with complex data types such as images, text, and audio. The process of obtaining annotated data is usually time-consuming and costly, especially in high-precision application scenarios such as medical imaging and autonomous driving. Therefore, it is crucial to reduce the demand for manually annotated data and develop technologies that can automatically generate high-quality annotated data.

[0003] Generative adversarial networks (GANs) train the generator and discriminator models to compete with each other, so that the generated virtual data gradually approaches the real data distribution. This technology has great potential in generating labeled data, which can greatly reduce manual labeling work, reduce data labeling costs, and improve model training efficiency. Summary of the invention

[0004] In response to the needs and shortcomings of current technological development, the present invention provides a method and system for automatically generating high-quality labeled data using a generative adversarial network, so as to output high-quality labeled data to train downstream machine learning models.

[0005] In a first aspect, the present invention provides a method for automatically generating high-quality annotated data using a generative adversarial network. The technical solution adopted to solve the above technical problems is as follows:

[0006] A method for automatically generating high-quality labeled data using a generative adversarial network comprises the following steps:

[0007] S1, perform data collection and enhancement;

[0008] S2. Build a generative adversarial network;

[0009] S3. Use small-scale annotated data to preliminarily train the generator and discriminator of the generative adversarial network, so that the generator can generate synthetic data with preliminary annotations, and the discriminator can distinguish the difference between the generated annotated data and the real annotated data;

[0010] S4, alternately train the generator and the discriminator in a cycle, and optimize the annotation according to the discriminator's evaluation of the accuracy of the generated data annotation. By continuously adjusting the network parameters and optimizing the loss function, the generator and the discriminator gradually reach a balanced state during the training process;

[0011] S5. Use the trained generative adversarial network to label the collected data, and use the labeled data to train downstream machine learning models.

[0012] Optionally, the step S2 involved specifically includes:

[0013] Build the generator, including: select the random number generator and initialize the seed, generate a random Gaussian noise vector as input, select the network architecture according to the nature of the generated data, design the output layer to match the data type, and add a module that can automatically generate annotation information;

[0014] Constructing a discriminator includes: taking real data and data generated by the generator as input, extracting spatial features according to different data selection algorithms, and outputting data authenticity and annotation accuracy at the output layer.

[0015] Optionally, the step S3 involved specifically includes:

[0016] S3.1. Select some training data for manual labeling, denoted as data set X = {(x 1 ,y 1 ),(x 1 ,y 2 ),...,(x n ,y n )}, where x i is the input data, y i It is real labeled data;

[0017] S3.2. Generator G is a neural network-based model. The unlabeled data x in the dataset X is used as the input of generator G. Generator G first outputs the generated annotations The generated annotations are then calculated using a predefined annotation loss function. and the true annotation y i The network then adjusts its own network parameters by minimizing the annotation loss, thereby gradually learning how to generate more accurate preliminary annotations.

[0018] S3.3, the discriminator D is a neural network based model that takes paired data (x, y) and As the input of the discriminator D, (x, y) represents the pair of input data and true annotation, Represents a pair of input data and the annotation generated by the generator; the discriminator D maximizes the probability of the true annotation and minimizes the probability of the generated annotation being judged as true through a pre-defined authenticity loss function, thereby outputting a loss function value D = (x, y), which represents the probability that the input annotation is a true annotation;

[0019] In the process of executing steps S3.2 and S3.3, the gradient descent method is used to optimize the labeling loss function of the generator and the authenticity loss function of the discriminator respectively; when optimizing the generator loss function, the labeling loss of the generator is taken as the target, the gradient of the generator network parameters is calculated, and then the parameters of the generator are updated according to the gradient descent strategy; when optimizing the discriminator loss function, the discriminator loss of the discriminator is taken as the target, the gradient of the discriminator network parameters is calculated, and then the parameters of the discriminator are adjusted according to the gradient descent strategy.

[0020] Further optionally, the predefined annotation loss function is expressed as follows:

[0021]

[0022] Where n represents the number of samples, y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotations;

[0023] The pre-defined authenticity loss function is expressed as follows:

[0024]

[0025] Where n represents the number of samples, i represents the i-th sample, and y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotation; logD(x i ,y i ) represents the true sample pair D(x i ,y i ) is the logarithm of the probability that the discriminator judges it to be true, (x i ,G(x i )) represents the generation of sample pairs, log(1-D(x i ,G(x i ))) represents the generation of sample pairs (x i ,G(x i )) is the logarithm of the probability that the discriminator judges it to be false;

[0026] Based on the labeling loss function and the authenticity loss function, the joint loss function is expressed as follows:

[0027] L joint =αL G +βL Greal ,

[0028] Among them, α and β are weight coefficients, both of which take values ​​between 0 and 1, including 0 and 1, and α+β=1.

[0029] Further optionally, the step S4 involved specifically includes:

[0030] S4.1. Training the discriminator: fix the generator parameters, use the real data and the labeled data generated by the generator to train the discriminator, calculate the output of the discriminator for the real data and the generated data, and calculate the loss value according to the authenticity loss function, and use the back propagation algorithm to update the discriminator parameters according to the calculated loss value;

[0031] S4.2. Training the generator: fix the discriminator parameters, the generator generates labeled data based on the input real data, sends the labeled data generated by the generator to the discriminator for calculation, obtains the output result of the discriminator, and calculates the loss value of the generator on these data according to the joint loss function, and uses the back propagation algorithm to update the parameters of the generator according to the loss value;

[0032] S4.3, annotation optimization: based on the discriminator's evaluation of the accuracy of the generated data annotation, adjust the generator annotation module parameters and the discriminator feedback parameters to make the annotation more accurate;

[0033] S4.4. Perform alternating training and repeat steps S4.1-S4.3 to achieve a balance between the generator and the discriminator.

[0034] In a second aspect, the present invention provides a system for automatically generating high-quality annotated data using a generative adversarial network. The technical solution adopted to solve the above technical problems is as follows:

[0035] A system for automatically generating high-quality labeled data using a generative adversarial network, comprising:

[0036] Collection enhancement module, used for data collection and enhancement;

[0037] Network building module, used to build generative adversarial networks;

[0038] A preliminary training module is used to preliminarily train the generator and discriminator of the generative adversarial network using small-scale annotated data, so that the generator can generate synthetic data with preliminary annotations and the discriminator can distinguish the difference between the generated annotated data and the real annotated data;

[0039] An alternating training module is used to cyclically alternately train the discriminator and the generator, and update the parameters of the discriminator and the generator using the back-propagation algorithm;

[0040] The annotation optimization module is used to optimize the annotation based on the discriminator's evaluation of the accuracy of the generated data annotation, continuously adjust the network parameters and optimize the loss function, so that the generator and the discriminator gradually reach a balanced state during the training process;

[0041] The model output module is used to annotate the collected data using the trained generative adversarial network. The annotated data is used to train the downstream machine learning model.

[0042] Optionally, the network construction modules involved specifically include:

[0043] The generator construction unit is used to construct the generator. The specific operations include: selecting a random number generator and initializing the seed, generating a random Gaussian noise vector as input, selecting a network architecture according to the nature of the generated data, designing an output layer that matches the data type, and adding a module that can automatically generate annotation information;

[0044] The discriminator construction unit is used to construct the discriminator. The specific operations include: taking the real data and the data generated by the generator as input, extracting spatial features according to different data selection algorithms, and the output layer outputs the data authenticity and annotation accuracy.

[0045] Optionally, the preliminary training module specifically performs the following operations to preliminarily train the generator and the discriminator:

[0046] Select part of the training data for manual annotation, denoted as data set X = {(x 1 ,y 1 ),(x 1 ,y 2 ),...,(x n ,y n )}, where x i is the input data, y i It is real labeled data;

[0047] Generator G is a neural network-based model. The unlabeled data x in the dataset X is used as the input of generator G. Generator G first outputs the generated annotations. The generated annotations are then calculated using a predefined annotation loss function. and the true annotation y i The network then adjusts its own network parameters by minimizing the annotation loss, thereby gradually learning how to generate more accurate preliminary annotations.

[0048] The discriminator D is a neural network-based model that uses paired data (x, y) and As the input of the discriminator D, (x, y) represents the pair of input data and true annotation, Represents a pair of input data and the annotation generated by the generator; the discriminator D maximizes the probability of the true annotation and minimizes the probability of the generated annotation being judged as true through a pre-defined authenticity loss function, thereby outputting a loss function value D = (x, y), which represents the probability that the input annotation is a true annotation;

[0049] During the initial training process, the gradient descent method is used to optimize the labeling loss function of the generator and the authenticity loss function of the discriminator respectively;

[0050] When optimizing the generator loss function, the generator's annotation loss is used as the target, the gradient of the generator network parameters is calculated, and then the generator parameters are updated according to the gradient descent strategy;

[0051] When optimizing the discriminator loss function, the discriminator loss is taken as the target, the gradient of the discriminator network parameters is calculated, and then the parameters of the discriminator are adjusted according to the gradient descent strategy.

[0052] Further optionally, the predefined annotation loss function is expressed as follows:

[0053]

[0054] Where n represents the number of samples, y i represents the true annotation, G(x i ) indicates that the generator G is based on the input data x i Generated annotations;

[0055] The pre-defined authenticity loss function is expressed as follows:

[0056]

[0057] Where n represents the number of samples, i represents the i-th sample, and y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotation; logD(x i ,y i ) represents the true sample pair D(x i ,y i ) is the logarithm of the probability that the discriminator judges it to be true, (x i ,G(x i )) represents the generation of sample pairs, log(1-D(x i ,G(x i ))) represents the generation of sample pairs (x i ,G(x i )) is the logarithm of the probability that the discriminator judges it to be false;

[0058] Based on the labeling loss function and the authenticity loss function, the joint loss function is expressed as follows:

[0059] L joint =αL G +βL Greal ,

[0060] Among them, α and β are weight coefficients, both of which take values ​​between 0 and 1, including 0 and 1, and α+β=1.

[0061] Optionally, when the alternating training module trains the discriminator, the generator parameters are fixed, the discriminator is trained using the real data and the labeled data generated by the generator, the output of the discriminator for the real data and the generated data is calculated, and the loss value is calculated according to the authenticity loss function, and the back propagation algorithm is used to update the parameters of the discriminator according to the calculated loss value;

[0062] When the alternating training module trains the generator, the discriminator parameters are fixed, the generator generates labeled data based on the input real data, the labeled data generated by the generator is sent to the discriminator for calculation, the output result of the discriminator is obtained, and the loss value of the generator on these data is calculated according to the joint loss function, and the back propagation algorithm is used to update the parameters of the generator according to the loss value.

[0063] The method and system of the present invention for automatically generating high-quality annotated data using a generative adversarial network have the following beneficial effects compared with the prior art:

[0064] 1. The present invention uses a generator to generate labeled data, and uses a discriminator to evaluate the labeling quality of the labeled data, and gradually generates high-quality labeled data close to the quality of manual labeling, thereby greatly reducing the demand for manual labeling data;

[0065] 2. The present invention can significantly reduce the workload of manual labeling in various application scenarios, and effectively improve the quality of labeled data and the efficiency of model training. It is not limited to applications in the fields of autonomous driving, medical image analysis, intelligent monitoring, etc., and can meet the needs of high-quality, large-scale data labeling and reduce development costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Attached Figure 1 is a flow chart of a method according to Embodiment 1 of the present invention;

[0067] Attached Figure 2 This is a module connection block diagram of the second embodiment of the present invention. DETAILED DESCRIPTION

[0068] In order to make the technical solution, the technical problem solved and the technical effect of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in conjunction with specific embodiments.

[0069] Embodiment 1:

[0070] Combined with Figure 1 This embodiment proposes a method for automatically generating high-quality labeled data using a generative adversarial network, which includes the following steps:

[0071] S1. Perform data collection and enhancement.

[0072] This step collects as diverse data as possible, such as image data, text data, and voice data, to ensure that the generator can be exposed to different types of data distributions, thereby generating more diverse samples. At the same time, the collected data (also called real data) is rotated, scaled, and cropped to increase the diversity and complexity of the training data, which helps to improve the generalization ability of the generator.

[0073] S2. Construct a generative adversarial network, including:

[0074] Build the generator, including: select the random number generator and initialize the seed, generate a random Gaussian noise vector as input, select the network architecture according to the nature of the generated data, design the output layer to match the data type, and add a module that can automatically generate annotation information;

[0075] Constructing a discriminator includes: taking real data and data generated by the generator as input, extracting spatial features according to different data selection algorithms, and outputting data authenticity and annotation accuracy at the output layer.

[0076] S3. Use small-scale annotated data to preliminarily train the generator and discriminator of the generative adversarial network, so that the generator can generate synthetic data with preliminary annotations, and the discriminator can distinguish the difference between the generated annotated data and the real annotated data.

[0077] This step specifically includes:

[0078] S3.1. Select some training data for manual labeling, denoted as data set X = {(x 1 ,y 1 ),(x 1 ,y 2 ),...,(x n ,y n )}, where x i is the input data, y i It is real labeled data;

[0079] S3.2. Generator G is a neural network-based model. The unlabeled data x in the dataset X is used as the input of generator G. Generator G first outputs the generated annotations The generated annotations are then calculated using a predefined annotation loss function. and the true annotation y i The network then adjusts its own network parameters by minimizing the annotation loss, thereby gradually learning how to generate more accurate preliminary annotations.

[0080] The predefined annotation loss function is expressed as follows:

[0081]

[0082] Where n represents the number of samples, y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotations;

[0083] S3.3, the discriminator D is a neural network based model that takes paired data (x, y) and As the input of the discriminator D, (x, y) represents the pair of input data and true annotation, Represents a pair of input data and the annotation generated by the generator; the discriminator D maximizes the probability of the true annotation and minimizes the probability of the generated annotation being judged as true through a pre-defined authenticity loss function, thereby outputting a loss function value D = (x, y), which represents the probability that the input annotation is a true annotation;

[0084] The pre-defined authenticity loss function is expressed as follows:

[0085]

[0086] Where n represents the number of samples, i represents the i-th sample, and y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotation; logD(x i ,y i ) represents the true sample pair D(x i ,y i ) is the logarithm of the probability that the discriminator judges it to be true, (x i ,G(x i )) represents the generation of sample pairs, log(1-D(x i ,G(x i ))) represents the generation of sample pairs (x i ,G(x i )) is the logarithm of the probability that the discriminator judges it to be false;

[0087] In the process of executing steps S3.2 and S3.3, the gradient descent method is used to optimize the annotation loss function of the generator and the authenticity loss function of the discriminator respectively. When optimizing the generator loss function, the annotation loss of the generator is taken as the target, the gradient of the generator network parameters is calculated, and then the parameters of the generator are updated according to the gradient descent strategy; when optimizing the discriminator loss function, the discriminator loss of the discriminator is taken as the target, the gradient of the discriminator network parameters is calculated, and then the parameters of the discriminator are adjusted according to the gradient descent strategy.

[0088] S4. The generator and discriminator are trained alternately in a cycle, and annotation optimization is performed based on the discriminator's evaluation of the accuracy of the generated data annotation. By continuously adjusting the network parameters and optimizing the loss function, the generator and discriminator gradually reach a balanced state during the training process.

[0089] This step specifically includes:

[0090] S4.1. Training the discriminator: fix the generator parameters, use the real data and the labeled data generated by the generator to train the discriminator, calculate the output of the discriminator for the real data and the generated data, and calculate the loss value according to the authenticity loss function, and use the back propagation algorithm to update the discriminator parameters according to the calculated loss value;

[0091] The pre-defined authenticity loss function is expressed as follows:

[0092]

[0093] Where n represents the number of samples, i represents the i-th sample, and y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotation; logD(x i ,y i ) represents the true sample pair D(x i ,y i ) is the logarithm of the probability that the discriminator judges it to be true, (x i ,G(x i )) represents the generation of sample pairs, log(1-D(x i ,G(x i ))) represents the generation of sample pairs (x i ,G(x i )) is the logarithm of the probability that the discriminator judges it to be false;

[0094] S4.2. Training the generator: fix the discriminator parameters, the generator generates labeled data based on the input real data, sends the labeled data generated by the generator to the discriminator for calculation, obtains the output result of the discriminator, and calculates the loss value of the generator on these data according to the joint loss function, and uses the back propagation algorithm to update the parameters of the generator according to the loss value;

[0095] Based on the labeling loss function and the authenticity loss function, the joint loss function is expressed as follows:

[0096] L joint =αL G +βL Greal ,

[0097] Among them, α and β are weight coefficients, both of which are between 0 and 1, including 0 and 1, α+β=1;

[0098] S4.3, annotation optimization: based on the discriminator's evaluation of the accuracy of the generated data annotation, adjust the generator annotation module parameters and the discriminator feedback parameters to make the annotation more accurate;

[0099] S4.4. Perform alternating training and repeat steps S4.1-S4.3 to achieve a balance between the generator and the discriminator.

[0100] S5. Use the trained generative adversarial network to annotate the collected data, and use the annotated data to train downstream machine learning models, such as image classification models, object detection models, and image segmentation models related to images, text generation models and language translation models related to text, and speech recognition models and speech synthesis models related to speech.

[0101] It is necessary to further add:

[0102] (A) For image-related tasks (such as image classification, object detection, and image segmentation), convolutional neural networks (CNNs) are usually selected to construct generators and discriminators. Specifically, (a1) for image classification tasks, the labeled data is annotated with the category label to which the image belongs. For example, a picture of a cat is labeled as "cat", a picture of a car is labeled as "car", etc. These category labels are manually labeled or obtained through other reliable labeling tools. They are used in preliminary training to allow the generator to learn to generate images with correct category labels, and to allow the discriminator to learn to distinguish between real image category labels and generated image category labels; (a2) for object detection tasks, the labeled data contains the location information of the target object in the image (usually represented by bounding box coordinates) and the category label. For example, in an image containing a person and a dog, the labeled data will detail the location of the person (bounding box coordinates) and the category "person", and the location of the dog Such labeled data is used for the generator to learn to generate images with target object location and category annotations, and the discriminator to learn to distinguish between real and generated target detection annotations; (a3) ​​For image segmentation tasks, the labeled data is pixel-level category annotations, that is, each pixel in the image is labeled as belonging to a certain object or background category. For example, in medical image segmentation, for a lung X-ray image, the pixels of the lung tissue may be labeled as the "lung" category, the pixels of the lesion area are labeled as the "lesion" category, and the remaining background pixels are labeled as the "background" category. These labeled data are used to train the generator to generate images with pixel-level annotations, and the discriminator to distinguish between real and generated image segmentation annotations.

[0103] (B) For text-related tasks (such as text generation and language translation), recurrent neural networks (RNNs) or their variants (such as long short-term memory networks (LSTMs) and gated recurrent units (GRUs)) and Transformer architectures may be used to build generators and discriminators. Specifically, (b1) for text generation tasks, the annotation data can be the next word, sentence, or paragraph of the text. For example, for a sentence generation task, the beginning of a given sentence is used as input, and the annotation data is the subsequent content of the sentence. In the initial training, the generator learns to generate subsequent text annotations based on the input text part, and the discriminator learns to distinguish between the annotations of real text and generated text; (b2) for language translation tasks, the annotation data is the target language translation text corresponding to the source language text. For example, for a task of translating English into Chinese, the English sentence is the input, and the corresponding Chinese translation sentence is the annotation data. In the initial training, the generator learns to generate the correct translation annotation, and the discriminator learns to distinguish between the annotations of real translation and generated translation.

[0104] (C) For speech-related tasks (such as speech recognition and speech synthesis), the generator and discriminator may be constructed based on the deep neural network architecture WaveNet. Specifically, (c1) for speech recognition tasks, the annotated data is the text content corresponding to the speech signal. For example, the text transcription corresponding to a piece of speech content is the annotated data. In the initial training, the generator learns to generate correct speech recognition annotations, and the discriminator learns to distinguish between real and generated speech recognition annotations; (c2) for speech synthesis tasks, the annotated data is the speech features or speech waveforms corresponding to the text content. For example, the speech acoustic parameters or speech waveforms corresponding to a sentence are the annotated data. In the initial training, the generator learns to generate correct speech synthesis annotations (speech waveforms or features), and the discriminator learns to distinguish between real and generated speech synthesis annotations.

[0105] Embodiment 2:

[0106] Combined with Figure 2 This embodiment proposes a system for automatically generating high-quality labeled data using a generative adversarial network, which includes:

[0107] Collection enhancement module, used for data collection and enhancement;

[0108] Network building module, used to build generative adversarial networks;

[0109] A preliminary training module is used to preliminarily train the generator and discriminator of the generative adversarial network using small-scale annotated data, so that the generator can generate synthetic data with preliminary annotations and the discriminator can distinguish the difference between the generated annotated data and the real annotated data;

[0110] An alternating training module is used to cyclically alternately train the discriminator and the generator, and update the parameters of the discriminator and the generator using the back-propagation algorithm;

[0111] The annotation optimization module is used to optimize the annotation based on the discriminator's evaluation of the accuracy of the generated data annotation, continuously adjust the network parameters and optimize the loss function, so that the generator and the discriminator gradually reach a balanced state during the training process;

[0112] The model output module is used to annotate the collected data using the trained generative adversarial network. The annotated data is used to train the downstream machine learning model.

[0113] In this embodiment, the network construction modules involved specifically include:

[0114] The generator construction unit is used to construct the generator. The specific operations include: selecting a random number generator and initializing the seed, generating a random Gaussian noise vector as input, selecting a network architecture according to the nature of the generated data, designing an output layer that matches the data type, and adding a module that can automatically generate annotation information;

[0115] The discriminator construction unit is used to construct the discriminator. The specific operations include: taking the real data and the data generated by the generator as input, extracting spatial features according to different data selection algorithms, and the output layer outputs the data authenticity and annotation accuracy.

[0116] In this embodiment, the preliminary training module specifically performs the following operations to preliminarily train the generator and the discriminator:

[0117] Select part of the training data for manual annotation, denoted as data set X = {(x 1 ,y 1 ),(x 1 ,y 2 ),...,(x n ,y n )}, where x i is the input data, y i It is real labeled data;

[0118] Generator G is a neural network-based model. The unlabeled data x in the dataset X is used as the input of generator G. Generator G first outputs the generated annotations. The generated annotations are then calculated using a predefined annotation loss function. and the true annotation y i The network then adjusts its own network parameters by minimizing the annotation loss, thereby gradually learning how to generate more accurate preliminary annotations.

[0119] The discriminator D is a neural network-based model that uses paired data (x, y) and As the input of the discriminator D, (x, y) represents the pair of input data and true annotation, (x, y) represents the pair of input data and annotation generated by the generator; the discriminator D maximizes the probability of true annotation and minimizes the probability of generated annotation being judged as true through a pre-defined authenticity loss function, thereby outputting a loss function value D = (x, y), which represents the probability that the input annotation is a true annotation.

[0120] During the initial training process, the gradient descent method is used to optimize the annotation loss function of the generator and the authenticity loss function of the discriminator. When optimizing the generator loss function, the annotation loss of the generator is used as the target, the gradient of the generator network parameters is calculated, and then the parameters of the generator are updated according to the gradient descent strategy; when optimizing the discriminator loss function, the discriminator loss of the discriminator is used as the target, the gradient of the discriminator network parameters is calculated, and then the parameters of the discriminator are adjusted according to the gradient descent strategy.

[0121] In this embodiment, when the alternating training module trains the discriminator, the generator parameters are fixed, the discriminator is trained using the real data and the labeled data generated by the generator, the output of the discriminator for the real data and the generated data is calculated, and the loss value is calculated according to the authenticity loss function, and the back propagation algorithm is used to update the parameters of the discriminator according to the calculated loss value;

[0122] When the alternating training module trains the generator, the discriminator parameters are fixed, the generator generates labeled data based on the input real data, the labeled data generated by the generator is sent to the discriminator for calculation, the output result of the discriminator is obtained, and the loss value of the generator on these data is calculated according to the joint loss function, and the back propagation algorithm is used to update the parameters of the generator according to the loss value.

[0123] In this embodiment, the predefined annotation loss function is expressed as follows:

[0124]

[0125] Where n represents the number of samples, y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotations;

[0126] The pre-defined authenticity loss function is expressed as follows:

[0127]

[0128] Where n represents the number of samples, i represents the i-th sample, and yi represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotation; logD(x i ,y i ) represents the true sample pair D(x i ,y i ) is the logarithm of the probability that the discriminator judges it to be true, (x i ,G(x i )) represents the generation of sample pairs, log(1-D(x i ,G(x i ))) represents the generation of sample pairs (x i ,G(x i )) is the logarithm of the probability that the discriminator judges it to be false;

[0129] Based on the labeling loss function and the authenticity loss function, the joint loss function is expressed as follows:

[0130] L joint =αL G +βL Greal ,

[0131] Among them, α and β are weight coefficients, both of which take values ​​between 0 and 1, including 0 and 1, and α+β=1.

[0132] In this embodiment, the model output module generates high-quality labeled data output by the adversarial network for training downstream machine learning models. Based on this, the network construction module and the preliminary training module need to be further supplemented as follows:

[0133] (A) For image-related tasks (such as image classification, object detection, and image segmentation), the network building module usually selects a convolutional neural network (CNN) to build a generator and a discriminator. Specifically, (a1) for image classification tasks, the labeled data is labeled with the category label to which the image belongs. For example, a picture of a cat is labeled as "cat", a picture of a car is labeled as "car", etc. These category labels are manually labeled or obtained through other reliable labeling tools. They are used in preliminary training to allow the generator to learn to generate images with correct category labels, and to allow the discriminator to learn to distinguish between real image category labels and generated image category labels; (a2) for object detection tasks, the labeled data contains the location information of the target object in the image (usually expressed in bounding box coordinates) and the category label. For example, in an image containing a person and a dog, the labeled data will detail the location of the person (bounding box coordinates) and the category "person", and the location of the dog Such labeled data is used for the generator to learn to generate images with target object location and category annotations, and the discriminator to learn to distinguish between real and generated target detection annotations; (a3) ​​For image segmentation tasks, the labeled data is pixel-level category annotations, that is, each pixel in the image is labeled as belonging to a certain object or background category. For example, in medical image segmentation, for a lung X-ray image, the pixels of the lung tissue may be labeled as the "lung" category, the pixels of the lesion area are labeled as the "lesion" category, and the remaining background pixels are labeled as the "background" category. These labeled data are used to train the generator to generate images with pixel-level annotations, and the discriminator to distinguish between real and generated image segmentation annotations.

[0134] (B) For text-related tasks (such as text generation and language translation), the network building module may use a recurrent neural network (RNN) or its variants (such as long short-term memory network LSTM, gated recurrent unit GRU) and Transformer architecture to build the generator and discriminator. Specifically, (b1) for text generation tasks, the annotation data can be the next word, sentence or paragraph of the text. For example, for a sentence generation task, the beginning of the sentence is given as input, and the annotation data is the subsequent content of the sentence. In the preliminary training, the generator learns to generate subsequent text annotations based on the input text part, and the discriminator learns to distinguish the annotations of the real text and the generated text; (b2) for language translation tasks, the annotation data is the target language translation text corresponding to the source language text. For example, for a task of translating English into Chinese, the English sentence is the input, and the corresponding Chinese translation sentence is the annotation data. In the preliminary training, the generator learns to generate the correct translation annotation, and the discriminator learns to distinguish the annotations of the real translation and the generated translation.

[0135] (C) For speech-related tasks (such as speech recognition and speech synthesis), the network building module may build a generator and a discriminator based on the deep neural network architecture WaveNet. Specifically, (c1) for speech recognition tasks, the labeled data is the text content corresponding to the speech signal. For example, the text transcription corresponding to a piece of speech content is the labeled data. In the initial training, the generator learns to generate correct speech recognition annotations, and the discriminator learns to distinguish between real and generated speech recognition annotations; (c2) for speech synthesis tasks, the labeled data is the speech features or speech waveforms corresponding to the text content. For example, the speech acoustic parameters or speech waveforms corresponding to a sentence are the labeled data. In the initial training, the generator learns to generate correct speech synthesis annotations (speech waveforms or features), and the discriminator learns to distinguish between real and generated speech synthesis annotations.

[0136] In summary, the method and system of the present invention for automatically generating high-quality labeled data using a generative adversarial network can automatically generate high-quality labeled data, reduce manual labeling work, reduce data labeling costs, and improve the training efficiency of downstream machine learning models.

[0137] The above specific examples are used to explain the principles and implementation methods of the present invention in detail. These examples are only used to help understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made by technicians in this technical field without departing from the principles of the present invention should fall within the scope of patent protection of the present invention.

Claims

1. A method for automatically generating high-quality annotated data using a generative adversarial network, characterized in that: The steps include: S1, perform data collection and enhancement; S2. Build a generative adversarial network; S3. Use small-scale annotated data to preliminarily train the generator and discriminator of the generative adversarial network, so that the generator can generate synthetic data with preliminary annotations, and the discriminator can distinguish the difference between the generated annotated data and the real annotated data; S4, alternately train the generator and the discriminator in a cycle, and optimize the annotation according to the discriminator's evaluation of the accuracy of the generated data annotation. By continuously adjusting the network parameters and optimizing the loss function, the generator and the discriminator gradually reach a balanced state during the training process; S5. Use the trained generative adversarial network to label the collected data, and use the labeled data to train downstream machine learning models.

2. The method for automatically generating high-quality labeled data using a generative adversarial network according to claim 1, characterized in that: The step S2 specifically includes: Build the generator, including: select the random number generator and initialize the seed, generate a random Gaussian noise vector as input, select the network architecture according to the nature of the generated data, design the output layer to match the data type, and add a module that can automatically generate annotation information; Constructing a discriminator includes: taking real data and data generated by the generator as input, extracting spatial features according to different data selection algorithms, and outputting data authenticity and annotation accuracy at the output layer.

3. The method for automatically generating high-quality labeled data using a generative adversarial network according to claim 1, characterized in that: The step S3 specifically includes: S3.

1. Select some training data for manual annotation, denoted as data set X = {(x1, y1), (x1, y2), ..., (x n ,y n )}, where x i is the input data, y i It is real labeled data; S3.

2. Generator G is a neural network-based model. The unlabeled data x in the dataset X is used as the input of generator G. Generator G first outputs the generated annotations The generated annotations are then calculated using a predefined annotation loss function. and the true annotation y i The network then adjusts its own network parameters by minimizing the annotation loss, thereby gradually learning how to generate more accurate preliminary annotations. S3.3, the discriminator D is a neural network based model that takes paired data (x, y) and As the input of the discriminator D, (x, y) represents the pair of input data and true annotation, Represents a pair of input data and the annotation generated by the generator; the discriminator D maximizes the probability of the true annotation and minimizes the probability of the generated annotation being judged as true through a pre-defined authenticity loss function, thereby outputting a loss function value D = (x, y), which represents the probability that the input annotation is a true annotation; In the process of executing steps S3.2 and S3.3, the gradient descent method is used to optimize the labeling loss function of the generator and the authenticity loss function of the discriminator respectively; when optimizing the generator loss function, the labeling loss of the generator is taken as the target, the gradient of the generator network parameters is calculated, and then the parameters of the generator are updated according to the gradient descent strategy; when optimizing the discriminator loss function, the discriminator loss of the discriminator is taken as the target, the gradient of the discriminator network parameters is calculated, and then the parameters of the discriminator are adjusted according to the gradient descent strategy.

4. The method for automatically generating high-quality labeled data using a generative adversarial network according to claim 3, characterized in that: The predefined annotation loss function is expressed as follows: Where n represents the number of samples, y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotations; The pre-defined authenticity loss function is expressed as follows: Where n represents the number of samples, i represents the i-th sample, and y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotation; logD(x i ,y i ) represents the true sample pair D(x i ,y i ) is the logarithm of the probability that the discriminator judges it to be true, (x i ,G(x i )) represents the generation of sample pairs, log(1-D(x i ,G(x i ))) represents the generation of sample pairs (x i ,G(x i )) is the logarithm of the probability that the discriminator judges it to be false; Based on the labeling loss function and the authenticity loss function, the joint loss function is expressed as follows: L joint =αL G +βL Greal , Among them, α and β are weight coefficients, both of which take values ​​between 0 and 1, including 0 and 1, and α+β=1.

5. The method for automatically generating high-quality labeled data using a generative adversarial network according to claim 4, characterized in that: The step S4 specifically includes: S4.

1. Training the discriminator: fix the generator parameters, use the real data and the labeled data generated by the generator to train the discriminator, calculate the output of the discriminator for the real data and the generated data, and calculate the loss value according to the authenticity loss function, and use the back propagation algorithm to update the discriminator parameters according to the calculated loss value; S4.

2. Training the generator: fix the discriminator parameters, the generator generates labeled data based on the input real data, sends the labeled data generated by the generator to the discriminator for calculation, obtains the output result of the discriminator, and calculates the loss value of the generator on these data according to the joint loss function, and uses the back propagation algorithm to update the parameters of the generator according to the loss value; S4.3, annotation optimization: based on the discriminator's evaluation of the accuracy of the generated data annotation, adjust the generator annotation module parameters and the discriminator feedback parameters to make the annotation more accurate; S4.

4. Perform alternating training and repeat steps S4.1-S4.3 to achieve a balance between the generator and the discriminator.

6. A system for automatically generating high-quality annotated data using a generative adversarial network, characterized in that: It includes: Collection enhancement module, used for data collection and enhancement; Network building module, used to build generative adversarial networks; A preliminary training module is used to preliminarily train the generator and discriminator of the generative adversarial network using small-scale annotated data, so that the generator can generate synthetic data with preliminary annotations and the discriminator can distinguish the difference between the generated annotated data and the real annotated data; An alternating training module is used to cyclically alternately train the discriminator and the generator, and update the parameters of the discriminator and the generator using the back-propagation algorithm; The annotation optimization module is used to optimize the annotation based on the discriminator's evaluation of the accuracy of the generated data annotation, continuously adjust the network parameters and optimize the loss function, so that the generator and the discriminator gradually reach a balanced state during the training process; The model output module is used to annotate the collected data using the trained generative adversarial network, and the annotated data is used to train the downstream machine learning model. The collected data is annotated using the trained generative adversarial network, and the annotated data is used to train the downstream machine learning model.

7. The method for automatically generating high-quality labeled data using a generative adversarial network according to claim 6, characterized in that: The network construction module specifically includes: The generator construction unit is used to construct the generator. The specific operations include: selecting a random number generator and initializing the seed, generating a random Gaussian noise vector as input, selecting a network architecture according to the nature of the generated data, designing an output layer that matches the data type, and adding a module that can automatically generate annotation information; The discriminator construction unit is used to construct the discriminator. The specific operations include: taking the real data and the data generated by the generator as input, extracting spatial features according to different data selection algorithms, and the output layer outputs the data authenticity and annotation accuracy.

8. The method for automatically generating high-quality labeled data using a generative adversarial network according to claim 6, characterized in that: The preliminary training module specifically performs the following operations to preliminarily train the generator and the discriminator: Select part of the training data for manual annotation, denoted as data set X = {(x1, y1), (x1, y2), ..., (x n ,y n )}, where x i is the input data, y i It is real labeled data; Generator G is a neural network-based model. The unlabeled data x in the dataset X is used as the input of generator G. Generator G first outputs the generated annotations. The generated annotations are then calculated using a predefined annotation loss function. and the true annotation y i The network then adjusts its own network parameters by minimizing the annotation loss, thereby gradually learning how to generate more accurate preliminary annotations. The discriminator D is a neural network-based model that uses paired data (x, y) and As the input of the discriminator D, (x, y) represents the pair of input data and true annotation, Represents a pair of input data and the annotation generated by the generator; the discriminator D maximizes the probability of the true annotation and minimizes the probability of the generated annotation being judged as true through a pre-defined authenticity loss function, thereby outputting a loss function value D = (x, y), which represents the probability that the input annotation is a true annotation; During the initial training process, the gradient descent method is used to optimize the labeling loss function of the generator and the authenticity loss function of the discriminator respectively; When optimizing the generator loss function, the generator's annotation loss is used as the target, the gradient of the generator network parameters is calculated, and then the generator parameters are updated according to the gradient descent strategy; When optimizing the discriminator loss function, the discriminator loss is taken as the target, the gradient of the discriminator network parameters is calculated, and then the parameters of the discriminator are adjusted according to the gradient descent strategy.

9. The method for automatically generating high-quality labeled data using a generative adversarial network according to claim 8, characterized in that: The predefined annotation loss function is expressed as follows: Where n represents the number of samples, y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotations; The pre-defined authenticity loss function is expressed as follows: Where n represents the number of samples, i represents the i-th sample, and y i represents the true annotation, G(x i ) indicates that the generator G is generated based on the input data x i Generated annotation; logD(x i ,y i ) represents the true sample pair D(x i ,y i ) is the logarithm of the probability that the discriminator judges it to be true, (x i ,G(x i )) represents the generation of sample pairs, log(1-D(x i ,G(x i ))) represents the generation of sample pairs (x i ,G(x i )) is the logarithm of the probability that the discriminator judges it to be false; Based on the labeling loss function and the authenticity loss function, the joint loss function is expressed as follows: L joint =αL G +βL Greal , Among them, α and β are weight coefficients, both of which take values ​​between 0 and 1, including 0 and 1, and α+β=1.

10. The method for automatically generating high-quality annotated data using a generative adversarial network according to claim 9, characterized in that: When the alternating training module trains the discriminator, the generator parameters are fixed, the discriminator is trained using the real data and the labeled data generated by the generator, the output of the discriminator for the real data and the generated data is calculated, and the loss value is calculated according to the authenticity loss function, and the back propagation algorithm is used to update the parameters of the discriminator according to the calculated loss value; When the alternating training module trains the generator, the discriminator parameters are fixed, the generator generates labeled data based on the input real data, the labeled data generated by the generator is sent to the discriminator for calculation, the output result of the discriminator is obtained, and the loss value of the generator on these data is calculated according to the joint loss function, and the back propagation algorithm is used to update the parameters of the generator according to the loss value.

Citation Information

Patent Citations

  • Target detection method based on generative adversarial network

    CN109543740A

  • Semi-supervised X-ray image automatic labeling based on generative adversarial network

    CN110110745A

  • Video foreground detection method based on full convolutional network and conditional adversarial network

    CN110580472A

  • TKA preoperative clinical staging intelligent evaluation method based on generative adversarial network

    CN111028941A

  • Zero-sample image recognition method and system based on generative adversarial network

    CN111476294A

Cited By

  • Rail locomotive operation and maintenance data intelligent monitoring method and system and electronic equipment

    CN120296430A

  • Model application-oriented multi-modal data set labeling management method and system

    CN120724391A