Skip to main content

Keypoint localization and parameter measurement in ultrasound biomicroscopy anterior segment images based on deep learning

Abstract

Background

Accurate measurement of anterior segment parameters is crucial for diagnosing and managing ophthalmic conditions, such as glaucoma, cataracts, and refractive errors. However, traditional clinical measurement methods are often time-consuming, labor-intensive, and susceptible to inaccuracies. With the growing potential of artificial intelligence in ophthalmic diagnostics, this study aims to develop and evaluate a deep learning model capable of automatically extracting key points and precisely measuring multiple clinically significant anterior segment parameters from ultrasound biomicroscopy (UBM) images. These parameters include central corneal thickness (CCT), anterior chamber depth (ACD), pupil diameter (PD), angle-to-angle distance (ATA), sulcus-to-sulcus distance (STS), lens thickness (LT), and crystalline lens rise (CLR).

Methods

A data set of 716 UBM anterior segment images was collected from Tianjin Medical University Eye Hospital. YOLOv8 was utilized to segment four key anatomical structures: cornea–sclera, anterior chamber, pupil, and iris–ciliary body—thereby enhancing the accuracy of keypoint localization. Only images with intact posterior capsule lentis were selected to create an effective data set for parameter measurement. Ten keypoints were localized across the data set, allowing the calculation of seven essential parameters. Control experiments were conducted to evaluate the impact of segmentation on measurement accuracy, with model predictions compared against clinical gold standards.

Results

The segmentation model achieved a mean IoU of 0.8836 and mPA of 0.9795. Following segmentation, the binary classification model attained an mAP of 0.9719, with a precision of 0.9260 and a recall of 0.9615. Keypoint localization exhibited a Euclidean distance error of 58.73 ± 63.04 μm, improving from the pre-segmentation error of 71.57 ± 67.36 μm. Localization mAP was 0.9826, with a precision of 0.9699, a recall of 0.9642 and an FPS of 32.64. In addition, parameter error analysis and Bland–Altman plots demonstrated improved agreement with clinical gold standards after segmentation.

Conclusions

This deep learning approach for UBM image segmentation, keypoint localization, and parameter measurement is feasible, enhancing clinical diagnostic efficiency for anterior segment parameters.

Introduction

The anterior segment of the eye comprises the front part of the eyeball, including the cornea, anterior chamber, iris, pupil, lens, and anterior chamber angle (ACA). Accurate localization of keypoints and precise measurement of anterior segment parameters are crucial for assessing ocular health, with significant clinical implications for diagnosing and treating eye diseases, such as glaucoma, cataracts, and refractive errors [1].

Studies have shown that patients with glaucoma often present with elevated intraocular pressure (IOP), shallow anterior chambers, shorter axial lengths, thickened or anteriorly displaced lenses, and smaller corneal diameters and curvatures [2, 3]. Incorporating precise anterior segment parameters into individualized treatment plans can significantly improve glaucoma management. Phacoemulsification remains the safest and most effective method for cataract treatment, with research indicating that postoperative outcomes include reduced IOP and increased anterior chamber depth (ACD), anterior chamber volume (ACV), and ATA [4, 5]. Accurate measurements of anterior segment parameters, such as keratometry curvature (KC), ACD, and axial length (AL), are essential for selecting appropriate surgical techniques and intraocular lenses [6]. Moreover, successful implantation of intraocular contact lenses (ICL) for high refractive error correction relies on precise anterior segment parameters of ATA, ACD, AL, and vault height [7, 8].

Anterior segment imaging is commonly performed using anterior segment-optical coherence tomography (AS-OCT) and ultrasound biomicroscopy (UBM). AS-OCT utilizes optical coherence interferometry to generate high-resolution (10–20 μm), non-invasive cross-sectional images. However, AS-OCT cannot visualize structures such as the posterior chamber, ciliary body, and suspensory ligament due to the inability of light to penetrate the iris pigment epithelium [9, 10]. In contrast, UBM utilizes high-frequency ultrasound (50–100 MHz), offering higher resolution than B-mode ultrasound but lower than AS-OCT. Despite being a contact imaging technique, UBM enables visualization of structures posterior to the iris, providing more comprehensive anatomical information [11]. Given these advantages, this study employed UBM for anterior segment imaging and parameter measurement.

With the rapid advancement of artificial intelligence and the expansion of large-scale medical data sets, deep learning algorithms are increasingly being applied in disease screening, diagnosis, and detection. Ophthalmic imaging, which relies heavily on auxiliary diagnostic tools, has particularly benefited from these advancements [12, 13]. For instance, Da Soh et al. developed and validated a deep learning model utilizing CycleGAN and U-NET algorithms to automatically label the scleral spur (SS) and segment the anterior chamber (AC) in AS-OCT images. This approach enabled rapid and accurate measurement of ACD and anterior chamber angle opening (ACA Opening), reducing human subjectivity [14]. Jiang et al. proposed a deep learning model using U-NET + + for ACA tissue segmentation, combined with support vector machine and logistic regression algorithms for classifying iris curvature, iris root insertion, and angle closure. Their SS localization and ACA parameter measurement algorithm demonstrated strong consistency with the gold standard [15]. Fu et al. analyzed the anatomical features of AC structures in patients suspected of primary angle closure suspect (PACS) and developed an AI-assisted diagnostic system using classification and regression trees, random forests, VGG-16, and AlexNet, with results validating its reliability [16]. Ren et al. designed and evaluated a deep learning system (PM-AI) for screening pathologic myopia (PM) and myopic choroidal neovascularization (mCNV) based on 1156 color fundus photographs, demonstrating high diagnostic performance and reducing the workload of ophthalmologists [17]. In summary, deep learning has shown great promise in ophthalmology, significantly enhancing intelligent diagnostics and disease screening. As AI-driven techniques continue to evolve, their role in ophthalmic disease detection and diagnosis is expected to expand further [18].

