Surrogate-Based Optimization of Interpretable Regular Expression Patterns for the Classification of Retinal Lesions in Retinal Fundus Images
Abstract
1. Introduction
2. Database and Methodological Background
2.1. Retinal Lesion Patch Database
2.2. Methods
2.2.1. Percentile Thresholding as a Controlled Binarization Rule
2.2.2. Run-Constrained Binary Patterns and Regular Expressions
2.2.3. Surrogate Optimization for Hyperparameter Selection
2.2.4. Ridge Classification Recast in Explicit Mathematical Form
3. Proposed Method
- Step 1. Intensity field construction. Given an RGB patch , an intensity field is computed using luminance
- Step 2. Percentile threshold selection. Given a percentile hyperparameter , a patch-specific threshold is computedwhere is the percentile operator.
- Step 3. Binary mask construction. A binary mask is then obtained using a polarity hyperparameter . If thenIf then
- Step 4. Run extraction with minimum length constraints. Each row and each column of B is scanned to extract maximal runs of identical symbols. Two integer hyperparameters are used: for one-runs and for zero-runs. A one-run is retained only if its length satisfies , and a zero-run only if . For each of the four cases, rows ones, columns ones, rows zeros, and columns zeros, three summaries are computed. The maxima array M stores the maximum valid run length per line, the count array C stores the number of valid runs per line, and the sum S stores the total length of all valid runs across lines.
- Step 5. Long-run structure and block continuity. A long-run threshold hyperparameter L defines a long-run flag per linewhere ℓ indexes a row or a column. Two long-run descriptors are then computed for each case. The long-run count is . The long-run block length is the maximum number of consecutive lines with .
- Step 6. Explicit construction of the 32 dimensional descriptor. A fixed descriptor is assembled from four coverage features and twenty-eight run summary features. The four coverage features are defined byFor each case determined by an orientation and a polarity , define the per-line maxima array , the per-line count array , and the long-run flag array derived from and L. Seven summary features are computed per case:where returns the maximum length of a consecutive block of ones in a binary sequence. The final descriptor is formed by concatenation in a fixed order. First the four coverages are appended, then seven features for rows ones are appended, seven features for columns ones are appended, seven features for rows zeros are appended and lastly seven features for columns zeros are appended.
- Step 7. Standardization and ridge decision function. Given descriptors , each dimension is standardized using the training-set mean and standard deviation :A ridge model is fitted and produces a score
- Step 8. Two-phase surrogate optimization for hyperparameter selection. The hyperparameters are collected as , where and is a discrete search space. Selection proceeds in two phases. The first phase seeks configurations whose training performance does not substantially exceed validation performance. For a candidate configuration , the ridge model is trained on the training split and evaluated on both training and validation splits. Let and denote the corresponding Matthews correlation coefficients. The phase one objective is the generalization gapSurrogate optimization is then used to minimize over , subject to feasibility constraints that reject degenerate extractions. All feasible configurations are collected and sorted in ascending order of . The K best configurations, denoted , are retained as seeds. In the second phase, each seed defines a local discrete neighborhood by restricting each coordinate to nearby candidate values. Surrogate optimization is executed within each neighborhood to maximize a stability-aware objective computed on resampling splits of the merged training and validation data. The external test split remains excluded from the search and is used only for final reporting. Let denote the validation MCC obtained on repetition r from an internal stratified split of the merged set. The phase-two fitness is defined bywhere controls the variability penalty and R is the number of repetitions. The final configuration is the maximizer of the phase-two objective across all neighborhoods, with used as the primary criterion and the penalty term used to prefer stable solutions when mean values are similar.
- Figure 4 provides a graphical overview of the complete pipeline. The diagram follows the eight steps described above: the input retinal patch enters the intensity field construction (Step 1), passes through percentile thresholding (Step 2) to produce the binary mask (Step 3), from which runs are extracted with minimum-length constraints (Step 4) and long-run structure is computed (Step 5). The resulting 32-dimensional descriptor (Step 6) is standardized and fed to the ridge classifier (Step 7), whose hyperparameters are selected through the two-phase surrogate optimization (Step 8). At each stage, the figure shows representative inputs and outputs so that the transformation from patch to decision can be traced visually.
3.1. Pseudocode for the Proposed Pipeline
| Algorithm 1 Run descriptor extraction and two-phase surrogate optimization |
|
Leakage-Aware Grouped Evaluation Protocol
3.2. Evaluation Metrics
4. Results and Discussions
4.1. Overall Performance of the Proposed Method
4.2. Comparative Analysis
4.3. Discriminative Performance, Operating Curve Behavior, and Stability
4.4. Additional Grouped Source–Image Robustness Analyses
4.5. Robustness Against Validation Overfitting
5. Conclusions
Supplementary Materials
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| ME | Macular Edema |
| DR | Diabetic Retinopathy |
| CNN | Convolutional Neural Network |
| UMAE | High Specialities Medical Unit |
| RFI | Retinal Fundus Images |
References
- Musat, O.; Cernat, C.; Labib, M.; Gheorghe, A.; Toma, O.; Zamfir, M.; Boureanu, A.M. Diabetic Macular Edema. Rom. J. Ophthalmol. 2015, 59, 133–136. [Google Scholar] [PubMed]
- García-Layana, A.; Cabrera-López, F.; García-Arumí, J.; Arias-Barquet, L.; Ruiz-Moreno, J.M. Early and intermediate age-related macular degeneration: Update and clinical review. Clin. Interv. Aging 2017, 12, 1579–1587. [Google Scholar] [CrossRef] [Scilit]
- Zhang, J.; Zhang, J.; Zhang, C.; Zhang, J.; Gu, L.; Luo, D.; Qiu, Q. Diabetic Macular Edema: Current Understanding, Molecular Mechanisms and Therapeutic Implications. Cells 2022, 11, 3362. [Google Scholar] [CrossRef] [Scilit]
- Wang, W.; Lo, A.C.Y. Diabetic Retinopathy: Pathophysiology and Treatments. Int. J. Mol. Sci. 2018, 19, 1816. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Morya, A.K.; Ramesh, P.V.; Nishant, P.; Kaur, K.; Gurnani, B.; Heda, A.; Salodia, S. Diabetic retinopathy: A review on its pathophysiology and novel treatment modalities. World J. Methodol. 2024, 14, 95881. [Google Scholar] [CrossRef] [Scilit]
- Georgescu, A.; Dascalu, A.M.; Stana, D.; Alexandrescu, C.; Bobirca, A.; Cristea, B.M.; Vancea, G.; Serboiu, C.S.; Serban, D.; Tudor, C.; et al. The Role of Inflammation in Diabetic Retinopathy in Patients with Type II Diabetes; Potential Therapeutic Perspectives. J. Mind Med. Sci. 2024, 11, 17–23. [Google Scholar] [CrossRef] [Scilit]
- Kowluru, R.A.; Santos, J.M.; Mishra, M. Epigenetic Modifications and Diabetic Retinopathy. BioMed Res. Int. 2013, 2013, 635284. [Google Scholar] [CrossRef] [Scilit]
- Shah, A.R.; Gardner, T.W. Diabetic retinopathy: Research to clinical practice. Clin. Diabetes Endocrinol. 2017, 3, 9. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Nilay, A.; Thool, A.R. A Review of Pathogenesis and Risk Factors of Diabetic Retinopathy with Emphasis on Screening Techniques. Cureus 2022, 14, e31062. [Google Scholar] [CrossRef] [Scilit]
- Gettinger, K.; Lee, D.; Tomita, Y.; Negishi, K.; Kurihara, T. Diabetic Retinopathy, a Comprehensive Overview on Pathophysiology and Relevant Experimental Models. Int. J. Mol. Sci. 2025, 26, 9882. [Google Scholar] [CrossRef] [Scilit]
- Bikbova, G.; Oshitari, T.; Bikbov, M. Diabetic Neuropathy of the Retina and Inflammation: Perspectives. Int. J. Mol. Sci. 2023, 24, 9166. [Google Scholar] [CrossRef] [Scilit]
- Pillar, S.; Moisseiev, E.; Sokolovska, J.; Grzybowski, A. Recent Developments in Diabetic Retinal Neurodegeneration: A Literature Review. J. Diabetes Res. 2020, 2020, 5728674. [Google Scholar] [CrossRef] [Scilit]
- Viganò, I.; Galbiati, S.; Aragona, E.; Gabellini, D.; Lattanzio, R.; Pedon, V.; Basile, G.; Arrigo, A.; Bandello, F.; Zerbini, G. Diabetes-Driven Retinal Neurodegeneration: Its Role in the Pathogenesis of Diabetic Retinopathy. Biomedicines 2025, 13, 1328. [Google Scholar] [CrossRef] [Scilit]
- Markan, A.; Agarwal, A.; Arora, A.; Bazgain, K.; Rana, V.; Gupta, V. Novel imaging biomarkers in diabetic retinopathy and diabetic macular edema. Ther. Adv. Ophthalmol. 2020, 12, 2515841420950513. [Google Scholar] [CrossRef] [Scilit]
- Hayati, A.; Abdol Homayuni, M.R.; Sadeghi, R.; Asadigandomani, H.; Dashtkoohi, M.; Eslami, S.; Soleimani, M. Advancing Diabetic Retinopathy Screening: A Systematic Review of Artificial Intelligence and Optical Coherence Tomography Angiography Innovations. Diagnostics 2025, 15, 737. [Google Scholar] [CrossRef] [Scilit]
- Cheema, A.A.; Cheema, H.R. Diabetic Macular Edema Management: A Review of Anti-Vascular Endothelial Growth Factor (VEGF) Therapies. Cureus 2024, 16, e52676. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Spaide, R.F.; Curcio, C.A. Drusen Characterization with Multimodal Imaging. Retina 2010, 30, 1441–1454. [Google Scholar] [CrossRef] [Scilit]
- Zhang, X.; Sivaprasad, S. Drusen and pachydrusen: The definition, pathogenesis, and clinical significance. Eye 2021, 35, 121–133. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Quellec, G.; Charrière, K.; Boudi, Y.; Cochener, B.; Lamard, M. Deep Image Mining for Diabetic Retinopathy Screening. Med. Image Anal. 2017, 39, 178–193. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Sundaram, S.; Selvamani, M.; Raju, S.K.; Ramaswamy, S.; Islam, S.; Cha, J.H.; Almujally, N.A.; Elaraby, A. Diabetic Retinopathy and Diabetic Macular Edema Detection Using Ensemble Based Convolutional Neural Networks. Diagnostics 2023, 13, 1001. [Google Scholar] [CrossRef] [Scilit]
- Nguyen, D.M.H.; Alam, H.M.T.; Nguyen, T.; Srivastav, D.; Profitlich, H.J.; Le, N.; Sonntag, D. Deep Learning for Ophthalmology: The State-of-the-Art and Future Trends. arXiv 2025, arXiv:2501.04073. [Google Scholar] [CrossRef] [Scilit]
- Parmar, U.P.S.; Surico, P.L.; Singh, R.B.; Romano, F.; Salati, C.; Spadea, L.; Musa, M.; Gagliano, C.; Mori, T.; Zeppieri, M. Artificial Intelligence (AI) for Early Diagnosis of Retinal Diseases. Medicina 2024, 60, 527. [Google Scholar] [CrossRef] [Scilit]
- Mutawa, A.M.; Alnajdi, S.; Sruthi, S. Transfer Learning for Diabetic Retinopathy Detection: A Study of Dataset Combination and Model Performance. Appl. Sci. 2023, 13, 5685. [Google Scholar] [CrossRef] [Scilit]
- Chavan, R.; Pete, D. Automatic multi-disease classification on retinal images using multilevel glowworm swarm convolutional neural network. J. Eng. Appl. Sci. 2024, 71, 26. [Google Scholar] [CrossRef] [Scilit]
- Ünver, H.M.; Kökver, Y.; Duman, E.; Erdem, O.A. Statistical Edge Detection and Circular Hough Transform for Optic Disk Localization. Appl. Sci. 2019, 9, 350. [Google Scholar] [CrossRef] [Scilit]
- Almotiri, J.; Elleithy, K.; Elleithy, A. Retinal Vessels Segmentation Techniques and Algorithms: A Survey. Appl. Sci. 2018, 8, 155. [Google Scholar] [CrossRef] [Scilit]
- García-Ramírez, R.A.; Gonzalez-Valadez, U.A.; Cruz-Aceves, I.; Hernández-Aguirre, A.; Trujillo-Sánchez, G.P.; Solorio-Meza, S.E.; Hernandez-González, M.A. Deep Belief Networks for Efficient Macular Edema Detection in Retinal Fundus Images. In Machine Learning Methods in Biomedical Field: Computer-Aided Diagnostics, Healthcare and Biology Applications; Moya-Albor, E., Ponce, H., Brieva, J., Gomez-Coronel, S.L., Torres, D.R., Eds.; Springer Nature: Cham, Switzerland, 2026; pp. 79–107. [Google Scholar] [CrossRef] [Scilit]
- García-Ramírez, R.A.; Cruz-Aceves, I.; Hernández-Aguirre, A.; Trujillo-Sánchez, G.P.; Hernandez-González, M.A. Evolutionary-Driven Convolutional Deep Belief Network for the Classification of Macular Edema in Retinal Fundus Images. J. Imaging 2025, 11, 123. [Google Scholar] [CrossRef] [Scilit]
- Aslanyürek, C.; Yerlikaya, T. Automatic Regular Expression Generation for Extracting Relevant Image Data from Web Pages Using Genetic Algorithms. IEEE Access 2024, 12, 90660–90669. [Google Scholar] [CrossRef] [Scilit]
- Wang, Y.; Shi, Y.; Yang, T.; Wang, W.; Sun, Z.; Zhang, Y. Structural Performance Warning Based on Computer Intelligent Monitoring and Fractional-Order Multi-Rate Kalman Fusion Method. Fractal Fract. 2026, 10, 186. [Google Scholar] [CrossRef] [Scilit]
- Tan, M.; Le, Q.V. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. arXiv 2020, arXiv:1905.11946. [Google Scholar] [CrossRef] [Scilit]
- Dong, K.; Zhou, C.; Ruan, Y.; Li, Y. MobileNetV2 Model for Image Classification. In Proceedings of the 2020 2nd International Conference on Information Technology and Computer Application (ITCA), Guangzhou, China, 18–20 December 2020. [Google Scholar] [CrossRef] [Scilit]
- Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining; ACM: New York, NY, USA, 2016; pp. 785–794. [Google Scholar] [CrossRef] [Scilit]
- Huang, G.; Liu, Z.; Van Der Maaten, L.; Weinberger, K. Densely connected convolutional networks. In Proceedings—30th IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, Hi, Hawaii, 21–26 July 2017; IEEE: New York, NY, USA, 2017; pp. 2261–2269. [Google Scholar] [CrossRef] [Scilit]
- Zhang, Z.; Zhang, H.; Zhao, L.; Chen, T.; Arik, S.O.; Pfister, T. Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding. arXiv 2021, arXiv: 2105.12723. [Google Scholar] [CrossRef] [Scilit]
- Liu, Z.; Mao, H.; Wu, C.Y.; Feichtenhofer, C.; Darrell, T.; Xie, S. A ConvNet for the 2020s. arXiv 2022, arXiv:2201.03545. [Google Scholar] [CrossRef] [Scilit]
- Chechekhina, E.; Voloshin, N.; Solopov, M.; Tyurin-Kuzmin, P.; Kulebyakin, K. Traditional machine learning in biomedical image analysis: Before you go too deep. Front. Artif. Intell. 2026, 9, 1695230. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Buvat, I.; Dutta, J.; Jha, A.K.; Siegel, E.; Yousefirizi, F.; Rahmim, A.; Bradshaw, T. Should end-to-end deep learning replace handcrafted radiomics? Eur. J. Nucl. Med. Mol. Imaging 2025, 52, 4360–4363. [Google Scholar] [CrossRef] [Scilit]
- de Moura, J.; Vidal, P.L.; Novo, J.; Rouco, J.; Penedo, M.G.; Ortega, M. Feature definition and comprehensive analysis on the robust identification of intraretinal cystoid regions using optical coherence tomography images. Pattern Anal. Appl. 2021, 25, 1–15. [Google Scholar] [CrossRef] [Scilit]








