# Weed Detection and Classification with Computer Vision Using a Limited Image Dataset
## 3 Results
### The Maximum Precisions by Training Image Number  
To find the best classification method, we selected the three best precision results by training image number. Tables 17-22 show the results. The bold highlighted columns show the maximum achieved precision results with training images per plant.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Features** & **Classifier** & **5** & **10** & **20** & **40** & **80** & **160** \\ \hline Color & RF & 76.19 & 82.16 & 84.24 & 87.52 & 89.76 & 91.18 \\ All exp. Hu, HOG & RF & 76.86 & 84.33 & 86.53 & 90.45 & 92.72 & 93.77 \\ All exp. HOG & RF & 75.43 & 83.04 & 86.16 & 91.20 & 92.85 & 93.71 \\ \hline \hline \end{tabular} The bold column is the best precision values.  
\end{table}
Table 17: The three best results with five training images.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Features** & **Classifier** & **5** & **10** & **20** & **40** & **80** & **160** \\ \hline Color & RF & 76.19 & 82.16 & 84.24 & 87.52 & 89.76 & 91.18 \\ All exp. Hu, HOG & RF & 76.86 & 84.33 & 86.53 & 90.45 & 92.72 & 93.77 \\ All exp. HOG & RF & 75.43 & 83.04 & 86.16 & 91.20 & 92.85 & 93.71 \\ \hline \hline \end{tabular} The bold column is the best precision values.  
\end{table}
Table 18: The 3 best results with 10 training images.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Features** & **Classifier** & **5** & **10** & **20** & **40** & **80** & **160** \\ \hline All exp. Hu, HOG & RF & 76.86 & 84.33 & 86.53 & **90.45** & 92.72 & 93.77 \\ All exp. HOG & RF & 75.43 & 83.04 & 86.16 & **91.20** & 92.85 & 93.71 \\ All exp. HOG & GBM & 66.22 & 74.03 & 83.00 & **90.46** & 92.81 & 94.56 \\ \hline \hline \end{tabular} The bold column is the best precision values.  
\end{table}
Table 19: The 3 best results with 20 training images.  
Figure 10: Comparison of the classification methods.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Features** & **Classifier** & **5** & **10** & **20** & **40** & **80** & **160** \\ \hline Color & RF & 76.19 & 82.16 & 84.24 & 87.52 & 89.76 & 91.18 \\ All exp. Hu, HOG & RF & 76.86 & 84.33 & 86.53 & 90.45 & 92.72 & 93.77 \\ All exp. HOG & RF & 75.43 & 83.04 & 86.16 & 91.20 & 92.85 & 93.71 \\ \hline \hline \end{tabular} The bold column is the best precision values.  
\end{table}
Table 20: The 3 best results with 40 training images.  
When training with only a few images, the RF classifier emerged as the optimal choice. However, as the number of images increased, the GBM classifier tended to yield superior results.  
It appears that feature combinations offer the most promising outcomes, as opposed to using all features together. Notably, the inclusion of HOG features and Hu moments tended to degrade classification performance.  
For datasets comprising fewer than 20 training images, it is advisable to utilize all features except Hu moments and HOG features with the RF classifier. Conversely, datasets with more than 40 training images may benefit from using all features except HOG features with the RF classifier.  
In cases where a large number of images are available, such as 160, and optimal weed classification is desired, employing the GBM classifier is recommended. However, it is essential to note that GBM was slower than RF and only marginally improved the results.  
It is encouraging to observe that even with as few as 10 training images, an 84% precision classifier can be developed. With approximately 40 training images, a precision of 91% was achieved. For datasets containing around 160 training images per plant, precision results approaching 95% were attained. In our study, the maximum precision achieved was 94.56%.