## 3 Results and Discussion
### Clustering Accuracy Results for Each Group  
The confusion matrix is an illustration of important classification results. The resulting confusion matrix with three views of Red Delicious and Golden Delicious apples are shown in Tables 4 and 5, respectively.  
In this study, there were 18 groups of apples (2 groups for healthy apples and 16 groups for unhealthy apples), and the accuracy of this method was shown to be about 90%. Each time the program is run, the accuracy varies by about 1-2%, from 88 to 92%, due to the random selection of sub-images within the images. After creating the dictionary by sparse coding, it was used to train the multilayer perceptron neural network. The perceptron neural network variables can be the number of neurons in the hidden layer, the number of hidden layers, and the learning rate. The following tables show the average clustering accuracy for all classes in a percentage for the change in network parameters. It should be noted that, since this is a clustering problem, the error rate (MSE) and coefficient of determination (R\({}^{2}\)) parameters will not be considered, and the performance evaluation parameters only include the clustering accuracy in terms of percentage and processing time.  
\begin{table}
\begin{tabular}{l l} \hline Number of features & 11 \\ \hline Number of classes & 18 \\ \hline Number of data used for training & 2073 \\ \hline Number of data used for validation & 519 \\ \hline \end{tabular}
\end{table}
Table 3: Information of the amount of data used in the artificial neural network classifier.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Number of Neurons in the Hidden Layer** & **Average Clustering Accuracy for All Classes (\%)** \\ \hline
2 & 79 \\
4 & 85 \\
6 & 86 \\
8 & 89 \\
10 & 91 \\
12 & 90 \\
14 & 87 \\
16 & 86 \\
18 & 85 \\
20 & 81 \\
22 & 80 \\
24 & 77 \\
26 & 75 \\
28 & 71 \\ \(\ldots\) & \(\ldots\) \\
70 & 30 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Average clustering accuracy for all classes with a hidden layer.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Learning Rate** & **Average Clustering Accuracy for All Classes (\%)** \\ \hline
0.1 & 89 \\
0.2 & 91 \\
0.3 & 90 \\
0.4 & 89 \\
0.5 & 88 \\
0.6 & 83 \\
0.7 & 84 \\
0.8 & 80 \\
0.9 & 79 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Average clustering accuracy for all classes with a hidden layer, 10 neurons, and different learning rates.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Number of Neurons in the Hidden Layer** & **Average Clustering Accuracy for All Classes (\%)** \\ \hline
2 & 79 \\
4 & 85 \\
6 & 86 \\
8 & 89 \\
8 & 10 & 90 \\
10 & 12 & 91 \\
12 & 10 & 90 \\
12 & 12 & 88 \\
14 & 12 & 87 \\
14 & 14 & 83 \\ \(\ldots\) & \(\ldots\) & \(\ldots\) \\
20 & 20 & 80 \\ \(\ldots\) & \(\ldots\) & \(\ldots\) \\
30 & 30 & 69 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Average clustering accuracy for all classes with two hidden layers.  
In this study, the sparse coding, which was used to reduce the size of database in the neural network training phase, had several benefits, such as increasing the learning speed of training data in the problems with very large database or increasing the performance of clustering problems in the image processing, where the feature extraction methods had a poor performance. The hidden pattern of feature relationships in the image processing problems can also be extracted using sparse coding. However, alongside these benefits and despite being often used for image processing problems, its application to other pattern recognition issues was limited. Additionally, implementing this method required the dimensions of the images in the database to be large.