## 2 Materials and Methods
### Training of CNN Architectures  
The chickpea image dataset was organised into four labelled files, each with 550 original images. The dataset was split into three parts: training, validation, and testing. The training was performed on 80% of the original images, with the remaining 10% used for validation and the other 10% for testing. As a result, the 80:10:10 ratio was consistent across all varieties and models. The validation set was used to validate training performance, whereas the test set was used to validate classifier performance. The images for training, validation, and testing were chosen by initialising the GPU random seeds to ensure that the model networks were trained, validated, and tested on the same dataset. All three model architectures utilised in this work were trained five times using five different random seeds and the findings reported in this study are for a single random seed (3) shared by all model architectures. The different hyperparameters utilised during network training, such as momentum, number of epochs, and optimiser (stochastic gradient descent), were modified to properly train the CNN for image classification. Momentum is employed during network training to accelerate the learning rate. An epoch is the number of times the network traverses the complete training dataset. It is important to note that the number of epochs that a model should be trained for depends on a number of factors, including the size and complexity of the dataset, the complexity of the model, and the desired level of accuracy. The optimiser is used to update the network's learnable parameters during training in order to reduce the loss function [30]. The settings of these hyperparameters (Table 5) were chosen based on available literature and then kept constant to allow for fair comparisons between networks [31]. The learning rate specifies how frequently the weights in the layers are updated during training, whereas the batch size specifies the number of images used to train the network in each epoch. The minimum and maximum ranges of the hyperparameters were determined through several trials and based on existing related literature. Since the training was performed on pre-trained networks with defined weights, the learning rate was kept low at 0.005. A very low learning rate may result in prolonged training time without convergence, while a very high learning rate may result in poor learning of complexity from the training dataset [32]. Similarly, choosing the right batch \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Stage** & **Operator** & **Resolution** & **Channels** & **Layers** \\ \hline
1 & Conv2d, \(3\times 3\) & \(224\times 224\) & 32 & 1 \\
2 & MBConv1, k \(3\times 3\) & \(112\times 112\) & 16 & 1 \\
3 & MBConv6, k \(3\times 3\) & \(112\times 112\) & 24 & 2 \\
4 & MBConv6, k \(5\times 5\) & \(56\times 56\) & 40 & 2 \\
5 & MBConv6, k \(3\times 3\) & \(28\times 28\) & 80 & 3 \\
6 & MBConv6, k \(5\times 5\) & \(14\times 14\) & 112 & 3 \\
7 & MBConv6, k \(5\times 5\) & \(14\times 14\) & 192 & 4 \\
8 & MBConv6, k \(3\times 3\) & \(7\times 7\) & 320 & 1 \\
9 & Conv2D, \(1\times 1\) & \(7\times 7\) & 1280 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: EfficientNetB0 architecture. size is critical for network training because a small batch size will converge faster than a large batch size. Furthermore, a bigger batch size will achieve optimum minima, which a very tiny batch will find difficult to achieve. For the training, 'TensorFlow Lite Model Maker' was used that simplified the process of training a TensorFlow Lite model using custom dataset. It uses transfer learning to reduce the quantity of required training data and training time, resulting in fewer epochs of model training. In this study, we have added two layers, a dropout layer and a dense layer, after each pre-trained CNN. The dropout rate used was 20% in the dropout layer and the dense layer had four units, or neurons, in order to classify four different varieties of chickpea with the SoftMax activation function.