# Yielding Multi-Fold Training Strategy for Image Classification of Imbalanced Weeds
## 5 Experiments
### Training of DNN Models  
We trained the DNN models using the Keras library on an Ubuntu 16.04.5 LTS Linux server, Intel(R) Core(TM) i9-7900X CPU @ 3.30 GHz, 125 GB RAM. The graphics processing unit is a 12 GB NVIDIA TITAN V with CUDA 10.1. We selected 3 DNN models for the experiment. These models have different architectures, and capture species characteristics in different ways. * Mobilenet [38]. This model architecture uses depthwise and pointwise convolution to learn an object's features. There are fewer parameters in the model than in traditional convolution operators. Mobilenet is the lightest of the 3 DNN models. We used Mobilenet version 1, which has nearly 3.5 million trainable parameters. * Resnet [39]. This is a deep residual learning model in which a shortcut connection is added between two blocks of convolutional layers, allowing information from one layer to flow directly to another layer. We used the 50-layer Resnet model that has over 24 million trainable parameters. * NASNet [40]. This model architecture is generated by using Neural Architecture Search to build a network from the ImageNet dataset. We used the mobile version of NASNet, which has over 4.5 million trainable parameters. We applied transfer learning, and used parameters trained on the ImageNet dataset as the initial parameters to train the model. We fine-tuned all three models by adding a fully connected layer of length 256, batch normalization, ReLU, and a Softmax layer. The input RGB image for the three models was \(128\times 128\), normalized to the range \([0,1]\). Stochastic Gradient Descent was used as the optimization method with a learning rate of 0.001. We applied these model configurations on both strategies to enable a fair comparison between the conventional and YMuT strategies, except that the batch size varied depending on the model and dataset. Table 1 show the batch sizes for each model and dataset, which were applied for both training approaches. We evaluated model performance on two small datasets (small PlantVillage and PlantSeedlings) by applying 5-fold cross-validation and 2 data augmentation techniques, random rotation, and random zoom. We used the YMufT strategy and divided the training set into folds. Due to the small number of samples in each fold, we duplicated the images in each fold four times in PlantSeedlings and three times in the small PlantVillage dataset to avoided overfitting when training the model using those folds. On two large datasets (CNU Weeds and large PlantVillage), we randomly selected 60% of each species' images for training, 20% for validation, and 20% for testing. We used no data augmentation techniques in the training set. We applied a sequence of consecutive numbers \((\alpha_{k})_{k=1}^{P}\) as the training loop on \(P\) periods, which required us to select a value of \(P\) that satisfied inequality (16). Table 2 shows the total number of samples in the folds (2 nd column) and the training set (3 rd column) with \(k=0.5\). The ratio in the 4 th column indicates that use of \(eps\geq 8\) when training the model in the conventional training method guarantees that \(P\geq 1\). We trained the DNN models using the conventional training method on 50 epochs in CNU Weeds and PlantVillage, and 100 epochs on the PlantSeedlings dataset. We chose the maximum possible natural number \(T\) that satisfies inequality (16), as shown in Table 3. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **CNU** & **PlantVillage (Large)** & **PlantVillage (Small)** & **PlantSeedlings** \\ \hline Mobilenet & 128 & 32 & 32 & 128 \\ Resnet & 32 & 16 & 16 & 32 \\ NASNet & 16 & 8 & 8 & 16 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Batch size according to model and dataset.