Solved – Penalize False negative in Deep Learning

classificationdeep learning

I am doing pathology classification (normal vs different pathologies).

I want to penalize more False negative than False positive in convolutional network (with Keras or Tensorflow package). Accuracy does not seem suitable

Best Answer

Going to convert my comment into an answer.

Deep learning models for binary classification produce probabilities, not class assignments. So the assignment of a class happens outside the scope of the neural network.

how does the model decide in case of low probability? randomly?

No, the model just does not decide to assign classes in ANY case, it ONLY assigns probabilities. Assigning classes based on the probabilities is outside the scope of a neural network, you, the modeler, need to determine some kind of rule to convert the probabilities into class assignments if that is a necessary step for solving your problem.

Assigning a class randomly has some pretty poor properties. Suppose we have two data points, and the model tells us that p = 0.1 for the first data point, and p = 0.05 for the second. You do not want to put yourself in a situation where you decide yes on the second data point and no on the first, since that is inconsistent with your probability estimates.

The standard procedure for this in a binary classification problem is picking a threshold for which you decide yes when the probability is greater than the threshold and no when the probability is less than the threshold. Developing that threshold is very problem specific, and is outside to scope of statistics and machine learning.

Related Question