Introduction

PACG is a significant cause of blindness worldwide, exhibiting disparities in prevalence and risk factors among diverse populations and demographics. The global prevalence of PACG ~0.6% among individuals aged 40 and above, with notable regional variations1,2,3. In Asia, PACG prevalence rates are the highest, ranging from 0.75% to 1.19% across various sub-regions, such as China and Japan3,4,5. PACG displays a higher prevalence among women than men, with a female-to-male ratio of ~1.5:1. Furthermore, the prevalence of PACG escalates with advancing age, particularly beyond the age of 501,3,4. Regular screening, particularly for individuals aged 40 and above or those with high-risk factors, holds immense value in the early detection and prevention of severe visual impairment6. Implementing population-based screening for PACG in China would be cost-effective, particularly when combined with primary open-angle glaucoma (POAG) screening. This strategy benefits rural and urban settings, offering significant health advantages and long-term cost savings7,8.

Although elevated intraocular pressure (IOP) constitutes a significant risk factor for glaucoma, vision loss can still occur even with well-controlled IOP, indicating the presence of other contributing factors9,10,11,12. Tonometry alone demonstrates low sensitivity in detecting glaucoma, with studies indicating sensitivities as low as 20% for glaucoma patients and 7% for glaucoma suspects13,14. NACA is a critical anatomical factor in the development of PACG15. Screening for these narrow angles is essential for early detection and intervention, potentially preventing the progression to glaucoma. Gonioscopy currently serves as the reference standard for detecting angle occlusion16. Although this technique provides comprehensive visualization of the anterior chamber angle (ACA) and adjacent structures, its invasiveness and reliance on advanced skill levels restrict its application to specialist ophthalmic settings. Consequently, gonioscopy is unsuitable for large-scale community screening. Several studies seek to evaluate the diagnostic accuracy of various non-contact tests in identifying high-risk individuals for PACG. The tests under assessment include limbal anterior chamber depth (LACD)17, oblique flashlight test18, scanning peripheral anterior chamber depth analyzer (SPAC)19, Scheimpflug photography20, and anterior segment optical coherence tomography (AS-OCT)21. Without deep learning enhancements, these non-contact tests exhibit a low to moderate certainty in identifying individuals at risk for PACG22. However, these methods have some shortcomings in glaucoma screening. They usually require ophthalmic technicians or optometrists who have received standardized training to operate specialized medical equipment or to perform professional evaluations of the collected images. The LACD and oblique flashlight test lack objective quantitative indicators and rely primarily on subjective judgment. Although SPAC, AS-OCT, and Scheimpflug photography can generate quantitative measurements, these ophthalmic devices are often expensive, making large-scale screening economically costly.

In recent years, deep learning technology has significantly advanced the screening and diagnosis of glaucoma, primarily based on images acquired from color fundus cameras, optical coherence tomography (OCT), and standard automated perimeters (SAP). These algorithms focus on detecting anatomical or functional changes in images, such as optic nerve head, retina, and visual field. Mirzania et al. 23 and Thompson et al. 24 systematically assessed the use of deep learning in glaucoma detection, demonstrating that deep learning algorithms achieve performance comparable to or surpass that of human experts. One study developed and evaluated a deep learning model using OCT devices to diagnose early glaucoma by analyzing the thickness of the retinal nerve fiber layer and the ganglion cell complex in the macula, achieving high diagnostic accuracy 25. Another study highlighted the superior performance of geometric deep learning in diagnosing glaucoma from a single OCT scan, especially when less input information is required26. Additionally, a three-dimensional deep learning algorithm was introduced for detecting glaucoma via SD-OCT scans, and its performance was validated across a multi-ethnic real-world dataset with impressive results27. Furthermore, a study proposed a deep learning-based method for anterior chamber angle classification, significantly improving accuracy through a densely connected high-resolution network and hybrid attention modules. This approach achieved 96.2% accuracy, 99.0% specificity, and 96.4% sensitivity when extracting features from anterior segment photos obtained via gonioscopy and slit lamp microscopy28.

This study leverages the anatomical characteristics of PACG, such as a shallow anterior chamber or narrow angles, by using a portable slit lamp and advanced algorithms to screen for NACA.

Results

Performance of the algorithm on the training and internal test dataset

