WO2020239208A1 - Method and system for training a model for image generation - Google Patents
Method and system for training a model for image generation Download PDFInfo
- Publication number
- WO2020239208A1 WO2020239208A1 PCT/EP2019/063853 EP2019063853W WO2020239208A1 WO 2020239208 A1 WO2020239208 A1 WO 2020239208A1 EP 2019063853 W EP2019063853 W EP 2019063853W WO 2020239208 A1 WO2020239208 A1 WO 2020239208A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- model
- gan
- vae
- training
- output image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
- G06N3/0455—Auto-encoder networks; Encoder-decoder networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0475—Generative networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/09—Supervised learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/094—Adversarial learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06V10/7747—Organisation of the process, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/778—Active pattern-learning, e.g. online learning of image or video features
- G06V10/7796—Active pattern-learning, e.g. online learning of image or video features based on specific statistical tests
Definitions
- the present disclosure is related to the field of image processing, in particular to a method for training a model for image generation, the model comprising a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework.
- VAE variational auto-encoder
- GAN generative adversarial network
- GANs Generative Adversarial Networks (GANs) have achieved state-of-the- art performance, with respect to realism, in generative modeling of image distributions, cf.:
- GANs do not explicitly estimate the data likelihood. Instead, it aims to "fool" an adversary, so that the adversary is unable to distinguish between images from the true distribution and the generated images. This leads to the generation of very realistic images. However, there is no incentive to cover the whole data distribution. Entire modes of the true data distribution can be missed - commonly referred to as the mode collapse problem.
- VAEs Variational Auto-encoders
- a (desirably computer-implemented) method of training a model for image generation comprises (or is) a hybrid variational autoencoder (VAE) - generative adversarial network (GAN) framework (i.e. architecture).
- VAE variational autoencoder
- GAN generative adversarial network
- the method comprises the steps of:
- b - determine the best of the multiple output image samples as a best-of-many sample, the best-of-many sample having the minimum reconstruction cost, and c - train the model based on a predefined training objective, the predefined training objective integrating the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
- a synthetic likelihood term can be integrated in the novel objective to yield a novel hybrid VAE-GAN framework.
- the GAN-based synthetic likelihood term integrated to the objective can enhance the realism of generated images.
- the model may be trained by using only the best-of-many sample for training the model and by disregarding the further multiple output image samples.
- the model may be trained based on the best-of-many sample in relation to the input image according to a predefined VAE objective.
- the model may be a (or may comprise at least one) deep neural network.
- the model may comprise a variational auto-encoder (VAE) including a recognition network and a generator and a generative adversarial network (GAN) including a generator and a discriminator.
- VAE variational auto-encoder
- GAN generative adversarial network
- VAE variational auto-encoder
- GAN generative adversarial network
- the model may be trained in step c based on the GAN-based synthetic likelihood term to learn generating sharper images by leveraging a discriminator of the GAN which is jointly trained to distinguish between real and generated images.
- the latent distribution of the input image may be sampled by multiple input of the input image into a recognition network which outputs in response respective regions in a latent space, and generation of respective output image samples in the image space by inputting the respective regions in the latent space into a generator.
- the output image samples are inputted into a discriminator of the GAN which outputs the GAN-based synthetic likelihood term.
- the worst of the multiple output image samples may be inputted into a discriminator of the GAN which outputs the GAN-based synthetic likelihood term.
- the term "worst" may mean the least realistic of the multiple output image samples.
- the GAN-based synthetic likelihood term may have a Lipschitz constant. This Lipschitz constant may be constrained to be equal to a predetermined value, in particular equal to 1, using e.g. Spectral Normalization.
- the present disclosure further relates to a (computer) system for training a model for image generation.
- the model comprises a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework.
- VAE variational auto-encoder
- GAN generative adversarial network
- a module A configured for a multiple input of an input image into the VAE which outputs in response multiple distinct output image samples
- the system may comprise the model, i.e. a hybrid variational auto ⁇ encoder (VAE) - generative adversarial network (GAN) framework.
- VAE variational auto ⁇ encoder
- GAN generative adversarial network
- the system may comprise further (sub-) modules and features corresponding to the features of the method described above.
- the present disclosure further relates to a (computer) system for generating an image sample, comprising the trained model of step c of the method described above or of the trained module D of the system described above.
- the present disclosure relates to a computer program including instructions for executing the steps of a method, as described above, when said program is executed by a computer.
- This program can use any programming language and take the form of source code, object code or a code intermediate between source code and object code, such as a partially compiled form, or any other desirable form.
- the present disclosure relates to a recording medium readable by a computer and having recorded thereon a computer program including instructions for executing the steps of a method, as described above.
- the information medium can be any entity or device capable of storing the program.
- the medium can include storage means such as a ROM, for example a CD ROM or a microelectronic circuit ROM, or magnetic storage means, for example a diskette (floppy disk) or a hard disk.
- the information medium can be an integrated circuit in which the program is incorporated, the circuit being adapted to execute the method in question or to be used in its execution.
- FIG. 1 shows a schematic flow chart of the steps of a method for training a model for image generation according to embodiments of the present disclosure
- FIG. 2 shows a schematic block diagram of a system according to embodiments of the present disclosure.
- FIG. 3 shows a schematic block diagram of a hybrid VAE-GAN model according to embodiments of the present disclosure.
- Fig. 1 shows a schematic flow chart of the steps of a method for training a model for image generation according to embodiments of the present disclosure.
- the model has a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) architecture.
- VAE variational auto-encoder
- GAN generative adversarial network
- the aim of the training method is to learn generative models for image distributions x ⁇ p(x) that transform a latent distribution z ⁇ p(z) to a learned distribution approximating p(x).
- the samples from the learned distribution must be sharp and realistic (likely under p(x))
- a first step SOI the same input image in inputted multiple times into the VAE which outputs in response respective multiple distinct output image samples. This allows the encoder multiple chances to draw desired samples.
- a subsequent step S02 the best of the multiple output image samples is determined.
- Said best output image is referred to in the following as a "best-of-many sample".
- the best-of-many sample is characterized by having the minimum reconstruction cost compared to the other output samples.
- a further step S03 the model is trained based on a predefined training objective.
- Said predefined training objective integrates (or is based on or comprises) the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
- Fig. 2 shows a schematic block diagram of a system according to embodiments of the present disclosure.
- a system 200 for training a model for image generation has been represented.
- the model comprises a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework.
- VAE variational auto-encoder
- GAN generative adversarial network
- This system 200 which may be a computer, comprises a processor 201 and a non volatile memory 202.
- the system 200 may not only be configured for training the model for image generation. It may also apply the trained model to another algorithm 400.
- the trained model may be applied to a computer vision system 400.
- a computer vision system for processing an input image sample 400 may comprise a pre-processor module configured to generate image samples based, the pre-processor module comprising said trained model.
- the system 200 may further be connected to a (passive) optical sensor 300, in particular a digital camera.
- the digital camera 300 is configured such that it can take pictures which may be used as input image samples provided to the model.
- a set of instructions is stored and this set of instructions comprises instructions to perform a method for training a model.
- these instructions and the processor 201 may respectively form a plurality of modules:
- a module A configured for a multiple input of an input image into the VAE which outputs in response multiple distinct output image samples
- Fig. 3 shows a schematic block diagram of a hybrid VAE-GAN model according to embodiments of the present disclosure.
- fig. 3 shows the model architecture at training time.
- the model is "hybrid" such that the VAE and the GAN share the same Generator
- the model thus leverages the strengths of VAEs and GANs to attain the two goals set out above.
- the GAN portion alone cangenerate realistic images, but has trouble covering all modes.
- the VAE portion can cover all modes of the distribution p(x). However, this comes at
- the VAE objective maximizes the log-likelihood of the data (x ⁇ p(x)).
- the log-likelihood, assuming the latent space to be distributed according to p(z) is,
- p(z) is usually Gaussian and the log-likelihood is usually the norm based reconstruction This requires the generator to generate samples that reconstruct every training example x for a likely z ⁇ p(z). This ensures that the decoder q covers all modes of the data distribution x ⁇ p(x). In contrast, GANs never directly maximize the (reconstruction based) likelihood and there is no direct incentive to cover all modes.
- Variational inference may use an (approximate) variational distribution which is jointly learned
- samples may be drawn instead from a recognition network and the variational auto-encoder based objective may be
- This objective has two important shortcomings. Firstly, this objective severly constrains the recognition network as high data log-
- the recognition network has to always generate latent samples z which are decoded by the generator close to x. Otherwise, the expected data log-likelihood would be low.
- the encoder is forced to trade off between a good estimate of the data log-likelihood and the divergence to the true latent p(z) distribution, which causes the generated latent space (by the recognition network) to be far from a Gaussain.
- it considers only a reconstruction-based log-likelihood which is known to lead to blurry image generations.
- An alternative variational approximation of (1) may be derived, which uses multiple samples to relax the constrains on the recognition network.
- the Mean-value theorem of Integration may be used, in order to derive a unconditional version of the (conditional) multi-sample objective starting from (2) (full derivation in Suppmat),
- the likelihood is computed considering all the generated samples.
- the recognition network gets multiple chances to draw samples with high likelihood. This encourages diversity in the generated samples and the recognition network can provide a good estimate of the data log-likelihood while not diverging from the prior p(z) - without trade-off.
- Synthetic estimates of the likelihood leads to the generation of sharper images by leveraging a classifier which is jointly trained to distinguish between real and generated images. A generated image which is indistinguishable from a real image is assigned higher likelihood.
- a synthetic likelihood term (with weight 1 - a) is integrated to both encourage the generator to generate realistic images and to cover all modes ( 1 reconstruction loss), thus meeting the initial two goals.
- the likelihood term is converted to a likelihood ratio form which allows for synthetic estimates
- the likelihood ratio can be estimated using a classifier.
- (6) can be written as (using Bayes theorem),
- the probability may be estimated using a classifier (image discriminator in fig. 3) which is jointly trained, leading to a
- the generator may be penalized using only the least realistic sample, and the likelihood ratio be estimated directly using
- the Lipschitz constant K of may be directly controlled, by setting it to be equal to 1, using Spectral Normalization, T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida. Spectral normalization for generative adversarial networks. ICLR, 2018.
- the synthetic likelihood ratio term is namely unstable during training - as it is the ratio of outputs of a classifier, any instability in the output of the classifier is magnified. Therefore it is proposed to directly estimate the ratio using a network with a controlled Lipschitz constant, which leads to significantly improved stability.
- KL-divergence term can also be recast in a likelihood ratio form (similar as (6)) allowing to leverage synthetic likelihoods using a classifier and minimize it globally instead of point-wise.
- the latent space discriminator D L is used to enforce the KL-divergence constraint in
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Medical Informatics (AREA)
- Multimedia (AREA)
- Probability & Statistics with Applications (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to a method and system for training a model for image generation. The model comprises a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework. The method comprises the steps of: a - multiple input (S01) of an input image into the VAE which outputs in response multiple distinct output image samples, b - determine (S02) the best of the multiple output image samples as a best- of-many sample, the best-of-many sample having the minimum reconstruction cost, c - train (S03) the model based on a predefined training objective, the predefined training objective integrating the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
Description
Method and system for training a model for image generation
FIELD OF THE DISCLOSURE
[0001] The present disclosure is related to the field of image processing, in particular to a method for training a model for image generation, the model comprising a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework.
BACKGROUND OF THE DISCLOSURE
[0002] Generative Adversarial Networks (GANs) have achieved state-of-the- art performance, with respect to realism, in generative modeling of image distributions, cf.:
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-
Farley, Sherjil Ozairy, Aaron Courville, Yoshua Bengioz (2014) "Generative
Adversarial Nets", Advances in neural information processing systems, Pages
2672-2680.
[0003] GANs do not explicitly estimate the data likelihood. Instead, it aims to "fool" an adversary, so that the adversary is unable to distinguish between images from the true distribution and the generated images. This leads to the generation of very realistic images. However, there is no incentive to cover the whole data distribution. Entire modes of the true data distribution can be missed - commonly referred to as the mode collapse problem.
[0004] In contrast, auto-encoders explicitly maximize data log-likelihood and are forced to cover all modes. However, auto-encoder latent distributions are discontinuous and hard to estimate and thus do not allow for sampling. Variational Auto-encoders (VAEs) enable generation using auto-encoders by constraining the latent space to be Gaussian, cf.:
D. P. Kingma and M. Welling. Auto-encoding variational bayes. ICLR, 2014.
[0005] This allows for generation using the decoder by sampling through the latent space. However, the usual log-likelihood estimate using L1 reconstruction cost leads to the generation of blurry images. Therefore, there has been a spur of recent work which aim to combine VAEs and GANs to jointly overcome each others shortcomings, cf. e.g.:
M. Rosea, B. Lakshminarayanan, D. Warde-Farley, and S. Mohamed.
Variational approaches for auto-encoding generative adversarial networks. arXiv preprint arXiv: 1706.04987, 2017.
[0006] Notably in this work, the VAE objective with the L1 reconstruction likelihood is combined with a GAN discriminator based synthetic likelihood leading to image quality at par with plain GANs.
[0007] However, the reconstruction log-likelihood and the latent space constraint in the VAE objective are at odds, which makes it difficult to achieve both at the same time. This problem is further exacerbated with the addition of the synthetic likelihood in hybrid VAE-GANs. This forces the encoder to trade-off between the two and makes latent spaces drift from true Gaussian. This leads to the degradation in the quality and diversity of generated images at test time.
SUMMARY OF THE DISCLOSURE
[0008] Currently, it remains desirable to enable an encoder to maintain both the latent representation constraint and high data log-likelihood and at the same time enhance the realism of generated images. In particular, it remains desirable to achieve high data log-likelihood and low divergence to the latent prior at the same time while generating realistic images.
[0009] Therefore, according to the embodiments of the present disclosure, a (desirably computer-implemented) method of training a model for image generation is provided. The model comprises (or is) a hybrid variational autoencoder (VAE) - generative adversarial network (GAN) framework (i.e. architecture). The method comprises the steps of:
a - multiple input of an input image (i.e. of the same input image) into the VAE which outputs in response multiple distinct output image samples,
b - determine the best of the multiple output image samples as a best-of-many sample, the best-of-many sample having the minimum reconstruction cost, and c - train the model based on a predefined training objective, the predefined training objective integrating the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
[0010] By providing such a method, a novel objective is proposed which integrates a "Best-of-Many" sample reconstruction cost and a synthetic likelihood term. This proposed objective enables the hybrid VAE-GAN framework to achieve high data log-likelihood and low divergence to the latent prior at the same time.
[0011] In other words, the constraints on the VAE can be relaxed, giving the encoder multiple chances to draw samples with high reconstruction likelihood -
only the best sample being penalized so that it can achieve both good reconstructions and maintain a latent space close to Gaussian. Furthermore, a synthetic likelihood term can be integrated in the novel objective to yield a novel hybrid VAE-GAN framework. The GAN-based synthetic likelihood term integrated to the objective can enhance the realism of generated images.
[0012] The model may be trained by using only the best-of-many sample for training the model and by disregarding the further multiple output image samples.
[0013] The model may be trained based on the best-of-many sample in relation to the input image according to a predefined VAE objective.
[0014] The model may be a (or may comprise at least one) deep neural network.
[0015] In particular the model may comprise a variational auto-encoder (VAE) including a recognition network and a generator and a generative adversarial network (GAN) including a generator and a discriminator.
[0016] The variational auto-encoder (VAE) and the generative adversarial network (GAN) may share a common generator. Hence, the model is desirably "hybrid" in the sense that the VAE and the GAN share the same Generator
[0017] The model may be trained in step c based on the GAN-based synthetic likelihood term to learn generating sharper images by leveraging a discriminator of the GAN which is jointly trained to distinguish between real and generated images.
[0018] During each training iteration the latent distribution of the input image may be sampled by multiple input of the input image into a recognition network which outputs in response respective regions in a latent space, and generation of respective output image samples in the image space by inputting the respective regions in the latent space into a generator.
[0019] The output image samples are inputted into a discriminator of the GAN which outputs the GAN-based synthetic likelihood term.
[0020] More in particular or as an alternative only the worst of the multiple output image samples may be inputted into a discriminator of the GAN which outputs the GAN-based synthetic likelihood term. With regard to the multiple output image samples, the term "worst" may mean the least realistic of the multiple output image samples.
[0021] The GAN-based synthetic likelihood term may have a Lipschitz constant. This Lipschitz constant may be constrained to be equal to a predetermined value, in particular equal to 1, using e.g. Spectral Normalization.
[0022] The present disclosure further relates to a (computer) system for training a model for image generation. The model comprises a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework. The system comprises:
a module A configured for a multiple input of an input image into the VAE which outputs in response multiple distinct output image samples,
a module B for determining the best of the multiple output image samples as a best-of-many sample, the best-of-many sample having the minimum reconstruction cost, and
a module C for training the model based on a predefined training objective, the predefined training objective integrating the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
[0023] The system may comprise the model, i.e. a hybrid variational auto¬ encoder (VAE) - generative adversarial network (GAN) framework.
[0024] The system may comprise further (sub-) modules and features corresponding to the features of the method described above.
[0025] The present disclosure further relates to a (computer) system for generating an image sample, comprising the trained model of step c of the method described above or of the trained module D of the system described above.
[0026] Furthermore the present disclosure relates to a computer program including instructions for executing the steps of a method, as described above, when said program is executed by a computer.
[0027] This program can use any programming language and take the form of source code, object code or a code intermediate between source code and object code, such as a partially compiled form, or any other desirable form.
[0028] Finally, the present disclosure relates to a recording medium readable by a computer and having recorded thereon a computer program including instructions for executing the steps of a method, as described above.
[0029] The information medium can be any entity or device capable of storing the program. For example, the medium can include storage means such
as a ROM, for example a CD ROM or a microelectronic circuit ROM, or magnetic storage means, for example a diskette (floppy disk) or a hard disk.
[0030] Alternatively, the information medium can be an integrated circuit in which the program is incorporated, the circuit being adapted to execute the method in question or to be used in its execution.
[0031] It is intended that combinations of the above-described elements and those within the specification may be made, except where otherwise contradictory.
[0032] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure, as claimed.
[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, and serve to explain the principles thereof.
BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Fig. 1 shows a schematic flow chart of the steps of a method for training a model for image generation according to embodiments of the present disclosure;
[0035] Fig. 2 shows a schematic block diagram of a system according to embodiments of the present disclosure; and
[0036] Fig. 3 shows a schematic block diagram of a hybrid VAE-GAN model according to embodiments of the present disclosure.
DESCRIPTION OF THE EMBODIMENTS
[0037] Reference will now be made in detail to exemplary embodiments of the disclosure, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like parts.
[0038] Fig. 1 shows a schematic flow chart of the steps of a method for training a model for image generation according to embodiments of the present disclosure. The model has a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) architecture.
[0039] The aim of the training method is to learn generative models for image distributions x ~ p(x) that transform a latent distribution z ~ p(z) to a
learned distribution
approximating p(x). The samples from the learned distribution must be sharp and realistic (likely under p(x))
and diverse - covering all modes of the distribution p(x).
[0040] In a first step SOI the same input image in inputted multiple times into the VAE which outputs in response respective multiple distinct output image samples. This allows the encoder multiple chances to draw desired samples.
[0041] In a subsequent step S02 the best of the multiple output image samples is determined. Said best output image is referred to in the following as a "best-of-many sample". The best-of-many sample is characterized by having the minimum reconstruction cost compared to the other output samples.
[0042] In a further step S03 the model is trained based on a predefined training objective. Said predefined training objective integrates (or is based on or comprises) the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
[0043] Due to this objective the encoder is enabled to maintain low divergence to the prior while generating realistic images. Further desirable details of the training method are described in the following, also in context of fig. 3.
[0044] Fig. 2 shows a schematic block diagram of a system according to embodiments of the present disclosure.
[0045] In this figure, a system 200 for training a model for image generation has been represented. The model comprises a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework. This system 200, which may be a computer, comprises a processor 201 and a non volatile memory 202. The system 200 may not only be configured for training the model for image generation. It may also apply the trained model to another algorithm 400. For example the trained model may be applied to a computer vision system 400. In other words, a computer vision system for processing an input image sample 400 may comprise a pre-processor module configured to generate image samples based, the pre-processor module comprising said trained model.
[0046] As an option, the system 200 may further be connected to a (passive) optical sensor 300, in particular a digital camera. The digital camera
300 is configured such that it can take pictures which may be used as input image samples provided to the model.
[0047] In the non-volatile memory 202, a set of instructions is stored and this set of instructions comprises instructions to perform a method for training a model.
[0048] In particular, these instructions and the processor 201 may respectively form a plurality of modules:
a module A configured for a multiple input of an input image into the VAE which outputs in response multiple distinct output image samples,
a module B for determining the best of the multiple output image samples as a best-of-many sample, the best-of-many sample having the minimum reconstruction cost, and
a module C for training the model based on a predefined training objective, the predefined training objective integrating the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
[0049] Fig. 3 shows a schematic block diagram of a hybrid VAE-GAN model according to embodiments of the present disclosure. In particular, fig. 3 shows the model architecture at training time. The model is "hybrid" such that the VAE and the GAN share the same Generator
[0050] The model thus leverages the strengths of VAEs and GANs to attain the two goals set out above. The GAN portion
alone cangenerate realistic images, but has trouble covering all modes. The VAE portion can cover all modes of the distribution p(x). However, this comes at
a cost - it is difficult to maintain both the VAE latent space close to Gaussain and cover all modes of the distribution p(x) at the same time. Therefore, in contrast to previous hybrid VAE-GAN approaches (Rosea et. al. as cited above), a novel objective is employed which leverages "Best-of-Many" samples to cover all modes of the distribution p(x) while generating realistic images and maintaining a latent space as close to Gaussian as possible.
[0051] The following detailed description begins with an explanation of the VAE objective and its shortcomings, followed by the proposed "Best-of-Many" objective for image generation which address its shortcomings.
Shortcomings of the VAE objective
[0052] The VAE objective maximizes the log-likelihood of the data (x ~ p(x)). The log-likelihood, assuming the latent space to be distributed according to p(z) is,
[0053] Here, p(z) is usually Gaussian and the log-likelihood
is usually the
norm based reconstruction
This requires the generator
to generate samples that reconstruct every training example x for a likely z ~ p(z). This ensures that the decoder q covers all modes of the data distribution x ~ p(x). In contrast, GANs never directly maximize the (reconstruction based) likelihood and there is no direct incentive to cover all modes.
[0054] However, the integral in (1) is intractable. Variational inference may use an (approximate) variational distribution which is jointly learned
[0055] During training, samples may be drawn instead from a recognition network and the variational auto-encoder based objective may be
[0056] This objective has two important shortcomings. Firstly, this objective severly constrains the recognition network as high data log-
likelihood and low divergence to the prior are at odds. As the expected log- likelihood is considered, the recognition network has to always generate latent samples z which are decoded by the generator close to x. Otherwise, the expected data log-likelihood would be low. Thus, the encoder is forced to trade off between a good estimate of the data log-likelihood and the divergence to the true latent p(z) distribution, which causes the generated latent space (by the recognition network) to be far from a Gaussain. Secondly, it considers only a reconstruction-based log-likelihood which is known to lead to blurry image generations.
[0057] Next, it is described how multiple samples can be effectively leveraged from to deal with the first shortcoming. Finally, a synthetic
likelihood term is integrated to deal with blurriness.
Leveraging Multiple Samples
[0058] An alternative variational approximation of (1) may be derived, which uses multiple samples to relax the constrains on the recognition network. For example, the Mean-value theorem of Integration may be used, in order to derive a unconditional version of the (conditional) multi-sample objective starting from (2) (full derivation in Suppmat),
[0059] In comparision to the VAE objective (3), in (4) the likelihood is computed considering all the generated samples. The recognition network gets multiple chances to draw samples with high likelihood. This encourages diversity in the generated samples and the recognition network can provide a good estimate of the data log-likelihood while not diverging from the prior p(z) - without trade-off.
[0060] However, also a good estimate of the likelihood
is desirable. Considering only L1 or L2 reconstruction based likelihoods would lead to the generation of blurry images. Therefore, (and because of the intractability of (1)), GANs instead use an adversary that provides indirect information of the likelihood - classifier that is jointly trained to distinguish between generated samples and real data samples.
[0061] Next, it is described how it can be leveraged such a classifier to directly obtain synthetic estimates of the likelihood that lead to the generation of crisp images.
Integrating Synthetic Likelihoods with the "Best-of-Many" Samples
[0062] Synthetic estimates of the likelihood leads to the generation of sharper images by leveraging a classifier which is jointly trained to distinguish
between real and generated images. A generated image which is indistinguishable from a real image is assigned higher likelihood. Starting from (4), a synthetic likelihood term (with weight 1 - a) is integrated to both encourage the generator to generate realistic images and to cover all modes ( 1 reconstruction loss), thus meeting the initial two goals. First the likelihood term is converted to a likelihood ratio form which allows for synthetic estimates,
[0063] Now the likelihood ratio
can be estimated using a classifier. To do this, the auxiliary variable y is introduced where, y = 1 denotes that the sample was generated and y = 0 denotes that the sample is from the true distribution. Now (6) can be written as (using Bayes theorem),
[0064] The probability
may be estimated using a classifier (image discriminator in fig. 3) which is jointly trained, leading to a
synthetic estimate of the likelihood ratio,
[0065] Note that the synthetic likelihood
is usually estimated using a softmax layer and the likelihood
takes the form
in (7). Both these log-sum-exps are numerically unstable. It can be dealt with the first log- sum-exp using the Jenson-Shannon inequality,
[0066] As stochastic gradient descent is performed, it can be dealt with the second log-sum-exp after stochastic (MC) sampling of the data points. The log- sum-exp can be well estimated using the max - the "Best-of-Many" samples,
[0068] Furthermore, the generator
may be penalized using only the least realistic sample, and the likelihood ratio be estimated directly using
[0069] To further ensure smoothness, the Lipschitz constant K of
may be directly controlled, by setting it to be equal to 1, using Spectral Normalization,
T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida. Spectral normalization for generative adversarial networks. ICLR, 2018.
The synthetic likelihood ratio term is namely unstable during training - as it is the ratio of outputs of a classifier, any instability in the output of the classifier is magnified. Therefore it is proposed to directly estimate the ratio using a network with a controlled Lipschitz constant, which leads to significantly improved stability.
[0070] In contrast to prior work (e.g. Rosea et.al.), (8) provides multiple chances to the recognition network to generate samples likely under the reconstruction based likelihood. Furthermore, the synthetic likelihood term ensures that every generated sample is realistic.
[0071] Intuitively, this objective can be seen as a generalization of prior hybrid VAE-GAN based models. If it is set T = 1 in (8) the exact objective used in the a-GAN model is recovered. Moreover, in e.g. Rosea et.al. for every sample x ~ p(x), the recognition network is used to obtain the exact
from latent space. In contrast, the objective (8) only requires the recognition network to only point to the appropriate region in the latent space.
[0072] Next, a detailed description of the optimization of the hybrid VAE- GAN model is provided using the "Best-of-Many" samples objective, which is called BMS-GAN.
Optimization
[0073] As recent works (e.g. Rosea et.al.) have shown, point-wise minimization of the KL-divergence using its analytical form leads to degradation in generatated image quality. The KL-divergence term can also be recast in a likelihood ratio form (similar as (6)) allowing to leverage synthetic likelihoods using a classifier and minimize it globally instead of point-wise. The latent space discriminator DL is used to enforce the KL-divergence constraint in
(8).
[0074] During optimization, samples from the true data distribution x ~ p(x) are first sampled. For each x, the recognition network
gives a region of the latent space It is assumed The generator
now generates samples in the data (image) space
from that region of the latent space. These samples are then given as input to the data
(image) discriminator DI, which provides a synthetic estimate of the likelihood. The latent space discriminator DL uses the latent samples
to provide a synthetic estimate of the divergence
[0075] Based on the generated samples and synthetic likelihood estimates, it is now updated: 1. DI and DL using the standard GAN update rule (using true and generated samples
2.
using synthetic likelihood estimates from DI, DL and the "Best-of-Many" reconstruction cost max; log
using synthetic likelihood estimate from D, and the "Best-of-Many" reconstruction cost.
[0076] Throughout the description, including the claims, the term "comprising a" should be understood as being synonymous with "comprising at least one" unless otherwise stated. In addition, any range set forth in the description, including the claims should be understood as including its end value(s) unless otherwise stated. Specific values for described elements should be understood to be within accepted manufacturing or industry tolerances known to one of skill in the art, and any use of the terms "substantially" and/or "approximately" and/or "generally" should be understood to mean falling within such accepted tolerances.
[0077] Although the present disclosure herein has been described with reference to particular embodiments, it is to be understood that these embodiments are merely illustrative of the principles and applications of the present disclosure.
[0078] It is intended that the specification and examples be considered as exemplary only, with a true scope of the disclosure being indicated by the following claims.
Claims
1. A method of training a model for image generation,
the model comprising a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework,
the method comprising the steps of:
a - multiple input (S01) of an input image into the VAE which outputs in response multiple distinct output image samples,
b - determine (S02) the best of the multiple output image samples as a best- of-many sample, the best-of-many sample having the minimum reconstruction cost,
c - train (S03) the model based on a predefined training objective, the predefined training objective integrating the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
2. The method according to any one of the preceding claims 1, wherein the model is trained by using only the best-of-many sample for training the model and by disregarding the further multiple output image samples.
3. The method according to any one of the preceding claims 1 and 2, wherein
the model is trained based on the best-of-many sample in relation to the input image according to a predefined VAE objective.
4. The method according to any one of the preceding claims, wherein the model is a deep neural network or comprises at least one deep neural network.
5. The method according to any one of the preceding claims, wherein the model comprises:
a variational auto-encoder (VAE) including a recognition network and a generator, and
a generative adversarial network (GAN) including a generator and a discriminator.
6. The method according to the preceding claim, wherein the variational auto-encoder (VAE) and the generative adversarial network (GAN) share a common generator.
7. The method according to any one of the preceding claims, wherein the model is trained in step c based on the GAN-based synthetic likelihood term to learn generating sharper images by leveraging a discriminator of the GAN which is jointly trained to distinguish between real and generated images.
8. The method according to any one of the preceding claims, wherein during each training iteration the latent distribution of the input image is sampled by:
multiple input of the input image into a recognition network which outputs in response respective regions in a latent space, and
generation of respective output image samples in the image space by inputting the respective regions in the latent space into a generator.
9. The method according to any one of the preceding claims, wherein the output image samples are inputted into a discriminator of the GAN which outputs the GAN-based synthetic likelihood term, or
only the worst of the multiple output image samples is inputted into a discriminator of the GAN which outputs the GAN-based synthetic likelihood term.
10. The method according to any one of the preceding claims, wherein the Lipschitz constant of the GAN-based synthetic likelihood term is constrained to be equal to a predetermined value, in particular equal to 1, using Spectral Normalization.
11. A system for training a model for image generation,
the model comprising a hybrid variational auto-encoder (VAE) - generative adversarial network (GAN) framework, the system comprising:
a module A configured for a multiple input of an input image into the VAE which outputs in response multiple distinct output image samples,
a module B for determining the best of the multiple output image samples as a best-of-many sample, the best-of-many sample having the minimum reconstruction cost, and
a module C for training the model based on a predefined training objective, the predefined training objective integrating the best-of-many sample reconstruction cost and a GAN-based synthetic likelihood term.
12. The system according to the preceding claim, further comprising the model.
13. A system for generating an image sample,
comprising the trained model of step c of any one of claims 1 to 10 or of the trained module C of claim 11 or 12.
14. A computer program comprising instructions for executing the steps of the method according to any one of the preceding method claims 1 to 10, when the program is executed by a computer.
15. A recording medium readable by a computer and having recorded thereon a computer program including instructions for executing the steps of a method according to any one of claims 1 to 10.
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US17/610,004 US20220237905A1 (en) | 2019-05-28 | 2019-05-28 | Method and system for training a model for image generation |
| PCT/EP2019/063853 WO2020239208A1 (en) | 2019-05-28 | 2019-05-28 | Method and system for training a model for image generation |
| DE112019007393.1T DE112019007393T5 (en) | 2019-05-28 | 2019-05-28 | Method and system for training a model for image generation |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/EP2019/063853 WO2020239208A1 (en) | 2019-05-28 | 2019-05-28 | Method and system for training a model for image generation |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020239208A1 true WO2020239208A1 (en) | 2020-12-03 |
Family
ID=66793952
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/EP2019/063853 Ceased WO2020239208A1 (en) | 2019-05-28 | 2019-05-28 | Method and system for training a model for image generation |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20220237905A1 (en) |
| DE (1) | DE112019007393T5 (en) |
| WO (1) | WO2020239208A1 (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113081001A (en) * | 2021-04-12 | 2021-07-09 | 杭州电子科技大学 | Method for removing BCG artifact of synchronous EEG-fMRI (electroencephalogram-based magnetic resonance imaging) |
| CN113643400A (en) * | 2021-08-23 | 2021-11-12 | 哈尔滨工业大学(威海) | an image generation method |
| CN113746087A (en) * | 2021-08-19 | 2021-12-03 | 浙江大学 | Controllable generation and evaluation method and system of power grid transient stability samples based on CTGAN |
| CN114880915A (en) * | 2021-11-24 | 2022-08-09 | 中国电力科学研究院有限公司 | Method and device for generating comprehensive energy metering simulation data and storage medium |
| CN121280577A (en) * | 2025-12-05 | 2026-01-06 | 浙江大学 | Digital human modeling method and system combining Gaussian sputtering image and GAN model |
| CN121705722A (en) * | 2026-02-10 | 2026-03-20 | 漳州市恒丽电子有限公司 | A deep learning-based method and system for recognizing watch strap wearing status |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB201718756D0 (en) * | 2017-11-13 | 2017-12-27 | Cambridge Bio-Augmentation Systems Ltd | Neural interface |
| EP3958182B1 (en) * | 2020-08-20 | 2025-07-30 | Dassault Systèmes | Variational auto-encoder for outputting a 3d model |
| CN115423887B (en) * | 2022-08-04 | 2023-05-23 | 北京乐信圣文科技有限责任公司 | Reference coloring method, system and device for face line picture and storage medium |
| CN119478238A (en) * | 2024-11-16 | 2025-02-18 | 海南三捷科技建设有限公司 | A virtual AI modeling method based on CPU image processing |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10595037B2 (en) * | 2016-10-28 | 2020-03-17 | Nec Corporation | Dynamic scene prediction with multiple interacting agents |
-
2019
- 2019-05-28 US US17/610,004 patent/US20220237905A1/en active Pending
- 2019-05-28 WO PCT/EP2019/063853 patent/WO2020239208A1/en not_active Ceased
- 2019-05-28 DE DE112019007393.1T patent/DE112019007393T5/en active Pending
Non-Patent Citations (7)
| Title |
|---|
| ALEXEY DOSOVITSKIY ET AL: "Generating Images with Perceptual Similarity Metrics based on Deep Networks", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 8 February 2016 (2016-02-08), XP080682203 * |
| ALIREZA MAKHZANI ET AL: "Adversarial Autoencoders", 25 May 2016 (2016-05-25), pages 1 - 16, XP055532752, Retrieved from the Internet <URL:https://arxiv.org/pdf/1511.05644.pdf> [retrieved on 20181211] * |
| BHATTACHARYYA APRATIM ET AL: "Accurate and Diverse Sampling of Sequences Based on a "Best of Many" Sample Objective", 2018 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION, IEEE, 18 June 2018 (2018-06-18), pages 8485 - 8493, XP033473772, DOI: 10.1109/CVPR.2018.00885 * |
| IAN J. GOODFELLOWJEAN POUGET-ABADIEMEHDI MIRZABING XUDAVID WARDE-FARLEYSHERJIL OZAIRYAARON COURVILLEYOSHUA BENGIOZ: "Generative Adversarial Nets", ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS, 2014, pages 2672 - 2680, XP055572979, DOI: doi:https://dl.acm.org/citation.cfm?id=2969125 |
| LARS MESCHEDER ET AL: "Adversarial Variational Bayes: Unifying Variational Autoencoders and Generative Adversarial Networks", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 17 January 2017 (2017-01-17), XP081324143 * |
| M. ROSCAB. LAKSHMINARAYANAND. WARDE-FARLEYS. MOHAMED, VARIATIONAL APPROACHES FOR AUTO-ENCODING GENERATIVE ADVERSARIAL NETWORKS, 2017 |
| SHUANGFEI ZHAI ET AL: "GENERATIVE ADVERSARIAL NETWORKS AS VARIA- TIONAL TRAINING OF ENERGY BASED MODELS", 1 January 2017 (2017-01-01), XP055655707, Retrieved from the Internet <URL:https://arxiv.org/pdf/1611.01799.pdf> [retrieved on 20200108] * |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113081001A (en) * | 2021-04-12 | 2021-07-09 | 杭州电子科技大学 | Method for removing BCG artifact of synchronous EEG-fMRI (electroencephalogram-based magnetic resonance imaging) |
| CN113081001B (en) * | 2021-04-12 | 2022-04-01 | 杭州电子科技大学 | Method for removing BCG artifact of synchronous EEG-fMRI (electroencephalogram-based magnetic resonance imaging) |
| CN113746087A (en) * | 2021-08-19 | 2021-12-03 | 浙江大学 | Controllable generation and evaluation method and system of power grid transient stability samples based on CTGAN |
| CN113746087B (en) * | 2021-08-19 | 2023-03-21 | 浙江大学 | Power grid transient stability sample controllable generation and evaluation method and system based on CTGAN |
| CN113643400A (en) * | 2021-08-23 | 2021-11-12 | 哈尔滨工业大学(威海) | an image generation method |
| CN113643400B (en) * | 2021-08-23 | 2022-05-24 | 哈尔滨工业大学(威海) | Image generation method |
| CN114880915A (en) * | 2021-11-24 | 2022-08-09 | 中国电力科学研究院有限公司 | Method and device for generating comprehensive energy metering simulation data and storage medium |
| CN121280577A (en) * | 2025-12-05 | 2026-01-06 | 浙江大学 | Digital human modeling method and system combining Gaussian sputtering image and GAN model |
| CN121705722A (en) * | 2026-02-10 | 2026-03-20 | 漳州市恒丽电子有限公司 | A deep learning-based method and system for recognizing watch strap wearing status |
Also Published As
| Publication number | Publication date |
|---|---|
| DE112019007393T5 (en) | 2022-03-03 |
| US20220237905A1 (en) | 2022-07-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020239208A1 (en) | Method and system for training a model for image generation | |
| Zhang et al. | Towards consistent video editing with text-to-image diffusion models | |
| RU2370831C2 (en) | Method of evaluating noise using step-by-step bayesian analysis | |
| US10614347B2 (en) | Identifying parameter image adjustments using image variation and sequential processing | |
| Wehenkel et al. | Diffusion priors in variational autoencoders | |
| CN112488148B (en) | Clustering methods and apparatus based on variational autoencoders | |
| US11829869B2 (en) | Multiple task transfer learning | |
| CN113837205A (en) | Method, apparatus, device and medium for image feature representation generation | |
| JP2022075620A (en) | Methods and systems for training convolutional neural networks | |
| Lin et al. | Cs-isolate: Extracting hard confident examples by content and style isolation | |
| US12430905B2 (en) | Methods, devices, and computer readable media for training a keypoint estimation network using cGAN-based data augmentation | |
| CN118397382A (en) | Image increment learning method based on label smoothing and distribution regularization | |
| CN116524070B (en) | A text-based method and system for editing scene images | |
| Cowen et al. | Lsalsa: accelerated source separation via learned sparse coding | |
| CN116861855A (en) | Multi-mode medical resource determining method, device, computer equipment and storage medium | |
| WO2022198210A1 (en) | Efficient pose estimation through iterative refinement | |
| WO2025050994A1 (en) | Method and apparatus for image generation, and device and storage medium | |
| CN120182145A (en) | A fisheye image distortion correction method and device | |
| CN117479013B (en) | Imaging jitter removing method for linear array camera under multi-axis motion platform | |
| CN119922393A (en) | Customize motion and appearance in video generation | |
| EP3726463B1 (en) | Learning device, learning method, sorting method, and storage medium | |
| Casas et al. | Few-shot meta-denoising | |
| CN117788646A (en) | Image generation method and device, electronic device, and readable storage medium | |
| CN117541504A (en) | Image blind deblurring method, device, equipment and medium | |
| CN117435896A (en) | A verification set synthesis method without segmentation in imbalanced classification scenarios |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19729198 Country of ref document: EP Kind code of ref document: A1 |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19729198 Country of ref document: EP Kind code of ref document: A1 |








