I have used multiple deep learning models like CNN, MobileNetv2, InceptionResNetv2, ResNet152v2 but each and every models same accuracy and i have used Diabetic Retinopathy Dataset which I have collected from kaggle.
CNN model's coding:
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import cv2
import os
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.preprocessing import image
from tensorflow.keras.optimizers import RMSprop
train = ImageDataGenerator(rescale=1/255)
validation = ImageDataGenerator(rescale=1/255)
train_dataset = train.flow_from_directory(
'DR_Datasets/Training/',
target_size=(200,200),
batch_size = 3,
class_mode = 'binary')
validation_dataset = validation.flow_from_directory(
'DR_Datasets/Validation/',
target_size=(200,200),
batch_size = 3,
class_mode = 'binary')
test_dataset = validation.flow_from_directory(
'DR_Datasets/Testing/',
target_size=(200,200),
batch_size = 3,
class_mode = 'binary')
model = tf.keras.models.Sequential([tf.keras.layers.Conv2D(16,(3,3), activation='relu', input_shape=(200, 200, 3)),
tf.keras.layers.MaxPool2D(2,2),
tf.keras.layers.Conv2D(132,(3,3), activation='relu'),
tf.keras.layers.MaxPool2D(2,2),
tf.keras.layers.Conv2D(64,(3,3), activation='relu'),
tf.keras.layers.MaxPool2D(2,2),
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(512, activation='relu'),
tf.keras.layers.Dense(1, activation='sigmoid'), #softmax
])
model.compile(loss = 'binary_crossentropy', #categorical_crossentropy
optimizer = RMSprop(lr=0.001),
metrics = ['accuracy'])
model_fit = model.fit(train_dataset,
steps_per_epoch=3,
epochs= 100,
validation_data = validation_dataset)
# Evaluate the loss and accuracy
loss, accuracy = model.evaluate(test_dataset)
# Print the accuracy
print("Accuracy: " + str(accuracy))
I check it by changing the Layers(Less Layers/More Layers), Increasing and Decreasing the epochs and also changed the image size.
So, what should I do now?
Note: I got 95.06 from all of the applied models as CNN, MobileNetv2, InceptionResNetv2, ResNet152v2, But I want to get the differents accuray from the mention models.