## 6 Conclusions  
In this paper, two pre-trained DL models were benchmarked in tomato detection and compared with a HSV colour space model in the classification of those fruits in four maturity classes. Two datasets of tomato images in greenhouses were acquired for that purpose.  
The YOLOv4 model best detected tomatoes, achieving an F1-Score of 85.81%, with a good tradeoff between the Precision and Recall rates. The results of the classification task were satisfactory and promising, with the YOLOv4 model standing out once again with a Macro F1-Score of 74.16%. The HSV colour space model outperformed the SSD MobileNet v2, obtaining a Balanced Accuracy similar to the YOLOv4 model of 68.10%. All models had more difficulty classifying tomatoes of the intermediate classes (Turning and Light Red). Although less demanding in its development, the HSV colour space model does not deal as well as DL models with highly complex scenarios.  
In perspective, putative future work should go through: (i) enlarge the dataset, balancing it with more images with Red tomatoes; (ii) evaluating the performance of these models in on-time conditions, inside the greenhouses; (iii) benchmark this DL models against new and more optimized backbone networks, such as ResNet18, ResNet50, SE-ResNet, SENet-154 [73] or ViT vision transformers [74] and (iv) improve the HSV colour space model to better deal with the problems of the complex environment, considering an image segmentation DL model or develop an algorithm for tomato boundaries detection inside the bounding box, by formalizing a thresholding algorithm that picks the most reddish pixel and analyzes all neighbors without a drastic change to green (background).  
**Author Contributions:** Conceptualisation, G.M., S.A.M., F.N.d.S. and M.C.; data curation, G.M., S.A.M. and T.P.; funding acquisition, F.N.d.S.; investigation, G.M. and S.A.M.; methodology, G.M. and S.A.M.; project administration, F.N.d.S.; software, G.M. and S.A.M.; supervision, M.C. and F.N.d.S.; validation, M.C. and F.N.d.S.; visualisation, G.M.; writing--original draft, G.M. and S.A.M.; writing--review and editing, M.C. and F.N.d.S. All authors read and agreed to the published version of the manuscript.  
**Funding:** This research received no external funding.  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** The data presented in this study are openly available in the digital repository Zenodo: AgRobTomato Dataset--[[https://doi.org/10.5281/zenodo.5596799](https://doi.org/10.5281/zenodo.5596799)]([https://doi.org/10.5281/zenodo.5596799](https://doi.org/10.5281/zenodo.5596799)) (accessed on 15 August 2021); RpiTomato Dataset--[[https://doi.org/10.5281/zenodo.5596363](https://doi.org/10.5281/zenodo.5596363)]([https://doi.org/10.5281/zenodo.5596363](https://doi.org/10.5281/zenodo.5596363)) (accessed on 15 August 2021).  
**Acknowledgments:** The authors would like to acknowledge the scholarship number SFRH/BD/147117/2019, funded by National Funds through the Portuguese funding agency, FCT - Fundacao para a Ciencia e Tecnologia, and co-founded by the European Social Fund (FSE). The authors would like to thank Horticola do Norte and Mr. [PERSON] through the COMPETE2020 program within the ROBOCARE project (project number Norte-01-0247-FEDER-045289) for making their tomato greenhouses available for data acquisition.  
**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.