Table 1 presents a statistical summary of demographic and ocular parameters, comparing populations with NACA to those without it. Our analysis indicates that individuals with NACA have significantly shorter axial lengths, shallower anterior chambers, and thicker lenses compared to those who do not have NACA.

Table 1 Statistical summary of demographic and ocular parameters comparing populations with and without NACA

In Dataset-1, the training set comprises 2441 images. Eight biological parameters of the central anterior chamber section were derived from 2174 images. These parameters include the closed area, central anterior chamber area, ratio of central anterior chamber area to limbus area, anterior chamber angle area, central area of the central anterior chamber section, anterior chamber angle, ratio of corneal band length to iris band length, and the difference in lengths between the corneal band and iris band. Figure 1 illustrates the distribution of these parameters between NACA and NON-NACA groups.

Fig. 1: Distribution of eight central anterior chamber parameters between the NACA and non-NACA groups in the Dataset-1 training set.
figure 1

ah Represent Parameters I-VIII, respectively.

The Kolmogorov–Smirnov test indicated that none of these parameters followed a normal distribution, as evidenced by p values <0.01. The Mann–Whitney U test revealed significant reductions in all parameters for NACA compared to NON-NACA (P < 0.01). Detailed information is presented in Table 2.

Table 2 Comparison of central anterior chamber section parameters between NACA and NON-NACA in the training dataset of Dataset-1

Table 3 presents a comprehensive assessment of the diagnostic efficiency of eight distinct central cross-sectional biological parameters of the anterior chamber for NACA using the training dataset of Dataset-1. Corresponding confusion matrices for each parameter are displayed in Fig. 2. The key findings are as follows: (1) In slit lamp images utilizing horizontal light band projection, the success rate for parameter calculation exceeded 95%, whereas in images utilizing vertical light band projection, the success rate was ~80%. (2) Among the eight biological parameters, those directly related to area (i.e., closed area, central anterior chamber section area, anterior chamber angle area, and the central area of the central anterior chamber section) demonstrated the highest diagnostic efficiency, excluding the ratio of central anterior chamber section area to limbus area. The anterior chamber angle parameters were closely followed. In contrast, the parameters indirectly related to area (i.e., the ratio of lengths between the corneal and iris bands and the difference in lengths between the corneal and iris bands) exhibited the lowest diagnostic efficiency. (3) The diagnostic efficiency of slit lamp images with horizontal light band projection is nearly identical, regardless of whether the light is incident from above or below. However, the diagnostic efficiency for vertical light band projection is higher when the light is incident from the temporal side compared to the nasal side. (4) Slit lamp images utilizing horizontal light band projection demonstrated superior diagnostic efficiency compared to those using vertical light band projection. The optimal cutoff value for diagnosis was determined by maximizing the Youden Index. The corresponding optimal cutoff values for each biometric parameter of the central anterior chamber cross-section are presented in the last column of Table 3.

Fig. 2: Confusion matrices of NACA classification in Dataset-1’s training set.
figure 2

The matrices evaluate the performance of eight central anterior chamber parameters under different slit-lamp illumination conditions.

Table 3 Diagnostic efficiency of eight morphological parameters of the central anterior chamber section for NACA using the training dataset of Dataset-1

Table 4 summarizes the evaluation of eight central anterior chamber parameters for NACA classification on Dataset-1’s test set using training-set-optimized cutoff values. Figure 3 presents the corresponding confusion matrices for each parameter. Notably, the parameters demonstrated comparable performance between the test and training datasets.

Fig. 3: Confusion matrices of NACA classification in Dataset-1’s test set.
figure 3

The matrices evaluate the performance of eight central anterior chamber parameters under different slit-lamp illumination conditions.

Table 4 Diagnostic efficiency of eight morphological parameters of the central anterior chamber section for NACA using the test dataset of Dataset-1

Table 5 presents the diagnostic efficiency of the ensemble model for NACA on the test set, using slit lamp images from four different imaging methods. The corresponding confusion matrices are shown in Fig. 4a. The results indicate that slit lamp images with a horizontal light band projected from above achieved the highest sensitivity of 0.90. In contrast, slit lamp images with a vertical light band projected from the temporal side exhibited the highest specificity, reaching 0.95.

Fig. 4: Confusion matrices evaluating the ensemble model’s performance in NACA classification.
figure 4

