A
AdhamElwakil1,2
ThibaudMartin1,2
JoséVargasQuiros3,4
BartLiefers3,4
MartinaKropp5
AlexiaDuriez5
CarolineKlaver3,4,7
CiaraBergin2
IleniaMeloni1,2
MattiaTomasoni1,2,8✉Emailmattia.tomasoni@fa2.ch
1Platform for Research in Ocular ImagingFondation Asile des Aveugles, Jules Gonin Eye HospitalLausanneSwitzerland
2Department of Ophthalmology, Fondation Asile des AveuglesUniversity of Lausanne, Jules Gonin Eye HospitalLausanneSwitzerland
3Department of OphthalmologyErasmus University Medical CenterRotterdamThe Netherlands
4Department of EpidemiologyErasmus University Medical CenterRotterdamThe Netherlands
5Division of Ophthalmology, Department of Clinical NeurosciencesUniversity Hospitals of Geneva1205GenevaSwitzerland
6HUG2 Experimental OphthalmologyUniversity of Geneva1205GenevaSwitzerland
7Department of OphthalmologyRadboud University Medical CenterNijmegenthe Netherlands
8EMC4 Institute of Molecular and Clinical OphthalmologyUniversity of Basel, AMC University Medical CentresAmsterdamSwitzerland, The Netherlands
Adham Elwakil 1,2; Thibaud Martin 1,2; José Vargas Quiros EMC1,EMC2; Bart Liefers EMC1,EMC2; Martina Kropp HUG1,HUG2; Alexia Duriez HUG1,HUG2; Eline De Clerck HUG1,HUG2; Caroline Klaver EMC1,EMC2,EMC3,EMC4; Reinier Schlingemann 2,AMC; Ciara Bergin 2; Ilenia Meloni 1,2,†; Mattia Tomasoni 1,2,†,✉
1 Platform for Research in Ocular Imaging, Fondation Asile des Aveugles, Jules Gonin Eye Hospital, Lausanne, Switzerland. 2 Department of Ophthalmology, University of Lausanne, Fondation Asile des Aveugles, Jules Gonin Eye Hospital, Lausanne, Switzerland. EMC1 Department of Ophthalmology, Erasmus University Medical Center, Rotterdam, The Netherlands. EMC2 Department of Epidemiology, Erasmus University Medical Center, Rotterdam, The Netherlands. HUG1 Division of Ophthalmology, Department of Clinical Neurosciences, University Hospitals of Geneva, 1205 Geneva, Switzerland. HUG2 Experimental Ophthalmology, University of Geneva, 1205 Geneva, Switzerland. EMC3 Department of Ophthalmology, Radboud University Medical Center, Nijmegen, the Netherlands. EMC4 Institute of Molecular and Clinical Ophthalmology, University of Basel, Switzerland. AMC University Medical Centres, Amsterdam, The Netherlands.
† Co-last authors; ✉ Corresponding author: mattia.tomasoni@fa2.ch
Abstract
Optical coherence tomography angiography (OCTA) enables non-invasive visualization of the retinal microvasculature, but widely used OCTA tools provide only global metrics such as vessel density or FAZ area, limiting their use for anatomically resolved phenotyping. We present CapillaryX, an open-source, end-to-end pipeline for anatomical segmentation and quantitative vascular feature extraction from superficial plexus OCTA projections. CapillaryX incorporates deep-learning models trained on the publicly annotated OCTA-500 dataset and fine-tuned using small annotated subsets to adapt across devices, fields of view, and slab definitions. The system segments arteries, veins, capillaries, and the foveal avascular zone (FAZ), and computes 34 vascular biomarkers, including bifurcation counts, vessel density, diameter and tortuosity distributions, small-vessel–specific metrics, and an extended set of FAZ morphometrics derived from contour, ellipse, convexity, and distance-based representations.
Across OCTA-500, OphtalmoLaus, and Rotterdam Study datasets, CapillaryX achieved high agreement with expert annotations (artery–vein Dice > 85%, FAZ Dice > 92%) and maintained stable performance across heterogeneous acquisition settings. Extracted features showed consistent distributions across vendors and scan sizes, supporting their robustness for large-scale analyses. To our knowledge, CapillaryX is the first open-source tool to provide artery–vein–resolved and capillary-level OCTA biomarkers together with extended FAZ shape descriptors. By enabling anatomy-aware, standardized, and device-agnostic OCTA phenotyping, CapillaryX provides a foundation for reproducible imaging research in ophthalmology, neurology, and systemic vascular disease.
Keywords:
OCTA
artery–vein segmentation
vascular biomarkers
FAZ morphology
retinal imaging
feature extraction
medical image analysis
A
A
1. Introduction
The retinal microvasculature offers a noninvasive window into systemic and neurovascular health. Abnormal vascular phenotypes have been linked to diabetic retinopathy, hypertension, stroke, and neurodegenerative disease, including Alzheimer’s 1–4. Quantitative assessment of features such as vessel caliber, tortuosity, bifurcation patterns, and non‑perfusion regions has therefore become increasingly valuable for early diagnosis and for probing systemic pathophysiology5,6.
Historically, most vascular phenotyping has relied on color fundus images (CFIs), analyzed using tools such as SIVA (Singapore I Vessel Assessment)7, IVAN8, and VAMPIRE (Vascular Assessment and Measurement Platform for Images of the Retina)9,10. These platforms enabled measurement of large vessel geometry but were fundamentally limited by their inability to resolve the multilayered, depth-dependent structure of the retinal vasculature. More recent pipelines such as AutoMorph11 and VascX12 have leveraged deep learning to improve vessel and artery-vein segmentation from CFIs. However, these tools remain constrained to 2D fundus images and do not fully capture the capillary-level or plexus-specific information available in Optical Coherence Tomography Angiography (OCTA).
Optical coherence tomography angiography (OCTA) has transformed retinal imaging by enabling depth‑resolved visualization of perfusion signal (motion contrast). It supports separate analysis of the superficial capillary plexus (SCP), intermediate capillary plexus (ICP), and deep capillary plexus (DCP), allowing delineation of the foveal avascular zone (FAZ) and characterization of fine capillary networks13–16. Despite this promise, the field lacks robust, standardized tools for extracting rich, interpretable biomarkers from OCTA. Existing pipelines are often tailored to fundus-based analysis, and most OCTA tools are either proprietary or limited in scope, focusing solely on vessel density or FAZ area without anatomical segmentation or structural/topological descriptors17,18. A major barrier to general-purpose OCTA analysis is the variability across acquisition protocols: different devices yield differing resolutions, fields of view, and en face slab definitions, making it difficult to deploy a single, consistent, and reproducible pipeline across datasets 17,18.
Commercial OCTA software provided by device manufacturers (Optovue AngioVue, Heidelberg Spectralis, Topcon Triton, Zeiss AngioPlex) offers vessel density and FAZ area but does not provide artery–vein labeling, extended FAZ morphology, or cross-device harmonization. As these tools are proprietary and not open for algorithmic inspection or reproducible analysis, they cannot support reproducible phenotyping across cohorts. These limitations also extend to currently available open-source utilities.
Despite the availability of several OCTA tools such as AngioTool19, OCTAVA20, and ReVA21, these tools provide only limited 2D vascular summaries and lack the anatomical segmentation needed for comprehensive phenotyping. AngioTool focuses on generic angiogenesis metrics, OCTAVA computes vessel density and basic FAZ geometry from vendor-provided images, and ReVA provides visualization with limited quantitative outputs. However, none supports artery–vein labeling, extended FAZ morphometrics, small-vessel geometric descriptors, or adaptation across devices. As a result, no existing software enables the anatomically resolved, device-agnostic OCTA biomarker extraction needed for large-cohort or multi-center studies.To address these challenges, we introduce CapillaryX, an end‑to‑end pipeline for vascular analysis from OCTA en face projections. CapillaryX is pretrained on a large, publicly annotated dataset (OCTA-500)22 and fine‑tuned with minimal supervision to adapt across scanners and protocols differing in resolution, field of view, and slab definitions. In the SCP, it performs anatomical segmentation of arteries, veins, and the FAZ, and then derives 34 quantitative biomarkers spanning geometry, topology, perfusion, and perfusion‑related descriptors. Our contributions are the following:
1.Initial segmentation models for artery-vein classification and FAZ detection in SCP projections, trained on publicly annotated datasets.
2.Annotation and fine-tuning tools that enable rapid adaptation of these models to new datasets and devices, addressing variability in acquisition protocols.
3.Feature extraction and validation methods that quantify vascular biomarkers from the segmentation outputs and benchmark them against measurements from certified clinical devices.
4.Open-source release of preprocessing and inference code, model weights, and feature definitions to ensure reproducibility and community use.
By enabling deeper, more granular analysis of OCTA images, CapillaryX paves the way for the discovery of novel vascular phenotypes and supports the development of data-driven diagnostic tools in retinal imaging.
2. Methods
CapillaryX is an end-to-end pipeline that takes OCTA en face images as input and produces standardized vascular features as output. It includes pretrained superficial capillary plexus (SCP) models for artery–vein (AV) and FAZ segmentation, trained on the publicly annotated OCTA-50022 dataset. To account for variability in resolution, field of view (FOV), and slab definitions across scanners, CapillaryX incorporates an annotation module and a fine-tuning module. Users annotate a small subset of their dataset, fine-tune the pretrained models to that domain, and then perform inference on the full cohort (Fig. 2). The resulting AV/FAZ segmentations are subsequently used to compute a suite of SCP biomarkers (geometry and topology). This strategy enables scalable phenotyping across acquisition protocols without requiring large-scale re-annotation for each new cohort. A schematic of the CapillaryX pipeline is shown in Fig. 4, illustrating the four main modules: annotation, fine-tuning, segmentation, and feature extraction.
A
Model weights and inference code are available from authors upon reasonable request. The following sections describe the datasets, annotation protocol, model training and fine-tuning, and feature extraction.
2.1 Datasets
A
We trained and evaluated CapillaryX using a combination of publicly available and proprietary Optical Coherence Tomography Angiography (OCTA) datasets. These datasets span a wide range of demographic, anatomical, and pathological presentations, enabling a robust assessment of generalizability and feature reproducibility. The publicly annotated OCTA-500
22 dataset was used for initial supervised training, while the OphtalmoLaus (OL)
23 and Rotterdam Eye Study datasets
24 were used as real-world target datasets to fine-tune the models, perform large-scale inference, and extract standardized vascular features. Figure
1 shows some examples of OCTA images and the corresponding pixel-level ground truth.
2.1.1 Public Dataset: OCTA-500
OCTA-50022, released by the School of Computer Science and Engineering at Nanjing University of Science and Technology, contains two subsets: OCTA-6M (300 subjects; 6 × 6 mm FOV) and OCTA-3M (200 subjects; 3 × 3 mm FOV) (Table 1). The scans include both healthy and diseased retinas and were acquired on a standardized 70 kHz spectral-domain OCT system with an 840 nm center wavelength (RTVue-XR, Optovue, CA). Each volume is provided with precomputed en face maximum-intensity projections between the ILM and OPL, highlighting inner-retinal vascular morphology. The dataset also includes manual annotations, comprising delineations of large vessels (further classified into arteries and veins), the foveal avascular zone (FAZ), and other vascular structures.
Table 1
Overview of datasets used in this study, including acquisition devices, spatial resolution, and field of view (FOV). OCTA-500 includes two scan types (3M and 6M) acquired with the RTVue-XR system from Optovue, while the OphtalmoLaus dataset was acquired using the Topcon Triton platform. Differences in resolution and FOV across datasets necessitated spatial harmonization and domain adaptation in CapillaryX.
Dataset | Machine | Number of subjects | Image size | Resolution | FOV |
|---|
OCTA-500 6M | RTVue-XR, Optovue | 300 | 400 x 400 | 0.015 mm | 6mm x 6mm |
OCTA-500 3M | RTVue-XR, Optovue | 500 | 304 x 304 | 0.009 mm | 3mm x 3mm |
OphtalmoLaus | Topcon Triton | 2046 | 320 x 320 | 0.014 mm | 4.5mm x 4.5mm |
Rotterdam study | Topcon Triton | 1896 | 320 x 320 | 0.0094 mm | 3mm x 3mm |
2.1.2 OphtalmoLaus (OL)
OL23 is part of the population-based CoLaus study in Lausanne, Switzerland25. It comprises 4,195 OCTA volumes from 2,046 subjects, acquired with the high-resolution Topcon Triton swept-source OCT system (Topcon, Tokyo, Japan). Each macula-centered OCTA scan covered a 4.5 × 4.5 mm field of view (Table 1). The superficial capillary plexus (SCP) was defined from the ILM to the IPL/INL boundary, and en face projections were generated using Topcon’s IMAGEnet 6 software (v1.31.17967).
Unlike OCTA-50022, OL is only partially annotated: a subset of scans includes manual delineations of artery-vein (AV) trees and FAZ boundaries, while the majority remain unlabelled. This makes OL a suitable dataset for evaluating the domain adaptation and scalability of CapillaryX under realistic variability in acquisition protocols. Expert annotations were created using the CapillaryX-integrated annotation tool (Fig. 3 and Fig. 4; see Section 2.3 for details).
2.1.3 The Rotterdam Study
A
The Rotterdam Study (RS)
24 is a prospective population-based cohort study of people living in Ommoord, a district of the city of Rotterdam. The RS consists of four cohorts, three of which were used in this work. Collection of 3x3mm macula-centered OCT-A scans began in December, 2021 for subjects from RS cohorts II, III, and IV using a Topcon Triton swept-source OCT system (Topcon, Tokyo, Japan). OCT-A imaging from 2321 patients was included in the study. As for OL, the superficial capillary plexus (SCP) was defined from the ILM to the IPL/INL boundary, and en face projections were generated using Topcon’s IMAGEnet 6 software (v1.31.17967).
The RS dataset was used for evaluation, with only a small subset of 80 images annotated manually for artery and vein segmentations and FAZ masks. Annotations were made using custom software developed at the Dept. of Ophthalmology at Erasmus Medical Center, Rotterdam.
2.2 Preprocessing
Preprocessing steps were tailored to the format and characteristics of each dataset.
For OCTA-500, en face projections were provided. To harmonize the field of view with OL (4.5×4.5 mm), the 6×6 mm scans were centrally cropped and resized to 300×300 pixels, matching OL’s field of view (4.5×4.5 mm). All images were intensity-normalized by dividing pixel values by 255 to ensure consistency across training and inference.
For OL and EMC, en face projections for the superficial capillary plexus (SCP) were reconstructed from volumetric OCTA scans using Topcon’s IMAGEnet software. Since slab definitions were embedded in the vendor-specific pipeline, no additional reslicing or projection was applied. Preprocessing was limited to normalizing intensity values. No interpolation, denoising, or contrast adjustments were performed.
2.3 Annotations
For the OCTA-500 dataset, ground-truth annotations of the retinal en-face projections were already available and included delineations of arteries, veins, and the foveal avascular zone (FAZ). For the OL and EMC dataset, we developed an internal tool based on napari26 within CapillaryX. The SCP projection images were annotated using this tool by two professional graders. The graders worked on desktop computers with a drawing tablet for segmentation. The graders labeled artery-vein (AV) trees and FAZ regions in SCP projections. The annotation process differed by structure type:
1.Artery-vein annotation: Graders began with an initial AV map generated by OCT2Former27, which they corrected manually. Connectivity errors at crossings were resolved by annotating arteries and veins on separate layers. To distinguish arteries from veins, graders were guided by corresponding color fundus images (CFIs), labeling arteries in red and veins in blue (Fig. 3).
2.FAZ annotation: Graders manually traced the FAZ boundary and then applied a fill operation to obtain a complete mask of the avascular zone.
These annotated subsets were used for domain-specific fine-tuning. Annotation of OL required approximately 0.5 months/person for 100 AV images from 75 subjects and 2 weeks for 250 FAZ images from 150 subjects.
2.4 Segmentation Models
Anatomical segmentation of the SCP was performed using a modified version of OCT2Former27, a transformer-based architecture optimized for OCTA vessel segmentation. Model modifications were limited to the loss functions (detailed in Section 2.5). We trained three distinct OCT2Former models to independently segment (i) arteries and veins, (ii) the FAZ, and (iii) the capillary network.
For adaptation to the OL dataset, initial training was conducted on the OCTA-500 6M subset with the following split: 245 images for training (NO.10001-NO.10245), 30 for validation (NO.10246–NO.10275), and 25 for testing (NO.10276–NO.10300). All models used an input resolution of 300 × 300 pixels with standard data augmentation (horizontal and vertical flips). To adapt the models to the OL domain, we performed fine-tuning of the AV and FAZ networks using small, manually labeled subsets. Specifically, we used 100 images from 75 subjects for AV fine-tuning, and 250 images from 150 patients for FAZ refinement.
For adaptation to the EMC dataset, the initial training was conducted on the OCTA-500 3M dataset, with the split: 140 training (NO.10301–NO.10440), 30 validation (NO.10441–NO.10475), and 25 testing (NO.10476–NO.10500)”. All models were trained with an input resolution of 304×304 pixels and subjected to standard data augmentation, including horizontal and vertical flips.
The arteries / veins and FAZ were segmented in a further 80 Rotterdam Study images for further fine-tuning via a semi-automatic approach consisting in manually correcting the output of the model trained on OCTA-500.
2.5 Loss Functions and Optimization
Each segmentation model employed a tailored loss function to account for the structure-specific challenges of OCTA.
For artery-vein segmentation, we used a custom weighted cross-entropy loss, penalizing confusion between arteries and veins more heavily than misclassification with background pixels. This was combined with Dice loss and surface loss to enforce vascular continuity and boundary precision.
For FAZ segmentation, we used a spatially weighted cross-entropy loss, emphasizing pixels near the FAZ boundary to improve delineation in low-contrast regions. This was also combined with Dice loss and surface loss.
The total loss function for all models took the form
where
,
,
are empirically tuned weighting parameters. Hyperparameters were optimized using the Optuna framework
28 with Bayesian search; final configurations are listed in Table
2 and Table
3.
Table 2
Optimized hyperparameters for the two segmentation tasks in CapillaryX (artery-vein segmentation, FAZ segmentation, and capillary segmentation), as determined using Bayesian optimization with Optuna. Each column lists the selected values for a given model, including learning rate, number of epochs, batch size, composite loss weights, input image size, and weight decay. Optimization done on cropped OCTA-500 3M.
Artery-vein segmentation | | FAZ segmentation |
|---|
Parameter | Value | | Parameter | Value |
|---|
Learning rate | 2e-4 | Learning rate | 1e-3 |
# epochs | 100 | # epochs | 100 |
Batch size | 2 | Batch size | 4 |
Loss weight | 0.39, 0.08, 0.53 | Loss weight | 0.39, 0.28, 0.33 |
Image size | 304, 304 | Image size | 304, 304 |
Weight decay | 1.99e-06 | Weight decay | 1e-04 |
Table 3
Optimized hyperparameters for the two segmentation tasks in CapillaryX (artery-vein segmentation, FAZ segmentation, and capillary segmentation), as determined using Bayesian optimization with Optuna. Each column lists the selected values for a given model, including learning rate, number of epochs, batch size, composite loss weights, input image size, and weight decay. Optimization done on cropped OCTA-500 6M.
Artery-vein segmentation | | FAZ segmentation |
|---|
Parameter | Value | | Parameter | Value |
|---|
Learning rate | 5e-4 | Learning rate | 1e-5 |
# epochs | 100 | # epochs | 100 |
Batch size | 6 | Batch size | 2 |
Loss weight | 0.70, 0.05, 0.35 | Loss weight | 0.39, 0.28,0.33 |
Image size | 300 x 300 | Image size | 300 x 300 |
Weight decay | 1e-4 | Weight decay | 8.27e-06 |
2.6 Evaluation Metrics
Model performance was evaluated using a comprehensive set of segmentation and overlap metrics. For all tasks, we report Dice coefficient, Intersection-over-Union (IoU), accuracy, sensitivity, and specificity in Table 4 and Table 5.
Table 4
Segmentation performance of CapillaryX across three datasets for the artery and veins: OCTA-500 (6M and 3M scans) and OphtalmoLaus (OL). Metrics reported include Dice coefficient (DICE), Intersection over union (IOU), accuracy (ACC), sensitivity, and specificity. These results reflect both cross-validation on OCTA-500 and fine-tuned evaluation on OL, demonstrating the pipeline’s generalizability and adaptability across acquisition protocols.
| | OCTA-500 6M | OCTA-500 3M | OL | Rotterdam study |
|---|
DICE | 85.4 | 87.5 | 87.1 | 74.6 |
IOU | 74.9 | 78.0 | 77.7 | 61.2 |
ACC | 97.7 | 98.5 | 97.9 | 96.9 |
Sensitivity | 86.9 | 89.0 | 90.0 | 76.3 |
Specificity | 99.2 | 99.5 | 99.1 | 98.8 |
Table 5
Segmentation performance of CapillaryX across three datasets for the FAZ: OCTA-500 (6M and 3M scans) and OphtalmoLaus (OL). Metrics reported include Dice coefficient (DICE), Intersection over union (IOU), accuracy (ACC), sensitivity, and specificity. These results reflect both cross-validation on OCTA-500 and fine-tuned evaluation on OL, demonstrating the pipeline’s generalizability and adaptability across acquisition protocols.
| | OCTA-500 6M | OCTA-500 3M | OL | Rotterdam study |
|---|
DICE | 92.9 | 96.7 | 95.1 | 92.8 |
IOU | 87.7 | 93.8 | 90.8 | 87.7 |
ACC | 99.8 | 99.7 | 99.8 | 99.6 |
Sensitivity | 89.8 | 96.2 | 91.8 | 91.6 |
Specificity | 99.9 | 99.9 | 99.9 | 99.8 |
Evaluation was conducted using five-fold cross-validation on OCTA-500. Model transferability to OL and EMC was assessed by fine-tuning on annotated subsets and evaluating feature consistency across scans.
2.7 FAZ Mask Refinement Procedure
To ensure anatomically valid and topologically consistent FAZ masks, all FAZ predictions were refined using a dedicated post-processing procedure. The algorithm first identified all connected components in the predicted FAZ mask using 8-connectivity. To select the true FAZ, components were ranked using a center-weighted scoring function that favors regions located near the image center and penalizes small or peripheral structures. As a safeguard against selecting spurious central fragments, if the center-selected component represented less than 20% of the area of the largest component, the largest connected region was chosen instead. The selected component was then regularized by hole-filling to remove internal discontinuities and produce a smooth, contiguous FAZ region. This cleaned mask served as the final FAZ segmentation used for all downstream morphometric analyses.
2.8 Feature Extraction
Following segmentation, CapillaryX extracted a comprehensive set of quantitative vascular features from the superficial capillary plexus (SCP). All metrics were grouped into two categories: artery–vein (AV) vascular descriptors and foveal avascular zone (FAZ) morphometrics.
2.8.1 Artery–Vein Features
For each vessel type (arteries and veins), sixteen geometric and topological descriptors were computed using the VascX package12, following established definitions for retinal vessel morphology29 and tortuosity30. These features included:
Median and standard deviation of vessel diameter
Tortuosity indices (path–chord ratio–based measures)
Small-vessel metrics (< 50 µm)
To quantify capillary-level geometry, we derived an additional subset of AV descriptors restricted to vessels with diameters < 50 µm. Pixel widths were converted to micrometers using each dataset’s lateral scale (Table 1), and VascX was modified to exclude all segments ≥ 50 µm. For the remaining vessels, we recomputed:
Diameter standard deviation
These small-vessel metrics are specific to OCTA and are not available in existing OCTA software tools. All AV features are summarized in Table 6.
Table 6
Summary of vascular features extracted by CapillaryX from the superficial plexus. Features are grouped into two anatomical categories: artery and vein metrics and foveal avascular zone (FAZ) morphometrics. These features quantify geometric, topological, and perfusion-related characteristics, supporting comprehensive vascular phenotyping from OCTA projections.
| | Feature | Description | Units |
|---|
A. Artery and Vein Features |
|---|
1 | Artery bifurcations | Number of branching points in the arterial tree | N/A (unitless) |
2 | Vein bifurcations | Number of branching points in the venous tree | N/A (unitless) |
3 | Artery tortuosity | Curviness of arterial paths based on path-to-chord ratio | Ratio (unitless) |
4 | Vein tortuosity | Curviness of venous paths based on path-to-chord ratio | Ratio (unitless) |
5 | Artery median diameter | Median width of all segmented arterial segments | µm |
6 | Vein median diameter | Median width of all segmented venous segments | µm |
7 | Artery median diameter SD | Standard deviation of arterial diameters | µm |
8 | Vein median diameter SD | Standard deviation of venous diameters | µm |
9 | Artery vessel density | Ratio of arterial pixels to total area | Ratio (unitless) |
10 | Vein vessel density | Ratio of venous pixels to total area | Ratio (unitless) |
11 | Small arteries median diameter | Median width of small segmented arterial segments. | µm |
12 | Small veins median diameter | Median width of small segmented venous segments | µm |
13 | Small arteries median diameter SD | Standard deviation of small arterial diameters | µm |
14 | Small vein median diameter SD | Standard deviation of small venous diameters | µm |
15 | Small arteries tortuosity | Curviness of small arterial paths based on path-to-chord ratio | Ratio (unitless) |
16 | Small veins tortuosity | Curviness of small arterial paths based on path-to-chord ratio | Ratio (unitless) |
B. FAZ Features |
1 | FAZ Area | Area enclosed by the foveal avascular zone | µm² |
2 | FAZ Perimeter | Length of the FAZ boundary | µm |
3 | FAZ Axis ratio | Ratio of major to minor axis of the FAZ ellipse | Ratio (unitless) |
4 | FAZ Circularity | Circularity score (4π × Area / Perimeter²) | Unitless (0–1) |
5 | FAZ Roundness | Roundess score (4 × Area / ²) | Unitless (0–1) |
6 | FAZ Convex Hull Area | Area of the smallest convex polygon enclosing the FAZ | µm² |
7 | FAZ Solidity | Ratio of FAZ area to its convex hull area | Unitless (0–1) |
8 | FAZ Eccentricity | Ellipse eccentricity of the FAZ | Unitless (0–1) |
9 | FAZ Equivalent diameter | Diameter of a circle with the same area as the FAZ | µm |
10 | FAZ Extent | Ratio of FAZ area to bounding box area | Ratio (unitless) |
11 | FAZ Feret Diameter (max) | Maximum caliper distances across FAZ | µm |
12 | FAZ Feret Diameter (median) | Median caliper distances across FAZ | Pixels |
13 | FAZ Orientation (degrees) | Angle of the major axis of the FAZ ellipse | Degrees |
14 | FAZ Acircularity | Deviation from perfect circularity | Unitless (≥ 1) |
15 | FAZ Chamfer Distance to Ellipse | X,Y coordinates of the FAZ center | µm |
16 | FAZ Hausdorff Distance to Ellipse | Maximum contour-to-ellipse boundary distance | µm |
17 | FAZ Centroid (X coordinate) | X coordinates of the FAZ center | µm |
18 | FAZ Centroid (Y coordinate) | Y coordinates of the FAZ center | µm |
2.8.2 FAZ Morphometric Features
Eighteen FAZ features were computed from the outer FAZ contour using standard image-analysis operations implemented in Python (OpenCV, scikit-image, SciPy). The feature set includes both classical OCTA metrics and extended descriptors of shape regularity.
Classical FAZ shape descriptors
Area (A): number of pixels enclosed by the contour.
Perimeter (P): contour length.
Circularity, a standard shape descriptor used in FAZ analysis (Eq. 1):
Acircularity, representing deviation from an equal-area circle (Eq. 2):
FAZ Equivalent diameter, defined as the diameter of a circle with the same area as the FAZ, is calculated using equation (Eq. 3)
Ellipse-based descriptors
An ellipse was fitted to the FAZ contour using OpenCV’s least-squares method to obtain the major axis (a), minor axis (b), and orientation. From these, we computed:
Axis ratio is defined is the ratio between the major axis and minor axis (Eq. 4):
Ellipse eccentricity (Eq. 5):
Convexity- and extent-based descriptors
Convex Hull area, area of the minimum convex polygon enclosing the FAZ
Solidity, defined as the ratio of FAZ area to its convex hull area, is given by equation (Eq. 7)
Extent, defined as the ratio of FAZ area to bounding box area, given by Eq. (8)
where w and h are the width and height of the bounding box of the FAZ contour.
Feret diameters. Maximum and median caliper distances were computed over contour point pairs (max/median Feret).
Distances to best-fit ellipse
Two-sided Hausdorff distance: maximum bidirectional distance between contour and fitted ellipse.
Chamfer distance: mean distance via distance transform between the FAZ contour and the ellipse boundary.
Centroid
The FAZ centroid (x, y) was computed from image moments and provides a reference point for regional analyses (e.g., ETDRS-grid placement).
Definitions and measurement units for all FAZ and AV features are summarized in Table 6.
2.9 Implementation and Runtime
All models were implemented in Python 3.9 using PyTorch 1.12. Image processing relied on NumPy, OpenCV, PIL, and scikit-image. Hyperparameter tuning was performed using Optuna28. Training and inference were conducted on an NVIDIA RTX A6000 GPU (48 GB VRAM), with an AMD Ryzen 9 5950X CPU and 128 GB RAM. Segmentation inference and feature extraction required under 10 seconds per scan on average. All code was version-controlled using Git, with pipelines designed for reproducibility and scalability across imaging protocols.
3. Results
3.1 Segmentation Accuracy and Anatomical Fidelity
CapillaryX produced high-quality anatomical segmentations of arteries, veins, capillaries, and the FAZ across all datasets. Visual inspection showed close agreement with expert annotations (Fig. 5), with accurate tracing of first- and second-order vessels, correct artery–vein polarity at crossings, and smooth, well-defined FAZ boundaries. CapillaryX preserved tree-like topology and avoided common OCTA segmentation errors such as branch interruptions, leakage into capillary beds, and FAZ over-segmentation.
Quantitatively, Dice scores exceeded 85% for artery–vein segmentation and 92% for FAZ segmentation on OCTA-500 (Tables 4 and 5). IoU, sensitivity, and specificity metrics demonstrated similarly strong performance, confirming both boundary precision and minimal false detections.
3.2 Cross-Device and Cross-Protocol Robustness
Fine-tuning enabled CapillaryX to generalize effectively across devices, resolutions, and slab definitions. Starting from OCTA-500 pretrained models, performance decreased only modestly on clinical datasets. For artery–vein maps, Dice remained 87.1% on OL and 74.6% on Rotterdam study; for FAZ, Dice remained 95.1% on OL and 92.8% on EMC. Specificity was consistently ≥ 98.5% across datasets (Table 4).
Despite substantial differences in field of view and nominal resolution, output topologies remained visually consistent. Large vessels and branch points were preserved across domains, arterial–venous polarity remained stable, and FAZ boundaries showed comparable smoothness and centroid locations. Representative segmentations from OCTA-500, OL, and EMC illustrate consistent performance after adaptation (Fig. 5).
These findings demonstrate that CapillaryX can be reliably deployed in heterogeneous imaging environments without re-training from scratch.
3.3 Artery–Vein Biomarker Extraction and Microvascular Geometry
CapillaryX computed 16 artery–vein biomarkers per vessel class, including bifurcation counts, vessel density, diameter distributions, and tortuosity measures. Across datasets, AV features were stable and biologically plausible (Tables 7 and 8). Venous tortuosity consistently exceeded arterial tortuosity, and bifurcation counts scaled with field of view.
Table 7
Descriptive statistics of quantitative OCTA features extracted from the superficial capillary plexus. The table summarizes the central tendency and dispersion of vessel- and FAZ-related metrics obtained from the OCTA-500 3M dataset with N = 200.
| | Mean | SD | min | q25 | Median | q75 | IQR | max |
|---|
vd_arteries | 0.0380 | 0.0071 | 0.0224 | 0.0334 | 0.0371 | 0.0417 | 0.0083 | 0.0686 |
vd_veins | 0.0301 | 0.0045 | 0.0191 | 0.0269 | 0.0302 | 0.0333 | 0.0065 | 0.0428 |
bif_arteries | 10.1000 | 3.2931 | 3.0000 | 7.7500 | 10.0000 | 13.0000 | 5.2500 | 21.0000 |
bif_veins | 6.3650 | 2.7767 | 0.0000 | 4.0000 | 6.0000 | 8.0000 | 4.0000 | 15.0000 |
diam_arteries_median | 21.0630 | 1.6624 | 16.7863 | 20.0485 | 20.5098 | 21.5885 | 1.5400 | 31.8962 |
diam_arteries_std | 11.5124 | 3.6990 | 5.3057 | 8.8222 | 10.4845 | 13.6916 | 4.8695 | 24.8892 |
diam_veins_median | 21.3021 | 1.5042 | 16.7583 | 20.2065 | 20.9519 | 22.1052 | 1.8987 | 27.8182 |
diam_veins_std | 8.9658 | 1.6026 | 5.3479 | 8.0488 | 8.9656 | 9.6423 | 1.5935 | 22.5778 |
small_vessels_diam_arteries_median | 20.6056 | 1.0484 | 16.7863 | 19.9587 | 20.3106 | 21.0846 | 1.1259 | 24.5390 |
small_vessels_diam_arteries_std | 8.7674 | 1.3082 | 5.1963 | 7.9882 | 8.7227 | 9.6046 | 1.6164 | 12.4801 |
small_vessels_diam_veins_median | 21.2605 | 1.4422 | 16.7583 | 20.1966 | 20.9339 | 22.0441 | 1.8476 | 26.4648 |
small_vessels_diam_veins_std | 8.7118 | 1.1169 | 5.3479 | 7.9312 | 8.7543 | 9.4247 | 1.4935 | 11.2990 |
tort_arteries | 1.0189 | 0.0066 | 1.0085 | 1.0150 | 1.0178 | 1.0212 | 0.0062 | 1.0615 |
tort_veins | 1.0244 | 0.0073 | 1.0130 | 1.0191 | 1.0235 | 1.0279 | 0.0088 | 1.0479 |
small_vessels_tort_arteries | 1.0187 | 0.0070 | 1.0067 | 1.0143 | 1.0175 | 1.0215 | 0.0072 | 1.0644 |
small_vessels_tort_veins | 1.0244 | 0.0074 | 1.0124 | 1.0191 | 1.0236 | 1.0279 | 0.0088 | 1.0479 |
FAZ_area | 339163.1150 | 137812.2763 | 46995.7950 | 245355.7838 | 317870.9325 | 416003.4450 | 170647.6612 | 1151225.4600 |
FAZ_Perimeter | 2552.8538 | 572.4484 | 1314.8307 | 2208.8510 | 2471.2614 | 2911.6657 | 702.8146 | 5441.7442 |
FAZ_Axis_Ratio | 0.8670 | 0.0705 | 0.6342 | 0.8349 | 0.8754 | 0.9175 | 0.0826 | 0.9815 |
FAZ_Circularity | 0.6428 | 0.1064 | 0.2033 | 0.5949 | 0.6597 | 0.7203 | 0.1254 | 0.8311 |
FAZ_Roundness | 1.0968 | 0.0932 | 0.9488 | 1.0341 | 1.0790 | 1.1387 | 0.1046 | 1.4430 |
FAZ_Solidity | 0.9080 | 0.0387 | 0.6970 | 0.8877 | 0.9166 | 0.9332 | 0.0455 | 0.9730 |
FAZ_Eccentricity | 0.4784 | 0.1205 | 0.1916 | 0.3976 | 0.4835 | 0.5504 | 0.1527 | 0.7731 |
FAZ_Equivalent_Diameter | 644.0953 | 130.6231 | 244.6158 | 558.9246 | 636.1805 | 727.7857 | 168.8611 | 1210.6964 |
FAZ_Convex_Hull_Area | 372888.8460 | 151577.6743 | 66842.8200 | 278801.6962 | 345779.2800 | 457743.4538 | 178941.7575 | 1339355.6550 |
FAZ_Extent | 0.6534 | 0.0546 | 0.4628 | 0.6229 | 0.6555 | 0.6895 | 0.0666 | 0.7738 |
FAZ_Feret_Diameter_Max | 765.0502 | 150.0940 | 363.0750 | 667.9002 | 746.3508 | 855.7191 | 187.8189 | 1544.5586 |
FAZ_Feret_Diameter_Median | 456.7108 | 91.8994 | 178.2000 | 400.7971 | 448.7330 | 521.2093 | 120.4122 | 851.6302 |
FAZ_Orientation | 81.6955 | 59.1361 | 0.4032 | 30.1372 | 69.8937 | 137.0561 | 106.9188 | 178.6411 |
FAZ Acircularity | 1.2643 | 0.1394 | 1.0969 | 1.1783 | 1.2312 | 1.2965 | 0.1182 | 2.2179 |
FAZ Hausdorff Distance to Ellipse | 76.4712 | 23.4742 | 40.8187 | 60.2193 | 71.3899 | 89.2371 | 29.0177 | 197.2561 |
FAZ Chamfer Distance to Ellipse | 20.4903 | 6.4216 | 8.4546 | 15.9713 | 19.2888 | 24.0408 | 8.0696 | 58.6762 |
FAZ_Centroid_X | 1491.8570 | 78.9421 | 1117.6733 | 1460.7102 | 1501.8699 | 1538.2207 | 77.5106 | 1705.7335 |
FAZ_Centroid_Y | 1495.0391 | 78.2891 | 1228.2478 | 1449.7830 | 1493.9266 | 1533.7555 | 83.9725 | 1883.7898 |
Table 8
Descriptive statistics of quantitative OCTA features extracted from the superficial capillary plexus. The table summarizes the central tendency and dispersion of vessel- and FAZ-related metrics obtained from the OCTA-500 6M dataset with N = 300.
| | Mean | SD | min | q25 | Median | q75 | IQR | max |
|---|
vd_arteries | 0.0429 | 0.0063 | 0.0257 | 0.0389 | 0.0427 | 0.0474 | 0.0085 | 0.0594 |
vd_veins | 0.0487 | 0.0082 | 0.0233 | 0.0439 | 0.0490 | 0.0536 | 0.0097 | 0.0788 |
bif_arteries | 24.2167 | 6.5354 | 5.0000 | 20.0000 | 24.0000 | 28.0000 | 8.0000 | 44.0000 |
bif_veins | 26.9200 | 7.8999 | 4.0000 | 22.0000 | 27.0000 | 32.0000 | 10.0000 | 52.0000 |
diam_arteries_median | 31.7886 | 1.5359 | 26.3879 | 30.8240 | 31.4542 | 32.3822 | 1.5583 | 40.1052 |
diam_arteries_std | 17.3226 | 3.9269 | 8.6936 | 14.4047 | 16.8543 | 19.2739 | 4.8692 | 34.2437 |
diam_veins_median | 33.1374 | 2.2188 | 30.0591 | 31.6265 | 32.7175 | 34.0433 | 2.4168 | 45.2114 |
diam_veins_std | 18.9897 | 5.8885 | 10.3631 | 14.4663 | 17.8547 | 22.3518 | 7.8855 | 42.9902 |
small_vessels_diam_arteries_median | 30.2784 | 0.7968 | 24.6941 | 30.0433 | 30.2584 | 30.5970 | 0.5537 | 32.5592 |
small_vessels_diam_arteries_std | 9.8774 | 0.8055 | 7.0033 | 9.3968 | 9.9597 | 10.4758 | 1.0790 | 11.5578 |
small_vessels_diam_veins_median | 31.0531 | 0.7003 | 30.0000 | 30.5577 | 30.9459 | 31.4279 | 0.8702 | 33.5039 |
small_vessels_diam_veins_std | 9.9155 | 0.5924 | 7.8917 | 9.5101 | 9.9796 | 10.3183 | 0.8081 | 11.3349 |
tort_arteries | 1.0173 | 0.0059 | 1.0073 | 1.0134 | 1.0161 | 1.0196 | 0.0062 | 1.0515 |
tort_veins | 1.0243 | 0.0070 | 1.0115 | 1.0196 | 1.0234 | 1.0274 | 0.0078 | 1.0599 |
small_vessels_tort_arteries | 1.0182 | 0.0067 | 1.0081 | 1.0137 | 1.0169 | 1.0211 | 0.0074 | 1.0507 |
small_vessels_tort_veins | 1.0258 | 0.0078 | 1.0115 | 1.0204 | 1.0246 | 1.0285 | 0.0081 | 1.0680 |
FAZ_area | 360430.5000 | 162220.6622 | 22500.0000 | 264318.7500 | 333506.2500 | 423421.8750 | 159103.1250 | 1169550.0000 |
FAZ_Perimeter | 2791.8667 | 769.5183 | 644.5584 | 2368.7021 | 2683.5460 | 3057.7275 | 689.0254 | 7193.1937 |
FAZ_Axis_Ratio | 0.8310 | 0.0966 | 0.4223 | 0.7778 | 0.8427 | 0.9022 | 0.1243 | 0.9861 |
FAZ_Circularity | 0.5758 | 0.1008 | 0.2618 | 0.5221 | 0.5839 | 0.6464 | 0.1243 | 0.7991 |
FAZ_Roundness | 1.1171 | 0.1533 | 0.8618 | 1.0196 | 1.0929 | 1.1872 | 0.1676 | 1.9115 |
FAZ_Solidity | 0.8732 | 0.0468 | 0.6580 | 0.8453 | 0.8804 | 0.9073 | 0.0620 | 0.9543 |
FAZ_Eccentricity | 0.5291 | 0.1422 | 0.1661 | 0.4314 | 0.5384 | 0.6285 | 0.1971 | 0.9064 |
FAZ_Equivalent_Diameter | 662.1596 | 143.2739 | 169.2569 | 580.1215 | 651.6390 | 734.2450 | 154.1235 | 1220.2939 |
FAZ_Convex_Hull_Area | 414374.6250 | 195286.1163 | 23850.0000 | 299868.7500 | 387281.2500 | 483243.7500 | 183375.0000 | 1512337.5000 |
FAZ_Extent | 0.6126 | 0.0581 | 0.4206 | 0.5710 | 0.6146 | 0.6555 | 0.0844 | 0.7593 |
FAZ_Feret_Diameter_Max | 829.4196 | 197.7968 | 256.7586 | 714.0373 | 812.8420 | 895.0489 | 181.0115 | 2259.2311 |
FAZ_Feret_Diameter_Median | 471.6587 | 99.7692 | 127.7196 | 420.2008 | 467.0519 | 519.9399 | 99.7391 | 860.7700 |
FAZ_Orientation | 98.1833 | 56.3524 | 0.2933 | 48.6262 | 100.0366 | 149.5581 | 100.9318 | 179.9937 |
FAZ Acircularity | 1.3360 | 0.1396 | 1.1187 | 1.2438 | 1.3087 | 1.3839 | 0.1402 | 1.9542 |
FAZ Hausdorff Distance to Ellipse | 96.2583 | 42.7602 | 45.0000 | 75.0000 | 86.1585 | 106.0660 | 31.0660 | 360.0000 |
FAZ Chamfer Distance to Ellipse | 26.4841 | 12.0691 | 5.1316 | 19.6440 | 24.6658 | 29.9849 | 10.3410 | 106.3278 |
FAZ_Centroid_X | 3037.0307 | 174.0122 | 2004.4709 | 2972.4574 | 3024.0598 | 3081.2959 | 108.8386 | 4464.4853 |
FAZ_Centroid_Y | 3011.7693 | 205.4189 | 1962.7739 | 2941.6223 | 3008.3362 | 3074.0245 | 132.4022 | 4008.7307 |
A novel contribution of CapillaryX is the extraction of small-vessel–specific metrics (< 50 µm), enabling capillary-level phenotyping not possible with existing OCTA analysis tools. These metrics revealed expected microvascular patterns, including narrower diameters and reduced diameter variability in capillaries compared with global vessels.
No systematic failures were observed in AV feature computation across datasets, confirming the reliability of the pipeline on large cohorts.
3.4 FAZ Morphometrics and Shape Descriptors
CapillaryX produced an extended set of 18 FAZ morphometric features, including classical metrics (area, perimeter, circularity), ellipse-based descriptors (axis ratio, eccentricity, orientation), convexity-based features (solidity, hull area), and distance-based irregularity measures (Hausdorff and Chamfer distances). To our knowledge, this is the first open-source pipeline to provide this breadth of FAZ descriptors for OCTA.
FAZ metrics showed tight, unimodal distributions across datasets, indicating segmentation stability and consistent morphological estimation. As expected, circularity and acircularity varied inversely, and solidity remained high, reflecting well-delineated FAZ boundaries in healthy eyes.
These extended FAZ descriptors capture shape characteristics not quantified in current OCTA software and support advanced analyses of foveal structure in health and disease.
4. Discussion
In this study, we presented CapillaryX, an end-to-end pipeline for anatomical segmentation and quantitative vascular phenotyping from OCTA images. CapillaryX moves beyond vessel density and FAZ area toward granular, interpretable, and reproducible microvascular biomarkers, including artery–vein (AV) metrics and extended FAZ descriptors. Importantly, CapillaryX does not rely on threshold-based binarization or skeletonization, which are common in existing OCTA utilities and limit robustness across image quality levels and acquisition protocols.
Using models trained on OCTA-500 and fine-tuned on clinical cohorts, CapillaryX maintained high agreement with expert annotations in the superficial plexus (Table 4 and Table 5, Fig. 5). Performance was stable across vendors, scan sizes, and slab definitions, and features were extracted reliably on both public and clinical datasets. To our knowledge, this is the first open-source tool to provide AV-resolved OCTA measurements—including small-vessel geometry—together with an extended FAZ morphometric set.
Compared with commercial OCTA software and existing open-source tools such as AngioTool, OCTAVA, and ReVA, CapillaryX provides a fundamentally richer and anatomically informed phenotyping approach. Current tools typically output global, threshold-derived metrics such as vessel density or FAZ area and do not perform artery–vein labeling, capillary-level segmentation, or region-standardized analysis. In contrast, CapillaryX produces 34 quantitative biomarkers, including small-artery and small-vein diameters, tortuosity indices, Feret diameters, acircularity, and distances between the FAZ boundary and its best-fit ellipse. Although ETDRS-grid extraction is not yet implemented, CapillaryX provides precise FAZ centroid coordinates, allowing seamless incorporation of ETDRS-aligned regional analysis and capillary-level feature extraction in future releases—capabilities that remain absent from current threshold-based OCTA tools.
Despite these advances, several limitations remain. First, the current implementation operates on en face SCP projections and does not exploit volumetric OCTA context; incorporating 3D information may further improve plexus differentiation and boundary definition. Second, small-vessel features depend on the empirically chosen 50 µm cutoff and on accurate pixel-to-micrometer calibration; additional cross-device calibration datasets would help standardize these measurements. Third, while features were designed to be interpretable, their clinical predictive value and longitudinal stability were not assessed here.
Future work will focus on (1) extending segmentation and feature extraction to the intermediate and deep plexuses, (2) building normative databases to quantify deviations from healthy vascular phenotypes, (3) evaluating longitudinal associations between OCTA biomarkers and disease onset or treatment response, and (4) broadening multi-site validation across vendors and acquisition protocols.
In summary, CapillaryX provides an anatomy-aware, threshold-free, and device-agnostic solution for OCTA vascular phenotyping. By enabling AV-resolved and FAZ-resolved biomarkers, precise FAZ-centric anchoring for future ETDRS analyses, and capillary-level quantification, CapillaryX establishes a reproducible framework for large-scale translational research in ophthalmology, neurology, and systemic vascular disease
5. Conclusions
We presented CapillaryX, an open-source, anatomy-aware pipeline for OCTA vascular phenotyping that unifies segmentation, feature extraction, and cross-device adaptation. CapillaryX produces an extended set of 34 biomarkers, including artery–vein–resolved and FAZ morphometrics, and maintains stable performance across heterogeneous datasets. By improving phenotype precision and enabling reproducible multicenter analysis, CapillaryX addresses critical limitations of current OCTA software. CapillaryX provides the methodological basis for large-scale imaging, epidemiological, and genetic studies, and represents a step toward standardized and interpretable OCTA vascular biomarkers.
6. Ethics Statement
Retinal imaging data were collected under the SOIN project BASEC ID 2022 − 01992. Data were obtained with informed consent and used in coded form in accordance with the approved protocol. This study also received approval from the CER-VD (protocol PB_2019 − 00168, Canton of Vaud, Switzerland).
Figures
Tables