| Metric | Min | Max | Mean | Median | Std. Dev. |
|---|---|---|---|---|---|
| MCC | 0.7144 | 0.8433 | 0.7829 | 0.7826 | 0.04475 |
| Accuracy | 0.8571 | 0.9286 | 0.9008 | 0.9048 | 0.02174 |
| F1-Score | 0.8125 | 0.8966 | 0.8529 | 0.8462 | 0.02939 |
| Precision | 0.7222 | 1.000 | 0.8525 | 0.8619 | 0.06912 |
| Recall | 0.7857 | 0.9286 | 0.8619 | 0.8571 | 0.06746 |
| Model | Accuracy | F1-Score | Recall | mcc |
|---|---|---|---|---|
| EfficientNetB0 [31] | 0.6279 | 0.5905 | 0.5948 | 0.1839 |
| HOG | 0.6744 | 0.5000 | 0.5000 | 0.2586 |
| Random Forest | 0.7358 | 0.7016 | 0.7358 | 0.3654 |
| GLCM (Haralick) | 0.7442 | 0.4762 | 0.3571 | 0.3658 |
| MobileNetV2 [32] | 0.6512 | 0.6481 | 0.7044 | 0.3884 |
| Gabor | 0.7442 | 0.5600 | 0.5000 | 0.3889 |
| XGBoost [33] | 0.7547 | 0.7363 | 0.7547 | 0.4189 |
| LBP | 0.7907 | 0.6400 | 0.5714 | 0.5026 |
| DenseNet121 [34] | 0.8140 | 0.7952 | 0.8067 | 0.5946 |
| SVM | 0.8302 | 0.8260 | 0.8302 | 0.6108 |
| NesT-Base [35] | 0.8302 | 0.8174 | 0.8302 | 0.6154 |
| Logistic Regression L2 | 0.8302 | 0.8329 | 0.8302 | 0.6409 |
| ConvNeXtTiny [36] | 0.8605 | 0.8626 | 0.8605 | 0.6972 |
| Proposed Method | 0.9286 | 0.8966 | 0.9286 | 0.8433 |
| Model | Training Time | Test Time | Mean Time per Image | Std. Dev. |
|---|---|---|---|---|
| ConvNeXtTiny | 82.2875 | 6.8226 | 0.0779 | 0.0036 |
| DenseNet121 | 145.5829 | 18.6904 | 0.0840 | 0.0029 |
| EfficientNetB0 | 108.1226 | 11.0021 | 0.0760 | 0.0030 |
| MobileNetV2 | 64.6640 | 7.0957 | 0.0734 | 0.0029 |
| NesT-Base | 44.1216 | 0.5660 | 0.0210 | 0.0027 |
| GLCM (Haralick) | 0.0019 | 0.0003 | <0.0001 | — |
| Gabor | 0.0018 | 0.0002 | <0.0001 | — |
| HOG | 0.0112 | 0.0004 | <0.0001 | — |
| LBP | 0.0233 | 0.0003 | <0.0001 | — |
| SVM | 0.0371 | 0.0161 | 0.0010 | 0.0001 |
| Logistic Regression L2 | 0.1657 | 0.0022 | 0.0007 | 0.0001 |
| Proposed Method | 0.2305 | 0.0576 | 0.0013 | 0.0003 |
| Random Forest | 1.8824 | 0.0262 | 0.0244 | 0.0011 |
| XGBoost | 9.3886 | 0.0014 | 0.0005 | 0.0001 |
| Metric | Value | CIlow | CIhigh |
|---|---|---|---|
| MCC | 0.843 | 0.641 | 1.000 |
| Accuracy | 0.929 | 0.833 | 1.000 |
| Macro F1 | 0.897 | 0.816 | 1.000 |
| Weighted F1 | 0.928 | 0.844 | 1.000 |
| Balanced Accuracy | 0.911 | 0.802 | 1.000 |
| AUROC (macro) | 0.934 | 0.837 | 1.000 |
| AUPRC (macro) | 0.911 | 0.792 | 1.000 |
| Metric | Mean | Std. Dev. | Median | Min | Max |
|---|---|---|---|---|---|
| MCC | 0.4748 | 0.1607 | 0.4697 | −0.1260 | 0.8454 |
| Accuracy | 0.7592 | 0.0953 | 0.7642 | 0.4375 | 0.9375 |
| Macro F1 | 0.7160 | 0.0945 | 0.7216 | 0.4182 | 0.9227 |
| Protocol | Search Strategy | Mean MCC | Median MCC | 95% CI MCC | Mean Macro F1 |
|---|---|---|---|---|---|
| Grouped repeated cross-validation | Proposed representation | 0.5642 | 0.5843 | 0.5122–0.6144 | 0.7549 |
| Grouped nested cross-validation | Two-phase TPE | 0.4714 | 0.5138 | 0.3833–0.5485 | 0.7112 |
| Grouped nested cross-validation | One-phase TPE | 0.4823 | 0.4557 | 0.4310–0.5329 | 0.7082 |
| Grouped nested cross-validation | Random search | 0.5234 | 0.5637 | 0.4596–0.5856 | 0.7263 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
García-Ramírez, R.A.; Cruz-Aceves, I.; Hernández-Aguirre, A.; Lopez-Hernandez, J.-M.; Trujillo-Sánchez, G.P.; Hernandez-González, M.A. Surrogate-Based Optimization of Interpretable Regular Expression Patterns for the Classification of Retinal Lesions in Retinal Fundus Images. Algorithms 2026, 19, 440. https://doi.org/10.3390/a19060440
García-Ramírez RA, Cruz-Aceves I, Hernández-Aguirre A, Lopez-Hernandez J-M, Trujillo-Sánchez GP, Hernandez-González MA. Surrogate-Based Optimization of Interpretable Regular Expression Patterns for the Classification of Retinal Lesions in Retinal Fundus Images. Algorithms. 2026; 19(6):440. https://doi.org/10.3390/a19060440
Chicago/Turabian StyleGarcía-Ramírez, Rafael A., Ivan Cruz-Aceves, Arturo Hernández-Aguirre, Juan-Manuel Lopez-Hernandez, Gloria P. Trujillo-Sánchez, and Martha A. Hernandez-González. 2026. "Surrogate-Based Optimization of Interpretable Regular Expression Patterns for the Classification of Retinal Lesions in Retinal Fundus Images" Algorithms 19, no. 6: 440. https://doi.org/10.3390/a19060440
APA StyleGarcía-Ramírez, R. A., Cruz-Aceves, I., Hernández-Aguirre, A., Lopez-Hernandez, J.-M., Trujillo-Sánchez, G. P., & Hernandez-González, M. A. (2026). Surrogate-Based Optimization of Interpretable Regular Expression Patterns for the Classification of Retinal Lesions in Retinal Fundus Images. Algorithms, 19(6), 440. https://doi.org/10.3390/a19060440

