{"id":1701,"date":"2019-01-16T18:00:02","date_gmt":"2019-01-17T02:00:02","guid":{"rendered":"https:\/\/live-cometml.pantheonsite.io\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/"},"modified":"2019-01-16T18:00:02","modified_gmt":"2019-01-17T02:00:02","slug":"a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream","status":"publish","type":"post","link":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/","title":{"rendered":"A CNN can learn Mir\u00f3\u2019 surrealism: Joan Mir\u00f3 Neural Style Transfer &#038; DeepDream"},"content":{"rendered":"\n<p>&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>Note: this article originally appeared on Ra\u00fal G\u00f3mez\u2019s website at\u00a0<\/em><a href=\"https:\/\/gombru.github.io\/2019\/01\/14\/miro_styletransfer_deepdream\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/gombru.github.io\/2019\/01\/14\/miro_styletransfer_deepdream\/<\/a><em>\u00a0and was reposted here with his permission. We highly encourage you to read the rest of Ra\u00fal\u2019s pieces\u00a0<\/em><a href=\"https:\/\/gombru.github.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a><em>.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Neural Style Transfer<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">The Neural Style Transfer Algorithm<\/h3>\n\n\n\n<p>Neural Style Transfer uses Deep Convolutional Neural Networks to transfer the\u00a0<em>style<\/em>\u00a0of one source image to another keeping its\u00a0<em>content<\/em>. It\u2019s often applied to transfer the style of a painting to a real word image. The key here is: How do we define\u00a0<em>style<\/em>\u00a0and how do we define\u00a0<em>content<\/em>?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>Style<\/em>: Aesthetic of the image (line style, color range, brush strokes, cubist patterns, etc.)<\/li>\n<li><em>Content<\/em>: Image objects and shapes that make the scene recognizable.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How are style and content represented in a CNN?<\/h3>\n\n\n\n<p>CNNs are attached convolutional layers where each layer processes the previous layer output. The first convolutional layer operates directly over the image pixels. Regardless the task the CNN is optimized for, this layer will learn to recognize simple patterns from images, such as edges or color. Next layers will learn to recognize a little bit more complex patterns, such as corners or textures. Last layers will learn to recognize more complex patterns related to the task the CNN is optimized for. If it is trained to classify buildings, it will be sensible to windows or door shapes, and if it is trained to classify faces, it will sensible to eyes or mouths. Simple features (extracted by the first layers) are called low-level features, and complex features (extracted by the lasts layers) high-level features.<\/p>\n\n\n\n<figure class=\"wp-block-image alignwide\"><img decoding=\"async\" class=\"wp-image-1125\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/cnn-feature-maps-1024x166-1.jpg\" alt=\"\" \/>\n<figcaption>Feature maps of AlexNet layers from a model trained for detection of human faces. Source:\u00a0<a href=\"https:\/\/becominghuman.ai\/what-exactly-does-cnn-see-4d436d8e6e52.\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/becominghuman.ai\/what-exactly-does-cnn-see-4d436d8e6e52.<\/a><\/figcaption>\n<\/figure>\n\n\n\n<p>Based on those observations, Neural Style proposes the following definitions (simplified):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>Style<\/em>: Two images are similar in\u00a0<em>style<\/em>\u00a0if their CNN low-level features are similar.<\/li>\n<li><em>Content<\/em>: Two images are similar in\u00a0<em>content<\/em>\u00a0if their CNN high-level features are similar.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How does it work?<\/h3>\n\n\n\n<p>Neural Style Transfer uses two different CNNs in the training phase: An\u00a0<strong>Image Transformation Network<\/strong>, which is the one trained and the one that will generate the styled images, and a\u00a0<strong>Loss Network<\/strong>, which is a pretrained and frozen classification CNN (VGG-16) used to compute the\u00a0<em>Style-Loss<\/em>\u00a0and the\u00a0<em>Content-Loss<\/em>\u00a0used to train the Image Transformation Network.<\/p>\n\n\n\n<p>The training process is as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>We chose a\u00a0<strong>source style image<\/strong>\u00a0(in our case a\u00a0<strong>Joan Mir\u00f3 painting<\/strong>\u00a0image) and we forward it though the Loss Network (VGG-16).<\/li>\n<li>Then we use a general classification dataset, such as ImageNet. We forward each ImageNet image though the Loss Network, and compute a\u00a0<em>Style-Loss<\/em>\u00a0based on the similarity between low-level activations with the source style image.<\/li>\n<li>Then we forward the ImageNet image though the Image Transformation Network, and forward its output through the Loss Network.<\/li>\n<li>There, a\u00a0<em>Content-Loss<\/em>\u00a0based on the similarity between higher-level activations with the original ImageNet image.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" class=\"wp-image-1126\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/neural-style-transfer-training.png\" alt=\"\" \/>\n<figcaption>Neural Style Transfer training pipeline<\/figcaption>\n<\/figure>\n\n\n\n<p>The Neural Style transfer algorithm I\u2019ve schematically explained and used here was developed by Google. It\u2019s explained deeply in their paper\u00a0<a href=\"https:\/\/arxiv.org\/abs\/1610.07629\" target=\"_blank\" rel=\"noreferrer noopener\">\u201cA Learned Representation for Artistic Style\u201d<\/a>\u00a0and also in their\u00a0<a href=\"https:\/\/ai.googleblog.com\/2016\/10\/supercharging-style-transfer.html\" target=\"_blank\" rel=\"noreferrer noopener\">blog post<\/a>\u00a0about it. This Google work is based on Justin Johnson paper\u00a0<a href=\"https:\/\/arxiv.org\/abs\/1603.08155\" target=\"_blank\" rel=\"noreferrer noopener\">\u201cPerceptual Losses for Real-Time Style Transfer and Super-Resolution\u201d<\/a>.<\/p>\n\n\n\n<p>To train the Joan Mir\u00f3 style transfer model, I\u2019ve used TensorFlow Magenta implementation, which is available\u00a0<a href=\"https:\/\/github.com\/tensorflow\/magenta\/tree\/master\/magenta\/models\/image_stylization\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Mir\u00f3 Neural Style Transfer<\/h3>\n\n\n\n<p>I trained a Neural Style Transfer model with 9 different Joan Mir\u00f3 paintings source styles. Here I show the results in a few testing images.<\/p>\n\n\n\n<p><strong>Results in my cat image for the 9 source styles.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" class=\"wp-image-1127\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/cat-miro-styles-1.png\" alt=\"\" \/>\n<figcaption>The 9 Mir\u00f3 source styles (top) and the styled images of the cat.<\/figcaption>\n<\/figure>\n\n\n\n<p><strong>More styling: We show the original image and the source style image, along with the styled image in sets of three.<\/strong><\/p>\n\n\n\n<p>Which one is your favorite?<\/p>\n\n\n\n<p>Set #1:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1128\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-11-1024x576-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1129\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-12.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/00edQdPKQrxttisjE.png\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<p>Set #2:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1130\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-21-1024x576-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1131\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-22.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/0cQ_Cnm6rVsDT4d-Y.png\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<p>Set #3:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1132\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-31-1024x768-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1133\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-32.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/07Pjq5c31HHp1eTIS.png\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<p>Set #4:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1134\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-41-1024x768-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1135\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-42.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/0a9laRhRzOedVXcnM.png\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<p>Set #5:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1136\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-51-1024x768-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1137\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-52.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/0o2h2auLUA0Gq7yFU.png\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<p>Set #6:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1138\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-61-1024x768-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1139\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-62.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/0Bfg5oXWipOXk_LdH.png\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<p>Set #7:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1140\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-71-1024x768-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1141\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-72.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/0QmHHc8DK8AQIVbmr.png\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<p>Set #8:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1142\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-81.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1143\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-82.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1144\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-83.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<p>Set #9:<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1145\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-91-1024x576-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1146\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/set-92.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/0Rj7TxC4URSPqD5-q.png\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">DeepDream<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">The DeepDream algorithm<\/h3>\n\n\n\n<p>DeepDream is an\u00a0<a href=\"https:\/\/ai.googleblog.com\/2015\/06\/inceptionism-going-deeper-into-neural.html\" target=\"_blank\" rel=\"noreferrer noopener\">algorithm by Google<\/a>\u00a0that magnifies the visual features that a CNN detects in an image, producing images where the recognized patterns are amplified. I research in methods to learn visual features from paired visual and textual data in a self-supervised way. A natural source of this multimodal data is the Web and the social media networks.\u00a0<strong>A detailed explanation of how I train this models, of how the DeepDream algorithm works, and of how I apply it to them, can be found in\u00a0<\/strong><a href=\"https:\/\/gombru.github.io\/2018\/10\/10\/barcelona_deepdream\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>the Barcelona Deep Dream blog post<\/strong><\/a><strong>\u00a0where I apply DeepDream to a model trained with #Barcelona Instagram data. I recommend reading it to understand what we are visualizing in the following images<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Mir\u00f3 DeepDream<\/h3>\n\n\n\n<p>I collected 200K Instagram posts containing #joanmiro and #miro hashtags, and trained a CNN model to learn visual features from those images using the text as a supervisory signal. The CNN learns filters to recognize the visual patterns that are most useful to differentiate between images with different associated texts. DeepDream allows to visualize those patterns, amplifying them and showing them in a single image.<\/p>\n\n\n\n<p>The following images show the visual patterns recognized by different layers of the CNN model (GoogleNet).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Mir\u00f3 Forest<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/1gUxbcq4Ljlo5AHCUx4E2dw.gif\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" class=\"wp-image-1147\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/mire-forrest-1024x575-1.jpg\" alt=\"\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Mir\u00f3 Lakes<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/1B93qJiBNXVGqI2wka6khCw.gif\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1148\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/miro-lakes-1024x575-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Mir\u00f3 Lights<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/1zzhsgxmuQWE208VgbD3sfw.gif\" alt=\"\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" class=\"wp-image-1149\" src=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/miro-lights-1024x575-1.jpg\" alt=\"\" \/><\/figure>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Note: this article originally appeared on Ra\u00fal G\u00f3mez\u2019s website at\u00a0https:\/\/gombru.github.io\/2019\/01\/14\/miro_styletransfer_deepdream\/\u00a0and was reposted here with his permission. We highly encourage you to read the rest of Ra\u00fal\u2019s pieces\u00a0here. Neural Style Transfer The Neural Style Transfer Algorithm Neural Style Transfer uses Deep Convolutional Neural Networks to transfer the\u00a0style\u00a0of one source image to another keeping its\u00a0content. It\u2019s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1739,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"customer_name":"","customer_description":"","customer_industry":"","customer_technologies":"","customer_logo":"","footnotes":""},"categories":[6,7],"tags":[],"coauthors":[107],"class_list":["post-1701","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A CNN can learn Mir\u00f3\u2019 surrealism: Joan Mir\u00f3 Neural Style Transfer &amp; DeepDream - Comet<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A CNN can learn Mir\u00f3\u2019 surrealism: Joan Mir\u00f3 Neural Style Transfer &amp; DeepDream\" \/>\n<meta property=\"og:description\" content=\"&nbsp; Note: this article originally appeared on Ra\u00fal G\u00f3mez\u2019s website at\u00a0https:\/\/gombru.github.io\/2019\/01\/14\/miro_styletransfer_deepdream\/\u00a0and was reposted here with his permission. We highly encourage you to read the rest of Ra\u00fal\u2019s pieces\u00a0here. Neural Style Transfer The Neural Style Transfer Algorithm Neural Style Transfer uses Deep Convolutional Neural Networks to transfer the\u00a0style\u00a0of one source image to another keeping its\u00a0content. It\u2019s [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/\" \/>\n<meta property=\"og:site_name\" content=\"Comet\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cometdotml\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-17T02:00:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/cat-miro-styles.png\" \/>\n\t<meta property=\"og:image:width\" content=\"753\" \/>\n\t<meta property=\"og:image:height\" content=\"481\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Gideon Mendels\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Cometml\" \/>\n<meta name=\"twitter:site\" content=\"@Cometml\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gideon Mendels\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"A CNN can learn Mir\u00f3\u2019 surrealism: Joan Mir\u00f3 Neural Style Transfer & DeepDream - Comet","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/","og_locale":"en_US","og_type":"article","og_title":"A CNN can learn Mir\u00f3\u2019 surrealism: Joan Mir\u00f3 Neural Style Transfer & DeepDream","og_description":"&nbsp; Note: this article originally appeared on Ra\u00fal G\u00f3mez\u2019s website at\u00a0https:\/\/gombru.github.io\/2019\/01\/14\/miro_styletransfer_deepdream\/\u00a0and was reposted here with his permission. We highly encourage you to read the rest of Ra\u00fal\u2019s pieces\u00a0here. Neural Style Transfer The Neural Style Transfer Algorithm Neural Style Transfer uses Deep Convolutional Neural Networks to transfer the\u00a0style\u00a0of one source image to another keeping its\u00a0content. It\u2019s [&hellip;]","og_url":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/","og_site_name":"Comet","article_publisher":"https:\/\/www.facebook.com\/cometdotml","article_published_time":"2019-01-17T02:00:02+00:00","og_image":[{"width":753,"height":481,"url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/cat-miro-styles.png","type":"image\/png"}],"author":"Gideon Mendels","twitter_card":"summary_large_image","twitter_creator":"@Cometml","twitter_site":"@Cometml","twitter_misc":{"Written by":"Gideon Mendels","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/#article","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/"},"author":{"name":"engineering@atre.net","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/550ac35e8e821db8064c5bd1f0a04e6b"},"headline":"A CNN can learn Mir\u00f3\u2019 surrealism: Joan Mir\u00f3 Neural Style Transfer &#038; DeepDream","datePublished":"2019-01-17T02:00:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/"},"wordCount":873,"publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/cat-miro-styles.png","articleSection":["Machine Learning","Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/","url":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/","name":"A CNN can learn Mir\u00f3\u2019 surrealism: Joan Mir\u00f3 Neural Style Transfer & DeepDream - Comet","isPartOf":{"@id":"https:\/\/www.comet.com\/site\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/#primaryimage"},"image":{"@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/#primaryimage"},"thumbnailUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/cat-miro-styles.png","datePublished":"2019-01-17T02:00:02+00:00","breadcrumb":{"@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/#primaryimage","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/cat-miro-styles.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2022\/06\/cat-miro-styles.png","width":753,"height":481,"caption":"Nine Mir\u00f3 source styles images of cat"},{"@type":"BreadcrumbList","@id":"https:\/\/www.comet.com\/site\/blog\/a-cnn-can-learn-miro-surrealism-joan-miro-neural-style-transfer-deepdream\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.comet.com\/site\/"},{"@type":"ListItem","position":2,"name":"A CNN can learn Mir\u00f3\u2019 surrealism: Joan Mir\u00f3 Neural Style Transfer &#038; DeepDream"}]},{"@type":"WebSite","@id":"https:\/\/www.comet.com\/site\/#website","url":"https:\/\/www.comet.com\/site\/","name":"Comet","description":"Build Better Models Faster","publisher":{"@id":"https:\/\/www.comet.com\/site\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.comet.com\/site\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.comet.com\/site\/#organization","name":"Comet ML, Inc.","alternateName":"Comet","url":"https:\/\/www.comet.com\/site\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/","url":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","contentUrl":"https:\/\/www.comet.com\/site\/wp-content\/uploads\/2025\/01\/logo_comet_square.png","width":310,"height":310,"caption":"Comet ML, Inc."},"image":{"@id":"https:\/\/www.comet.com\/site\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cometdotml","https:\/\/x.com\/Cometml","https:\/\/www.youtube.com\/channel\/UCmN63HKvfXSCS-UwVwmK8Hw"]},{"@type":"Person","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/550ac35e8e821db8064c5bd1f0a04e6b","name":"engineering@atre.net","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.comet.com\/site\/#\/schema\/person\/image\/027c18177377edf459980f0cfb83706c","url":"https:\/\/secure.gravatar.com\/avatar\/d002a459a297e0d1779329318029aee19868c312b3e1f3c9ec9b3e3add2740de?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d002a459a297e0d1779329318029aee19868c312b3e1f3c9ec9b3e3add2740de?s=96&d=mm&r=g","caption":"engineering@atre.net"},"sameAs":["https:\/\/live-cometml.pantheonsite.io"],"url":"https:\/\/www.comet.com\/site\/blog\/author\/engineeringatre-net\/"}]}},"_links":{"self":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/1701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/comments?post=1701"}],"version-history":[{"count":0,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/posts\/1701\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media\/1739"}],"wp:attachment":[{"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/media?parent=1701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/categories?post=1701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/tags?post=1701"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.comet.com\/site\/wp-json\/wp\/v2\/coauthors?post=1701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}