Next, we use the proposed approaches to determine the VA from a set of Zernike coefficients, age and in some cases individual measurements of amplitude of accommodation to account for subject accommodation variability (regression trees) and pupil size (neural network). Table 2 presents a comparison of the variables used in each model. We show that our proposed approaches can provide fast and near-clinical accuracy VA predictions from experimental data obtained from the clinical trial.
Regression trees
As the clinical trial measured 36 Zernike polynomials for each subject, we evaluated which subset of Zernike coefficients yielded the best results for both methods (LSBoost and XGBoost). Several tests were conducted to determine the optimal number of coefficients evaluated over the test set aiming to achieve the best performance. Specifically, we assessed the following subsets of Zernike coefficients: 5 (from the 1st to the 5th coefficients in the OSA convention), 9 (from the 1st to the 9th), 14 (from the 1st to the 14th), and 36 (from the 0th to the 35th). To perform these tests, we used as input the Zernike coefficients, age and corresponding VA of the test set. In Table 3, we show the results obtained for the LSBoost approach. In this table, we provide usual metrics such as the mean square error (MSE), the root mean square error (RMSE), the mean absolute error (MAE), the R2 metric representing the goodness of the fitting, the maximum and minimum errors (MaxE and MinE) and the mode and median of the errors. For context, an RMSE of 0.1 logMAR approximately corresponds to one line difference on a standard visual acuity chart. Therefore, RMSE values below 0.1 indicate good predictive performance. The best result for each metric is highlighted in bold. As shown in Table 3, the results obtained using 9 and 14 Zernike coefficients are very similar, with the 9 Zernike coefficients providing the best overall performance. A visual representation of the MSE, RMSE, and MAE results are presented in Figure S2(a).
Therefore, we used 9 Zernike coefficients as input in our LSBoost approach for subsequent experiments. We then incorporated the measured amplitude of accommodation of each subject as an additional parameter observing improvements in most metrics (MSE, RMSE, MAE, R2, etc.) except for the mode. These results are shown in Table 4(a). Subsequently, in Table 4(b), we provide computed results when outliers in the test set were removed (i.e., errors greater than 3σ). Note that the data used to train and evaluate these models were obtained from a clinical trial. Therefore, we must assume the possibility of erroneous entries, whether from false-positive or false-negative responses by participants, or mistakes made by participants and/or clinical staff. The number of entries evaluated in Table 4(b) are 348 and 328 with and without removing outliers respectively. Consequently, the percentage of removed outliers in the test set is 5.75%. To assess the model’s generalization ability, Table 4(c) presents the results obtained for the training set, including the amplitude of accommodation. Comparing these results with those from the test set (Table 4(a) and (b)) provides insight into potential overfitting or underfitting. As expected, the training set exhibited lower error values across all metrics. However, the model maintained strong generalization, with a slight increase in error on the test set but no indications of severe overfitting. These findings confirm that the model performs well on unseen data while preserving robustness. A visual representation of the percentage improvement derived from these metrics is provided in Figure S2(b). Finally, Figure S3 shows plots of the clinically measured VA (real VA) versus the LSBoost-predicted VA (predicted VA) for the test set, presented both with outliers (left) and without outliers (right). The color of each point reflects the absolute error between the real and predicted VA.
The same tests were conducted using the XGBoost approach. Table 5 shows the results obtained with different numbers of Zernike coefficients. As shown in Table 5, while the XGBoost approach yields similar results across the various cases, the results obtained using 5 Zernike coefficients are slightly better than those from the other configurations. A visual representation of the MSE, RMSE, and MAE results are presented in Fig. S2(c).
Consequently, we proceeded to remove the outliers in the test set, following the same procedure as with the LSBoost approach. The corresponding results are presented in Table 6(a) and Figure S4. In this case, the number of removed outliers is 16, representing 4.6% of the test set. To evaluate the model’s ability to generalize, Table 6(b) shows the results obtained for the training set. The model demonstrates strong generalization capabilities, as evidenced by lower error metrics in the training set and a reasonable increase in error in the test set. While the test set exhibits a higher maximum error, particularly before outlier removal, the overall error distribution remains consistent. The minimum error remains stable across all cases, and slight differences in mode and median values further indicate effective generalization without significant overfitting. A visual representation of the percentage improvement derived from these metrics is provided in Figure S2(d).
Finally, comparing Tables 4(b) and 6(a), we see that LSBoost outperforms XGBoost across most error metrics, demonstrating lower overall prediction errors and a better fit to the data. It also shows greater robustness to extreme values, with a consistently lower maximum error. After outlier removal, both models improve in all performance metrics, with LSBoost showing slightly better results. Although the differences between the two models become less pronounced without outliers, XGBoost appears more sensitive to extreme values. Overall, LSBoost exhibits superior predictive accuracy and generalization. Section “Computation time” discusses the computation time required for training and prediction, and section “Comparison with other models” presents a comparison of the LSBoost and XGBoost models with other approaches.
Age was included as a parameter in our models due to its well-established influence on VA, which tends to decrease with increasing age. Age-related changes in the visual system can significantly affect daily activities and quality of life, with common alterations including reduced VA25.
Radner and Benesch examined the age-related progression of best-corrected VA in healthy eyes between the ages of 25 and 7426. Their findings indicated that VA remained consistently high up to 54 years of age, with a noticeable decline beginning between 55 and 59 years. In healthy eyes up to age 64, a minimum angle of resolution of less than 1 min of arc (corresponding to a visual acuity better than 0.0 logMAR) could still be expected. In contrast, Frisén et al.,27 reported that peak visual acuity was reached at approximately 25 years of age.
To illustrate the contribution of age to VA, we analyzed models using 9 Zernike coefficients combined with amplitude of accommodation for LSBoost, and 5 Zernike coefficients for XGBoost—the configurations that yielded the best results for each model. When age was removed from the models, performance declined notably. In LSBoost model, MSE increased by 30% (0.0063 to 0.0082), RMSE by 14% (0.0792 to 0.0906), and MAE by 13% (0.0574 to 0.0651), while R2 decreased by about 3% (0.9115 to 0.8842). Similarly, in the XGBoost model, MSE increased by 19% (0.0070 to 0.0083), RMSE by 9% (0.0836 to 0.0910), and MAE by 13% (0.0580 to 0.0655), while R2 decreased by about 2% (0.9014 to 0.8832). These results highlight the significant contribution of age in improving the accuracy of VA prediction. Moreover, this contribution can be observed in Figure S5, which shows the feature importance for each model. Age appears as the second most important feature in LSBoost and as one of the top-ranked features in XGBoost (several features share the maximum importance score). The bar plots also reveal that \(\:{Z}_{2}^{0}\) is the most influential feature in LSBoost, and it holds a similar level of importance to age in XGBoost.
Finally, we performed two stratified analyses: age and refractive error. In the case of age, the data were divided into six groups: 30–40, 41–44, 45–50, 51–55, 56–60, and 61–65 years. Comparing the results for groups without outliers for both LSBoost and XGBoost to the overall test set, we observe that the 30–40 and 41–44 groups outperform the test set, the 61–65 group performs similarly to the test set, and the remaining groups perform worse. For LSBoost, the best metrics are observed in the 30–40 group (RMSE = 0.0411 vs. 0.0576 in the test set) and the worst in the 51–55 group (RMSE = 0.0716). For XGBoost, the best metrics are also in the 30–40 group (RMSE = 0.0507 vs. 0.0629) and the worst in the 45–50 group (RMSE = 0.086). Overall, model performance is better in younger groups (30–44), likely reflecting lower inter-subject variability in VA, whereas performance is worse in middle-age groups (45–55), where natural variability in VA is higher. The similarity between the 61–65 group and the overall test set likely reflects that VA in older adults tends to converge toward a common pattern of age-related changes, and the model predictions for this group approximate the test set average. The results obtained in this stratified analysis can be found in Table S2 for LSBoost and Table S3 for XGboost.
In the case of refractive error, we stratified the data using the spherical equivalent (SE), calculated as (3), based on the sphere (S) and cylinder (C) measurements obtained in the clinical trial.
Groups were defined as myopic (SE < − 0.5 D), emmetropic (− 0.5 D ≤ SE ≤ 0.5 D), and hyperopic (SE > 0.5 D). In this stratified analysis, we considered only 53 observations, fewer than the 348 in the full test set. As VA measurements for each subject were obtained in both eyes under several optical conditions: uncorrected, corrected (second-order Zernike terms set to zero), and defocus curves (\({Z}_{2}^{-2}\) and \(\:{Z}_{2}^{-2}\) set to zero and varying \(\:{Z}_{2}^{0}\) according to the defocus level), in test set there are observations under all of these optical conditions. However, for the refractive error analysis, we used only the original Zernike measurements representing the actual optical state of each eye. This ensures that the analysis reflects model performance across real refractive categories. When examining the results, both myopic and hyperopic groups perform worse than the overall test set for both LSBoost and XGBoost (myopic: RMSE = 0.1177 for LSBoost, 0.0949 for XGBoost; hyperopic: RMSE = 0.1522 for LSBoost, 0.1434 for XGBoost, compared to RMSE = 0.0576 and 0.0629 for the full test set, respectively). In contrast, the emmetropic group outperforms the test set in both models (RMSE = 0.0480 for LSBoost and 0.0498 for XGBoost). All RMSE values reported here refer to metrics calculated without outliers. For more metrics without outliers and metrics with outliers see Table S4.
Neural network
As previously explained, the neural network attempts to recognize each neural optotype image by classifying it into a recognition label (0 or 1, depending on whether the network recognizes the optotype image). This classification is then used, as detailed in section “Determination of VA by the neural network”, to calculate the VA. Therefore, the effectiveness of this approach in estimating VA is directly linked to the neural network’s ability to recognize the neural optotypes. To assess the robustness of the trained neural network, we computed the confusion matrix on the test set, which is presented in Table 7. As shown in Table 7, the network correctly identifies 93.2% of the optotypes recognized by the subjects (true positives) and 85.3% of the optotypes not recognized by the subjects (true negatives), thus the sensitivity of the neural network is 93.2% with a specificity of 85.3%. However, the network exhibits a 14.7% false positive rate and a 6.8% false negative rate.
To evaluate the network’s ability to predict VA, we used images generated from Zernike coefficients of subjects who were not included in the training and validation datasets, as the responses (i.e., the letters identified) from their VA measurement tests were unavailable. However, the VA values themselves were available. This set was composed of 27 individuals generating 54 cases. After making the predictions and performing the corresponding calculations, the network achieved a root mean square error (RMSE) of 0.2095 and a mean absolute error (MAE) of 0.1715. Section “Computation time” discusses the computation time required for prediction. These computed errors are significatively higher than the ones computed with the regression trees showing lower robustness of the neural network method to estimate visual acuity.
Computation time
In our study, we emphasize computational speed because the aim of our models is the design and manufacture of customized ophthalmic lenses. In the patented method for ophthalmic lens design (US11092823B2)28, the subject’s VA profile is used to generate lens parameters. These parameters are optimized iteratively using VA based merit functions. Because the generation of lens parameters directly depends on predicted VA and involves repetitive optimization, the predictive model must provide results rapidly to avoid computational bottlenecks. This requirement justifies the use of fast algorithms, which enable the efficient integration of VA prediction into the design-to-manufacture process.
Among the three methods proposed, XGBoost approach is the fastest, followed by the LSBoost method. In terms of training time, XGBoost takes 3 min and 31 s, while LSBoost requires approximately 2 min. After the training phase, when predicting a single VA value from a set of Zernike coefficients, age and amplitude of accommodation, XGBoost takes approximately 1 ms, whereas LSBoost requires 116.243 ms. On the other hand, the estimation of VA by the neural network requires a more complex pipeline which impacts the computation time. Moreover, the computation time depends on the actual VA value itself: the lower the VA logMAR value, the longer it takes, since it must evaluate more neural optotypes. As example, a VA of − 0.18 logMAR requires 23.558 s, while a VA of 0.62 logMAR requires 14.868 s. When predicting all 348 observations in the test set, XGBoost requires only 1 ms, regression trees with LSBoost take approximately 145.5 ms, and the neural network requires around 3 h. In this case, when we refer to “the neural network,” we mean the entire processing pipeline, including the simulation of multiple optotypes at different VA levels and the corresponding classification by the neural network. The network itself requires only ~ 2.5 ms to classify a single optotype. When optotype generation is included, the time increases to ~ 0.44 s per optotype. Since each observation may involve up to 15 VA levels (form 1 logMAR to −0.3 logMAR in steps of 0.1) with 5 optotypes per level, the maximum time per observation (corresponding to the prediction of a single VA value) is ~ 33 s. For the 348 observations in the test set, this corresponds to a maximum total processing time of ~ 3.2 h. This time represents an upper bound, as the procedure often stops earlier once a given VA level cannot be recognized (i.e., when all five optotypes of that level are classified as “not recognized”), thereby reducing the actual runtime. These processing times have been obtained by always the same computer. The experiments were conducted on a system equipped with an Intel Core i9-11900 CPU, 128GB of RAM, a NVIDIA RTX A5000 GPU, and a 1 TB SSD. The software environment includes MATLAB (version R2023a), which was used for implementing LSBoost and the neural network models. For XGBoost, we used a Python 3.10.17 environment, including key dependencies such as NumPy 2.2.5, SciPy 1.15.2, scikit-learn 1.6.1, and XGBoost 3.0.0. This Python environment was called directly from MATLAB. The system runs on Windows 11.
Comparison with other models
Regarding the functional VA models, Watson and Ahumada13 reported a RMSE of 0.056 logMAR, while the RMSE for LSBoost was 0.058 logMAR and 0.063 logMAR for XGBoost, in both cases after removing outliers. Therefore, the results are comparable between our model and that of Watson and Ahumada, though XGBoost shows a slightly higher RMSE. However, there are significant differences in the size of the test set. Watson and Ahumada used a set of 4 subjects and obtained 152 observations using a defocus curve, whereas we verified our algorithms on a larger test set with a total of 348 observations coming from a total of 20 subjects. Thus, our results are supported by greater statistical power. Additionally, the model proposed by Watson and Ahumada employs multiple possible values for a parameter (\(\varphi\)) that cannot be directly measured in patients and is adjusted to optimize the fitting. In contrast, our LSBoost and XGBoost based methods do not use any phenomenological parameter and the neural network employs a single common \(\varphi\) value across all subjects. The model of Nestares et al.12 was verified by Dalimier et al.21, who used 10 subjects with 140 observations and obtained a RMS of 0.23 in decimal visual acuity, which corresponds to 0.1 logMAR. Finally, Fülep et al.14 tested their model with a set of 8 subjects and reported an RMSE error of 0.045 logMAR. A comparative summary of the different functional VA models, including RMSE values and test set size, is provided in the Supplementary Material (Table S5). Therefore, we can conclude that our model and the functional VA models present good accuracy, with an average value close to 0.06 logMAR. This is interesting because, in the ETDRS chart commonly used to assess VA, the penalty for failing to recognize a letter corresponds to 0.02 logMAR. Thus, we can estimate the error of our models as equivalent to failing to recognize two letters on the ETDRS chart. Moreover, the regression tree-based models (LSBoost and XGBoost) present a significant computational advantage compared to all these models previously proposed, as they do not require image formation.
