Differences between CPU and GPU execution

Running the same BiaPy workflow on a CPU versus a GPU can result in significant differences in both execution time and variability in the results. To illustrate these differences, we provide the results of several tests conducted across various workflows and image dimensions.

2D Workflow Comparison

The following results were obtained using BiaPy v3.5.0, the wound_segmentation template, and the embryo wound segmentation dataset ([1]).

Semantic segmentation

CPU

GPU

Train time (360 epochs, patience 50)

Test Foreground IoU (per patch)

Test Foreground IoU (merge patches)

3:15:16 ± 0:05:30

0,336 ± 0.000

0,410 ± 0.000

0:22:12 ± 0:00:07

0,279 ± 0.004

0,369 ± 0.012

For instance segmentation, the following results were obtained using BiaPy v3.5.0, the instance_segmentation template, and the ZeroCostDL4Mic Stardist dataset for cell instance segmentation.

Instance segmentation

CPU

GPU

Train time (360 epochs, patience 50)

Test Foreground IoU (per patch)

Test Foreground IoU (merge patches)

Precision (threshold 0.3)

Precision (threshold 0.5)

Precision (threshold 0.75)

Recall (threshold 0.3)

Recall (threshold 0.5)

Recall (threshold 0.75)

Accuracy (threshold 0.3)

Accuracy (threshold 0.5)

Accuracy (threshold 0.75)

F1 (threshold 0.3)

F1 (threshold 0.5)

F1 (threshold 0.75)

Panoptic quality (threshold 0.3)

Panoptic quality (threshold 0.5)

Panoptic quality (threshold 0.75)

3:31:36 ± 0:01:54

0,077 ± 0.000

0,741 ± 0.000

0,973 ± 0.000

0,968 ± 0.000

0,802 ± 0.000

0,982 ± 0.000

0,977 ± 0.000

0,809 ± 0.000

0,955 ± 0.000

0,947 ± 0.000

0,674 ± 0.000

0,977 ± 0.000

0,973 ± 0.000

0,805 ± 0.000

0,820 ± 0.000

0,818 ± 0.000

0,704 ± 0.000

0:12:54 ± 0:00:11

0,074 ± 0.002

0,732 ± 0.008

0,932 ± 0.003

0,922 ± 0.003

0,859 ± 0.008

0,984 ± 0.003

0,972 ± 0.003

0,907 ± 0.008

0,918 ± 0.006

0,898 ± 0.006

0,790 ± 0.013

0,957 ± 0.003

0,946 ± 0.003

0,883 ± 0.008

0,830 ± 0.001

0,825 ± 0.001

0,783 ± 0.007

3D Workflow Comparison

For 3D semantic segmentation, the following values were measured with BiaPy v3.5.0, the 3D semantic_segmentation template, and the EPFL CVLAB electron microscopy dataset for mitochondria segmentation.

Semantic segmentation

CPU

GPU

Train time (360 epochs, patience 50)

Test Foreground IoU (per patch)

Test Foreground IoU (merge patches)

13:56:47 ± 00:02:02

0,121 ± 0.000

0,858 ± 0.000

02:11:03 ± 00:12:19

0,115 ± 0.010

0,829 ± 0.046

For 3D instance segmentation, these values were measured using BiaPy v3.5.0, the 3D instance_segmentation template, and the StarDist 3D demo dataset for nuclei instance segmentation.

Instance segmentation

CPU

GPU

Train time (360 epochs, patience 50)

Test Foreground IoU (per patch)

Test Foreground IoU (merge patches)

Precision (threshold 0.3)

Precision (threshold 0.5)

Precision (threshold 0.75)

Recall (threshold 0.3)

Recall (threshold 0.5)

Recall (threshold 0.75)

Accuracy (threshold 0.3)

Accuracy (threshold 0.5)

Accuracy (threshold 0.75)

F1 (threshold 0.3)

F1 (threshold 0.5)

F1 (threshold 0.75)

Panoptic quality (threshold 0.3)

Panoptic quality (threshold 0.5)

Panoptic quality (threshold 0.75)

4:24:58 ± 0:06:49

0,074 ± 0.000

0,797 ± 0.000

0,996 ± 0.000

0,912 ± 0.000

0,106 ± 0.000

0,957 ± 0.000

0,877 ± 0.000

0,102 ± 0.000

0,953 ± 0.000

0,808 ± 0.000

0,055 ± 0.000

0,976 ± 0.000

0,894 ± 0.000

0,104 ± 0.000

0,629 ± 0.000

0,591 ± 0.000

0,081 ± 0.000

0:42:29 ± 0:00:55

0,073 ± 0.001

0,804 ± 0.001

0,996 ± 0.000

0,924 ± 0.012

0,096 ± 0.010

0,953 ± 0.006

0,885 ± 0.006

0,091 ± 0.009

0,949 ± 0.006

0,825 ± 0.015

0,049 ± 0.005

0,974 ± 0.003

0,904 ± 0.009

0,093 ± 0.010

0,631 ± 0.002

0,598 ± 0.003

0,073 ± 0.007