The diagnosis and treatment of anterior segment diseases rely heavily on imaging-based measurements [19]. Currently, clinical assessments primarily involve manual annotation of anatomical structures or the use of physical measurement devices such as Orbscan, IOL-Master, Pentacam, A-scan, AS-OCT, and UBM to obtain anterior segment parameters [20]. While widely employed, these methods have notable limitations. First, traditional devices require a high level of expertise, leading to inter-operator variability that affects measurement precision and consistency. Second, manual annotation and measurement processes are time-consuming and prone to human error, thereby reducing efficiency. In addition, the resolution and measurement accuracy of some traditional devices are constrained by hardware limitations, making high-precision assessments challenging. In contrast, deep learning methods offer significant advantages in anterior segment parameter measurement. They enable automated image processing, enhancing efficiency while minimizing human error. Deep learning models demonstrate high consistency and stability when analyzing large datasets, ensuring reliable and accurate results. Moreover, as data sets expand and models are further optimized, measurement precision and robustness will improve, reducing reliance on operator experience. However, research on comprehensive anterior segment parameter measurement using deep learning remains limited, highlighting the need for further investigation to enhance accuracy and completeness.

According to the actual requirements of the above analysis, this study employed deep learning technology using the YOLOv8 model for semantic segmentation of clinically collected UBM images. The segmentation targeted key anterior segment structures, including the cornea–sclera, anterior chamber, pupil, and iris–ciliary body. Subsequently, the UBM data were classified to exclude clinically insignificant data. Following segmentation, the YOLOv8 object detection algorithm was utilized for keypoint localization, identifying anatomical keypoints, such as the central corneal epithelium, central corneal endothelium, posterior capsule lentis, left and right anterior chamber angles, left and right ciliary grooves, the midpoint of the anterior lens capsule, and the left and right edges of the pupil. Based on these keypoints, the study computed anterior segment parameters, including CCT, ACD, PD, ATA, STS, LT, and CLR. Each of these parameters holds clinical significance: CCT is closely associated with IOP variations and primary angle-closure glaucoma (PACG) progression; ACD measurement aids in PACG prevention and intraocular lens (IOL) placement; PD assists in cataract surgery planning; and ATA, STS, and CLR are essential for selecting IOLs in ICL surgery. In addition, LT serves as a crucial indicator for detecting conditions, such as glaucoma and cataracts [21,22,23,24].

This study aims to develop an accurate and efficient method for the automatic localization and measurement of multiple anterior segment parameters using UBM images. By simplifying the clinical measurement process and detecting a comprehensive set of relevant parameters, this approach can support clinical diagnosis and improve workflow efficiency. The feasibility of the proposed keypoint localization and parameter measurement method was validated through a comparison of the automated detection results with the gold standard provided by clinicians.

Methods

Data sets

The data sets utilized in this study were sourced from myopic patients who underwent panoramic UBM examinations at Tianjin Medical University Eye Hospital between April 11, 2019, and September 18, 2020, in preparation for ICL surgery. Images were acquired using the MD-300L device (MEDA Co., Ltd., Tianjin, China) with a 50 MHz ultrasound probe, a scanning depth of 11 mm, and a width of 17.5 mm. Each image, with a resolution of 1024 × 576, captured detailed structures of the cornea, sclera, iris, pupil, anterior chamber, ciliary body, and lens. Experienced ophthalmologists performed the imaging, while another trained ophthalmologist annotated the images using Labelme (Massachusetts Institute of Technology, Cambridge, MA, USA) under de-identified conditions. The annotations were subsequently reviewed by a senior ophthalmologist to ensure accuracy and consistency. Ultimately, 716 high-quality panoramic UBM images meeting clinical criteria were included for analysis. To protect patient privacy, all images were anonymized. This study adhered to the principles of the Declaration of Helsinki by the World Medical Association and was approved by the Medical Ethics Committee of Tianjin Medical University Eye Hospital (2023KY-05). As a retrospective study utilizing anonymized data, informed consent was not required.

The annotation of UBM images was divided into three steps:

Segmentation: A random selection of 200 UBM anterior segment images was selected and manually segmented using Labelme software by an experienced ophthalmologist. Four anatomical structures were annotated: cornea–sclera, anterior chamber, iris–ciliary body, and pupil. Given the indistinct boundaries between the cornea and sclera, as well as the iris and ciliary body in UBM images, and considering that precise separation was not essential for keypoint localization, the cornea and sclera were combined into a single class, as were the iris and ciliary body. The annotated data set was divided into training and validation sets at an 8:2 ratio. Upon completion of model training, segmentation was performed on the remaining 516 images. The resulting segmented outputs were subsequently utilized in the binary classification task.

Classification: Since the posterior capsule lentis is only visible when the ultrasound beam is nearly perpendicular to the imaging plane, its presence indicates that the scanning plane is aligned close to the midline of the lens and eyeball. Therefore, only images displaying the posterior capsule were considered valid for further analysis.

From the 516 images obtained from the segmentation model inference, 200 images were randomly selected and manually annotated by ophthalmologists to indicate the presence or absence of the posterior capsule. These annotated images were divided into training and validation sets at an 8:2 ratio to develop a binary classification model for detecting the posterior capsule. Once trained, the model was applied to the remaining 316 unannotated images to automatically identify valid images containing the posterior capsule.

In the control group, which did not undergo segmentation, the same set of 200 images used in the experimental group of binary classification task was selected. These images were similarly divided into training and validation sets at an 8:2 ratio and used to train a separate binary classification model. Since this group did not include segmentation, the trained model was directly applied to the remaining 516 unsegmented images to identify valid samples.

