Computing Valid P-Values for Image Segmentation by Selective Inference

Kosuke Tanizaki, Noriaki Hashimoto, Yu Inatsu, Hidekata Hontani, Ichiro Takeuchi

Abstract: Image segmentation is one of the most fundamental tasks in computer vision. In many practical applications, it is essential to properly evaluate the reliability of individual segmentation results. In this study, we propose a novel framework for quantifying the statistical significance of individual segmentation results in the form of p-values by statistically testing the difference between the object region and the background region. This seemingly simple problem is actually quite challenging because the difference — called segmentation bias — can be deceptively large due to the adaptation of the segmentation algorithm to the data. To overcome this difficulty, we introduce a statistical approach called selective inference, and develop a framework for computing valid p-values in which segmentation bias is properly accounted for. Although the proposed framework is potentially applicable to various segmentation algorithms, we focus in this paper on graph-cut- and threshold-based segmentation algorithms, and develop two specific methods for computing valid p-values for the segmentation results obtained by these algorithms. We prove the theoretical validity of these two methods and demonstrate their practicality by applying them to the segmentation of medical images.

Introduction: The Problem of Segmentation Bias

In fields like medical imaging, knowing whether a segmented region (such as a potential tumor) is "real" or merely a result of random noise is critical. Traditionally, researchers evaluate a segmentation algorithm's reliability by comparing its average intensity in the "object" pixels versus the "background" pixels. If the difference is large, the $p$-value is small, and the result is deemed significant.

However, this approach suffers from a fundamental flaw known as segmentation bias or "double-dipping." Segmentation algorithms are designed to maximize the difference between regions. If an algorithm is run on an image of pure noise, it will still find two regions that look different. A naive statistical test will interpret this deceptive difference as a significant finding, leading to a high rate of false positives.

Illustration of segmentation bias on noise vs. selective inference.

Post-Segmentation Inference (PSegI)

To overcome this, we introduce Post-Segmentation Inference (PSegI), a framework that leverages Selective Inference (SI). Instead of a standard test, PSegI calculates a conditional $p$-value. It asks: "Given that our algorithm chose this specific segmentation result, how likely is it that we would see such a large difference between regions by pure chance?"

The core technical contribution is demonstrating that for many popular algorithms, the "event" of choosing a specific segmentation can be described as a set of quadratic inequalities ($x^\top A x + b^\top x + c \le 0$). By conditioning the null distribution on these constraints, we can compute a "selective $p$-value" that is mathematically guaranteed to be valid (i.e., uniformly distributed under the null hypothesis).

Implementation and Algorithms

The paper specifically develops solutions for two major classes of segmentation algorithms:

  1. Graph-Cut (GC) Segmentation: We show that the min-cut/max-flow optimization process can be decomposed into a series of comparisons that fit the quadratic inequality requirement.
  2. Threshold (TH) Based Segmentation: This includes both global (Otsu’s method) and local thresholding, characterizing the selection of the optimal threshold as a set of constraints on the image data.

Experimental Results

The authors evaluated PSegI using artificial noise, pathological tissue specimens (spleen and lymph nodes), and CT images from the MICCAI Liver Tumor Segmentation Challenge.

  • False Positive Rate (FPR) Control: In simulations on pure noise, the naive method failed, producing $p$-values near zero almost 100% of the time as image size increased. The proposed selective $p$-values correctly maintained the FPR at the target significance level (e.g., $\alpha = 0.05$).
  • Practical Utility: On real medical images, the naive method gave $p \approx 0$ for almost every segmentation, even incorrect ones. PSegI correctly flagged unreliable segmentations (e.g., $p = 0.35$ or $0.77$) that were likely picking up background textures, while maintaining small $p$-values for clear, fibrous regions.

Limitations and Future Work

While robust, the framework currently assumes that image noise follows a multivariate normal distribution. Furthermore, characterizing the segmentation process as a set of inequalities is computationally intensive. Extending Selective Inference to the non-linear, high-dimensional "selection" performed by modern deep learning-based segmentation (CNNs/Transformers) remains a significant open challenge.

Summary updated

BibTeX
@inproceedings{tanizaki2020computing,
  author = {Kosuke Tanizaki and Noriaki Hashimoto and Yu Inatsu and Hidekata Hontani and Ichiro Takeuchi},
  title = {{Computing Valid P-Values for Image Segmentation by Selective Inference}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  url = {https://openreview.net/forum?id=q8oWlR3Oqo},
}
Figure