Many of us might have the experience when we look up in the sky, we see the clouds as many shapes or objects. Some pieces of clouds look like a human face, while some others look like the dog in your neighbor’s backyards. In this post, I will demonstrate that A.I. nowadays have the similar ability, i.e. to imagine a certain image to some other objects.
But first I want to introduce the Google’s DeepDream. DeepDream is a computer vision program created by Google using Convolutional Neural Networks (CNN) to create dreamlike, deliberately over-processed images. If you are interested in how a certain image is over-processed, you can google ‘DeepDream’ to get a sense of it. I will not demonstrate it here because some of them are really not that aesthetically pleasing.
My experiment starts with using the Python DeepDream code from Google. I decide to use the CNN developed by google Google ImageNet challenge as the architecture. The net has a lot of layers to use and I decide to experiment on two layers (which can be seen as two filters due to the inner nature of the CNN layers) of the CNN to process the original image, which I will show below:

The first layer I will use is called “inception_3a”. It is one of the first several layers in the Google’s ImageNet CNN. The reason why CNN works so well in computer vision problem is the fact that CNN, through back propagation (or some other updating algorithms), learn the feature representation of the images. This implies that the higher the layer, the more complex features CNN will learn. For example, if we want to train a 10 layer CNN to recognize the image of dogs. The first two layers will learn some primitive features, such as the edges and corners. The 5th or 6th layer might be able to learn the face of a dog, or the leg. If we visualize the 8th or 9th layer, we can see features of a dog of any kind. Anyway, let’s visualize what happens if we apply lower layers in CNN to the cloud image.
After about 5 iterations, CNN seems to learn the edges and corners of the cloud and began to alter the image according to the edges and points it detected. Let’s see what happened if we train this image for 27 iterations:

Now most of the edges in the original image can be detected and amplified, thus creating a dreamlike image of a cloud.
Now it’s time for us to use some deeper layers to our original image. This time I use “inception_5a” layer, which is not far from the output layer. After 5 iterations, here is what we have:

I am not sure about you, but I can see some eyes of some very weird animals. It seems to be dogs, but not quite. This is because the layer tries to learn the representation of ALL images, not a single image of a particular dog. Besides the layer needs to image the cloud to be some kind of animal. Thus what we have is a ‘synthetic animal’ image derived from a cloud. After 27 iterations, let’s see what we have:

We can see a little more about animal eyes and everything. Finally, I would like to demonstrate what happens if we train the original cloud image using the deepest convolutional layer in CNN for 27 iterations. Our guess is that it can really learn some very complex features of the cloud. See for yourself if it is true:

This is a little gross. What the HELL are these weird animals? I mean, seriously, a rabbit splitting with a fish? A bug with two head? This is delusional. Anyway, this is the power of CNN. It is able to create some deeply hallucinated images, to the extent that we even feel a little disgusted by some. This really is some real complex features of thousands of images!














