Decoupling method, system and related equipment based on β-GVAE

By introducing a generative adversarial network into VAE and combining a β-VAE variant autoencoder, the problem of the traditional method's trade-off between reconstruction degree and decoupling ability is solved, and better decoupling and image generation effects are achieved.

CN114662666BActive Publication Date: 2025-05-02TIANJIN UNIV OF SCI & TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210309254.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-05-02
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

Traditional VAE-based decoupling methods are difficult to achieve a good trade-off between reconstruction degree and decoupling ability.

Method used

The KL divergence of β-VAE is constrained by combining the generative adversarial network (GAN) and the β-VAE variational autoencoder through the feedback optimization mechanism of the generative adversarial network.

Benefits of technology

It achieves better decoupling capabilities and image generation effects, and improves the visual expression of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114662666B_ABST
    Figure CN114662666B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of image generation technology, and provides a decoupling method, system and related equipment based on β-GVAE, the method comprising: presetting a training data set for image generation; extracting observation samples from the training data set, and inputting the observation samples into an image generation model for training; presetting a loss function L for training the image generation model; performing hyperparameter optimization on the image generation model, and calculating the optimal hyperparameter value according to a preset evaluation index, and using the optimal hyperparameter value for the image generation model to complete the training; inputting a random sample into the trained image generation model to obtain a final generated image. The present invention constrains β-VAE by generating an adversarial network, thereby improving the decoupling and image generation capabilities of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image generation, and in particular relates to a decoupling method, system and related equipment based on β-GVAE. Background Art

[0002] In recent years, learning disentangled representations has attracted much attention in the machine learning community. The goal of learning disentangled representations is to learn disentangled latent factors that are learned from observed data, where the dimensions of the latent factors are independent of each other, each dimension controls the generation of a feature, and they do not affect each other. Such representations have many advantages: when used for downstream tasks, they can improve predictive performance, reduce sample complexity, provide interpretability, improve fairness, and have been identified as a way to overcome shortcut learning in deep learning.

[0003] The definition of decoupling is open and there is no standard definition. Everyone may have a different definition of decoupling. This can be explained by an example. For example, for face data, there are 10 dimensions of potential decoupling factors. The first dimension controls skin color, the second dimension controls hair length, and the third dimension controls eye size. If the first dimension is adjusted and the other dimensions remain unchanged, images of different skin colors of the same face can be generated.

[0004] Commonly used decoupling methods include VAE (Variational Auto-Encoder) and GAN (Generative Adversarial Networks). The traditional variational auto-encoder model consists of an inference model (encoder) and a generation model (decoder), where the inference model encodes the real data x into a low-dimensional latent variable z through a multi-layer neural network, and the generation model restores the latent variable z to a high-dimensional data space through a multi-layer neural network. In addition, there is a modified β-VAE, which introduces an adjustable hyperparameter β to the original VAE objective. Choosing a good β value leads to more decoupled potential representations, however, in order to obtain a better decoupling effect, it often leads to poor reconstruction. In order to obtain a better reconstruction effect, it often leads to poor decoupling ability. Therefore, even if the existing β-VAE can improve the decoupling ability, the higher β value required to encourage decoupling usually leads to a trade-off between the fidelity of the β-VAE reconstruction and the decoupling nature of its latent code z. Summary of the invention

[0005] The embodiment of the present invention provides a variational autoencoder decoupling method combined with a generative adversarial network, aiming to solve the problem that the traditional VAE-based decoupling method cannot achieve a good balance between reconstruction degree and decoupling ability.

[0006] In a first aspect, an embodiment of the present invention provides a decoupling method based on β-GVAE, the method comprising the following steps:

[0007] S1, preset training dataset for image generation;

[0008] S2, extracting an observation sample x from the training data set, and inputting the observation sample x into an image generation model for training, wherein the image generation model is based on β-GVAE, including a β-VAE variational autoencoder and a generative adversarial network;

[0009] S3, presetting a loss function L for training the image generation model;

[0010] S4, performing hyperparameter optimization on the image generation model, and calculating an optimal hyperparameter value according to a preset evaluation index, and applying the optimal hyperparameter value to the image generation model to complete training;

[0011] S5. Input the random sample into the image generation model obtained after completing the training in step S4 to obtain the final generated image.

