Answers.Body: <p>For recreating an image exactly the same as the original, you can use an autoencoder. This basically use AI Layers to encode the image raw pixel values to a vector of floats, drastically decreasing the representing vector. Afterwards another AI Layer increases the dimensions back to the original image. The method does not required labels, as it only refer to teh image to encode it to a vector of features. For implementing in java, there is not a lot 9f resources. However, you can check this library out: <a href="https://deeplearning4j.org/" rel="nofollow noreferrer">https://deeplearning4j.org/</a>
  For the implementation, see this: <a href="https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/variational/VariationalAutoEncoderExample.java" rel="nofollow noreferrer">https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/variational/VariationalAutoEncoderExample.java</a>
  For the method, you can see this python tutorial and implement it in java. <a href="https://towardsdatascience.com/autoencoders-in-keras-c1f57b9a2fd7" rel="nofollow noreferrer">https://towardsdatascience.com/autoencoders-in-keras-c1f57b9a2fd7</a></p>
  
  <p>For generating completely new image, you can try GAN(Generative Adverserial Network). This generates completely new images from a random noise image. The noise image is passed through a generator which is a CNN(convolutional neural network) and get a result image. The result image is then feed to  a discriminator(CNN as well) to classify if that image is fake or real. The generator and discriminator compete and slowly gets better. For java implementation, see this: <a href="https://github.com/wmeddie/dl4j-gans" rel="nofollow noreferrer">https://github.com/wmeddie/dl4j-gans</a></p>
  
  <p>Hope I can help you and have a nice day!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-25T13:19:45.127Z
Answers.LastActivityDate: 2019-10-25T13:19:45.127Z
Answers.UserDisplayName: Clement
Body: <p>I am pretty new to Artificial Intelligence programming, however i do understand the basic concept. 
  I have an idea in my mind: </p>
  
  <p>Import a JPEG Image, 
  Convert this Image into a 2D Array (x,y values + r g b values). 
  Then create a second array with same (xy) values wit rgb all set to 0,0,0.
  Now i want to build an AI Layer which will try to lower the error factor between the arrays until they are equal (the rgb values in the second array are equal to the first array (error factor 0) ).
  I would prefer to do it in Java. Any suggestions to librarys or example that can help me get started? Thanks for any help. </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-25T11:17:08.090Z
Comments.Text: To just copy image pixel values between arrays as you suggest you don't need any AI "layer". However, this kind of thing is strongly related to various image generating, classifying or compression work. It may help to explain where you want to take this. A very simply "toy" example might be for an AI to learn the function `pixel(x,y)` which given a co-ordinate in the image generates the right RGB colour array `[r,g,b]` - it's a simple, fun and informative task to use a neural network on, and you can animate the results. Would that sort of thing be what you had in mind?
Comments.UserDisplayName: Neil Slater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-25T11:20:19.943Z
Comments.Text: Yes that sounds like a cool idea too. Do you have a framework or sdk or something in mind?
Comments.UserDisplayName: videokate
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-25T11:23:58.757Z
Comments.Text: Not for Java. Someone else would need to suggest that. I wanted to clarify what kind of thing would count, since your description of your idea is a bit vague, and does not naturally lead to an AI solution. So it would be helpful to know your goals - e.g. are you learning about neural networks, or want to explore computational creativity? With this one idea it is only going to be a single small step towards any goal.
Comments.UserDisplayName: Neil Slater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-25T11:26:44.503Z
Comments.Text: My idea is to recreate a given image by using ai, maybe you could add a twist like only lines are allowed etc. Im just messing around with ai because it seems really interesting to me.
Comments.UserDisplayName: videokate
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-25T11:38:15.717Z
Comments.Text: That sounds more like a genetic algorthm approach e.g. https://www.youtube.com/watch?v=rGt3iMAJVT8 - I think you need to settle on a more specific goal than "just mess with AI" for this question (it's fine as a personal goal, but too broad for anyone to answer). This site cannot really give you the ideas for your project as answers because that is too open-ended. But we can answer more specific questions such as how to use neural networks or how to use genetic algorithms to solve a given problem.
Comments.UserDisplayName: Neil Slater
Tags: <machine-learning><training><neurons><java>
Title: Generate Image with Artificial intelligence
UserDisplayName: videokate
ThreadText: # Generate Image with Artificial intelligence
  
  (Asked by: username_0 on 2019-10-25)
  
  I am pretty new to Artificial Intelligence programming, however i do understand the basic concept.
  I have an idea in my mind:
  
  Import a JPEG Image,
  Convert this Image into a 2D Array (x,y values + r g b values).
  Then create a second array with same (xy) values wit rgb all set to 0,0,0.
  Now i want to build an AI Layer which will try to lower the error factor between the arrays until they are equal (the rgb values in the second array are equal to the first array (error factor 0) ).
  I would prefer to do it in Java. Any suggestions to librarys or example that can help me get started? Thanks for any help.
  
  **Tags:** machine-learning, training, neurons, java
  > **Comments:**
  > **username_1**: To just copy image pixel values between arrays as you suggest you don't need any AI "layer". However, this kind of thing is strongly related to various image generating, classifying or compression work. It may help to explain where you want to take this. A very simply "toy" example might be for an AI to learn the function `pixel(x,y)` which given a co-ordinate in the image generates the right RGB colour array `[r,g,b]` - it's a simple, fun and informative task to use a neural network on, and you can animate the results. Would that sort of thing be what you had in mind?  
  > **username_0**: Yes that sounds like a cool idea too. Do you have a framework or sdk or something in mind?  
  > **username_1**: Not for Java. Someone else would need to suggest that. I wanted to clarify what kind of thing would count, since your description of your idea is a bit vague, and does not naturally lead to an AI solution. So it would be helpful to know your goals - e.g. are you learning about neural networks, or want to explore computational creativity? With this one idea it is only going to be a single small step towards any goal.  
  > **username_0**: My idea is to recreate a given image by using ai, maybe you could add a twist like only lines are allowed etc. Im just messing around with ai because it seems really interesting to me.  
  > **username_1**: That sounds more like a genetic algorthm approach e.g. https://www.youtube.com/watch?v=rGt3iMAJVT8 - I think you need to settle on a more specific goal than "just mess with AI" for this question (it's fine as a personal goal, but too broad for anyone to answer). This site cannot really give you the ideas for your project as answers because that is too open-ended. But we can answer more specific questions such as how to use neural networks or how to use genetic algorithms to solve a given problem.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-10-25. Score: 0 | Accepted answer
  
  For recreating an image exactly the same as the original, you can use an autoencoder. This basically use AI Layers to encode the image raw pixel values to a vector of floats, drastically decreasing the representing vector. Afterwards another AI Layer increases the dimensions back to the original image. The method does not required labels, as it only refer to teh image to encode it to a vector of features. For implementing in java, there is not a lot 9f resources. However, you can check this library out: <https://deeplearning4j.org/>
  For the implementation, see this: <https://github.com/eclipse/deeplearning4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/unsupervised/variational/VariationalAutoEncoderExample.java>
  For the method, you can see this python tutorial and implement it in java. <https://towardsdatascience.com/autoencoders-in-keras-c1f57b9a2fd7>
  
  For generating completely new image, you can try GAN(Generative Adverserial Network). This generates completely new images from a random noise image. The noise image is passed through a generator which is a CNN(convolutional neural network) and get a result image. The result image is then feed to a discriminator(CNN as well) to classify if that image is fake or real. The generator and discriminator compete and slowly gets better. For java implementation, see this: <https://github.com/wmeddie/dl4j-gans>
  
  Hope I can help you and have a nice day!
  
  
  ---
  
  