Harris Hawks Optimization–Optimized Explainable Quality Index for Tomato Grading
Automated tomato ripeness and quality grading is essential for precision agriculture and industrial packing lines, replacing slow, subjective manual sorting. Most reported systems, however, rely on heavy deep networks or a single accuracy figure without ablation, statistical validation, or an explicit accuracy–interpretability–latency trade-off. This study proposes HHO-XQI, a Harris Hawks Optimization (HHO)-optimized Explainable Quality Index that fuses interpretable color-statistical features into a continuous Tomato Quality Index for four-class grading (Damaged, Old, Ripe, Unripe). The framework extracts 125 RGB/HSV/Lab colorstatistical descriptors, fuses four base learners (logistic regression, random forest, extra trees, k-nearest neighbors) via HHO-optimized soft voting on 7,226 images, and is benchmarked against a fine-tuned ResNet18 CNN with Gradient-weighted Class Activation Mapping (Grad-CAM). Evaluation combined held-out accuracy/macro-F1, repeated cross-validation with Holm-corrected Wilcoxon tests, feature- and ensemble-composition ablation, HHO sensitivity/convergence analysis, SHapley Additive exPlanations (SHAP) attribution, and latency/training-time profiling. HHO-XQI reached 94.62% accuracy (92.90% macro-F1), significantly beating three baselines (p < 10−4 ) but not extra trees alone (p = 0.071); the CNN reached 99.31% accuracy at comparable CPU latency (11.31 vs. 12.05 ms) yet required approximately 147 × longer training (575.7 vs. 3.92 s). These findings support a two-tier deployment: HHO-XQI as a near-instantly retrainable, SHAP-native first-stage screener, and the CNN + Grad-CAM branch as a slower-to-retrain but more accurate second-stage auditor. The study contributes a statistically validated, fully reproducible metaheuristic-fused explainable grading pipeline that fills a rigor gap common in agricultural swarm-intelligence literature. Received: 29 July 2026 | Revised: 7 September 2026 | Accepted: 29 September 2026 Conflicts of Interest The authors declare that they have no conflicts of interest to this work. Data Availability Statement The tomato image dataset used in this study is the publicly available Tomatoes dataset published by Enalis (2023) on Kaggle: https://www.kaggle.com/datasets/enalis/tomatoes-dataset. Per the journal’s editorial guidance, this dataset is not listed as a numbered reference in the reference list; the full dataset citation and access link are provided here instead. The feature-extraction, HHO optimization, and CNN training code are available from the corresponding author upon reasonable request. Author Contribution Statement Van Van Chau: Conceptualization, Methodology, Software, Formal analysis, Investigation, Writing – original draft, Visualization. Minh Tuan Nguyen: Conceptualization, Methodology, Validation, Data curation, Writing – review & editing, Project administration. Phayung Meesad: Resources, Writing – review & editing, Supervision, Project administration.
HHO-XQI 以颜色统计特征加软投票实现四类番茄分级,准确率94.62%,重训仅需约4秒,但精度低于ResNet18的99.31%;作者据此建议将其作为一级筛查、CNN作为二级复核。