Model Description
Code for "Validation of neuron activation patterns for AI models in oculomics" Please email the author on songyang.an@auckland.ac.nz describing the reason for access before sending an access request.
Pre-requisites
- The models and results require images from the UK Biobank dataset.
- The input files provided in this repository only contain the image names and simple accompanying metadata.
- To gain access to the UK Biobank dataset, please apply for access using this link.
- After access permission has been granted, follow the instructions from UK Biobank, https://biobank.ctsu.ox.ac.uk/crystal/ukb/docs/ukbfetch_instruct.html, in fetching the left (field ID 21015) and right (field ID 21016) fundus photographs.
- The raw images from UK Biobank have black borders. The images must be squared cropped otherwise it will not be compatible with the model
Getting started
- Install required python packages by running pip install requirement.txt
- Run "1. Generate dataset summary table.py" to recreate table 1
- Run "2. extract neuron activations.py" to extract feature map activations from model. Note: This step requires the path to where the cropped UK Biobank images are stored For example, if the images are stored in "c:\biobank images" then run console command in the following format: python.exe "2. extract neuron activations.py" "c:\biobank images"
- Run "3. calculate similarities for neuron activations.py" to calculate similarity means. Note: This step relies on the outputs from step 3.
- Run "4. outcome 1 analysis" to generate results in table 2. This step is can be executed without steps 3, and 4, as I've included the intermediate files generated from steps 3 and 4 into the repository.
- Run "5. outcome 2 analysis" to generate results in table 2. This step is can be executed without steps 3, and 4, as I've included the intermediate files generated from steps 3 and 4 into the repository.
Citation
To be done