So, I have seen few pictures re-created by a Neural Network or some other Machine Learning algorithm after it has been trained over a data set.

How, exactly is this done? How are the weights converted back into a picture or a memory which a Neural Net is holding?

A real life example would be when we close our eyes we can easily visualize things we have seen. Based on that we can classify things we see. Now in a Neural Net classification part is easily done, but what about the visualization part? What does the Neural Net see when it closes its eyes? And how to represent it for human understanding?

For example a deep net generated this picture:

enter image description here SOURCE: Deep nets generating stuff

There can be many other things generated. But the question is how exactly is this done?


You should use google for this question, it is extremely vague. Some technical documents will give very clear insight into what's happening here.



If you really want to understand "what the AI is thinking", well, you may never know. The idea of AI is that it can handle complex data (high degree of dimensionality) and is too complex for Humans to comprehend.

  • $\begingroup$ Actually I was asking how to back calculate in a nn to represent the memory of the object it is classifying... Image is just a specific case $\endgroup$ – user9947 Jan 30 '18 at 4:48

A "normal" neural network can give you a distribution of probabilities for categories given some image. (Ex: a picture of a dog might return 50% dog; 30% cat; 10% car; 5% laptop; 5% skeleton).

What we then do, is maximize the probability of a given category by manipulating the image directly. We do this iteratively, until we are satisfied by the result.

For example, one might start with a grey image, tweak some random pixels to improve a specific category probability of the image, save our results, and repeat, until we have an image that responds very well to a given probability.

So to answer your question, the weights aren't directly manipulated to produce the image, though they are implicitly used in the construction.

  • $\begingroup$ I don't get it....As far as I know for simple NN's input is not manipulated? What am i missing? $\endgroup$ – user9947 Mar 1 '18 at 5:01
  • $\begingroup$ Yes, for simple NNs the input is not manipulated. However to generate the images such as the one you posted, we alter the image to converge towards a high likelihood for a given class. $\endgroup$ – k.c. sayz 'k.c sayz' Apr 30 '18 at 2:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy