$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
Data acquisition
To validate our toolbox, we analyzed two distinct tubular networks in adult mouse liver tissue: bile canaliculi (BC) and sinusoidal networks. For each structure, one 3D microscopy image from a single animal was used for training, while two independent images from different animals were used exclusively for testing. All liver images were acquired with isotropic voxel resolution of 0.3 µm/voxel, ensuring consistent sampling across the three spatial dimensions. The dataset, originally published in Morales-Navarrete et al.9, was curated using Labkit25, providing high-quality binary masks of the tubular structures used as ground truth for supervised learning. For the sinusoidal network, we generated two types of binary masks: one outlining the tube borders (hollow representation) and another capturing the filled tubular volume, enabling different training strategies depending on the application.
Additionally, we evaluated our toolbox on an external dataset of whole-brain blood vessels from adult Mus musculus, provided as part of the SELMA3D 2024 challenge. This dataset consists of 3D light-sheet microscopy images acquired under standard housing conditions (12 h light/12 h dark cycle for 3 months) and is available through BioStudies (S-BIAD1197) images26. Five brain images were used for training and nineteen for testing. The original anisotropic stacks were resampled to isotropic voxel dimensions using linear interpolation in Fiji to ensure compatibility with our analysis pipeline.
Preprocessing
To address the limited number of original 3D images, we applied data augmentation techniques that introduced realistic imaging artifacts and simulated varying signal-to-noise ratios ranging from 15 to 1. This approach was critical for enhancing the generalizability and robustness of the models.
The test image was subdivided into non-overlapping patches of 64 x 64 x 64 voxels to assess model performance at the regional level and to evaluate robustness across different spatial contexts within the same 3D volume.
Model architecture
We implemented and compared two convolutional neural network architectures tailored for 3D segmentation:
A standard 3D U-Net17, composed of symmetric encoder-decoder blocks with 2×2×2 max pooling, convolutional layers with ReLU activations, and a final 1 x 1 x 1 convolution followed by a sigmoid function for binary classification.
An Attention U-Net27, which incorporates an attention mechanism that dynamically highlights salient features and suppresses irrelevant background, improving the segmentation of complex and variable structures such as liver tubular networks.
Training protocol
Both architectures were trained using the TensorFlow and Keras libraries on a high-performance computing cluster equipped with 32 CPU cores, 128 GB RAM, and two NVIDIA A100 SXM4 40 GB GPUs. The Attention U-Net required more training time due to its architectural complexity, especially when using the augmented datasets (see Table 1).
Evaluation metrics
Model performance was quantitatively assessed on the held-out test images using standard segmentation metrics: Dice coefficient, Intersection over Union (IoU), F1 score, Volume similarity, and Sensitivity and specificity.
Results for BC, sinusoidal structures, and vessels are summarized in Figure 2, Figure 3, Figure 4, and Figure 5. Additionally, Table 2 presents a performance comparison with established classical methods for tubular segmentation, including Otsu and adaptative thresholding. Our models, particularly the Attention U-Net trained on augmented data, consistently outperformed these traditional methods across all metrics.
Statistical analysis and robustness
The analysis of whole images as well as the 64 x 64 x 64 voxel patches (Table 3) in the test set allowed us to also quantify spatial variability in model predictions across regions. All models demonstrated high accuracy, with the Attention U-Net showing consistently higher performance, particularly in F1 score and Dice coefficient. Qualitative results, shown in Figure 2A,B, Figure 3A,B, Figure 4A,B, Figure 5A,B, as well as Video 1, Video 2, Video 3, and Video 4, support these findings, illustrating precise delineation of tubular structures in most regions of the test data.
Explanation of anomalies in performance metrics
The lower values of the box plots for the patches analysis (Supplemental Figure S1, Supplemental Figure S2, Supplemental Figure S3, Supplemental Figure S4, and Supplemental Figure S5), indicate the presence of performance outliers in a subset of test patches. Likewise, the suboptimal segmentation in the final frames of videos can be attributed to two key factors:
Boundary effects: Segmentation performance often degrades at the image borders where partial structures are underrepresented or incompletely captured, leading to greater uncertainty and potential misclassification.
Image quality degradation in deeper z-planes: Despite the isotropic voxel size, biological and technical factors such as signal attenuation, light scattering, and reduced contrast in the z-direction lead to reduced image quality toward the bottom of the volume. This degradation complicates accurate boundary delineation and contributes to segmentation inconsistencies.
These factors are inherent challenges in 3D biological imaging and are particularly impactful in regions distant from the imaging plane or containing ambiguous structure boundaries.
In summary, our results demonstrate that deep learning-based segmentation models, particularly the Attention U-Net trained with augmented data, offer robust and accurate delineation of complex tubular structures in 3D liver microscopy images. By leveraging curated datasets, realistic augmentation strategies, and attention mechanisms, the models achieved superior performance compared to classical methods such as thresholding. The regional evaluation using 64³ voxel patches confirmed the consistency and generalizability of the approach across different image regions and structural complexities. While some limitations persist-mainly due to boundary effects and z-plane image degradation-our study highlights the effectiveness of attention-based architectures and provides a validated, open-source solution for high-precision 3D tubular segmentation in biomedical imaging.

