Gallstone Classification Using Random Forest Optimized by Sand Cat Swarm Optimization Algorithm with SHAP and DiCE-Based Interpretability
Abstract
1. Introduction
- ■
- We have used the Sand Cat Swarm Optimization (SCSO) algorithm for simultaneous feature selection and hyperparameter tuning within the Random Forest (RF) framework for gallstone classification;
- ■
- We have introduced a metaheuristic-based optimization pipeline that reduces the number of features while improving classification accuracy and computational efficiency in clinical usages;
- ■
- The proposed model incorporates interpretable AI techniques, including SHAP for detailed feature contribution analysis and DiCE for generating counterfactual explanations, enabling a clinically meaningful understanding of predictions;
- ■
- In this study, the model’s performance has been systematically evaluated across multiple metrics, including accuracy, F1-score, precision, recall, AUC, ROC, and execution time, demonstrating both effectiveness and efficiency.
2. Materials and Methods
2.1. Dataset
2.2. Random Forest Classifier
2.3. Sand Cat Swarm Optimization
2.3.1. Justification of Choosing SCSO
2.3.2. Optimizer Problem Development
Algorithm 1 MHA-Based Optimization for Each Training Fold Using RF Hyperparameters |
|
2.3.3. Performance Evaluation
2.3.4. SHAP-Based Interpretability
2.3.5. Diverse Counterfactual Explanations (DiCE)
3. Results
3.1. Only Classifier Without Cross-Validation
3.2. Only Classifier with Cross-Validation
3.2.1. Optimized Classifier with Cross-Validation
3.2.2. Controlling the Overfitting
3.2.3. Computational Complexity
3.2.4. Misclassifications
3.3. SHAP Analysis
3.3.1. SHAP of Only Classifier Without Cross-Validation
3.3.2. SHAP of Only Classifier with Cross-Validation
3.3.3. SHAP for RF-SCSO
3.4. DiCE Analysis
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Lammert, F.; Gurusamy, K.; Ko, C.W.; Miquel, J.; Méndez-Sánchez, N.; Portincasa, P.; van Erpecum, K.J.; Laarhoven, C.J.; Wang, D.Q.-H. Gallstones. Nat. Rev. Dis. Prim. 2016, 2, 16024. [Google Scholar] [CrossRef] [PubMed]
- Gurusamy, K.S.; Davidson, B.R. Gallstones. BMJ 2014, 348, g2669. [Google Scholar] [CrossRef] [PubMed]
- Cariati, A. Gallstone classification in western countries. Indian J. Surg. 2015, 77 (Suppl. 2), 376–380. [Google Scholar] [CrossRef] [PubMed]
- Thamer, S.J. Pathogenesis, diagnosis and treatment of gallstone disease: A brief review. Biomed. Chem. Sci. 2022, 1, 70–77. [Google Scholar] [CrossRef]
- Bozdag, A.; Yildirim, M.; Karaduman, M.; Mutlu, H.B.; Karaduman, G.; Aksoy, A. Detection of Gallbladder Disease Types Using a Feature Engineering-Based Developed CBIR System. Diagnostics 2025, 15, 552. [Google Scholar] [CrossRef]
- Wang, L.F.; Wang, Q.; Mao, F.; Xu, S.H.; Sun, L.P.; Wu, T.F.; Zhou, B.Y.; Yin, H.H.; Shi, H.; Zhang, Y.Q.; et al. Risk stratification of gallbladder masses by machine learning-based ultrasound radiomics models: A prospective and multi-institutional study. Eur. Radiol. 2023, 33, 8899–8911. [Google Scholar] [CrossRef]
- Obaid, A.M.; Turki, A.; Bellaaj, H.; Ksantini, M.; AlTaee, A.; Alaerjan, A. Detection of gallbladder disease types using deep learning: An informative medical method. Diagnostics 2023, 13, 1744. [Google Scholar] [CrossRef]
- Pang, S.; Ding, T.; Qiao, S.; Meng, F.; Wang, S.; Li, P.; Wang, X. A novel YOLOv3-arch model for identifying cholelithiasis and classifying gallstones on CT images. PLoS ONE 2019, 14, e0217647. [Google Scholar] [CrossRef]
- Hong, C.; Zafar, I.; Ayaz, M.M.; Kanwal, R.; Kanwal, F.; Dauelbait, M.; Bourhia, M.; Jardan, Y.A.B. Analysis of Machine Learning Algorithms for Real-Time Gallbladder Stone Identification from Ultrasound Images in Clinical Decision Support Systems. Int. J. Comput. Intell. Syst. 2025, 18, 73. [Google Scholar] [CrossRef]
- Esen, İ.; Arslan, H.; Esen, S.A.; Gülşen, M.; Kültekin, N.; Özdemir, O. Early prediction of gallstone disease with a machine learning-based method from bioimpedance and laboratory data. Medicine 2024, 103, e37258. [Google Scholar] [CrossRef]
- Rajwar, K.; Deep, K.; Das, S. An exhaustive review of the metaheuristic algorithms for search and optimization: Taxonomy, applications, and open challenges. Artif. Intell. Rev. 2023, 56, 13187–13257. [Google Scholar] [CrossRef]
- Sarker, P.; Ksibi, A.; Jamjoom, M.M.; Choi, K.; Nahid, A.A.; Samad, M.A. Breast cancer prediction with feature-selected XGB classifier, optimized by metaheuristic algorithms. J. Big Data 2025, 12, 78. [Google Scholar] [CrossRef]
- Stephan, P.; Stephan, T.; Kannan, R.; Abraham, A. A hybrid artificial bee colony with whale optimization algorithm for improved breast cancer diagnosis. Neural Comput. Appl. 2021, 33, 13667–13691. [Google Scholar] [CrossRef]
- Li, G.; Tan, Z.; Xu, W.; Xu, F.; Wang, L.; Chen, J.; Wu, K. A particle swarm optimization improved BP neural network intelligent model for electrocardiogram classification. BMC Med. Inform. Decis. Mak. 2021, 21 (Suppl. 2), 99. [Google Scholar] [CrossRef] [PubMed]
- Qtaish, A.; Albashish, D.; Braik, M.; Alshammari, M.T.; Alreshidi, A.; Alreshidi, E.J. Memory-based sand cat swarm optimization for feature selection in medical diagnosis. Electronics 2023, 12, 2042. [Google Scholar] [CrossRef]
- Anupama, C.S.S.; Yonbawi, S.; Moses, G.J.; Lydia, E.L.; Kadry, S.; Kim, J. Sand cat swarm optimization with deep transfer learning for skin cancer classification. Comput. Syst. Sci. Eng. 2023, 47, 2079–2095. [Google Scholar] [CrossRef]
- Al-Tashi, Q.; Rais, H.; Jadid, S. Feature selection method based on grey wolf optimization for coronary artery disease classification. In International Conference of Reliable Information and Communication Technology; Springer International Publishing: Cham, Switzerland, 2018; pp. 257–266. [Google Scholar]
- Le, T.M.; Pham, T.N.; Dao, S.V.T. A novel wrapper-based feature selection for heart failure prediction using an adaptive particle swarm grey wolf optimization. In Enhanced Telemedicine and e-Health: Advanced IoT Enabled Soft Computing Framework; Springer International Publishing: Cham, Switzerland, 2021; pp. 315–336. [Google Scholar]
- Vlontzou, M.E.; Athanasiou, M.; Dalakleidi, K.V.; Skampardoni, I.; Davatzikos, C.; Nikita, K. A comprehensive interpretable machine learning framework for mild cognitive impairment and Alzheimer’s disease diagnosis. Sci. Rep. 2025, 15, 8410. [Google Scholar] [CrossRef]
- Su, J.; Lu, H.; Zhang, R.; Cui, N.; Chen, C.; Si, Q.; Song, B. Cervical cancer prediction using machine learning models based on routine blood analysis. Sci. Rep. 2025, 15, 22655. [Google Scholar] [CrossRef]
- AlJalaud, E.; Hosny, M. Counterfactual explanation of AI models using an adaptive genetic algorithm with embedded feature weights. IEEE Access 2024, 12, 74993–75009. [Google Scholar] [CrossRef]
- Akoglu, H. User’s guide to correlation coefficients. Turk. J. Emerg. Med. 2018, 18, 91–93. [Google Scholar] [CrossRef]
- Breiman, L. Random forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
- Fawagreh, K.; Gaber, M.M.; Elyan, E. Random forests: From early developments to recent advancements. Syst. Sci. Control Eng. Open Access J. 2014, 2, 602–609. [Google Scholar] [CrossRef]
- Sheykhmousa, M.; Mahdianpari, M.; Ghanbari, H.; Mohammadimanesh, F.; Ghamisi, P.; Homayouni, S. Support vector machine versus random forest for remote sensing image classification: A meta-analysis and systematic review. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2020, 13, 6308–6325. [Google Scholar] [CrossRef]
- Seyyedabbasi, A.; Kiani, F. Sand Cat swarm optimization: A nature-inspired algorithm to solve global optimization problems. Eng. Comput. 2023, 39, 2627–2651. [Google Scholar] [CrossRef]
- Anka, F.; Aghayev, N. Advances in sand cat swarm optimization: A comprehensive study. Arch. Comput. Methods Eng. 2025, 32, 2669–2712. [Google Scholar] [CrossRef]
- Srinivasan, C.; Sheeba, J.C. Energy management of hybrid energy storage system in electric vehicle based on hybrid SCSO-RERNN approach. J. Energy Storage 2024, 78, 109733. [Google Scholar]
- Xiao, D.; Li, B.; Shan, J.; Yan, Z.; Huang, J. SOC estimation of vanadium redox flow batteries based on the ISCSO-ELM algorithm. ACS Omega 2023, 8, 45708–45714. [Google Scholar] [CrossRef]
- Lundberg, S.M.; Lee, S.I. A unified approach to interpreting model predictions. In Proceedings of the Advances in Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; Volume 30. [Google Scholar]
- Shapley, L.S. A value for n-person games. In Contributions to the Theory of Games II; Princeton University Press: Princeton, NJ, USA, 1953. [Google Scholar]
- Mothilal, R.K.; Sharma, A.; Tan, C. Explaining machine learning classifiers through diverse counterfactual explanations. In Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency, Barcelona, Spain, 27–30 January 2020; pp. 607–617. [Google Scholar]
- Rajab, I.M.; Majerczyk, D.; Olson, M.E.; Addams, J.M.; Choe, M.L.; Nelson, M.S.; Potempa, L.A. C-reactive protein in gallbladder diseases: Diagnostic and therapeutic insights. Biophys. Rep. 2020, 6, 49–67. [Google Scholar] [CrossRef]
- Jiang, Z.; Jiang, H.; Zhu, X.; Zhao, D.; Su, F. The relationship between high-sensitivity C-reactive protein and gallstones: A cross-sectional analysis. Front. Med. 2024, 11, 1453129. [Google Scholar] [CrossRef]
- Liu, T.; Siyin, S.T.; Yao, N.; Duan, N.; Xu, G.; Li, W.; Qu, J.; Liu, S. Relationship between high-sensitivity C reactive protein and the risk of gallstone disease: Results from the Kailuan cohort study. BMJ Open 2020, 10, e035880. [Google Scholar] [CrossRef]
- Bin, C.; Zhang, C. The association between vitamin D consumption and gallstones in US adults: A cross-sectional study from the national health and nutrition examination survey. J. Formos. Med. Assoc. 2025, 124, 212–217. [Google Scholar] [CrossRef]
- Olokoba, A.B.; Bojuwoye, B.J.; Olokoba, L.B.; Braimoh, K.T.; Inikori, A.K.; Abdulkareem, A.A. Relationship between gallstone disease and liver enzymes. Res. J. Med. Sci. 2009, 3, 1–3. [Google Scholar]
- Shi, A.; Xiao, S.; Wang, Y.; He, X.; Dong, L.; Wang, Q.; Lu, X.; Jiang, J.; Shi, H. Metabolic abnormalities, liver enzymes increased risk of gallstones: A cross-sectional study and multivariate mendelian randomization analysis. Intern. Emerg. Med. 2025, 20, 501–508. [Google Scholar] [CrossRef]
Fet. Index | Feature Name | Type | Description |
---|---|---|---|
Target | Gallstone Status | Bin. | Presence (0) or absence (1) of gallstones |
0 | Age | Int. | Patient’s age |
1 | Gender | Cat. | Patient’s sex |
2 | Comorbidity | Cat. | Other existing diseases |
3 | Coronary Artery Disease (CAD) | Bin. | Heart disease presence |
4 | Hypothyroidism | Bin. | Underactive thyroid presence |
5 | Hyperlipidemia | Bin. | Elevated blood fats |
6 | Diabetes Mellitus (DM) | Bin. | Diabetes presence |
7 | Height | Int. | Patient’s height |
8 | Weight | Con. | Patient’s weight |
9 | Body Mass Index (BMI) | Con. | Weight-to-height ratio |
10 | Total Body Water (TBW) | Con. | Total body water volume |
11 | Extracellular Water (ECW) | Con. | Water outside cells |
12 | Intracellular Water (ICW) | Con. | Water inside cells |
13 | ECF/TBW Ratio | Con. | Ratio of extracellular fluid to total water |
14 | Total Body Fat Ratio (TBFR) | Con. | Percentage of body fat |
15 | Lean Mass (LM) | Con. | Lean tissue mass |
16 | Body Protein Content (Protein) | Con. | Total protein amount |
17 | Visceral Fat Rating (VFR) | Int. | Fat around organs |
18 | Bone Mass (BM) | Con. | Bone tissue mass |
19 | Muscle Mass (MM) | Con. | Muscle tissue mass |
20 | Obesity | Con. | Level of excess fat |
21 | Total Fat Content (TFC) | Con. | Total fat quantity |
22 | Visceral Fat Area (VFA) | Con. | Area of visceral fat |
23 | Visceral Muscle Area (VMA) | Con. | Area of visceral muscle |
24 | Hepatic Fat Accumulation (HFA) | Cat. | Liver fat buildup |
25 | Glucose | Con. | Blood sugar level |
26 | Total Cholesterol (TC) | Con. | Total cholesterol level |
27 | Low Density Lipoprotein (LDL) | Con. | “Bad” cholesterol level |
28 | High Density Lipoprotein (HDL) | Con. | “Good” cholesterol level |
29 | Triglyceride | Con. | Blood triglyceride level |
30 | Aspartat Aminotransferaz (AAST) | Con. | Liver enzyme level |
31 | Alanin Aminotransferaz (ALT) | Con. | Liver enzyme level |
32 | Alkaline Phosphatase (ALP) | Con. | Liver and bone enzyme |
33 | Creatinine | Con. | Kidney function marker |
34 | Glomerular Filtration Rate (GFR) | Con. | Kidney filtration rate |
35 | C-Reactive Protein (CRP) | Con. | Inflammation marker |
36 | Hemoglobin (HGB) | Con. | Oxygen-carrying blood protein |
37 | Vitamin D | Con. | Vitamin level for bone health |
Train | Test | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Time (ms) | Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Time (ms) | |
100.00 | 100.00 | 100.00 | 100.00 | 230.46 | 81.25 | 79.07 | 85.00 | 73.91 | 15.03 |
Fold | Train | Test | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Time (ms) | Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Time (ms) | ||
1 | 100.00 | 100.00 | 100.00 | 100.00 | 499.75 | 80.00 | 79.12 | 80.00 | 78.26 | 9.22 | |
2 | 100.00 | 100.00 | 100.00 | 100.00 | 207.56 | 82.11 | 79.01 | 80.00 | 78.05 | 12.63 | |
3 | 100.00 | 100.00 | 100.00 | 100.00 | 210.55 | 77.89 | 77.89 | 75.51 | 80.43 | 8.50 | |
4 | 100.00 | 100.00 | 100.00 | 100.00 | 206.77 | 75.79 | 75.27 | 76.09 | 74.47 | 8.74 | |
5 | 100.00 | 100.00 | 100.00 | 100.00 | 216.70 | 76.84 | 77.08 | 82.22 | 72.55 | 9.08 | |
6 | 100.00 | 100.00 | 100.00 | 100.00 | 303.06 | 76.84 | 73.81 | 79.49 | 68.89 | 13.25 | |
7 | 100.00 | 100.00 | 100.00 | 100.00 | 207.28 | 74.74 | 73.91 | 75.56 | 72.34 | 11.16 | |
8 | 100.00 | 100.00 | 100.00 | 100.00 | 224.96 | 78.95 | 79.17 | 82.61 | 76.00 | 8.15 | |
9 | 100.00 | 100.00 | 100.00 | 100.00 | 219.02 | 76.84 | 78.43 | 80.00 | 76.92 | 8.50 | |
10 | 100.00 | 100.00 | 100.00 | 100.00 | 233.61 | 84.21 | 83.87 | 88.64 | 79.59 | 8.97 | |
Mean | 100.00 | 100.00 | 100.00 | 100.00 | 252.93 | 78.42 | 77.75 | 80.01 | 75.75 | 9.82 |
Fold | Feature Indexes | ||||
---|---|---|---|---|---|
1 | 30, 33, 37 | 290 | 10 | 2 | 1 |
2 | 16, 30, 33 | 273 | 10 | 2 | 1 |
3 | 27, 33, 35, 37 | 105 | 10 | 2 | 1 |
4 | 16, 25, 33 | 156 | 9 | 2 | 1 |
5 | 6, 7, 8, 20, 27 | 228 | 10 | 2 | 1 |
6 | 12, 33, 35 | 252 | 10 | 2 | 1 |
7 | 16, 37 | 136 | 10 | 2 | 1 |
8 | 25, 30, 37 | 178 | 10 | 2 | 1 |
9 | 7, 27, 30, 32 | 290 | 10 | 2 | 1 |
10 | 8, 16 | 290 | 9 | 2 | 1 |
Finalized | 6, 7, 8, 12, 16, 20, 25, 27, 30, 32, 33, 35, 37 | 290 | 10 | 2 | 1 |
Fold | Train | Test | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Time (ms) | Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Time (ms) | ||
1 | 100.00 | 100.00 | 100.00 | 100.00 | 1126.85 | 81.05 | 80.00 | 81.82 | 78.26 | 64.64 | |
2 | 100.00 | 100.00 | 100.00 | 100.00 | 1358.37 | 80.00 | 78.16 | 73.91 | 82.93 | 26.65 | |
3 | 100.00 | 100.00 | 100.00 | 100.00 | 794.87 | 77.89 | 76.92 | 77.78 | 76.09 | 13.43 | |
4 | 100.00 | 100.00 | 100.00 | 100.00 | 523.95 | 80.00 | 79.12 | 81.82 | 76.60 | 7.73 | |
5 | 100.00 | 100.00 | 100.00 | 100.00 | 506.59 | 73.68 | 72.53 | 82.50 | 64.71 | 7.99 | |
6 | 100.00 | 100.00 | 100.00 | 100.00 | 529.04 | 76.84 | 73.81 | 79.49 | 68.89 | 9.80 | |
7 | 100.00 | 100.00 | 100.00 | 100.00 | 812.72 | 76.84 | 75.00 | 80.49 | 70.21 | 10.35 | |
8 | 100.00 | 100.00 | 100.00 | 100.00 | 517.15 | 75.79 | 76.29 | 78.72 | 74.00 | 8.34 | |
9 | 100.00 | 100.00 | 100.00 | 100.00 | 677.25 | 77.89 | 79.61 | 80.39 | 78.85 | 12.89 | |
10 | 100.00 | 100.00 | 100.00 | 100.00 | 514.08 | 83.16 | 82.98 | 86.67 | 79.59 | 7.71 | |
Mean | 100.00 | 100.00 | 100.00 | 100.00 | 736.09 | 78.32 | 77.44 | 80.36 | 75.01 | 16.95 |
Train | Test | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Time (ms) | Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Time (ms) | |
100.00 | 100.00 | 100.00 | 100.00 | 518.94 | 79.17 | 77.78 | 79.55 | 76.09 | 21.80 |
Max Depth | Train | Test | Gap (%) | |||||||
---|---|---|---|---|---|---|---|---|---|---|
Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | Acc. (%) | F1 (%) | Pre. (%) | Rec. (%) | |||
1 | 78.48 | 76.70 | 82.29 | 71.82 | 75.00 | 73.33 | 78.57 | 68.75 | 3.48 | |
2 | 82.06 | 81.13 | 84.31 | 78.18 | 77.08 | 76.09 | 79.55 | 72.92 | 4.98 | |
3 | 88.34 | 87.62 | 92.00 | 83.64 | 79.17 | 78.72 | 80.43 | 77.08 | 9.17 | |
4 | 92.38 | 91.87 | 96.97 | 87.27 | 79.17 | 79.59 | 78.00 | 81.25 | 13.21 | |
5 | 97.31 | 97.20 | 100.00 | 94.55 | 78.13 | 77.89 | 78.72 | 77.08 | 19.18 | |
6 | 98.21 | 98.15 | 100.00 | 96.36 | 77.08 | 77.55 | 76.00 | 79.17 | 21.12 | |
7 | 99.55 | 99.54 | 100.00 | 99.09 | 77.08 | 77.08 | 77.08 | 77.08 | 22.47 | |
8 | 100.00 | 100.00 | 100.00 | 100.00 | 79.17 | 79.59 | 78.00 | 81.25 | 20.83 | |
9 | 100.00 | 100.00 | 100.00 | 100.00 | 79.17 | 79.59 | 78.00 | 81.25 | 20.83 | |
10 | 100.00 | 100.00 | 100.00 | 100.00 | 81.25 | 82.00 | 78.85 | 85.42 | 18.75 | |
11 | 100.00 | 100.00 | 100.00 | 100.00 | 82.29 | 82.83 | 80.39 | 85.42 | 17.71 | |
12 | 100.00 | 100.00 | 100.00 | 100.00 | 81.25 | 82.00 | 78.85 | 85.42 | 18.75 | |
13 | 100.00 | 100.00 | 100.00 | 100.00 | 80.21 | 80.81 | 78.43 | 83.33 | 19.79 | |
14 | 100.00 | 100.00 | 100.00 | 100.00 | 82.29 | 83.17 | 79.25 | 87.50 | 17.71 | |
15 | 100.00 | 100.00 | 100.00 | 100.00 | 82.29 | 83.17 | 79.25 | 87.50 | 17.71 | |
16 | 100.00 | 100.00 | 100.00 | 100.00 | 82.29 | 83.17 | 79.25 | 87.50 | 17.71 | |
17 | 100.00 | 100.00 | 100.00 | 100.00 | 82.29 | 83.17 | 79.25 | 87.50 | 17.71 | |
18 | 100.00 | 100.00 | 100.00 | 100.00 | 82.29 | 83.17 | 79.25 | 87.50 | 17.71 | |
19 | 100.00 | 100.00 | 100.00 | 100.00 | 82.29 | 83.17 | 79.25 | 87.50 | 17.71 | |
20 | 100.00 | 100.00 | 100.00 | 100.00 | 82.29 | 83.17 | 79.25 | 87.50 | 17.71 |
Only RF Classifier with 10-fold Cross-Validation | |||||
---|---|---|---|---|---|
Fold | Training Time | Testing Time | |||
Fold-Wise (ms) | Per Sample (ms) | Fold-Wise (ms) | Per Sample (ms) | ||
01 | 499.75 | 2.231 | 9.22 | 0.097 | |
02 | 207.56 | 0.927 | 12.63 | 0.133 | |
03 | 210.55 | 0.940 | 8.50 | 0.089 | |
04 | 206.77 | 0.923 | 8.74 | 0.092 | |
05 | 216.70 | 0.967 | 9.08 | 0.096 | |
06 | 303.06 | 1.353 | 13.25 | 0.139 | |
07 | 207.28 | 0.925 | 11.16 | 0.117 | |
08 | 224.96 | 1.004 | 8.15 | 0.086 | |
09 | 219.02 | 0.978 | 8.50 | 0.089 | |
10 | 233.61 | 1.043 | 8.97 | 0.094 | |
Mean | 252.93 | 1.129 | 9.82 | 0.103 | |
RF–SCSO with 10-fold cross-validation | |||||
Fold | Training Time | Testing Time | |||
Fold-wise (ms) | Per Sample (ms) | Fold-wise (ms) | Per Sample (ms) | ||
01 | 1126.85 | 5.031 | 64.64 | 0.680 | |
02 | 1358.37 | 6.064 | 26.65 | 0.281 | |
03 | 794.87 | 3.549 | 13.43 | 0.141 | |
04 | 523.95 | 2.339 | 7.73 | 0.081 | |
05 | 506.59 | 2.262 | 7.99 | 0.084 | |
06 | 529.04 | 2.362 | 9.80 | 0.103 | |
07 | 812.72 | 3.628 | 10.35 | 0.109 | |
08 | 517.15 | 2.309 | 8.34 | 0.088 | |
09 | 677.25 | 3.023 | 12.89 | 0.136 | |
10 | 514.08 | 2.295 | 7.71 | 0.081 | |
Mean | 736.09 | 3.286 | 16.95 | 0.178 |
Feature | Index 73 | Index 116 | Index 118 | Index 147 | Index 94 | Mean |
---|---|---|---|---|---|---|
ALP | 66 | 157 | 46 | 70 | 92 | 86.2 |
Creatinine | 1.03 | 0.69 | 0.64 | 0.68 | 0.63 | 0.734 |
CRP | 0.63 | 0.18 | 0.00 | 2.00 | 0.78 | 0.718 |
Vitamin D | 10.9 | 13.7 | 8.23 | 28.5 | 21.8 | 16.626 |
DM | 0 | 0 | 0 | 0 | 0 | 0.0 |
Height | 179 | 156 | 161 | 146 | 158 | 160.0 |
Weight | 81.9 | 56.9 | 70.4 | 63.6 | 92.5 | 73.06 |
ICW | 28.0 | 15.4 | 20.4 | 15.9 | 20.1 | 19.96 |
Protein (%) | 17.63 | 15.92 | 15.13 | 16.23 | 12.43 | 15.468 |
Obesity (%) | 16.2 | 14.9 | 23.5 | 35.6 | 68.5 | 31.74 |
Glucose | 91 | 99 | 85 | 107 | 92 | 94.8 |
LDL | 160 | 167 | 129 | 221 | 129 | 161.2 |
AAST | 17 | 14 | 13 | 15 | 18 | 15.4 |
Feature | In. 176 | In. 211 | In. 177 | In. 299 | In. 194 | In. 316 | In. 195 | In. 203 | In. 250 | Mean |
---|---|---|---|---|---|---|---|---|---|---|
ALP | 127 | 75 | 73 | 92 | 70 | 94 | 56 | 87 | 63 | 81.89 |
Creatinine | 1.00 | 1.09 | 0.87 | 1.24 | 1.34 | 1.04 | 0.64 | 0.75 | 0.70 | 0.963 |
CRP | 0.60 | 0.50 | 0.55 | 0.20 | 0.20 | 0.00 | 0.00 | 0.26 | 0.20 | 0.279 |
Vitamin D | 12.7 | 26.0 | 23.3 | 36.9 | 26.7 | 15.7 | 30.5 | 25.8 | 12.2 | 23.31 |
DM | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0.222 |
Height | 177 | 179 | 165 | 172 | 176 | 172 | 163 | 153 | 169 | 169.56 |
Weight | 78.6 | 95.8 | 64.0 | 78.8 | 116.1 | 96.6 | 68.5 | 74.7 | 71.3 | 82.71 |
ICW | 25.4 | 29.0 | 22.4 | 23.9 | 32.8 | 28.2 | 19.6 | 17.2 | 23.0 | 24.17 |
Protein (%) | 19.20 | 15.85 | 15.35 | 18.47 | 14.13 | 15.87 | 14.99 | 13.77 | 14.98 | 15.96 |
Obesity (%) | 14.1 | 21.95 | 6.8 | 21.0 | 70.5 | 48.4 | 17.1 | 45.0 | 1.9 | 27.64 |
Glucose | 110 | 92 | 88 | 101 | 118 | 122 | 98 | 108 | 284 | 115.67 |
LDL | 149 | 127 | 147 | 125 | 88 | 153 | 140 | 101 | 79 | 123.22 |
AAST | 26 | 16 | 21 | 17 | 17 | 21 | 24 | 29 | 17 | 21.00 |
Serial No | CRP | Vitamin D | AAST | Gallstone Status |
---|---|---|---|---|
1 | 0.6 → 12.8 | 12.7 | 26.0 | 0 → 1 |
2 | 0.6 → 14.7 | 12.7 | 26.0 → 144.9 | 0 → 1 |
3 | 0.6 → 6.5 | 12.7 → 20.4 | 26.0 | 0 → 1 |
4 | 0.6 → 8.2 | 12.7 → 25.0 | 26.0 | 0 → 1 |
5 | 0.6 → 15.2 | 12.7 | 26.0 | 0 → 1 |
6 | 0.6 → 3.0 | 12.7 | 26.0 | 0 → 1 |
7 | 0.6 → 6.6 | 12.7 → 20.8 | 26.0 | 0 → 1 |
8 | 0.6 → 12.7 | 12.7 | 26.0 → 126.0 | 0 → 1 |
9 | 0.6 → 10.8 | 12.7 → 31.8 | 26.0 | 0 → 1 |
10 | 0.6 → 13.8 | 12.7 | 26.0 → 136.0 | 0 → 1 |
Serial No | CRP | Vitamin D | AAST | Gallstone Status |
---|---|---|---|---|
1 | 0.63 | 10.9 → 18.1 | 17.0 → 60.4 | 1 → 0 |
2 | 0.63 | 10.9 → 36.2 | 17.0 → 124.0 | 1 → 0 |
3 | 0.63 | 10.9 → 37.9 | 17.0 → 129.9 | 1 → 0 |
4 | 0.63 | 10.9 | 17.0 → 51.6 | 1 → 0 |
5 | 0.63 | 10.9 → 39.7 | 17.0 | 1 → 0 |
6 | 0.63 | 10.9 | 17.0 → 47.8 | 1 → 0 |
7 | 0.63 | 10.9 → 28.8 | 17.0 → 98.0 | 1 → 0 |
8 | 0.63 | 10.9 → 41.6 | 17.0 → 143.0 | 1 → 0 |
9 | 0.63 | 10.9 | 17.0 → 112.3 | 1 → 0 |
10 | 0.63 | 10.9 → 37.0 | 17.0 → 126.9 | 1 → 0 |
Serial No | CRP | Vitamin D | AAST | Gallstone Status |
---|---|---|---|---|
1 | 13.9 → 0.1 | 13.6 | 36.0 | 1 → 0 |
2 | 13.9 → 0.3 | 13.6 | 36.0 | 1 → 0 |
3 | 13.9 → 0.4 | 13.6 | 36.0 | 1 → 0 |
4 | 13.9 → 0.5 | 13.6 | 36.0 | 1 → 0 |
5 | 13.9 → 0.1 | 13.6 → 3.9 | 36.0 | 1 → 0 |
SL | Author | Dataset Type | Performance |
---|---|---|---|
01 | Bozdag et al. [5] | Image | Accuracy = 94.4 % |
02 | Wang et al [6] | Image | AUC = 0.995 |
03 | Obaid et al. [7] | Image | Accuracy = 98% |
04 | Pang et al. [8] | Image | Accuracy = 86.5% |
05 | Esen et al. [10] | Tabular | Accuracy = 85.42%; Features No = 38 |
Our Proposed Frameworks | |||
SL | Frameworks | Dataset Type | Performance |
01 | RF without CV | Tabular | Accuracy = 81.25%; F-score = 79.07% Precision = 85%; Recall = 73.91% Features No = 38 |
02 | RF with CV | Tabular | Accuracy = 78.42%; F-score = 77.75% Precision = 80.01%; Recall = 75.75% Features No = 38 |
03 | RF-SCSO without CV | Tabular | Accuracy = 79.17% F-score = 77.78% Precision = 79.55%; Recall = 76.09% Features No = 13 |
04 | RF-SCSO with CV | Tabular | Accuracy = 78.32% F-score = 77.44% Precision = 80.36%; Recall = 75.01% Features No = 13 |
Gallstone Positive (Class 0) | Gallstone Negative (Class 1) | ||||||
---|---|---|---|---|---|---|---|
Type | CRP | Vitamin D | AAST | CRP | Vitamin D | AAST | |
Original Dataset | 0.46 | 24.90 | 23.91 | 3.27 | 17.83 | 19.41 | |
Wrong Prediction | 0.279 | 23.31 | 21.00 | 0.718 | 16.626 | 15.4 |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Sarker, P.; Tiang, J.-J.; Nahid, A.-A. Gallstone Classification Using Random Forest Optimized by Sand Cat Swarm Optimization Algorithm with SHAP and DiCE-Based Interpretability. Sensors 2025, 25, 5489. https://doi.org/10.3390/s25175489
Sarker P, Tiang J-J, Nahid A-A. Gallstone Classification Using Random Forest Optimized by Sand Cat Swarm Optimization Algorithm with SHAP and DiCE-Based Interpretability. Sensors. 2025; 25(17):5489. https://doi.org/10.3390/s25175489
Chicago/Turabian StyleSarker, Proshenjit, Jun-Jiat Tiang, and Abdullah-Al Nahid. 2025. "Gallstone Classification Using Random Forest Optimized by Sand Cat Swarm Optimization Algorithm with SHAP and DiCE-Based Interpretability" Sensors 25, no. 17: 5489. https://doi.org/10.3390/s25175489
APA StyleSarker, P., Tiang, J.-J., & Nahid, A.-A. (2025). Gallstone Classification Using Random Forest Optimized by Sand Cat Swarm Optimization Algorithm with SHAP and DiCE-Based Interpretability. Sensors, 25(17), 5489. https://doi.org/10.3390/s25175489