# Keras CNN image input and output

## I'm trying to build a CNN similar to this:

For this purpose I chose to use Keras since I worked with it before (simple RNN and FFNN only). My training data consists of the input data (25 x 25px images) and the output, being 25 x 25px images as well. The problem is, that I don't know how to build the Model using Keras. How do I specify the output to be of the same shape as the input?

Here is what I have so far:

batch_size = 5
input_shape = (batch_size, 28, 28,  32)

model = Sequential()
activation='relu',
input_shape=input_shape))
activation='relu',
input_shape=input_shape))

model.compile(loss=keras.losses.categorical_crossentropy,
optimizer=keras.optimizers.SGD(lr=0.01),
metrics=['accuracy'])


I know, that the code will not work like that. I just want to clarify what I'm trying to do. The code above was taken from: Keras tutorial – build a convolutional neural network in 11 lines

As of now I just tried to reverse the code from the point, where the tutorial would output the predicted label for the given image to transform the result back to the wanted output image.

• Hi and welcome, would you please put a reference for your image? Is that a formal architechture introduced in a paper? – Media Apr 17 '18 at 6:11