Figure 1: Workflow for the 3D segmentation of tubular structures in fluorescence microscopy images using U-Net and Attention U-Net models. (A) Data preparation: Schematic 2D sections of 3D fluorescence microscopy images of mouse liver tissue, showing the original images and corresponding binary masks. (B) Data augmentation: Simulation-based augmentation of the prepared data, generating images with varying signal-to-noise ratios (e.g., SNR = 15 and SNR = 1). (C) Model training: Patch-based training of U-Net and Attention U-Net models using both original and augmented data. Image and mask patches of size 64 x 64 x 64 are generated for training. (D) Model evaluation: Quantitative performance metrics, including Recall and F1 Score, are calculated for each model to assess segmentation accuracy on test datasets. (E) Model Inference: Application of the trained model on unseen images to generate predicted segmentation masks. Abbreviation: SNR = signal-to-noise ratio. Please click here to view a larger version of this figure.

Figure 2: Evaluation of U-Net and Attention U-Net models for segmentation of Bile Canaliculi network from 3D fluorescence microscopy images of mouse liver tissue. (A) Representative 2D sections (middle section) of 3D fluorescence microscopy images, displaying the original image and the corresponding ground truth mask for BC in mouse liver tissue. The top-right images provide a zoomed-in view of the insets highlighted in each section. (B) Predicted segmentation masks generated by the U-Net, Attention U-Net, and their augmented versions. The upper row highlights True Positives (correctly segmented structures), the lower one shows False Positives (incorrectly identified structures), and False Negatives (missed structures) for each model. (C) Quantitative evaluation metrics for each model, including Accuracy, F1 Score, Precision, Recall, Volume Similarity, and Dice Coefficient. The evaluation was performed in the patches extruded from the 3D image. Error bars denote standard deviations across test images. Scale bar: 60 µm; inset scale bar: 30 µm. Abbreviation: BC = bile canaliculi. Please click here to view a larger version of this figure.

Figure 3: Evaluation of U-Net and Attention U-Net models for segmentation of the sinusoidal network from 3D fluorescence microscopy images of mouse liver tissue. (A) Representative 2D sections (middle section) of 3D fluorescence microscopy images, displaying the original image and the corresponding ground truth mask for Sinusoids in mouse liver tissue. The top-right images provide a zoomed-in view of the insets highlighted in each section. (B) Predicted segmentation masks generated by the U-Net, Attention U-Net, and their augmented versions. The upper row highlights True Positives (correctly segmented structures), the lower one shows False Positives (incorrectly identified structures), and False Negatives (missed structures) for each model. (C) Quantitative evaluation metrics for each model, including Accuracy, F1 Score, Precision, Recall, Volume Similarity, and Dice Coefficient. The evaluation was performed in the patches extruded from the 3D image. Error bars denote standard deviations across test images. Scale bar: 60 µm; inset scale bar: 30 µm. Please click here to view a larger version of this figure.

Figure 4: Evaluation of U-Net and Attention U-Net models for segmentation of the sinusoidal network from 3D fluorescence microscopy images of mouse liver tissue, considering the mask as filled tubes. (A) Representative 2D middle sections of 3D fluorescence microscopy images, displaying the original image and the corresponding ground truth mask for Sinusoids in mouse liver tissue. The top-right images provide a zoomed-in view of the insets highlighted in each section. (B) Predicted segmentation masks generated by the U-Net, Attention U-Net, and their augmented versions. Whereas the upper row highlights True Positives (correctly segmented structures), the lower one shows False Positives (incorrectly identified structures), and False Negatives (missed structures) for each model. (C) Quantitative evaluation metrics for each model, including Accuracy, F1 Score, Precision, Recall, Volume Similarity, and Dice Coefficient. The evaluation was performed in the patches extruded from the 3D image. Error bars denote standard deviations across test images. Scale bar: 60 µm; inset scale bar: 30 µm. Please click here to view a larger version of this figure.

Figure 5: Evaluation of U-Net and Attention U-Net models for segmentation of the vascular network in mouse brain from 3D light-sheet microscopy images using filled-tube masks. (A) Representative 2D middle sections extracted from 3D light-sheet microscopy images of mouse brain, showing the original image and the corresponding ground truth mask for blood vessels. Zoomed-in views of selected insets are shown in the top-right corner of each panel. Predicted segmentation masks generated by U-Net, Attention U-Net, and their augmented versions. The top row highlights True Positives (correctly segmented vessel structures), while the bottom row illustrates False Positives (incorrectly segmented regions) and False Negatives (missed vessel structures) for each model. (C) Quantitative evaluation of model performance using metrics including Accuracy, F1 Score, Precision, Recall, Volume Similarity, and Dice Coefficient. Evaluations were performed on 3D patches extracted from the test volumes. Error bars represent standard deviations across the 19 test images. Please click here to view a larger version of this figure.
Video 1: Z-Stack animation of predicted masks for the BC network. The video shows an animated sequence through the z-stack of predicted segmentation masks for bile canaliculi in mouse liver tissue, generated by U-Net, Attention U-Net, and their augmented versions. Each 2D section highlights True Positives (white), False Positives (green), and False Negatives (magenta) for each model, moving through the entire stack. Abbreviation: BC = bile canaliculi. Please click here to download this Video.
Video 2: Z-Stack animation of predicted masks for the Sinusoidal network. The video shows an animated sequence through the z-stack of predicted segmentation masks for Sinusoids in mouse liver tissue, generated by U-Net, Attention U-Net, and their augmented versions. Each 2D section highlights True Positives (white), False Positives (green), and False Negatives (magenta) for each model, moving through the entire stack. Please click here to download this Video.
Video 3: Z-Stack animation of predicted masks for the Sinusoidal network as filled tubes. The video shows an animated sequence through the z-stack of predicted segmentation masks for the Sinusoidal network as filled tubes in mouse liver tissue, generated by U-Net, Attention U-Net, and their augmented versions. Each 2D section highlights True Positives (white), False Positives (green), and False Negatives (magenta) for each model, moving through the entire stack. Please click here to download this Video.
Video 4: Z-Stack animation of predicted masks for the brain vessels. The video shows an animated sequence through the z-stack of predicted segmentation masks for vessels, generated by U-Net, Attention U-Net, and their augmented versions. Each 2D section highlights True Positives (white), False Positives (green), and False Negatives (magenta) for each model, moving through the entire stack. Please click here to download this Video.
Table 1: Training time for U-Net 3D and Attention U-Net 3D Models on Bile Canaliculi and Sinusoid datasets with and without data augmentation. Training time for U-Net 3D and Attention U-Net 3D models on bile canaliculi and sinusoid datasets with and without data augmentation. The table lists the number of patches for each dataset and the corresponding training time in minutes. Data augmentation increases the number of patches from 1353 to 10824, leading to a significant increase in training time. The Attention U-Net model consistently requires more training time than the U-Net model, especially with augmented datasets, due to its additional complexity in focusing on relevant features within the data. Abbreviation: BC = bile canaliculi. Please click here to download this Table.
Table 2: Quantitative evaluation of U-Net 3D and Attention U-Net 3D models across four datasets using whole-image segmentation. This table reports the performance of each model as well as classical methods such as Otsu and adaptive thresholding, on four different datasets: bile canaliculi, sinusoidal networks (hollow and filled representations), and whole-brain vasculature, using whole 3D images for evaluation. For each combination of model and dataset, the number of test images is listed, along with performance metrics: Accuracy, Precision, Recall (Sensitivity), Specificity, F1 Score, Dice Coefficient, IoU, and Volume Similarity. These metrics provide a comprehensive assessment of segmentation quality in terms of both voxel-wise correctness and volumetric agreement between predictions and ground truth. Abbreviations: BC = bile canaliculi; IoU = Intersection over Union. Please click here to download this Table.
Table 3: Quantitative evaluation of U-Net 3D and Attention U-Net 3D models across four datasets using 64 x 64 x 64 patches. This table summarizes the performance of U-Net 3D and Attention U-Net 3D models on four datasets-bile canaliculi, sinusoidal networks (hollow and filled masks), and whole-brain vasculature-based on evaluation in 3D image patches of size 64×64×64 voxels. For each model-dataset combination, the number of test patches is listed alongside key performance metrics: Accuracy, Precision, Recall (Sensitivity), Specificity, F1 Score, Dice Coefficient, Intersection over Union, and Volume Similarity. These patch-level metrics offer localized insight into model performance and are especially useful for identifying spatially heterogeneous segmentation accuracy across volumes. Abbreviations: BC = bile canaliculi; IoU = Intersection over Union. Please click here to download this Table.
Supplemental Figure S1: Patch-level segmentation performance of 3D U-Net and Attention U-Net models for bile canaliculi segmentation. Graphs illustrate the quantitative performance of the 3D U-Net and Attention U-Net models on bile canaliculi datasets, evaluated using 3D image patches of size 64 x 64 x 64 voxels. Metrics shown include Accuracy, Precision, Recall (Sensitivity), Specificity, F1 Score, Dice Coefficient, Intersection over Union, and Volume Similarity. The results reflect variability across patches, offering localized insight into model performance and highlighting spatial heterogeneity within 3D liver tissue volumes. Abbreviations: BC = bile canaliculi; IoU = Intersection over Union. Please click here to download this File.
Supplemental Figure S2: Patch-level segmentation performance of 3D U-Net and Attention U-Net models for sinusoid segmentation. Graphs illustrate the quantitative performance of the 3D U-Net and Attention U-Net models on sinusoid datasets, evaluated using 3D image patches of size 64 x 64 x 64 voxels. Metrics shown include Accuracy, Precision, Recall (Sensitivity), Specificity, F1 Score, Dice Coefficient, Intersection over Union, and Volume Similarity. The results reflect variability across patches, offering localized insight into model performance and highlighting spatial heterogeneity within 3D liver tissue volumes. Abbreviation: IoU = Intersection over Union. Please click here to download this File.
Supplemental Figure S3: Patch-level segmentation performance of 3D U-Net and Attention U-Net models for sinusoids as filled tubes segmentation. Graphs illustrate the quantitative performance of the 3D U-Net and Attention U-Net models on sinusoids as filled tubes datasets, evaluated using 3D image patches of size 64 x 64 x 64 voxels. Metrics shown include Accuracy, Precision, Recall (Sensitivity), Specificity, F1 Score, Dice Coefficient, Intersection over Union, and Volume Similarity. The results reflect variability across patches, offering localized insight into model performance and highlighting spatial heterogeneity within 3D liver tissue volumes. Abbreviation: IoU = Intersection over Union. Please click here to download this File.
Supplemental Figure S4: Patch-level segmentation performance of 3D U-Net and Attention U-Net models for brain vasculature from light-sheet microscopy images. Graphs illustrate the quantitative performance of the 3D U-Net and Attention U-Net models on whole-brain vasculature datasets, evaluated using 3D image patches of size 64 x 64 x 64 voxels. Metrics shown include Accuracy, Precision, Recall (Sensitivity), Specificity, F1 Score, Dice Coefficient, Intersection over Union, and Volume Similarity. The results reflect variability across patches, offering localized insight into model performance and highlighting spatial heterogeneity within 3D liver tissue volumes. Abbreviation: IoU = Intersection over Union. Please click here to download this File.
Supplemental Figure S5: Overlay of segmentation results on original 3D fluorescence microscopy images of bile canaliculi. Representative image slices from 3D fluorescence microscopy datasets of bile canaliculi in mouse liver are shown with segmentation masks overlaid in red. Predicted masks from the 3D U-Net and Attention U-Net models are superimposed on the original grayscale microscopy images to visually assess segmentation accuracy. Ten example images are presented to illustrate the models' ability to capture diverse morphological features and handle signal variability across different tissue regions. Please click here to download this File.