# Binary classification to recognize blobs on pictures generates many false-positive results

I am training a NN for blobs vs non-blobs recognition.

Blobs example:

Non-blobs:

Keras architecture is:

model = Sequential() activation = "relu" model = Sequential([
Convolution2D(8,(3,3), activation='relu', input_shape=input_shape),
Convolution2D(8,(3,3), activation='relu'),
MaxPooling2D(),
Convolution2D(16,(3,3), activation='relu'),
Convolution2D(16,(3,3), activation='relu'),
MaxPooling2D(),
Flatten(),
Dense(1024, activation='relu'),
Dense(128, activation='relu'),
Dense(16, activation='relu'),
Dense(1, activation='sigmoid')   ]) opt = SGD(lr=0.01) model.compile(loss="binary_crossentropy", optimizer=opt, metrics=["accuracy"])


Although training accuracy is about 96-97%, there are 25-30% of false-positive cases.

Tried different things, like add more convolution layers, change number of filters, add dense layers - no difference, the mentioned model is pretty much the best.

I appreciate any advice to improve the recognition.

• Hi and welcome. Can you please put your main question in the title? "Need advice" is not a question and you should not ask for advice but for possible solutions. You should be able to summarise your main question in one line. – nbro Jun 25 at 16:33
• Changed, thank you – TPRLab Jun 25 at 16:50
• Use softmax as the output layer activation. I haven't tried myself, but I don't think you should be using sigmoid with cross-entropy loss. – Recessive Jun 26 at 3:26