[0012] Furthermore, the image generation model includes an inference model of a β-VAE variational autoencoder, a generation model, a generator of the generative adversarial network, and a discriminator of the generative adversarial network, wherein the inference model also serves as the generator in the image generation model, and the generative adversarial network uses the latent variable z obtained by the inference model as a negative sample and the latent variable z obtained by the standard normal distribution as a positive sample as a judgment basis for the discriminator.

[0013] Furthermore, the image generation model first takes the observed sample as input, and generates a latent variable z through the inference model. After that, the discriminator uses the latent variable z obtained by the inference model as a negative sample and the latent variable z obtained by the standard normal distribution as a positive sample as a basis for judgment to obtain a probability value. At the same time, the generation model uses the latent variable z obtained by the inference model as a prior distribution to sample and obtain sampling data, and then inputs the sampling data into the conditional probability distribution to generate the final image.

[0014] Furthermore, the loss function of the generative adversarial network in the image generation model satisfies the following expression (1):

[0015] min G maxD V(D,G)=E z~p(z) [logD(x)]+E x~Pdata(x) [log(1-D(G(x)))] (1)

[0016] Among them, G represents the generator, which also serves as the inference model in the image generation model, D represents the discriminator, z~p(z) represents the hidden variable z sampled from the standard normal distribution p(z)=N(0,1) as a positive sample, x~Pdata(x) represents the observation sample x obtained from the training data set, and then the observation sample x is input into the generator G, and the obtained hidden variable z is used as a negative sample, and the hidden variable z corresponding to the positive sample and the negative sample is input into the discriminator D. If the input of the discriminator D comes from the positive sample, the output is 1, and if the input of the discriminator D comes from the negative sample, the output is 0.

[0017] Furthermore, the loss function L satisfies the following expression (2):

[0018]

[0019] Wherein, θ is the network parameter of the generative model, φ is the network parameter of the inference model, δ is the network parameter of the discriminator, x is the observed sample, z is the hidden variable, β is the hyperparameter of the restricted KL term, γ is the hyperparameter of the discriminator, q φ (z|x) represents the reasoning part of the image generation model, p θ (x|z) represents the generation part in the image generation model, and D is the discriminator.

[0020] Furthermore, the objects of hyperparameter optimization of the image generation model in step S4 include a hyperparameter β for limiting the KL term and a hyperparameter γ of the discriminator.

[0021] Furthermore, the preset evaluation indicators when the image generation model performs hyperparameter optimization include reconstruction error and KL divergence.

[0022] In a second aspect, an embodiment of the present invention further provides a decoupling system based on β-GVAE, comprising:

[0023] A data acquisition module, used to acquire a preset training data set for image generation;

[0024] A sample extraction module, used to extract an observation sample x from the training data set, and input the observation sample x into an image generation model for training, wherein the image generation model is based on β-GVAE, including a β-VAE variational autoencoder and a GAN generative adversarial network;

[0025] A loss function module, used to obtain a preset loss function L for training the image generation model;

[0026] A hyperparameter optimization module, used to optimize the hyperparameters of the image generation model, calculate the optimal hyperparameter value according to the preset evaluation index, and use the optimal hyperparameter value for the image generation model to complete the training;

[0027] The image generation module is used to input random samples into the image generation model obtained after completing the training in the hyperparameter optimization module to obtain the final generated image.

[0028] In a third aspect, an embodiment of the present invention further provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the β-GVAE-based decoupling method as described in any one of the above embodiments are implemented.

[0029] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the β-GVAE-based decoupling method as described in any one of the above embodiments are implemented.

[0030] The beneficial effects achieved by the present invention are that, due to the use of a generative adversarial network combined with β-VAE to construct an image generation model based on β-GVAE, the feedback optimization mechanism of the generative adversarial network can be used to constrain the KL divergence of β-VAE, thereby enabling the image generation model to have better decoupling capabilities, and improving the image generation capability of the model, so that the image has better visual effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a flow chart of a decoupling method based on β-GVAE provided in an embodiment of the present invention;

[0032] Figure 2 is a structural schematic diagram of an image generation model provided by an embodiment of the present invention;

[0033] Figure 3 It is a schematic diagram of the reconstruction error curve of different models;

