Just starting learning things about tensorflow and NN. As an exercise I decided to create a dataset of images, watermarked and not, in order to binary classify these. First of all, the dataset ( you can see it here ) was created artificially by me applying some random watermarks. First doubt, in the dataset I don't have both images one watermarked and one not, would be better to have? Second, frustrating: model stand on 0.5 accuracy, so it just produce random output :( Model I tried is this:
model = tf.keras.Sequential([ tf.keras.layers.Conv2D(16,(1,1), activation='relu', input_shape=(150, 150, 3)), tf.keras.layers.MaxPool2D(2,2), tf.keras.layers.Conv2D(32,(3,3), activation='relu'), tf.keras.layers.MaxPool2D(2,2), tf.keras.layers.Conv2D(64,(3,3), activation='relu'), tf.keras.layers.MaxPool2D(2,2), tf.keras.layers.Flatten(), tf.keras.layers.Dense(128, activation='elu'), tf.keras.layers.Dense(64, activation='elu'), tf.keras.layers.Dense(32, activation='relu'), tf.keras.layers.Dense(1,activation="sigmoid")
and then compiled as this:
model.compile(optimizer='adam', loss='binary_crossentropy', metrics = ['accuracy'])
Here below the fit:
history = model.fit(train_data, validation_data=valid_data, steps_per_epoch=100, epochs=15, validation_steps=50, verbose=2)
As for any other details, code is here. I already checked for technical issues, I'm pretty sure image enter properly, train and validation dataset are 80/20, about 12K images for training. However accuracy bounches up and down around .5 while fitting. How can I improve?