I made my simple image classification model(classification.h5) by using CNN and I am hoping to see whether my model is working properly.
My CNN model is:
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
model = Sequential()
model.add(Conv2D(16, (3, 3), activation='relu', strides=(1, 1),
padding='same',input_shape=input_shape))
model.add(MaxPool2D((2, 2)))
model.add(Dropout(0.5))
model.add(Conv2D(32, (3, 3), activation='relu', strides=(1, 1),
padding='same'))
model.add(MaxPool2D((2, 2)))
model.add(Dropout(0.5))
model.add(Conv2D(412, (13, 13), strides=(1, 1), padding = 'same', activation='relu'))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Dropout(0.5))
model.add(Flatten())
model.add(Dense(128, activation='relu'))
model.add(Dense(64, activation='relu'))
model.add(Dense(4, activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer='adam',metrics=['acc'])
The model worked well. For the next step, I tried to see if this model really works well but I am lost how actually I can see the real result.
What I want to try to see is shown below:
model prediction = 'Model predicted answer'
Real Answer = 'Real answer'
How can I write the code for this output?
model.fit(x_train, y_train)
). You get the model's predictions with (model.predict(x_test)
). Does this answer your question? – Max Mar 2 at 2:10