An Open-Source Generalizable Deep Learning Framework for Automated Corneal Segmentation in Anterior Segment Optical Coherence Tomography Imaging

preprint OA: gold CC-BY-4.0
📄 Open PDF Full text JSON View at publisher
Full text 45,353 characters · extracted from preprint-html · click to expand
An Open-Source Generalizable Deep Learning Framework for Automated Corneal Segmentation in Anterior Segment Optical Coherence Tomography Imaging | medRxiv /* */ /* */ <!-- <!-- /*! * yepnope1.5.4 * (c) WTFPL, GPLv2 */ (function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;j.type='text/javascript';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-P4HH5NV'); Skip to main content Home About Submit ALERTS / RSS Search for this keyword Advanced Search An Open-Source Generalizable Deep Learning Framework for Automated Corneal Segmentation in Anterior Segment Optical Coherence Tomography Imaging View ORCID Profile Lynn Kandakji , View ORCID Profile Siyin Liu , View ORCID Profile Shafi Balal , View ORCID Profile Ismail Moghul , View ORCID Profile Bruce Allan , View ORCID Profile Stephen Tuft , Daniel Gore , View ORCID Profile Nikolas Pontikos doi: https://doi.org/10.1101/2025.06.18.25329856 Lynn Kandakji 1 University College London Institute of Ophthalmology , 11-43 Bath Street, London EC1V 9EL, United Kingdom 2 Moorfields Eye Hospital NHS Foundation Trust , London, United Kingdom MSc Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Lynn Kandakji Siyin Liu 1 University College London Institute of Ophthalmology , 11-43 Bath Street, London EC1V 9EL, United Kingdom 2 Moorfields Eye Hospital NHS Foundation Trust , London, United Kingdom MBBS Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Siyin Liu Shafi Balal 1 University College London Institute of Ophthalmology , 11-43 Bath Street, London EC1V 9EL, United Kingdom 2 Moorfields Eye Hospital NHS Foundation Trust , London, United Kingdom MBBS Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Shafi Balal Ismail Moghul 1 University College London Institute of Ophthalmology , 11-43 Bath Street, London EC1V 9EL, United Kingdom PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Ismail Moghul Bruce Allan 1 University College London Institute of Ophthalmology , 11-43 Bath Street, London EC1V 9EL, United Kingdom 2 Moorfields Eye Hospital NHS Foundation Trust , London, United Kingdom MD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Bruce Allan Stephen Tuft 1 University College London Institute of Ophthalmology , 11-43 Bath Street, London EC1V 9EL, United Kingdom 2 Moorfields Eye Hospital NHS Foundation Trust , London, United Kingdom MD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Stephen Tuft Daniel Gore 1 University College London Institute of Ophthalmology , 11-43 Bath Street, London EC1V 9EL, United Kingdom 2 Moorfields Eye Hospital NHS Foundation Trust , London, United Kingdom MD Find this author on Google Scholar Find this author on PubMed Search for this author on this site Nikolas Pontikos 1 University College London Institute of Ophthalmology , 11-43 Bath Street, London EC1V 9EL, United Kingdom 2 Moorfields Eye Hospital NHS Foundation Trust , London, United Kingdom PhD Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Nikolas Pontikos For correspondence: n.pontikos{at}ucl.ac.uk Abstract Full Text Info/History Metrics Data/Code Preview PDF Abstract Purpose To develop a deep learning model – Cornea nnU-Net Extractor (CUNEX) – for full-thickness corneal segmentation of anterior segment optical coherence tomography (AS-OCT) images and evaluate its utility in artificial intelligence (AI) research. Methods We trained and evaluated CUNEX using nnU-Net on 600 AS-OCT images (CSO MS-39) from 300 patients: 100 normal, 100 keratoconus (KC), and 100 Fuchs endothelial corneal dystrophy (FECD) eyes. To assess generalizability, we externally validated CUNEX on 1,168 AS-OCT images from an infectious keratitis dataset acquired from a different device (Casia SS-1000). We benchmarked CUNEX against two recent models, CorneaNet and ScLNet. We then applied CUNEX to our dataset of 194,599 scans from 37,499 patients as preprocessing for a classification model evaluating whether segmentation improves AI prediction, including age, sex, and disease staging (KC and FECD). Results CUNEX achieved Dice similarity coefficient (DSC) and intersection over union (IoU) scores ranging from 94–95% and 90–99%, respectively, across healthy, KC, and FECD eyes. This was similar to ScLNet (within 3%) but better than CorneaNet (8–35% lower). On external validation, CUNEX maintained high performance (DSC 83%; IoU 71%) while ScLNet (DSC 14%; IoU 8%) and CorneaNet (DSC 16%; IoU 9%) failed to generalize. Unexpectedly, segmentation minimally impacted classification accuracy except for sex prediction, where accuracy dropped from 81 to 68%, suggesting sex-related features may lie outside the cornea. Conclusion CUNEX delivers the first open-source generalizable corneal segmentation model using the latest framework, supporting its use in clinical analysis and AI workflows across diseases and imaging platforms. It is available at https://github.com/lkandakji/CUNEX . Introduction Anterior segment optical coherence tomography (AS-OCT) provides high-resolution radial cross-sections of the cornea that can support the diagnosis and management of corneal diseases such as keratoconus (KC), 1 , 2 Fuchs endothelial corneal dystrophy (FECD), 3 and infectious keratitis (IK). 4 However, interpreting these images when there is early disease requires a high level of expertise. Deep learning (DL), particularly convolutional neural networks (CNNs), has advanced image analysis, 5 often outperforming clinician-reviewed scans or pre-selected metrics such as pachymetry, curvature, or symmetry indices. 6 , 7 However, their diagnostic performance may depend on image quality and/or limiting the analysis on the most relevant anatomical regions. 8 , 9 To date, most DL image analysis models have been trained on data from Placido disk or Scheimpflug-derived topographic maps. 10 Despite growing interest in AS-OCT, cross-sectional images, sometimes referred to as B-scans, are still rarely reported in DL classification studies. In other imaging domains, including magnetic resonance imaging (MRI), 11 computed tomography (CT), 12 fundus photography, 13 , 14 and retinal OCT, 15 , 16 segmentation has improved performance and interpretability. Segmentation delineates a pathological region or anatomical structure, enabling a structure-specific input for further analysis, but its role as part of the model workflow for the diagnosis of corneal disease remains untested. AS-OCT classification workflows generally follow two approaches: (1) Measurement-based classification, where biometric parameters are extracted from the AS-OCT B-scan and these numeric values are used as the input for a classifier; 17 – 19 or (2) End-to-end DL, where a CNN analyzes the AS-OCT image output from either a cross-section or derived heatmap and predicts a condition. 20 – 22 Segmentation may enhance either approach by isolating the most diagnostically relevant structures and reducing noise from surrounding anatomy. We developed a novel cornea nnU-Net extractor (CUNEX), a generalizable DL framework that performs full thickness limbus-to-limbus corneal segmentation from AS-OCT cross-sectional images. Our goal was to create an accurate and adaptable segmentation tool to support a wide range of AS-OCT research and clinical applications. To inform future modeling priorities for AS-OCT analysis, we also investigate the role of corneal segmentation in DL classification of AS-OCTs and determine when anatomical precision meaningfully contributes to model utility. Materials and Methods Dataset The study received ethical approval from Moorfields Eye Hospital (MEH) NHS Foundation Trust (references CA17/CED/03 and 22/PR/0249). The study adhered to the principles outlined in the Declaration of Helsinki. The Moorfields Eye Hospital Corneal dataset included 194,599 AS-OCT scans (MS-39, Costruzione Strumenti Oftalmici, Florence, Italy) from 37,499 patients. Each scan consists of 25 radial cross-sections with a resolution of 900×1800 pixels per image. To train CUNEX, we defined three corneal classes: 100 unique normal eyes, 100 that had KC, and 100 with FECD. For the classification CNN, we selected a separate set of 600 unique healthy eyes, 480 with KC, and 400 with FECD. Clinical diagnoses were confirmed by a fellowship-trained corneal specialist following review of the AS-OCT images and electronic health records. The normal eyes were from patients reviewed before laser vision correction (LVC) with no ocular pathology apart from myopia. Each model development dataset was split into training (70%), test (15%), and validation (15%), stratified by class ( Figure 1 ). Model performance was evaluated on the validation set. All training was performed on an NVIDIA GeForce RTX 3090 GPU. Download figure Open in new tab Figure 1. Dataset selection and partitioning workflow. To assess CUNEX generalizability on out-of-distribution data - i.e., images that differ in pathology, resolution, and device from those used in training - and simulate a real-world clinical deployment we performed external validation without additional retraining using an independent dataset of eyes with infectious keratitis (IK). 23 This dataset comprises 1,168 AS-OCT images with resolution (1723 × 1000 pixels) from 64 patients with IK from a swept-source Casia SS-1000 OCT system (Tomey Corporation, Japan). Manual Annotation To create the labels used to train CUNEX, AS-OCT images were manually annotated (LK) on the Moorfields Grading Platform (grading.readingcentre.org ). In this context, labels refer a single manually drawn region covering the whole of the imaged section of the cornea, which serves as the reference (ground-truth) for training the segmentation model. From each 25-scan volume, a transverse and sagittal view was selected to delineate the whole cornea from limbus to limbus ( Supplemental Digital Content Figure 1 ). To assess reproducibility, a subset of 50 scans was independently annotated by a second grader (RL) and reviewed by a fellowship-trained corneal specialist (ST). Segmentation Model Development and Evaluation We developed CUNEX using the nnU-Net framework. For comparison, we used two other U-Net models, CorneaNet 24 and ScLNet. 25 As our image dimensions were incompatible with CorneaNet, we retrained its architecture on our internal dataset. A pre-trained ScLNet model could not be accessed, so we also retrained its architecture on our internal dataset. We retained the original training hyperparameters and number of epochs for both CorneaNet and ScLNet, as specified in their source codes. The architectural and pre-processing differences between CUNEX and previous U-Net implementations are detailed in Supplemental Digital Content Table 1 . We assessed segmentation performance against manual annotation using three metrics: the Dice Similarity Coefficient (DSC), intersection over union (IoU), and the Hausdorff Distance (HD). DSC and IoU measure the overlap between the predicted and manual segmentation masks, while HD assesses the boundary accuracy. To assess segmentation consistency, each corneal image was vertically divided into three equal segments and DSC, IoU, and HD were calculated for the central and peripheral zones. The segmentation model generalizability was assessed using two validation sets. First, an internal hold-out set from the same device (MS-39). Then, the trained model weights were applied without re-training or fine-tuning to an external dataset (AIDK). Segmentation ground truth for the AIDK set was provided by the authors as polygon-based labels (LabelMe JSON format). We then quantified segmentation accuracy by comparing the CUNEX-predicted masks to the manual reference annotations. Classification Model Development and Evaluation We conducted four binary classification experiments to evaluate the impact of segmenting the cornea with CUNEX on classification performance. Two experiments focused on discriminating between early- vs end-stage KC and FECD and another two on discriminating age (≤30 or >30) and sex (male or female). Age and sex predictions used only healthy eyes to avoid confounding by disease-related patterns, as KC and FECD affect younger 24 and older 25 individuals, respectively. We empirically selected the 30-year age threshold based on the distribution of ages in the healthy cohort (mean 30 ± 8 years, median 29, range 16–60) to yield a balanced split. To address class imbalance in the training data for early vs end stage KC and FECD, we used weighted sampling so that the CNN saw a balanced number of examples from each class during learning. Each experiment was conducted twice using two input types: (1) the original AS-OCT cross-sectional images (classification-only), and (2) the same images masked to show only the cornea (segmentation-classification). In the second approach, segmentation masks generated by CUNEX were applied to remove non-corneal regions. The CNN architecture was kept consistent across all experiments and was based on lightweight classification models such as MobileNet 26 and Xception 27 ( Supplemental Digital Content Table 2 ). All models were trained for 10 epochs using the Adam optimizer and binary cross-entropy loss. Rather than optimizing the network architecture itself, the aim of this study was to evaluate whether providing an explicit anatomical focus – the cornea – improves the CNN’s ability to correctly classify the input. Model performance for each binary classification task was evaluated on a held-out validation set using five standard metrics: accuracy, sensitivity (recall), specificity, F1 score, and Matthews correlation coefficient (MCC). We used F1 score and MCC over receiver operating characteristic curves and area under the curve, to reflect clinical use of fixed decision thresholds and performance under class imbalance. All metrics were computed separately for each of the four classification tasks. To compare the two input conditions, we used McNemar’s test with statistical significance set at p < 0.05. Results Segmentation Training One volume from the healthy group was excluded from the segmentation dataset due to motion artifact caused by blinking. Inter-grader agreement of manual annotations (n=98) was high with an average DSC of 98%, IoU of 84%, and ICC for mask area of 0.83 (r=0.83, p<0.001). Most boundary differences were <60 pixels with a mean HD of 130.9 ± 97.4 ( Supplemental Digital Content Table 3 ). CUNEX and ScLNet reached 96% DSC after 205 and 100 training epochs, respectively, while CorneaNet achieved 91% after 600 epochs. Quantitative Validation On the internal validation set, CUNEX consistently outperformed both CorneaNet and ScLNet, particularly in KC and FECD cases ( Table 1 ). While CUNEX and ScLNet achieved similar DSC and IoU scores, CUNEX showed more localized boundary errors, reflected in slightly higher HD values. In contrast, CorneaNet exhibited substantially lower overlap metrics, especially in KC, and produced the largest and most spatially diffuse boundary errors, indicating poor generalizability to atypical corneal shapes. Segmentation accuracy was highest in the central cornea across all models, likely due to clearer anatomical contrast and fewer non-corneal structures. However, HD values were paradoxically greater in the central zone, suggesting the presence of small but sharp deviations in predicted boundaries near the apex. On the external AIDK dataset, CUNEX maintained strong performance with DSC and IoU scores above 80 and 70%, respectively. In contrast, CorneaNet and ScLNet failed to generalize, with DSC and IoU scores less than 16 and 10%, respectively. View this table: View inline View popup Download powerpoint Table 1. Performance of various models on validation data is presented. Support represents the proportion of images each class occupies within the dataset. Both the DSC and IOU scores for each of the three image classes are detailed, alongside comparisons between the central (inner third) and peripheral regions (outer thirds) of the OCT image. Qualitative Validation Visual inspection confirmed that CUNEX consistently isolated the whole corneal structure across diverse presentations while excluding surrounding features such as the limbus, iris, lens, and sclera ( Figure 2 ). It handled common imaging artifacts with minimal degradation, including central lines, speckle noise, and low SNR regions. ScLNet demonstrated similar performance to CUNEX but with slightly coarser boundary definitions and localized discontinuities, suggesting reduced subpixel precision at the epithelial and endothelial margins. In contrast, CorneaNet exhibited frequent segmentation failures, including incomplete boundaries, discontinuous regions, and false positives in adjacent structures, particularly in KC and FECD images. Download figure Open in new tab Figure 2. Variability in the performance of three segmentation networks: CUNEX, CorneaNet, and ScLNet, in segmenting the cornea across healthy, keratoconus (KC) and Fuchs endothelial corneal dystrophy (FECD). Each row shows a representative cross-section AS-OCT image from a healthy eye (row 1), KC eye (row 2), and eye with FECD (row 3). Column show the original B-scan (A), and corresponding corneal segmentation mask predicted by CUNEX (B), ScLNet (C), and CorneaNet (D). On the external AIDK dataset, segmentation performance diverged significantly between the three models ( Figure 3 ). CUNEX demonstrates strong generalizability, producing anatomically accurate outputs across all cases. However, prominent central artifact lines near the visual axis in AIDK images occasionally caused central overcuts in CUNEX’s outputs and likely contributed to its slight drop in validation accuracy. In contrast, ScLNet produced large false positives and anatomically implausible extensions beyond the corneal boundaries, while CorneaNet captured only partial and disjointed anterior and posterior corneal boundaries. Download figure Open in new tab Figure 3. External segmentation performance on keratitis AS-OCT images (AIDK dataset) acquired using the Casia SS-1000 swept-source device. Row A displays the original cross-section image, row B the CorneaNet prediction, row C the ScLNet prediction and row D the CUNEX prediction. Comparative Evaluation of Classification Performance with and without Segmentation Segmentation did not improve discriminative ability in any of the four classification tasks. Performance metrics were consistently, but marginally, lower with segmentation-assisted inputs compared to the original image ( Table 2 ). Most prediction differences involved a single false positive or negative ( Figure 4 ), suggesting normal variability in training. Segmentation slightly reduced specificity in KC staging and improved it in FECD staging, though neither change was statistically significant. Sex classification showed a significant decrease in performance with the segmented input, which may indicate that sexually dimorphic features are located outside the cornea and are partially suppressed with segmentation. Download figure Open in new tab Figure 4. Confusion matrices for binary classification performance of deep learning models trained to predict age group (≤30 vs >30), sex (male vs female), and disease stage (early vs end-stage keratoconus or FECD) in AS-OCT images. Performance is reported on validation data, comparing models trained without (top row) and with (bottom row) corneal segmentation applied to the input image. True labels were derived from clinical records. Each cell shows absolute counts with percentage of total. TP=true positive; TN=true negative; FP=false positive; FN=false negative; KC=keratoconus; FECD=Fuchs’ endothelial corneal dystrophy. View this table: View inline View popup Download powerpoint Table 2. Performance of the classification model in various binary tasks on the testing set with and without segmentation of images prior to training. P=Positive predictor, N=Negative predictor, Acc=Accuracy, Sen=Sensitivity, Spec=Specificity, MCC=Matthews correlation coefficient. Discussion This paper introduces CUNEX, the first externally validated DL model for full-thickness segmentation in AS-OCT cross-sectional images. We trained CUNEX using a standardized, data-driven framework (nnU-Net), avoiding manual configuration and investigator bias. CUNEX achieved high segmentation accuracy cross healthy, KC, and FECD groups. We compared CUNEX to two open-source AS-OCT segmentation models, ScLNet and CorneaNet, retrained both on our internal dataset, and tested all three models on a held-out internal validation set as well as an external IK dataset from a different AS-OCT device. We also assessed the impact of segmentation on disease staging and age and sex discrimination by training a CNN classifier with and without CUNEX-generated segmentation masks. ScLNet and CorneaNet are established AS-OCT segmentation models. ScLNet employs multiscale contextual encoding and edge-aware supervision, whereas CorneaNet adopts a variant of the classic U-Net structure. 28 Both were reported to achieve high accuracy (DSC, 99% for both; IoU 98% and 97%,respectively) and were validated on healthy and KC eyes. CorNet, 29 another AS-OCT segmentation model, was excluded from our comparison as it is not open source and thus not reproducible. AS-OCT scans capture multiple interfaces and anatomy in one image, including the cornea, iris, lens, sclera, the eyelid and lashes, making full corneal segmentation complex. Prior studies have trained segmentation models on cropped portions of the image, such as the anterior chamber angle or central cornea. 30 – 32 On the internal validation set, CUNEX performed similarly to ScLNet, with DSC and IoU score differences under 3%, and consistently outperformed CorneaNet across all classes, particularly KC. This may be because CorneaNet was trained on images from a custom-built ultrahigh-resolution spectral-domain OCT (UHR-SD-OCT) system 33 not available for clinical use. 33 This highlights a limitation of generalizability of models developed on single device datasets. CUNEX delivers robust corneal segmentation across heterogenous AS-OCT inputs, such as variation in corneal morphologies, devices, image quality and resolutions, without retraining. On an external dataset of IK images with a different resolution acquired using a different AS-OCT device, 34 CUNEX still produced reliable corneal segmentation, whereas ScLNet and CorneaNet did not. This capability addresses domain shift, a persistent challenge in real-world DL deployment where a model trained on one dataset performs poorly on data from another device. 35 , 36 CUNEX’s data-driven configuration enables it to learn transferable anatomical representations rather than overfitting a specific image input, make it well-suited for multi-center studies and explainable AI. It has not been tested whether integrating segmentation improves DL classification performance for anterior segment diseases. In our experiments, corneal segmentation did not improve classification accuracy, suggesting that the CNN is able to identify the relevant features within the original input image and that predictions were primarily driven by corneal anatomy. However, the sex classification performance decreased significantly when segmentation was applied to the input image, reducing accuracy to near chance levels. This implies that the anatomical features used to infer sex in AS-OCT images may lie outside the cornea. Previous studies using AS-OCT have linked sex differences to corneal shape, anterior chamber conformation, and lens position. 37 Rather than simply a means to potentially boost performance, segmentation may serve as a tool to probe which regions meaningfully influence a given classification task. Ultimately, CUNEX is the only externally validated open-source model for whole corneal segmentation in AS-OCT. It is based on the latest architecture for segmentation, nnU-Net, and is generalizable, which means new users will not have to retrain CUNEX to run inference on their dataset, compared to prior models which are not as easily reproducible. This could support broader AS-OCT research and use in multi-center studies and low-resource settings, where imaging protocols and resolution may vary. Besides classification models, it can be used for a range of additional applications such as biomechanical modelling that relies on precise corneal boundaries and surgical planning tools requiring accurate anatomical mapping. There are some limitations. Both ScLNet and CorneaNet were originally developed for more complex segmentation tasks, including multi-class labeling of individual corneal layers or differentiation of the cornea from scleral lenses. For the purposes of this study, we adapted both models to perform a simplified task—segmenting only the whole cornea—to allow direct comparison with CUNEX. Segmentation also adds complexity, requiring expert annotations and processing time, which must be balanced against potential gains in predictive accuracy. Some studies suggest that when training datasets are large – on the order of thousands of images – and the classification involves easily distinguishable classes, such as healthy vs diseased eyes, CNNs can learn relevant features without requiring segmentation. 38 These factors may explain why segmentation has not been widely adopted as a pre-processing step, but could become increasingly helpful as models evolve towards detecting subtler features, such as those seen in early-stage disease. As experimental adoption of volumetric AS-OCT increases, following trends in MRI imaging, 11 future work could explore 3D segmentation of the full cornea to improve spatial continuity and enable more precise mapping of focal pathology or surgical planning. A 2D model was used in this study to reflect the current standard of AS-OCT research and maximize computational efficiency, but the nnU-Net framework can be readily extended to 3D volumetric data. Moreover, although AS-OCT provides detailed visualization of anterior segment anatomy, its integration into interpretable AI frameworks remains unexplored. In this context, CUNEX lays the groundwork the development of explainable AI tools in clinical practice. Data Availability All data produced in the present study are available upon reasonable request to the authors. https://github.com/lkandakji/CUNEX Model Availability The source code and model weights of CUNEX have been made publicly available at https://github.com/lkandakji/CUNEX/ . Funding LK is funded by Moorfields Eye Charity PhD studentship (GR001147) and an Amazon Web Services Scholarship. NP is funded by the National Institute for Health Research (NIHR) AI Award (AI_AWARD02488). SL is funded by Medical Research Council/Fight for Sight Clinical Research Training Fellowship (MR/X006271/1) Conflict of Interest No relevant conflicts of interest. Legend for Supplemental Digital Content Supplemental Digital Content Figure 1. Title: Representative manually annotated AS-OCT B-scans. Description: Example annotated transverse (A) and sagittal (B) anterior segment optical coherence tomography B-scans, showing manual segmentation of the full-thickness cornea (highlighted in yellow). The cornea is segmented from limbus to limbus, capturing anterior and posterior boundaries while avoiding the sclera. Supplemental Digital Content Table 1. Title: Comparison of segmentation model architectures and configurations. Description: Comparison between standard U-Net, CorneaNet, CorNet, ScLNet, and CUNEX. CUNEX is generalizable to different input sizes and is optimized for AS-OCT images by preserving image resolution, adjusting network depth. Supplemental Digital Content Table 2. Title: Classification CNN architecture parameters. Description: Layer-wise configuration of the CNN used for downstream classification. Supplemental Digital Content Table 3. Title: Inter-grader agreement statistics for manual annotations. Description: Summary statistics of inter-grader segmentation agreement across 98 AS-OCT images. Reported metrics include Dice similarity coefficient (DSC), Intersection over Union (IoU), and Hausdorff distance, as well as the annotated mask area in pixels for each grader (L.K. and R.L.). All values are presented as mean, standard deviation, minimum, and maximum. Supplemental Digital Content Figure 2. Title: CUNEX training performance. Description: CUNEX loss and Dice similarity coefficient (DSC) graph for fold 1, using both Dice loss and cross-entropy loss as the loss function (red and blue curves) and DSC as the accuracy metric (green curves). Loss curves for both models initially demonstrated rapid decreases, indicating rapid early learning, and subsequently stabilized, reflecting incremental model improvements with occasional spikes due to challenging data batches. References 1. ↵ Said OM , Kamal M , Tawfik S , Saif ATS . Comparison of corneal measurements in normal and keratoconus eyes using Anterior Segment Optical Coherence Tomography (AS-OCT) and Pentacam HR topographer . BMC Ophthalmology . 2023 ; 23 ( 1 ): 194 . OpenUrl PubMed 2. ↵ Wang Y , Ning R , Li K , Xu H , Li Y , Yang Y , et al. Repeatability of Epithelium Thickness Measured by an AS-OCT in Different Grades of Keratoconus and Compared to AS-OCT/Placido Topography . American Journal of Ophthalmology . 2024 ; 265 : 213 – 23 . OpenUrl PubMed 3. ↵ Suzuki T , Yamaguchi T , Yagi-Yaguchi Y , Kasamatsu H , Tomida D , Fukui M , et al. Three-Dimensional Assessment of Descemet Membrane Reflectivity by Optical Coherence Tomography in Fuchs Endothelial Corneal Dystrophy . Cornea . 2024 ; 43 ( 2 ): 207 – 13 . OpenUrl PubMed 4. ↵ Ichikawa K , Ono T , Chen L , Kitamoto K , Taketatni Y , Toyono T , et al. Quantitative evaluation of corneal irregularity and scarring after infectious keratitis using anterior segment optical coherence tomography . Graefe’s Archive for Clinical and Experimental Ophthalmology . 2024 ; 262 ( 1 ): 133 – 41 . OpenUrl PubMed 5. ↵ Bodmer NS , Christensen DG , Bachmann LM , Faes L , Sanak F , Iselin K , et al. Deep Learning Models Used in the Diagnostic Workup of Keratoconus: A Systematic Review and Exploratory Meta-Analysis . Cornea . 2024 ; 43 ( 7 ): 916 – 31 . OpenUrl PubMed 6. ↵ Fitoussi L , Zéboulon P , Rizk M , Ghazal W , Rouger H , Saad A , et al. Deep Learning Versus Corneal Tomography Features to Detect Subclinical Corneal Edema in Fuchs Endothelial Corneal Dystrophy . Cornea Open . 2024 ; 3 ( 2 ): e0038 . OpenUrl 7. ↵ Kallel IF , Mahfoudhi O , Kammoun S . Deep learning models based on CNN architecture for early keratoconus detection using corneal topographic maps . Multimedia Tools and Applications . 2024 ; 83 ( 16 ): 49173 – 93 . OpenUrl 8. ↵ Liang W , Tadesse GA , Ho D , Fei-Fei L , Zaharia M , Zhang C , et al. Advances, challenges and opportunities in creating data for trustworthy AI . Nature Machine Intelligence . 2022 ; 4 ( 8 ): 669 – 77 . OpenUrl 9. ↵ Whang SE , Roh Y , Song H , Lee J-G . Data collection and quality challenges in deep learning: a data-centric AI perspective . The VLDB Journal . 2023 ; 32 ( 4 ): 791 – 813 . OpenUrl CrossRef 10. ↵ Nguyen T , Ong J , Masalkhi M , Waisberg E , Zaman N , Sarker P , et al. Artificial intelligence in corneal diseases: A narrative review . Contact Lens and Anterior Eye . 2024 ; 47 ( 6 ): 102284 . OpenUrl PubMed 11. ↵ Sun L , Zhang S , Chen H , Luo L . Brain Tumor Segmentation and Survival Prediction Using Multimodal MRI Scans With Deep Learning . Front Neurosci . 2019 ; 13 : 810 . OpenUrl CrossRef PubMed 12. ↵ Shang Y , Wei Z , Hui H , Li X , Li L , Yu Y , et al. Two-stage hybrid network for segmentation of COVID-19 pneumonia lesions in CT images: a multicenter study . Medical & Biological Engineering & Computing . 2022 ; 60 ( 9 ): 2721 – 36 . OpenUrl PubMed 13. ↵ Vaghjiani D , Saha S , Connan Y , Frost S , Kanagasingam Y , editors. Visualizing and Understanding Inherent Image Features in CNN-based Glaucoma Detection . 2020 Digital Image Computing: Techniques and Applications (DICTA) ; 2020 29 Nov.-2 Dec . 2020 . 14. ↵ Saha S , Vignarajan J , Frost S . A fast and fully automated system for glaucoma detection using color fundus photographs . Sci Rep . 2023 ; 13 ( 1 ): 18408 . OpenUrl CrossRef PubMed 15. ↵ Kaothanthong N , Limwattanayingyong J , Silpa-Archa S , Tadarati M , Amphornphruet A , Singhanetr P , et al. The Classification of Common Macular Diseases Using Deep Learning on Optical Coherence Tomography Images with and without Prior Automated Segmentation . Diagnostics (Basel ). 2023 ; 13 ( 2 ). 16. ↵ Schlegl T , Waldstein SM , Bogunovic H , Endstraßer F , Sadeghipour A , Philip A-M , et al. Fully Automated Detection and Quantification of Macular Fluid in OCT Using Deep Learning . Ophthalmology . 2018 ; 125 ( 4 ): 549 – 58 . OpenUrl CrossRef PubMed 17. ↵ Soh ZD , Tan M , Nongpiur ME , Yu M , Qian C , Tham YC , et al. Deep Learning-based Quantification of Anterior Segment OCT Parameters . Ophthalmol Sci . 2024 ; 4 ( 1 ): 100360 . OpenUrl PubMed 18. Goyanes E , Moura Jd , Fernández-Vigo JI , Fernández-Vigo JA , Novo J , Ortega M . Automatic simultaneous ciliary muscle segmentation and biomarker extraction in AS-OCT images using deep learning-based approaches . Biomedical Signal Processing and Control . 2024 ; 90 : 105851 . OpenUrl 19. ↵ Yang G , Li K , Yao J , Chang S , He C , Lu F , et al. Automatic measurement of anterior chamber angle parameters in AS-OCT images using deep learning . Biomed Opt Express . 2023 ; 14 ( 4 ): 1378 – 92 . OpenUrl PubMed 20. ↵ Fu H , Baskaran M , Xu Y , Lin S , Wong DWK , Liu J , et al. A Deep Learning System for Automated Angle-Closure Detection in Anterior Segment Optical Coherence Tomography Images . American Journal of Ophthalmology . 2019 ; 203 : 37 – 45 . OpenUrl CrossRef PubMed 21. Xu BY , Chiang M , Chaudhary S , Kulkarni S , Pardeshi AA , Varma R . Deep Learning Classifiers for Automated Detection of Gonioscopic Angle Closure Based on Anterior Segment OCT Images . American Journal of Ophthalmology . 2019 ; 208 : 273 – 80 . OpenUrl CrossRef PubMed 22. ↵ Elsawy A , Abdel-Mottaleb M . A Novel Network With Parallel Resolution Encoders for the Diagnosis of Corneal Diseases . IEEE Transactions on Biomedical Engineering . 2021 ; 68 ( 12 ): 3671 – 80 . OpenUrl PubMed 23. ↵ Sun Y , Maimaiti N , Xu P , Jin P , Cai J , Qian G , et al. An AS-OCT image dataset for deep learning-enabled segmentation and 3D reconstruction for keratitis . Scientific Data . 2024 ; 11 ( 1 ): 627 . OpenUrl PubMed 24. ↵ Godefrooij DA , de Wit GA , Uiterwaal CS , Imhof SM , Wisse RPL . Age-specific Incidence and Prevalence of Keratoconus: A Nationwide Registration Study . American Journal of Ophthalmology . 2017 ; 175 : 169 – 72 . OpenUrl PubMed 25. ↵ Aiello F , Gallo Afflitto G , Ceccarelli F , Cesareo M , Nucci C . Global Prevalence of Fuchs Endothelial Corneal Dystrophy (FECD) in Adult Population: A Systematic Review and Meta-Analysis . J Ophthalmol . 2022 ; 2022 : 3091695 . OpenUrl PubMed 26. ↵ Howard AG , Zhu M , Chen B , Kalenichenko D , Wang W , Weyand T , et al. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications . CoRR . 2017 ; abs/1704.04861 . 27. ↵ Chollet F , editor Xception: Deep Learning with Depthwise Separable Convolutions . 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) ; 2017 21-26 July 2017 . 28. ↵ Ronneberger O , Fischer P , Brox T , editors. U -Net: Convolutional Networks for Biomedical Image Segmentation 2015 ; Cham : Springer International Publishing . 29. ↵ Mathai TS , Lathrop KL , Galeotti J , editors. Learning To Segment Corneal Tissue Interfaces In Oct Images . 2019 IEEE 16th International Symposium on Biomedical Imaging (ISBI 2019) ; 2019 8-11 April 2019 . 30. ↵ Heslinga FG , Alberti M , Pluim JPW , Cabrerizo J , Veta M . Quantifying Graft Detachment after Descemet’s Membrane Endothelial Keratoplasty with Deep Convolutional Neural Networks . Transl Vis Sci Technol . 2020 ; 9 ( 2 ): 48 . OpenUrl 31. Zeboulon P , Ghazal W , Gatinel D . Corneal Edema Visualization With Optical Coherence Tomography Using Deep Learning: Proof of Concept . Cornea . 2021 ; 40 ( 10 ): 1267 – 75 . OpenUrl PubMed 32. ↵ Dos Santos VA , Schmetterer L , Stegmann H , Pfister M , Messner A , Schmidinger G , et al. CorneaNet: fast segmentation of cornea OCT scans of healthy and keratoconic eyes using deep learning . Biomed Opt Express . 2019 ; 10 ( 2 ): 622 – 41 . OpenUrl PubMed 33. ↵ Werkmeister RM , Sapeta S , Schmidl D , Garhofer G , Schmidinger G , Aranha Dos Santos V , et al. Ultrahigh-resolution OCT imaging of the human cornea . Biomed Opt Express . 2017 ; 8 ( 2 ): 1221 – 39 . OpenUrl PubMed 34. ↵ Niestrata M , Radia M , Jackson J , Allan B . Global review of publicly available image datasets for the anterior segment of the eye . Journal of Cataract & Refractive Surgery . 2024 ; 50 ( 11 ): 1184 – 90 . OpenUrl PubMed 35. ↵ Wang F , Casalino LP , Khullar D . Deep Learning in Medicine—Promise, Progress, and Challenges . JAMA Internal Medicine . 2019 ; 179 ( 3 ): 293 – 4 . OpenUrl PubMed 36. ↵ Abràmoff MD , Leng T , Ting DSW , Rhee K , Horton MB , Brady CJ , et al. Automated and Computer-Assisted Detection, Classification, and Diagnosis of Diabetic Retinopathy . Telemedicine and e-Health . 2020 ; 26 ( 4 ): 544 – 50 . OpenUrl 37. ↵ Namba H , Maeda N , Tsukamoto M , Utsunomiya H , Kaneko Y , Nishitsuka K , et al. Associations of ocular anterior segment structures with sex and age: the Yamagata study (Funagata) . Japanese Journal of Ophthalmology . 2024 ; 68 ( 6 ): 751 – 63 . OpenUrl PubMed 38. ↵ Elsawy A , Eleiwa T , Chase C , Ozcan E , Tolba M , Feuer W , et al. Multidisease Deep Learning Neural Network for the Diagnosis of Corneal Diseases . American Journal of Ophthalmology . 2021 ; 226 : 252 – 61 . OpenUrl PubMed View the discussion thread. Back to top Previous Next Posted June 20, 2025. Download PDF Data/Code Email Thank you for your interest in spreading the word about medRxiv. NOTE: Your email address is requested solely to identify you as the sender of this article. Your Email * Your Name * Send To * Enter multiple addresses on separate lines or separate them with commas. You are going to email the following An Open-Source Generalizable Deep Learning Framework for Automated Corneal Segmentation in Anterior Segment Optical Coherence Tomography Imaging Message Subject (Your Name) has forwarded a page to you from medRxiv Message Body (Your Name) thought you would like to see this page from the medRxiv website. Your Personal Message CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions. Share An Open-Source Generalizable Deep Learning Framework for Automated Corneal Segmentation in Anterior Segment Optical Coherence Tomography Imaging Lynn Kandakji , Siyin Liu , Shafi Balal , Ismail Moghul , Bruce Allan , Stephen Tuft , Daniel Gore , Nikolas Pontikos medRxiv 2025.06.18.25329856; doi: https://doi.org/10.1101/2025.06.18.25329856 Share This Article: Copy Citation Tools An Open-Source Generalizable Deep Learning Framework for Automated Corneal Segmentation in Anterior Segment Optical Coherence Tomography Imaging Lynn Kandakji , Siyin Liu , Shafi Balal , Ismail Moghul , Bruce Allan , Stephen Tuft , Daniel Gore , Nikolas Pontikos medRxiv 2025.06.18.25329856; doi: https://doi.org/10.1101/2025.06.18.25329856 Citation Manager Formats BibTeX Bookends EasyBib EndNote (tagged) EndNote 8 (xml) Medlars Mendeley Papers RefWorks Tagged Ref Manager RIS Zotero Tweet Widget Facebook Like Google Plus One Subject Area Ophthalmology Subject Areas All Articles Addiction Medicine (568) Allergy and Immunology (863) Anesthesia (300) Cardiovascular Medicine (4435) Dentistry and Oral Medicine (444) Dermatology (382) Emergency Medicine (608) Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1509) Epidemiology (15227) Forensic Medicine (30) Gastroenterology (1124) Genetic and Genomic Medicine (6597) Geriatric Medicine (668) Health Economics (997) Health Informatics (4534) Health Policy (1368) Health Systems and Quality Improvement (1613) Hematology (540) HIV/AIDS (1264) Infectious Diseases (except HIV/AIDS) (15916) Intensive Care and Critical Care Medicine (1103) Medical Education (623) Medical Ethics (146) Nephrology (667) Neurology (6599) Nursing (346) Nutrition (998) Obstetrics and Gynecology (1144) Occupational and Environmental Health (957) Oncology (3332) Ophthalmology (974) Orthopedics (369) Otolaryngology (420) Pain Medicine (436) Palliative Medicine (130) Pathology (663) Pediatrics (1693) Pharmacology and Therapeutics (691) Primary Care Research (711) Psychiatry and Clinical Psychology (5447) Public and Global Health (9230) Radiology and Imaging (2198) Rehabilitation Medicine and Physical Therapy (1370) Respiratory Medicine (1196) Rheumatology (593) Sexual and Reproductive Health (712) Sports Medicine (530) Surgery (712) Toxicology (99) Transplantation (289) Urology (265) (function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'a002887888bd0db4',t:'MTc3OTUyMzI5MA=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-21T05:10:58.409756+00:00
License: CC-BY-4.0