Skip to main content

A/V segmentation

Updated version (may26)​

av_may26
Model description:

UNet ensemble (5 models) for artery-vein segmentation from color fundus images (CFIs), trained on various public datasets, and on images from the Rotterdam Study.

Intended uses:

Robust artery-vein segmentation on color fundus images.

Training data:

The model was trained on HRF-AV, Les-AV, RITE, Leuven-Haifa, REYIA and on images from the Rotterdam Study.

Training procedure:

See VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images. This model has the same architecture and training procedure, but we added additional training data from REYIA (publicly available), and from the Rotterdam Study.

Evaluation:

See VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images

Notes:

  • The model was trained and evaluated using CFIs cropped to a square using [retinalysis-fundusprep].
Limitations:
  • Mistakes in A/V classification
  • Not trained on WF or UWF fundus images
Inference:
We recommend to run inference using retinalysis-inference, which can auto-download the model weights and execute CFI pre-processing (crop to square) if necessary. For running… Show moreShow less

We recommend to run inference using retinalysis-inference, which can auto-download the model weights and execute CFI pre-processing (crop to square) if necessary. For running inference on a CFI:

  1. Install retinalysis-inference:

    pip install retinalysis-inference
  2. Load the ensemble:

    from rtnls_inference import (
    HeatmapRegressionEnsemble,
    SegmentationEnsemble,
    )
    ensemble = SegmentationEnsemble.from_huggingface("Eyened/vascx:artery_vein/av_may26.pt").to(device)
  3. Run inference:

    # 1. Preprocess one input record.
    image = np.array(Image.open("/PATH/TO/RGB/FUNDUS/IMAGE.PNG"))
    item = ensemble.preprocess_item({"image": image})

    # 2. Make a batch of size 1.
    batch = ensemble.make_batch([item])

    # 3. Run the ensemble.
    predictions = ensemble.predict_batch(batch)

    # 4. Postprocess the prediction into a final mask.
    result = ensemble.postprocess_batch(predictions, batch)[0]

For more information see retinalysis-inference.

License & citation:
If you use this model, please consider citing, based on relevance: VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images Vargas Quiros, J. D.,… Show moreShow less

If you use this model, please consider citing, based on relevance:

  • VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images

    Vargas Quiros, J. D., Liefers, B., van Garderen, K. A., Vermeulen, J. P., & Klaver, C. C. W. (2025). VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images. Translational Vision Science & Technology, 14(7), 19-19.

  • retinalysis-vascx: An explainable software toolbox for the extraction of retinal vascular biomarkers

    Vargas Quiros, J. V., Beyeler, M. J., Vela, S. O., Center, E. R., Bergmann, S., Klaver, C. C. W., & Liefers, B. (2026). retinalysis-vascx: An explainable software toolbox for the extraction of retinal vascular biomarkers. arXiv preprint arXiv:2602.08580.

  • The Leuven-Haifa dataset and REYIA datasets together are a large part of the training data for this model, and we encourage users to consider citing them separately:

    Van Eijgen J, Fhima J, Billen Moulin-Romsée MI, Behar JA, Christinaki E, Stalmans I. Leuven-haifa high-resolution fundus image dataset for retinal blood vessel segmentation and glaucoma diagnosis. Scientific data. 2024 Feb 29;11(1):257.

    Fhima J, Van Eijgen J, Beeckmans L, Jacobs T, Freiman M, Nakayama LF, Stalmans I, Baskin C, Behar JA. Enhancing retinal vessel segmentation generalization via layout-aware generative modelling. Machine Learning: Health. 2025 Mar.

We share the model under a Creative Commons Attribution–NonCommercial 4.0 license. We note that some of the datasets used for training and evaluating the model ensemble were made publicly available for research purposes, but do not include a license. Other such as Leuven-Haifa explicitly use custom terms with non-commercial clauses.

Original version (july24)​

av_july24
Model description:

UNet ensemble (5 models) for artery-vein segmentation from color fundus images (CFIs), trained on various public datasets, and on images from the Rotterdam Study.

Intended uses:

Robust artery-vein segmentation on color fundus images.

Training data:

The model was trained on HRF-AV, Les-AV, RITE, Leuven-Haifa, IOSTAR, and on images from the Rotterdam Study.

Training procedure:

See VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images

Evaluation:

See VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images

Notes:

  • The model was trained and evaluated using CFIs cropped to a square using [retinalysis-fundusprep].
Limitations:
  • Mistakes in A/V classification
  • Not trained on WF or UWF fundus images
Inference:
We recommend to run inference using retinalysis-inference, which can auto-download the model weights and execute CFI pre-processing (crop to square) if necessary. For running… Show moreShow less

We recommend to run inference using retinalysis-inference, which can auto-download the model weights and execute CFI pre-processing (crop to square) if necessary. For running inference on a CFI:

  1. Install retinalysis-inference:

    pip install retinalysis-inference
  2. Load the ensemble:

    from rtnls_inference import (
    HeatmapRegressionEnsemble,
    SegmentationEnsemble,
    )
    ensemble = SegmentationEnsemble.from_huggingface("Eyened/vascx:artery_vein/av_july24.pt").to(device)
  3. Run inference:

    # 1. Preprocess one input record.
    image = np.array(Image.open("/PATH/TO/RGB/FUNDUS/IMAGE.PNG"))
    item = ensemble.preprocess_item({"image": image})

    # 2. Make a batch of size 1.
    batch = ensemble.make_batch([item])

    # 3. Run the ensemble.
    predictions = ensemble.predict_batch(batch)

    # 4. Postprocess the prediction into a final mask.
    result = ensemble.postprocess_batch(predictions, batch)[0]

For more information see retinalysis-inference.

License & citation:
If you use this model, please consider citing, based on relevance: VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images Vargas Quiros, J. D.,… Show moreShow less

If you use this model, please consider citing, based on relevance:

Van Eijgen, J., Fhima, J., Billen Moulin-Romsée, MI. et al. Leuven-Haifa High-Resolution Fundus Image Dataset for Retinal Blood Vessel Segmentation and Glaucoma Diagnosis. Sci Data 11, 257 (2024). https://doi.org/10.1038/s41597-024-03086-6

We share the model under a Creative Commons Attribution–NonCommercial 4.0 license. We note that some of the datasets used for training and evaluating the model ensemble were made publicly available for research purposes, but do not include a license. Other such as Leuven-Haifa explicitly use custom terms with non-commercial clauses.