[0034] Figure 4 It is a schematic diagram of the KL divergence curve of different models;

[0035] Figure 5 This is a schematic diagram comparing the image generation results of the three models on the CelebA dataset;

[0036] Figure 6 This is a schematic diagram comparing the image generation results of the three models on the dsprites dataset;

[0037] Figure 7 This is a schematic diagram comparing the image generation results of the three models on the 3DChairs dataset;

[0038] Figure 8 is a schematic structural diagram of a decoupling system 200 provided in an embodiment of the present invention;

[0039] Fig. 9 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0041] Please refer to Figure 1 , Figure 1 : is a flow chart of a decoupling method based on β-GVAE provided in an embodiment of the present invention, wherein the method comprises the following steps:

[0042] S1. Preset training dataset for image generation.

[0043] Specifically, the training data set for image generation in the embodiment of the present invention includes multiple existing image data sets. In order to facilitate verification and reflect the effect of image generation, the embodiment of the present invention selects three data sets containing different objects, namely CelebA, 3DChairs and dsprites, as the source of the training data set. The CelebA (CelebFaces Attribute, celebrity face attribute data set) contains 202599 face images of 10177 celebrity identities and is widely used in face-related computer vision training tasks; 3DChairs is a data set of 3D chairs, which includes a variety of chairs. The potential factors of chairs include width, size, azimuth, leg style, back height, etc.; dsprites is a data set of 2D shapes, which is generated by 6 potential factors that are unrelated to the ground truth. All possible combinations of these potential factors appear only once, so that the shapes in the dsprites data set are rich enough.

[0044] S2. Extract an observation sample x from the training data set, and input the observation sample x into an image generation model for training. The image generation model is based on β-GVAE, including a β-VAE variational autoencoder and a generative adversarial network.

[0045] The observation sample x is a portion of image data with non-repetitive content randomly selected from the training data set, which is used for training the image generation model. The image generation model is based on β-GVAE (β-VAE+GAN), which includes a combination of β-VAE variational autoencoder and generative adversarial network. For details, please refer to Figure 2 , Figure 2 is a schematic diagram of the structure of the image generation model provided by an embodiment of the present invention, wherein, for the β-VAE variational autoencoder, it includes an inference model and a generation model. In the embodiment of the present invention, q φ (z|x) represents the inference model, p θ (x|z) represents the generative model, and the generative adversarial network includes a generator and a discriminator. The inference model also serves as the generator in the image generation model, that is, q in the embodiment of the present invention. φ (z|x) also plays the role of image generation of the generator in the generative adversarial model.

[0046] For the generative adversarial network, the input of its discriminator requires the generated data generated by the generator and a set of real data as a control. In the embodiment of the present invention, the q of the generator is φ The hidden variable z output by (z|x) is used as the negative sample (generated data) required by the discriminator, and the hidden variable z obtained by the standard normal distribution is the positive sample. When processing, the discriminator will determine whether the input content comes from the positive sample. If the input is the positive sample, the discriminator outputs 1. If the input of the discriminator D comes from the negative sample, it outputs 0. According to the above definition, the loss function of the generative adversarial network satisfies the following expression (1):

[0047] min G max D V(D,G)=E z~p(z) [logD(x)]+E x~Pdata(x) [log(1-D(G(x)))] (1)

[0048] Among them, G represents the generator, which also serves as the inference model in the image generation model, D represents the discriminator, z~p(z) represents the latent variable z sampled from the standard normal distribution p(z)=N(0,1) as the positive sample, and x~Pdata(x) represents the observed sample x obtained from the training data set.

[0049] In a generative adversarial network, the judgment result of the discriminator will be used as feedback to optimize the generator. In the network structure provided in the embodiment of the present invention, the optimization of the generator is equivalent to the optimization of the inference model, so as to achieve the effect of optimizing β-VAE through a generative adversarial network. In the β-GVAE-based image generation model provided in the embodiment of the present invention, under ideal conditions, the discriminator during the training process cannot distinguish whether the input data comes from the positive sample or the negative sample, that is, the probability value of the output of the discriminator being equal to 1 or 0 each time is one-half, and the image generation model is optimal at this time. However, it takes a long time to iterate for the probability value to be equal to one-half, and the output value is more dependent on the amount of input data and related network parameters in the training of the neural network model. In the actual training process, the interval value of the discriminator output reaching the optimal state can be set, and when the interval value is reached, the image generation model can also be considered to be optimal, which can be set specifically according to actual conditions.

