## 4 Experimental Result
### Comparison of Model Efficiency & Embedded System  
To compare the models and training methods proposed in this paper, this experiment chose famous models, including ResNet [18], MobileNetV3 [19], EfficientNetV2 [30], and ShuffleNetV2 [31], to evaluate and compare with LDCNN. In this experiment, the same dataset was used to train each model. The Adam optimizer was employed, learning rate was set to 0.001, batch size was 16, and 100 epochs were trained. This study used the public dataset of green coffee beans, because most of the related research uses private datasets and is not public. In this work, the evaluation indicators of each model were tested, including accuracy, precision, recall, F1 score, parameter, model size, GFLOPs, and evaluation time, as shown in Table 4. We used the F1 score divided by eval time for evaluation. If the value was higher, the proposed model was the best in the green coffee bean identification task, as shown in Figure 16. As suggested in Table 4, in the quality detection of green coffee beans, the accuracy rate was better when LDCNN was used than when other models were utilized. However, the accuracy rate was quite low with the ResNet model compared with that with the other models; ResNet18 had an accuracy of only 89.66%, and ResNet 34 and ResNet 50 had decreased accuracy due to overfitting under increased CL.  
Based on relevant research of public datasets [29], a lightweight model was proposed by [PERSON] et al. [9] in which the ResNet18 model was trained as a teacher model through knowledge distillation (KD) to train the lightweight model. The accuracy rate of the lightweight model reached up to 91% with parameters of 256,779. As illustrated in Table 5, [PERSON] et al. [11] put forward DSC, SAM, SpinalNet, and KD methods to train the model when the F1 score achieved 96.54%. Compared with LDCNN, the previous model [9] had higher accuracy and lower parameters since the latter took ResNet18 as the teacher model for training. Nevertheless, ResNet18 in this experiment was not the optimal model, resulting in a low accuracy rate of the lightweight model. In contrast to [PERSON] et al. [11], the precision of LDCNN increased by 2.12%, recall was raised by 0.36%, and F1 score gained 1.74%. Finally, the LDCNN was placed on Raspberry Pi 4B to execute the green coffee bean quality detection system (see Table 6). The evaluation time included model building, image preprocessing, and image estimation time, which showed that LDCNN could achieve the task of real-time detection on the embedded system. The model was performed using Python programming language on Raspberry Pi 4B. The experiment used a 3701 verification dataset, and evaluation time was the time it took the model to predict  
Figure 16: Comparisons with other related models.  
3701 images (including the preprocessing time). A total of 1226.57 s was used during the experiment when hardware acceleration method was not used. However, the image size of the verification dataset had been converted to 224 \(\times\) 224 \(\times\) 3 in numpy array format, so that the model could be executed on limited memory, and the implementation of the model on the embedded system.