# What are True Positive and False Positive with reference to image processing

Say for instance, face detection algorithms - I see researchers testing their algorithms and table their results under TP and FP. What are these?

• This is more a machine-learning question than DSP. – user7358 Mar 1 '14 at 7:26
• Normally, I thought people in this area reported in terms of precision and recall curves (en.wikipedia.org/wiki/Precision_and_recall). – Batman Mar 1 '14 at 13:38
• but how can I detect whether a pixel is true positive or true negative ? Is it by visual inspection only ? Or there is any other method or metrics ? – Somesh Roy Dec 30 '17 at 9:51

A ,,true'' positive would be an image that has a property (in the context of face detection maybe: ,,contains a face'') and that is recognized by a program as such. A ,,false'' positive then is one that does not have the property but is recognized anyway.

These terms are validation metrics used for verifying quality of a segmented image. In a scenario where you want to compare a segmented image with ground truth, then taking the ground truth image as base of comparison you can make assumption of taking foreground as "white" pixels and background as "black" pixels in ground-truth. The terms that you referred then would mean:

1. True positive (TP) : pixels correctly segmented as foreground
2. False positive (FP) : pixels falsely segmented as foreground
3. True negative (TN) : pixels correctly detected as background
4. False negative (FN) : pixels falsely detected as background

These metrics are then used to calculate sensitivity, specificity and accuracy as:

sensitivity : The sensitivity tells us how likely the test is come back positive in someone who has the characteristic. This is calculated as TP/(TP+FN).

specificity : The specificity tells us how likely the test is to come back negative in someone who does not have the characteristic. This is calculated as TN/(TN+FP).

accuracy : (TP+TN)/(TP+FP+TN+FN)

Hope this helps !!