Finally, the valid images identified by both the experimental and control groups were compared, and their intersection—comprising the same images recognized as valid with or without segmentation—was used as the final data set for the subsequent keypoint localization task.

Keypoint Localization: A total of 182 valid intersecting images were identified through the binary classification task. An experienced ophthalmologist then annotated the coordinates of ten key anatomical points, which served as the ground truth for the keypoint localization task. These keypoints included the central corneal epithelium, central corneal endothelium, posterior capsule lentis, left and right anterior chamber angles, left and right ciliary grooves, midpoint of the anterior lens capsule, and the left and right edges of the pupil. Subsequently, fivefold cross-validation was performed on the selected data set, which comprised 182 segmented images (experimental group) and their corresponding 182 unsegmented original images (control group). In each fold, the data were randomly divided into training, validation, and test sets in a 6:2:2 ratio. A YOLOv8s-based keypoint localization model was trained on each training set and evaluated on its respective test set. Upon completion of all five folds, keypoint localization results were generated for all 182 images in both groups. Based on the predicted coordinates, seven anterior segment anatomical parameters were calculated for further analysis and comparative evaluation.

Model

To enhance adaptability in hardware-constrained environments, this study employed YOLOv8 as the deep learning model to simultaneously perform segmentation, classification, and localization tasks. The goal was to achieve efficient and accurate real-time inference while minimizing hardware demands, paving the way for future integration of multi-task learning. The YOLOv8 framework offers advantages, such as low hardware demands, a shared feature extraction network, unified optimization through a joint loss function, and a flexible multi-output design. These features enable seamless handling of segmentation, classification, and localization tasks within a single model. Released by the Ultralytics team in 2023, YOLOv8 follows the YOLO (You Only Look Once) paradigm and consists of three key components: the backbone, the neck, and the YOLO head. It adopts the CSPNet (Cross Stage Partial Network) architecture, which enhances feature learning while maintaining the real-time performance and high efficiency characteristic of the YOLO series [25, 26].

In this study, the YOLOv8s-seg semantic segmentation model was first utilized to segment four anatomical structures—cornea–sclera, anterior chamber, iris–ciliary body, and pupil. Subsequently, the YOLOv8s object detection model was employed to perform binary classification by identifying the presence of the posterior capsule lentis, ensuring that only clinically meaningful images containing this structure were retained for further analysis. Following this filtering step, the YOLOv8s model was again used to localize ten predefined anatomical keypoints. Based on these localization results, seven critical anterior segment parameters—CCT, ACD, PD, ATA, STS, LT, and CLR—were subsequently calculated.

Experimental procedure

The overall experimental workflow is illustrated in Fig. 1. To accommodate the unique positional characteristics of key points in UBM images, specific segmentation strategies were implemented. The cornea and sclera were combined into a single class, facilitating the extraction of key points related to the central corneal epithelium and endothelium. The anterior chamber was segmented separately to enhance the detection of the left and right anterior chamber angles. Similarly, the ciliary body and iris were grouped together to aid in localizing the left and right ciliary grooves. Meanwhile, the pupil was segmented individually to improve the identification of the midpoint of the anterior lens capsule and the left and right edges of the pupil.

Fig. 1
figure 1

Overall workflow diagram

From the original set of 716 UBM images, 200 were randomly selected for training the YOLOv8s-seg semantic segmentation model. An experienced ophthalmologist manually annotated four anatomical structures using Labelme software. After training, the segmentation model was applied to the remaining 516 images. Subsequently, 200 of 516 segmented images were randomly selected and annotated for the presence or absence of the posterior capsule lentis, serving as a clinical criterion to evaluate the completeness and validity of the segmentation outputs. A binary classification model was then trained using these annotated images. Finally, the remaining 316 images—which had not been used during either the segmentation or classification training phases—were evaluated using the trained classifier, and clinically invalid images were excluded from further analysis.

To evaluate whether segmenting key anterior segment regions in UBM images improves keypoint detection accuracy, a control experiment was conducted. In this experiment, 200 randomly selected unsegmented images from the original set of 716 were annotated for the presence of the posterior capsule lentis and used to train a binary classification model. This model was then applied to the remaining 516 unsegmented images to filter out clinically invalid cases.

Based on the binary classification results from both the experimental and control groups, a total of 182 overlapping valid images were identified and selected as the final data set for keypoint localization. Subsequently, fivefold cross-validation was conducted separately for the experimental group (with segmentation) and the control group (without segmentation). In each fold, the 182 images were randomly split into training, validation, and test sets in a 6:2:2 ratio. Two independent YOLOv8s-based keypoint localization models were trained on the respective training sets and evaluated on the corresponding test sets. After completing all five folds, keypoint localization results were obtained for all 182 images in both groups. Using the predicted coordinates of ten key anatomical keypoints, seven critical anterior segment parameters—CCT, ACD, PD, ATA, STS, LT, and CLR—were calculated. A comprehensive comparison of these parameters between the two groups is presented in the following sections.

In the first experimental group, the image is processed by YOLOv8s-seg to segment 4 key structures, followed by YOLOv8s for binary classification to filter valid images and detect 10 anterior segment keypoints. Clinical parameters such as CCT, ACD, PD, ATA, STS, LT, and CLR are then computed.

In the second experimental group, the image is directly processed by YOLOv8s to filter valid images and detect 10 keypoints, followed by the calculation of CCT, ACD, PD, ATA, STS, LT, and CLR parameters.

Environment setup

