## 5 Conclusions and Future Work  
In this study, a new model for quality detection of green coffee beans, a LDCNN, was proposed, which combined DSC, SE block, skip block, and other frameworks, as well as HS and ReLU activation functions, to make the model lightweight and efficient. To improve the performance and training stability, RA, LA, and GC models were combined to avoid random prediction caused by the lightweight model. Based on the experimental results, compared with those of other state-of-the-art models, our model could achieve a higher accuracy rate of 98.38% and an F1 score of 98.24% in the quality detection of green coffee beans, indicating excellent detection performance. When the model was placed in the embedded system, the average speed reached up to 3.02 FPS. Finally, the LIME interpretable model was used to verify that the model in this work was reliable, indicating that the impact of image preprocessing on the model after the image was interpretable and could be understood to optimize the training of the model or screen the abnormal data in the dataset. Hence, the accuracy and generalization of the model could be improved during the training. This work used a public dataset for verification, which predicted and classified the quality of green coffee beans. However, there are more than ten types of defective green coffee beans, and the types of defective beans can be classified in the future. Since coffee beans are classified via different screening methods, their color, shape, and size will be different, which can also improve the generalization of the model. In addition, with AI research focusing on edge computing and XAI in recent years, XAI techniques have been developed to improve the explainability of models, such that their output can be better understood. It can be imported into different industries, and the model can be judged with reliability. Therefore, we can focus on the development of efficient XAI algorithms to increase academic research and industrial application in the future work. Finally, ochratoxin A is a mycotoxin produced by mold. The contamination cases found in coffee beans in the past were all caused by mold caused by the drying process of coffee beans in harvesting and ochratoxin [37]. Therefore, the government should conduct market monitoring to strengthen food management. In addition, it is also necessary to pay attention to whether coffee-related products are mandatory to label with the category \begin{table}
\begin{tabular}{c c c} \hline \hline
**\# Image** & **Evaluate Time** & **Average Frames per Second (FPS)** \\ \hline
3701 & 1226.57 s & 3.0174 s \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Performance efficiency of the LDCNN model on Raspberry Pi 4B. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Models** & **Accuracy** & **Precision** & **Recall** & **F1 Score** & **Parameter** \\ \hline ResNet50 [18] & N/A & 84.00\% & 84.89\% & 84.21\% & N/A \\ [PERSON] et al. [9] & 91\% & N/A & N/A & N/A & 256,779 \\ [PERSON] et al. [11] & N/A & 96.48\% & 97.53\% & 96.54\% & N/A \\ SqueezeNet [14] & 95.92\% & 95.25\% & 96.01\% & 95.58\% & 1,248,424 \\ MobileNet [32] & N/A & 76.98\% & 81.31\% & 77.03\% & N/A \\ DenseNet121 [33] & N/A & 88.28\% & 88.28\% & 88.28\% & N/A \\ Xception [34] & N/A & 89.70\% & 89.56\% & 89.60\% & N/A \\ Vgg16 [35] & N/A & 93.55\% & 93.52\% & 93.09\% & N/A \\ [PERSON] et al. [36] & N/A & 97.38\% & 97.16\% & 97.21\% & N/A \\ LDCNN & **98.38\%** & **98.60\%** & **97.89\%** & **98.24\%** & **156,370** \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of using a public dataset. of caffeine and compliance with limit standards such as microorganisms, heavy metals, and pesticide residues. Global standards are based on reference to the background value of coffee products in various countries and the risk assessment results of people's dietary exposure and consider that people will not be caused health hazards due to excessive intake of ochratoxins under the condition of normal coffee drinking.