Skip to main content

Fovea localisation

Updated version (may26)​

fovea_may26
Model description:
ConvnextV2 model for fovea localisation from color fundus images (CFIs), trained on various public datasets, and on images from the Rotterdam Study. The model uses heatmap… Show moreShow less

ConvnextV2 model for fovea localisation from color fundus images (CFIs), trained on various public datasets, and on images from the Rotterdam Study. The model uses heatmap regression to produce (x,y) coordinates for the fovea location in the image, with x and y in the range [0,1], relative to image size.

Intended uses:

Localisation of the fovea on color fundus images.

Training data:

The model was trained on IDRID, ADAM, PALM, REFUGE2, and on images from the Rotterdam Study.

Training procedure:

See VascX Models: Deep Ensembles for Retinal Vascular Analysis From Color Fundus Images. This model follows the same setup, except that it is no longer an ensemble, but a single convnextv2 model fine-tuned from ImageNet weights, which made it faster at no cost in performance.

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:
  • The fovea may be difficult to localise precisely on some CFIs, depending on anatomy and illumination.
  • Does not work when the fovea is out of bounds.
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 = HeatmapRegressionEnsemble.from_huggingface("Eyened/vascx:fovea/fovea_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 the final fovea coordinates.
    result = ensemble.postprocess_batch(predictions, batch)[0]

For more information see retinalysis-inference.

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

If you use this model, please consider citing:

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.

Original version (july24)​

fovea_july24
Model description:
UNet ensemble (5 models) for fovea localisation from color fundus images (CFIs), trained on various public datasets, and on images from the Rotterdam Study. The model uses heatmap… Show moreShow less

UNet ensemble (5 models) for fovea localisation from color fundus images (CFIs), trained on various public datasets, and on images from the Rotterdam Study. The model uses heatmap regression to produce (x,y) coordinates for the fovea location in the image, with x and y in the range [0,1], relative to image size.

Intended uses:

Localisation of the fovea on color fundus images.

Training data:

The model was trained on IDRID, ADAM, PALM, REFUGE2, 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:
  • The fovea may be difficult to localise precisely on some CFIs, depending on anatomy and illumination.
  • Does not work when the fovea is out of bounds.
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 = HeatmapRegressionEnsemble.from_huggingface("Eyened/vascx:fovea/fovea_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 the final fovea coordinates.
    result = ensemble.postprocess_batch(predictions, batch)[0]

For more information see retinalysis-inference.

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

If you use this model, please consider citing:

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.