# Weed Detection in Wheat Crops Using Image Analysis and Artificial Intelligence (AI)
###### Abstract  
In the present study, we used device visualization in tandem with deep learning to detect weeds in the wheat crop system in actual time. We selected the PMAS Arid Agriculture University research farm and wheat crop fields in diverse weather environments to collect the weed images. Some 6000 images were collected for the study. Throughout the season, the databank was assembled to detect the weeds. For this study, we used two different frameworks, TensorFlow and PyTorch, to apply deep learning algorithms. PyTorch's implementation of deep learning algorithms performed comparatively better than that of TensorFlow. We concluded that the neural network implemented through the PyTorch framework achieves a superior outcome in speed and accuracy compared to other networks, such as YOLO variants. This work implemented deep learning models for weed detection using different frameworks. While working on real-time detection models, it is very important to consider the inference time and detection accuracy. Therefore, we have compared the results in terms of execution time and prediction accuracy. In particular, the accuracy of weed removal from wheat crops was judged to be 0.89 and 0.91, respectively, with inference times of 9.43 ms and 12.38 ms on the NVIDIA RTX2070 GPU for each picture (640 \(\times\) 640). artificial intelligence; deep learning; wheat crops; weed detection; YOLO
for insect pests. Weeds are referred to as pests in agriculture because they harm produce. Weed infestation is the most damaging but least visible variable adversely impacting wheat crop production. Weeds are the most unappealing, destructive, and problematic vegetation worldwide. These off-type plants have grown out of their natural habitat, and their value has yet to be identified. Weeds also serve as a pool for the food and protection of various pests and diseases during the off-season. Weed density has been investigated with regard to yield losses depending on different densities of Melilo indica in both rainfall and irrigated conditions. Implementing healthy farming requires modern technologies and methods, such as processing images, videos, machine vision, and artificial intelligence. These enable the maximum application of pesticides in machine vision applications in agriculture [8], accurate assessment of crop nitrogen levels, determination of crop growth, calculation of the solar radiation received by the crop, and the identification of plant diseases and grasses. The most important part of designing machine vision systems is segregation, because of the risk of extracting and sorting identified objects from the process. Nowadays, the development of computer vision and automated expert systems has made it possible to distinguish between crops and weeds in an easy and fast way. Multiple groundwater detection techniques for selective herb application and site-related grass management have been studied as environmentally friendly techniques to reduce the consumption of chemical pesticides and their environmental impact on fields. For this purpose, some researchers used remote sensing technology to distinguish weeds, crops, and soil-based measurements reflected at different wavelengths. In contrast, others distinguish plants based on color, texture, and shape characteristics. An image-processing system to detect weeds based on classification was developed by [9]. Real-time target identification relies on a number of variables, such as the amount and quality of pictures, the architecture of deep convolutional neural networks (DCNN), the hardware, and the memory storage, including GPUs [10]. Quantifying the phenotypic changes resulting from genetic or environmental differences using convolutional neural networks (CNNs) produced an 86.6% detection accuracy in recognizing wheat spikes. Using DL models, a 95.9 and 99.7% accuracy in identifying wheat spikes and spikelets, respectively, was achieved. [PERSON] et al. [11] reported that DCNNs support agricultural applications.