journal article·2022-10-29Open access

An Explainable and Lightweight Deep Convolutional Neural Network for Quality Detection of Green Coffee Beans

Chih-Hsien Hsia, Yi-Hsuan Lee, Chin-Feng Lai

Applied Sciences· Volume 12· Issue 21

Abstract

In recent years, the demand for coffee has increased tremendously. During the production process, green coffee beans are traditionally screened manually for defective beans before they are packed into coffee bean packages; however, this method is not only time-consuming but also increases the rate of human error due to fatigue. Therefore, this paper proposed a lightweight deep convolutional neural network (LDCNN) for a quality detection system of green coffee beans, which combined depthwise separable convolution (DSC), squeeze-and-excite block (SE block), skip block, and other frameworks. To avoid the influence of low parameters of the lightweight model caused by the model training process, rectified Adam (RA), lookahead (LA), and gradient centralization (GC) were included to improve efficiency; the model was also put into the embedded system. Finally, the local interpretable model-agnostic explanations (LIME) model was employed to explain the predictions of the model. The experimental results indicated that the accuracy rate of the model could reach up to 98.38% and the F1 score could be as high as 98.24% when detecting the quality of green coffee beans. Hence, it can obtain higher accuracy, lower computing time, and lower parameters. Moreover, the interpretable model verified that the lightweight model in this work was reliable, providing the basis for screening personnel to understand the judgment through its interpretability, thereby improving the classification and prediction of the model.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Coffee research and impacts · Advanced Chemical Sensor Technologies · Food Supply Chain Traceability

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Department of Engineering Science, National Cheng Kung University, Tainan City 70101, Taiwan

Department of Computer Science and Information Engineering, National Llan University, Yilan County 26041, Taiwan

Funding

Ministry of Science and Technology

References (37)