This study employed YOLOv8s and YOLOv8s-seg models. The model training framework was PyTorch version 2.4.1, with Python version 3.11.9. The GPU used was an NVIDIA RTX 3090Ti with 24 GB of memory, and the computing platform was based on CUDA version 12.1.

Evaluation metrics

Segmentation model evaluation metrics:

In deep learning-based segmentation tasks, performance is commonly assessed using metrics, such as Intersection over Union (IoU) and Pixel Accuracy (PA):

$$\text{IOU}=\frac{\text{Intersection }}{\text{Union}}=\frac{\text{TP}}{\text{TP}+\text{FP}+\text{FN}}$$

IoU measures the overlap between the predicted segmentation and the ground truth, providing an indication of model accuracy. True Positives (TP) represent correctly classified positive pixels, False Positives (FP) denote pixels mistakenly classified as positive, and False Negatives (FN) correspond to positive pixels incorrectly classified as negative:

$$\text{PA}=\frac{\text{TP}+\text{TN}}{\text{TP}+\text{FP}+\text{TN}+\text{FN}}$$

PA measures the proportion of correctly predicted pixels relative to the total number of pixels in the image. In this context, True Negatives (TN) refer to pixels accurately classified as belonging to the negative class.

Evaluation Metrics for Binary Classification Models:

In binary classification tasks, commonly used evaluation metrics include mean Average Precision (mAP), Precision, and Recall to assess model performance:

$$\text{AP}=\sum_{n=1}^{N}\left({\text{R}}_{n}-{\text{R}}_{n-1}\right){\text{P}}_{n}$$

The Average Precision (AP) evaluates the model’s accuracy and stability for a single class, where \({\text{R}}_{n}\) is the recall at the nth recall point, \({\text{P}}_{n}\) is the precision at the nth point, and N is the number of threshold points:

$$\text{mAP}=\frac{1}{C}\sum_{c=1}^{C}{\text{AP}}_{c}$$

mAP measures the model's ability to balance precision and recall across all classes, where C is the total number of classes, and \({\text{AP}}_{c}\) denotes the average precision for class c:

$$\text{Precision}=\frac{\text{TP}}{\text{TP}+\text{FP}}$$

Precision represents the proportion of correctly predicted positive samples among all samples classified as positive:

$$\text{Recall}=\frac{\text{TP}}{\text{TP}+\text{FN}}$$

Recall indicates the proportion of actual positive samples that are correctly predicted by the model.

Evaluation Metrics for Keypoint Localization Models:

In this study, the performance of the keypoint localization model is evaluated using the Mean Absolute Error (MAE), which measures the average absolute error of the Euclidean distance between the deep learning localization results and the gold standard; the Root Mean Squared Error (RMSE), which calculates the root mean square error of the Euclidean distance; as well as mAP, Precision, Recall, and Frames Per Second (FPS) to assess the effectiveness of keypoint localization:

$$\text{MAE}=\frac{1}{n}\sum_{i=1}^{n}\left|{y}_{i}-\widehat{{y}_{i}}\right|$$

MAE reflects the average absolute difference between the predicted values and the true values, where n is the number of samples, \({y}_{i}\) is the true value of the ith sample, and \(\widehat{{y}_{\text{i}}}\) is the predicted value of the ith sample:

$$\text{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}{\left({y}_{i}-\widehat{{y}_{i}}\right)}^{2}}$$

RMSE reflects the variability between predictions and ground truth, while FPS represents the model's inference speed by measuring the number of images processed per second.

Results

Segmentation results

The model achieved an mIoU of 0.8836 and an mPA of 0.9795 in the internal data set, demonstrating strong segmentation performance. The results, both before and after segmentation, are presented in Fig. 2.

Fig. 2
figure 2

UBM Images before and after segmentation. a Original UBM image before segmentation. b Manually annotated segmentation mask. c Predicted structural maps for the four categories by the segmentation model. d Predicted segmentation masks by the segmentation model

Binary classification results

In this study, the effectiveness of the UBM images was assessed by determining the presence or absence of the posterior capsule lentis using the YOLOv8s model. For the unsegmented images, the model achieved an mAP of 0.9661, a precision of 0.9254, and a recall of 0.9549. For segmented images, the model achieved an mAP of 0.9719, a precision of 0.9259, and a recall of 0.9615. The valid images identified by both the experimental (segmented) and control (unsegmented) groups were then compared, and their intersection—comprising 182 identical images recognized as valid in both cases—was selected as the final data set for the subsequent keypoint localization task.

Keypoint localization and anterior segment parameter calculation

In this study, the YOLOv8s model was employed for object detection to locate ten anterior segment keypoints and calculate anterior segment parameters. The keypoint localization results before and after segmentation are presented in Fig. 3.

Fig. 3
figure 3

Results of keypoints localization. a Keypoints localization result before segmentation. b Keypoints localization result after segmentation

In the figure, the coordinates of the detection box center points for Classes 0 to 9 correspond to the positions of the left and right ciliary grooves, the midpoint of the anterior lens capsule, the central corneal endothelium, the central corneal epithelium, the left and right anterior chamber angles, the left and right edges of the pupil, and the posterior capsule lentis. Table 1 summarizes the average performance of the keypoint localization models under fivefold cross-validation, both with and without segmentation, in terms of MAE, RMSE, mAP, Recall, and FPS.

Table 1 Localization performance of keypoints before and after segmentation

As shown in the table above, the keypoint localization model demonstrates a relatively high detection speed, exceeding 32 frames per second. After segmentation, the average Euclidean distance error decreased from 71.57 ± 67.36 μm to 58.73 ± 63.04 μm, indicating a significant reduction in localization error. Both MAE and RMSE also improved, further confirming that segmentation enhances the accuracy of the object detection model. In addition, the mAP, Precision, and Recall values were higher after segmentation, reflecting improved model performance and greater suitability for keypoint localization in UBM images. Figure 4 presents a histogram of the localization errors of keypoints before and after segmentation, with the x-axis representing the error range (μm) and the y-axis representing the proportion of keypoints.

