image_output_1.png
import tensorflow as tf

training_data_gen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1 / 255.0, rotation_range=40, zoom_range=0.2, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, horizontal_flip=True, vertical_flip=True)
training_generator = training_data_gen.flow_from_dataframe(dataframe=train, x_col='images', y_col='labels', target_size=(224, 224), color_mode='rgb', class_mode='categorical', batch_size=64)
val_data_gen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1 / 255.0)
validation_generator = val_data_gen.flow_from_dataframe(dataframe=val, x_col='images', y_col='labels', target_size=(224, 224), color_mode='rgb', class_mode='categorical', batch_size=64)
test_data_gen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1 / 255.0)
test_generator = test_data_gen.flow_from_dataframe(dataframe=test, x_col='images', y_col='labels', target_size=(224, 224), color_mode='rgb', class_mode='categorical', batch_size=64)

mlp_model = tf.keras.models.Sequential()
mlp_model.add(tf.keras.layers.Flatten(input_shape=(224, 224, 3)))
mlp_model.add(tf.keras.layers.Dense(256, activation='relu'))
mlp_model.add(tf.keras.layers.Dropout(0.4))
mlp_model.add(tf.keras.layers.Dense(256, activation='relu'))
mlp_model.add(tf.keras.layers.Dense(128, activation='relu'))
mlp_model.add(tf.keras.layers.Dense(9, activation='softmax'))

tf.keras.utils.plot_model(mlp_model, show_shapes=True, show_dtype=True, show_layer_names=True)