How to create network that outputs an image

187 views
Skip to first unread message

Jakub Mareda

unread,
Dec 4, 2018, 1:57:25 PM12/4/18
to convnetjs
I would like to create network that performs a transform on an image. That means I need it to have the same dimensions of output as it has for input. How can I set upt the output layer to be a 3*X*Y matrix?

jjrod...@anda.pe

unread,
Feb 26, 2019, 3:26:31 PM2/26/19
to convnetjs
On Tuesday, December 4, 2018 at 1:57:25 PM UTC-5, Jakub Mareda wrote:
> I would like to create network that performs a transform on an image. That means I need it to have the same dimensions of output as it has for input. How can I set upt the output layer to be a 3*X*Y matrix?

You probably have to develop a GAN

Allister Tanner

unread,
May 29, 2019, 4:33:35 PM5/29/19
to convnetjs
It depends on the type of image you'd like to produce.  There is a nice article here: http://blog.otoro.net/2015/06/19/neural-network-generative-art/

You could also use a version of the image painter demo, which is interesting to note, that it can store more than one image at the same time, with suitable modification. The number of network weights and the complexity of the images has a bearing on how reliably it can store more than one image - it may be that if all images were of the same type of object then you'd get away with less weights.  I added two more inputs (for two images) that define whether the pixels come from image 1 or image 2 (I used something called 'one's hot' encoding), hoping to make a type of image autoencoder, with inputs that actually meant something (which image).  After suitable training time to get the images looking somewhat like the originals, you can alter the x,y and values for what the images is meant to be to get strange combinations of both images (keep the 'what' inputs the same and ask it for the pixels one by one.  It might even work for more than 2 images, but I have not tried this.
Here is what the result looks like for two of the images in the image painter demo - Rubik's cube and world: https://www.youtube.com/watch?v=Dc8cyOwbHRE  
Reply all
Reply to author
Forward
0 new messages