Fig. 4
figure 4

Error Range and Proportion of Keypoints Localization Before and After Segmentation. a Histogram of keypoints localization errors before segmentation. b Histogram of keypoints localization errors after segmentation

As illustrated in Fig. 4, the proportion of keypoints with localization errors below 50 μm increased from 68.24% to 76.42% after segmentation, while the proportion of keypoints with errors exceeding 50 μm decreased. These results further confirm the improved performance of the keypoint localization model after the application of segmentation.

Once the ten keypoints of the anterior segment are identified, calculating the values of CCT, ACD, PD, ATA, STS, LT, and CLR becomes straightforward. Their positions within the UBM images are illustrated in Fig. 5.

Fig. 5
figure 5

Key Anterior Segment Parameters Before and After Segmentation. a Key anterior segment parameters before segmentation. b Key anterior segment parameters after segmentation. CCT: Distance from the central corneal apex to the endothelium; ACD: Distance from the corneal endothelium to the apex of the anterior lens capsule; LT: Vertical distance from the apex of the anterior lens capsule to the posterior capsule lentis; ATA: Distance between the left and right anterior chamber angles; STS: Distance between the left and right ciliary grooves; PD: Distance between the left and right edges of the pupil; CLR: Distance from the midpoint of the anterior lens capsule to the line connecting the left and right anterior chamber angles

In this study, the performance of key parameter measurements was evaluated using the MAE and the RMSE of the Euclidean distances between the deep learning predictions and the ground truth. After fivefold cross-validation, the measurement results of all test sets, with and without segmentation, are summarized in Table 2.

Table 2 Measurement performance of key parameters before and after segmentation

The accuracy of four anterior segment parameters—ATA, STS, PD, and CLR—significantly improved after segmentation. This improvement can be attributed to several factors:

  1. 1.

    Semantic segmentation refines the YOLOv8s localization model by extracting local features, distinguishing anatomical structures (e.g., cornea, iris, ciliary body), reducing background noise, and improving keypoint localization accuracy.

  2. 2.

    Segmentation provides structured contextual information, helping define anatomical boundaries and spatial relationships. Since all 10 keypoints are located near these boundaries, segmentation assists YOLOv8s in achieving more precise localization.

  3. 3.

    High-quality segmentation optimizes training data, providing more accurate inputs for keypoint detection and improving overall localization accuracy.

Conversely, the accuracy of CCT, ACD, and LT slightly decreased after segmentation, which may be due to the following reasons:

  1. 1.

    Error Accumulation: These parameters rely on the positions of the cornea, pupil, and posterior capsule lentis, where segmentation errors may accumulate, affecting accuracy.

  2. 2.

    Indistinct Boundaries: Certain structures are challenging to delineate precisely, leading to potential misalignment in keypoint localization.

  3. 3.

    Impact on Non-Boundary Keypoints: Keypoints such as the central corneal endothelium and epithelium are located near bright crescent-shaped regions rather than clear structural boundaries. Since segmentation primarily emphasizes boundaries, it may introduce slight shifts in their localization.

  4. 4.

    UBM Resolution Limitations: The errors in CCT, ACD, and LT measurements fall within the 10–20 μm range, which is lower than the device's resolution limits (30 μm axial, 40 μm lateral), constraining further accuracy improvements.

Moreover, as shown in the table above, the RMSE of different key parameters after segmentation exhibits variations, with some increasing and others decreasing, without a clear consistent trend. RMSE is highly sensitive to outliers, meaning that segmentation errors in specific images can lead to significant fluctuations. These variations reflect the complexity of UBM images, data set diversity, and inherent limitations of the segmentation model.

Figure 6 presents the Bland–Altman plots for anterior segment parameter measurements before and after segmentation, illustrating the consistency between the deep learning model's outputs and the ground truth data.

Fig. 6
figure 6

Bland–Altman plots based on the error distance between all predicted and actual points. a Bland–Altman plot of 182 points before segmentation. b Bland–Altman plot of 182 points after segmentation

In the Bland–Altman plot, the red dashed line represents the mean difference between the predicted and true values. This line remains close to zero both before and after segmentation, indicating that the deep learning-based method for measuring anterior segment parameters does not exhibit significant systematic bias, and the predicted values align well with the actual values. The two green lines represent the limits of agreement (LoA), within which most of the data points should fall. A narrower LoA interval suggests better stability in the prediction results. In Fig. 6b, the LoA interval is narrower, and the data points are more tightly clustered, particularly around zero, indicating that the predicted values are closer to the true values. This further indicates that after segmentation, the model demonstrates reduced variability, leading to enhanced consistency and stability in the measurements. These findings further confirm the positive impact of segmentation on anterior segment parameter estimation. Overall, considering keypoint localization accuracy and parameter calculation before and after segmentation, the YOLOv8s-based model, following segmentation, proves more suitable for clinical measurement of key parameters in UBM anterior segment images.

Discussion

In this study, we proposed a method for keypoint localization and parameter measurement in UBM anterior segment images based on the YOLOv8 deep learning model. Our approach successfully segmented four key structures: cornea–sclera, anterior chamber, iris–ciliary body, and pupil. We evaluated the effectiveness of the anterior segment images and filtered UBM images with complete clinical significance. We accurately localized ten keypoints and computed seven commonly used anterior segment parameters—CCT, ACD, PD, ATA, STS, LT, and CLR—based on clinical definitions. The maximum error compared to the gold standard established by clinical experts was within the micrometer range, highlighting the potential of artificial intelligence to enhance efficiency and completeness in anterior segment parameter measurement. Furthermore, comparative experiments demonstrated that segmenting key structures in UBM images significantly improves measurement accuracy.

