Different loss functions used by default in Keras, make use of average beetween all sample and all components. In particular, I used:
model_cnn_dense.compile(loss