## 4 Results and Discussions
\begin{table}
\begin{tabular}{c c c c c c c c} \hline
**Class** & **Images** & **Instances** & **Precision** & **Recall** & **F1 Score** & **mAP50** & **mAP50-95** \\ \hline All & 525 & 1818 & 0.972 & 0.988 & 0.979 & 0.988 & 0.932 \\ Potato & 525 & 130 & 0.973 & 1 & 0.986 & 0.992 & 0.983 \\ Tomato & 525 & 254 & 0.964 & 0.984 & 0.973 & 0.992 & 0.988 \\ Onion & 525 & 151 & 0.977 & 1 & 0.988 & 0.995 & 0.973 \\ Turnip & 525 & 126 & 0.947 & 0.986 & 0.966 & 0.988 & 0.942 \\ Chili & 525 & 192 & 0.897 & 0.891 & 0.893 & 0.945 & 0.691 \\ Garlic & 525 & 155 & 0.975 & 1 & 0.987 & 0.991 & 0.921 \\ Carrot & 525 & 66 & 0.967 & 1 & 0.983 & 0.98 & 0.821 \\ Cucumber & 525 & 106 & 0.984 & 1 & 0.991 & 0.993 & 0.935 \\ Apricot & 525 & 171 & 0.998 & 1 & 0.998 & 0.995 & 0.995 \\ Yam & 525 & 136 & 0.997 & 1 & 0.998 & 0.995 & 0.946 \\ Lemon & 525 & 203 & 0.997 & 1 & 0.998 & 0.995 & 0.995 \\ Plum & 525 & 128 & 0.989 & 1 & 0.994 & 0.995 & 0.991 \\ \hline \end{tabular}
\end{table} 
Table 2: The metrics values of YOLOv5n. Figure 16: Recall metric graph of YOLOv5n. \begin{table}
\begin{tabular}{c c c c c c c} \hline
**Class** & **Images** & **Instances** & **Precision** & **Recall** & **F1 Score** & **mAP50** & **mAP50-95** \\ \hline All & 525 & 1818 & 0.972 & 0.986 & 0.978 & 0.987 & 0.951 \\ Potato & 525 & 130 & 0.974 & 1 & 0.986 & 0.991 & 0.989 \\ Tomato & 525 & 254 & 0.951 & 1 & 0.974 & 0.993 & 0.988 \\ Onion & 525 & 151 & 0.998 & 1 & 0.998 & 0.995 & 0.984 \\ Turnip & 525 & 126 & 0.952 & 0.984 & 0.967 & 0.988 & 0.919 \\ Chili & 525 & 192 & 0.921 & 0.854 & 0.886 & 0.929 & 0.741 \\ Garlic & 525 & 155 & 0.975 & 0.998 & 0.986 & 0.994 & 0.923 \\ Carrot & 525 & 66 & 0.949 & 1 & 0.97 & 0.984 & 0.948 \\ Cucumber & 525 & 106 & 0.966 & 1 & 0.982 & 0.992 & 0.977 \\ Apricot & 525 & 171 & 0.996 & 1 & 0.997 & 0.995 & 0.995 \\ Yam & 525 & 136 & 0.999 & 1 & 0.999 & 0.995 & 0.962 \\ Lemon & 525 & 203 & 0.994 & 1 & 0.996 & 0.996 & 0.994 \\ Plum & 525 & 128 & 0.99 & 1 & 0.994 & 0.995 & 0.995 \\ \hline \end{tabular}
\end{table} 
Table 3: The metrics values of YOLOv7. Both models attained F1 scores of 0.979 and 0.978, respectively, across all classes. This indicates that both versions of YOLO achieved a balanced combination of precision and recall, capturing a high proportion of true positive instances while minimizing false positives and false negatives. Furthermore, we present the F1 scores for individual classes in Tables 2 and 3 for YOLOv5n and YOLOv7, respectively. The F1 scores were calculated using the provided equations:  
\[F1\ Score=\frac{2\times(P\times R)}{P+R}\]  
The evaluation of object detection models commonly employs two metrics: mean Average Precision at an IoU threshold of 0.5 (mAP50) and mean Average Precision within the IoU range of 0.5 to 0.95 (mAP50:95). These metrics provide an indication of the model's ability to accurately localize and classify objects with varying levels of IoU thresholds. Figures 18 and 19 depict the performance of two models, YOLOv5n and YOLOv7, in terms of mAP50 and mAP50:95. For YOLOv5n, the model achieved an mAP50 of 0.988 and an mAP50:95 of 0.932. On the other hand, YOLOv7 attained an mAP50 of 0.987 and an mAP50:95 of 0.951. These metrics were calculated using a validation dataset, which is separate from the training dataset. Typically, models tend to perform well on the training dataset due to the optimization of their parameters based on that specific data. However, in this case, both YOLOv5n and YOLOv7 demonstrate mAP values exceeding 0.98 on the validation dataset. This indicates that the models were able to generalize effectively to unseen data, which is a positive sign. When a model overfits the training data, it tends to perform exceptionally well on the training set but struggles to generalize to new, unseen data. However, since both models achieved high mAP values on the validation dataset, it suggests that they did not overfit the training data.