A Small-Sample Data Synthesis Method Based on Bidirectional Generative Adversarial Networks
Through the design of a two-way generative adversarial network, the authenticity and diversity of samples are optimized by two generators and discriminators, and the problem of difficulty in balancing diversity and authenticity in the generation of small sample data sets is solved. The generated samples are visually and statistically similar to the original data set, improving the generalization ability and generation effect of the model.
Patent Information
- Application Number
- CN202411331762.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The prior art is difficult to balance diversity and authenticity in the generation of small sample data sets. The samples generated by traditional generative adversarial networks lack diversity in the samples in small sample scenarios or are significantly different from the real samples, and lack an effective automated evaluation mechanism, resulting in the generator optimization process being inaccurate enough.
Two-way generative adversarial networks are adopted to build two generators and two discriminators, respectively, optimize the authenticity and diversity of generated samples, and dynamically adjust network parameters to achieve the best balance through adaptive noise introduction mechanism and data enhancement module, combined with an automated evaluation mechanism.
The generated samples are visually similar to the original dataset, have higher diversity, improve the generalization ability of the model, avoid pattern crash problems, and generate more stable and in line with expectations.
Smart Images

Figure CN119167091B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of small sample data, and in particular to a small sample data synthesis method based on a bidirectional generative adversarial network. Background Art
[0002] In the existing fields of artificial intelligence and machine learning, especially in the training process of deep learning models, the scale and quality of the data set have a crucial impact on the performance of the model. However, in many practical application scenarios, it is often extremely challenging to obtain a sufficiently large-scale and high-quality labeled data set. Especially in the fields of medical image processing and industrial fault detection, due to the scarcity and difficulty of obtaining samples, the data set is usually small. The existence of such a small sample data set greatly limits the generalization ability of the deep learning model, resulting in poor performance of the deep learning model when facing unseen data.
[0003] Traditional data augmentation methods, including rotation, flipping, scaling, and noise injection, although increase the diversity of the data set to a certain extent, the transformation methods are relatively simple and cannot truly generate new samples with rich diversity. Therefore, they cannot fundamentally solve the problem of the small sample data set.
[0004] The introduction of the generative adversarial network provides a new solution for data synthesis. Through the adversarial training of the generator and the discriminator, the generative adversarial network can generate samples similar to the real data distribution. However, the application of the traditional generative adversarial network in small sample scenarios still faces many challenges. For example, it is difficult to balance the diversity and authenticity of the generated samples, and the phenomenon of mode collapse is likely to occur, that is, the generated samples lack diversity, or the generated samples have obvious differences from the real samples in statistical characteristics. In addition, in the process of generating samples by the existing generative adversarial network methods, there is a lack of an effective automatic evaluation mechanism to balance the authenticity and diversity of the generated samples, resulting in inaccurate optimization of the generator and difficulty in dynamically adjusting the parameters of the generation network, thus affecting the quality of the finally generated data set. Summary of the Invention
[0005] An object of the present invention is to propose a small sample data synthesis method based on a bidirectional generative adversarial network. The present invention finds the best balance point between the diversity and authenticity of the generated samples, so that the extended data set is visually similar to the original data set while having higher diversity.
[0006] A small sample data synthesis method based on a bidirectional generative adversarial network according to an embodiment of the present invention includes the following steps:
[0007] S1. Obtain a small sample data set, and perform preprocessing on the small sample data set, including data cleaning, normalization processing, and noise filtering;
[0008] S2. Construct a bidirectional generative adversarial network with a dual-generator and dual-discriminator:
[0009] The first generator is used to generate a first synthetic sample dataset similar to the original small-sample dataset;
[0010] The second generator is used to generate a second synthetic sample dataset slightly different from the original small-sample dataset;
[0011] The first discriminator is used to distinguish the first synthetic sample dataset generated by the first generator from the real small-sample dataset and evaluate the authenticity of the first synthetic sample dataset;
[0012] The second discriminator is used to distinguish the small-sample dataset generated by the second generator from the real small-sample dataset and evaluate the diversity of the second synthetic sample dataset;
[0013] S3. Initialize the parameters of the first generator, the second generator, the first discriminator, and the second discriminator, and conduct preliminary training on the first generator, the second generator, the first discriminator, and the second discriminator;
[0014] S4. Generate an initial synthetic sample dataset through the first generator and the second generator, and respectively input the sample datasets into the first discriminator and the second discriminator for discrimination. The first discriminator evaluates the authenticity of the samples generated by the first generator, and the second discriminator evaluates the diversity of the samples generated by the second generator;
[0015] S5. According to the loss values output by the first discriminator and the second discriminator, respectively update the parameters of the first generator and the second generator in the reverse direction, where the first generator optimizes the authenticity of the generated samples, and the second generator optimizes the diversity of the generated samples;
[0016] S6. Repeat S4 and S5, and continuously optimize the quality of the synthetic sample dataset during the alternating training of the first generator and the second generator until the synthetic sample dataset meets the predetermined requirements in terms of authenticity and diversity;
[0017] S7. Optimize the inputs of the first generator and the second generator through an adaptive noise introduction mechanism and a data augmentation module to enhance the diversity of the small-sample dataset. The adaptive noise introduction mechanism dynamically adjusts the noise distribution according to the training stage;
[0018] S8. Generate an extended small-sample dataset, which is generated by the first generator and the second generator and is visually and statistically similar to the original small-sample dataset, with higher diversity;
[0019] S9. Score the authenticity and diversity of the generated small sample dataset through an automated evaluation mechanism, and dynamically adjust the parameters of the bidirectional generative adversarial network according to the evaluation results.
[0020] Optionally, the S1 includes the following sub-steps:
[0021] S11. Obtain an initial small sample dataset D0. The initial small sample dataset contains n samples, and each sample x i belongs to the data space X, that is, D0 = {x1, x2, …, x n}, where x i represents the i-th data sample;
[0022] S12. Perform data cleaning on the initial small sample dataset D0, remove incomplete or abnormal data points, and generate a cleaned small sample dataset D1, where the cleaning operation is expressed as:
[0023] D1 = {x i ∈ D0 | satisfying the cleaning conditions};
[0024] S13. Perform normalization processing on the cleaned small sample dataset D1, map all sample data x i ∈ D1 to the standard range [a, b] to obtain a normalized small sample dataset D2;
[0025] S14. Perform noise filtering on the normalized small sample dataset D2, remove or suppress the random noise components in the small sample dataset, and generate a final preprocessed small sample dataset D pre :
[0026] D pre = {x' i ∈ D2 | passing the noise filtering}.
[0027] Optionally, the S2 includes the following sub-steps:
[0028] S21. Construct a first generator G1, which is used to generate a first synthetic sample dataset D pre similar to the final preprocessed small sample dataset D gen1 , where the first generator G1 generates sample data by inputting a noise vector and generates a first synthetic data sample x gen1 by combining the feature distribution in the latent space Z1:
[0029]
[0030] Among them, W0 and w1 are the weight matrices of the first generator G1 respectively, b0 and b1 are the bias vectors of the first generator G1 respectively, σ is the activation function, w1 is the adjustable parameter in the first generator, z1 represents the noise vector, and x gen1 represents the first synthetic sample data generated;
[0031] S22. Construct the second generator G2, which is used to generate a second synthetic sample data set D pre different from the finally preprocessed small sample data set D gen2 , where the second generator G2 generates sample data by inputting the noise vector and performs fine-tuning by combining the diversity adjustment parameter λ during the generation process, so that the generated second synthetic sample data set D gen2 has diversity in the data space X:
[0032]
[0033] Among them, W1 and W2 are the weight matrices of the second generator G2 respectively, b1 and b2 are the bias vectors, λ is the diversity adjustment parameter, z2 represents the noise vector, and x gen2 represents the second synthetic sample data generated;
[0034] S23. Construct the first discriminator D1, which is used to distinguish the first synthetic sample data set D gen1 generated by the first generator G1 from the finally preprocessed small sample data set D pre , and output an evaluation index on the authenticity of the first synthetic sample data set D gen1 ;
[0035]
[0036] Among them, D1(x i ) represents the discriminant output of the first discriminator D1 on the real sample x i , represents the synthetic sample generated by the first generator G1 α is the regularization parameter, is the two-norm distance between the weight matrices of the first generator;
[0037] S24. Construct the second discriminator D2, which is used to distinguish the second synthetic sample data set D gen2 generated by the second generator G2 from the finally preprocessed small sample data set D pre , and output an evaluation index on the diversity of the second synthetic sample data set D gen2 ;
[0038]
[0039] Among them, D2(x i ) represents the discrimination output of the second discriminator D2 on the real sample x i . represents the synthetic sample generated by the second generator G2 β is a regularization parameter, representing the variance of the generated sample.
[0040] Optionally, the S3 includes the following sub-steps:
[0041] S31. Initialize the parameters of the first generator G1 and the parameters of the second generator G2 and the parameters of the first discriminator D1 and and and the parameters of the second discriminator D2 and
[0042] S32. Select the learning rate η and the batch size m, and determine the initial number of training rounds T of the generator and the discriminator. Among them, the learning rate η determines the step size of each parameter update, the batch size m affects the number of data samples used in each training, and the number of training rounds T determines the initial training intensity of the entire model;
[0043] S33. Extract a small batch of samples x pre from the small sample dataset D (i) ∈ D pre by means of random sampling. At the same time, extract noise vectors and from the noise distributions and respectively, where i = 1, 2,..., m. The noise vectors and are used as the inputs of the first generator G1 and the second generator G2 respectively to generate the corresponding synthetic samples. The distributions p z1 (z) and p z2 (z) of the noise vectors determine the diversity of the generated samples;
[0044] S34. Use the extracted noise vectors and to calculate the first synthetic data samples of the first generator G1 and the second generator G2 respectively and the second synthetic data samples, and calculate the loss functions and
[0045]
[0046] Among them, D1(x (i) ) and D2(x (i) ) respectively represent the discrimination outputs of the first discriminator D1 and the second discriminator D2 on the real sample x (i) . and represent the discrimination outputs on the generated samples;
[0047] S35. Repeat steps S33 to S34 until the predetermined number of training rounds T is completed, generating the initially trained generator and discriminator models.
[0048] Optionally, the S5 includes the following sub-steps:
[0049] S51. Calculate the gradient of the first generator G1 according to the output loss value of the first discriminator D1:
[0050]
[0051] Among them, represents the weight matrix of the first generator G1, represents the loss value of the i-th sample, is the i-th synthetic sample generated by the first generator G1;
[0052] S52. Update the parameters and of the first generator G1 to optimize the authenticity of the generated samples:
[0053]
[0054] Among them, and are respectively the gradients of the loss function with respect to the weight matrix and the bias vector ;
[0055] S53. Calculate the gradient of the second generator G2 according to the output loss value of the second discriminator D2:
[0056]
[0057] Among them, represents the weight matrix of the second generator G2, represents the loss value of the i-th sample, The i-th synthetic sample generated by the second generator G2;
[0058] S54. Update the parameters of the second generator G2 and to optimize the diversity of the generated samples:
[0059]
[0060] where and are the gradients of the loss function with respect to the weight matrix and the bias vector respectively;
[0061] S55. Repeat steps S51 to S54 until the samples generated by the optimized first generator G1 reach a predetermined authenticity standard and the samples generated by the optimized second generator G2 reach a predetermined diversity standard, completing the parameter back-update process of the bidirectional generative adversarial network.
[0062] Optionally, the S8 includes the following sub-steps:
[0063] S81. Use the optimized first generator G1 to generate an extended small sample dataset D gen1 , where each generated sample is generated by a noise vector :
[0064]
[0065] where represents the j-th noise vector, is the weight matrix of the optimized first generator, is the j-th generated extended sample, and the extended sample dataset D gen1 consists of n1 generated samples, that is:
[0066]
[0067] S82. Use the optimized second generator G2 to generate an extended small sample data D gen2 , where each generated sample is generated by a noise vector :
[0068]
[0069] where represents the k-th noise vector, is the weight matrix of the optimized second generator, and λ is the diversity adjustment parameter. The k-th generated extended sample, the extended sample dataset D gen2 consists of n2 generated samples, i.e.:
[0070]
[0071] S83. Combine the extended sample dataset D gen1 generated by the first generator G1 with the extended sample dataset D gen2 generated by the second generator G2 to generate the final extended small sample dataset D exp :
[0072] D exp = D gen1 ∪ D gen2 ;
[0073] where D exp contains all the generated samples and is visually and statistically similar to the original small sample dataset D pre ;
[0074] S84. Verify the visual and statistical characteristics of the generated extended small sample dataset D exp to make the extended small sample dataset visually similar to the original dataset D pre and ensure that the sample distribution of the extended dataset covers a wider sample space through statistical analysis.
[0075] Optionally, the S9 includes the following sub-steps:
[0076] S91. Perform authenticity scoring on the generated extended small sample dataset D exp using the first discriminator D1 to discriminate and output for each sample and calculate the overall authenticity score where n
[0077]
[0078] represents the total number of samples in the extended dataset D exp exp is the l-th extended sample, reflecting the overall performance of the generated dataset in terms of authenticity;
[0079] S92. Perform diversity scoring on the generated extended small sample dataset D exp using statistical methods to calculate the distribution characteristics of the generated samples and obtain the overall diversity score
[0080]
[0081] Among them, Var(D exp ) is the variance of the extended dataset, and μ exp represents the mean vector of the extended dataset D exp , and is used to evaluate the diversity of the generated dataset; is used to evaluate the diversity of the generated dataset;
[0082] S93. Combine the authenticity score and the diversity score to calculate the comprehensive score for dynamically adjusting the parameters of the bidirectional generative adversarial network:
[0083]
[0084] Among them, α1 and β1 are weight coefficients used to balance the influence of authenticity and diversity in the comprehensive score, indicating the overall quality of the generated samples;
[0085] S94. According to the result of the comprehensive score , dynamically adjust the parameters of the first generator G1 and the second generator G2 and
[0086] S95. Repeat steps S91 to S94 until the comprehensive score S total reaches a predetermined standard, thereby completing the optimization and adjustment of the parameters of the generative adversarial network, ensuring that the generated small sample dataset meets the requirements in terms of authenticity and diversity.
[0087] The beneficial effects of the present invention are as follows:
[0088] (1) The small sample data synthesis method based on the bidirectional generative adversarial network of the present invention has achieved significant technical breakthroughs in the expansion of small sample datasets through the design of dual generators and dual discriminators. By constructing the first generator and the second generator, this method can simultaneously generate synthetic sample datasets that are similar to and slightly different from the original small sample dataset. The dual generator architecture effectively solves the contradiction between diversity and authenticity in traditional bidirectional generative adversarial networks. By optimizing the outputs of the two generators respectively, the best balance point between the diversity and authenticity of the generated samples is found, making the extended dataset visually similar to the original dataset while having higher diversity.
[0089] (2) The dual discriminator mechanism proposed by the present invention greatly improves the quality of the generated samples. The first discriminator focuses on evaluating the authenticity of the generated samples to ensure that the generated samples are consistent with the real samples in statistical characteristics. The second discriminator is used to evaluate the diversity of the generated samples. Through the two-way evaluation mechanism, the generator can more accurately optimize the data distribution of the generated samples, effectively avoiding the problem of mode collapse. The generated samples not only cover the main features of the original samples but also contain rich variation information, thus enhancing the generalization ability of model training.
[0090] (3) The present invention introduces an automated evaluation mechanism during the generation process. By scoring the authenticity and diversity of the generated samples, the parameters of the generator and discriminator are dynamically adjusted, enabling the two-way generative adversarial network to have an adaptive adjustment ability during training, making the generated samples more in line with the expected quality requirements. The introduction of the comprehensive score not only significantly improves the overall quality of the generated samples but also provides an effective feedback signal for the training process of the two-way generative adversarial network, avoiding the problem of unstable generation effects caused by the lack of an evaluation mechanism in traditional methods.
[0091] (4) The present invention also realizes the continuous optimization of the quality of the generated samples by dynamically adjusting the weight matrix and bias vector of the generator. During the training process, it can adaptively adjust the network parameters according to the real-time performance of the generated samples to ensure the best balance between the diversity and authenticity of the generated samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] The drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings:
[0093] Figure 1 is a flowchart of a small-sample data synthesis method based on a two-way generative adversarial network proposed by the present invention;
[0094] Figure 2 is a schematic framework diagram of a dual-generator-dual-discriminator structure in a small-sample data synthesis method based on a two-way generative adversarial network proposed by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0095] Now, the present invention will be further described in detail with reference to the drawings. These drawings are all simplified schematic diagrams, only showing the basic structure of the present invention in a schematic way, so they only show the components related to the present invention.
[0096] Refer to Figure 1-2 , a small-sample data synthesis method based on a two-way generative adversarial network, includes the following steps:
[0097] S1. Obtain a small sample dataset and preprocess the small sample dataset, including data cleaning, normalization processing, and noise filtering;
[0098] S2. Construct a bidirectional generative adversarial network with a dual-generator and dual-discriminator:
[0099] The first generator is used to generate a first synthetic sample dataset similar to the original small sample dataset;
[0100] The second generator is used to generate a second synthetic sample dataset slightly different from the original small sample dataset;
[0101] The first discriminator is used to distinguish the first synthetic sample dataset generated by the first generator from the real small sample dataset and evaluate the authenticity of the first synthetic sample dataset;
[0102] The second discriminator is used to distinguish the small sample dataset generated by the second generator from the real small sample dataset and evaluate the diversity of the second synthetic sample dataset;
[0103] S3. Initialize the parameters of the first generator, the second generator, the first discriminator, and the second discriminator, and perform preliminary training on the first generator, the second generator, the first discriminator, and the second discriminator;
[0104] S4. Generate an initial synthetic sample dataset through the first generator and the second generator, and respectively input the sample datasets into the first discriminator and the second discriminator for discrimination. The first discriminator evaluates the authenticity of the samples generated by the first generator, and the second discriminator evaluates the diversity of the samples generated by the second generator;
[0105] S5. According to the loss values output by the first discriminator and the second discriminator, respectively update the parameters of the first generator and the second generator in the reverse direction, where the first generator optimizes the authenticity of the generated samples, and the second generator optimizes the diversity of the generated samples;
[0106] S6. Repeat S4 and S5, and continuously optimize the quality of the synthetic sample dataset during the alternating training of the first generator and the second generator until the synthetic sample dataset meets the predetermined requirements in terms of authenticity and diversity;
[0107] S7. Optimize the inputs of the first generator and the second generator through an adaptive noise introduction mechanism and a data augmentation module to enhance the diversity of the small sample dataset. The adaptive noise introduction mechanism dynamically adjusts the noise distribution according to the training stage;
[0108] S8. Generate an extended small-sample dataset, which is generated by the first generator and the second generator and is visually and statistically similar to the original small-sample dataset, with higher diversity.
[0109] S9. Score the authenticity and diversity of the generated small-sample dataset through an automated evaluation mechanism, and dynamically adjust the parameters of the bidirectional generative adversarial network according to the evaluation results.
[0110] In this embodiment, S1 includes the following sub-steps:
[0111] S11. Obtain the initial small-sample dataset D0, where the initial small-sample dataset contains n samples, and each sample x i belongs to the data space X, that is, D0 = {x1, x2,..., x n}, where x i represents the i-th data sample;
[0112] S12. Clean the initial small-sample dataset D0, remove incomplete or abnormal data points, and generate the cleaned small-sample dataset D1, where the cleaning operation is expressed as:
[0113] D1 = {x i ∈ D0 | satisfying the cleaning condition};
[0114] S13. Normalize the cleaned small-sample dataset D1, map all sample data x i ∈ D1 to the standard range [a, b] to obtain the normalized small-sample dataset D2;
[0115] S14. Filter the noise of the normalized small-sample dataset D2, remove or suppress the random noise components in the small-sample dataset, and generate the finally preprocessed small-sample dataset D pre :
[0116] D pre = {x' i ∈ D2 | passing the noise filter}.
[0117] In this embodiment, S2 includes the following sub-steps:
[0118] S21. Construct the first generator G1, which is used to generate the first synthetic sample dataset D pre similar to the finally preprocessed small-sample dataset D gen1 , where the first generator G1 generates sample data by inputting a noise vector and generates the first synthetic data sample x gen1 :
[0119]
[0120] Among them, W0 and w1 are the weight matrices of the first generator G1 respectively, b0 and b1 are the bias vectors of the first generator G1 respectively, σ is the activation function, w1 is the adjustable parameter in the first generator, z1 represents the noise vector, and x gen1 represents the first synthesized sample data generated;
[0121] S22. Construct the second generator G2 for generating the second synthesized sample dataset D different from the finally preprocessed small sample dataset D pre where the second synthesized sample dataset D gen2 is generated by inputting the noise vector and is fine-tuned by combining the diversity adjustment parameter λ during the generation process, so that the generated second synthesized sample dataset D gen2 has diversity in the data space X:
[0122]
[0123] Among them, W1 and W2 are the weight matrices of the second generator G2 respectively, b1 and b2 are the bias vectors, λ is the diversity adjustment parameter, z2 represents the noise vector, and x gen2 represents the second synthesized sample data generated;
[0124] S23. Construct the first discriminator D1 for distinguishing the first synthesized sample dataset D generated by the first generator G1 gen1 from the finally preprocessed small sample dataset D pre and outputting the evaluation index of the authenticity of the first synthesized sample dataset D gen1 where D1(x
[0125]
[0126] ) represents the discriminant output of the first discriminator D1 for the real sample x i , i represents the synthesized sample generated by the first generator G1 α is the regularization parameter, is the two-norm distance between the weight matrices of the first generator;
[0127] S24. Construct the second discriminator D2 for distinguishing the second synthesized sample dataset D generated by the second generator G2 gen2 from the finally preprocessed small sample dataset D pre , and output the evaluation index of the diversity of the second synthetic sample dataset D gen2 Diversity evaluation index
[0128]
[0129] where D2(x i ) represents the discriminant output of the second discriminator D2 for the real sample x i , represents the synthetic sample generated by the second generator G2 β is a regularization parameter, represents the variance of the generated sample.
[0130] In this embodiment, S3 includes the following sub-steps:
[0131] S31. Initialize the parameters of the first generator G1 and the parameters of the second generator G2 and the parameters of the first discriminator D1 and and and the parameters of the second discriminator D2 and
[0132] S32. Select the learning rate η and the batch size m, and determine the initial number of training rounds T of the generator and the discriminator. Among them, the learning rate η determines the step size of each parameter update, the batch size m affects the number of data samples used in each training, and the number of training rounds T determines the initial training intensity of the entire model;
[0133] S33. Randomly sample a small batch of samples x pre from the small sample dataset D (i) ∈ D pre , and at the same time, draw noise vectors and from the noise distributions and respectively, where i = 1, 2,..., m. The noise vectors and are used as the inputs of the first generator G1 and the second generator G2 respectively to generate corresponding synthetic samples. The distributions of the noise vectors and determine the diversity of the generated samples;
[0134] S34. Calculate the first synthetic data samples of the first generator G1 and the second generator G2 respectively using the drawn noise vectors and and the second synthetic data sample and calculate the loss function through the first discriminator D1 and the second discriminator D2 and
[0135]
[0136] wherein, D1(x (i) ) and D2(x (i) ) respectively represent the discrimination outputs of the first discriminator D1 and the second discriminator D2 on the real sample x (i) ; and represent the discrimination outputs on the generated samples;
[0137] S35. Repeat steps S33 to S34 until the predetermined number of training rounds T is completed, and generate the initially trained generator and discriminator models.
[0138] In this embodiment, S5 includes the following sub-steps:
[0139] S51. Calculate the gradient of the first generator G1 according to the output loss value of the first discriminator D1 :
[0140]
[0141] wherein, represents the weight matrix of the first generator G1, represents the loss value of the i-th sample, is the i-th synthetic sample generated by the first generator G1;
[0142] S52. Update the parameters of the first generator G1 and to optimize the authenticity of the generated samples:
[0143]
[0144] wherein, and are respectively the gradients of the loss function with respect to the weight matrix and the bias vector ;
[0145] S53. Calculate the gradient of the second generator G2 according to the output loss value of the second discriminator D2 :
[0146]
[0147] wherein, Denote the weight matrix of the second generator G2, Denote the loss value of the i-th sample, is the i-th synthetic sample generated by the second generator G2;
[0148] S54. Update the parameters of the second generator G2 and to optimize the diversity of the generated samples:
[0149]
[0150] wherein, and are the gradients of the loss function with respect to the weight matrix and the bias vector respectively;
[0151] S55. Repeat steps S51 to S54 until the samples optimized and generated by the first generator G1 reach a predetermined authenticity standard, and the samples optimized and generated by the second generator G2 reach a predetermined diversity standard, thus completing the parameter back-update process of the bidirectional generative adversarial network.
[0152] In this embodiment, S8 includes the following sub-steps:
[0153] S81. Use the optimized first generator G1 to generate an extended small sample dataset D gen1 , wherein each generated sample is generated by a noise vector :
[0154]
[0155] wherein, denotes the j-th noise vector, is the weight matrix of the optimized first generator, is the j-th extended sample generated, and the extended sample dataset D gen1 is composed of n1 generated samples, that is:
[0156]
[0157] S82. Use the optimized second generator G2 to generate an extended small sample data D gen2 , wherein each generated sample is generated by a noise vector :
[0158]
[0159] wherein, Denote the k-th noise vector, is the weight matrix of the second generator after optimization, and λ is the diversity adjustment parameter. is the k-th generated extended sample, and the extended sample dataset D gen2 consists of n2 generated samples, that is:
[0160]
[0161] S83. Combine the extended sample dataset D gen1 generated by the first generator G1 gen2 with the extended sample dataset D exp generated by the second generator G2
[0162] D exp = D gen1 ∪ D gen2 ;
[0163] where D exp contains all the generated samples and is visually and statistically similar to the original small sample dataset D pre ;
[0164] S84. Verify the visual and statistical characteristics of the generated extended small sample dataset D exp to make the extended small sample dataset visually similar to the original dataset D pre and ensure that the sample distribution of the extended dataset covers a wider sample space through statistical analysis.
[0165] In this embodiment, S9 includes the following sub-steps:
[0166] S91. Score the authenticity of the generated extended small sample dataset D exp by using the first discriminator D1 to discriminate and output for each sample and calculate the overall authenticity score
[0167]
[0168] where n exp represents the total number of samples in the extended dataset D exp and is the l-th extended sample, and S real reflects the overall performance of the generated dataset in terms of authenticity;
[0169] S92. For the generated extended small sample dataset D expPerform diversity scoring, calculate the distribution characteristics of the generated samples using statistical methods, and obtain the overall diversity score
[0170]
[0171] where Var(D exp ) is the variance of the extended dataset, and μ exp represents the mean vector of the extended dataset D exp , which is used to evaluate the diversity of the generated dataset; It is used to evaluate the diversity of the generated dataset;
[0172] S93. Combine the authenticity score and the diversity score to calculate the comprehensive score for dynamically adjusting the parameters of the bidirectional generative adversarial network:
[0173]
[0174] where α1 and β1 are weight coefficients used to balance the influence of authenticity and diversity in the comprehensive score, representing the overall quality of the generated samples;
[0175] S94. According to the result of the comprehensive score , dynamically adjust the parameters of the first generator G1 and the second generator G2 and
[0176] S95. Repeat steps S91 to S94 until the comprehensive score reaches the predetermined standard, thereby completing the optimization and adjustment of the parameters of the generative adversarial network and ensuring that the generated small sample dataset meets the requirements in terms of authenticity and diversity.
[0177] Example 1:
[0178] To verify the feasibility and effectiveness of the present invention, verification was carried out in Example 1. During the period from June 2023 to August 2023, the medical imaging center of a large hospital carried out a study on the CT image diagnosis of early lung cancer. The purpose of the study was to improve the accuracy of early lung cancer detection. However, due to the scarcity of early lung cancer cases, the medical imaging center only collected CT image data of 120 confirmed patients. The image data of each patient included 12 slice images, and the final formed initial dataset totaled 1440 labeled images. Due to the limited sample size, the training effect of the deep learning model on the dataset was not ideal, and there was an obvious overfitting phenomenon. To improve the generalization ability of the model, the medical imaging center decided to adopt the data synthesis method based on the bidirectional generative adversarial network of the present invention to expand the existing small sample dataset.
[0179] The research team first preprocessed the initial small - sample data set, including data cleaning, noise filtering, and normalization, to obtain the processed data set. Subsequently, the team carried out data synthesis work using the method of the present invention on the high - performance computing server of the hospital. On July 15, 2023, the team officially started the training process of the bidirectional generative adversarial network. The initial parameters required for training were set according to the characteristics of the processed data set. The initial learning rate was set to 0.0002, and the batch size was set to 64.
[0180] During the training process, the system first generated synthetic samples similar to the original CT images through the first generator. After the end of the first training stage, that is, on July 20, 2023, the team conducted a preliminary evaluation of the 1000 generated synthetic images. The evaluation found that approximately 85% of the generated images were highly similar to the original images visually, but 15% of the images had distortions in details, especially at the image edges. For this reason, the research team fine - tuned the network parameters on July 21, 2023, especially focusing on adjusting the weights of the discriminator to optimize its discriminative ability for detail features.
[0181] Subsequently, the team generated synthetic samples slightly different from the original images through the second generator to improve the diversity of the data set. By July 25, 2023, the system generated 1200 diverse synthetic images. To ensure the quality of these images, the team introduced an automated evaluation mechanism to score the authenticity and diversity of the generated samples. The scoring results showed that 80% of the images had a significant improvement in diversity but a slight decrease in authenticity. For further optimization, the team adjusted the weight parameters of the generator again and reduced the learning rate to balance the diversity and authenticity of the images.
[0182] On August 1, 2023, after multiple rounds of iterative training, a total of 6000 high - quality synthetic CT images were finally generated. The synthetic CT images were highly similar to the original images visually and covered more sample variations in statistical characteristics. The team randomly selected 300 of these images for comparison with the original images and found that 92% of the generated images were almost indistinguishable from the real images visually, and only 8% of the images had slight differences in some details. Through blind - test scoring by experts, the average score of the generated images was 8.8 / 10. Compared with the score of the original images, which was 9.2 / 10, the gap was small and did not affect the accuracy of medical diagnosis.
[0183] To verify the effectiveness of the extended dataset, the research team compared the training of 6,000 extended datasets with only 1,440 original datasets. The experiment was conducted in the computer laboratory of the hospital from August 10, 2023, to August 15, 2023. A convolutional neural network model was used for training in the experiment. The data comparison results are shown in Table 1 below:
[0184] Table 1 Comparison data of experimental results
[0185]
[0186] From the comparison data, it can be seen that the extended dataset generated by using the method of the present invention significantly improves the accuracy of the validation set of the model. The accuracy rate has increased from 83.6% to 91.3%, and the loss value has decreased from 0.42 to 0.28, indicating that the performance of the model on the extended dataset is more stable. More importantly, the convergence time of the model has been shortened from 5.2 hours to 3.7 hours, showing that the extended dataset not only improves the accuracy of the model but also accelerates the training process. In addition, the degree of overfitting of the model has been significantly reduced, indicating that the generalization ability of the model has been enhanced through the extended dataset.
[0187] During the experiment, the research team also found that the extended dataset generated by using the method of the present invention can cover more early lung cancer feature regions. Through comparative analysis, among the 6,000 generated images, about 18% of the images contain micro-nodule features that were not labeled in the original dataset, which is of great medical significance and can significantly improve the diagnosis rate of early lung cancer. The expert group further verified these features and confirmed that the generated images are not only highly realistic visually but also can capture more potential lesion information, which provides great help for subsequent clinical applications.
[0188] In summary, the method of the present invention demonstrates excellent application effects in the field of medical image processing. By generating high-quality and diverse synthetic datasets, it successfully solves the problems of insufficient diversity and poor authenticity in the expansion of small-sample datasets, provides a solid data foundation for model training, significantly improves the generalization ability and diagnostic accuracy of the model, and has important significance in actual clinical applications. It can help doctors detect early lung cancer lesions earlier and more accurately, thereby improving the cure rate of patients.
[0189] The small-sample data synthesis method based on the bidirectional generative adversarial network of the present invention has achieved significant technological breakthroughs in the expansion of small-sample data sets through the design of dual generators and dual discriminators. By constructing the first generator and the second generator, this method can simultaneously generate synthetic sample data sets that are similar to and slightly different from the original small-sample data set. The dual-generator architecture effectively solves the contradiction between diversity and authenticity in traditional bidirectional generative adversarial networks. By separately optimizing the outputs of the two generators, the best balance point is found between the diversity and authenticity of the generated samples, enabling the expanded data set to be visually similar to the original data set while having higher diversity.
[0190] The dual-discriminator mechanism proposed by the present invention greatly improves the quality of the generated samples. The first discriminator focuses on evaluating the authenticity of the generated samples to ensure that the generated samples are consistent with the real samples in statistical characteristics. The second discriminator is used to evaluate the diversity of the generated samples. Through the bidirectional evaluation mechanism, the generator can more accurately optimize the data distribution of the generated samples, effectively avoiding the problem of mode collapse. The generated samples not only cover the main features of the original samples but also contain rich variation information, thus enhancing the generalization ability of model training.
[0191] The present invention introduces an automated evaluation mechanism during the generation process. By scoring the authenticity and diversity of the generated samples, the parameters of the generator and discriminator are dynamically adjusted, enabling the bidirectional generative adversarial network to have an adaptive adjustment ability during the training process, making the generated samples more in line with the expected quality requirements. The introduction of the comprehensive score not only significantly improves the overall quality of the generated samples but also provides an effective feedback signal for the training process of the bidirectional generative adversarial network, avoiding the problem of unstable generation effects caused by the lack of an evaluation mechanism in traditional methods.
[0192] The present invention also realizes the continuous optimization of the quality of the generated samples by dynamically adjusting the weight matrix and bias vector of the generator. During the training process, it can adaptively adjust the network parameters according to the real-time performance of the generated samples to ensure the best balance between the diversity and authenticity of the generated samples.
[0193] The above is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, making equivalent substitutions or changes, should be covered by the protection scope of the present invention.
Claims
1. A small-sample data synthesis method based on a bidirectional generative adversarial network, characterized in that It includes the following steps: S1. Obtain a small sample dataset, which is an image dataset, and preprocess the small sample dataset; S2. Construct a bidirectional generative adversarial network with dual generators and dual discriminators; The first generator is used to generate a first synthetic sample dataset similar to the original image dataset; The second generator is used to generate a second synthetic sample dataset different from the original image dataset; The first discriminator is used to distinguish the first synthetic sample dataset generated by the first generator from the real small sample dataset and evaluate the authenticity of the first synthetic sample dataset; The second discriminator is used to distinguish the small sample dataset generated by the second generator from the real small sample dataset and evaluate the diversity of the second synthetic sample dataset; S3. Initialize the parameters of the first generator, the second generator, the first discriminator, and the second discriminator, and perform preliminary training; S4. Generate an initial synthetic sample dataset through the first generator and the second generator, and respectively input the sample datasets into the first discriminator and the second discriminator for discrimination. The first discriminator evaluates the authenticity of the samples generated by the first generator, and the second discriminator evaluates the diversity of the samples generated by the second generator; S5. According to the loss values output by the first discriminator and the second discriminator, respectively update the parameters of the first generator and the second generator in the reverse direction; S6. Repeat S4 and S5, and continuously optimize the quality of the synthetic sample dataset during the alternating training of the first generator and the second generator until the synthetic sample dataset meets the predetermined requirements in terms of authenticity and diversity; S7. Optimize the inputs of the first generator and the second generator through an adaptive noise introduction mechanism and a data augmentation module; S8. Generate an extended small sample dataset, which is generated by the first generator and the second generator and is visually and statistically similar to the original small sample dataset; S9. Score the authenticity and diversity of the generated small sample dataset through an automated evaluation mechanism, and dynamically adjust the parameters of the bidirectional generative adversarial network according to the evaluation results.
2. The small-sample data synthesis method based on a bidirectional generative adversarial network according to claim 1, wherein The S1 includes the following sub-steps: S11. Obtain an initial small sample dataset , the initial small sample dataset contains n samples, and each sample belongs to the data space X, that is , where represents the i-th data sample; S12. For the initial small sample data set perform data cleaning to remove incomplete or abnormal data points and generate a cleaned small sample data set , where , the cleaning operation is expressed as: ; S13. Normalize the cleaned small sample dataset and map all sample data to the standard range [a, b] to obtain the normalized small sample dataset ; S14. For the normalized small-sample dataset perform noise filtering to remove or suppress the random noise components in the small-sample dataset, generating the finally preprocessed small-sample dataset : 。 3. A small-sample data synthesis method based on a bidirectional generative adversarial network according to claim 1, characterized in that The S2 includes the following sub-steps: S21. Construct the first generator to generate a first synthetic sample dataset similar to the finally preprocessed small sample dataset , where the first generator generates sample data by inputting a noise vector and generates the first synthetic data sample in combination with the feature distribution in the latent space : ; Among them, and are the weight matrices of the first generator respectively, and are the bias vectors of the first generator respectively, is the activation function, is the adjustable parameter in the first generator, represents the noise vector, represents the generated first synthetic sample data; S22. Construct the second generator , which is used to generate a second synthetic sample dataset different from the finally preprocessed small sample dataset , where the second generator generates sample data by inputting a noise vector and fine-tunes by combining a diversity adjustment parameter during the generation process: ; Among them, and are the weight matrices of the second generator respectively, and are bias vectors, is the diversity adjustment parameter, represents the noise vector, represents the generated second synthetic sample data; S23. Construct the first discriminator to distinguish the first generated synthetic sample dataset generated by the first generator from the finally preprocessed small sample dataset and output the evaluation metrics for the authenticity of the first generated synthetic sample dataset : ; Among them, represents the first discriminator 's discrimination output for real samples . represents the synthetic samples generated by the first generator . is the regularization parameter, is the second norm distance between the weight matrices of the first generator; S24. Construct a second discriminator to distinguish the second generated dataset generated by the second generator from the finally preprocessed small-sample dataset , and output an evaluation metric on the diversity of the second generated dataset : ; Among them, represents the second discriminator for the discriminant output of the real sample , represents the synthetic sample generated by the second generator , , is the regularization parameter, represents the variance of the generated sample.
4. A small-sample data synthesis method based on a bidirectional generative adversarial network according to claim 1, wherein The S3 includes the following sub-steps: S31. Initialize the parameters of the first generator and and the parameters of the second generator and and the parameters of the first discriminator and and as well as the parameters of the second discriminator and and ; S32. Select the learning rate and the batch size m, and determine the initial number of training epochs T for the generator and the discriminator. Among them, the learning rate determines the step size of each parameter update, the batch size m affects the number of data samples used in each training, and the number of training epochs T determines the initial training intensity of the entire model; S33, by random sampling from a small sample data set Draw small batches of samples , while from the noise distribution and Extract the noise vectors and ,in , the noise vector and As the first generator and the second generator The input is used to generate the corresponding synthetic samples, the distribution of the noise vector and Determine the diversity of generated samples; S34. Utilize the extracted noise vectors and to calculate the first synthetic data sample of the first generator and the second synthetic data sample of the second generator , and calculate the loss functions and through the first discriminator and the second discriminator : ; ; Among them, and respectively represent the discrimination outputs of the first discriminator and the second discriminator for real samples , and and represent the discrimination outputs for generated samples; S35. Repeat steps S33 to S34 until the predetermined number of training rounds T is completed, and generate the generator and discriminator models after preliminary training.
5. A small-sample data synthesis method based on a bidirectional generative adversarial network according to claim 1, characterized in that The S5 includes the following sub-steps: S51. Calculate the gradient of the first generator based on the output loss value of the first discriminator : ; Among them, represents the weight matrix of the first generator , represents the loss value of the i-th sample is the first generator The i-th synthetic sample generated; S52. Update the parameters of the first generator to optimize the authenticity of the generated samples: and ; wherein, and are the gradients of the loss function with respect to the weight matrix and the bias vector respectively; S53. Calculate the gradient of the second generator according to the output loss value of the second discriminator . ; Among them, represents the weight matrix of the second generator , represents the loss value of the i-th sample is the second generator generates the i-th synthetic sample; S54. Update the parameters of the second generator to optimize the diversity of the generated samples: and ; Among them, and are the gradients of the loss function with respect to the weight matrix and the bias vector respectively; S55. Repeat steps S51 to S54 until the first generator Optimize the generated samples to meet a predetermined authenticity standard, and the second generator Optimize the generated samples to meet a predetermined diversity standard, and complete the parameter back-update process of the bidirectional generative adversarial network.
6. A small-sample data synthesis method based on a bidirectional generative adversarial network according to claim 1, wherein The S8 includes the following sub-steps: S81. Utilize the first optimized generator to generate an extended small-sample dataset , where each generated sample is generated from a noise vector : ; Among them, represents the j-th noise vector, is the weight matrix of the first optimized generator, is the j-th generated extended sample, and the extended sample dataset is composed of generated samples, that is: ; S82. Utilize an optimized second generator to generate extended small-sample data , where each generated sample is generated from a noise vector : ; Among them, represents the k-th noise vector, is the weight matrix of the second generator after optimization, is the diversity adjustment parameter, is the k-th generated extended sample, and the extended sample dataset is composed of generated samples, that is ; S83. Combine the extended sample data set generated by the first generator with the extended sample data set generated by the second generator to generate a final extended small sample data set : : ; Among them, includes all the generated samples and is visually and statistically similar to the original small sample dataset similar; S84. Verify the visual and statistical characteristics of the generated extended small-sample dataset so that the extended small-sample dataset is visually similar to the original dataset 7. A small-sample data synthesis method based on a bidirectional generative adversarial network according to claim 1, characterized in that The S9 includes the following sub-steps: S91. Score the authenticity of the generated extended small sample dataset using the first discriminator to make a discrimination output for each sample and calculate the overall authenticity score : ; Among them, represents the total number of samples in the extended data set, is the l-th extended sample, reflecting the overall performance of the generated data set in terms of authenticity; S92. Score the diversity of the generated extended small-sample dataset Calculate the distribution characteristics of the generated samples using statistical methods to obtain the overall diversity score : ; Among them, is the variance of the extended dataset, represents the mean vector of the extended dataset and is used to evaluate the diversity of the generated dataset. S93. Calculate a comprehensive score by combining the authenticity score and the diversity score for dynamically adjusting the parameters of the bidirectional generative adversarial network: ; Among them, and are weight coefficients used to balance the influence of authenticity and diversity in the comprehensive score, represents the overall quality of the generated samples; S94. Dynamically adjust the parameters of the first generator and the second generator according to the result of the comprehensive score ; and ; S95. Repeat steps S91 to S94 until the comprehensive score reaches the predetermined standard, thus completing the optimization and adjustment of the parameters of the generative adversarial network.
Citation Information
Patent Citations
Image generation method and device, computing equipment and storage medium
CN116664972A
Fuzzy test data generation method based on GAN
CN118013533A