Adaptive Optics Image Analysis Using Generative AI (GPT-4) Scripting: Exploratory Study

Background The availability of dedicated image analysis scripts for adaptive optics (AO)–flood illumination ophthalmoscopy (FIO) is limited, especially for large-scale measurements and analyses of nonhealthy images. This limitation highlights the need for alternative approaches to facilitate automated and scalable analysis. Large language models may help develop such scripts. Objective This study aimed to generate an analysis script for AO-FIO images in the R programming language using a widely available generative AI (GenAI; specifically, GPT-4) as a proof of principle for generating a functional but nonvalidated script. Methods GPT-4 was used to generate an R script for the analysis of AO-FIO images. The code generated by GPT-4 was fine-tuned iteratively based on trial and error, testing the script for image preprocessing and analysis using images from 4 participants, including 1 healthy individual and 3 patients with Stargardt disease. The script code was subsequently checked for errors by another researcher who was naive to previous coding, using a different test set of AO-FIO images from 4 other participants (n=1 healthy individual and n=3 patients with Stargardt disease). The cone counts from 5 AO image snippets were compared with the counts independently recorded by 2 human graders and those generated by pre-existing AO analysis software that was trained on healthy participants. Results After 54 iterations of instructions, a functional R script for the analysis of AO-FIO images was generated. The script identified and quantified blobs. Conclusions We developed a preliminary nonvalidated script for cone detection in retinal AO images with support from GPT-4. Before such a script can be used in clinical research, it should undergo more fine-tuning and extensive testing. Future work should enhance the image analysis capabilities of the script and validate its results to assess the potential of AO-based cone counts as biomarkers in clinical trials.

Authors

Publication Details

Journal
JMIR Formative Research
Published
2026-09-14
DOI
https://doi.org/10.2196/94906
Primary Topic
Ophthalmology and Visual Impairment Studies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
article

Adaptive Optics Image Analysis Using Generative AI (GPT-4) Scripting: Exploratory Study

Yara Lechanteur, Thomas Theelen, Jeroen Pas, Carel B. Hoyng et al.
JMIR Formative Research
Ophthalmology and Visual Impairment Studies
article

Adaptive Optics Image Analysis Using Generative AI (GPT-4) Scripting: Exploratory Study

Yara Lechanteur, Thomas Theelen, Jeroen Pas, Carel B. Hoyng, Ludo van der Zanden, Yoeri van Leeuwen
article en

Abstract

Background The availability of dedicated image analysis scripts for adaptive optics (AO)–flood illumination ophthalmoscopy (FIO) is limited, especially for large-scale measurements and analyses of nonhealthy images. This limitation highlights the need for alternative approaches to facilitate automated and scalable analysis. Large language models may help develop such scripts. Objective This study aimed to generate an analysis script for AO-FIO images in the R programming language using a widely available generative AI (GenAI; specifically, GPT-4) as a proof of principle for generating a functional but nonvalidated script. Methods GPT-4 was used to generate an R script for the analysis of AO-FIO images. The code generated by GPT-4 was fine-tuned iteratively based on trial and error, testing the script for image preprocessing and analysis using images from 4 participants, including 1 healthy individual and 3 patients with Stargardt disease. The script code was subsequently checked for errors by another researcher who was naive to previous coding, using a different test set of AO-FIO images from 4 other participants (n=1 healthy individual and n=3 patients with Stargardt disease). The cone counts from 5 AO image snippets were compared with the counts independently recorded by 2 human graders and those generated by pre-existing AO analysis software that was trained on healthy participants. Results After 54 iterations of instructions, a functional R script for the analysis of AO-FIO images was generated. The script identified and quantified blobs. Conclusions We developed a preliminary nonvalidated script for cone detection in retinal AO images with support from GPT-4. Before such a script can be used in clinical research, it should undergo more fine-tuning and extensive testing. Future work should enhance the image analysis capabilities of the script and validate its results to assess the potential of AO-based cone counts as biomarkers in clinical trials.

JMIR Formative ResearchVol. 10
Openalex Percentile: Top 10%
Ophthalmology and Visual Impairment Studies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.