3D Nerve Segmentation QPBO Benchmark

Faster Multi-Object Segmentation using Parallel Quadratic Pseudo-Boolean Optimization, ICCV 2021 Paper

Author: Niels Jeppesen (niejep@dtu.dk)

This notebook is based on the NerveSegmentation3D.ipynb notebook by Jeppesen et. al. Parts of this notebook is copied directly from the NerveSegmentation3D.ipynb notebook with little or no modification.

The goal of this notebook is to benchmark three different QPBO implementations (P-QPBO, M-QPBO and K-QPBO) on two large 3D segmentation tasks.

To run the benchmark, a modified version of the slgbuilder package, which includes P-QPBO and M-QPBO is required. This version of the slgbuilder package relies on the shrdr package for P-QPBO and M-QPBO C++ wrappers. Both packages are included in the supplementary material alongside this notebook.

N1 and N2 configurations

The N1 and N2 segmentation tasks are based on the same raw data. However, N2 uses more samples, resulting in a larger graph. The two cells below contain the paramters used for the N1 and N2 tasks, respectively. For N2 we have use to 64-bit edge/arc indices to avoid overflow due to the number of edges.

Nerve Data

The data we'll be working with comes from volume of a small cut-out from the hand or wrist of a person. In this data, the nerves are clearly visible and almost completely aligned in terms of direction. In this notebook we'll working with the full volume and segment our over one hundred nerves. For the nerves we'll be segmenting center lines have been annotated by a another process.

The raw volume is 2048x2048x2048. The center annotations were made on a 512x512x512 downscaled volume, but we can use them here.

Reading data

Let's load the image and annotated approximate center positions.

Getting center positions

Because the center positions where created on a lower resolution we need to translate their positions and use interpolation to estimates centers in the slices we create. Each nerve will have a center line, which we will create as a simple list of points.

Unfolding data

We need unfold the nerves to use them with column-ordered graphs.

Segmentation

We define functions for constructing the energy function using slgbuilder, specifically the MQPBOBuilder. We also define functions for copying a builder, building and solving the defined QPBO problem. The reason we copy the builder is to save time in the build process.

Benchmark

We solve QPBO problem with each of the three different implementations a number of times. For P-QPBO we benchmark the implementation for a number of different parallel thread configurations.

Save results

We add system information to the results and save them as CSV.