Answers.Body: <p>A generative adversarial network is probably not the best approach for generating the images desired.  We can assume from the comments that the data is not collected.  That's a good thing, because a set of rasterized images, labeled with student age or grade is an inferior input form.</p>
  
  <p>It appears that access to a student population is planned or already negotiated, which is also good.</p>
  
  <p>Although the drawing, as it is being drawn, is seen through each student's eyes, the primary features correlated with drawing skill development is motor control, shape formation, and color choice.  If the sheet of paper is placed over a drawing tablet, the tablet's incoming USB stream events are captured to a file, and the color selection is somehow recorded or automatically determined by having students hold the pencil or crayon up to the computer's camera before using it, a much better <em>in natura</em> input stream can be developed.</p>
  
  <p>Pre-processing can lead to an expression of each drawing experience as a sequence of events arranged in temporal order with the following dimensions for each event.</p>
  
  <ul>
  <li>Relative time from the instruction to draw in seconds</li>
  <li>Color</li>
  <li>Nearest x grid</li>
  <li>Nearest y grid</li>
  <li>Pressure</li>
  </ul>
  
  <p>Determining color from camera input may be developed using LSTM approaches.</p>
  
  <p>The dimensions of the label for each of these sequences would be those demographics and rankings that would most closely correlated with developmental stages.</p>
  
  <ul>
  <li>Student age</li>
  <li>Student gender</li>
  <li>Curriculum grade (-1, 0, 1, 2, ... 12, where -1 is preschool and 0 is kindergarten)</li>
  <li>Identifier of the drawing instructions given to the class</li>
  <li>Grade ranking of the student in the class</li>
  </ul>
  
  <p>The micro-analysis attached to each ELEMENT in the sequence includes these additional dimensions.</p>
  
  <ul>
  <li>Drawing rate of the utensil given by <span class="math-container">$r = \frac {\sqrt{(x - x_p)^2 + (y - y_p)^2}} {t - t_p}$</span> where the subscript p indicates the values are drawn from the previous event in the sequence.</li>
  <li>Drawing direction given by <span class="math-container">$\theta = \arctan (x - x_p, \; y - y_p)$</span></li>
  <li>Curvature <span class="math-container">$\kappa$</span> calculated using cubic splines or some other data fitting approach</li>
  <li>FFT spectrum <span class="math-container">$\vec{a}$</span> and Lyapunov exponent <span class="math-container">$\lambda$</span> applied to auto-correlation results</li>
  </ul>
  
  <p>This is a modification of the system Google uses to synthesize speech, based on the WaveNet design. In the diagram, the residual function is defined as follows.</p>
  
  <p><span class="math-container">$z = \tanh \, (W_{f,k} x + V_{f,k} y) \, \odot \, \sigma \, (W_{g,k} x + V_{g,k} y)$</span></p>
  
  <p>The development required is that the <span class="math-container">$\vec{a}$</span> must now be accompanied with scalars <span class="math-container">$r, \theta, \kappa, and \lambda$</span>, but the resulting drawings are likely to have many of the hand-eye developmental features of the examples.
  <a href="https://i.sstatic.net/eA3i4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eA3i4.png" alt="Child Drawing Learning Design like WaveNet"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-21T08:00:38.923Z
Answers.Text: Sir @Douglas, can I ask for a translation of your answer in simple terms or maybe Python code? I'm having trouble understanding the text since I'm neophyte on the field.
Answers.UserDisplayName: Sidney Guaro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-21T00:19:16.933Z
Answers.LastActivityDate: 2018-09-21T00:19:16.933Z
Answers.UserDisplayName: Douglas Daseeco
Answers.Body: <p>I think your task is as follows.</p>
  
  <p>$\ $</p>
  
  <p>Let's assume 5-year-old children.</p>
  
  <p>You have numbers of pictures that drew by them.
  (Let, these pictures are your [training set].)</p>
  
  <p>And, you want to synthesis similar pictures with the training set.</p>
  
  <p>Because you need more pictures for your study.</p>
  
  <p>Am I right?</p>
  
  <p>$\ $</p>
  
  <p>OK.</p>
  
  <p>From the pictures, you want to extract some meaningful information about a real child who drew them, right?</p>
  
  <p>Then, I think GAN is not faithful for your study.</p>
  
  <p>Of course, GAN can make very similar pictures with your training set.</p>
  
  <p>However, it does not mean the synthesized images can contain the things what you want!</p>
  
  <p>GAN just synthesizes "fake pictures" that cannot be distinguished from your training set.</p>
  
  <p>The synthesized pictures may do not have any meaningful thing.</p>
  
  <p>Because it is not drawn by the real child.  </p>
  
  <p>$\ $</p>
  
  <p>But it is worth to do.</p>
  
  <p>May GAN captures some features of "children-like". (But I think it is too hard.)</p>
  
  <p>You can find lots of GAN for your research, especially DCGAN.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-13T13:30:14.247Z
