Categories
Misc

Model predictions are shifted

Hey, I have trained an image classification problem to classify plant diseases, the training went well when testing the model with evaluate it gives 90% accuracy, it’s all rainbows, and till I started predicting single image.

I have 38 classes problem is if I tested it on an image from class 1 it will predict the image is class 10,

test it on an image from class 2 it will predict the image is class 11, class 3 will be class 12 class 4 will be class 13 and so on, like the labels are shifted linearly.

most images from any class will have their labels shifted to another class. I don’t know what’s going on here, any help would be appreciated.

code for reading the image and loading it to the model

img=np.resize(img,(256,256,3)) # Preprocessing the image img = image.img_to_array(img) # x = np.true_divide(x, 255) img = np.expand_dims(img, axis=0) img = img/255 prediction = model.predict(img) 

submitted by /u/Ali99695
[visit reddit] [comments]

Leave a Reply

Your email address will not be published.