a On the test set from Dataset-1. b On Dataset-2. c On Dataset-3.

Table 5 Diagnostic efficiency of ensemble model for NACA using the test dataset of Dataset-1 from four distinct orientations

Performance of the algorithm on the external test dataset

The external test sets consist entirely of slit lamp images with horizontal light bands. Testing was conducted on Dataset-2 using the classification thresholds of the eight central cross-sectional biological parameters derived from the training set of Dataset-1. Table 6 summarizes the NACA classification performance of these parameters, with corresponding per-parameter confusion matrices illustrated in Fig. 5. The diagnostic efficiency of each parameter was lower compared to their performance on the test dataset of Dataset-1.

Fig. 5: Confusion matrices of NACA classification in Dataset-2.
figure 5

The matrices evaluate the performance of eight central anterior chamber parameters.

Table 6 Diagnostic efficiency of eight morphological parameters of the central anterior chamber section for NACA using the Dataset-2

Using the same ensemble model, Table 7 presents an analysis of the diagnostic efficiency for NACA on Dataset-2. The corresponding confusion matrices are shown in Fig. 4b. However, the diagnostic efficiency was lower than the performance on the test dataset of Dataset-1.

Table 7 Diagnostic efficiency of ensemble method for NACA using the Dataset-2 from two distinct orientations

Testing was conducted on Dataset-3 using the classification thresholds of the eight central cross-sectional biological parameters derived from the training set of Dataset-1. Table 8 summarizes the NACA classification performance of these parameters, with corresponding per-parameter confusion matrices illustrated in Fig. 6. The findings revealed that compared to the test results on Dataset-2, the sensitivity of these parameters was higher, but the specificity was lower.

Fig. 6: Confusion matrices of NACA classification in Dataset-3.
figure 6

The matrices evaluate the performance of eight central anterior chamber parameters.

Table 8 Diagnostic efficiency of eight morphological parameters of the central anterior chamber section for NACA using the Dataset-3

Applying the identical ensemble model to Dataset-3, Table 9 demonstrates the NACA classification performance, with corresponding confusion matrices presented in Fig. 4c. However, the diagnostic efficiency on Dataset-3 exhibited higher sensitivity and lower specificity than the performance on Dataset-2.

Table 9 Diagnostic efficiency of ensemble method for NACA using the Dataset-3 from two distinct orientations

Discussion

As presented in Table 5, slit lamp imaging with superiorly projected horizontal light bands achieved peak sensitivity (0.90) for detecting NACA, while temporally projected vertical light bands demonstrated optimal specificity (0.95) in the test set of Dataset 1. This performance profile shows comparable screening efficacy to Scheimpflug photography (sensitivity: 0.92; specificity: 0.86) for PACG risk assessment22. However, in the external test sets, sensitivity and specificity exhibited varying degrees of decrease. There are two primary reasons for these observed discrepancies. Firstly, the stability of handheld slit lamp photography was insufficient, particularly in Dataset-3, where a different image collector with limited experience and diverging shooting techniques and habits conducted the data collection at He Eye Specialist Jinzhou Hospital. This collector difference significantly impacted the results and highlighted the need for more equipment stability. Secondly, although the study design specified that photographs should be taken in a semi-dark or dark room, the shooting environment was not strictly controlled. Consequently, images were captured in moderately illuminated, semi-dark, and dark rooms. These variations can affect the state of the anterior chamber angle. They can also lead to significant differences in the pixel value distribution of anterior segment slit lamp images compared to those taken in a dark or semi-dark room, thus impacting the accuracy of light band segmentation. A similar study employs seven dimensions (A–G, as presented in Table 2 of the referenced paper) derived from smartphone-captured slit lamp images to train a Random Forest Regression model for predicting central anterior chamber depth (ACD), with ground truth measurements obtained from ASOCT29. Their results demonstrate a strong positive correlation between predicted and measured ACD values (R² = 0.91 for training data and R² = 0.73 for test data). However, several limitations should be noted: while the study references principles analogous to the Van Herick method for extracting ACD-related dimensions (measured in pixels between image landmarks), the specific landmarks used are not explicitly defined; the approach relies on manual annotation of key anatomical structures without incorporating automated detection models; and the dataset comprises 66 eyes, but the proportion with narrow angles is unspecified, and the study does not assess the method’s efficacy in narrow-angle screening. In contrast, our study adopts a fully automated classification pipeline, eliminating manual intervention and enhancing scalability. Given these fundamental differences in methodology and objectives, a direct comparison of results is not feasible.