[0050] The image generation model in the embodiment of the present invention first takes the observed sample x as input, passes through the inference model and generates a latent variable z, the inference model uses the obtained latent variable z as a prior distribution to sample to obtain sampling data, and then inputs the sampling data into the conditional probability distribution to generate the final image.

[0051] S3. Preset a loss function L for training the image generation model.

[0052] Specifically, in the embodiment of the present invention, the loss function L satisfies the following expression (2):

[0053]

[0054] Wherein, θ is the network parameter of the generative model, φ is the network parameter of the inference model, δ is the network parameter of the discriminator, x is the observed sample, z is the hidden variable, β is the hyperparameter of the restricted KL term, γ is the hyperparameter of the discriminator, q φ (z|x) represents the reasoning part of the image generation model, p θ (x|z) represents the generation part in the image generation model, and D is the discriminator.

[0055] S4. Optimize the hyperparameters of the image generation model, calculate the optimal hyperparameter values ​​according to the preset evaluation index, and use the optimal hyperparameter values ​​for the image generation model to complete the training.

[0056] In the embodiment of the present invention, the objects for hyperparameter optimization of the image generation model include the hyperparameter β for limiting the KL term and the hyperparameter γ of the discriminator. The preset evaluation indicators for hyperparameter optimization include reconstruction error (res loss) and KL divergence (kld). For the above loss function L expression, the term corresponding to the reconstruction error is The term corresponding to the KL divergence is The reconstruction error describes the model's ability to generate images, and the KL divergence describes the constraints on the latent space of the variational autoencoder. The smaller the KL divergence, the stronger the constraint of the variational autoencoder on the inference model, making q φ (z|x) is closer to the standard Gaussian distribution p(z), thus achieving better decoupling capability.

[0057] Specifically, please refer to Table 1, which is a schematic table of hyperparameter optimization indicators in the training process of the image generation model provided by an embodiment of the present invention.

[0058] Table 1 Schematic diagram of hyperparameter optimization indicators

[0059]

[0060] As shown in Table 1, when β=2 and γ=2, the reconstruction error rec loss achieves an optimal value of 228.511, and when β=4 and γ=1, the KL divergence value kld achieves an optimal value of 16.073. It can be seen from the data in the table that the reconstruction error is inversely proportional to the KL divergence, that is, when the reconstruction error is small, the KL divergence is large, and when the reconstruction error is large, the KL divergence is small. Therefore, in order to weigh the reconstruction error and KL divergence, the embodiment of the present invention selects β=4 and γ=10 as the hyperparameter values ​​when training the image generation model. At this time, the reconstruction error and KL divergence of the image generation model can both achieve a good result, which can reflect the balance of performance. Afterwards, the image generation model trained according to the above values ​​is output.

[0061] S5. Input the random sample into the image generation model obtained after completing the training in step S4 to obtain the final generated image.

[0062] Specifically, the random sample is any picture with a valid shape image. For the sake of convenience, the three data sets of CelebA, 3DChairs and dsprites used as the training data sets in the embodiment of the present invention are taken as examples. The β-GVAE-based image generation model used in the embodiment of the present invention is qualitatively compared with VAE and β-VAE to compare the differences in reconstruction errors and KL divergences of different network structures.

[0063] Please refer to Table 2. Figure 3 , Figure 4 ,Table 2 is the experimental comparison data of qualitative results of different models, Figure 3 is a schematic diagram of the reconstruction error curve of different models. Figure 4 It is a schematic diagram of the KL divergence curve of different models.

[0064] Table 2 Comparison data of qualitative results of different models

[0065]

[0066] From the above data, it can be seen that VAE has the smallest reconstruction error, but the β-GVAE provided by the embodiment of the present invention has a reconstruction error that is not much different from that of VAE, and the reconstruction error is much lower than that of β-VAE; at the same time, the β-GVAE provided by the embodiment of the present invention not only has a lower reconstruction error, but also has the lowest KL divergence value, which shows that β-GVAE has the best decoupling ability among the three. Based on the above data, the β-GVAE provided by the embodiment of the present invention not only has better decoupling ability, but also has a certain ability to generate images, and its performance exceeds that of β-VAE.