Answers.Text: I want to use GAN to generate a generalized image for a certain age (4-12). Just one per age. That image will be used for manual analysis.
Answers.UserDisplayName: Sidney Guaro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-13T10:28:25.733Z
Answers.LastActivityDate: 2018-09-13T10:28:25.733Z
Answers.UserDisplayName: Jun
Body: <p>I want to generate images of childrens' drawings consistent with the developmental state of children of a given age.  The training data set will include drawings made by real children in a school setting.  The generated images will be used for developmental analysis. </p>
  
  <p>I have heard that Generative Adversarial Networks are a good tool for this kind of problem. If this is true, how would I go about applying a GAN to this challenge?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-09T18:25:39.833Z
Comments.Text: So, you can find interesting stuff at [this github repo](https://github.com/jasonicarter/MNIST-adversarial-images), or [this berkeley course](https://ml.berkeley.edu/blog/2018/01/10/adversarial-examples/)... I have to add that none of this is my work, and I'm not an expert of adversarial nets so I can't say that here lies your answer. Moreover, please developp your question, expose your project with more details, because I doubt anyone can really help you with so little info...
Comments.UserDisplayName: 16Aghnar
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-09T21:08:00.037Z
Comments.Text: Welcome to AI.SE @SidneyGuaro. As the other commenters note, it is difficult to understand what you are asking here. In particular, what do you mean by "combine"? GANs are a useful tool for generating new images in certain style. Are you hoping to use a GAN to generate images in the style of children at different developmental ages?
Comments.UserDisplayName: John Doucette
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-10T06:37:34.033Z
Comments.Text: @JohnDoucette yes, exactly
Comments.UserDisplayName: Sidney Guaro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-10T09:32:11.060Z
Comments.Text: @SidneyGuaro Ok, I edited your question to reflect that. Hopefully it is clearer now, while still matching your intent?
Comments.UserDisplayName: John Doucette
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-10T11:06:03.257Z
Comments.Text: Do you have a big data set of children's drawings? Could you point me to it, if it is publicly available?
Comments.UserDisplayName: BlindKungFuMaster
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-10T14:29:56.893Z
Comments.Text: Data set is not available for the meantime but it will be around 200 images of children's drawing. The reason to why it is small its because data set that will be collected will be based on a school setting. For example, children with ages 4 produced 190 drawings. It will be used to train the GAN to generate an image for analysis. Another set will be produced by children with ages 5 and so forth.
Comments.UserDisplayName: Sidney Guaro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-13T12:09:14.617Z
Comments.Text: You won't be able to get anything meaningful out of a GAN trained on 200 images. The data set will be too disjoint for the NN to model features at the semantic/stylistic level you are interested in. If all the images are coloured pencils on white paper, you might expect the GAN to roughly produce lines and blobs of the right colour on a white background. Such output might bring to mind "a bit like a child's drawing", but it will not be convincing or realistic, and you won't be able to analyse what is represented.
Comments.UserDisplayName: Neil Slater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-09-13T12:12:52.800Z
Comments.Text: . . . alternatively, if the GAN could over-fit, and you end up with slightly distorted versions of the original inputs for most samples, with occasional weird and obviously wrong results. This answer on SO *might* help a little: https://stackoverflow.com/questions/48601991/training-gan-on-small-dataset-of-images
Comments.UserDisplayName: Neil Slater
Tags: <machine-learning><generative-adversarial-networks>
Title: How to use a Generative Adversarial Network to generate images for developmental analysis?
UserDisplayName: Sidney Guaro
ThreadText: # How to use a Generative Adversarial Network to generate images for developmental analysis?
  
  (Asked by: username_0 on 2018-09-09)
  
  I want to generate images of childrens' drawings consistent with the developmental state of children of a given age. The training data set will include drawings made by real children in a school setting. The generated images will be used for developmental analysis.
  
  I have heard that Generative Adversarial Networks are a good tool for this kind of problem. If this is true, how would I go about applying a GAN to this challenge?
  
  **Tags:** machine-learning, generative-adversarial-networks
  > **Comments:**
  > **username_1**: So, you can find interesting stuff at [this github repo](https://github.com/jasonicarter/MNIST-adversarial-images), or [this berkeley course](https://ml.berkeley.edu/blog/2018/01/10/adversarial-examples/)... I have to add that none of this is my work, and I'm not an expert of adversarial nets so I can't say that here lies your answer. Moreover, please developp your question, expose your project with more details, because I doubt anyone can really help you with so little info...  
  > **username_2**: Welcome to AI.SE @SidneyGuaro. As the other commenters note, it is difficult to understand what you are asking here. In particular, what do you mean by "combine"? GANs are a useful tool for generating new images in certain style. Are you hoping to use a GAN to generate images in the style of children at different developmental ages?  
  > **username_0**: @JohnDoucette yes, exactly  
  > **username_2**: @SidneyGuaro Ok, I edited your question to reflect that. Hopefully it is clearer now, while still matching your intent?  
  > **username_3**: Do you have a big data set of children's drawings? Could you point me to it, if it is publicly available?  
  > **username_0**: Data set is not available for the meantime but it will be around 200 images of children's drawing. The reason to why it is small its because data set that will be collected will be based on a school setting. For example, children with ages 4 produced 190 drawings. It will be used to train the GAN to generate an image for analysis. Another set will be produced by children with ages 5 and so forth.  
  > **username_4**: You won't be able to get anything meaningful out of a GAN trained on 200 images. The data set will be too disjoint for the NN to model features at the semantic/stylistic level you are interested in. If all the images are coloured pencils on white paper, you might expect the GAN to roughly produce lines and blobs of the right colour on a white background. Such output might bring to mind "a bit like a child's drawing", but it will not be convincing or realistic, and you won't be able to analyse what is represented.  
  > **username_4**: . . . alternatively, if the GAN could over-fit, and you end up with slightly distorted versions of the original inputs for most samples, with occasional weird and obviously wrong results. This answer on SO *might* help a little: https://stackoverflow.com/questions/48601991/training-gan-on-small-dataset-of-images  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_5 on 2018-09-21. Score: 1 | Accepted answer
  
  A generative adversarial network is probably not the best approach for generating the images desired. We can assume from the comments that the data is not collected. That's a good thing, because a set of rasterized images, labeled with student age or grade is an inferior input form.
  
  It appears that access to a student population is planned or already negotiated, which is also good.
  
  Although the drawing, as it is being drawn, is seen through each student's eyes, the primary features correlated with drawing skill development is motor control, shape formation, and color choice. If the sheet of paper is placed over a drawing tablet, the tablet's incoming USB stream events are captured to a file, and the color selection is somehow recorded or automatically determined by having students hold the pencil or crayon up to the computer's camera before using it, a much better *in natura* input stream can be developed.
  
  Pre-processing can lead to an expression of each drawing experience as a sequence of events arranged in temporal order with the following dimensions for each event.
  
  * Relative time from the instruction to draw in seconds
  * Color
  * Nearest x grid
  * Nearest y grid
  * Pressure
  
  Determining color from camera input may be developed using LSTM approaches.
  
  The dimensions of the label for each of these sequences would be those demographics and rankings that would most closely correlated with developmental stages.
  
  * Student age
  * Student gender
  * Curriculum grade (-1, 0, 1, 2, ... 12, where -1 is preschool and 0 is kindergarten)
  * Identifier of the drawing instructions given to the class
  * Grade ranking of the student in the class
  
  The micro-analysis attached to each ELEMENT in the sequence includes these additional dimensions.
  
  * Drawing rate of the utensil given by $r = \frac {\sqrt{(x - x\_p)^2 + (y - y\_p)^2}} {t - t\_p}$ where the subscript p indicates the values are drawn from the previous event in the sequence.
  * Drawing direction given by $\theta = \arctan (x - x\_p, \; y - y\_p)$
  * Curvature $\kappa$ calculated using cubic splines or some other data fitting approach
  * FFT spectrum $\vec{a}$ and Lyapunov exponent $\lambda$ applied to auto-correlation results
  
  This is a modification of the system Google uses to synthesize speech, based on the WaveNet design. In the diagram, the residual function is defined as follows.
  
  $z = \tanh \, (W\_{f,k} x + V\_{f,k} y) \, \odot \, \sigma \, (W\_{g,k} x + V\_{g,k} y)$
  
  The development required is that the $\vec{a}$ must now be accompanied with scalars $r, \theta, \kappa, and \lambda$, but the resulting drawings are likely to have many of the hand-eye developmental features of the examples.
  [![Child Drawing Learning Design like WaveNet](https://i.sstatic.net/eA3i4.png)](https://i.sstatic.net/eA3i4.png)
  
  > **Comments:**
  > **username_0**: Sir @Douglas, can I ask for a translation of your answer in simple terms or maybe Python code? I'm having trouble understanding the text since I'm neophyte on the field.  
  
  ---
  
  ### Answer by username_6 on 2018-09-13. Score: -2
  
  I think your task is as follows.
  
  $\ $
  
  Let's assume 5-year-old children.
  
  You have numbers of pictures that drew by them.
  (Let, these pictures are your [training set].)
  
  And, you want to synthesis similar pictures with the training set.
  
  Because you need more pictures for your study.
  
  Am I right?
  
  $\ $
  
  OK.
  
  From the pictures, you want to extract some meaningful information about a real child who drew them, right?
  
  Then, I think GAN is not faithful for your study.
  
  Of course, GAN can make very similar pictures with your training set.
  
  However, it does not mean the synthesized images can contain the things what you want!
  
  GAN just synthesizes "fake pictures" that cannot be distinguished from your training set.
  
  The synthesized pictures may do not have any meaningful thing.
  
  Because it is not drawn by the real child.
  
  $\ $
  
  But it is worth to do.
  
  May GAN captures some features of "children-like". (But I think it is too hard.)
  
  You can find lots of GAN for your research, especially DCGAN.
  
  > **Comments:**
  > **username_0**: I want to use GAN to generate a generalized image for a certain age (4-12). Just one per age. That image will be used for manual analysis.  
  
  ---
  
  