Professional Documents
Culture Documents
CMC 47869 Annotation2
CMC 47869 Annotation2
2 DOI:xxxxx
3 Type: XXXX
5 Abstract:
Weeds are a common problem in crop production, as they tend to spread unpre-
dictably across fields, competing for essential resources such as sunlight, water,
fertilizer, and soil nutrients. Detecting and dealing with weeds has become a sig-
nificant challenge for farmers. To minimize potential crop yield losses, it is crucial
view
to take early and proactive measures to control weeds during the growing sea-
e
son. Smart agriculture has gained importance recently because it can accurately
locate weeds in the field, apply weed control where it’s needed, make herbi-
r
cides more effective, and ultimately boost the economic benefits of agricultural
or
products. In terms of object detection, the You Only Look Once (YOLO)
detection model outperforms its competitors due to its accuracy, speed, and
F
generalization capabilities. Using standardized hyper-parameters, in this article,
we analyze four different models of YOLO (YOLOv5s, YOLOv6, YOLOv7, and
YOLOv8) on a corn dataset consisting of 1268 images. In the experimental
evaluation, the YOLOv7 achieved the highest detection accuracy among the
compared models reaching 0.992 in terms of mean Average Precision
(mAP@0.5). In addition, we expand the analysis by using 950 images collected
from random farms of three classes; the Okra, Eggplant, and Weeds. The results
indicate that YOLOv7 is superior to other approaches, achieves optimal
performance, and generalizes well to different datasets. We believe that such an
extensive evaluation contributes to the advancement of weed detection
techniques, as well as providing valuable information for future agricultural
research and applications.
8 1 Introduction
9 Agriculture is undeniably one of the world’s largest industries, playing a pivotal role in sustaining
10 global food production. Among the challenges facing the agricultural sector, weeds stand out as one of the
11 most significant obstacles. Weeds are the plants that grow in crop fields in an undesirable and uncontrolled
12 manner, sprouting up haphazardly across the landscape. The unchecked growth of these unwanted plants in
13 agricultural fields have several adverse consequences. Firstly, it disrupts ecological harmony and thus triggers
2 CMC,2023, vol, no
14 the imbalances within the delicate ecosystem of the farm and farmers’ lives. Moreover, the unchecked growth
15 of weeds detrimentally affect the overall health and productivity of crops, diminishing both their growth
16 potential and their ultimate yearly output and yield.
17 The output of the agriculture sector can be influenced by several factors such as unexpected weather
18 conditions, pests, soil fertility, and weeds. Interestingly, weeds have a more detrimental impact on crops
19 compared to insects, fungi, or other pests. Weeds can serve as hosts for various harmful pathogens
20 that have the potential to adversely affect crop production. Furthermore, they can increase the activity of
21 other pests such as insects and nematodes, and in dry summer conditions, can even contribute to an
22 increased risk of fires [1]. In addition, they can cause damage to other engineering works, such as water
23 sprinklers, drains, and foundations. Furthermore, these weeds can also cause health problems for humans
24 (i.e. skin irritation) and animals (i.e. toxins).
25 In the detection process, farmers must deploy resources to reduce the growth of weeds. Various strate-
26 gies can be used to reduce the growth of weeds and reduce their impact. These strategies are: preventing
27 weeds from establishing, maintaining field hygiene, preventing weed seed bank, mechanical, biological, to
28 utilizing natural enemies of weeds, and chemical using herbicides [2].
29 All of these approaches have their drawbacks. They often come with a financial burden, requiring extra
30 time and effort. Furthermore, control treatments can negatively impact the health and safety of individuals,
31 plants, soils, animals, and the environment [2]. In recent years, weeds control industry advancements have
32 enabled it to move beyond the simple detection of weeds in images to the identification of specific weed
species
33 and plant morphological characteristics, and finally, to be able to characterize and locate weed species in
34 images [3]. Different solutions were proposed to provide alternatives to traditional approaches, such as
35 using ML algorithms, Hyper-spectral imaging [4], Robotics and automation [5], Drones [6], Patch and spot
36 spraying [7].
37 Smart farm technology has revolutionized the agricultural industry, enabling farmers to optimize crop
38 production and reduce resource waste through data-driven decision-making and automation. With the help
39 of Artificial intelligence (AI)-based technology for wireless sensors, the efficient functioning of all sectors
40 of agriculture, including crop harvesting, irrigation, and soil content sensitivity, has been significantly en-
41 hanced. AI technology enables the diagnosis of plant diseases, pests, and malnutrition on farms, providing
42 farmers with crucial information to maintain the health and productivity of their crops. Farmers now have
43 access to these advanced AI-based tools that can accurately identify and target weeds, leading to more ef-
44 ficient and sustainable farming practices. The use of AI in weed detection has significantly improved the
45 accuracy and efficiency of farming practices by enabling farmers to identify and target weeds with preci-
46 sion. These AI-based tools can distinguish between weeds and crops, allowing farmers to apply targeted
47 herbicide treatments only where necessary, minimizing the use of chemicals and reducing environmental
48 impact. This has resulted in increased crop yields, reduced costs, and improved overall productivity in the
49 agricultural industry. This technology has proven to increase crop yields, improve efficiency, and contribute
50 to sustainable farming practices [8].
51 The detection of weeds in crops is challenging due to weeds and crop plants often having similar
52 colours, textures, and shapes. While there are challenges in detecting weeds using computer vision, advances
53 in Machine Learning (ML) algorithms and hardware capabilities may help to overcome these challenges
54 and improve weed detection accuracy in agriculture. The use of Deep Learning (DL) contributes to the
55 achievement of sustainable goals in many paradigms and fields. Agriculture has recently benefited from
56 the DL approaches. Several approaches based on the DL paradigm have been successful at detecting and
57 classifying weeds and other unwanted objects from the agricultural scenarios [9].
58 An object detection technique involves localizing an object within an image and classifying this object
59 as one would classify an image in a typical way. A single image may contain several regions of interest
CMC,2023, vol, no 3
60 pointing to a variety of objects. As a result, object detection becomes an increasingly challenging image
61 classification problem. You Only Look Once (YOLO) is a popular object detection model that is known
62 for its speed and accuracy. Since its introduction in 2016 by Redmon et al. [10], YOLO has gone through
63 several iterations, the latest iteration being Version 8 by Jocher [11] in 2023. For tasks involving the real-
64 time detection of objects, it is a highly effective and fast technique, especially for multiple object detection in
65 single images. The flexibility and scalability of the YOLO architecture allow it to be adapted and customized
66 to meet specific requirements, enabling researchers and developers to fine-tune the model to achieve optimal
67 performance within their respective fields [12].
68 In this paper, we analyze 4 different YOLO models for weed detection. These models are YOLOv5s,
69 YOLOv6, YOLOv7 and YOLOv8 using the corn data set. The dataset consists of 1268 images. In the
70 experimental evaluation, the YOLOv7 achieves the highest detection accuracy among the compared models.
71 We also augment the evaluation with 950 images collected from random farms of Okra, Eggplant, and
72 Weeds. In the evaluation, we found the YOLOv7 to be superior to other approaches by reporting the highest
73 detection performance. We believe that using YOLOv7 in weed detection can have a significant impact on
74 real-world agricultural practices. By accurately and efficiently identifying weeds near plants using images
75 collected from Unmanned aerial vehicles (UAVs) that were taken from drone camera.
76 The main contribution of this paper is summarised as follows: (1) Examine and evaluate the performance
77 of different DL-based object detection models typically the YOLO. (2) Using publicly available datasets,
78 find an efficient and accurate DL-based approach to detecting unwanted weeds within crops. (3) Determine
79 the best image resolution for weed detection using YOLO as an object detector model. (3) Introduce a new
80 datasets from our environment in Saudi Arabia and test our hypothesis as to whether the selection model
81 remains effective. The rest of the paper is organized as follows: Section 2 discusses different approaches
82 and datasets for weed detection. Section 3 presents the technical details of the YOLO-evaluated approaches.
83 Section 4 discusses the results and insights. Section 5 concludes the paper.
106 fore, combining their different perspectives may lead to improved results. Thus, based on this concept,
107 Trong et al. [23] develop a novel classification approach based on a late fusion of multimodal DNNs. They
108 used five DNN models: NASNet [24], ResNet, Inception-ResNet, MobileNet [25], and VGG [26] with the
109 Plant Seedlings dataset and Chonnam National University (CNU) weeds dataset. In the seedling data set,
110 the methods were able to achieve a precision of 97.31%, and with the CNU weed data set, they achieved
111 a precision of 98.77%. Hu et al. [27] proposed a novel deep architecture called Graph Weeds Net (GWN).
112 The authors recognized multiple types of weeds based on conventional RGB images as multiscale graphs
113 collected from complex range lands. The GWN identified the key patches of an entire image that are highly
114 likely to contain target weeds rather than background or other plants. In terms of top-1 accuracy, GWN
115 achieved 98.1% on the weeds dataset.
116 Peteinatos et al. [28] presented a weeds dataset of maize, sunflower, and potatoes. They tested three
117 different CNNs, namely VGG16, ResNet-50, and Xception [29], to assess their performance in a balanced
118 image dataset (93, 000+) which was collected by an RGB camera. The results showed that ResNet-50, along
119 with Xception, achieved top-1 testing precision (97%). Ramirez et al. [30] compared DeepLab-v3 [31],
120 SegNet [32] and U-Net [33] models in data sets that correspond to agricultural fields of sugar beet. The
121 DeepLabv3 algorithm has demonstrated the highest accuracy using class-balanced data, which has a greater
122 spatial context.
123 Recently, Dang et al. [34] evaluated the detection performance using object detectors from the YOLO
124 series, including: YOLOv3, YOLOv4 [35], Scaled-YOLOv4 and YOLOv5 [36]. The models trained on 12-
125 class of cotton weeds datasets were collected under various lighting conditions, varying weather conditions,
126 and at multi-stages of weed growth. Lopez et al. [9] proposed a novel method for weed detection in tomato
127 fields based on object detection neural networks, one-step (YOLOv7 [37], RetinaNet [38]) and two-step
128 Faster RCNN models [39] were trained on RGB images. Faster RCNN and RetinaNet achieved similar and
129 excellent performance in detection, whereas the YOLOv7 model provides fast detection speed but is less
130 accurate. An improved YOLOv4 model was proposed by Zhao et al. [40] for weed detection in potato
131 fields. This algorithm replaces the CSPDarknet53 backbone network in YOLOv4 network structures with
132 the lightweight MobileNetV3 network. In a potato field, this model achieved a Mean Average Precision
133 (mAP) of 98.52%.
134 The approaches such as [41, 42, 43] proposed a weeds detection system using a combination of different
135 DL models to achieve better accuracy. Yang et al. [44] investigated the impact of input image size on
136 CNN model training. The authors investigated the effects of image size variations on weed detection using
137 different types of neural network architecture. A recent study by, Rahman et al. [45] used 13 weed detection
138 models built using DL-based one and two-stage object detectors. The networks are trained using the 1821
139 images, followed by an experimental evaluation of the two videos recording one type of weeds
140 and two types of non-target plants in the field with and without shading disturbances.
144 • Extending datasets and optimizing model training and data augmentation techniques will still be
145 needed to improve weed detection accuracy. Furthermore, it is necessary to conduct field tests and
146 demonstrations to increase the assessment and upgrading of the trained models, which are de-
147 ployed in natural field conditions on a machine vision system with onboard computing hardware [45].
148 • Most weed target techniques are designed for specific weed species or plant types. This makes them
149 less versatile and limit their applicability in different environments.
CMC,2023, vol, no 5
150 • Few crop and weeds pixels are incorrectly predicted as background, this limitation is observed in
151 Moazzam et al. [46]. They proposed a method, and weed pixels were removed when they simplified the
image
152 by removing the background. In addition to Jiang et al., [47] proposed GCN approach has some false
153 recognition cases. One reason is that crops and weeds are very similar at the seedling stage. Another
154 possible reason is that the GCN used here is not very deep due to the relatively small size of the
155 dataset.
156 • The processing time of the images is also an issue that needs to be addressed. Such as complex algo-
157 rithms provide better results in the detection of weeds, but that is accompanied by a longer processing
158 time.
Table 1: Summary of publicity available dataset used by previous studies to detect weeds from different
crop types.
Figure 2: Annotation heatmap for (a) weeds, (b) corn, and (c) all classes
170 been captured at different stages of growth as shown in Figure 1. Moreover, some of the images contain more
171 than one type of weed in a single image which makes it more challenging for object detectors. The YOLO
172 object detection models can locate multiple objects in one image which makes them suitable
173 techniques for weeds detection.
174 Heatmaps in Figure 2 indicate the locations of annotations, i.e., bounding boxes, for all captured images.
175 Heatmaps display information on a graphical or two-dimensional basis based on a color coding system. With
176 the use of a heatmap, the correlation between annotated values is made easier to understand using colors
177 compared to numerical tables. The yellow color indicates highly positioned annotations, while the light
178 green color indicates lower positioning. Annotations are generally located in the center of all heatmaps
179 depicted.
180 The object count histogram in Figure 3 details the number of images with a given number of objects,
181 for each object class. The number of objects, i.e., annotations of weeds is more than corn it reaches up to
182 11 objects as shown in Figure 3(a). There are four to five weed objects for 976 images. The
183 number of corn objects are 8, as shown in Figure 3(b) in which five corn objects are in 756 images
184 and perceptibly one corn object in about 100 images. Figure 3(c) represents the object count histogram of
185 all classes where 995 images contain eight to nine objects. The results obtained for both parameters, namely
186 the annotation heatmap and the object count histogram, demonstrate the excellent accuracy and quality for
187 each class of image data.
188 The data wrangling steps are applied to the dataset in Roboflow. The steps involve data processing, data
189 annotation, data splitting and data augmentation. These steps ensure that the raw data being prepared for
190 processing and analysis is accurate and consistent.
CMC,2023, vol, no 7
(a) Count of weeds objects (b) Count of corn objects (c) Count of all objects
Figure 3: Histogram of object count by image for (a) weeds, (b) corn, (c) all classes
191 1. Data Processing: Auto-orient operation was applied which strips dataset images according to their
192 EXIF data that determines the orientation of a given image to be displayed in the same way they are
193 stored. Also, the images were resized to 640 x 640. The effects of Auto-Orient can vary depending
194 on the input image’s orientation metadata. If the image has the correct orientation, no changes will
195 be made. However, if the image is rotated or flipped, Auto-Orient will apply the necessary transfor-
196 mations to ensure the image is displayed in the correct orientation.
197 2. Data Annotation: The dataset is annotated using bounding box annotation which is a rectangle that
198 surrounds an object, that specifies its position as shown in Figure 4.
199 3. Data Splitting: The dataset that has been used in the evaluation of the method is split into three
200 parts: 80% for training, 10% for validation, and 10% for testing. Where each set serves a specific
201 purpose as shown in Figure 5.
Train
80%
10%
Test
10%
Vali
d
202
203 4. Data Augmentation: The augmentation process artificially increases the amount of data by creating
204 new data points based on existing data. The dataset is increased into 3042 images where the outputs
205 per training example is 3. The crop class applied 20% Maximum Zoom, 0% Minimum Zoom and the
206 rotation between -15°and +15°.
215 1. YOLOv5: The YOLOv5 version was released in 2020, and it is the first YOLO implementation
216 in Pytorch rather than Darknet and it used complex architecture called EfficientDet. Compared to
217 YOLOv3 and YOLOv4, YOLOv5 has the highest performance in precision, recall, and average
218 precision. Also, YOLOv5 consists of five versions, which are YOLOv5n, YOLOv5s, YOLOv5m,
219 YOLOv5l, and YOLOv5x according to memory storage size. There are several different variants of
220 this algorithm, Each variant offers different accuracy rates and requires a different amount of training
221 time [53]. However, no differences in terms of operation used except for the number of layers.
222 2. YOLOv6: As an improvement over previous versions, YOLOv6 was proposed in 2022 by Li et
223 al. [54]. A major difference between YOLOv5 and YOLOv6 is the CNN architecture. With YOLOv6,
224 a variant of the EfficientNet architecture is used called EfficientNet-L2. There are fewer parameters in
225 and it has a higher computational efficiency than EfficientDet in YOLOv5. In terms of accuracy and
226 speed, the result outperforms other real-time detectors. YOLOv6 also has a customized quantization
227 method that makes it an ever-fast detector out-of-the-box to facilitate industrial deployment [54].
228 3. YOLOv7: YOLOv7 in introduced by Wang et al. [37]. The authors augmented several improve-
229 ments. YOLOv7 uses nine anchor boxes to detect objects of varying shapes and sizes, there-
230 fore helping to reduce the number of false positives. Also, there is a new loss function. YOLOv7 also
231 offers a higher resolution than previous versions. Due to the higher resolution, YOLOv7 can
232 detect smaller objects and has a higher level of accuracy. A major advantage of YOLOv7 is its speed.
233 With this algorithm, images are processed at a rate of 155 frames per second, which is much faster
234 than that of other state-of-the-art algorithms for object detection.
235 4. YOLOv8: YOLOv8 is the newest version of YOLO, and has been released by Ultralytics [11].
The
236 authors added additional features and enhancements to boost performance, flexibility, and efficiency.
237 With this augmentation, the YOLOv8 is thus capable of handling a wide variety of vision AI tasks,
238 encompassing detection, segmentation, pose estimation, tracking, and classification.
∗
Where TP stands for true positives, TN for true negatives, FP for false positives, and FN for false negatives.
∗∗
Where AP stands for Average Precision and n indicate the number of classes.
253
Figure 6: Training curve of mAP@0.5 for YOLOv5, YOLOv6, YOLOv7, and YOLOv8
274 higher proportion of relevant objects. Despite this, YOLOv7 remains the preferred choice as it effectively
275 minimizes false positives, prioritizes high precision, and consistently achieves the highest values on other
276 performance metrics. Its ability to balance accuracy and precision makes it an optimal model for weeds
277 detection.
278 To provide a visual representation of the YOLOv7’s performance, Figure 7 shows a visualization
279 of how YOLOv7 performs in terms of precision, and recall, and the mAP graph provides an overall measure
of
280 the model’s detection accuracy across different IoU thresholds.
Table 3: Results for different versions of the YOLO model on the validation set
281 Several factors can be taken into consideration of how the YOLOv7 outperforms other models. The
282 performance of YOLOv7 is improved by the integration of the Extended Efficient Layer Aggregation (E-
283 ELAN) computational block. E-ELAN uses expand, shuffle, and merge cardinality to increase learning
284 ability and enables the framework to learn more effectively without destroying the gradient path [37]. More-
285 over, the trainable Bag of Freebies in the YOLOv7 increases the performance of a model without increasing
the
286 training cost. Also, the higher resolution in YOLOv7 leads to detect smaller objects and has a higher
287 accuracy overall. However, it is important to note that the performance of YOLO detectors can vary depend-
288 ing on the specific object detection tasks and datasets, as observed in the state-of-the-art. YOLOv7 remains
289 the preferred choice as it effectively minimizes false positives, prioritizes high precision, and consistently
290 achieves the highest values of other performance metrics. It is an optimal model for weed detection because
291 it can balance accuracy with precision.
CMC,2023, vol, no 11
293 Inference is similar to the hallucination phase in the ML paradigm. During the inference phase, the trained
294 YOLO models are utilized to make predictions on new and unseen data. The YOLO model processes the
295 entire image simultaneously and generates predictions for bounding boxes, object classes, and confidence
296 scores. However, the specific confidence threshold used to determine the detection results and it varies be-
297 tween different models. In YOLOv7, the confidence threshold is set to 0.1, in YOLOv6 and YOLOv8, it
298 is set to 0.25, and in YOLOv5, it is set to 0.4. This threshold determines the minimum confidence score
299 required for an object detection to be considered valid. Figure 8 shows the predictions result in the inference
300 steps for all the models.
Figure 8: Examples of weeds detection through different YOLO models from the Inference phase
12 CMC,2023, vol, no
329 To the best of our knowledge the feasibility and effectiveness of the DL techniques for weed detection
330 in Saudi fields have never been investigated thoroughly. Additionally, there is currently no research ded-
331 icated to weeds detection on Okra and Eggplant fields. Figure 9 show sample images from eggplant and
okra filds. As such, our dataset consists of 3 classes (Okra, Eggplant, Weeds) and 950 images captured by
iPhone 11 Pro and iPhone 12 Ultra Wide camera from May 16-18, 2023. The data was collected between 11
AM and 7 PM, including various weather and light con- ditions.
Figure 9: Sample images from our dataset consist of Okra and Eggplant fields, collected from farms in
Saudi Arabia
334
To annotate the new images, we used the advanced Smart Polygon feature in Roboflow Annotate,
which is powered by the Segment Anything Model (SAM), as shown in Figure 10.
Figure 10: Sample image annotated using the Smart Polygon feature in Roboflow Annotate.
335
336 More augmentation techniques were applied to generate two versions of each source image. These techniques
337 included a 50% probability of horizontal flip, a 50% probability of vertical flip, random rotation within the
338 range of -15 to +15 degrees, and random shear horizontally and vertically within the range of -15° to
339 +15°. As a result of these augmentations, the total number of images in the dataset increased by 1596.
340 In the training phase, we visualize the performance of the model through various graphs shown in
341 Figure 11. These graphs provide insights into the model’s learning progress and its ability to improve over
342 the training iterations.
343 We also analyze the performance of the YOLOv7 model on the validation set. The precision score obtained
344 is 0.884, indicating a high level of accuracy in correctly identifying objects of interest. The recall value
345 achieved is 0.811, reflecting the model’s ability to capture a substantial proportion of true positive detections.
14 CMC,2023, vol, no
346 Furthermore, the model achieved an mAP of 0.88 at an IoU threshold of 0.5, demonstrating its ability to
347 accurately localize and classify objects with reasonable overlap. The achieved mAP at a stricter IoU range of
348 0.5 to 0.95 is 0.719, indicating the model’s ability to handle a wider range of object variations and occlusions.
349 Figure 12 shows the samples of inference results. This visual representation allows us to assess the
350 model’s performance in accurately detecting and localizing objects of interest.
351 Moreover, there are noticeable class-specific variations in YOLOv7’s performance. Eggplant and Okra
352 achieved high mAP scores of 0.973 and 0.927. However, the mAP for weeds is comparatively lower at
353 0.741. The variation in mAP scores could be influenced by the size of the objects. If weeds are generally
354 smaller than crops, it can pose a challenge for accurate detection, leading to lower mAP. In addition the
355 occlusion levels, and the diversity of appearances within each class It could contribute to lowering the mAP
356 of weeds class.
CMC,2023, vol, no 15
357 Although the achieved results may be slightly lower compared to our evaluation of the corn dataset, it
358 is important to consider several factors. We increased the number of classes in our dataset, expanding the
359 model’s ability to detect and classify a wider variety of weeds. The total number of images in the dataset
360 was relatively smaller. Moreover, the presence of less common weeds in the dataset adds complexity to the
361 task, as they may have limited representation and make it more challenging for the model to generalize.
362 Considering the number of influencing factors, we believe that the results are still attractive, depicting the
363 model’s effectiveness in weeds detection. Despite the increase in class diversity and the smaller number
364 of images, the model demonstrates satisfactory precision, recall, and mAP scores, indicating its ability to
365 handle various weed types and achieves reliable performance.
366 5 Conclusions
367 The main objective of this paper is to thoroughly assess and evaluate the four different YOLO models
368 in the context of weed detection. To achieve this, we employed a diverse range of metrics as part of our
369 evaluation process. We aimed to comprehensively analyze the performance and capabilities of these
370 models to determine their effectiveness in weed detection for the corn dataset, and generalize to other unseen
371 similar scenarios. The evaluation results of YOLOv5, YOLOv6, YOLOv7, and YOLOv8 achieved mAP of
372 0.986, 0.963, 0.992, and 0.98, respectively. The YOLOv7 demonstrated the highest performance among
373 these models. The YOLOv7 was also evaluated on a new dataset derived from random farms. The results
374 demonstrate that the model is capable of accurately detecting and classifying objects, which makes it suitable
375 for a wide range of object detection tasks. Thus our results indicate that YOLOv7 is superior to other weed
376 detection algorithms, achieve optimal performance with specific image sizes and is capable of generalizing
377 well to different datasets. Based on the results of the YOLOv7 model, it was demonstrated that the model can
378 be easily adapted to a variety of agricultural scenarios and crop types. The datasets used in the experiments
379 included a variety of different scenarios, and the models demonstrated effective adaptation to a variety of
380 conditions and types of crops.
381 This study contributes to the advancement of weed detection techniques. We believe that such an
382 extensive evaluation will add to the state-of-the-art and augment the advancement of weed detection tech-
383 niques, as well as providing valuable information for future agricultural research and applications. The
384 results of using YOLOv7 in weed detection can contribute to the advancement of weed detection tech-
385 niques in smart agriculture in several ways: The YOLOv7 model’s high recognition accuracy can greatly
386 improve the efficiency and reliability of weed detection in smart agriculture systems. The use of YOLOv7
387 in weeds detection can provide real-time monitoring and early detection of weeds, allowing farmers to take
388 timely action and prevent the growth and spread of weeds, ultimately leading to higher crop yields. The
389 YOLOv7 model’s ability to detect weeds from color images enables the automation of weed control mea-
390 sures, reducing the need for manual labour and increasing cost-effectiveness in smart agriculture. There are
391 several areas within agricultural research that could benefit from further exploration using YOLOv7. For
392 example, further exploration can be done in the identification and detection of other pest species or diseases
393 in crops. Another area of exploration could be the development of automated systems for targeted weed
394 control based on the detection and classification capabilities of YOLOv7 [58]. Emerging technologies and
395 improvements in deep learning architectures can greatly impact the future development of weed detection
396 models by enhancing their accuracy, efficiency, and scalability. These advancements can enable more pre-
397 cise identification and segmentation of weeds, leading to increased effectiveness in weed control strategies.
398 Furthermore, there are several economic benefits to using YOLOv7 to improve weed detection. Firstly,
399 with YOLOv7, farmers can identify and remove weeds which allows crops to grow more healthily. This
400 increases farmers’ profitability and crop yields. Secondly, the improved efficiency of weed detection using
401 YOLOv7 can significantly reduce labour and operational costs.
402 Regarding the results we obtained in this study, it may be possible to improve the detection results from
16 CMC,2023, vol, no
403 YOLOv7 by adding more preprocessing tasks, such as enhancement. It would be possible to prove this
404 through further research.
405 Acknowledgments
406 Researchers would like to thank the Deanship of Scientific Research, Qassim University for funding
407 publication of this project.
Funding Statement
409 None
Author Contributions
Conceptualization, S.S.A.; Methodology, R.N.A. and J.S.A.; Validation, R.N.A. and J.S.A.; Formal
analysis, R.N.A., J.S.A. and S.S.A.; Investigation, R.N.A. and J.S.A; Resources, R.N.A., J.S.A. and S.S.A; Writing
—original draft, R.N.A. and J.S.A.; Writing—review & editing, H.F.A. and R.U.K.; Visualization, R.N.A. and
J.S.A; Supervision, S.S.A.; Project administration, S.S.A. All authors have read and agreed to the published version
of the manuscript.
413 References
414 1. Y. Gharde et al., (2018). Assessment of yield and economic losses in agriculture due to weeds in India.
Crop Protection, 107, 12–18.
2. M. Hasan, F. Sohel, D. Diepeveen, H. Laga, and M. G. Jones. (2021). A survey of deep learning techniq
ues for weed detection from images. Computers and Electronics in Agriculture, 184, 106067.
,
418 3. Coleman, G. R., Bender, A., Hu, K., Sharpe, S. M., Schumann, A. W., et al. Weed detection to weed
419 recognition: reviewing 50 years of research to identify constraints and opportunities for large-scale
420 cropping systems. Weed Technology, 1–50.
421 4. Li, Y. Li et al. (2021). Identification of weeds based on hyperspectral imaging and machine learning. Frontiers
in Plant Science, 11, 611622.
423 5. Wu, X., Aravecchia, S., Lottes, P., Stachniss, C., Pradalier, C. (2020). Robotic weed control using
424 automated weed and crop classification. Journal of Field Robotics, 37(2), 322–340.
425 6. Revanasiddappa, B., Arvind, C., Swamy, S., et al. (2020). Real-time early detection of weed plants in
426 pulse crop field using drone with iot. Technology, 16(5), 1227–1242.
427 7. Allmendinger, A., Spaeth, M., Saile, M., Peteinatos, G. G., Gerhards, R. (2022). Precision chemi-
428 cal weed management strategies: A review and a design of a new cnn-based modular spot sprayer.
429 Agronomy, 12(7), 1620.
430 8. Mesías-Ruiz, G. A., Pérez-Ortiz, M., Dorado, J., de Castro, A. I., Peña, J. M. (2023). Boosting
431 precision crop protection towards agriculture 5.0 via machine learning and emerging technologies: A
432 contextual review. Frontiers in Plant Science, 14, 1143326.
433 9. López-Correa, J. M., Moreno, H., Ribeiro, A., Andújar, D. (2022). Intelligent weed management based
434 on object detection neural networks in tomato crops. Agronomy, 12(12), 2953.
435 10. Redmon, J., Divvala, S., Girshick, R., Farhadi, A. (2016). You only look once: Unified, real-time
436 object detection//Proceedings of the IEEE conference on computer vision and pattern recognition.
437 11. Jocher, G., Chaurasia, A., Qiu, J. (2023). YOLO by Ultralytics. URL https://github.com/
CMC,2023, vol, no 17
438 ultralytics/ultralytics. Accessed: Month 01-2023
439 12. Hussain, M. (2023). Yolo-v1 to yolo-v8, the rise of yolo and its complementary nature toward digital
440 manufacturing and industrial defect detection. Machines, 11(7), 677.
441 13. Wu, Z., Chen, Y., Zhao, B., Kang, X., Ding, Y. (2021). Review of weed detection methods based on
442 computer vision. Sensors, 21(11), 3647.
443 14. Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., et al. (2016). Ssd: Single shot multibox
444 detector//European conference on computer vision.
445 15. Girshick, R. (2015). Fast r-cnn//Proceedings of the IEEE international conference on computer vision.
18 CMC,2023, vol, no
Olsen,
446 16. Konovalov, D. A., Philippa, B., Ridd, P., Wood, J. C., et al. (2019). Deepweeds: A multiclass weed
A.,
species
447 image dataset for deep learning. Scientific reports, 9(1), 1–12.
Szegedy,
448 17.C., Ioffe, S., Vanhoucke, V., Alemi, A. A. (2017). Inception-v4, inception-resnet and the impact of
residual
449 connections on learning//Thirty-first AAAI conference on artificial intelligence.
450 18. He, K., Zhang, X., Ren, S., Sun, J. (2016). Deep residual learning for image
451 recognition//Proceedings of the IEEE conference on computer vision and pattern recognition.
452 19. Partel, V., Kakarla, S. C., Ampatzidis, Y. (2019). Development and evaluation of a low-cost and smart
453 technology for precision weed management utilizing artificial intelligence. Computers and
454 electronics in agriculture, 157, 339–350.
455 20. Redmon, J., Farhadi, A. (2018). Yolov3: An incremental improvement. arXiv preprint
456 arXiv:1804.02767.
457 21. Czymmek, V., Harders, L. O., Knoll, F. J., Hussmann, S. (2019). Vision-based deep learning approach
458 for real-time detection of weeds in organic farming//2019 IEEE International Instrumentation and
459 Measurement Technology Conference (I2MTC).
460 22. Sharpe, S. M., Schumann, A. W., Boyd, N. S. (2020). Goosegrass detection in strawberry and
461 tomato using a convolutional neural network. Scientific Reports, 10(1), 9548.
462 23. Trong, V. H., Gwang-hyun, Y., Vu, D. T., Jin-young, K. (2020). Late fusion of multimodal deep neural
463 networks for weeds classification. Computers and Electronics in Agriculture, 175, 105506.
464 24. Adam, G., Lorraine, J. (2019). Understanding neural architecture search techniques. arXiv preprint
465 arXiv:1904.00438.
466 25. Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.-C. (2018). Mobilenetv2: Inverted
467 residu- als and linear bottlenecks//Proceedings of the IEEE conference on computer vision and
468 pattern recog- nition.
469 26. Simonyan, K., Zisserman, A. (2014). Very deep convolutional networks for large-scale image recog-
470 nition. arXiv preprint arXiv:1409.1556.
471 27. Hu, K., Coleman, G., Zeng, S., Wang, Z., Walsh, M. (2020). Graph weeds net: A graph-based deep
472 learning method for weed recognition. Computers and electronics in agriculture, 174, 105520.
473 28. Peteinatos, G. G., Reichel, P., Karouta, J., Andújar, D., Gerhards, R. (2020). Weed identification in
474
maize, sunflower, and potatoes with the aid of convolutional neural networks. Remote Sensing,
475
12(24), 4185.
476 29. Chollet, F. (2017). Xception: Deep learning with depthwise separable convolutions//Proceedings of
477
the IEEE conference on computer vision and pattern recognition.
478 30. Ramirez, W., Achanccaray, P., Mendoza, L., Pacheco, M. (2020). Deep convolutional neural networks
479
for weed detection in agricultural crops using optical aerial images//2020 IEEE Latin American
480
GRSS & ISPRS Remote Sensing Conference (LAGIRS).
481 31. Chen, L.-C., Papandreou, G., Schroff, F., Adam, H. (2017). Rethinking atrous convolution for semantic
482
image segmentation. arXiv preprint arXiv:1706.05587.
483 32. Badrinarayanan, V., Kendall, A., Cipolla, R. (2017). Segnet: A deep convolutional encoder-decoder
484
architecture for image segmentation. IEEE transactions on pattern analysis and machine
485
intelligence, 39(12), 2481–2495.
486 33. Ronneberger, O., Fischer, P., Brox, T. (2015). U-net: Convolutional networks for biomedical image
487
segmentation//Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015:
488
18th International Conference, Munich, Germany, October 5-9, 2015, Proceedings, Part III 18.
489 34. Springer. Dang, F., Chen, D., Lu, Y., Li, Z., Zheng, Y. (2022). Deepcottonweeds (dcw): a novel
490
benchmark of yolo object detectors for weed detection in cotton production systems//2022 ASABE
491
Annual Interna- tional Meeting.
492 35. Bochkovskiy, A., Wang, C.-Y., Liao, H.-Y. M. (2020). Yolov4: Optimal speed and accuracy of object
CMC,2023, vol, no 19
540 55. Yu, C., Liu, Y., Zhang, W., Zhang, X., Zhang, Y., et al. (2023). Foreign objects identification of
541 transmission line based on improved yolov7. IEEE Access, 11(11), 51997–52008.
542 56. Maggioli, M. (2021). Evaluating the performances of a weed-detection algorithm for multiple plant
543 species detection to improve biodiversity preservation. [Netherlands]:[publisher not identified].
544 57. Padilla, R., Passos, W. L., Dias, T. L., Netto, S. L., Da Silva, E. A. (2021). A comparative analysis of
545 object detection metrics with a companion open-source toolkit. Electronics, 10(3), 279.
546 58. Yang, S., Xing, Z., Wang, H., Dong, X., Gao, X., et al. (2023). Maize-yolo: a new high-precision and
547 real-time method for maize pest detection. Insects, 14(3), 278.
548 59. Hearst, M. A., Dumais, S. T., Osuna, E., Platt, J., Scholkopf, B. (1998). Support vector machines.
549 IEEE Intelligent Systems and their applications, 13(4), 18–28.
550 60. McAndrew, A. (2004). An introduction to digital image processing with matlab notes for scm2511
551 image processing 1 semester 1, 2004.
552 61. Islam, N., Rashid, M. M., Wibowo, S., Xu, C.-Y., Morshed, A., et al. (2021). Early weed detection
553 using image processing and machine learning techniques in an australian chilli farm. Agriculture,
554 11(5), 387.
555 62. Breiman, L. (2001). Random forests. Machine learning, 45, 5–32.
556 63. Liakos, K. G., Busato, P., Moshou, D., Pearson, S., Bochtis, D. (2018). Machine learning in agriculture:
557 A review. Sensors, 18(8), 2674.
558 64. Bakhshipour, A., Jafari, A. (2018). Evaluation of support vector machine and artificial neural networks
559 in weed detection using shape features. Computers and Electronics in Agriculture, 145, 153–160.
560 65. Pantazi, X.-E., Moshou, D., Bravo, C. (2016). Active learning system for weed species recognition
561 based on hyperspectral sensing. Biosystems Engineering, 146, 193–202.
562 66. Gao, J., Nuyttens, D., Lootens, P., He, Y., Pieters, J. G. (2018). Recognising weeds in a maize crop
563 using a random forest machine-learning algorithm and near-infrared snapshot mosaic hyperspectral
564 imagery. Biosystems engineering, 170, 39–50.
565 67. Lohia, A., Kadam, K. D., Joshi, R. R., Bongale, A. M. (2021). Bibliometric analysis of one-stage and
566 two-stage object detection. Libr. Philos. Pract, 4910, 34.
567 68. Lachenbruch, P. A. (2014). Mcnemar test. Wiley StatsRef: Statistics Reference Online.
568 69. Krizhevsky, A., Sutskever, I., Hinton, G. E. (2017). Imagenet classification with deep convolutional
569 neural networks. Communications of the ACM, 60(6), 84–90.
570 70. Sabzi, S., Abbaspour-Gilandeh, Y., Arribas, J. I. (2020). An automatic visible-range video weed
571 detection, segmentation and classification prototype in potato field. Heliyon, 6(5), e03685.
572 71. Le, V. N. T., Apopei, B., Alameh, K. (2019). Effective plant discrimination based on the combination of
573 local binary pattern operators and multiclass support vector machine methods. Information processing
574 in agriculture, 6(1), 116–131.
575 72. Louargant, M., Jones, G., Faroux, R., Paoli, J.-N., Maillot, T., et al. (2018). Unsupervised classification
576 algorithm for early weed detection in row-crops by combining spatial and spectral information. Remote
577 Sensing, 10(5), 761.
578 73. Mahajan, S., Raina, A., Gao, X.-Z., Kant Pandit, A. (2021). Plant recognition using morphological
579 feature extraction and transfer learning over svm and adaboost. Symmetry, 13(2), 356.
580 74. Wang, A., Zhang, W., Wei, X. (2019). A review on weed detection using ground-based machine vision
581 and image processing techniques. Computers and electronics in agriculture, 158, 226–240.
582 75. Osorio, K., Puerto, A., Pedraza, C., Jamaica, D., Rodríguez, L. (2020). A deep learning approach for
583 weed detection in lettuce crops using multispectral images. AgriEngineering, 2(3), 471–488.
584 76. Wakchaure, M., Patle, B., Mahindrakar, A. (2023). Application of ai techniques and robotics in agri-
585 culture: A review. Artificial Intelligence in the Life Sciences, 100057.
586 77. Benos, L., Tagarakis, A. C., Dolias, G., Berruto, R., Kateris, D., et al. (2021). Machine learning in
CMC,2023, vol, no 21
634 arabia): Implication for invasive species ecology. Biosci. Biotech. Res. Asia, 15(3), 619–625.
635 102. Fatih, B., Kayaalp, F. (2021). Review of machine learning and deep learning models in agriculture.
636 International Advanced Researches and Engineering Journal, 5(2), 309–323.
637 103. Tan, M., Pang, R., Le, Q. V. (2020). Efficientdet: Scalable and efficient object detection//Proceedings
638 of the IEEE/CVF conference on computer vision and pattern recognition.
639 104. Alam, M., Alam, M. S., Roman, M., Tufail, M., Khan, M. U., et al. (2020). Real-time machine-learning
640 based crop/weed detection and classification for variable-rate spraying in precision
agriculture//2020 641 7th International Conference on Electrical and Electronics Engineering (ICEEE).
642 105. Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., et al. (2015). Going deeper with convolu-
643 tions//Proceedings of the IEEE conference on computer vision and pattern recognition.
644 106. Patidar, S., Singh, U., Sharma, S. K., et al. (2020). Weed seedling detection using mask regional
645 convolutional neural network//2020 International Conference on Electronics and Sustainable Commu-
646 nication Systems (ICESC).
647 107. Partel, V., Kim, J., Costa, L., Pardalos, P. M., Ampatzidis, Y. (2020). Smart sprayer for precision weed
648 control using artificial intelligence: Comparison of deep learning frameworks.//ISAIM.
649 108. Li, J., Cheng, J.-h., Shi, J.-y., Huang, F. (2012). Brief introduction of back propagation (bp) neural
650 network algorithm and its improvement//Advances in Computer Science and Information Engineering:
651 Volume 2. Springer.
652 109. Leutenegger, S., Chli, M., Siegwart, R. Y. (2011). Brisk: Binary robust invariant scalable key-
653 points//2011 International conference on computer vision. Ieee.
654 110. Margineantu, D. D., Dietterich, T. G. (1997). Pruning adaptive boosting//ICML. volume 97. Citeseer.
655 111. Liu, S., Qi, L., Qin, H., Shi, J., Jia, J. (2018). Path aggregation network for instance segmenta-
656 tion//Proceedings of the IEEE conference on computer vision and pattern recognition.
657 112. He, K., Gkioxari, G., Dollár, P., Girshick, R. (2017). Mask r-cnn//Proceedings of the IEEE interna-
658 tional conference on computer vision.
659 113. Redmon, J., Farhadi, A. (2017). Yolo9000: better, faster, stronger//Proceedings of the IEEE conference
660 on computer vision and pattern recognition.
661 114. Adarsh, P., Rathi, P., Kumar, M. (2020). Yolo v3-tiny: Object detection and recognition using one
662 stage improved model//2020 6th international conference on advanced computing and
communication 663 systems (ICACCS). IEEE.
664 115. Padilla, R., Netto, S. L., Da Silva, E. A. (2020). A survey on performance metrics for object-detection
665 algorithms//2020 international conference on systems, signals and image processing (IWSSIP).
IEEE. 666 116. Long, J., Shelhamer, E., Darrell, T. (2015). Fully convolutional networks for semantic
segmenta- 667 tion//Proceedings of the IEEE conference on computer vision and pattern recognition.
668 117. Kohonen, T. (2012). Self-organizing maps, volume 30. Springer Science & Business Media.
669 118. Gordon, A. D. (1999). Classification. CRC Press.
670 119. S. K. Valicharla, "Weed Recognition in Agriculture: A Mask R-CNN Approach," M.S. thesis, West
Virginia Univ., Morgantown, WV, 2021.
672 120. (-). Weedcrop image dataset@ONLINE. URL https://www.kaggle.com/datasets/
673 vinayakshanawad/weedcrop-image-dataset?resource=download.
674 121. (2021). Saudi green initiative@ONLINE. URL https://www.greeninitiatives.gov.sa/
675 saudi-global-climate-Impact/.
676 122. ultralytics (2020). Yolov5. URL https://github.com/ultralytics/yolov5.
677 123. Rath, S. (2022). Yolov6 object detection â paper explanation and inference. URL https://
678 learnopencv.com/yolov6-object-detection/#YOLOv6-vs-YOLOv5.
679 124. Sovit Rath, V. G. (2022). Performance comparison of yolo object detection models â an intensive
681 125. Rath, S. (2023). Train yolov8 on custom dataset â a complete tutorial. URL https://learnopencv.
682 com/train-yolov8-on-custom-dataset/.
683 126. (-). Roboflow. URL https://roboflow.com/.
684 127. (-). Google colaboratory. URL https://colab.research.google.com/.
685 128. Espinoza, M. A. M. (2020). USING MACHINE LEARNING FOR WEED IDENTIFICATION AND
686 YIELD PREDICTION OF STRAWBERRIES. Ph.D. thesis, California State Polytechnic University,
687 Pomona.
688 129. Gai, J., Tang, L., Steward, B. L. (2020). Automated crop plant detection based on the fusion of color
689 and depth images for robotic weed control. Journal of Field Robotics, 37(1), 35–52.
690 130. Di Cicco, M., Potena, C., Grisetti, G., Pretto, A. (2017). Automatic model based dataset generation
691 for fast and accurate crop and weeds detection//2017 IEEE/RSJ International Conference on Intelligent
692 Robots and Systems (IROS). IEEE.
693 131. Haug, S., Ostermann, J. (2015). A crop/weed field image dataset for the evaluation of computer vi-
694 sion based precision agriculture tasks//Computer Vision-ECCV 2014 Workshops: Zurich,
Switzerland,
695 September 6-7 and 12, 2014, Proceedings, Part IV 13. Springer.
696 132. Lameski, P., Zdravevski, E., Trajkovik, V., Kulakov, A. (2017). Weed detection dataset with rgb im-
697 ages taken under variable light conditions//ICT Innovations 2017: Data-Driven Innovation. 9th
Inter-
698 national Conference, ICT Innovations 2017, Skopje, Macedonia, September 18-23, 2017,
Proceedings
699 9. Springer.
700 133. Kazmi, W., Garcia-Ruiz, F. J., Nielsen, J., Rasmussen, J., Andersen, H. J. (2015). Detecting
creeping
701 thistle in sugar beet fields using vegetation indices. Computers and Electronics in Agriculture, 112,
702 10–19.