What is wrong with this CNN network, why are there hot pixels? I'm building a CNN decoder, which mirrors (in reverse) the VGG network structure from Conv-4-1 layer. 

The net seems to be working fine, however, the output looks broken. Please note that the colour distortion is fine, it's the the [255/0 RGB pixels] e.g. green that I'm worrying about.

I tried to overfit a single image, but even then I get these hot pixels. Does anyone know why they appear?



My net:

    activation = 'elu'

    input_ = Input((None, None, 512))
    x = Conv2D(filters=256, kernel_size=self.kernel_size, padding='same', bias_initializer='zeros', activation=activation)(input_)

    x = UpSampling2D()(x)
    for _ in range(3):
        x = Conv2D(filters=256, kernel_size=self.kernel_size, padding='same', activation=activation)(x)
    x = Conv2D(filters=128, kernel_size=self.kernel_size, padding='same', activation=activation)(x)

    x = UpSampling2D()(x)
    x = Conv2D(filters=128, kernel_size=self.kernel_size, padding='same', activation=activation)(x)
    x = Conv2D(filters=64, kernel_size=self.kernel_size, padding='same', activation=activation)(x)

    x = UpSampling2D()(x)
    x = Conv2D(filters=64, kernel_size=self.kernel_size, padding='same', activation=activation)(x)
    x = Conv2D(filters=3, kernel_size=self.kernel_size, padding='same')(x)

    model = Model(inputs=input_, outputs=x)
I've seen this too many times - it's not a problem with your network, it's a problem with matplotlib and how it displays the image. You are probably trying to display a float with range $&lt;0, 255&gt;$. When matplotlib sees float type as input, it assumes a range of $&lt;0, 1&gt;$, and thresholds everything outside of that range, and the results you can see.