[0067] Please also refer to Figure 5 , Figure 6 , Figure 7 , Figure 5 This is a schematic diagram comparing the image generation results of the three models on the CelebA dataset. Figure 6 This is a schematic diagram comparing the image generation results of the three models on the dsprites dataset. Figure 7 This is a schematic diagram comparing the image generation results of the three models on the 3DChairs dataset. In the above schematic diagram, two columns are taken as examples:

[0068] First, on the CelebA dataset, the generated images in column A of VAE have changes in background color and gender, and column B has changes in background color, face angle, and hair color, indicating that VAE has poor decoupling ability; the generated images in column A of β-VAE have changes in face angle, and column B has changes in background color and gender, indicating that β-VAE has better decoupling ability; the generated images in column A of β-GVAE have changes in hair color, and column B has changes in background color and gender, indicating that β-GVAE has better decoupling ability and the quality of the generated images appears to be higher than that of β-VAE;

[0069] Secondly, on the dsprites dataset, the generated images in column A of VAE have shape and scale transitions, but also generate poor shapes. Column B has shape and scale transitions, but no images are generated in the end, indicating that VAE has poor decoupling ability; the generated images in column A of β-VAE have scale transitions, and column B has shape transitions, but in the end, poor shapes are generated, indicating that β-VAE has decoupling ability; the generated images in column A of β-GVAE have shape transitions, and column B has scale transitions, indicating that β-GVAE has better decoupling ability, and the quality of the generated images appears to be higher than that of β-VAE;

[0070] Finally, on the 3DChairs dataset, the generated images in column A of VAE have size changes, and those in column B have rotation changes, which means that VAE also has decoupling capabilities; the generated images in column A of β-VAE have size changes, and those in column B have rotation changes, which means that β-VAE has decoupling capabilities; the generated images in column A of β-GVAE have size changes, and those in column B have rotation changes, which means that β-GVAE also has decoupling capabilities, but the quality of images generated by β-GVAE appears to be higher than that of VAE and β-VAE.

[0071] Based on the above data, β-GVAE not only has better decoupling ability, but also the generated data has good visual effects, far exceeding VAE and β-VAE.

[0072] The beneficial effects achieved by the present invention are that, due to the use of a generative adversarial network combined with β-VAE to construct an image generation model based on β-GVAE, the feedback optimization mechanism of the generative adversarial network can be used to constrain the KL divergence of β-VAE, thereby enabling the image generation model to have better decoupling capabilities, and improving the image generation capability of the model, so that the image has better visual effects.

[0073] The embodiment of the present invention also provides a decoupling system based on β-GVAE, please refer to Figure 8 , Figure 8 is a schematic diagram of the structure of a decoupling system 200 provided in an embodiment of the present invention, including:

[0074] A data acquisition module 201 is used to acquire a preset training data set for image generation;

[0075] A sample extraction module 202 is used to extract an observation sample x from the training data set and input the observation sample x into an image generation model for training. The image generation model is based on β-GVAE, including a β-VAE variational autoencoder and a GAN generative adversarial network;

[0076] A loss function module 203, used to obtain a preset loss function L for training the image generation model;

[0077] A hyperparameter optimization module 204 is used to optimize the hyperparameters of the image generation model, calculate the optimal hyperparameter value according to the preset evaluation index, and use the optimal hyperparameter value for the image generation model to complete the training;

[0078] The image generation module 205 is used to input random samples into the image generation model obtained after completing the training in the hyperparameter optimization module 204 to obtain a final generated image.

[0079] The β-GVAE-based decoupling system 200 can implement the steps in the β-GVAE-based decoupling method in the above embodiment, and can achieve the same technical effects. Please refer to the description in the above embodiment, which will not be repeated here.

[0080] The embodiment of the present invention also provides a computer device, please refer to Fig. 9 , Fig. 9 300 is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. The computer device 300 includes: a memory 302, a processor 301, and a computer program stored in the memory 302 and executable on the processor 301.