Based on the study findings, the following key points can be summarized: 1. The use of slit lamp images with horizontal light band projection for parameter calculation results in a higher success rate. 2. The diagnostic efficiency for NACA remains consistent whether the slit lamp’s light band is projected from above or below the horizontal plane. 3. Slit lamp images captured with horizontal light band projection exhibited higher sensitivity, whereas those obtained with vertical light band projection demonstrated greater specificity. From the training dataset comprising 2174 successfully analyzed images, we categorized the samples into two groups based on illumination direction: the horizontal light band group (n = 1371) and the vertical light band group (n = 803). Quantitative analysis revealed a statistically significant difference in anterior chamber area measurements between groups (p < 0.01). The horizontal light band group exhibited larger dimensions (220,976.50 ± 48,329.66) than the vertical light band group (202,297.76 ± 50,129.76). Diagnostic performance analysis indicated that horizontal light band imaging was associated with a higher false-positive rate, whereas vertical light band projection tended to produce more false-negative results.

In this study, we developed eight central anterior chamber section parameters: closed area, central anterior chamber section area, the ratio of central anterior chamber section area to limbus area, anterior chamber angle area, central area of the central anterior chamber section, anterior chamber angle, the ratio of corneal band length to iris band length, and the length difference between the corneal and iris bands. The design of these parameters corresponds to the anatomical characteristics of PACG, typically marked by a shallow anterior chamber or narrow anterior chamber angle. The central anterior chamber section area and its ratio to the limbus area indicate the size of the entire section. The central anterior chamber section’s closed area and central area reflect the central region’s size. In contrast, the anterior chamber angle area represents the size of the peripheral region. The ratio of corneal band length to iris band length and their length difference indirectly suggests the size of the central anterior chamber section area. The corneal and iris light bands create an arc-shaped region, with the corneal light band approximating an arc and the iris light bands approximating chords. The arc’s length exceeds that of the chords. The closer the arc-to-chord length ratio is to 1, the smaller the difference between the arc and chord lengths, the smaller the central anterior chamber section area. The anterior chamber angle parameters, measuring the angle between the iris and corneal beams, directly reflect the angle’s width. In our study, we used ocular biometric instruments to measure and record anterior chamber-related parameters, including axial length, anterior chamber depth, and lens thickness, in most subjects. Table 1 illustrates that populations with NACA exhibit significantly shorter axial lengths, shallower anterior chambers, and thicker lenses compared to those without NACA. This result indicates that designing these eight anterior chamber biological parameters for screening NACA based on the anatomical features of PACG is reasonable.

This section will provide detailed explanations of the algorithm used in this study. Firstly, the limbal area is calculated by determining the maximum diameter based on the segmented image of the limbus. The limbal area is then estimated using the formula for the area of a circle, approximating the limbus as a circle. This approach is necessary due to the frequent occlusion of the upper and lower limbus by the eyelids, making strict segmentation challenging. This methodology ensured stability when calculating the anterior chamber area to limbal area ratio parameter. Secondly, compression is applied to the corneal and iris beams before calculating the anterior chamber’s central cross-sectional biological parameters. Theoretically, the difference between the corneal and iris beams already reflects the size of the anterior chamber area. However, the corneal and iris beams are compressed due to potential deviations in the light incident angle during photography, and the anterior chamber angles on both sides are fitted accordingly. This step addresses the instability of the slit lamp light angle during image acquisition. Deviations in the incident angle can result in overlap between the corneal and iris beams, leading to more minor measurement outcomes if the central cross-section of the anterior chamber is used without compression. Thirdly, fitting the anterior chamber angles on both sides represents a technical challenge in this study. The corneal curvature is calculated using the central part of the corneal beam, as the central 4 mm diameter circular area near the pupil is approximately spherical with a consistent radius of curvature. This curvature is then used to fit the extension lines of the corneal beam on both sides, gradually decreasing as we move away from the corneal center. The fitting of the iris beam extension lines on both sides is also achieved using a similar method, with a lesser degree of curvature decay compared to the cornea. Fourthly, using slit lamp images with horizontal light band projection for parameter calculation results in a higher success rate than using vertical light band projection. When using vertical light band projection to obtain anterior segment slit lamp images, the lengths of the corneal and iris light bands can be affected by the eyelids. Our algorithm employs three segmented light bands to compute the complete central cross-section of the anterior chamber, from which we derive eight morphological parameters. Suppose the eyelid obscures most of the light bands, especially the iris. In that case, there are insufficient effective pixels to accurately compute the central cross-section, ultimately leading to failure in calculating the eight parameters. However, with horizontal light band illumination for capturing anterior segment slit-lamp photographs, the likelihood of this issue is significantly reduced. Fifthly, we utilized the Scheie classification to evaluate the status of the anterior chamber angle. A narrow anterior chamber angle is defined as one in which 90° or more of the angle is graded as either III or IV, a criterion more inclusive than the ISGEO system. For instance, if a subject’s eye exhibits ~135° of the angle without visible posterior trabecular meshwork under static gonioscopy, it would be classified as Category 0 according to the ISGEO classification. In contrast, this eye would be classified as Category 1 under our study’s criteria. The ISGEO classification standard may inadvertently overlook individuals who are genuinely at risk of developing glaucoma. Aligned with our research objectives, we evaluated the pros and cons. We prioritized minimizing missed diagnoses (false negatives), even if this necessitates accepting a certain number of misdiagnoses (false positives). Consequently, we established the slit-lamp image classification criteria used in this study.

