{"id":3482,"date":"2016-04-21T14:39:22","date_gmt":"2016-04-21T05:39:22","guid":{"rendered":"https:\/\/deeplearning.jp\/?page_id=693"},"modified":"2017-07-21T13:00:01","modified_gmt":"2017-07-21T04:00:01","slug":"cvae","status":"publish","type":"page","link":"https:\/\/deeplearning.jp\/en\/cvae\/","title":{"rendered":"Conditional Variational Autoencoder (CVAE)"},"content":{"rendered":"<p>We would like to introduce conditional variational autoencoder (CVAE) [2][3], a deep generative model,\u00a0and show our online demonstration (<a href=\"http:\/\/52.69.107.87\/\">Facial VAE<\/a>).\u00a0We believe that the CVAE method is very promising to many fields, such as image generation, anomaly detection problems, and so on.<\/p>\n<h2>VAE<\/h2>\n<p>Variational autoencoder (VAE) [1] is a generative model which utilizes deep neural networks to describe the distribution of observed and latent (unobserved) variables. Using the VAE model,\u00a0we assume that the data x is generated by p\u03b8(x|z) where \u03b8 denotes the parameter of deep neural networks. Given the data x, we want to maximize the log-likelihood logp(x)\u00a0and in order to solve this problem, we can use variational inference. The main principle of variatioal inference is to introduce an approximate distribution q(z|x) and maximize the lower bound instead of the log-likelihood. In VAE, the approximate distribution q(z|x) can be parameterized by q\u03c6(z|x) where \u03c6 means the parameter of deep neural networks. We usually call p(x|z) the encoder (or the recognition model) and q(z|x) the decoder (or the generative model). From this point of view, we can consider this model as a different kind of autoencoder and why it is called variational \u201cautoencoder\u201d.\u00a0By\u00a0using the training algorithm Stochastic Gradient Variational Bayes (SGVB),<i>\u00a0<\/i>we can train deep neural networks on VAE by backpropagation. If you want to know VAE algorithm in detail, please see [1].<\/p>\n<p>VAE can reconstruct the data such as normal autoencoders. Moreover, VAE can generate samples from random values by using the decoder p(x|z). Note that these generated samples are not actually exist in the original training data. VAE trains the probability distribution p(x|z) which is most likely to generate the original data, therefore we can generate new samples which look like the original data.<\/p>\n<p><a href=\"http:\/\/935.835.myftpupload.com\/wp-content\/uploads\/2016\/04\/vae.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-816 aligncenter\" src=\"http:\/\/935.835.myftpupload.com\/wp-content\/uploads\/2016\/04\/vae-300x174.png\" alt=\"vae\" width=\"300\" height=\"174\" \/><\/a><\/p>\n<h2>CVAE<\/h2>\n<p>Conditional VAE [2][3] is VAE architecture conditioning on another description of the data, y.\u00a0 In this model, we can generate samples from the conditional distribution p(x|y). By changing the value of y, such as numbers of labels in MNIST, we can get corresponding samples x~p(x|y).<\/p>\n<p><a href=\"http:\/\/935.835.myftpupload.com\/wp-content\/uploads\/2016\/04\/cvae.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-815 aligncenter\" src=\"http:\/\/935.835.myftpupload.com\/wp-content\/uploads\/2016\/04\/cvae-300x238.png\" alt=\"cvae\" width=\"300\" height=\"238\" \/><\/a><\/p>\n<h2>Application : Facial VAE<\/h2>\n<p>To demonstrate and explain how CVAE can apply to real face images we created \u201cFacial VAE\u201d.\u00a0This demo is inspired from [4][5]. In our demo, we can generate face images conditioned on attributes, such as male, young and so on. Moreover, we combine VAE and Generative Adversarial Networks (GAN) [6]\u00a0 into one model in order to generate clearer images.\u00a0 The most significant difference between [4][5] and ours\u00a0is the ability to infer attributes from an image given by a user.\u00a0Therefore, if you submit your image to Facial VAE, you will get the corresponding attributes and a reconstruction of the image.\u00a0 Moreover, if you change the attributes, then you will get a new generated image conditioned based on those attributes.<\/p>\n<p><a href=\"http:\/\/935.835.myftpupload.com\/wp-content\/uploads\/2016\/04\/overview.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-817 aligncenter\" src=\"http:\/\/935.835.myftpupload.com\/wp-content\/uploads\/2016\/04\/overview-300x170.png\" alt=\"overview\" width=\"550\" height=\"311\" \/><\/a><\/p>\n<p>Facial VAE &#8211;\u00a0<a href=\"http:\/\/fvae.ail.tokyo\">Demo<\/a><\/p>\n<p><b>Please give try our demo!<\/b><\/p>\n<p>[1] Kingma, Diederik P., and Max Welling. &#8220;Auto-encoding variational bayes.&#8221; <i>arXiv preprint arXiv:1312.6114<\/i> (2013).<\/p>\n<p>[2] Kingma, Diederik P., et al. &#8220;Semi-supervised learning with deep generative models.&#8221; <i>Advances in Neural Information Processing Systems<\/i>. 2014.<\/p>\n<p>[3] Sohn, Kihyuk, Honglak Lee, and Xinchen Yan. &#8220;Learning Structured Output Representation using Deep Conditional Generative Models.&#8221; <i>Advances in Neural Information Processing Systems<\/i>. 2015.<\/p>\n<p>[4] Larsen, Anders Boesen Lindbo, S\u00f8ren Kaae S\u00f8nderby, and Ole Winther. &#8220;Autoencoding beyond pixels using a learned similarity metric.&#8221; <i>arXiv preprint arXiv:1512.09300<\/i> (2015).<\/p>\n<p>[5] Generating Faces with Torch (<a href=\"http:\/\/torch.ch\/blog\/2015\/11\/13\/gan.html\">http:\/\/torch.ch\/blog\/2015\/11\/13\/gan.html<\/a>)<\/p>\n<p>[6] Goodfellow, Ian, et al. &#8220;Generative adversarial nets.&#8221; <i>Advances in Neural Information Processing Systems<\/i>. 2014.<\/p>","protected":false},"excerpt":{"rendered":"<p>We would like to introduce conditional variational autoencoder (CVAE) [2][3], a deep  <a class=\"read-more\" href=\"https:\/\/deeplearning.jp\/en\/cvae\/\"> more <i class=\"fa fa-arrow-right\" aria-hidden=\"true\"><\/i><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"tags":[],"class_list":["post-3482","page","type-page","status-publish","hentry"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"We would like to introduce conditional variational auto\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/deeplearning.jp\/en\/cvae\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\n\t\t<!-- Google tag (gtag.js) -->\n<script async src=\"https:\/\/www.googletagmanager.com\/gtag\/js?id=G-S7YG337LDD\"><\/script>\n<script>\n  window.dataLayer = window.dataLayer || [];\n  function gtag(){dataLayer.push(arguments);}\n  gtag('js', new Date());\n\n  gtag('config', 'G-S7YG337LDD');\n<\/script>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Deep Learning JP\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Conditional Variational Autoencoder (CVAE) | Deep Learning JP\" \/>\n\t\t<meta property=\"og:description\" content=\"We would like to introduce conditional variational auto\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/deeplearning.jp\/en\/cvae\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/deeplearning.jp\/wp-content\/uploads\/2018\/06\/img_DLapplied-1.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/deeplearning.jp\/wp-content\/uploads\/2018\/06\/img_DLapplied-1.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"450\" \/>\n\t\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2016-04-21T05:39:22+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2017-07-21T04:00:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Conditional Variational Autoencoder (CVAE) | Deep Learning JP\" \/>\n\t\t<meta name=\"twitter:description\" content=\"We would like to introduce conditional variational auto\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/deeplearning.jp\/wp-content\/uploads\/2018\/06\/img_DLapplied-1.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/cvae\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/cvae\\\/#listItem\",\"name\":\"Conditional Variational Autoencoder (CVAE)\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/cvae\\\/#listItem\",\"position\":2,\"name\":\"Conditional Variational Autoencoder (CVAE)\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/#listItem\",\"name\":\"Home\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/#organization\",\"name\":\"Deep Learning JP\",\"description\":\"Discover the Gradient\",\"url\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/cvae\\\/#webpage\",\"url\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/cvae\\\/\",\"name\":\"Conditional Variational Autoencoder (CVAE) | Deep Learning JP\",\"description\":\"We would like to introduce conditional variational auto\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/cvae\\\/#breadcrumblist\"},\"datePublished\":\"2016-04-21T14:39:22+09:00\",\"dateModified\":\"2017-07-21T13:00:01+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/\",\"name\":\"Deep Learning JP\",\"description\":\"Discover the Gradient\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/deeplearning.jp\\\/en\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Conditional Variational Autoencoder (CVAE) | Deep Learning JP","description":"We would like to introduce conditional variational auto","canonical_url":"https:\/\/deeplearning.jp\/en\/cvae\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":"&lt;!-- Google tag (gtag.js) --&gt;\n&lt;script async src=\"https:\/\/www.googletagmanager.com\/gtag\/js?id=G-S7YG337LDD\"&gt;&lt;\/script&gt;\n&lt;script&gt;\n  window.dataLayer = window.dataLayer || [];\n  function gtag(){dataLayer.push(arguments);}\n  gtag('js', new Date());\n\n  gtag('config', 'G-S7YG337LDD');\n&lt;\/script&gt;"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/deeplearning.jp\/en\/cvae\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/deeplearning.jp\/en\/#listItem","position":1,"name":"Home","item":"https:\/\/deeplearning.jp\/en\/","nextItem":{"@type":"ListItem","@id":"https:\/\/deeplearning.jp\/en\/cvae\/#listItem","name":"Conditional Variational Autoencoder (CVAE)"}},{"@type":"ListItem","@id":"https:\/\/deeplearning.jp\/en\/cvae\/#listItem","position":2,"name":"Conditional Variational Autoencoder (CVAE)","previousItem":{"@type":"ListItem","@id":"https:\/\/deeplearning.jp\/en\/#listItem","name":"Home"}}]},{"@type":"Organization","@id":"https:\/\/deeplearning.jp\/en\/#organization","name":"Deep Learning JP","description":"Discover the Gradient","url":"https:\/\/deeplearning.jp\/en\/"},{"@type":"WebPage","@id":"https:\/\/deeplearning.jp\/en\/cvae\/#webpage","url":"https:\/\/deeplearning.jp\/en\/cvae\/","name":"Conditional Variational Autoencoder (CVAE) | Deep Learning JP","description":"We would like to introduce conditional variational auto","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/deeplearning.jp\/en\/#website"},"breadcrumb":{"@id":"https:\/\/deeplearning.jp\/en\/cvae\/#breadcrumblist"},"datePublished":"2016-04-21T14:39:22+09:00","dateModified":"2017-07-21T13:00:01+09:00"},{"@type":"WebSite","@id":"https:\/\/deeplearning.jp\/en\/#website","url":"https:\/\/deeplearning.jp\/en\/","name":"Deep Learning JP","description":"Discover the Gradient","inLanguage":"en-US","publisher":{"@id":"https:\/\/deeplearning.jp\/en\/#organization"}}]},"og:locale":"en_US","og:site_name":"Deep Learning JP","og:type":"article","og:title":"Conditional Variational Autoencoder (CVAE) | Deep Learning JP","og:description":"We would like to introduce conditional variational auto","og:url":"https:\/\/deeplearning.jp\/en\/cvae\/","og:image":"https:\/\/deeplearning.jp\/wp-content\/uploads\/2018\/06\/img_DLapplied-1.jpg","og:image:secure_url":"https:\/\/deeplearning.jp\/wp-content\/uploads\/2018\/06\/img_DLapplied-1.jpg","og:image:width":450,"og:image:height":300,"article:published_time":"2016-04-21T05:39:22+00:00","article:modified_time":"2017-07-21T04:00:01+00:00","twitter:card":"summary","twitter:title":"Conditional Variational Autoencoder (CVAE) | Deep Learning JP","twitter:description":"We would like to introduce conditional variational auto","twitter:image":"https:\/\/deeplearning.jp\/wp-content\/uploads\/2018\/06\/img_DLapplied-1.jpg"},"aioseo_meta_data":{"post_id":"3482","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"WebPage","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2023-11-28 07:34:31","updated":"2023-11-28 07:34:31","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/deeplearning.jp\/en\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tConditional Variational Autoencoder (CVAE)\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/deeplearning.jp\/en\/"},{"label":"Conditional Variational Autoencoder (CVAE)","link":"https:\/\/deeplearning.jp\/en\/cvae\/"}],"_links":{"self":[{"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/pages\/3482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/comments?post=3482"}],"version-history":[{"count":3,"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/pages\/3482\/revisions"}],"predecessor-version":[{"id":6355,"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/pages\/3482\/revisions\/6355"}],"wp:attachment":[{"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/media?parent=3482"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deeplearning.jp\/en\/wp-json\/wp\/v2\/tags?post=3482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}