I'm doing a project where a python script used a convolutional neural network to determine if a plant is healthy, and then water it based on that. While training the CNN, it seems to get up to 100% accuracy quite early, although it isn't accurate. I only have a little less than 2000 images, and was wondering if I didn't have enough, or it was my model, which is here
self.model = Sequential() self.model.add(Conv2D(numFilters, filterSize, activation='relu', input_shape=(IMG_SIZE, IMG_SIZE, 3))) self.model.add(Conv2D(numFilters * 2, (3, 3), activation='relu')) self.model.add(MaxPooling2D(pool_size=poolSize)) self.model.add(Dropout(0.25)) self.model.add(Flatten()) self.model.add(Dense(numFilters * 4, activation='relu')) self.model.add(Dropout(0.5)) self.model.add(Dense(2, activation='softmax')) self.model.compile(loss='categorical_crossentropy', optimizer = 'adam', metrics=['accuracy'])
I would just like to know the reason why it doesn't train well. Thanks.