Might be wrong but best practice for the last layer for binary image classification is a single output neuron with a sigmoid activation. Something like this:
Idk if its just a standard thing or it's actually has a tangible improvement but yeh might improve training. The loss function used (SparseCategoricalCrossentropy) is also used for classifying non binary outputs. A loss='binary_crossentropy' should be more appropriate.
Might be wrong but best practice for the last layer for binary image classification is a single output neuron with a sigmoid activation. Something like this:
tf.keras.layers.Dense(1, activation=tf.nn.sigmoid (or whatever))
Idk if its just a standard thing or it's actually has a tangible improvement but yeh might improve training. The loss function used (SparseCategoricalCrossentropy) is also used for classifying non binary outputs. A
loss='binary_crossentropy'
should be more appropriate.again no idea if it has tangible benefits