<p>I suggest you use a type of <a href="https://arxiv.org/abs/1505.04597" rel="nofollow noreferrer">UNet</a>. This kind of architecture has downsampling layers, followed by up sampling layers to get back to the original spatial dimensions.</p>

<p>Please refer <a href="https://github.com/iver56/image-regression" rel="nofollow noreferrer">this</a> Image Regression article </p>
Can a Convolutional Neural Network output images?
<p>I am working on a deep learning problem which requires me to have a deep - learning model that has as input an image and as output another image. Now, the input and output images are of different dimensions and for this reason I cannot use an autoencoder. I have already tried to build a very simple Convolutional Neural Network that has a final output dense layer that has as "units" argument the width and height of the output image multiplied together. However, this network that I am attaching below did not have success. My questions are: </p>

<ul>
<li>are CNNs the right type of deep learning network to approach this problem in the way I did it?</li>
<li>if not, what are the other type of deep learning networks I can experiment 
to tackle this problem?</li>
</ul>

<p>Thanks in advance!</p>

<p>Here is the summary of the CNN model that I have already tried:</p>

<hr>

<h1>Layer (type)                 Output Shape              Param #</h1>

<p>conv2d_1 (Conv2D)            (None, 26, 877, 32)       544       </p>

<hr>

<p>activation_1 (Activation)    (None, 26, 877, 32)       0         </p>

<hr>

<p>max_pooling2d_1 (MaxPooling2 (None, 13, 438, 32)       0         </p>

<hr>

<p>conv2d_2 (Conv2D)            (None, 12, 437, 16)       2064      </p>

<hr>

<p>activation_2 (Activation)    (None, 12, 437, 16)       0         </p>

<hr>

<p>max_pooling2d_2 (MaxPooling2 (None, 6, 218, 16)        0         </p>

<hr>

<p>conv2d_3 (Conv2D)            (None, 5, 217, 8)         520       </p>

<hr>

<p>activation_3 (Activation)    (None, 5, 217, 8)         0         </p>

<hr>

<p>max_pooling2d_3 (MaxPooling2 (None, 2, 108, 8)         0         </p>

<hr>

<p>activation_4 (Activation)    (None, 2, 108, 8)         0         </p>

<hr>

<p>flatten_1 (Flatten)          (None, 1728)              0         </p>

<hr>

<p>dropout_1 (Dropout)          (None, 1728)              0         </p>

<hr>

<p>dense_1 (Dense)              (None, 19316)             33397364  </p>

<p>=================================================================
Total params: 33,400,492
Trainable params: 33,400,492
Non-trainable params: 0</p>

<hr>

<pre><code>def generator(data_arr, batch_size = 10):

num = len(data_arr) 

if num % batch_size != 0 : 
    num = int(num/batch_size)

# Loop forever so the generator never terminates
while True: 

for offset in range(0, num, batch_size):

    batch_samples = (data_arr[offset:offset+batch_size])

    samples = []
    labels = []

    for batch_sample in batch_samples:

        samples.append(batch_sample[0])
        labels.append((np.array(batch_sample[1].flatten)).transpose())

    X_ = np.array(samples)
    Y_ = np.array(labels)

    X_ = X_[:, :, :, newaxis]

    yield (X_, Y_)

# compile and train the model using the generator function
train_generator = generator(training_data, batch_size = 10)
validation_generator = generator(val_data, batch_size = 10)

run_opts = tf.RunOptions(report_tensor_allocations_upon_oom = True)

model = Sequential()

model.add(Conv2D(32, (4, 4), strides=(2, 2), input_shape = (55, 1756, 
1)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size = (2, 2)))

model.add(Conv2D(16, (2, 2)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size = (2, 2)))

model.add(Conv2D(8, (2, 2)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size = (2, 2)))

model.add(Activation('softmax'))
model.add(Flatten())  
model.add(Dropout(0.3))
model.add(Dense(19316))

model.compile(loss = 'categorical_crossentropy',
              optimizer = 'adam',
              metrics = ['accuracy'],
              options = run_opts)

model.summary()

batch_size = 20
nb_epoch = 6

model.fit_generator(train_generator, 
                    steps_per_epoch = len(training_data) ,
                    epochs = nb_epoch,
                    validation_data = validation_generator,
                    validation_steps = len(val_data))
</code></pre>