## 5 Conclusions and Future Work  
The study aimed to build, analyze, and evaluate a deep learning model for providing machine vision to autonomous weeding robots. To develop a weed detection system, the deep learning-based single-stage object detection model YOLO5 is used. The model is then compared with another single-shot detector SSD-ResNet to assess its performance.  
The dataset was created by visiting multiple Agri farm fields in different parts of Pakistan. The videos yielded a total of 12,000 frames (images). Following the removal of noisy images, the remaining 9000 images contained three different crops and four weed  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **mAP@IOU 0.5** & **mAP@IOU 0.95** & **FPS (Frame per Second)** \\ \hline YOLO v5 & 0.88 & 0.48 & 40 \\ SSD & 0.53 & 0.25 & 30 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Performance comparison of YOLOv5 and SSD-ResNet.  
Figure 10: The total loss function curve for the SSD-ResNet model.  
species. A total of 1500 photos were selected at random as the test set, with the remaining 7500 serving as the test set. The training was set for 15 epochs. YOLO5 accurately and quickly detected weeds and crops in images at a rate of 40 frames per second with a detection speed of 0.02 s per image and mAP [EMAIL_ADDRESS] of 0.88. On the other hand, SSD ResNet detected weeds and crops in the images at a rate of 30 FPS with a speed of 0.046 s and a mAP [EMAIL_ADDRESS] of 0.53. The superior performance of the YOLO5 model makes it a suitable DL model for detecting and classifying weeds and crops within fields. In order to make the detection system robust, the trained YOLO5 model was further tested on a standalone embedded device, the Nvidia Xavier AGX. Based on the performance of the developed weed detection system, it can be commercially employed on an autonomous laser weeding vehicle for real-time site-specific weed management without causing crop damage.  
The future work will focus on collecting more data for the given crops and weed species, as the accuracy for Herb Paris, bitter gourd, and the grass was relatively low. Furthermore, data will be collected for more crops and weed species, as, being an agricultural country, Pakistan produces a wide variety of crops. Therefore, collecting data for a wider variety of crops and weed species could help improve the accuracy and effectiveness of object detection models for agricultural applications in Pakistan.  
Conceptualization, H.S.F. and M.K.; methodology, H.S.F. and Lu.H.; software, H.S.F. and Lu.H.; validation, M.K., M.Z.A. and S.H.; data curation, H.S.F. and Lu.H.; writing--original draft preparation, H.S.F.; writing--review and editing, H.S.F., S.H., M.K. and M.Z.A.; supervision, M.K. and D.S. All authors have read and agreed to the published version of the manuscript.  
This research was funded by DAAD, project No. 57569494. The project was funded under the German-Pakistani Research Cooperation program for two years, January 2021-December 2022. The APC was covered under this funding.  
Informed Consent Statement: Informed consent was obtained from all subjects involved in the study.  
The Weed Dataset of this work is publicly available through our research lab profile on kaggle: [[https://www.kaggle.com/datasets/smartcitylabnccai/pakistaniweeddataset](https://www.kaggle.com/datasets/smartcitylabnccai/pakistaniweeddataset)]([https://www.kaggle.com/datasets/smartcitylabnccai/pakistaniweeddataset](https://www.kaggle.com/datasets/smartcitylabnccai/pakistaniweeddataset)) (accessed on 2 December 2022).  
Authors declare no conflict of interest.