0
$\begingroup$

I made an autoencoder to, ideally, turn an image into seemingly random numbers(Using a loss that determines randomness) and turn those random numbers into the original image. The results were kind of meh. The ideal encoded image would just look like rainbow static, but I got this instead:

Badly Encoded Image

The decoded image was also kind of bad, but that's the same problem as the encoder. I was wondering if there was a better way to handle the image -> random -> image conversions better. Like maybe changing the stride length or filter size could help it learn global features better. Here is what my current encoder and decoder look like:

input_layer = Input(shape=input_shape)
x = Conv2D(4, (3, 3), activation='relu', padding='same')(input_layer)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
x = Conv2D(4, (3, 3), activation='relu', padding='same', groups=1)(x)
decoded = Conv2D(3, (3, 3), activation='sigmoid', padding='same')(x)

Pls don't judge my autoencoder 💀 Thanks

$\endgroup$
4
  • $\begingroup$ Why should you be able to reconstruct the image from random values? $\endgroup$
    – Dave
    Commented Dec 30, 2023 at 2:32
  • $\begingroup$ @Dave The encoded images wouldn't really be random, but I have a loss on the encoder based on how random the distribution of images is. This way, it can create a random-looking image for each real image while being able to sneak information through to the decoder. I just have a problem where CNNs are good at spatially related images, but not random numbers. $\endgroup$ Commented Dec 30, 2023 at 10:21
  • $\begingroup$ That last part makes it sound like the CNN is doing what it’s supposed to do. It isn’t supposed to invent patterns out of randomness (that’s overfitting, at least a little loosely speaking). $\endgroup$
    – Dave
    Commented Dec 30, 2023 at 10:33
  • $\begingroup$ @NathanaelSuarez To receive an answer quickly, it may help to clearly outline your question in the post. $\endgroup$
    – DeepQZero
    Commented Dec 30, 2023 at 18:05

0

You must log in to answer this question.