## 4 Discussion  
In the disease recognition results, the classification accuracies of diseased, normal, and background parts are relatively high, achieving more than 91%, and the classification accuracy of the background parts is the highest at 98.10%, proving that this method has a better effect. In the process of the acquisition of optimal testing parameters, the size of the neighborhood block has a significant impact on the recognition results, among which the size of 7 \(\times\) 7 is the best. In the identification results with different dictionary sizes, \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Methods**} & \multicolumn{3}{c}{**Fruit Cracking**} & \multicolumn{3}{c}{**Rust Spot**} \\ \cline{2-7}  & **Average OA** & **Average Kappa** & **Average Time** & **Average OA** & **Average Kappa** & **Average Time** \\  & **(\%)** & **Coefficient** & **Cost (s)** & **(\%)** & **Coefficient** & **Cost (s)** \\ \hline SVM & 88.81 & 0.86 & 42.46 & 80.45 & 0.74 & 36.75 \\ KNN & 89.28 & 0.87 & 38.14 & 78.56 & 0.71 & 46.17 \\ DeepLabV3+ & 91.58 & 0.90 & 126.46 & 85.68 & 0.84 & 185.37 \\ Unet++ & 91.95 & 0.91 & 265.65 & 86.38 & 0.85 & 215.38 \\ Our method & 92.06 & 0.92 & 35.93 & 88.98 & 0.87 & 48.37 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Classification results of different methods. Figure 7: Average overall classification accuracy of different dictionary sizes. the average OA of fruit cracking disease is higher than that of rust spot, and the effect of the dictionary size on fruit cracking is more obvious than that of rust spot. In terms of the identification results of the different methods, the method proposed in this paper can effectively identify the disease nectarine images, and the reconstructed image of fruit cracking is better than that for rust spot disease. We found that the sparse dictionary learning method based on multi-color features combined with improved LK-SVD can identify fruit cracking and rust spot in nectarine quickly and accurately, which can provide technical support for disease identification in agricultural products. Reference [35] proposed an improved discriminative K-singular value decomposition (D-KSVD) algorithm for face recognition. In the D-KSVD algorithm, the initialization of dictionary \(D\) was implemented manually, which should guarantee that all categories were included in the dictionary. When human error occurs, the classification ability of the dictionary is incomplete. In the algorithm used in this study, we used \(D=Y\cdot\Omega\) to generate the initialized \(D\) randomly in the early stage of dictionary optimization; thus, the dictionary selection was dynamically adjusted according to the limited conditions. Furthermore, the dictionary optimization process can be converted from semi-manual to fully automatic, so we were able to develop a dictionary with strong category discrimination ability and linear classifiers. We added comparisons between machine learning methods and the recently advanced deep learning models of DeepLabV3+ and Unet++. Deep learning models need a GPU environment with a deep learning framework and additional acceleration libraries to conduct complex calculations, while our method does not rely on high-performance devices. Furthermore, the datasets in this study were relatively small, which are not suitable for deep learning models. In order to meet the requirements of deep learning for datasets, we used flipping, rotation, and other methods to expand the datasets. Finally, the OA results that we obtained were close to our method. Though the identification results of DeepLabV3+ and Unet++ were also relatively high and the average OAs for fruit cracking were 91.58% and 91.95%, their average time costs were much higher. Therefore, considering the high equipment costs, small sample, and long running time, the method proposed in this paper provides a basis for more effective fruit disease identification.