# Weed Detection in Wheat Crops Using Image Analysis and Artificial Intelligence (AI)
## 5 Conclusions and Future Work  
The various DCNNs were effective, and verified using pictures of weeds collected using a mobile camera and Logitech HD camera in wheat crops. Three DCNN models, YOLOv5s, YOLOv5m, and YOLOv5l, were evaluated using the PyTorch framework. The YOLOv5l and YOLOv5m models were more effective than YOLOv5s, due to the base-on-model accuracy rate; conclusively, the Pytorch framework was better than the TensorFlow framework. All the DCNN models used in this study had results that showed better accuracies (i.e., 0.44, 0.49, and 0.39) regarding all the development phases of the weed shruberies. However, all the models recorded the maximum accuracy of the dataset. All the models performed better with respect to inference speed within the PyTorch framework. Our findings for inference times showed that the DCNN models YOLOv5s, YOLOv5m, and YOLOv5l fulfil the requirements for real-time wildflower credentials in the wheat field. In this study, we achieved a good balance between accuracy and inference speed in the models' real-time application for weed detection. All the results of the developed models in this study suggested that the DL models YOLOv5l, YOLOv5s, and YOLOv5m also preferred two DCNNs. Additionally, two DCNN models, YOLOv4-Tiny and YOLOv3-Tiny, were evaluated using the TensorFlow framework. The YOLOv4-Tiny was more effective than the  
Figure 11: Loss and Accuracy Graph for YOLOv3-Tiny.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Network Model** & **Precision** & **Recall** & **F1 score** \\ \hline
**YOLOv4-Tiny** & 0.89 & 0.96 & 0.92 \\
**YOLOv3-Tiny** & 0.91 & 0.90 & 0.90 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Precision Recall and F1 score values for weeds dataset using these models.  
YOLOv3 Tiny due to the base-on model accuracy rate; therefore, the TensorFlow framework is better than the PyTorch framework. All the DCNN models used in this study showed better accuracies (0.97 and 0.96) at all stages of the growth of weed plants.  
This study demonstrated that deep learning algorithms implemented through PyTorch outperformed implementations achieved with Tensorflow. This is because PyTorch gives deeper and more fine-grained controls (that increase its flexibility over that of TensorFlow), thus allowing better models and resulting in better accuracies. We concluded that our setup achieves a superior outcome concerning swiftness and precision compared to other networks such as YOLOv4. Image recognition is far more effective and efficient than more conventional methods of recognition. The NVIDIA RTX2070 GPU's inference time per picture (640 \(\times\) 640) was 9.43 milliseconds and 12.38 milliseconds, respectively, with the highest accuracy of unwanted plants along with wheat plants being 0.89 and 0.91, correspondingly. This also relates to autonomous crop-harvesting equipment.  
In the future, the authors plan to extend their proposed weed detection work to other crops and regions for wider applicability. Furthermore, deep learning models with high prediction and detection accuracy could be integrated with variable rate technologies to provide real-time weed management solutions.  
S.I.U.H.: writing--original draft. M.N.T.: Supervision and Project administration. Y.L.: Visualization. All authors have read and agreed to the published version of the manuscript.  
This work was supported by Data Driven Smart Decision Platform (PSDP-332), and Higher Education Commission of Pakistan. The authors would like to thank all researchers and students involved in this project for their assistance during the experiments.  
Not applicable.  
The authors would like to thank the DDSDP project.  
The authors declare no conflict of interest.