

AI in ophthalmology increasingly depends on well-annotated data for training and validation, but it can be challenging to collect substantial imaging datasets, especially for rare diseases and less common clinical scenarios. Years of effort are required, and the process is often hindered by regulatory constraints and patient privacy concerns.
Enter generative modeling. Recent approaches based on generative adversarial networks (GANs), flow-based models, and diffusion models can synthesize realistic deepfake images at scale.1,2 By producing new artificial images, these models can fill data gaps in ways that conventional data augmentation methods cannot. In ophthalmology, high-fidelity synthetic OCT scans can help train robust AI systems, especially at the data-sparse extremes that rarely appear in real-world datasets.
This article summarizes how we used GANs to create synthetic anterior segment OCT scans so realistic that experienced surgeons often could not distinguish them from real images. These synthetic images are more than just a curiosity; they could improve AI performance for corneal and refractive tasks and accelerate future developments in anterior segment research.
GANS AND RELATED MODELS
GANs employ two deep neural networks—a generator and a discriminator—and engage them in a competitive game. The generator fabricates synthetic images, and the discriminator attempts to determine whether an image is genuine or fake.1 Through many training cycles, the generator refines its output until the discriminator is regularly fooled, leading to images that closely mimic real scans.
Other generative architectures, such as diffusion models and flow-based models, approach the problem differently (ie, by gradually denoising an image sample or by learning more tractable probability distributions).2 These techniques also yield high-quality synthetic images without the adversarial training framework of GANs.
Much of the work on generative modeling in ophthalmology has focused on the retina. Examples include producing synthetic retina OCT scans3 and removing blood vessel shadows from OCT images.4 The potential to adapt these algorithms for the anterior segment is significant because AI models for corneal imaging often rely on comparatively smaller datasets.
GENERATING SYNTHETIC ANTERIOR SEGMENT SCANS
Our team compiled a large OCT dataset of more than 100,000 images representing various corneal pathologies and postoperative states, including keratoconus, intrastromal corneal ring segments (ICRSs), laser vision correction, phakic IOLs, and more.5 We used this extensive library to train a GAN that, after sufficient iterations, began synthesizing realistic OCT scans (Figure 1). When we asked corneal specialists to differentiate real from generated images in a blinded quiz, they performed no better than chance (see Take the Quiz).

Figure 1. Representative GAN-generated anterior segment OCT images illustrating the diversity captured in synthetic scans. These include variations in corneal surgeries (eg, an EVO ICL and ICRSs) and artifacts such as central flares and eyelid shadows to enhance training for diverse clinical scenarios.
Take the Quiz
Can you distinguish real scans from synthetic ones? Click here to take the authors’ quiz. This fun exercise illustrates how far generative models have come in simulating true clinical images.
As with any machine learning approach, however, not every image generated was perfect. At times, the GAN introduced unrealistic anatomic blends (eg, combining two different ICRSs in one cornea).5 Nevertheless, the vast majority of synthetic scans were visually indistinguishable from authentic ones—a testament to the power of these models.
ENHANCING ICL VAULT ESTIMATION
Correctly measuring the vault of an EVO or Visian ICL (both from STAAR Surgical) is key to preventing postoperative complications: too high a vault can risk pupillary block,6 and too low a vault can lead to early cataract formation.7 Surgeons typically rely on manual caliper measurements via OCT (Figure 2), but the method can be time-consuming and is prone to interobserver variability.

Figure 2. An example of an OCT scan of a low-vault ICL used to train the authors’ deep learning model for vault measurement.
Our group previously developed a deep learning model to measure postoperative vault directly from OCT scans, which reduced our reliance on manual caliper measurements.8 Although successful, the dataset featured primarily midrange or “safe” vault levels. This limited the model’s exposure to atypically high or low vault heights, thereby restricting its generalizability. To address the gap, we supplemented the dataset with millions of synthetic ICL scans generated by our GAN.9 This approach provided more examples of rare vault scenarios, leading to improved error metrics (Figure 3). We observed clear gains in model performance at the distribution’s extremes, which shows how real and synthetic data can synergize to form a more comprehensive training base. Our reliance on real-world data limited our model’s ability to generalize to outliers. Integrating synthetic data bridged the gap and improved predictions for both common and rare vault scenarios.

