text_plain_output_2.png text_plain_output_1.png
from tensorflow.keras.layers import Conv2D, MaxPooling2D

from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten

from tensorflow.keras.models import Sequential

import pickle

import pickle
with open('../input/X.pickle', 'rb') as fp:
    X_feature = pickle.load(fp)
with open('../input/Y.pickle', 'rb') as fp:
    Y_label = pickle.load(fp)

X_feature = X_feature / 255.0
model = Sequential()
model.add(Conv2D(64, (3, 3), input_shape=X_feature.shape[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(Dense(4))
model.add(Activation('softmax'))

model.compile(loss='sparse_categorical_crossentropy', optimizer='sgd', metrics=['accuracy'])

model.fit(x=X_feature, y=Y_label, batch_size=20, epochs=50, validation_split=0.1, shuffle=True)