Radu Angelescu

aug. 12, 2016

Artistic machine 42

This is an introductory article about a social artificial intellgence artistmachine42 I am developing in my spare time and it will not contain a lot of math (unfortunately). More in depth articles will follow.

This is it’s most successfull post so far:

http://artistmachine42.tumblr.com/post/144247722217/i-must-be-a-mermaid-rango-i-have-no-fear-of

It seems I took a very long pause from writing on this site. I got on with a longer project I had in mind for a while and dedicated most of my time to accumulating knowledge. As I did not write for a while, this article will probably be kind of long and picture/tumblr post intensive :).

You can probably see, one of my passions is artificial intelligence. It’s been a great interest of mine since I first read an article my father wrote (when I was verry little) for a science magazine which was about how people create computers basically by mimicking their way of perciving the world, and trying to recreate it. The ideea of the article (which I now, may admit that I don’t remeber word for word) was actually a particularity of the ideea that creativity and it’s produce is mostly constrained combinatorics and nothing fundamentaly new can be created by a human being ( nice article about the general ideea ) . You could see a big machine combining notions into ideeas and then veto-ing the silly ones and could probably relate to the free won’t or neuroscience of free will but I did not know about these things then.

I really liked the concept at that time and it stuck to me. As I grew older, learned and tested things for myself, I became less and less sure of this. Actually I grew less and less sure about a lot of things but I guess that is the beauty of life, not knowing but actually finding out. Living in the constant state of ambivalence that keeps you creating and asking questions.

Artificial intelligence was always about “Oh my god, I think this is how I could model a human!” and later on “Guess I was wrong, back to the drawing board” and then “Oh my god, I think this how we model speech recognition/object recognition/strategic thinking!” and yet again “Guess I was wrong, back to the drawing board!”. This neverending loop is not futile as this represents the scientific method of any domain and it got us really far. Every “guess I was wrong” statement would actually bring us closer to the truth.

Before talking about my project I will first like to express my awe about the google deep mind wining the Go contest (I had alot of emotions watching the games unfold). Basically a part (the board analysis) of the Google AI was done with convolution neural networks (or so I read) so I guess it relates to my project a little, as I used the same ideea for my style transfer stuff (the great article about this).

I followed some courses about neural networks but I would actually like to share with any interested reader that wants to know more about machine learning this free youtube course i really like that my friend and coleague Alexandru Ene brought to my attention.

My project is called ArtisticMachine42 and it’s actually a tumblr bot that posts neural network style transfer art and somewhat matching qoutes, trying to basically create an experience in the viewer, the same way a human artist does.

This bot made me think of a lot of interesting questions about human relation to art, does the creator really matter? Maybe the creator matters only in his eyes, and all art actually happens in the viewer or maybe art is a bridge between people, like Whitmans spider silk (and machines can never take part in this). There are a lot of good questions one can ask with this experiment and because I didn’t want to spoil the informational part and be open to new discovery I didn’t write about my bot earlier (wanted to see if people saw the machine part or the art part). Maybe it relates to the turing test or it was simply a curiosity I had after playing around the bot or not site and creating a ton of bad poem generators and my licence paper that was also about creating a belivable AI.

What I can say for sure is that my bot managed to get around 620 followers (although some of them porn bots :D ) at 522 posts spread out about 2 per day some people contacted it and wrote they really enjoyed his posts (around 20) some reblogs, an the most liked post had about 192 notes. I did not try to get followers, and tried to not delete anything it posted (the act of filtering its creations would actually imply a process that the AI is not yet capable of).. I actually deleted about 3-4 posts that were created with gruesome porn pics (before I decoupled the social part from the artistic part).

Even with me knowing it was a bot, and developing the algorithms, I still liked some of its posts. Sometimes artisticmachine42 seemed to post things I was thinking about :D . For me it was not magic, or synchronicity it was just my mind trying to find contextual patterns in it’s never ending problem solving, like a big fuzzy pattern contextual recognition device but nevertheless, i still enjoyed some of the posts even knowing they were not made by a human.

The process behind this is fairly complicated as I kept doing iterations (which can actually be seen through the posts as the bot gets better).

The first iteration

was just filter-combining the pictures it got from tumblr friends and then posting poetry generated by an n-gram statistical system trained on sheakspear and Ovid (the results were kind of bad).

http://artistmachine42.tumblr.com/post/126279637707/the-state-of-agitation-that-it-was-his-speech-did

