How to change CNN model when reducing image size

I build a CNN model for defect detection with dataset images 120*120 size.

Now I change my images into 60*60 size and I want to run my CNN model for these images. For that, I just change my input_shape from (120,120,3) into (60,60,3), but when I run my CNN model, the accuracy reduced a lot!

Here is my CNN model:

from keras.models import Sequential

model = Sequential()
model.add(tf.keras.layers.Conv2D(input_shape = (60, 60, 3), filters=16, kernel_size=(3, 3), activation='relu'))
model.add(tf.keras.layers.MaxPool2D(pool_size=(2, 2)))
model.add(tf.keras.layers.Conv2D(filters=32, kernel_size=(3, 3), activation='relu'))
model.add(tf.keras.layers.MaxPool2D(pool_size=(2, 2)))
model.add(tf.keras.layers.GlobalAveragePooling2D())
model.add(tf.keras.layers.Dense(3, activation='softmax'))

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

print(model.summary())
history = model.fit(
    train_data,
    validation_data=val_data,
    epochs=100,
    callbacks=[
        tf.keras.callbacks.EarlyStopping(
            monitor='val_loss',
            patience=3,
            restore_best_weights=True
        )
    ]
)

Also, after I run my CNN and get low accuracy, I want to test one image, but I got error. Here is my test part:

import os

from PIL import Image
import numpy as np
from skimage import transform

def load(filename):
    np_image = Image.open(filename)
    np_image = np.array(np_image).astype('float32')/255
    np_image = np.expand_dims(np_image, axis=0)
    return np_image

folder_path = './New folder/29.png'
image = load(folder_path)
pred = model.predict(image)
pred.tolist()[0]

The error I got is:

ValueError: Input 0 of layer sequential_2 is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: (None, 60, 60)

Could any one help me to solve these problems? I would be so thankful.

Answer

Try this:

def load(filename):
    np_image = Image.open(filename)
    np_image = np.array(np_image).astype('float32')/255
    np_image = transform.resize(np_image, (60, 60, 3))
    np_image = np.expand_dims(np_image, axis=0)
    return np_image