# The Fruit Recognition and Evaluation Method Based on Multi-Model Collaboration
## 1 Introduction
Currently, most research on fruit recognition and evaluation is focused on several key areas: the precise recognition and evaluation of single fruit varieties, the detection and evaluation of multiple fruit types, and improving recognition capabilities in indoor and orchard environments. Tasks such as fruit ripeness assessment, quality grading, damage detection, and disease identification provide more comprehensive and accurate solutions for agricultural production and fruit quality control. In fruit recognition and classification tasks, single models are widely used due to their simple structure and ease of implementation. However, single models often suffer from limitations such as poor generalization ability and stability when recognizing multiple fruit types. To overcome these limitations, collaborative strategies involving multiple models have been gradually introduced. Compared to single models, the use of multiple models typically leads to significant improvements in performance. Multi-model strategies primarily include model ensemble, model fusion, and model collaboration. These approaches combine the strengths of independent models, further enhancing the system's robustness, accuracy, and generalization ability. Many researchers have improved model performance from different angles to achieve more accurate recognition and evaluation. Currently, most studies focus on recognizing a few types of fruits, and once the data labels are determined, the model's recognition categories are restricted. In this paper, during the construction of the fruit recognition dataset, only a generalized \"fruit\" label is assigned. The YOLO-based detection model is improved to locate the fruit regions in the image. Then, a classification model is employed to perform detailed classification on the detected fruit regions. By separating the detection and classification tasks, the method achieves multi-model collaboration for better overall performance. Furthermore, when new fruit categories need to be added for recognition and evaluation tasks, only the classification model needs to be updated, reducing the labeling workload for detection. The detection model only needs to recognize the \"fruit\" target, allowing it to focus more on the position and shape features of the target, thereby reducing misjudments and omissions caused by category confusion. The classification model, on the other hand, can make finer category distinctions on the detected fruit images, improving recognition accuracy. Finally, for classification results with lower confidence, feature matching is used for calibration to enhance classification accuracy. Additionally, feature matching requires only a small number of samples to effectively address classification issues when new fruit categories appear. The contributions of this paper can be summarized as follows:  
1. This paper proposes a multi-model collaborative method for fruit recognition and evaluation, which separates the detection and classification tasks and optimizes the classification results through a feature matching network. The proposed method can achieve more accurate fruit recognition and is also suitable for fruit ripeness assessment. 2. An attention-based fusion module is designed to achieve interactive fusion and enhancement of input features, which helps improve the performance and generalization capability of the YOLOv8 detection model in complex tasks. 3. A classification prediction network is designed, where a Swin Transformer-based classification network works in collaboration with a cosine similarity-based feature matching network. This approach enhances classification accuracy while effectively addressing the classification issues of new categories. 4. Ablation experiments and experimental results demonstrate the effectiveness of the proposed method, which can be applied to both indoor and outdoor fruit recognition and ripeness assessment.