The future improvement plans for this study encompass several aspects: Firstly, enhance the stability of handheld slit lamp photography by designing a specialized eye mask in future research. The eye mask serves as a support to maintain a consistent distance between the slit lamp lens and the corneal center, ensuring a constant projection angle and central alignment of the slit light, either horizontally or vertically. Additionally, the eye mask provides a stable dark environment for capturing slit lamp photographs. Secondly, improve the accuracy of light band segmentation in slit lamp images. Precise segmentation directly affects the fitting of the central anterior chamber section and the calculation of morphological parameters. Enhancing the accuracy of slit lamp light band segmentation can be achieved by expanding the training dataset or exploring new segmentation models. Lastly, the algorithm for anterior chamber angle fitting should be enhanced. The current algorithm employs a relatively simple curvature decay method to extend the corneal and iris light bands to fit bilateral anterior chamber angles. Future research can incorporate ultrasound biomicroscopy (UBM) and AS-OCT to investigate the curvature changes of the cornea and iris, thereby optimizing the anterior chamber angle fitting algorithm. This will contribute to improving the accuracy of subsequent morphological parameter calculations.

This study assessed the feasibility of using a portable slit lamp, combined with advanced algorithms, to determine NACA from anterior segment images. The results indicate that the model’s generalizability has not yet met expectations. Nonetheless, the findings highlight its potential for screening at risk of PACG, especially with improvements in portable slit lamp performance, auxiliary support equipment, and further algorithm optimization.

Methods

Study approval

The study adhered strictly to the principles of the Declaration of Helsinki. The Institutional Review Board (IRB2023.K003.01) of He Eye Specialist Hospital approved the protocol. All participants gave informed consent, allowing the publication of all images, clinical data, and associated information in this manuscript.

Study design

The study employed a dual-center, single-masked, cross-sectional design. Figure 7 shows the experimental workflow. To ensure the reliability of the anterior segment slit lamp image, the researchers implemented the exclusion criteria outlined, which include the following: uncertain anterior chamber angle status; inadequate exposure of the ocular surface (e.g., ptosis); the presence of ocular conditions hindering precise corneal or iris imaging (e.g., severe corneal opacity, iris absence); history of ocular surgery within the past year (e.g., glaucoma surgery, cataract surgery); history of laser procedures (e.g., iridoplasty, laser peripheral iridotomy, laser refractive surgeries); use of medications that may impact ocular status (e.g., steroids, anti-glaucoma drugs); acute ocular inflammation or infection (e.g., keratitis, conjunctivitis); inability to cooperate during slit lamp examination effectively; and withdrawal from the study before completion. Several factors may hinder the successful computation of morphological parameters in the central anterior chamber section. The primary challenges include: (1) Eyelid obstruction of the corneal or iris beams is the most common issue, as it can render them too short for accurate curvature measurement, impeding the anterior chamber angle fitting. (2) Incomplete or discontinuous corneal or iris beams can prevent obtaining a closed central anterior chamber section. (3) Inaccurate segmentation of the corneal or iris beams occasionally leads to ineffective intersection along the curvature direction, obstructing the formation of the anterior chamber angle. The process advances to the NACA discrimination stage only when all eight morphological parameters of the central anterior chamber section are successfully computed.

