text_plain_output_1.png
from keras.layers import Conv2D, MaxPooling2D, Activation, Dropout, Flatten, Dense

from keras.models import Sequential

from keras.utils import normalize

from keras.utils import to_categorical

(x_train.shape, y_train.shape)

(x_test.shape, y_test.shape)

x_train = normalize(x_train, axis=1)
x_test = normalize(x_test, axis=1)
Y_train = to_categorical(y_train, num_classes=2)
Y_test = to_categorical(y_test, num_classes=2)

model = Sequential()
model.add(Conv2D(32, (3, 3), input_shape=(64, 64, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3), kernel_initializer='he_uniform'))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(64, (3, 3), kernel_initializer='he_uniform'))
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(2))
model.add(Activation('softmax'))

model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])

model.fit(x_train, Y_train, batch_size=16, verbose=True, epochs=10, validation_data=(x_test, Y_test), shuffle=False)