  The development of robotic solutions for agriculture requires advanced
perception capabilities that can work reliably in any crop stage. For example,
to automatise the tomato harvesting process in greenhouses, the visual
perception system needs to detect the tomato in any life cycle stage (flower to
the ripe tomato). The state-of-the-art for visual tomato detection focuses
mainly on ripe tomato, which has a distinctive colour from the background. This
paper contributes with an annotated visual dataset of green and reddish
tomatoes. This kind of dataset is uncommon and not available for research
purposes. This will enable further developments in edge artificial intelligence
for in situ and in real-time visual tomato detection required for the
development of harvesting robots. Considering this dataset, five deep learning
models were selected, trained and benchmarked to detect green and reddish
tomatoes grown in greenhouses. Considering our robotic platform specifications,
only the Single-Shot MultiBox Detector (SSD) and YOLO architectures were
considered. The results proved that the system can detect green and reddish
tomatoes, even those occluded by leaves. SSD MobileNet v2 had the best
performance when compared against SSD Inception v2, SSD ResNet 50, SSD ResNet
101 and YOLOv4 Tiny, reaching an F1-score of 66.15%, an mAP of 51.46% and an
inference time of 16.44 ms with the NVIDIA Turing Architecture platform, an
NVIDIA Tesla T4, with 12 GB. YOLOv4 Tiny also had impressive results, mainly
concerning inferring times of about 5 ms.