The proposed method for anterior segment parameter measurement offers several advantages over traditional approaches. In terms of automation and efficiency, conventional methods rely on manual annotation and device-based measurements (e.g., Orbscan, IOL-Master, Pentacam, A-scan, AS-OCT, and UBM), which are time-consuming and subject to operator experience and subjective biases. In contrast, our fully automated approach significantly enhances processing efficiency. In addition, it ensures greater consistency. Traditional methods often exhibit variability due to differences in operator skills, making it difficult to maintain uniform accuracy. By leveraging deep learning, our method produces stable and reliable results, minimizing human error. Furthermore, our method effectively reduces measurement errors. Traditional techniques rely on the operator’s ability to precisely identify key anatomical points, making them prone to errors, especially among less experienced practitioners. In contrast, our deep learning model continuously improves its robustness and accuracy as data volume increases, leading to a significant reduction in error rates.

Previous studies on AI applications in ophthalmology have primarily focused on disease assessment and diagnosis, including glaucoma, cataracts, age-related macular degeneration, and diabetic retinopathy, while research dedicated to anterior segment parameter measurements remains limited. Guangqian Yang et al. measured anterior segment parameters such as the anterior chamber angle opening distance (AOD), trabecular iris space area (TISA), and ACA using a hybrid convolutional neural network, which aids in the diagnosis and monitoring of PACG [27]. Studies in the field of artificial intelligence for anterior segment parameter measurement are similar to this work, while literature on measuring other anterior segment parameters remains limited. Zhuyun Qian, Zhi Da Soh, and Shimizu E utilized deep learning models to measure ACD, demonstrating the importance of high-quality imaging. Shimizu E's machine learning model, based on SWSL ResNet, reported an ACD detection error of 93 ± 82 μm—significantly higher than the 24.14 ± 19.06 μm achieved in this study [28,29,30]. In addition, the anterior segment parameters measured using artificial intelligence models in existing studies remain relatively limited in scope. Pham T H et al. utilized U-NET and FRRnet to segment structures, such as the iris, cornea–scleral shell, and anterior chamber, subsequently measuring ACD, ATA, and ACA Opening with high reliability—an approach that closely aligns with this study [31]. Fu H et al. utilized VGG-16 to measure multiple parameters, including PD, ATA, ACD, ACV, and iris thickness (IT) in AS-OCT images. Their study's findings are highly referential, but the accuracy of their measurements is significantly influenced by the positioning accuracy of the SS and trabecular meshwork (TM), as well as interference from image shadows [32]. Overall, there remains a shortage of research on AI-driven measurement of multiple anterior segment parameters. Further studies are needed to enhance the comprehensiveness and accuracy of AI-based measurement approaches.

In this study, the segmentation model achieved an mIOU of 0.8836 and an mPA of 0.9795, effectively segmenting four key structures in UBM anterior segment images. Meanwhile, the mAP for binary classification exceeded 0.96, demonstrating the model's ability to accurately identify UBM images with complete clinical significance. We further evaluated keypoint localization and parameter measurement performance before and after segmentation. After segmentation, the Euclidean distance error for keypoint localization improved to 58.73 ± 63.04 μm from 71.57 ± 67.36 μm, with 76.42% of keypoints having an error below 50 μm compared to 68.24% before segmentation. In addition, the model achieved an mAP of 0.9826, a Precision of 0.9699 and a Recall of 0.9642, highlighting its suitability for keypoint localization in UBM anterior segment images. For parameter measurements, segmentation significantly reduced errors in ATA, STS, PD, and CLR, indicating that the semantic segmentation model enhanced the YOLOv8s localization model by extracting local features, providing structured contextual information, and optimizing the training data set. However, the accuracy of CCT, ACD, and LT slightly declined, suggesting that the segmentation-then-localization approach may introduce segmentation errors, affecting precise boundary detection and reducing accuracy for non-boundary key points. In addition, the resolution limitations of the UBM device may constrain further precision improvements. The RMSE variations across different parameters showed inconsistencies, reflecting image complexity, data set variability, and segmentation model limitations. To enhance result reliability, future research could incorporate stability analyses, such as multiple cross-validation, to assess performance across different contexts. In the Bland–Altman plot (Fig. 6), the post-segmentation results exhibited improved consistency, characterized by narrower limits of agreement and data points more densely clustered around zero. This indicates that the predicted values more closely approximate the true values, further validating the positive effect of segmentation on anterior segment parameter measurements. Overall, this method provides an efficient and comprehensive approach for measuring key anterior segment parameters (CCT, ACD, PD, ATA, STS, LT, CLR) in UBM images, offering valuable clinical reference and improving diagnostic efficiency. However, further validation through clinical practice is necessary for broader application.

This study also has some limitations. First, compared to traditional methods, our approach has a higher reliance on computational resources. While using high-end GPUs (such as the 3090Ti), the model inference speed can exceed 32 FPS. Although reasonable hardware configurations can achieve the same or higher detection rates without relying on high-end GPUs, some resource-limited hospitals may struggle to meet the hardware requirements. Future research should focus on reducing model complexity through techniques such as pruning, quantization, depthwise separable convolutions, and lightweight architectures to improve performance in hardware-constrained environments. Second, the model's generalization ability is relatively weak. The data set used in this study comes from a single UBM device, with a small sample size and a fixed target population. If the source of the images or the equipment changes, the model's detection accuracy may decrease. Future work will need to retrain or adjust the model to ensure the reliability and accuracy of the measurement results. Finally, the interpretability of the results is limited. Traditional methods have a transparent and easily understandable calculation process, while our method directly outputs results, which may reduce trust in the outcomes by both patients and doctors.

