binary image classification with cnn #886
-
I am trying to classify if a given image is a woodpile or not. So my classes are wood and none_wood. None_wood class contains different photos including documents, numbers, persons etc. My train set consist of 4655 wood and 4566 none_wood images(I used augmentor to increase the size of none_wood class) and test set includes 1139 images of each class. My model is as following: classifier = Sequential() I tried different epochs up to 10, I added callback to prevent overfit, I did data augmentation with ImageDataGenerator, there is no imbalance in the dataset, I tried different optimizers, I tried different loss functions but there is no change. What do you suggest? I could not understand what is the exact problem and why the FP and TN values are 0 in confusion matrix? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
there is a duplication of the Convolution2D layer with the same parameters in your model architecture. You should have a different set of layers for building a convolutional neural network (CNN) properly. Here's a revised version of your model:
In this corrected code, we have a single instance of each convolutional layer (with the parameters you specified) followed by the appropriate pooling layers and other layers for your binary classification task. |
Beta Was this translation helpful? Give feedback.
there is a duplication of the Convolution2D layer with the same parameters in your model architecture. You should have a different set of layers for building a convolutional neural network (CNN) properly. Here's a revised version of your model:
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense