Skip to content

Harvard-Ophthalmology-AI-Lab/VFTransformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VFTransformer

The code for the paper entitled Transformer-based Deep Learning Prediction of 10-Degree Humphrey Visual Field Tests from 24-Degree Data. If you have any questions, please email harvardophai@gmail.com and harvardairobotics@gmail.com.

Requirements

Python 3.8
tensorflow 2.4.0
opencv-python 4.5.5

Dataset

Here are sample codes to visualize the source 24-2 VF map:

import tensorflow as tf
from vf_tools import *
import pandas as pd

vfdata = np.load('data/vfdata.npy', allow_pickle=True)
age, righteye, duration, centralval, centralprob, md, mdprob, psd, timegap, tds = vfdata[1]
plot_vf(tds)

Pretrained Model

Download the model via this link. Unzip the file and put under the "checkpoint" folder.

Use the Model

Please refer to example.ipynb.

# prepare the data
test_dataset, tds24_test = prepare_data(vfdata)

# load the pretrained model
model = tf.keras.models.load_model('checkpoint/fttransformer')

# predict 10-2 VF
preds = model.predict((test_dataset, tds24_test))
vf10_pred = np.array(preds['output'])
                           
# visualize the source 24-2 VF and predicted 10-2 VF
plot_vf(tds24_test[1], title='source 24-2 VF')
plot_vf(vf10_pred[1], title='predicted 10-2 VF')

10-2 VF prediction example:

Acknowledgement and Citation

Coming soon ...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published