# Weed Detection and Classification with Computer Vision Using a Limited Image Dataset
## 1 Introduction  
In contemporary agriculture, a significant trend is emerging: a diminishing interest in working within the agricultural sector. Despite this trend, the global population continues to grow, now surpassing 8.1 billion people, all of whom require food to survive. The challenge is clear: How can we produce sufficient food with fewer people willing to work in agriculture? This situation underscores the urgent need for innovative methods and technologies to enhance agricultural productivity and ensure adequate food supply for everyone. In the field of computer vision, two prominent methodologies are particularly noteworthy: traditional feature-based approaches and deep learning methods. The former involves extracting meaningful features from images to facilitate classification tasks. This method relies on identifying distinctive characteristics within the image, such as shapes, textures, or color patterns, which are then used to classify objects or scenes. Conversely, deep learning methods, especially those involving neural networks, have gained significant traction in recent years. These approaches train complex neural network models using large datasets of labeled images. Through iterative learning processes, the neural network automatically extracts relevant features and makes classifications based on the input images. The cornerstone of computer vision (CV) deep learning methods is the convolutional neural network (CNN), with one of its prominent implementations being the YOLO algorithm. A previous study [1] included both artificial plants and real plants. Portulaca weeds were targeted, while square weeds and pepper plants were not targeted. For artificial plants, an accuracy and recall of 91% were achieved, while for real plants, an accuracy and recall of 71% and 78% were achieved, respectively. The YOLO deep learning solution was chosen for classification. In the field of agriculture, accessible datasets play a crucial role. While it is possible to generate images, progress can be accelerated by utilizing other datasets, particularly those with labeled data, to conduct tests and enable the training of artificial networks. While there are numerous databases available on the internet that contain images of dogs, cats, and human faces, finding usable datasets using images of crops, plants, leaves, fruits, vegetables, or weeds can be challenging. One such dataset, referenced in [2], focuses on five types of weeds and comprises 1200 images for each category. Similarly, in [3], the author discussed an on-site weed management computer vision system that utilizes a public weed database sourced from Kaggle. However, this dataset contains only 1300 images in total, further compounded by the fact that it is an augmented dataset. Originally, there were only 546 images available. Ref. [4] provides an up-to-date overview of publicly available image databases for weed detection. Among the 36 identified datasets, there were limitations regarding data variations and distributional shifts. This study concluded that few datasets are suitable for examining the robustness of weed detection models. In this study, a new, two-season, eight-class weed dataset was constructed, consisting of images collected in the 2021 and 2022 seasons. Tests were conducted on the dataset using the YOLO algorithm. The dataset discussed in [5] contains manually captured data from both handheld cameras and unmanned aerial systems, making it suitable for both ground-based and aerial weed control robots. This dataset comprises 3975 images featuring five different weed species commonly found in North Dakota. The images were captured under various lighting conditions, including sunny, cloudy, shadowy, and low-light conditions. Despite the impressive capabilities of deep learning algorithms in image classification tasks, there remains a significant level of opacity in understanding how these networks arrive at their decisions.