# Leveraging Machine Learning for Weed Management and Crop Enhancement: Vineyard Flora Classification
## 4 Results
### Experiment 3: Testing a New Dataset with Re-Trained PyTorch Classification Architectures  
Smaller datasets, such as the initial one of 172 images, pose challenges for training complex deep learning models. Such models require large data to generalize effectively, and with limited data, overfitting risks increase. For smaller datasets, overly complex architectures might not be suitable, as they demand extensive data for effective training. So, in this phase of the research, the twelve architectures were re-trained using the initial combination of hyperparameters that yielded the best results and the new dataset, extending the simulation to 200 epochs. The aim was to assess whether these models could maintain their performance when trained with varying quantities of images and more variance in the backgrounds. The updated dataset was obtained by downloading several images from various platforms, including Flora-On [37], INaturalist [38], UTAD Botanical  
Figure 4: Performance evaluation of the top twelve sub-architectures: simulation results for 25 epochs.  
Figure 3: Highest accuracy achieved from all the architectures trained with the smallest dataset.  
Garden [39], and the Global Biodiversity Information Facility (GBIF) [40]. This dataset comprises 6730 images categorized into the five classes that were defined in the dataset. The images were randomly split, following the standard practice of an 85% training set and a 15% validation set, as recommended in the literature [33]. Consequently, 5724 images were used for training, while 1006 photos were reserved for model validation. The distribution of these images across different species in both the training and validation sets is shown in Figure 5.  
Figure 6 shows the results of the accuracy of the top twelve models trained with the new and extended dataset.  
Experiment 4: Testing Best-Performing Models of PyTorch Classification Architectures with New Images  
To evaluate the models, a web application was developed using Gradio [41]. New testing images were captured (26 images) in the field, with the same camera used in experiment 1, after completing all training and experiments, averaging five images per species. These images were taken using a phone camera for further assessment.  
During this phase, images of the five plant species were sequentially uploaded to the web application's interface, and their classifications were verified.  
Figure 5: The extended dataset of 6730 images is visually represented, showcasing the distribution of images for training and validation across different species. The blue line indicates the number of training images per species, and the orange line represents the validation images. In comparison, the green line shows training images and the red line depicts validation images from the initial dataset.  
Figure 6: Model performance of the top twelve models trained with the extended dataset.  
In the testing stage, the MaxVit model and various versions of ShuffleNet and EfficientNet, which were utilized in previous sections, were employed. Each model was tested with the same test images.  
Users can upload an image of a plant species, request its classification, and receive the species' name in return.  
The results, shown in Figure 7, show that both EfficientNet_B5 and EfficientNet_B1 achieved superior accuracy.