[0081] The processor 301 calls the computer program stored in the memory 302 to execute the steps of the park management method provided in the embodiment of the present invention. Figure 1 , including:

[0082] S1, preset training data set for image generation;

[0083] S2, extracting an observation sample x from the training data set, and inputting the observation sample x into an image generation model for training, wherein the image generation model is based on β-GVAE, including a β-VAE variational autoencoder and a generative adversarial network;

[0084] S3, presetting a loss function L for training the image generation model;

[0085] S4, performing hyperparameter optimization on the image generation model, and calculating an optimal hyperparameter value according to a preset evaluation index, and using the optimal hyperparameter value for the image generation model to complete training;

[0086] S5. Input the random sample into the image generation model obtained after the training in step S4 to obtain the final generated image.

[0087] Furthermore, the image generation model includes an inference model of a β-VAE variational autoencoder, a generation model, a generator of the generative adversarial network, and a discriminator of the generative adversarial network, wherein the inference model also serves as the generator in the image generation model, and the generative adversarial network uses the latent variable z obtained by the inference model as a negative sample and the latent variable z obtained by the standard normal distribution as a positive sample as a judgment basis for the discriminator.

[0088] Furthermore, the image generation model first takes the observed sample as input, and generates a latent variable z through the inference model. After that, the discriminator uses the latent variable z obtained by the inference model as a negative sample and the latent variable z obtained by the standard normal distribution as a positive sample as a basis for judgment to obtain a probability value. At the same time, the generation model uses the latent variable z obtained by the inference model as a prior distribution to sample and obtain sampling data, and then inputs the sampling data into the conditional probability distribution to generate the final image.

[0089] Furthermore, the loss function of the generative adversarial network in the image generation model satisfies the following expression (1):

[0090] min G max D V(D,G)=E z~p(z) [logD(x)]+E x~Pdata(x) [log(1-D(G(x)))] (1)

[0091] Among them, G represents the generator, which also serves as the inference model in the image generation model, D represents the discriminator, z~p(z) represents the hidden variable z sampled from the standard normal distribution p(z)=N(0,1) as a positive sample, x~Pdata(x) represents the observation sample x obtained from the training data set, and then the observation sample x is input into the generator G, and the obtained hidden variable z is used as a negative sample, and the hidden variable z corresponding to the positive sample and the negative sample is input into the discriminator D. If the input of the discriminator D comes from the positive sample, the output is 1, and if the input of the discriminator D comes from the negative sample, the output is 0.

[0092] Furthermore, the loss function L satisfies the following expression (2):

[0093]

[0094] Wherein, θ is the network parameter of the generative model, φ is the network parameter of the inference model, δ is the network parameter of the discriminator, x is the observed sample, z is the hidden variable, β is the hyperparameter of the restricted KL term, γ is the hyperparameter of the discriminator, q φ (z|x) represents the reasoning part of the image generation model, p θ (x|z) represents the generation part in the image generation model, and D is the discriminator.

[0095] Furthermore, the objects of hyperparameter optimization of the image generation model in step S4 include a hyperparameter β for limiting the KL term and a hyperparameter γ of the discriminator.

[0096] Furthermore, the preset evaluation indicators when the image generation model performs hyperparameter optimization include reconstruction error and KL divergence.

[0097] The computer device 300 provided in the embodiment of the present invention can implement the steps in the decoupling method based on β-GVAE in the above embodiment, and can achieve the same technical effect. Please refer to the description in the above embodiment, which will not be repeated here.

[0098] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes and steps in the β-GVAE-based decoupling method provided in the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0099] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0100] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0102] The embodiments of the present invention are described above in conjunction with the accompanying drawings. What is disclosed is only the preferred embodiment of the present invention. However, the present invention is not limited to the above-mentioned specific implementation manner. The above-mentioned specific implementation manner is only illustrative rather than restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms and equivalent changes without departing from the scope of protection of the purpose of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A decoupling method based on β-GVAE, characterized in that: The decoupling method comprises the following steps: S1, preset training data set for image generation; S2, extracting an observation sample x from the training data set, and inputting the observation sample x into an image generation model for training, wherein the image generation model is based on β-GVAE, including a β-VAE variational autoencoder and a generative adversarial network; S3. Preset a loss function L for training the image generation model, wherein the loss function L satisfies the following expression (2): Among them, θ is the network parameter of the generative model, φ is the network parameter of the inference model, δ is the network parameter of the discriminator, x is the observed sample, z is the hidden variable, β is the hyperparameter of the restricted KL term, γ is the hyperparameter of the discriminator, q φ (z|x) represents the reasoning part of the image generation model, p θ (x|z) represents the generation part in the image generation model, and D is the discriminator; S4, performing hyperparameter optimization on the image generation model, and calculating an optimal hyperparameter value according to a preset evaluation index, and using the optimal hyperparameter value for the image generation model to complete training; S5. Input the random sample into the image generation model obtained after the training in step S4 to obtain the final generated image.

