{"id":215,"date":"2021-03-16T20:29:07","date_gmt":"2021-03-16T19:29:07","guid":{"rendered":"http:\/\/www.fabidouille.com\/?p=215"},"modified":"2021-03-16T20:35:19","modified_gmt":"2021-03-16T19:35:19","slug":"deep-learning-palms-on","status":"publish","type":"post","link":"https:\/\/www.fabidouille.com\/?p=215","title":{"rendered":"Deep learning palms-on"},"content":{"rendered":"<p>And Now for Something Completely Different, let\u2019s move away from concrete stuff and bite a bit of Machine Learning abstraction (which \u2013 who knows \u2013 we may plug in a \u201creal life\u201d apparatus) in the good company of indisputably the best story tellers of the 20th century, Carl Barks and Don Rosa.<\/p>\n<h2>The Masters of a rich palmed world<\/h2>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Barks.jpg\">\u00a0Carl Barks, the creator\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-216 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Barks.jpg\" alt=\"\" width=\"262\" height=\"350\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Barks.jpg 262w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Barks-225x300.jpg 225w\" sizes=\"auto, (max-width: 262px) 100vw, 262px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/800px-DonRosa-2.jpg\">Don Rosa, the innovator\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-217\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/800px-DonRosa-2.jpg\" alt=\"\" width=\"467\" height=\"350\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/800px-DonRosa-2.jpg 800w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/800px-DonRosa-2-300x225.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/800px-DonRosa-2-768x576.jpg 768w\" sizes=\"auto, (max-width: 467px) 100vw, 467px\" \/><\/a><\/p>\n<div class=\"wp-block-group\">\n<div class=\"wp-block-group__inner-container\">\n<p>For the unlucky ones who don\u2019t know them, or rather the lucky ones who don\u2019t know them (who can\u2019t worship them (yet)), Carl Barks and Don Rosa are respectively the creator of the wide Duck world and the guy who refreshed the \u201cfranchise\u201d.<\/p>\n<\/div>\n<\/div>\n<p>They both share a tender respect for the both mild and deep universe they created.<\/p>\n<p>A dive into the awe of an anthropomorphic universe, where adventures always mean discoveries, where gold is often but not always at stake, sometimes Goldie is to be found.<\/p>\n<figure id=\"attachment_221\" aria-describedby=\"caption-attachment-221\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Goldie_barks.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-221 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Goldie_barks-300x177.png\" alt=\"\" width=\"300\" height=\"177\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Goldie_barks-300x177.png 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Goldie_barks.png 588w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-221\" class=\"wp-caption-text\">Goldie, an ambiguous acquaintance from Scrooge\u2019s youth<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>As for Goldie, characters are often not what they appear, Donald Duck despite his uncontrollable anger happens to be the best uncle for his three nephews, most cherished treasures of the stingly Scrooge McDuck are clearly not worth a lot of dollars or the lucky-lookingly Gladstone Glander does not live such a wonderful life, really.<\/p>\n<p>Clearly, that\u2019s an invitation to see characters behind appearances.<\/p>\n<h2>Ok, then what?<\/h2>\n<p>Now you may wonder, why such hommage in this blog?<\/p>\n<p>Well, your devoted blog author (myself) being (as you guessed) an idolatrous of this universe, I thought this could be an entertaining opportunity to hands-on Tensorflow, a very accessible neural network framework.<\/p>\n<p>Long term goal is to apply training\/inference to real-world devices with sensors, and actuators.<\/p>\n<p>Short term goal, depicted in this article, will be one of the simplest activity offered out-of-the-box by such frameworks (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Comparison_of_deep-learning_software\" target=\"_blank\" rel=\"noreferrer noopener\">many<\/a>\u00a0coexist) : classification.<\/p>\n<p>How? Well, Carl Barks and Don Rosa have very different drawing styles, obvious to the passionate reader.<\/p>\n<p>So\u00a0<strong>I was wondering whether a cold, (a priori) unpassionate convolutional neural net could figure that out.<\/strong><\/p>\n<h2>Why Tensorflow?<\/h2>\n<p>First, let me restate that this blog is about experiments done out of curiosity, and clearly not written by an expert in the fields and techniques involved.<\/p>\n<p>That being said, your servant (myself) happened to briefly look at the state-of-the-art of neural networks\u2026 at the end of last century (the nineties).<\/p>\n<p>A time when perceptrons and Hopfield topologies were ruling keywords under the then-more-restricted neural network realm. A time those under 20 years old cannot know, a more primitive time where sigmo\u00efd were the only viable activation functions, where you had to write your C++ code for your gradient descent (for the learning phase) with your bare p\u0336a\u0336l\u0336m\u0336s\u0336 hands.<\/p>\n<p>Good that time is now gone!<\/p>\n<p>So, TensorFlow is a miracle of simplicity exposed to the user compared to that. Plus it has good community, good support among hardware vendors (GPU acceleration via Nvidia Cuda and also A\u0336T\u0336I\u0336 AMD ROCm) but also Google Cloud services (such as the excellent Google Colaboratory, a free environment where you can enjoy dedicated 12 GB with Nvidia Volta GPU or Google\u2019s own TPU).<\/p>\n<p>Will that be enough hardware muscles for only a cold, maybe unpassionate network to perceive the specifics of the two creators? Let\u2019s find out!<\/p>\n<h2>By the way, what is a neural network, and how could it classify drawings?<\/h2>\n<p>Hmm, vast subject.<\/p>\n<p>Your minion (the author of these lines) wrote some lines on that subject back in 2001 in a dedicated website (iacom.fr.st, now redirecting to some unclear Japanese contents).<\/p>\n<p>I would have bet without question that this site has completely vanished into the ashes of the past eternity of the web, but to my great surprise the web archive project<a href=\"https:\/\/web.archive.org\/web\/20130626012110\/http:\/\/fabien.ficheau.free.fr\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u00a0kept\u00a0<strong>one<\/strong>\u00a0copy back in 2013<\/a>. Only the front page was saved\u2026<\/p>\n<p>Anyway, one of the best short introductions to contemporary n\u0336e\u0336u\u0336r\u0336a\u0336l\u0336 \u0336n\u0336e\u0336t\u0336w\u0336o\u0336r\u0336k\u0336s\u0336 Deep Learning I can recommend is here:\u00a0<a href=\"https:\/\/codelabs.developers.google.com\/codelabs\/cloud-tensorflow-mnist\/#0\">https:\/\/codelabs.developers.google.com\/codelabs\/cloud-tensorflow-mnist<\/a><\/p>\n<p>If you can afford more time, I\u2019d recommend the Stanford Coursera course (<a href=\"https:\/\/www.coursera.org\/learn\/machine-learning\">https:\/\/www.coursera.org\/learn\/machine-learning<\/a>).<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capture_coursera.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-223\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capture_coursera-300x229.jpg\" alt=\"\" width=\"300\" height=\"229\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capture_coursera-300x229.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capture_coursera-768x587.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capture_coursera.jpg 971w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<figure class=\"wp-block-image size-large is-resized\"><figcaption>Coursera course will reward your studying labours with a certificate, see this as a way to say thank you to Coursera for their otherwise free (&amp; excellent) courses.<\/figcaption><\/figure>\n<p>This ellipsis being made, let\u2019s jump into the dataset preparation!<\/p>\n<h2>Dataset preparation<\/h2>\n<blockquote class=\"wp-block-quote\"><p>\u201cAll quality and no quantity would make our model a dull model.\u201d<\/p>\n<p><cite>Nobody in particular<\/cite><\/p><\/blockquote>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9897_red.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-224\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9897_red-300x200.jpg\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9897_red-300x200.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9897_red-768x511.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9897_red.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9898_red.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-225\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9898_red-300x200.jpg\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9898_red-300x200.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9898_red-768x511.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DSC_9898_red.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>We have plenty of input data available. Btw, check out the superb volumes edited by Glenat (in France) with lots of annotation\/anecdotes, some by Don Rosa himself for the collection dedicated to his work!<\/p>\n<p>In particular if you sometimes fail to discover the hidden D.U.C.K. (<em>Dedicated to Unca Carl from Keno<\/em>) dedications in the first panels of Don Rosa stories.<\/p>\n<h3>Digitization<\/h3>\n<p>I have no doubt that your imagination makes this step unnecessary.<\/p>\n<p>At the end of this stage, we had:<\/p>\n<figure class=\"wp-block-table is-style-stripes\">\n<table>\n<tbody>\n<tr>\n<td class=\"has-text-align-center\" data-align=\"center\"><\/td>\n<td>Stats<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-center\" data-align=\"center\">Carl Barks, in English<\/td>\n<td>1158 files<br \/>\n1.35 GB<br \/>\n1.17 MB per file in average<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-center\" data-align=\"center\">Carl Barks, in French<\/td>\n<td>1544 files<br \/>\n2.8 GB<br \/>\n1.8 MB per file in average<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-center\" data-align=\"center\">Don Rosa, in English<\/td>\n<td>689 files<br \/>\n0.484 GB<br \/>\n0.702 MB per file in average<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-center\" data-align=\"center\">Don Rosa, in French<\/td>\n<td>464 files<br \/>\n0.313 GB<br \/>\n0.676 MB per file in average<\/td>\n<\/tr>\n<\/tbody>\n<\/table><figcaption>Heterogeneous sources, but nearly even FR\/EN ratio (to limit possible learning bias)<\/figcaption><\/figure>\n<h3>Filtering<\/h3>\n<p>Whether we use a stack of only-dense layers (aka old school perceptron) or have mostly convolutional layers, input layer will always have a fixed size, exactly mapping pixel resolution of input images \u2026<\/p>\n<p>This means we have to feed our network during training phase with images of same pixel resolution.<\/p>\n<figure id=\"attachment_239\" aria-describedby=\"caption-attachment-239\" style=\"width: 183px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-239 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement.png\" alt=\"\" width=\"183\" height=\"275\" \/><\/a><figcaption id=\"caption-attachment-239\" class=\"wp-caption-text\">Terminology: A is a panel, B is a borderless panel, green area is a tier, rest is called gutters<\/figcaption><\/figure>\n<figure id=\"attachment_240\" aria-describedby=\"caption-attachment-240\" style=\"width: 189px\" class=\"wp-caption alignnone\"><a style=\"font-weight: bold; font-size: 0.875rem; text-align: center;\" href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/picsou1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-240 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/picsou1.jpg\" alt=\"\" width=\"189\" height=\"266\" \/><\/a><figcaption id=\"caption-attachment-240\" class=\"wp-caption-text\">A typical Don Rosa page<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_242\" aria-describedby=\"caption-attachment-242\" style=\"width: 214px\" class=\"wp-caption alignnone\"><a style=\"font-weight: bold; font-size: 0.875rem; text-align: center;\" href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa8.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-242 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa8-214x300.jpg\" alt=\"\" width=\"214\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa8-214x300.jpg 214w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa8.jpg 425w\" sizes=\"auto, (max-width: 214px) 100vw, 214px\" \/><\/a><figcaption id=\"caption-attachment-242\" class=\"wp-caption-text\">A slightly less usual, but not so unusual, Don Rosa page<\/figcaption><\/figure>\n<div class=\"mceTemp\">\n<p>&nbsp;<\/p>\n<\/div>\n<figure id=\"attachment_243\" aria-describedby=\"caption-attachment-243\" style=\"width: 218px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-243 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-218x300.jpg\" alt=\"\" width=\"218\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-218x300.jpg 218w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-768x1059.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-743x1024.jpg 743w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/a><figcaption id=\"caption-attachment-243\" class=\"wp-caption-text\">A typical Carl Barks page, pretty regular 8 panels page<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>As shown above, terminology related to comics had to be fixed beforehand.<\/p>\n<p>Also, regarding their respective styles, while Carl Barks has a purer, \u201cclassic\u201d stroke of pen, Don Rosa, the engineer by training, has definitely profound sense of detail.<\/p>\n<p>While Carl Barks will often sketch everyday life scenes, Don Rosa tends to lean towards epic setups. Naturally, there are many shades of grey in between, these are only tendencies felt by the human reader which I am.<\/p>\n<figure id=\"attachment_281\" aria-describedby=\"caption-attachment-281\" style=\"width: 189px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/epic_dynamic_bark.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-281 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/epic_dynamic_bark-189x300.jpg\" alt=\"\" width=\"189\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/epic_dynamic_bark-189x300.jpg 189w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/epic_dynamic_bark.jpg 582w\" sizes=\"auto, (max-width: 189px) 100vw, 189px\" \/><\/a><figcaption id=\"caption-attachment-281\" class=\"wp-caption-text\">Carl Barks sometimes deviates from 8 panels layout for dynamic scenes<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Ideally, in order to compare drawing styles of the two authors, we would feed images with same resolutions.<\/p>\n<figure id=\"attachment_244\" aria-describedby=\"caption-attachment-244\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/BARKSLITHO.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-244 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/BARKSLITHO-300x241.jpg\" alt=\"\" width=\"300\" height=\"241\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/BARKSLITHO-300x241.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/BARKSLITHO-768x618.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/BARKSLITHO-1024x824.jpg 1024w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/BARKSLITHO.jpg 1074w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-244\" class=\"wp-caption-text\">One of the many famous Barks lithographies<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_279\" aria-describedby=\"caption-attachment-279\" style=\"width: 194px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/LifeAndTimes.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-279 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/LifeAndTimes-194x300.jpg\" alt=\"\" width=\"194\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/LifeAndTimes-194x300.jpg 194w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/LifeAndTimes.jpg 225w\" sizes=\"auto, (max-width: 194px) 100vw, 194px\" \/><\/a><figcaption id=\"caption-attachment-279\" class=\"wp-caption-text\">Don Rosa also drawed full size images (sometimes for covers)<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Both authors created full size images, which could be good samples. However, in case of Carl Barks the intention is more esthetic arts than support for story telling. His drawing style for lithographies is not similar to the one used in his comics. And we want to analyse the style used in the stories.<\/p>\n<p>Also, due to the vast amount of work and time to create such images, there are much less samples falling in these categories.<\/p>\n<p>So we really want to use for our dataset extracts from stories, not these full size images.<\/p>\n<h4>Page panel extraction : Kumiko<\/h4>\n<p><a href=\"https:\/\/github.com\/njean42\/kumiko\" target=\"_blank\" rel=\"noreferrer noopener\">Kumiko<\/a>\u00a0is an open source tool is a set of tools using OpenCV\u2019s contour detection algorithm to compute meta information on comic pages, such as panels.<\/p>\n<p>A first attempt was done to extract all panels using this tool, but sometimes the algorithm went wrong (borderless panels are difficult to identify). But normalisation would have implied image scaling, and panel shapes are too different to have non destructive shape uniformisation.<\/p>\n<p>So I decided to use images as input of neural networks (knowing that even reduced, such images may not be easy to digest \u2026).<\/p>\n<p>I went for a 1007\u00d7648 format, as a compromise between keeping details and not overwhelming our net.<\/p>\n<p>Many pages are descriptive, fully-fletched with text and various layouts.<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement_B.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-246\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement_B.jpg\" alt=\"\" width=\"189\" height=\"267\" \/><\/a><\/p>\n<p>Also because of Don Rosa\u2019s old engineer habits some pages tend to be \u2026 singular ;), such as these very precious ones, depicting Uncle Scrooge\u2019s money bin secret plans:<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement_B2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-247\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement_B2.jpg\" alt=\"\" width=\"190\" height=\"266\" \/><\/a><\/p>\n<p>Useful for the Beagle boys, but clearly not for us.<\/p>\n<p>In order not to interfere with story telling pages, we use Kumiko to count the number of panels.<\/p>\n<p>Kumiko json output<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-16-59-06.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-248\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-16-59-06-300x38.png\" alt=\"\" width=\"300\" height=\"38\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-16-59-06-300x38.png 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-16-59-06-768x97.png 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-16-59-06-1024x129.png 1024w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-16-59-06.png 1905w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Some Python code helps us to automate the reading-kumiko-panel-meta-information-then-resizing part of input images.<\/p>\n<p>Note, alternatively a rescaling layer can be added at the beginning of our network topology, but that would mean more data to be sent to Colaboratory (as original images are always larger than target resolution).<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-17-02-22.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-249 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-17-02-22.png\" alt=\"\" width=\"733\" height=\"124\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-17-02-22.png 733w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Screenshot-from-2020-08-06-17-02-22-300x51.png 300w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/a><\/p>\n<p>As can be seen, we only select images for which we detect more than three panels.<\/p>\n<p>Results look good, only meaningful images are left.<\/p>\n<p>However, some visually corrupted images were still present.<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks3_corr.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-250\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks3_corr-218x300.jpg\" alt=\"\" width=\"218\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks3_corr-218x300.jpg 218w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks3_corr-768x1059.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks3_corr-743x1024.jpg 743w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/a><\/p>\n<p>Which were easily moved away using, again, simple python logic:<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DETECTCORRUP.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-251 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DETECTCORRUP.jpg\" alt=\"\" width=\"909\" height=\"533\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DETECTCORRUP.jpg 909w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DETECTCORRUP-300x176.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/DETECTCORRUP-768x450.jpg 768w\" sizes=\"auto, (max-width: 909px) 100vw, 909px\" \/><\/a><\/p>\n<p>At the end, 1025 clean files remained for Barks\/FR, 692 for Barks\/EN, 598 for Rosa\/EN and 377 for Rosa\/FR.<\/p>\n<h2>Now, let\u2019s get into Tensorflow!<\/h2>\n<p>As suggested previously, Google Colaboratory is well integrated into Google\u2019s world. Notably Google Drive.<\/p>\n<p>So after having pushed all files filtered and scaled by our previous python logic (~2.3 GB of .png files compressed in .tar.bz2) to a Google Drive folder, it could be mounted on a Colaboratory session.<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLABINTRO.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-252 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLABINTRO.jpg\" alt=\"\" width=\"1553\" height=\"796\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLABINTRO.jpg 1553w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLABINTRO-300x154.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLABINTRO-768x394.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLABINTRO-1024x525.jpg 1024w\" sizes=\"auto, (max-width: 1553px) 100vw, 1553px\" \/><\/a><\/p>\n<p>After some manual (re)exploration of the dataset, it is time to convert images to Keras input dataset format, and at the same time we want to specify the training\/validation ratio.<\/p>\n<p>As we have enough images, we reserve 20% of our sample for the validation:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-253 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB2.jpg\" alt=\"\" width=\"708\" height=\"646\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB2.jpg 708w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB2-300x274.jpg 300w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/a><\/p>\n<p>As we want to train the network to distinguish between Rosa and Barks images, we have two classes, one for each.<\/p>\n<p>The two classes are implicitly detected after the names of the subdirectories from main dataset directories (one class for subdirectory barks\/ and the other for rosa\/).<\/p>\n<p>Then comes the network topology.<\/p>\n<p>Convulational networks tend to be better then multi dense-layers networks because their cubes-2-cubes internal transformations are somehow better at matching shapes.<\/p>\n<p>Also, that smells newer than our retro perceptrons, so let\u2019s go for it!<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-254 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB3.jpg\" alt=\"\" width=\"567\" height=\"406\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB3.jpg 567w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB3-300x215.jpg 300w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><\/p>\n<figure class=\"wp-block-image size-large\"><figcaption>Chosen topology<\/figcaption><\/figure>\n<p>Another disclaimer: this experiment was done in a brief amount of time, so no time at all was spend to experiment on various topology variants.<\/p>\n<p>Only the number of neurons in last dense layer was changed a bit.<\/p>\n<p>The rescaling layer at the beginning is just to normalize inputs from 0-&gt;255 ranges (RGB colors) to 0-&gt;1.<\/p>\n<p>An interesting yet simple explanation for choice of relu activation functions can be read\u00a0<a href=\"https:\/\/codelabs.developers.google.com\/codelabs\/cloud-tensorflow-mnist\/#6\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n<figure id=\"attachment_255\" aria-describedby=\"caption-attachment-255\" style=\"width: 855px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-255 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB4.jpg\" alt=\"\" width=\"855\" height=\"698\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB4.jpg 855w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB4-300x245.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/COLAB4-768x627.jpg 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><\/a><figcaption id=\"caption-attachment-255\" class=\"wp-caption-text\">A summary of model as seen by Tensorflow<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>An important thing is to NOT prefetch images in training or validation sets &#8211; as it is often the case by default -, otherwise training will quickly cause OOMs (not enough RAM) the session, whatever the batch size is. Because our input images are too big.<\/p>\n<p>After 15 epochs (aka training steps) with batches of 16 images each, we converged to a surprisingly good 99.44% accuracy!\u00a0\ud83d\ude42<\/p>\n<p>It took ~22 min to train with a GPU enabled session.<\/p>\n<p>Be careful, by default session starts with no hardware accelerator\u2026 so make sure to select it at begining of your session.<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capturecocolab.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-258\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capturecocolab-300x206.jpg\" alt=\"\" width=\"300\" height=\"206\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capturecocolab-300x206.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/Capturecocolab.jpg 387w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-257 size-full\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement-1.png\" alt=\"\" width=\"496\" height=\"482\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement-1.png 496w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement-1-300x292.png 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/a><\/p>\n<p>Training and accuracy validation plots seem to show 15 epochs should be enough.<\/p>\n<p>However, after attempting some predictions, it appeared another run of 15 epochs did improve results for tested samples.<\/p>\n<p>Despite convergence towards lower accuracy overall:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-259\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement-2-300x292.png\" alt=\"\" width=\"300\" height=\"292\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement-2-300x292.png 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/t\u00e9l\u00e9chargement-2.png 496w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Interesting is that during 2nd run validation accuracy fell a bit before reincreasing, and redecreasing (could be interesting to test with more epochs). This might be related to overfitting.<\/p>\n<p>First more natural steps would be to stop learning as soon as validation accuracy drops, and training accuracy stops growing (slightly after epoch 15).<\/p>\n<p>As we shuffled both training and validation sets, plus we dedicated a good part to validation (20%), it is not sure massively increasing the amount of training data would help a lot. Decreasing number of model parameters could possibly be key. Or alternatively, we could augment training\/validation sets by performing image transformations such as scaling (could help identify full size drawings).<\/p>\n<p>Maybe dropout could be used to reset some neurons at each training iteration. Also, playing with learning rate could be worth testing in a future session.<\/p>\n<p>Funny enough, while reaching a lower accuracy (99.26%), results were much better on samples we used for prediction.<\/p>\n<h2>And now, let\u2019s predict our Duck stories author<\/h2>\n<p>Let\u2019s have a look together at some samples not part of training nor validation set found randomly on the net, and see whether prediction was correct or not (and in parenthesis the confidence factor), and my comments for each picture in legend.<\/p>\n<figure id=\"attachment_260\" aria-describedby=\"caption-attachment-260\" style=\"width: 218px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-260 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks1-218x300.jpg\" alt=\"\" width=\"218\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks1-218x300.jpg 218w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks1-768x1057.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks1-744x1024.jpg 744w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/a><figcaption id=\"caption-attachment-260\" class=\"wp-caption-text\">Correct! (72% confidence) This one from Barks is interesting, this is an unfavorable case, with introductive format. But the model gets the correct answer \ud83d\ude42<\/figcaption><\/figure>\n<figure id=\"attachment_261\" aria-describedby=\"caption-attachment-261\" style=\"width: 218px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-261 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-1-218x300.jpg\" alt=\"\" width=\"218\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-1-218x300.jpg 218w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-1-768x1059.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks2-1-743x1024.jpg 743w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/a><figcaption id=\"caption-attachment-261\" class=\"wp-caption-text\">Correct (100%)! Easy one, very \u201ctypical\u201d from Barks, nothing fancy here.<\/figcaption><\/figure>\n<figure id=\"attachment_262\" aria-describedby=\"caption-attachment-262\" style=\"width: 218px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks6.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-262 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks6-218x300.jpg\" alt=\"\" width=\"218\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks6-218x300.jpg 218w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks6-768x1059.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks6-743x1024.jpg 743w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/a><figcaption id=\"caption-attachment-262\" class=\"wp-caption-text\">Barks, correct(100%)! Nothing fancy either.<\/figcaption><\/figure>\n<figure id=\"attachment_263\" aria-describedby=\"caption-attachment-263\" style=\"width: 218px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-263 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks5-218x300.jpg\" alt=\"\" width=\"218\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks5-218x300.jpg 218w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks5-768x1059.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks5-743x1024.jpg 743w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/a><figcaption id=\"caption-attachment-263\" class=\"wp-caption-text\">Barks, correct (100%)!<\/figcaption><\/figure>\n<figure id=\"attachment_264\" aria-describedby=\"caption-attachment-264\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-264 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks7-300x218.jpg\" alt=\"\" width=\"300\" height=\"218\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks7-300x218.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks7-768x557.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_barks7.jpg 1000w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-264\" class=\"wp-caption-text\">Incorrect (99.86%) \ud83d\ude41 A bit of disappointment for this one. This is an \u201cepic\u201d theme from Carl Barks, not so typical and more Don Rosa like. Even a human would have hesitated! Maybe an improvement of the training could change the result \u2026<\/figcaption><\/figure>\n<figure id=\"attachment_265\" aria-describedby=\"caption-attachment-265\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-265 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks-300x207.jpg\" alt=\"\" width=\"300\" height=\"207\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks-300x207.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks-768x531.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-265\" class=\"wp-caption-text\">This was Barks, but identified as Rosa. Incorrect (100%) \ud83d\ude41<\/figcaption><\/figure>\n<figure id=\"attachment_266\" aria-describedby=\"caption-attachment-266\" style=\"width: 207px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-266 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks2-207x300.jpg\" alt=\"\" width=\"207\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks2-207x300.jpg 207w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks2.jpg 553w\" sizes=\"auto, (max-width: 207px) 100vw, 207px\" \/><\/a><figcaption id=\"caption-attachment-266\" class=\"wp-caption-text\">Incorrect again (100%) \ud83d\ude41 Looks like black&amp;white comics don\u2019t fit in learned Barks\u2019 pattern \u2026 maybe such samples could be added to the training set (but there are few of them)<\/figcaption><\/figure>\n<figure id=\"attachment_267\" aria-describedby=\"caption-attachment-267\" style=\"width: 211px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-267 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks3-211x300.jpg\" alt=\"\" width=\"211\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks3-211x300.jpg 211w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks3-768x1091.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks3-721x1024.jpg 721w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_old_barks3.jpg 981w\" sizes=\"auto, (max-width: 211px) 100vw, 211px\" \/><\/a><figcaption id=\"caption-attachment-267\" class=\"wp-caption-text\">Incorrect (99.86%) \ud83d\ude41 Disappointment. Clearly the colorisation is aged, but the trait is specific to Barks (and note this is the same story as in the 3rd picture)<\/figcaption><\/figure>\n<figure id=\"attachment_268\" aria-describedby=\"caption-attachment-268\" style=\"width: 188px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa4-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-268 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa4-1-188x300.jpg\" alt=\"\" width=\"188\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa4-1-188x300.jpg 188w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa4-1-768x1224.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa4-1-643x1024.jpg 643w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa4-1.jpg 1260w\" sizes=\"auto, (max-width: 188px) 100vw, 188px\" \/><\/a><figcaption id=\"caption-attachment-268\" class=\"wp-caption-text\">Correct (88%) \ud83d\ude42 A full page drawing from Don Rosa, correctly found. Nice!<\/figcaption><\/figure>\n<figure id=\"attachment_269\" aria-describedby=\"caption-attachment-269\" style=\"width: 213px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa3-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-269 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa3-1-213x300.jpg\" alt=\"\" width=\"213\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa3-1-213x300.jpg 213w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa3-1-768x1080.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa3-1-728x1024.jpg 728w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa3-1.jpg 1198w\" sizes=\"auto, (max-width: 213px) 100vw, 213px\" \/><\/a><figcaption id=\"caption-attachment-269\" class=\"wp-caption-text\">Correct (100%) \ud83d\ude42 A really newish style for this one, dynamic traits, vivid colors. Clearly on Rosa side, but could have probably been misidentified as other recent Duck artists.<\/figcaption><\/figure>\n<figure id=\"attachment_270\" aria-describedby=\"caption-attachment-270\" style=\"width: 186px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-270 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa2-186x300.jpg\" alt=\"\" width=\"186\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa2-186x300.jpg 186w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa2-768x1240.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa2-634x1024.jpg 634w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa2.jpg 1257w\" sizes=\"auto, (max-width: 186px) 100vw, 186px\" \/><\/a><figcaption id=\"caption-attachment-270\" class=\"wp-caption-text\">Correct (58%). Another full page drawing from Don Rosa, correctly found, yet with less confidence. Obvious to the enthusiast however.<\/figcaption><\/figure>\n<figure id=\"attachment_271\" aria-describedby=\"caption-attachment-271\" style=\"width: 214px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-271 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa6-214x300.png\" alt=\"\" width=\"214\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa6-214x300.png 214w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa6.png 482w\" sizes=\"auto, (max-width: 214px) 100vw, 214px\" \/><\/a><figcaption id=\"caption-attachment-271\" class=\"wp-caption-text\">Correct (100%) \ud83d\ude42 An easy win again for the model. Very dynamic Rosa style.<\/figcaption><\/figure>\n<figure id=\"attachment_272\" aria-describedby=\"caption-attachment-272\" style=\"width: 201px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-272 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa7-201x300.jpg\" alt=\"\" width=\"201\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa7-201x300.jpg 201w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa7-768x1145.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa7-687x1024.jpg 687w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa7.jpg 936w\" sizes=\"auto, (max-width: 201px) 100vw, 201px\" \/><\/a><figcaption id=\"caption-attachment-272\" class=\"wp-caption-text\">Correct (100%) This one from Rosa is too easy for our model!<\/figcaption><\/figure>\n<figure id=\"attachment_273\" aria-describedby=\"caption-attachment-273\" style=\"width: 214px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa8-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-273 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa8-1-214x300.jpg\" alt=\"\" width=\"214\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa8-1-214x300.jpg 214w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa8-1.jpg 425w\" sizes=\"auto, (max-width: 214px) 100vw, 214px\" \/><\/a><figcaption id=\"caption-attachment-273\" class=\"wp-caption-text\">Correct (100%). A full page image, with looots of details, typical for Rosa. \ud83d\ude42 \ud83d\ude42<\/figcaption><\/figure>\n<figure id=\"attachment_274\" aria-describedby=\"caption-attachment-274\" style=\"width: 212px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-274 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa5-212x300.jpg\" alt=\"\" width=\"212\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa5-212x300.jpg 212w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa5-768x1087.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa5-724x1024.jpg 724w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa5.jpg 1212w\" sizes=\"auto, (max-width: 212px) 100vw, 212px\" \/><\/a><figcaption id=\"caption-attachment-274\" class=\"wp-caption-text\">Correct (96%). \u201cI know Don Rosa\u201d something murmured \ud83d\ude09<\/figcaption><\/figure>\n<figure id=\"attachment_275\" aria-describedby=\"caption-attachment-275\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa9.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-275 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa9-300x224.jpg\" alt=\"\" width=\"300\" height=\"224\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa9-300x224.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa9-768x574.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa9.jpg 901w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-275\" class=\"wp-caption-text\">Correct (100%), Rosa naturally<\/figcaption><\/figure>\n<figure id=\"attachment_276\" aria-describedby=\"caption-attachment-276\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa10.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-276 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa10-300x103.jpg\" alt=\"\" width=\"300\" height=\"103\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa10-300x103.jpg 300w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_rosa10.jpg 767w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-276\" class=\"wp-caption-text\">Correct (100%). Rosa in Danish, another big homeland for Duck stories.<\/figcaption><\/figure>\n<figure id=\"attachment_277\" aria-describedby=\"caption-attachment-277\" style=\"width: 212px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_unknown1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-277 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_unknown1-212x300.jpg\" alt=\"\" width=\"212\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_unknown1-212x300.jpg 212w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_unknown1.jpg 600w\" sizes=\"auto, (max-width: 212px) 100vw, 212px\" \/><\/a><figcaption id=\"caption-attachment-277\" class=\"wp-caption-text\">Rosa at 100%: unknown artist. But I agree with the model.<\/figcaption><\/figure>\n<figure id=\"attachment_278\" aria-describedby=\"caption-attachment-278\" style=\"width: 212px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_notduck.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-278 size-medium\" src=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_notduck-212x300.jpg\" alt=\"\" width=\"212\" height=\"300\" srcset=\"https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_notduck-212x300.jpg 212w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_notduck-768x1088.jpg 768w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_notduck-723x1024.jpg 723w, https:\/\/www.fabidouille.com\/wp-content\/uploads\/2021\/03\/toto_notduck.jpg 1065w\" sizes=\"auto, (max-width: 212px) 100vw, 212px\" \/><\/a><figcaption id=\"caption-attachment-278\" class=\"wp-caption-text\">Rosa at 99%. This time, I disagree! \ud83d\ude09<\/figcaption><\/figure>\n<h2>To conclude<\/h2>\n<p>This hands-on on \u201cDeep Learning\u201d was a very fun experiment for me, I really appreciated digging into that.<\/p>\n<p>I\u2019d say results are beyond my initial expectations, however I felt a bit disappointed when the learned model fell in some of the set traps (the \u201cepic\u201d Bark panel for example).<\/p>\n<p>Now, to which extent the model learned the artistic style (whatever this means) or just the layout, the vividness of colorisation or drawing techniques (half a century separates the two!), difficult to say!<\/p>\n<p>However the capability of the model to still have good predictions even for images slightly more exotic than the sometimes rigid 8-panels format used for lots of Carl Barks artworks is appreciable.<\/p>\n<p>Now a next step could be to try other esteemed, modern artists such as Romano Scarpa. Would it still be distinctive enough for a simple model such as the one we trained here?<\/p>\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i.pinimg.com\/originals\/49\/8c\/f7\/498cf757acff574ee4043e921e165e34.jpg\" alt=\"From Uncle Scrooge #351, &quot;Anti-Dollarosis&quot;. Romano Scarpa | Scrooge mcduck, Uncle scrooge, Scrooge\" width=\"284\" height=\"209\" \/><figcaption>Ducks as drawn by Romano Scarpa<\/figcaption><\/figure>\n<p>And who knows, maybe this kind of approach could pave way for artificially generated Duck stories in a not-so-distant future?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>And Now for Something Completely Different, let\u2019s move away from concrete stuff and bite a bit of Machine Learning abstraction (which \u2013 who knows \u2013 we may plug in a \u201creal life\u201d apparatus) in the good company of indisputably the best story tellers of the 20th century, Carl Barks and Don Rosa. The Masters of&hellip;<\/p>\n<p><a class=\"more-link\" href=\"https:\/\/www.fabidouille.com\/?p=215\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=215"}],"version-history":[{"count":8,"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":283,"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions\/283"}],"wp:attachment":[{"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fabidouille.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}