A small sample image generation method
By introducing a generative adversarial network with dynamic hybrid Gaussian implicit coding and hybrid attention mechanism, the problems of insufficient diversity and realism in the generation of few-sample images are solved. The generated images are more reasonable in terms of local content and global layout, and are suitable for tasks such as data augmentation, classification and segmentation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-09
- Publication Date
- 2026-04-07
AI Technical Summary
Existing methods for generating few-sample images are insufficient in terms of generation diversity and realism, and are prone to overfitting, especially when the amount of data is limited, their performance degrades.
Dynamic mixture Gaussian hidden encoding is introduced as the input to the generative model, and a hybrid attention mechanism is combined to enhance intermediate features during the generation process. The model parameters are updated through the training optimization function of the generative adversarial network.
It improves the diversity and realism of generated images in small sample scenarios, alleviates the overfitting problem, and the generated images are more reasonable in terms of local content and global layout, making them suitable for tasks such as data augmentation, classification, and segmentation.
Smart Images

Figure CN115690487B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and mainly relates to the problem of image generation in small sample scenarios; it is mainly applied to image editing, generation, and augmentation. Background Technology
[0002] With the continuous development of deep learning, it has made significant progress in the field of computer vision and has been applied to various fields. Among them, deep image generation models, which utilize deep networks to learn and understand the content and distribution of images and generate realistic images similar to real images, are a hot topic in computer vision. Deep image generation models are the foundation for tasks such as image restoration, editing, and super-resolution, and can be applied to various fields such as film and television media and creative design. However, training deep image generation models usually requires a large amount of data and computational cost, which greatly limits the application of generative models in fields with only a small number of images, such as medical images and paintings by celebrities. Applying generative models to small sample scenarios is a very meaningful direction for both application and research. It can not only expand the data in small sample scenarios by generating data, but also use the generated data to assist in small sample classification, segmentation, and other problems.
[0003] When trained on a small number of images, generative models often overfit and simply memorize the training data, failing to produce realistic and diverse images. To improve the realism and diversity of generated images in small-sample scenarios, researchers have proposed various methods to mitigate the overfitting problem. One direct approach is to utilize transfer learning. Assuming the existence of a source domain similar to the small-sample data and possessing a large amount of data, the model first pre-trains on the source domain and then transfers the knowledge from the source domain to the small-sample target domain to improve the diversity and realism of the generated images. However, this type of method has two problems: first, pre-training the source domain still requires significant computational and data acquisition costs; second, when there is a certain deviation between the source domain and the small-sample target domain, it can actually reduce the performance of the small-sample target domain.
[0004] Another type of few-shot generation method uses data augmentation techniques to expand the data by flipping, translating, etc., the small sample data, increasing the training data available to the model. This type of method also has two problems: First, flipping and translating the original image may change the distribution of the original data, thus misleading the generation model to produce unreasonable generated images; second, the augmentation of samples is essentially still processing the same batch of data and does not change the internal structure, so the model is still prone to overfitting. Summary of the Invention
[0005] Unlike existing few-shot image generation methods, this invention starts from data priors and the essence of data. Based on the assumption that more complex prior information can provide the model with more editable attributes, it designs Gaussian dynamic mixture latent space coding as the input signal for the generative model, providing more diverse Gaussian mixture latent coding to the model. Simultaneously, to further ensure the diversity and realism of the generated images, this invention designs a hybrid attention enhancement module that performs content and layout enhancements on intermediate features during the generation process, ensuring the rationality and integrity of local content and global layout. By integrating these two modules, this invention constructs a few-shot image generation method, achieving excellent results on few-shot data from different fields, including comic book style and real photographs.
[0006] The purpose of this invention is to provide a method for generating few-sample images, thereby improving the fidelity and richness of generated images in few-sample scenarios.
[0007] This invention is a few-shot image generation method that introduces dynamic mixture Gaussian implicit coding to provide the generation model with more variable and editable attributes, addressing the lack of diversity in existing few-shot generation methods. Furthermore, to further enhance the realism of the generated images, this invention proposes a hybrid attention mechanism to enhance the global layout and local content of intermediate features during the generation process, effectively preserving key information from these intermediate features. By integrating these methods, this invention effectively improves the diversity and realism of few-shot image generation, alleviating problems such as model training instability and overfitting in few-shot scenarios.
[0008] To facilitate the description of the invention, some commonly used terms are defined first.
[0009] Definition 1: Generative Adversarial Networks (GANs): GANs are the most commonly used and widely applied deep generative models. The generative system of this invention is built using GANs as the base network. A GAN typically consists of a generator network (G) and a discriminator network (D). The generator network G maps latent codes sampled from a specific distribution to generated images. The generated images and real images are fed into the discriminator network D, which learns to distinguish between the generated and real images. The training objective function of the GAN is:
[0010]
[0011] In the above formula, I realLet G(z) represent the distribution of real data, G(z) represent the generated data, and log() represent the logarithmic loss. D and G represent the discriminator network and the generator network, respectively. The discriminator network maximizes the classification loss between the generated and real data, while the generator network minimizes the classification loss of the discriminator network on the generated data. They interact and eventually reach an equilibrium state. At this equilibrium, the generator network has the ability to generate sufficiently realistic images, while the discriminator network cannot distinguish between real and generated images.
[0012] Definition 2: Latent Code: The latent code is the input to the generator network G, typically a fixed-length vector, denoted by z, randomly sampled from a specific distribution (such as Gaussian or uniform distribution). The generator network D learns to map the latent code z to the generated image.
[0013] Definition 3: Attention Mechanism: Inspired by the human visual attention mechanism, the attention mechanism learns the content in an image that should receive more attention and increases the weight of the corresponding content.
[0014] Definition 4: Gaussian Mixture Distribution: A Gaussian Mixture Distribution represents a distribution composed of N Gaussian distributions. In order to provide more editable and variable properties to the generative network of this invention, this invention randomly samples the implicit code from the Gaussian Mixture Distribution as the input of the generative network, instead of sampling the implicit code from a single Gaussian distribution as the input of the generative network as in existing methods.
[0015]
[0016] In the formula above, Let μ be the weight of the i-th Gaussian distribution. i ,∑ i Let ) represent the mean and variance of the i-th Gaussian distribution, respectively, and z represent the mixture Gaussian distribution.
[0017] Definition 5: Reparameterization Trick: Since sampling the hidden code from N Gaussian distributions would cause the neural network to become non-differentiable, this invention performs reparameterization processing on the Gaussian mixture distribution. First, δ is sampled from one of the Gaussian distributions, and then flattened and reparameterized to obtain z.
[0018] z = u i +σ i δ
[0019] In the formula above, u i and σ iHere, δ is a learnable parameter of the network, which is obtained by random sampling from a Gaussian distribution with a mean of 0 and a variance of 1, i.e., δ∈N(0,1).
[0020] To provide the generative network with more variable and editable properties, this invention further introduces a dynamic adjustment factor λ, which can dynamically adjust the Gaussian components of the hidden code:
[0021] z=λu i +(1-λ)σ i δ
[0022] In the formula above, λ is the dynamic control factor, and u i and σ i Here, δ represents the learnable parameters of the network, obtained by random sampling from a Gaussian distribution with mean 0 and variance 1, i.e., δ∈N(0,1). z represents the obtained dynamic Gaussian mixture latent code.
[0023] Definition 6: Sigmoid activation function: An activation function that transforms the model's input through a non-linear transformation to obtain a new output. Its formal definition is:
[0024]
[0025] In the formula above, e represents the natural exponent, z is the input to the activation function, and g(z) is the Sigmoid activation function.
[0026] Definition 7: Convolution: Convolution is a technique for processing images based on the spatial dependencies of input image pixels.
[0027] Definition 8: Pooling: Pooling reduces the dimensionality of the input feature map according to certain rules, including max pooling and average pooling.
[0028] The present invention discloses a few-sample image generation method, characterized in that the few-sample image generation method includes:
[0029] The dynamic Gaussian mixture latent code is obtained by random sampling from the dynamic Gaussian mixture distribution, wherein the dynamic Gaussian mixture distribution is a Gaussian mixture distribution with a dynamic adjustment factor introduced;
[0030] The dynamic Gaussian mixture latent code is input into the generator network, and the intermediate features of the generator network are enhanced by the hybrid attention mechanism. The intermediate features are obtained by the generator network mapping the dynamic Gaussian mixture latent code. The enhanced intermediate features are input into the generator network to obtain a set of generated images.
[0031] The generated image set and the real image set are input into the discrimination network to obtain the image discrimination results for the generated image set and the real image set;
[0032] Based on the image discrimination result and the objective optimization functions of the generator network and the discriminator network, the generator network and the discriminator network are updated to obtain the updated generator network and the discriminator network.
[0033] The present invention provides a method for generating small sample images, which helps to solve the problems of overfitting and model collapse caused by limited data in small sample scenarios, and improves the realism and diversity of generated images.
[0034] The method for generating small sample images according to the present invention is characterized in that the dynamic Gaussian mixture distribution conforms to the following correspondence:
[0035] z=λu i +(1-λ)σ i δ
[0036] Where z is the dynamic Gaussian mixture distribution, λ is a dynamic adjustment factor that can adjust the Gaussian distribution component in the dynamic Gaussian mixture latent coding, and u i and σ i Here, δ is a learnable parameter of the network, which is obtained by random sampling from a Gaussian distribution with a mean of 0 and a variance of 1, i.e., δ∈N(0,1).
[0037] The present invention discloses a few-sample image generation method, characterized in that the hybrid attention mechanism includes a spatial attention mechanism and a channel attention mechanism. The hybrid attention mechanism enhances the intermediate features of the generator network, which are obtained by the generator network through dynamic Gaussian mixture latent coding, including global layout and local content information of the generated image. Using the hybrid attention enhancement helps improve the realism of the generated image.
[0038] The present invention discloses a few-sample image generation method, characterized in that the spatial attention mechanism focuses on which part of the features is most important and enhances that part. The spatial attention mechanism first uses pooling operations to aggregate channel information, obtaining two 2D feature maps: and These represent the feature maps obtained after applying average pooling and max pooling, respectively. Next, the two feature maps are concatenated and subjected to a convolution operation to obtain the feature map for the spatial attention mechanism. The spatial attention mechanism is formally described as follows:
[0039]
[0040] Where σ represents the Sigmoid activation function, AvgPool and MaxPool represent the average pooling and max pooling respectively, and f 7×7 This represents a convolution operation with a 7×7 kernel. F represents the feature map. and The feature map is obtained after the average pooling and the max pooling. The spatial attention focuses on global layout information, and enhancing the global layout information is beneficial to the overall rationality and realism of the generated image.
[0041] The present invention provides a few-sample image generation method, characterized in that the channel attention mechanism focuses on what content in the feature map is worth paying attention to. To calculate the feature map of the channel attention, average pooling and max pooling are first used to compress the spatial information, resulting in two 2D feature maps: and Then, a network is used to generate the feature map M of the channel attention. c ∈R c×1×1 This network is a multilayer perceptron with one hidden layer. The channel attention mechanism is formally described as follows:
[0042]
[0043] Where σ represents the Sigmoid activation function, W1 and W0 are shared parameters, AvgPool and MaxPool represent the average pooling and the max pooling, respectively, and MLP is a multilayer perceptron. and The feature map is obtained after applying the average pooling and max pooling methods. The channel attention focuses on local content information; enhancing local content information contributes to the local realism and detail fidelity of the generated image.
[0044] The present invention discloses a few-sample image generation method, characterized in that the parameters of the generation network and the discriminator network are updated according to the objective optimization function of the generation network and the discriminator network based on the image discrimination result. This includes:
[0045] The image discrimination result is fed into the objective optimization function of the discrimination network to update the parameters of the discrimination network, wherein the objective optimization function of the discrimination network conforms to the following correspondence:
[0046]
[0047] Where E represents expectation, I realLet z be the set of real images, G(z) be the dynamic Gaussian mixture distribution, D(x) be the set of generated images, and min() denote minimization. recons The reconstruction loss helps improve the discriminant network's ability to extract features, thereby enhancing the discriminant network's discrimination ability.
[0048] The image discrimination result is fed into the objective optimization function of the generator network to update the parameters of the generator network, wherein the objective optimization function of the generator network conforms to the following correspondence:
[0049] L G =-E x~G(z) [D(x)]
[0050] Where E represents the expectation, z is the dynamic Gaussian mixture distribution, x~G(z) is the generated image set, and D(x) is the image discrimination result.
[0051] The present invention discloses a few-sample image generation method, characterized in that, after updating the parameters of the generator network and the discriminator network according to the objective optimization function of the generator network and the discriminator network, the method further includes: using the updated generator network to discriminate the network, wherein the updated generator network is used to generate image data for at least one of data augmentation, classification, and segmentation.
[0052] The present invention discloses a method for generating small sample images, characterized in that it includes a generator and a discriminator, wherein the generator is coupled to the generation network, the discriminator is coupled to the discrimination network, and the generation method is used to execute the programs of the generator and the discriminator.
[0053] The beneficial effects of this invention are as follows: The few-sample image generation method designed in this invention uses the dynamic mixture Gaussian implicit coding as input, providing the generation network with more editable and variable attributes, thus improving the diversity of generated samples; the hybrid attention mechanism is used to enhance the local content and global layout of intermediate features during the generation process, improving the realism of the generated samples. The fusion of these two methods alleviates the overfitting problem of the generation model, enabling the generation of sufficiently realistic and diverse images even in few-sample scenarios. This invention is not limited to a specific generation model and can be adaptively nested into other models to help improve the diversity and realism of generated samples, avoiding problems such as pattern collapse that often occur in generation models. The generated images can also be used in image classification, segmentation, and other fields. Attached Figure Description
[0054] Figure 1 This is an overall training flowchart provided by an embodiment of the present invention.
[0055] Figure 2 This is an overall framework diagram provided in the embodiments of the present invention.
[0056] Figure 3 This is a diagram of the hybrid attention mechanism provided in an embodiment of the present invention.
[0057] Figure 4 This is a generated effect diagram of an artistic landscape painting and a dataset of real animal photos provided in an embodiment of the present invention.
[0058] Figure 5 This is a diagram showing the generation effect of anime face and real face photo datasets provided in an embodiment of the present invention. Detailed Implementation
[0059] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. To clarify the implementation process, practical details will also be provided in detail. However, these practical details do not limit the present invention to the scope of the described embodiments.
[0060] This invention is a few-sample image generation method that utilizes dynamic Gaussian mixture latent coding as input to a generator network, providing it with richer prior information and more editable attribute information. The generator network maps the latent coding to generated images. During the generation of intermediate images, the intermediate feature representations contain local content and global layout information of the final generated image. A hybrid attention mechanism is used to enhance the content and layout information of the intermediate representations, ultimately generating the final image. The generated image and the real image are input into a discriminative model, which needs to distinguish whether a given image is generated or real. The generator network and the discriminative network are updated using a discriminative loss. The generator network learns to generate images that are as close as possible to the real distribution, while the discriminative network tries to distinguish between real and generated images. The two networks interact and improve through continuous training, eventually reaching an equilibrium state.
[0061] This invention, based on the aforementioned generative and discriminative networks, learns to generate realistic and diverse images on a small sample image dataset. The training process is described below. Figure 1 See the overall framework. Figure 2 .
[0062] The specific execution process of this invention is as follows:
[0063] Step 1: Parameter Initialization
[0064] Initialize the training image size D, training set P, batch size, number of training iterations T, and randomly initialize the generator network G and the discriminator network D.
[0065] Step 2: Sample dynamic Gaussian mixture latent coding and dataset samples
[0066] Randomly sample m hidden codes {z1,…,z2} from a dynamic Gaussian mixture distribution. m}, randomly sample m original training images {I1,…,I} from the training set P. m The dynamic Gaussian mixture distribution is:
[0067] z=λu i +(1-λ)σ i δ,δ∈N(0,1)
[0068] Where λ is a dynamic adjustment factor that can dynamically adjust the Gaussian distribution component in the hybrid implicit coding, and δ is a vector randomly sampled from a Gaussian distribution with a mean of 0 and a variance of 1.
[0069] Step 3: Preprocess the m original images by horizontally flipping, randomly cropping, and standardizing them, and represent the data as tensors;
[0070] Step 4: Input the hidden code into the generator network. During the intermediate generation process, remove the intermediate feature representations and use a hybrid attention mechanism to enhance the content and layout of the intermediate feature representations. The enhanced feature representations are then used in the generator network to obtain m generated images, which are processed into the same format as the training images: {G(z1),…,G(z2)}. m )};
[0071] The hybrid attention mechanism described in step 4 includes spatial attention and channel attention, focusing on both local content and overall layout information of the feature map. The process is as follows: Figure 3 As shown.
[0072] Step 5: Generate m images {G(z1),…,G(z2)} m )} and m real images {I1,…,I m The data is input into the discriminator network, where real images are labeled "real" and generated images are labeled "fake," and the discriminator network makes the distinction.
[0073] Step 6: Train the discriminant network
[0074] The discrimination probability of the discriminant network is improved by minimizing the objective loss function. Gradient descent is used for backpropagation on the loss function of the discriminant network to update the parameters of the discriminant network.
[0075] The loss function of the discriminant network is defined as:
[0076]
[0077] Where E represents expectation, I realLet z be the real training sample, G(z) be the dynamic Gaussian mixture distribution, min() be the generated sample, D(x) be the image discrimination result, and L be the real training sample. recons To reconstruct the loss, the reconstruction loss helps improve the discriminative network's ability to extract features, thereby enhancing its discriminative power.
[0078] Step 7: Train the generative network
[0079] The generator network continuously generates images under the guidance of the discriminator network. The generated images need to be as similar as possible to the real images to confuse the discriminator network. By minimizing the target loss function of the generator network, the probability of misclassification by the discriminator network is increased. Gradient descent is used to backpropagate the generator network and update its parameters.
[0080] The loss function of a generator network is defined as:
[0081] L G =-E x~G(z) [D(G(z))]
[0082] Where E represents the expectation, z is the dynamic Gaussian mixture distribution, x~G(z) is the generated image set, and D(x) is the image discrimination result.
[0083] Step 8: Check the number of iterations. The total number of iterations in this invention is set to 50,000. Steps 2-7 are executed repeatedly until the termination condition is met. The model parameters are saved once every 10,000 iterations, resulting in 5 models. The saved models can be used to read the network parameters and generate images for visualization and quantitative comparison. The generated images can also be used for data augmentation to help improve tasks such as classification and segmentation.
[0084] Experimental Design
[0085] Experimental Dataset
[0086] The experimental dataset was selected from small sample image datasets of different styles, including animation, painting, faces, and landscapes. The datasets included different resolutions of 256*256*3, 512*512*3, and 1024*1024*3, and each dataset contained no more than 1,000 images. The data was extremely limited, and a detailed description of the data is shown in Table 1. This presented a significant challenge, but also had strong application and research value.
[0087] Table 1. Introduction to the Experimental Dataset
[0088]
[0089] Comparison Algorithm
[0090] This invention targets image generation in scenarios with limited samples, and compares the algorithms with the current best methods for such scenarios, including StyleGAN2, DiffAug, ADA, and FastGAN.
[0091] Evaluation indicators
[0092] The commonly used metric for evaluating the realism and diversity of generated images is FID (Fixed Distributed Identification). FID calculates the distance between real and generated images. Following common settings, real training images are selected as reference images, 5000 images are generated, and the distribution distance between the two is calculated. The smaller the value, the closer the generated image is to the real image, meaning better performance.
[0093] The formula for calculating FID is:
[0094] FID = ||μ r -μ g || 2 +Tr(∑ r +∑ g -2(∑ r ∑ g ) 1 / 2 )
[0095] Where μ r and μ g ∑ represents the feature mean of the real image and the generated image, respectively. r and ∑ g Let ||·|| represent the covariance matrices of the real image and the generated image, respectively, and Tr denote the trace. 2 This represents the L2 norm.
[0096] Experimental results
[0097] Table 2. Experimental results of the present invention and the comparative method on the 256*256*3 dataset.
[0098]
[0099]
[0100] Table 3. Experimental results of the present invention and the comparative method on the 512*512*3 dataset.
[0101] Datasets AnimeFace ArtPainting Moongate Flat Fauvism StyleGAN2 152.73 74.56 288.25 285.61 181.91 DiffAug 135.85 49.25 136.12 310.14 223.58 ADA 59.67 46.38 149.06 248.46 201.99 FastGAN 59.38 45.08 122.29 240.24 182.14 Ours 53.36 44.50 112.14 200.99 176.43
[0102] Table 4. Experimental results of the present invention and the comparison method on the 1024*1024*3 dataset.
[0103] Datasets Pokemon Skulls Shells FFHQ Flowers StyleGAN2 190.23 127.98 241.37 - 45.23 DiffAug 62.73 124.23 151.94 48.88 37.09 ADA 66.41 97.05 136.52 40.63 27.36 FastGAN 57.19 130.05 155.47 47.78 25.66 Ours 47.04 99.02 134.20 44.01 24.06
[0104] Tables 2, 3, and 4 present the experimental results of the method of the present invention and the comparative method on datasets of different resolutions. It can be seen that, in scenarios with limited sample size, the present invention can generate images with higher realism and diversity, proving the effectiveness and superiority of the present invention as a small sample image generator.
[0105] Visualization Analysis
[0106] To better investigate the diversity and realism of the generated effects of this invention on small sample image datasets, visualization results were generated and organized for different resolutions. See [link / reference]. Figure 4 and Figure 5 As can be seen from the visualization, the images generated by this invention are quite close to real images, achieving good results on datasets of different resolutions. The images generated by this invention are quite reasonable in terms of local content and global layout.
[0107] In summary, the few-sample image generation method proposed in this invention can significantly improve the diversity and realism of generated images in few-sample scenarios. Quantitative and qualitative results verify the effectiveness and practicality of the system. Furthermore, the images generated by this invention can be used for a wide range of tasks in data-limited scenarios, including data augmentation, classification, and segmentation. Moreover, this invention provides a reference for other related problems in the field; its principles and ideas can be extended to other relevant application scenarios, offering valuable reference and guidance, and providing a very broad application prospect.
[0108] The above descriptions are specific embodiments of the present invention and do not limit the invention to the described examples. For those skilled in the art, the present invention can be adapted to various different models and can be adjusted and modified according to specific tasks. Any modifications, substitutions, and improvements made within the scope of the principles of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for generating few-sample images, characterized in that, The small sample image generation method includes: Dynamic Gaussian mixture latent codes are obtained by randomly sampling from a dynamic Gaussian mixture distribution. The dynamic Gaussian mixture distribution conforms to the following correspondence: z=λu i +(1-λ)σ i d Where z is the dynamic Gaussian mixture distribution, λ is a dynamic adjustment factor that can adjust the Gaussian distribution component in the implicit coding of the dynamic Gaussian mixture distribution, and u i and σ i Here, δ represents the learnable parameters of the network, and δ is a vector randomly sampled from a Gaussian distribution with a mean of 0 and a variance of 1, i.e., δ∈N(0,1). The dynamic Gaussian mixture latent code is input into the generator network, and the intermediate features of the generator network are enhanced through a hybrid attention mechanism, which includes a spatial attention mechanism and a channel attention mechanism. The spatial attention mechanism first uses pooling operations to aggregate channel information to obtain two 2D feature maps: and These represent the feature maps obtained after average pooling and max pooling, respectively. Next, the two feature maps are concatenated and convolved to obtain the feature map for spatial attention. The spatial attention mechanism is formally described as follows: Where σ represents the activation function, AvgPool and MaxPool represent the average pooling and max pooling respectively, and f 7× 7 f 7×7 This represents a convolution operation with a 7×7 kernel, where F is the feature map. and The feature maps are obtained after the average pooling and the max pooling; the channel attention mechanism first uses average pooling and max pooling to compress the spatial information, resulting in two 2D feature maps: and Then, a network is used to generate the feature map M of the channel attention. c ∈R c×1×1 This network is a multilayer perceptron with one hidden layer; the channel attention mechanism is formally described as follows: Where σ represents the Sigmoid activation function, W1 and W0 are shared parameters, AvgPool and MaxPool represent average pooling and max pooling, respectively, and MLP stands for Multilayer Perceptron. and The feature map obtained after using the average pooling and max pooling; The intermediate features are obtained by the generator network through the dynamic Gaussian mixture latent coding mapping. The enhanced intermediate features are input into the generator network to obtain a set of generated images. The generated image set and the real image set are input into the discrimination network to obtain the image discrimination results for the generated image set and the real image set; Based on the image discrimination result and the objective optimization functions of the generator network and the discriminator network, the generator network and the discriminator network are updated to obtain the updated generator network and the discriminator network.
2. The method for generating small sample images according to claim 1, characterized in that, The step of updating the parameters of the generator network and the discriminator network based on the image discrimination result and the objective optimization function of the generator network and the discriminator network includes: The image discrimination result is fed into the objective optimization function of the discrimination network to update the parameters of the discrimination network, wherein the objective optimization function of the discrimination network conforms to the following correspondence: Where E represents expectation, I real Let z be the set of real images, G(z) be the dynamic Gaussian mixture distribution, D(x) be the set of generated images, and min() denote minimization. recons The reconstruction loss helps improve the discriminant network's ability to extract features, thereby enhancing the discriminant network's discrimination ability. The image discrimination result is fed into the objective optimization function of the generator network to update the parameters of the generator network, wherein the objective optimization function of the generator network conforms to the following correspondence: L G =-E x~G(z) [D(x)] Where E represents the expectation, z is the dynamic Gaussian mixture distribution, and x ~ G(z) is the set of generated images. D(x) is the image discrimination result.
3. The method for generating small sample images according to claim 1, characterized in that, After updating the parameters of the generator network and the discriminator network according to the objective optimization functions of the generator network and the discriminator network, the method further includes: The updated generator network is used to generate image data for at least one of data augmentation, classification, and segmentation.
4. A method for generating small sample images, characterized in that, The method includes a generator and a discriminator, wherein the generator is coupled to the generation network and the discriminator is coupled to the discrimination network, and the generation method is used to execute the programs of the generator and the discriminator to perform the method of any one of claims 1 to 3.