How does Keras calculate accuracy?
For binary classification, the code for accuracy metric is:
K.mean(K.equal(y_true, K.round(y_pred)))

which suggests that 0.5 is the threshold to distinguish between classes. y_true should of course be 1-hots in this case.
It's a bit different for categorical classification:
K.mean(K.equal(K.argmax(y_true, axis=-1), K.argmax(y_pred, axis=-1)))

which means &quot;how often predictions have maximum in the same spot as true values&quot;
There is also an option for top-k categorical accuracy, which is similar to one above, but calculates how often target class is within the top-k predictions.