{"id":207,"date":"2016-02-19T17:48:12","date_gmt":"2016-02-19T17:48:12","guid":{"rendered":"http:\/\/liipetti.net\/erratic\/?p=207"},"modified":"2018-05-06T09:41:38","modified_gmt":"2018-05-06T09:41:38","slug":"the-endless-possibilities-of-neural-networks","status":"publish","type":"post","link":"http:\/\/liipetti.net\/erratic\/2016\/02\/19\/the-endless-possibilities-of-neural-networks\/","title":{"rendered":"The endless possibilities of neural networks"},"content":{"rendered":"<p>No, I am not saying that neural networks can achieve everything. The endless possibilities I am facing do not extend outwards towards practical goals. Instead, when I am experimenting with applications of neural network for creative and original art, I am overwhelmed by the endless options and variations at my disposal. Even if I stick to a single pre-trained neural network, there is the choice of the content and style images, content and style weights, different optimizers with their parameters and last, but not least, selecting which\u00a0network layers are used to control content and style generation. In addition, the absolute values of content and style weights do matter, so that 10 and 1000 give different results than 100 and 10000. And the right values for each case are different, depending on the material and image sizes.<\/p>\n<p>Then there is a choice of several pre-trained networks. I have already touched here one alternative, nin-imagenet-conv, to replace the default, VGG19. The latter seems to produce sharper quality and follow the style of the model image more faithfully, so it appears to be the favorite of most who experiment with neural-style. For me, looking for a practical tool for original work, nin-imagenet-conv, which works well with much smaller memory, feels almost fully adequate.<\/p>\n<p>I made some tests, using this drawing as a style model.<\/p>\n<p><a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tmadonna2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-208\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tmadonna2-200x300.jpg\" alt=\"tmadonna2\" width=\"200\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tmadonna2-200x300.jpg 200w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tmadonna2-682x1024.jpg 682w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tmadonna2-100x150.jpg 100w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<p>Running a photo through both VGG19 and nin-imagenet-conv, with this style model, gives, respectively. This illustrates well how a neural network does not simply modify an image; it actually builds its own understanding of the image contents and then recreates it. VGG19 has visualized hair where nin-image-net sees hair and shoulder differently. Nin-imagenet-conv, then, has perhaps visualized the face more accurately.<\/p>\n<p><a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/12705378_10154046348823729_2233332087520290009_n.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-210\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/12742708_10154046346193729_6812626325657529243_n.jpg\" alt=\"12742708_10154046346193729_6812626325657529243_n\" width=\"291\" height=\"299\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/12742708_10154046346193729_6812626325657529243_n.jpg 206w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/12742708_10154046346193729_6812626325657529243_n-146x150.jpg 146w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-209\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/12705378_10154046348823729_2233332087520290009_n-292x300.jpg\" alt=\"12705378_10154046348823729_2233332087520290009_n\" width=\"292\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/12705378_10154046348823729_2233332087520290009_n-292x300.jpg 292w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/12705378_10154046348823729_2233332087520290009_n-146x150.jpg 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/12705378_10154046348823729_2233332087520290009_n.jpg 933w\" sizes=\"auto, (max-width: 292px) 100vw, 292px\" \/><\/p>\n<p>Next, I tested VGG_FACE, a neural network pre-trained to recognize faces and facial features. Now something interesting happens. The network first faintly sees the contours of the lady, but then loses the view. Yet the lines that develop later (on the right) seem to belong to a human body even if no human image emerges.<\/p>\n<p><a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_50.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-211\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_50-291x300.png\" alt=\"tsaara2vggface1b_50\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_50-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_50-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_50.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a> <a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_200.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-212\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_200-291x300.png\" alt=\"tsaara2vggface1b_200\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_200-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_200-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_200.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a><\/p>\n<p>A second try, changing the parameters, leads to something similar. There is something reminiscent of a human face, but still no face. A further trial, with increased content weight finally produces a drawing-like picture of a face, but in an interestingly distorted form (right).<\/p>\n<p><a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1_400.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-213\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1_400-291x300.png\" alt=\"tsaara2vggface1_400\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1_400-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1_400-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1_400.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a>\u00a0<a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_1350.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-214\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_1350-291x300.png\" alt=\"tsaara2vggface1b_1350\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_1350-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_1350-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_1350.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a><\/p>\n<p>Also the earlier iterations that produced the image on the right above are interesting. We can see how the final image is being formed.<\/p>\n<p><a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_300.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-215\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_300-291x300.png\" alt=\"tsaara2vggface1b_300\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_300-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_300-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_300.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a> <a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_550.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-216\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_550-291x300.png\" alt=\"tsaara2vggface1b_550\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_550-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_550-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1b_550.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a><\/p>\n<p>Increasing content weight leads to a more realistic image, but only after a number of intermediate stages. Here, once again, an\u00a0earlier version feels more interesting to me. And looking at the final result, once again it can be noted how the neural network has had difficulty in perceiving the hair and the contours of the shoulder.<\/p>\n<p><a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_300.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-217\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_300-291x300.png\" alt=\"tsaara2vggface1c_300\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_300-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_300-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_300.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a> <a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_500.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-218\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_500-291x300.png\" alt=\"tsaara2vggface1c_500\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_500-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_500-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_500.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a> <a href=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_1600.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-219 alignleft\" src=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_1600-291x300.png\" alt=\"tsaara2vggface1c_1600\" width=\"291\" height=\"300\" srcset=\"http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_1600-291x300.png 291w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_1600-146x150.png 146w, http:\/\/liipetti.net\/erratic\/wp-content\/uploads\/2016\/02\/tsaara2vggface1c_1600.png 497w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>So far I have been writing about using pre-trained neural networks only. But it is also possible to train neural networks oneself, with the kind of images and features one wants them to be able to recognize. I have already been dabbling at this, but so far I have only experienced that while almost any network can produce some kind of interesting effect, it is not easy to train a network to be a well-behaving tool. \u00a0Still, I strongly feel that in the long run, for original artistic work, training one&#8217;s own neural network is the way to go. Yet at the same time it is not something to be achieved quickly or easily. At least at this phase, the number of possibilities really becomes endless.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>No, I am not saying that neural networks can achieve everything. The endless possibilities I am facing do not extend outwards towards practical goals. Instead, when I am experimenting with applications of neural network for creative and original art, I am overwhelmed by the endless options and variations at my \u2026<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"http:\/\/liipetti.net\/erratic\/2016\/02\/19\/the-endless-possibilities-of-neural-networks\/\">Continue reading<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":213,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-art","category-neural-networks"],"_links":{"self":[{"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":8,"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":302,"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/posts\/207\/revisions\/302"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/media\/213"}],"wp:attachment":[{"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/liipetti.net\/erratic\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}