Show source-provided references
1. Influence of coffee drinking on subsequent risk of hepatocellular carcinoma: A prospective study in Japan10.1093/jnci/dji040 ↗
2. Association of coffee consumption with overall and cause-specific mortality in a large US prospective cohort study
3. Chemical composition of defective coffee beans10.1016/S0308-8146(98)00167-8 ↗
4. He, K., Zhang, X., Ren, S., and Sun, J. (2016, January 27–30). Deep residual learning for image recognition. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA.10.1109/CVPR.2016.90 ↗
5. Howard, A., Sandler, M., Chen, B., Wang, W., Chen, L.-C., Tan, M., Chu, G., Vasudevan, V., Zhu, Y., and Pang, R. (November, January 27). Searching for MobileNetV3. Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Korea.
6. Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., and Chen, L.-C. (2018, January 18–23). MobileNetV2: Inverted residuals and linear bottlenecks. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA.10.1109/CVPR.2018.00474 ↗
7. Hu, J., Shen, L., and Sun, G. (2018, January 18–23). Squeeze-and-excitation networks. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA.10.1109/CVPR.2018.00745 ↗
8. Liu, L., Jiang, H., He, P., Chen, W., Liu, X., Gao, J., and Han, J. (2020, January 20–30). On the variance of the adaptive learning rate and beyond. Proceedings of the International Conference on Learning Representations, Addis Ababa, Ethiopia.
9. Kingma, D.P., and Ba, J. (2015, January 7–9). Adam: A method for stochastic optimization. Proceedings of the International Conference on Learning Representations, San Diego, CA, USA.
10. Goyal, P., Doll’ar, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., and He, K. (2017). Accurate, large minibatch SGD: Training ImageNet in 1 hour. arXiv.
11. Zhang, M., Lucas, J., Ba, J., and Hinton, G.E. (2019, January 8–14). Lookahead optimizer: K steps forward, 1 step back. Proceedings of the Conference on Neural Information Processing Systems, Vancouver, BC, Canada.
12. Yong, H., Huang, J., Hua, X., and Zhang, L. (2020, January 23–28). Gradient centralization: A new optimization technique for deep neural networks. Proceedings of the European Conference on Computer Vision, Glasgow, UK.10.1007/978-3-030-58452-8_37 ↗
13. Ribeiro, M.T., Singh, S., and Guestrin, C. (2016, January 13–17). Why should I trust you? Explaining the predictions of ant classifier. Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA.10.1145/2939672.2939778 ↗
14. (2021, May 26). Coffee Bean Dataset: Small Optical Sorter. Available online: https://github.com/tanius/smallopticalsorter.
15. (2021, March 11). ImageNet. Available online: https://www.image-net.org/.
16. Tan, M., and Le, Q.V. (2021, January 18–24). EfficientNetV2: Smaller models and faster training. Proceedings of the International Conference on Machine Learning, Online.
17. Ma, N., Zhang, X., Zheng, H.-T., and Sun, J. (2018, January 8–14). ShuffleNet V2: Practical guidelines for efficient CNN architecture design. Proceedings of the European Conference on Computer Vision, Munich, Germany.10.1007/978-3-030-01264-9_8 ↗
18. Deep convolutional neural network for coffee bean inspection
19. Yang, P.-Y., Jhong, S.-Y., and Hsia, C.-H. (2021, January 15–17). Green coffee beans classification using attention-based features and knowledge transfer. Proceedings of the IEEE International Conference on Consumer Electronics-Taiwan, Penghu, Taiwan.10.1109/ICCE-TW52618.2021.9603134 ↗
20. Evaluation of green coffee beans quality using near infrared spectroscopy: A quantitative approach10.1016/j.foodchem.2012.06.059 ↗
21. A computer vision system for coffee beans classification based on computational intelligence techniques10.1016/j.jfoodeng.2015.10.009 ↗
22. Arboleda, E.R., Fajardo, A.C., and Medina, R.P. (2018, January 11–12). Classification of coffee bean species using image processing, artificial neural network and K nearest neighbors. Proceedings of the IEEE International Conference on Innovative Research and Development, Bangkok, Thailand.10.1109/ICIRD.2018.8376326 ↗
23. Arboleda, E.R., Fajardo, A.C., and Medina, R.P. (2018, January 11–12). An image processing technique for coffee black beans identification. Proceedings of the IEEE International Conference on Innovative Research and Development, Bangkok, Thailand.10.1109/ICIRD.2018.8376325 ↗
24. Pinto, C., Furukawa, J., Fukai, H., and Tamura, S. (2017, January 16–18). Classification of green coffee bean images based on defect types using convolutional neural network (CNN). Proceedings of the IEEE International Conference of Advanced Informatics, Denpasar, Indonesia.10.1109/ICAICTA.2017.8090980 ↗
25. Smart agriculture: Real-time classification of green coffee beans by using a convolutional neural network10.1049/iet-smc.2020.0068 ↗
26. Kabir, H.M.D., Abdar, M., Jalali, S.M.J., Khosravi, A., Atiya, A., Nahavandi, S., and Srinivasan, D. (2020). SpinalNet: Deep neural network with gradual input. arXiv.
27. (2021, September 01). Post-Training Quantization. Available online: https://www.tensorflow.org/model_optimization/guide/quantization/post_training.
28. Weight-quantized squeezenet for resource-constrained robot vacuums for indoor obstacle classification10.3390/ai3010011 ↗
29. What is the state of neural network pruning?
30. Tang, Z., Luo, L., Xie, B., Zhu, Y., Zhao, R., Bi, L., and Lu, C. (2022). Automatic sparse connectivity learning for neural networks. IEEE Transac. Neural Netw. Learn. Syst., 1–15.
31. Wang, Z., Li, C., and Wang, X. (2021, January 20–25). Convolutional neural network pruning with structural redundancy reduction. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA.10.1109/CVPR46437.2021.01467 ↗
32. Howard, A.G., Zhu, M., Chen, B., Kalenichenko, D., Wang, W., Weyang, T., Andreetto, M., and Adam, H. (2017). MobileNets: Efficient convolutional neural networks for mobile vision applications. arXiv.
33. Huang, G., Liu, Z., Maaten, L.V.D., and Weinberger, K.Q. (2017, January 21–26). Densely connected convolutional networks. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA.10.1109/CVPR.2017.243 ↗
34. Chollet, F. (2017, January 21–26). Xception: Deep learning with depthwise separable convolutions. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA.10.1109/CVPR.2017.195 ↗
35. Simonyan, K., and Zisserman, A. (2015, January 7–9). Very deep convolutional networks for large-scale image recognition. Proceedings of the International Conference for Learning Representations, San Diego, CA, USA.
36. Chen, P.-H., Jhong, S.-Y., and Hsia, C.-H. (2022, January 6–8). Semi-supervised learning with attention-based CNN for classification of coffee beans defect. Proceedings of the IEEE International Conference on Consumer Electronics-Taiwan, Taipei, Taiwan.10.1109/ICCE-Taiwan55306.2022.9869187 ↗
37. Ochratoxigenic fungi associated with green coffee beans (Coffea arabica L.) in conventional and organic cultivation in Brazil10.1590/S1517-83822013000200006 ↗