## 5 Discussion
### AlexNet Identification Results  
Figure 11 is the AlexNet architecture investigated in this paper, which contains five convolutional layers (Cov), three max pooling layers (Max pooling), two fully connected layers (Fully connected), and an output layer [41]. Relu was used as the activation function to prevent the problem of gradient vanishing in this network. The max pooling layers were connected after Cov1, Cov2, and Cov5, and LRN (local response normalization) was set after the layers Cov1 and Cov2. Each of two fully connected layers has 4096 neurons and randomly deactivates neurons using the dropout method for reducing the overfitting [42; 43]. The output layer contains four neurons and is used to represent the four categories or the four contents of the adulterations. In the current study, AlexNet network was implemented with the PyTorch (v1.13.0) deep-learning framework with the computer system configuration details shown in Table 4.  
During the training of AlexNet, we randomly selected 80% samples from the feature dataset as the training sub-dataset, and the remaining 20% of samples were used as the testing sub-dataset. The size of the input image was resized to 224 \(\times\) 224 pixels to match the input requirement of the AlexNet network. The Adam optimizer performs better in sparse data than the SGD optimizer due to it tending to fall into local optima. The Adam optimizer can assign different learning rates to different parameters, thus increasing the optimization speed. It therefore was chosen to be employed in the current study. The parameters of the training process are listed in Table 5. \begin{table}
\begin{tabular}{l l} \hline \hline
**Item** & **Parameters** \\ \hline CPU & Core(TM) i9-12900H, 2.50 GHz \\ RAM & 16.0 GB, 3200 MHz \\ GPU & NVIDIA GeForce RTX 3060 Laptop GPU 6 GB \\ Operating System & Windows 11 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Details of the system configuration for running AlexNet. Figure 11: The architecture of AlexNet used to identify the adulterants in chili powder. \begin{table}
\begin{tabular}{l l l l l l l l} \hline \hline \multirow{2}{*}{**Datasets**} & \multicolumn{3}{c}{**HOG**} & \multicolumn{3}{c}{**SVM**} & \multirow{2}{*}{**Accuracy**} & \multirow{2}{*}{**Std**} \\ \cline{2-2} \cline{4-7}  & **Cell Size** & **Block Size** & **Kernel Functions** & **C** & \(\boldsymbol{\gamma}\) & \\ \hline \(1\) & 10 & 1 & RBF & 32.0 & 0.031 & 0.983 & 0.0136 \\ _1-ca_ & 8 & 2 & Sigmoid & 2.0 & 2.0 & 0.942 & 0.0204 \\ _1-cb_ & 12 & 1 & RBF & 0.125 & 8.0 & 0.933 & 0.0333 \\ _1-ct_ & 4 & 1 & RBF & 11.314 & 90.510 & 0.950 & 0.0486 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Summary of the identification accuracy based on HOG features with different parameters. Figure 12 shows the performance comparison of the AlexNet training process on different datasets. It can be seen that the best performance was obtained on the dataset \(I\) with the accuracy of 96.5%, and the slightly lower accuracies of 92.7%, 94.7%, and 93.7% were run on the other three datasets _l-ca_, _l-cb_, and _l-ct_. The model parameters that obtained the highest accuracy on each training dataset were also validated on each corresponding testing sub-dataset. Table 6 shows the comparison of the identification accuracies of HOG+SVM and AlexNet. It can be seen HOG+SVM obtained the absolute higher identification accuracy than AlexNet on all datasets, as the identification accuracy of the deep-learning algorithm is highly dependent on the amount of training data. If the number of samples increased, AlexNet should express higher identification accuracy. However, the time consumed for both training and identification process will undoubtedly be lengthened. Furthermore, collecting more sample data also requires a lot of time. It should be noted that due to the sample number of the dataset \(I\) being much greater than other datasets, the training on the dataset \(I\) inevitably takes the longest time.