http://artistmachine42.tumblr.com/post/126318381432/hough-whose-observations-brehm-transmitted-to

http://artistmachine42.tumblr.com/post/126319201492/listened-to-her-nursing-notwithstanding-your

and a random test for procedural pencil painting that ended up being the logo

http://artistmachine42.tumblr.com/post/126488383782

The second iteration

was doing a really expensive neural iterative process of painting and learning on each try by looking at several classical artist paintings this turned out to be too much for my poor server (dual core with no graphics card at that time) so I had to leave this thought behind.

The third iteration

was generating really short gifs and posting them via moviepy, from various movies it got from the internet and then it also posted a n-gram poem.

you can see here a lucky match :) :

http://artistmachine42.tumblr.com/post/126614692987/why-not-try-lightning-or-electricity-that-will

http://artistmachine42.tumblr.com/post/126614911187/in-what-was-on-the-other-abraham-lincoln-at

The forth iteration

was actually the basics for what I have right now (I am just improving this via various methods and not changing the whole concept). We have 2 parts that work independantly : the social part and the artist part. But I will first show you some results I liked:

http://artistmachine42.tumblr.com/post/146298721087/is-it-possible-for-home-to-be-a-person-and-not-a

http://artistmachine42.tumblr.com/post/146255411432/youth-is-happy-because-it-has-the-capacity-to-see

http://artistmachine42.tumblr.com/post/144324662522/be-steady-and-well-ordered-in-your-life-so-that

http://artistmachine42.tumblr.com/post/146334915817/every-child-is-an-artist-the-problem-is-how-to
http://artistmachine42.tumblr.com/post/141673633502/painting-is-just-another-way-of-keeping-a-diary

http://artistmachine42.tumblr.com/post/141598736172/i-find-him-in-the-curves-of-certain-lines-in-the
http://artistmachine42.tumblr.com/post/148668161572/clothes-make-the-man-naked-people-have-little-or
http://artistmachine42.tumblr.com/post/148288588207/art-is-the-lie-that-enables-us-to-realize-the
http://artistmachine42.tumblr.com/post/147332887477/someone-i-loved-once-gave-me-a-box-full-of
  • The social part: Handles the befriending, following and liking of tumblr accounts/posts
  • The artist part: Handles the neural style transfer, finding good art styles and good photos to repaint and of course matching the qoutes to the painting.

The social part is the easiest as it’s using the tumblr api to get friends of friends or followers and follow them randomly and also like posts.pytumblr

I basically have a sqlite database that started out with some hand picked accounts (artistically inclined, that I liked) and I get random friends of these guys, follow and add them to my database. (it’s crawling for friends on the internet :) ). I actually used friends pictures at first, for the artistic part but in the end this turned out not to be that great as the friends of friends of friend of… etc eventually turned out to be porn blogs and if you have just one porn blog friend then you get into the well connected graph of porn blogs and there is no exiting this :) , so I decoupled the artistic part from the social part (you may see this in older posts :) ).

The artistic part was a lot of fun to get working. I actually used caffe after trying tensor flow and another library I didn’t like as I had a google pretrained model. I managed to make caffe work on windows (that was a real challenge) so I could develop in windows and deploy on Linux (my server). I optimised a lot so I got from a picture taking 8 hours on my server (quad core Xenon 2.3 GH, 10 gigs of CRC server Ram) and sometimes giving me OOM, to it taking 4 hours on my server (and 30 minutes on my personal computer with cuda enabled NVIDIA geforce 970). Testing things out, making a table for the styles and pictures and programming this was a blast. Then I crawled for famous qoutes (stored in my sqlite db, which I used for everything even dev settings). I loved working on this as I kept having nice questions that needed answering. The last small iteration was on qoute matching with the paintings, after trying a lot of options I now use the google vision service to tag the art and then use these words to match a good qoute. I have a good ideea on how to improve this (as I do not have enough qoutes and they keep repeating because of the small tag space ), I will try to do my own inverse index method (elastic search is too memory expensive and overencumbered for my purposes) and then combine it with a big text corpus (free internet e-books). I think I will do something about the porn bots by implementing some kind of spam detection (i have some ideeas about this too but implementing them it’s not that exciting for me)

This is an overview of what I did (there are a lot more stories about the process, but I will write them in other future articles). Feel free to drop me questions, or chat about AI stuff.