Fig. 7: Experimental workflow.
figure 7

Red arrows denote the algorithm training process, where “Cutoff” signifies the classification threshold derived from training. Yellow arrows represent the algorithm testing process, using the trained cutoff to evaluate each dataset. The red rounded rectangle indicates the exclusion criteria. The gray rounded rectangle indicates the reasons for algorithm failure. Detailed descriptions are provided in the Methods section.

This study collected three datasets. Dataset-1 was used for algorithm training and testing, while Datasets-2 and Dataset-3 were used for external algorithm validation. Dataset-1 was sourced from the ophthalmology outpatient department of He Eye Specialist Shenyang Hospital, with data collected from May to August 2023. It included 607 subjects, with an average age of 69.46 years (±9.67) and an age range of 32 to 98 years. Among these subjects were 246 males and 361 females, resulting in the collection of 1021 eyes (505 right eyes and 516 left eyes), totaling 3079 images. Based on exclusion criteria, 138 eyes (412 images) were excluded, leaving 2667 images in the study, divided into a training set of 2411 images and a testing set of 256 images.

Dataset-2 was sourced from the ophthalmology outpatient department of He Eye Specialist Shenyang Hospital, with data collected from September to December 2023. This dataset was used for external algorithm validation and included 665 subjects, with an average age of 69.90 years (±9.05) and an age range of 32 to 95 years. It comprised 630 right and 633 left eyes, totaling 2526 anterior segment slit lamp images.

Dataset-3 was obtained from the ophthalmology outpatient department at He Eye Specialist Jinzhou Hospital, with data collected from September to December 2023. It was also used for external algorithm validation and included 200 subjects, with an average age of 68.32 years (±9.86) and an age range of 17–89 years. This dataset comprised 174 right and 175 left eyes, totaling 698 anterior segment slit lamp images.

Portable slit lamp examination

The portable slit lamp (ISPECTOR MINI HE 010-21, eyerobo, Shenyang, China) used in this study is compact, lightweight, and user-friendly, as shown in Fig. 8. This device provides 10× magnification, weighs only 100 g, and has a working distance of 40 mm. It features a slit length of over 8 mm, a slit width of no more than 0.2 mm, and a slit illumination angle of 30°. Powered by a 3.7 V lithium battery with an 850 mAh capacity, it can operate continuously for over 2 h. The device measures 126 mm in length, 53 mm in width, and 31 mm in height, allowing for high-quality anterior segment image capture.

Fig. 8: Portable slit lamp.
figure 8

The image shows the compact design and key features of the portable slit lamp used in the study.

In this study, we utilized the Honor 6-H60-L02 smartphone (Huawei, China) for image acquisition, specifically the rear camera. The smartphone’s optical properties include a 13-megapixel resolution and an aperture size of f/2.0, enhancing its ability to capture clear images in low-light conditions. Additionally, the rear camera supports 720p video recording at 30 frames per second. The device employs a fourth-generation backside-illuminated (BSI) CMOS sensor with a dual LED flash.

In our study, we adhered to a standardized protocol for image acquisition. Patients were seated and allowed to rest for three minutes before images were captured. The smartphone’s rear camera was aligned with and attached to the lens of the portable slit lamp. The capture sequence involved both vertical and horizontal light bands: for vertical bands, images were taken from the temporal and nasal sides of the right and left eyes; for horizontal bands, images were taken from the upper and lower sides of the right and left eyes. The portable slit lamp was held parallel to the line connecting both eyes, with the midpoint of the lens positioned 4 cm from the corneal center, using the pinky, ring, and middle fingers for support. Images were captured with the slit light centered on the pupil. The portable slit lamp used in the study had fixed optical parameters, and the smartphone camera was set to default parameters to ensure consistent image quality.

