Can I use the Softmax function with a binary classification in deep learning? I want to create a deep learning model (CNN) for binary classification, can I used the softmax function instead of the sigmoid function in binary classification?

Adding the classification layer to the model, will be like this

model.add(Dense(2, activation='softmax'))
For binary classification, it should give the same results, because softmax is a generalization of sigmoid for a larger number of classes.