Precise categorization of avocado ripeness plays a vital role in strengthening post-harvest operations and curbing waste throughout agricultural supply networks. The present study centers on constructing a resilient ensemble classification framework employing spectral readings from 120 kilograms of Buccaneer avocados procured from the Royal Project in Chiang Mai, Thailand. The specimens were assessed via near-infrared (NIR) spectroscopy at 18 wavelengths. Five distinct machine learning models—Random Forest, Decision Tree, XGBoost, Gradient Boosting, and Gaussian Mixture Model—were separately trained and subsequently fused into a unified ensemble. Four distinct algorithms were deployed to fine-tune the weighting of each model: Bayesian optimisation, differential evolution, particle swarm optimisation, and grid search. Evaluation metrics covering accuracy, precision, recall, F1-score, confusion matrices, and ROC curves were applied. Grid Search yielded the strongest classification outcomes, securing an accuracy of 82.5% alongside an F1-score of 85.3%, emphasizing the value of weight-refined ensemble learning relative to standalone classifiers. This investigation delivers a scalable and transparent pipeline for non-destructive ripeness identification. The outcomes, notwithstanding constraints related to overfitting and dependency on spectral data integrity, pave the way for eventual real-time field deployment in agriculture.
Precise pixel-level delineation of fruit across different ripeness stages is vital for the development of autonomous harvesting platforms, particularly in unconstrained field settings. This work merges two in-field datasets covering peaches and strawberries to enable multi-stage ripeness identification and proposes a lightweight, query-driven instance segmentation architecture, termed FruitQuery. The unified dataset encompasses 3 ripeness phases for peach and 4 for strawberry, capturing diverse unstructured environments for these two common crops. The FruitQuery architecture is built from three core components: a backbone network, a pixel decoder, and Transformer decoders. Efficient multi-head self-attention mechanisms are embedded into the backbone to cut computational demands. At the same time, a pyramid pooling module is appended to the pixel decoder to strengthen multi-scale feature integration. Transformer decoders are then leveraged to extract a fixed set of queries from the feature maps and directly output instance masks, thereby circumventing the need for post-processing steps such as non-maximum suppression. FruitQuery functions in a fully end-to-end manner and merges convolutional operations with Transformer blocks to seize fine-grained details tied to distinct fruits at varying ripeness stages. Thorough evaluations on the aggregated fruit dataset reveal that the proposed FruitQuery achieves an average precision of 67.02 with only 14.08M parameters, exceeding 13 leading-edge models across 33 variants. Notably, FruitQuery outstrips three generations of YOLO (v8, v9, and v10) by a considerable gap. Ablation experiments and visual analyses further confirm its robust feature extraction with a reduced parameter count, indicating that the query-centric design is efficient at pinpointing fruit. These findings emphasize the model’s favorable trade-off between segmentation accuracy and compactness, suggesting its viability for real-world field deployment.