2. The decoupling method based on β-GVAE according to claim 1, characterized in that: The image generation model includes an inference model of a β-VAE variational autoencoder, a generation model, a generator of the generative adversarial network, and a discriminator of the generative adversarial network, wherein the inference model also serves as the generator in the image generation model, and the generative adversarial network uses the latent variable z obtained by the inference model as a negative sample and the latent variable z obtained by the standard normal distribution as a positive sample as a judgment basis for the discriminator.

3. The decoupling method based on β-GVAE according to claim 2, characterized in that: The image generation model first takes the observed sample as input, and generates a latent variable z through the inference model. After that, the discriminator uses the latent variable z obtained by the inference model as a negative sample and the latent variable z obtained by the standard normal distribution as a positive sample as a basis for judgment to obtain a probability value. At the same time, the generation model uses the latent variable z obtained by the inference model as a prior distribution to sample and obtain sampling data, and then inputs the sampling data into the conditional probability distribution to generate the final image.

4. The decoupling method based on β-GVAE according to claim 2, characterized in that: The loss function of the generative adversarial network in the image generation model satisfies the following expression (1): min G max D V(D,G)=E z~p(z) [logD(x)]+E x~Pdata(x) [log(1-D(G(x)))] (1) Among them, G represents the generator, which also serves as the inference model in the image generation model, D represents the discriminator, z~p(z) represents the hidden variable z sampled from the standard normal distribution p(z)=N(0,1) as a positive sample, x~Pdata(x) represents the observation sample x obtained from the training data set, and then the observation sample x is input into the generator G, and the obtained hidden variable z is used as a negative sample, and the hidden variable z corresponding to the positive sample and the negative sample is input into the discriminator D. If the input of the discriminator D comes from the positive sample, the output is 1, and if the input of the discriminator D comes from the negative sample, the output is 0.

5. The decoupling method based on β-GVAE according to claim 2, characterized in that: The objects of hyperparameter optimization of the image generation model in step S4 include a hyperparameter β for limiting the KL term and a hyperparameter γ of the discriminator.

6. The decoupling method based on β-GVAE according to claim 5, characterized in that: The preset evaluation indicators when the image generation model performs hyperparameter optimization include reconstruction error and KL divergence.

7. A decoupling system based on β-GVAE, characterized in that: include: A data acquisition module, used to acquire a preset training data set for image generation; A sample extraction module, used to extract an observation sample x from the training data set, and input the observation sample x into an image generation model for training, wherein the image generation model is based on β-GVAE, including a β-VAE variational autoencoder and a GAN generative adversarial network; A loss function module, used to obtain a preset loss function L for training the image generation model, The loss function L satisfies the following expression (2): Among them, θ is the network parameter of the generative model, φ is the network parameter of the inference model, δ is the network parameter of the discriminator, x is the observed sample, z is the hidden variable, β is the hyperparameter of the restricted KL term, γ is the hyperparameter of the discriminator, q φ (z|x) represents the reasoning part of the image generation model, p θ (x|z) represents the generation part in the image generation model, and D is the discriminator; A hyperparameter optimization module, used to optimize the hyperparameters of the image generation model, calculate the optimal hyperparameter value according to the preset evaluation index, and use the optimal hyperparameter value for the image generation model to complete the training; The image generation module is used to input random samples into the image generation model obtained after completing the training in the hyperparameter optimization module to obtain the final generated image.

8. A computer device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the β-GVAE-based decoupling method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the β-GVAE-based decoupling method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Image quality processing system, method, equipment and medium

    CN112365551A