Conclusion

The deep learning model we proposed effectively performs keypoint localization and parameter measurement in UBM anterior segment images. It accurately and effectively detects seven critical anterior segment parameters: CCT, ACD, PD, ATA, STS, LT, and CLR. The measurement results exhibit minimal errors compared to the gold standard established by clinical experts, offering valuable references for clinicians and improving diagnostic efficiency. This demonstrates the model's potential for clinical application. Future work will focus on further clinical validation to assess its real-world performance and refine it to better meet clinical needs.

Availability of data and materials

No datasets were generated or analysed during the current study.

Abbreviations

UBM:

Ultrasound biomicroscopy

CCT:

Central corneal thickness

ACD:

Anterior chamber depth

PD:

Pupil diameter

ATA:

Angle-to-angle distance

STS:

Sulcus-to-sulcus distance

LT:

Lens thickness

CLR:

Crystalline lens rise

ACA:

Anterior chamber angle

IOP:

Intraocular pressure

ACV:

Anterior Chamber volume

KC:

Keratometry curvature

AL:

Axial length

ICL:

Intraocular contact lenses

AS-OCT:

Anterior segment optical coherence tomography

SS:

Scleral spur

AC:

Anterior chamber

ACA Opening:

Anterior chamber angle opening

PACS:

Primary angle closure suspect

AMD:

Age-related macular degeneration

SD-OCT:

Spectral-domain optical coherence tomography

PACG:

Primary angle-closure glaucoma

YOLO:

You only look once

CSPNet:

Cross stage partial network

IoU:

Intersection over union

PA:

Pixel accuracy

TP:

True positives

FP:

False positives

FN:

False negatives

TN:

True negatives

mAP:

Mean average precision

AP:

Average precision

MAE:

Mean absolute error

RMSE:

Root mean squared error

FPS:

Frames per second

AOD:

Angle opening distance

TISA:

Trabecular iris space area

IT:

Iris thickness

TM:

Trabecular meshwork

