SegmentationFPR95#

class torch_uncertainty.metrics.segmentation.SegmentationFPR95(pos_label, ignore_index=None, **kwargs)[source]#

Image-averaged FPR@95 TPR for dense binary segmentation tasks.

For each image, a per-pixel False Positive Rate at 95% True Positive Rate is computed (see FPR95) from the pixel scores and binary OOD labels. The metric is then averaged over the \(B\) images of the test set:

\[\text{FPR95} = \frac{1}{B} \sum_{b=1}^{B} \text{FPR95}_b.\]

Image-wise averaging is the convention used in the dense OOD-detection literature.

Images without both positive and negative pixels are excluded because FPR@95 is undefined. The metric returns nan if no valid image was observed. A one-dimensional input is treated as one image; otherwise, the first dimension is the image batch dimension.

Parameters:
  • pos_label (int) – The positive label in the segmentation OOD detection task (typically 1 for OOD pixels).

  • ignore_index (int | None) – Optional label value to ignore.

  • kwargs – Additional keyword arguments for the underlying FPR95 metric.