In this study, Dataset-1 and Dataset-2 were collected by a trained photographer, while a different photographer collected Dataset-3. Each eye was photographed four times, as shown in Fig. 9. The yellow arrow in Fig. 9a indicates the light band formed by the slit lamp on the cornea, and the blue arrow indicates the light band on the iris. These light bands delineate the cross-section of the central anterior chamber, which forms the basis for calculating the morphological parameters of the anterior chamber. However, due to specific ocular conditions in some subjects, only vertical or horizontal light band photography could be conducted. For example, ptosis prevented the capture of the upper corneal or iris band in the vertical meridian, resulting in only horizontal band images. Each photograph was saved in JPG format, with dimensions of 4160 × 3120 pixels or 3120 × 4160 pixels and a resolution of 72 dpi.

Fig. 9: Anterior segment slit lamp photos captured for one eye.
figure 9

The yellow arrow indicates the light band on the cornea, and the blue arrow indicates the light band on the iris. a Horizontal lower incident light band. b Vertical nasal incident light band. c Horizontal upper incident light band. d Vertical temporal incident light band.

Gonioscopy and classification of anterior segment slit lamp images

The anterior chamber angle of both eyes was independently examined by two glaucoma specialists using a Volk three-mirror gonioscope and a slit lamp. The angle was evaluated utilizing the Scheie grading system. The Scheie system assigns grades from “Wide” to “IV” for the angle classification. A “Wide” grade indicates an open angle where all structures are visible, while a “IV” grade implies a closed angle with no visible structures. Grade I indicates a slightly narrowed angle where the ciliary body is visible, but the last roll of the iris obscures the recess. Grade II signifies that the apex is not visible, along with the non-visibility of the ciliary body. Grade III implies that the posterior half of the trabecular meshwork, the ciliary body, and the scleral spur are not visible. Lastly, Grade IV indicates the non-visibility of any angle structures, including the ciliary body, scleral spur, and trabecular meshwork. For eyes with an anterior chamber angle where 90° or more of the angle is graded as III or IV, slit lamp images are classified as Category 1, indicating NACA. Conversely, slit lamp images are categorized as Category 0, signifying NON-NACA. In cases where the two ophthalmologists disagreed, a re-examination was conducted. If consensus remained unattainable, the eye was excluded from the dataset.

Ophthalmological examination

All subjects underwent a standard ophthalmic examination, although it is noted that some patients may have missed one or more of the following tests. Visual acuity was assessed using a standard logarithmic visual acuity chart. Refractive errors were determined utilizing an automatic kerato-refractometer (KR-8100, Topcon, Japan). Intraocular pressure was measured using a non-contact tonometer (CT-800, Topcon, Tokyo, Japan). Fundus examination was conducted using a 45° non-mydriatic digital camera (TRC-NW300, Topcon, Japan). Ocular biometric parameters were measured using an optical biometer (IOL Master 700, Zeiss, Germany).

Algorithm workflow

As illustrated in Fig. 10, the algorithm consists of four steps: image preprocessing, corneal band and iris band segmentation, fitting the central anterior chamber section, and calculating anterior chamber biological parameters.

Fig. 10: Calculation process of central anterior chamber morphological parameters from slit lamp images.
figure 10

a Original anterior segment image at 4160 × 3120 pixels. b Preprocessed image with effective FOV at 2048 × 2048 pixels. c Segmented corneal and iris light band. d Fitted central cross-section of the anterior chamber. el Correspond to Parameters I–VIII, respectively.

Image preprocessing consists of three steps. First, a deep learning model is trained to recognize the limbus, and this pre-trained model is subsequently utilized to obtain the boundary coordinates of the corneal limbus. Second, to construct the bounding rectangle of the limbus, the longer side is designated as the diameter of an approximate circle representing the limbus, thereby treating the limbus as a circular shape. The area of this approximate circle, determined by its diameter, is defined as the area of the corneal limbus and is utilized for subsequent calculations of relative morphological parameters in the central section of the anterior chamber. Lastly, the original image is cropped to 2048 × 2048 pixels, centering on the limbus. The pre-trained model details are as follows: Limbus segmentation annotation for anterior segment photographs was conducted using the Labelme tool, ensuring that annotation points accurately align with the limbus, maintain smoothness and density, and adhere to the eyelid edge when obscured. One thousand three anterior segment photographs were annotated, with 902 for training and 101 for testing. The model utilizes UNet30 as its backbone, PSPNet31 as the head, and FCN32 as an auxiliary head, with an input size of 1024 × 1024. A cross-entropy loss function and an SGD33 optimizer with an initial learning rate of 0.001 following a poly decay strategy were employed. The batch size was set to 4, and the model was iterated 20,000 times. On the test set, the Dice coefficient for the background was 0.994, with an accuracy of 0.995, while for the limbus area, the Dice coefficient was 0.949, with an accuracy of 0.939. This preprocessing maximizes the retention of the anterior chamber region while removing potential interferences (Fig. 10b).