Figure 3. Comparison of ICL vault model performance trained on real images alone versus a combination of real and synthetic images. Synthetic data enriched the training set with rare cases, significantly improving accuracy, especially for extreme vault scenarios.
In a complementary classification task, we observed a 22% increase in accuracy when synthetic data were included, further demonstrating the robustness added by GAN-generated images.5
REALISM WITH CAUTION
Despite their impressive fidelity, GAN-derived images have inherent limitations. A synthetic OCT scan may blend features from different surgical procedures or corneal abnormalities in ways rarely seen in practice.5 Researchers must carefully validate whether such deepfakes truly help an AI algorithm learn the correct decision boundaries or if they risk introducing subtle biases. Generative models nevertheless remain promising for three purposes.
No. 1: Rare Conditions
Synthetic images of rare pathologies (eg, Acanthamoeba keratitis and corneal melt) can help train algorithms when real-world examples are scarce.
No. 2: Image Enhancement
Models such as Pix2Pix or CycleGAN can be trained to remove speckle noise, sharpen fine details, and correct minor artifacts (eg, glare or shadows) in OCT or slit-lamp images.10 This process can enhance diagnostic clarity and might reduce the need for repeat scans.
No. 3: Enhancement and Sharing of Datasets
Whenever privacy or Institutional Review Board constraints limit data sharing, synthetic images could sidestep patient-identifiable elements. This approach could, in turn, facilitate multicenter collaboration without the direct exchange of protected health information.
CONCLUSION
Generative AI is reshaping the landscape of ophthalmic image analysis. By producing synthetic data that closely mimic real-world scans, GANs and diffusion models can improve AI training, validation, and performance—particularly for challenging or rare conditions. Caution regarding pathologic realism is warranted, but the potential for these models to enrich datasets and reduce data bottlenecks is difficult to ignore. Surgeons and clinicians who integrate generative imaging into their workflow may expedite research, streamline data sharing, and develop more robust AI algorithms to tackle everyday clinical tasks in refractive and corneal care.
1. Goodfellow I, Pouget-Abadie J, Mirza M, et al. Generative adversarial nets. In: Advances in Neural Information Processing Systems 27 (NIPS 2014). NeurlPS Proceedings. Accessed January 27, 2025. https://proceedings.neurips.cc/paper_files/paper/2014/hash/5ca3e9b122f61f8f06494c97b1afccf3-Abstract.html
2. Sohl-Dickstein J, Weiss E, Maheswaranathan N, Ganguli S. Deep unsupervised learning using nonequilibrium thermodynamics. In: Proceedings of the 32nd International Conference on Machine Learning. PMLR. 2015(37):2256-2265. Accessed January 27, 2025. https://proceedings.mlr.press/v37/sohl-dickstein15.html
3. Zheng C, Xie X, Zhou K, et al. Assessment of generative adversarial networks model for synthetic optical coherence tomography images of retinal disorders. Transl Vis Sci Technol. 2020;9(2):29.
4. Cheong H, Devalla SK, Pham TH, et al. DeshadowGAN: a deep learning approach to remove shadows from optical coherence tomography images. Transl Vis Sci Technol. 2020;9(2):23.
5. Assaf JF, Abou Mrad A, Reinstein DZ, et al. Creating realistic anterior segment optical coherence tomography images using generative adversarial networks. Br J Ophthalmol. 2024;108(10):1414-1422.
6. Smallman DS, Probst L, Rafuse PE. Pupillary block glaucoma secondary to posterior chamber phakic intraocular lens implantation for high myopia. J Cataract Refract Surg. 2004;30(4):905-907.
7. Gonzalez-Lopez F, Mompean B, Bilbao-Calabuig R, Vila-Arteaga J, Beltran J, Baviera J. Dynamic assessment of light-induced vaulting changes of implantable collamer lens with central port by swept-source OCT: pilot study. Transl Vis Sci Technol. 2018;7(3):4.
8. Assaf JF, Reinstein DZ, Zakka C, et al. Deep learning-based estimation of implantable collamer lens vault using optical coherence tomography. Am J Ophthalmol. 2023;253:29-36.
9. Assaf JF, Yazbeck H, Reinstein DZ, et al. Enhancing the automated detection of implantable collamer lens vault using generative adversarial networks and synthetic data on optical coherence tomography. J Refract Surg. 2024;40(4):e199-e207.
10. Zhou Y, Yu K, Wang M, et al. Speckle noise reduction for OCT images based on image style transfer and conditional GAN. IEEE J Biomed Health Inform. 2022;26(1):139-150.