I'm trying to build a CNN to play a game online. This game to be precise:
https://www.gameeapp.com/game-bot/ibBTDViUP
I've collected images and labels for each image. These labels tell the network to press SPACE (output 1) or do nothing (output 0).
I'm training the network using Keras, like this:
history = model.fit_generator(
train_generator,
steps_per_epoch=2000 // batch_size,
epochs=3,
validation_data=validation_generator,
validation_steps=800 // batch_size)
The network looks like this:
model = Sequential()
model.add(Conv2D(32, (3, 3), input_shape=(275, 208, 1)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(64, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(64, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten())
model.add(Dense(64))
model.add(Activation('relu'))
model.add(Dropout(0.5))
model.add(Dense(1))
model.add(Activation('sigmoid'))
model.compile(loss='binary_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])
The thing is. Most of the time the network ends up always outputting 1 or always zero even when the images are completely unrelated to the game images.
Am I modelling this problem the right way?
How can I make the best way for the network to be able to Identify to "not do" anything.
Please let me know if the question isn't clear and Thanks in advance!