For the segmentation of the corneal band and iris band, a three-class semantic segmentation model is trained to classify the background, corneal band, and iris band (Fig. 10c). The Labelme tool was utilized for the segmentation annotation of the corneal light band and iris light band in anterior segment photographs. The annotation guidelines involved separately annotating the corneal limbus light band and the iris light band, ensuring annotation points accurately fall on the edges of the light bands, and maintaining smooth and dense point distribution. Three thousand seventy-nine anterior segment photographs were annotated, with 2771 images used for model training and 308 for model testing. A subset of annotated images of corneal and iris light bands is presented in Supplementary Fig. 1. The model employs UNet30 as the backbone, PSPNet31 as the head, and FCN32 as the auxiliary head, with an input size of 1024 × 1024. The loss function is cross-entropy, and the optimizer is SGD33 with an initial learning rate of 0.001. The learning rate decay follows a poly strategy. The batch size is set to 4, and the model was trained for 20,000 iterations. On the test set, the Dice coefficient for the background is 0.995, with an accuracy of 0.992. For the corneal light band, the Dice coefficient is 0.900, with an accuracy of 0.953. For the iris light band, the Dice coefficient is 0.882, with an accuracy of 0.957.

The process of fitting the central anterior chamber section comprises three primary steps: firstly, the corneal and iris bands are compressed; secondly, the two iris bands are interconnected; lastly, gradient information from the corneal and iris bands is employed to fit the anterior chamber angles on both sides, thereby generating the closed section of the central anterior chamber (Fig. 10d). In the test set images of Dataset-1, the fitted lines of the central anterior chamber section are drawn on the original images, as shown in Supplementary Fig. 2.

This study focuses on fitting eight biological parameters of the central anterior chamber section. The closed area (Fig. 10e) refers to the number of pixels within the closed region formed by sequentially connecting the segmented corneal light band and two iris light bands, and it is not affected by the fitting step of the central anterior chamber section. The central anterior chamber section area (Fig. 10f) is the number of pixels within the fitted central anterior chamber section. The ratio of central anterior chamber section area to limbus area (Fig. 10g) is the ratio of the central anterior chamber section area to the limbus area. The anterior chamber angle area (Fig. 10h) is the average number of pixels in the angle regions on both sides of the central anterior chamber section, divided into five equal parts along its long axis. The central area of the central anterior chamber section (Fig. 10i) is the total number of pixels in the middle three parts when the central anterior chamber section is divided into five equal parts along its long axis. The anterior chamber angle (Fig. 10j) is the average angle in degrees of the fitted central anterior chamber section on both sides. The ratio of lengths of the corneal band to the iris band (Fig. 10k) is the ratio of the length of the line on the cornea to the length of the line on the iris in the fitted central anterior chamber section. Lastly, the difference in lengths between the corneal band and iris band (Fig. 10l) is the difference in length between the line on the cornea and the line on the iris in the fitted central anterior chamber section.

Based on the voting concept, a simple ensemble model was devised to integrate the eight biological parameters of the central anterior chamber cross-section. A case is classified as Category 1 if at least four of the eight parameters exceed their respective thresholds.

Statistics

The data were analyzed using SPSS version 27. Descriptive statistics for continuous variables were presented as mean ± SD. The normality of these variables was assessed using the Kolmogorov-Smirnov test. For variables following a normal distribution, group comparisons were conducted with an independent samples two-sided t-test; for non-normal distributions, the two-sided Mann–Whitney U test was employed. Binary variables were reported as the percentage of Category 1, and group differences were analyzed with the chi-square test. Diagnostic performance was evaluated by calculating accuracy, sensitivity, specificity, F1 score, and the area under the receiver operating characteristic (ROC) curve (AUC).