I just tried Image Classification with Python TensorFlow Keras but for only one class and it worked. And now i wonder if this could also be upgraded into subclass classification. So, let's say I've classified for dogs and cats, and now I wanna improve the classification so that I can classify based on its races like Siberian Dog and Persian Cat)
Here are the imports that I used for single-class Image Classification:
from tensorflow.keras.models import Sequentialfrom tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Densefrom tensorflow.keras.preprocessing.image import ImageDataGeneratorAnd then I use Sequential Model like this:
model = models.Sequential()model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(img_height, img_width, 3)))model.add(layers.MaxPooling2D((2, 2)))model.add(layers.Conv2D(64, (3, 3), activation='relu'))model.add(layers.MaxPooling2D((2, 2)))model.add(layers.Conv2D(128, (3, 3), activation='relu'))model.add(layers.MaxPooling2D((2, 2)))model.add(layers.Flatten())model.add(layers.Dense(128, activation='relu'))model.add(layers.Dense(num_classes, activation='softmax'))