References

  1. Zhang P, Ai M. Clinical research progress of anterior segment parameter biometrics. J Clin Ophthalmol. 2017;25(5):475–9.

    Google Scholar 

  2. Zhou M, Wang W, Ding X, et al. Choroidal thickness in fellow eyes of patients with acute primary angle-closure measured by enhanced depth imaging spectral-domain optical coherence tomography. Invest Ophthalmol Vis Sci. 2013;54(3):1971–8.

    Article  Google Scholar 

  3. Hao H. Analysis of anterior segment optical coherence tomography images based on deep learning. Ningbo University. 2020.

  4. Doganay S, Bozgul Firat P, Emre S, Yologlu S. Evaluation of anterior segment parameter changes using the Pentacam after uneventful phacoemulsification. Acta Ophthalmol. 2010;88:601–6.

    Article  Google Scholar 

  5. Lee W, Bae HW, Kim CY, et al. The change of anterior segment parameters after cataract surgery in normal-tension glaucoma. Int J Ophthalmol. 2017;10(8):1239.

    Google Scholar 

  6. Bai Q, Wang Y, Hu Y, et al. Study on the differences in anterior segment parameter biometrics before cataract surgery. Guide China Med. 2014;12(24):131–2.

    Google Scholar 

  7. Kiraly L, Duncker G. Biometrie des vorderen Augensegmentes zur Implantation phaker Vorderkammerlinsen. Ophthalmologe. 2012;109:242–9.

    Article  Google Scholar 

  8. Zhang J, Luo HH, Zhuang J, et al. Comparison of anterior section parameters using anterior segment optical coherence tomography and ultrasound biomicroscopy in myopic patients after ICL implantation. Int J Ophthalmol. 2016;9(1):58.

    Google Scholar 

  9. Maslin JS, Barkana Y, Dorairaj SK. Anterior segment imaging in glaucoma: an updated review. Indian J Ophthalmol. 2015;63(8):630–40.

    Article  Google Scholar 

  10. Zhang W, Gao J. Progress in measuring anterior chamber biological parameters. J Otolaryngol Ophthalmol Shandong Univ. 2012;26(03):86–9+94.

    Google Scholar 

  11. Qian Y, Liu L, Shi Y, et al. Assessment of anterior chamber by ultrasound biomicroscopy and anterior segment optical coherence tomography in patients with inflammatory glaucoma. J Int Med Res. 2019;47(12):5950–6.

    Article  Google Scholar 

  12. Thompson AC, Jammal AA, Medeiros FA. A review of deep learning for screening, diagnosis, and detection of glaucoma progression. Transl Vis Sci Technol. 2020;9(2):42–42.

    Article  Google Scholar 

  13. Gong D, Li WT, Li XM, et al. Development and research status of intelligent ophthalmology in China. Int J Ophthalmol. 2024;17(12):2308.

    Article  Google Scholar 

  14. Da Soh Z, Tan M, Nongpiur ME, et al. Deep learning-based quantification of anterior segment OCT parameters. Ophthalmol Sci. 2024;4(1): 100360.

    Article  Google Scholar 

  15. Jiang W, Yan Y, Cheng S, et al. Deep learning-based model for automatic assessment of anterior angle chamber in ultrasound biomicroscopy. Ultrasound Med Biol. 2023;49(12):2497–509.

    Article  Google Scholar 

  16. Fu Z, Xi J, Ji Z, et al. Analysis of anterior segment in primary angle closure suspect with deep learning models. BMC Med Inform Decis Mak. 2024;24(1):251.

    Article  Google Scholar 

  17. Ren PF, Tang XY, Yu CY, et al. Evaluation of a novel deep learning based screening system for pathologic myopia. Int J Ophthalmol. 2023;16(9):1417.

    Article  Google Scholar 

  18. Shao Y, Jie Y, Liu ZG, et al. Guidelines for the application of artificial intelligence in the diagnosis of anterior segment diseases (2023). Int J Ophthalmol. 2023;16(9):1373.

    Article  Google Scholar 

  19. Liu YH, Li LY, Liu SJ, et al. Artificial intelligence in the anterior segment of eye diseases. Int J Ophthalmol. 2024;17(9):1743.

    Article  Google Scholar 

  20. Zhu J, Lu Q, Tong Q, et al. Research progress on the application of anterior segment parameter biometrics in ICL implantation. Mod Pract Med. 2023;35(07):972–6.

    Google Scholar 

  21. Wu M. Study on the correlation between anterior segment biological parameters and primary angle-closure glaucoma. Xiamen University 2019.

  22. An Z, Yang B, Zhang B. Measurement of anterior chamber depth and pupil diameter before and after cataract surgery and its significance. J Jilin Univ Med Ed. 2010;36(03):571–3.

    Google Scholar 

  23. Saito A, Kamiya K, Fujimura F, et al. Comparison of angle-to-angle distance using three devices in normal eyes. Eye. 2020;34(6):1116–20.

    Article  Google Scholar 

  24. Wang J, Wang Z, Xu T, et al. The impact of lens vault on postoperative vault in Phakic eyes after posterior chamber implantation. Int J Ophthalmol. 2021;21(02):377–81.

    Google Scholar 

  25. Huang M, Mi W, Wang Y. EDGS-YOLOv8: an improved YOLOv8 lightweight UAV detection model. Drones. 2024;8(7):337.

    Article  Google Scholar 

  26. Wu S, Xu Y, Zhao D. Review of object detection based on deep convolutional networks. Pattern Recognit Artif Intell. 2018;31(04):335–46.

    Google Scholar 

  27. Yang G, Li K, Yao J, et al. Automatic measurement of anterior chamber angle parameters in AS-OCT images using deep learning. Biomed Opt Express. 2023;14(4):1378–92.

    Article  Google Scholar 

  28. Qian Z, Xie X, Yang J, et al. Detection of shallow anterior chamber depth from two-dimensional anterior segment photographs using deep learning. BMC Ophthalmol. 2021;21:1–9.

    Article  Google Scholar 

  29. Soh ZD, Jiang Y, So Ganesan S/O, et al. From 2 dimensions to 3rd dimension: quantitative prediction of anterior chamber depth from anterior segment photographs via deep-learning. PLOS Digit Health. 2023;2(2): e0000193.

    Article  Google Scholar 

  30. Shimizu E, Tanaka K, Nishimura H, et al. The use of artificial intelligence for estimating anterior chamber depth from slit-lamp images developed using anterior-segment optical coherence tomography. Bioengineering. 2024;11(10):1005.

    Article  Google Scholar 

  31. Pham TH, Devalla SK, Ang A, et al. Deep learning algorithms to isolate and quantify the structures of the anterior segment in optical coherence tomography images. Br J Ophthalmol. 2021;105(9):1231–7.

    Article  Google Scholar 

  32. Fu H, Baskaran M, Xu Y, et al. A deep learning system for automated angle-closure detection in anterior segment optical coherence tomography images. Am J Ophthalmol. 2019;203:37–45.

    Article  Google Scholar 

Download references

Acknowledgements

The authors are grateful to the financial support from Tianjin Municipal Science and Technology Project (Grant Number 24ZXZSSS00110), Tianjin Natural Science Foundation (Grant Number 22JCYBJC00340), Tianjin Metrology Technology Foundation (Grant Number 2024TJMT035),CAMS Innovation Fund for Medical Sciences (Grant Numbers 2022-I2M-2-003, 2023-I2M-2-008)

Funding

Tianjin Municipal Science and Technology Project (Grant Number 24ZXZSSS00110), Tianjin Natural Science Foundation (Grant Number 22JCYBJC00340), Tianjin Metrology Technology Foundation (Grant Number 2024TJMT035), CAMS Innovation Fund for Medical Sciences (Grant Numbers 2022-I2M-2-003, 2023-I2M-2-008).

Author information

Authors and Affiliations

Authors

Contributions

Miao QH conducted the experiments, analyzed the experimental results, and drafted the manuscript. Zhou S, Yang J, and Wang XC provided guidance and optimization for the experimental design, as well as revisions to the manuscript. Zhang M contributed experimental data, annotated key point locations, and verified and analyzed the experimental results. All authors read and approved the final manuscript.

Corresponding authors

Correspondence to Wang Xiaochun or Zhang Min.

Ethics declarations

Ethics approval and consent to participate

This study adhered to the principles outlined in the World Medical Association Declaration of Helsinki. Ethical approval was granted by the Medical Ethics Committee of Tianjin Medical University Eye Hospital (Approval No. 2023KY-05). Since this was a retrospective study utilizing de-identified UBM images, the requirement for informed consent was waived.

Consent for publication

Not applicable.

Competing interests

The authors declare no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Qinghao, M., Sheng, Z., Jun, Y. et al. Keypoint localization and parameter measurement in ultrasound biomicroscopy anterior segment images based on deep learning. BioMed Eng OnLine 24, 53 (2025). https://doiorg.publicaciones.saludcastillayleon.es/10.1186/s12938-025-01388-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doiorg.publicaciones.saludcastillayleon.es/10.1186/s12938-025-01388-3

Keywords