JumaRubea's picture
push main.ipynb utils.py and model.py
68ed147 verified
from tensorflow.keras.models import Sequential
import tensorflow.keras.layers as tfl
def cat_dog_model(image_size, image_channel):
model = Sequential([
# Block 1
tfl.Conv2D(32, (3, 3), activation='relu', input_shape=(image_size, image_size, image_channel)),
tfl.BatchNormalization(),
tfl.MaxPooling2D(pool_size=(2, 2)),
tfl.Dropout(0.2),
# Block 2
tfl.Conv2D(64, (3, 3), activation='relu'),
tfl.BatchNormalization(),
tfl.MaxPooling2D(pool_size=(2, 2)),
tfl.Dropout(0.2),
# Block 3
tfl.Conv2D(128, (3, 3), activation='relu'),
tfl.BatchNormalization(),
tfl.MaxPooling2D(pool_size=(2, 2)),
tfl.Dropout(0.2),
# Block 4
tfl.Conv2D(256, (3, 3), activation='relu'),
tfl.BatchNormalization(),
tfl.MaxPooling2D(pool_size=(2, 2)),
tfl.Dropout(0.2),
# Fully Connected Layers
tfl.Flatten(),
tfl.Dense(512, activation='relu'),
tfl.BatchNormalization(),
tfl.Dropout(0.2),
# Output Layer (Softmax for multi-class classification)
tfl.Dense(1, activation='sigmoid')
])
return model