Home / Regular Issue / JST Vol. 30 (1) Jan. 2022 / JST-2536-2021


Deep Learning to Detect and Classify the Purity Level of Luwak Coffee Green Beans

Yusuf Hendrawan, Shinta Widyaningtyas, Muchammad Riza Fauzy, Sucipto Sucipto, Retno Damayanti, Dimas Firmanda Al Riza, Mochamad Bagus Hermanto and Sandra Sandra

Pertanika Journal of Science & Technology, Volume 30, Issue 1, January 2022

DOI: https://doi.org/10.47836/pjst.30.1.01

Keywords: Classification, convolutional neural network, Luwak coffee green beans, purity

Published on: 10 January 2022

Luwak coffee (palm civet coffee) is known as one of the most expensive coffee in the world. In order to lower production costs, Indonesian producers and retailers often mix high-priced Luwak coffee with regular coffee green beans. However, the absence of tools and methods to classify Luwak coffee counterfeiting makes the sensing method’s development urgent. The research aimed to detect and classify Luwak coffee green beans purity into the following purity categories, very low (0-25%), low (25-50%), medium (50-75%), and high (75-100%). The classifying method relied on a low-cost commercial visible light camera and the deep learning model method. Then, the research also compared the performance of four pre-trained convolutional neural network (CNN) models consisting of SqueezeNet, GoogLeNet, ResNet-50, and AlexNet. At the same time, the sensitivity analysis was performed by setting the CNN parameters such as optimization technique (SGDm, Adam, RMSProp) and the initial learning rate (0.00005 and 0.0001). The training and validation result obtained the GoogLeNet as the best CNN model with optimizer type Adam and learning rate 0.0001, which resulted in 89.65% accuracy. Furthermore, the testing process using confusion matrix from different sample data obtained the best CNN model using ResNet-50 with optimizer type RMSProp and learning rate 0.0001, providing an accuracy average of up to 85.00%. Later, the CNN model can be used to establish a real-time, non-destructive, rapid, and precise purity detection system.

  • Amirvaresi, A., Nikounezhad, N., Amirahmadi, M., Daraei, B., & Parastar, H. (2021). Comparison of near-infrared (NIR) and mid-infrared (MIR) spectroscopy based on chemometrics for saffron authentication and adulteration detection. Food Chemistry, 344, Article 128647. https://doi.org/10.1016/j.foodchem.2020.128647

  • Anami, B. S., Malvade, N. N., & Palaiah, S. (2019). Automated recognition and classification of adulteration levels from bulk paddy grain samples. Information Processing in Agriculture, 6(1), 47-60. https://doi.org/10.1016/j.inpa.2018.09.001

  • Azimi, S., Kaur, T., & Gandhi, T. K. (2021). A deep learning approach to measure stress level in plants due to Nitrogen deficiency. Measurement, 173, Article 108650. https://doi.org/10.1016/j.measurement.2020.108650

  • Bragagnolo, L., Rezende, L. R., da Silva, R. V., & Grzybowski, J. M. V. (2021). Convolutional neural networks applied to semantic segmentation of landslide scars. CATENA, 201, Article 105189. https://doi.org/10.1016/j.catena.2021.105189

  • Cancilla, J. C., Izquierdo, M., Semenikhina, A., Flores, E. G., Mejias, M. L., & Torrecilla, J. S. (2020). Exposing adulteration of Muscatel wines and assessing its distribution chain with fluorescence via intelligent and chaotic networks. Food Control, 118, Article 107428. https://doi.org/10.1016/j.foodcont.2020.107428

  • Cardoso, V. G. K., & Poppi, R. J. (2021). Cleaner and faster method to detect adulteration in cassava starch using Raman spectroscopy and one-class support vector machine. Food Control, 125, Article 107917. https://doi.org/10.1016/j.foodcont.2021.107917

  • Cebi, N., Yilmaz, M. T., & Sagdic, O. (2017). A rapid ATR-FTIR spectroscopic method for detection of sibutramine adulteration in tea and coffee based on hierarchical cluster and principal component analyses. Food Chemistry, 229, 517-526. https://doi.org/10.1016/j.foodchem.2017.02.072

  • Combes, M. C., Joet, T., & Lashermes, P. (2018). Development of a rapid and efficient DNA-based method to detect and quantify adulterations in coffee (Arabica versus Robusta). Food Control, 88, 198-206. https://doi.org/10.1016/j.foodcont.2018.01.014

  • Daniel, D., Lopes, F. S., Santos, V. B., & Lago, C. L. (2018). Detection of coffee adulteration with soybean and corn by capillary electrophoresis-tandem mass spectrometry. Food Chemistry, 243, 305-310. https://doi.org/10.1016/j.foodchem.2017.09.140

  • Eltrass, A. S., Tayel, M. B., & Ammar, A. I. (2021). A new automated CNN deep learning approach for identification of ECG congestive heart failure and arrhythmia using constant-Q non-stationary Gabor transform. Biomedical Signal Processing and Control, 65, Article 102326. https://doi.org/10.1016/j.bspc.2020.102326

  • Hendrawan, Y., Damayanti, R., Al-Riza, D. F., & Hermanto, B. (2021). Classification of water stress in cultured Sunagoke moss using deep learning. TELKOMNIKA, 19(5), 1594-1604. http://dx.doi.org/10.12928/telkomnika.v19i5.20063

  • Hendrawan, Y., Widyaningtyas, S., & Sucipto. (2019). Computer vision for purity, phenol, and pH detection of Luwak Coffee green bean. TELKOMNIKA, 17(6), 3073-3085. http://dx.doi.org/10.12928/telkomnika.v17i6.12689

  • Huang, X., Li, Z., Zou, X., Shi, J., Tahir, H. E., Xu, Y., Zhai, X., & Hu, X. (2019). A low cost smart system to analyze different types of edible Bird’s nest adulteration based on colorimetric sensor array. Journal of Food and Drug Analysis, 27(4), 876-886. https://doi.org/10.1016/j.jfda.2019.06.004

  • Huitron, V. G., Borges, J. A. L., Mata, A E. R., Sosa, L. E. A., Pereda, B. R., & Rodriguez, H. (2021). Disease detection in tomato leaves via CNN with lightweight architectures implemented in Raspberry Pi 4. Computers and Electronics in Agriculture, 181, Article 105951. https://doi.org/10.1016/j.compag.2020.105951

  • Iymen, G., Tanriver, G., Hayirlioglu, Y. Z., & Ergen, O. (2020). Artificial intelligence-based identification of butter variations as a model study for detecting food adulteration. Innovative Food Science & Emerging Technologies, 66, Article 102527. https://doi.org/10.1016/j.ifset.2020.102527

  • Izquierdo, M., Mejias, M. L., Flores, E. G., Cancilla, J. C., Perez, M., & Torrecilla, J. S. (2020a). Convolutional decoding of thermographic images to locate and quantify honey adulterations. Talanta, 209, Article 120500. https://doi.org/10.1016/j.talanta.2019.120500

  • Izquierdo, M., Mejias, M. L., Flores, E. G., Cancilla, J. C., Santos, R. A., & Torrecilla, J. S. (2020b). Deep thermal imaging to compute the adulteration state of extra virgin olive oil. Computers and Electronics in Agriculture, 171, Article 105290. https://doi.org/10.1016/j.compag.2020.105290

  • Jiang, B., He, J., Yang, S., Fu, H., Li, T., Song, H., & He, D. (2019). Fusion of machine vision technology and AlexNet-CNNs deep learning network for the detection of postharvest apple pesticide residues. Artificial Intelligence in Agriculture, 1, 1-8. https://doi.org/10.1016/j.aiia.2019.02.001

  • Jumhawan, U., Putri, S. P., Yusianto, Bamba, T., & Fukusaki, E. (2015). Application of gas chromatography/flame ionization detector-based metabolite fingerprinting for authentication of Asian palm civet coffee (Kopi Luwak). Journal of Bioscience and Bioengineering, 120(5), 555-561. https://doi.org/10.1016/j.jbiosc.2015.03.005

  • Jumhawan, U., Putri, S. P., Yusianto, Bamba, T., & Fukusaki, E. (2016). Quantification of coffee blends for authentication of Asian palm civet coffee (Kopi Luwak) via metabolomics: A proof of concept. Journal of Bioscience and bioengineering, 122(1), 79-84. https://doi.org/10.1016/j.jbiosc.2015.12.008

  • Jumhawan, U., Putri, S. P., Yusianto, Marwani, E., Bamba, T., & Fukusaki, E. (2013). Selection of discriminant markers for aunthetication of Asian palm civet coffee (Kopi Luwak): A metabolomics approach. Journal of Agricultural and Food Chemistry, 61(3), 7994-8001. https://doi.org/10.1021/jf401819s

  • Kiani, S., Minaei, S., & Varnamkhasti, M. G. (2017). Integration of computer vision and electronic nose as non-destructive systems for saffron adulteration detection. Computers and Electronics in Agriculture, 141, 46-53. https://doi.org/10.1016/j.compag.2017.06.018

  • Li, Q., Zeng, J., Lin, J., Zhang, J., Yao, L., Wang, S., Du, J., & Wu, Z. (2021). Mid-infrared spectra feature extraction and visualization by convolutional neural network for sugar adulteration identification of honey and real-world application. LWT, 140, Article 110856. https://doi.org/10.1016/j.lwt.2021.110856

  • Lim, D. K., Long, N. P., Mo, C., Dong, Z., Cui, L., Kim, G., & Kwon, S. W. (2017). Combination of mass spectrometry-based targeted lipidomics and supervised machine learning algorithms in detecting adulterated admixtures of white rice. Food Research International, 100(1), 814-821. https://doi.org/10.1016/j.foodres.2017.08.006

  • Lin, G., & Shen, W. (2018). Research on convolutional neural network based on improved Relu piecewise activation function. Procedia Computer Science, 131, 977-984. https://doi.org/10.1016/j.procs.2018.04.239

  • Lin, L., Xu, M., Ma, L., Zeng, J., Zhang, F., Qiao, Y., & Wu, Z. (2020). A rapid analysis method of safflower (Carthamus tinctorius L.) using combination of computer vision and near-infrared. Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy, 236, Article 118360. https://doi.org/10.1016/j.saa.2020.118360

  • Liu, Y., Yao, L., Xia, Z., Gao, Y., & Gong, Z. (2021). Geographical discrimination and adulteration analysis for edible oils using two-dimensional correlation spectroscopy and convolutional neural networks (CNNs). Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy, 246, Article 118973. https://doi.org/10.1016/j.saa.2020.118973

  • Lopetcharat, K., Kulapichitr, F., Suppavorasatit, I., Chodjarusawad, T., Phatthara-aneksin, A., Pratontep, S., & Borompichaichartkul, C. (2016). Relationship between overall difference decision and electronic tongue: Discrimination of civet coffee. Journal of Food Engineering, 180, 60-68. https://doi.org/10.1016/j.jfoodeng.2016.02.011

  • Lopez, S. P., Calabuig, A. M. P., Cancilla, J. C., Lozano, M. A., Rodrigo, C., Mena, M. L., & Torrecilla, J. S. (2021). Deep transfer learning to verify quality and safety of ground coffee. Food Control, 122, Article 107801. https://doi.org/10.1016/j.foodcont.2020.107801

  • Manninen, H., Ramlal, C. J., Singh, A., Rocke, S., Kilter, J., & Landsberg, M. (2021). Toward automatic condition assessment of high-voltage transmission infrastructure using deep learning techniques. International Journal of Electrical Power & Energy Systems, 128, Article 106726. https://doi.org/10.1016/j.ijepes.2020.106726

  • Marcone, M. F. (2004). Composition and properties of Indonesian palm civet coffee (Kopi Luwak) and Ethiopian civet coffee. Food Research International, 37(9), 901-912. https://doi.org/10.1016/j.foodres.2004.05.008

  • Medus, L. D., Saban, M., Villora, J. V. F., mompean, M. B., & Munoz, A. R. (2021). Hyperspectral image classification using CNN: Application to industrial food packaging. Food Control, 125, Article 107962. https://doi.org/10.1016/j.foodcont.2021.107962

  • Mkonyi, L., Rubanga, D., Richard, M., Zekeya, N., Sawahiko, S., Maiseli, B., & Machuve, D. (2020). Early identification of Tuta absoluta in tomato plants using deep learning. Scientific African, 10, Article e00590. https://doi.org/10.1016/j.sciaf.2020.e00590

  • Muzaifa, M., Hasni, D., & Syarifudin. (2019). What is Kopi Luwak? A literature review on production, quality and problems. IOP Conf. Series: Earth and Environmental Science, 365, Article 012041. doi:10.1088/1755-1315/365/1/012041

  • Nayak, S. R., Nayak, D. R., Sinha, U., Arora, V., & Pachori, R. B. (2021). Application of deep learning techniques for detection of COVID-19 cases using chest X-ray images: A comprehensive study. Biomedical Signal Processing and Control, 64, Article 102365. https://doi.org/10.1016/j.bspc.2020.102365

  • Nunez, N., Saurina, J., & Nunez, O. (2021). Non-targeted HPLC-FLD fingerprinting for the detection and quantitation of adulterated coffee samples by chemometrics. Food Control, 124, Article 107912. https://doi.org/10.1016/j.foodcont.2021.107912

  • Ongo, E., Falasconi, M., Sberveglieri, G., Antonelli, A., Montevecchi, G., Scerveglieri, V., Concina, I., & Sevilla, F. (2012). Chemometric discrimination of Philippine civet coffee using electronic nose and gas chromatography mass spectrometry. Procedia Engineering, 47, 977-980. https://doi.org/10.1016/j.proeng.2012.09.310

  • Pauli, E. D., Barbieri, F., Garcia, P. S., Madeira, T. B., Junior, V. R. A., Scarminio, I. S., Camara, C. A. P., & Nixdorf, S. L. (2014). Detection of ground roasted coffee adulteration with roasted soybean and wheat. Food Research International. 61, 112-119. https://doi.org/10.1016/j.foodres.2014.02.032

  • Raikar, M. M., Meena, S. M., Kuchanur, C., Girraddi, S., & Benagi, P. (2020). Classification and grading of okra-ladies finger using deep learning. Procedia Computer Science, 171, 2380-2389. https://doi.org/10.1016/j.procs.2020.04.258

  • Reile, C. G., Rodriguez, M. S., Fernandes, D. D. S., Gomes, A. A., Diniz, P. H. G. D., & Anibal, C. V. D. (2020). Qualitative and quantitative analysis based on digital images to determine the adulteration of ketchup samples with Sudan I dye. Food Chemistry, 328, Article 127101. https://doi.org/10.1016/j.foodchem.2020.127101

  • Ruuska, S., Hamalainen, W., Kajava, S., Mughal, M., Matilainen, P., & Mononen, J. (2018). Evaluation of the confusion matrix method in the validation of an automated system for measuring feeding behaviour of cattle. Behavioral Processes, 148, 56-62. https://doi.org/10.1016/j.beproc.2018.01.004

  • Sezer, B., Apaydin, H., Bilge, G., & Boyaci, I. H. (2018). Coffee arabica adulteration: Detection of wheat, corn and chickpea. Food Chemistry, 264, 142-148. https://doi.org/10.1016/j.foodchem.2018.05.037

  • Silva, A. F. S., & Rocha, F. R. P. (2020). A novel approach to detect milk adulteration based on the determination of protein content by smartphone-based digital image colorimetry. Food Control, 115, Article 107299. https://doi.org/10.1016/j.foodcont.2020.107299

  • Simon, P., & Uma, V. (2020). Deep learning based feature extraction for texture classification. Procedia Computer Science, 171, 1680-1687. https://doi.org/10.1016/j.procs.2020.04.180

  • Skowron, M. J., Franskowski, R., & Grzeskowiak, A.Z. (2020). Comparison of methylxantines, trigonelline, nicotinic acid and nicotinamide contents in brews of green and processed Arabica and Robusta coffee beans - Influence of steaming, decaffeination and roasting processes on coffee beans. LWT, 125, Article 109344. https://doi.org/10.1016/j.lwt.2020.109344

  • Song, W., Yun, Y. H., Wang, H., Hou, Z., & Wang, Z. (2021). Smartphone detection of minced beef adulteration. Microchemical Journal, 164, Article 106088. https://doi.org/10.1016/j.microc.2021.106088

  • Suhandy, D., & Yulia, M. (2017). The use of partial least square regression and spectral data in UV-visible region for quantification of adulteration in Indonesian palm civet coffee. International Journal of Food Science, 2017, Article 6274178. https://doi.org/10.1155/2017/6274178

  • Takase, T. (2021). Dynamic batch size tuning based on stopping criterion for neural network training. Neurocomputing, 429, 1-11. https://doi.org/10.1016/j.neucom.2020.11.054

  • Thenmozhi, K., & Redy, U. S. (2019). Crop pest classification based on deep convolutional neural network and transfer learning. Computers and Electronics in Agriculture, 164, Article 104906. https://doi.org/10.1016/j.compag.2019.104906

  • Tian, C., Xu, Y., & Zuo, W. (2020). Image denoising using deep CNN with batch renormalization. Neural Networks, 121, 461-473. https://doi.org/10.1016/j.neunet.2019.08.022

  • Ucar, F., & Korkmaz, D. (2020). COVIDiagnosis-Net: Deep Bayes-SqueezeNet based diagnosis of the coronavirus disease 2019 (COVID-19) from X-ray images. Medical Hypotheses, 140, Article 109761. https://doi.org/10.1016/j.mehy.2020.109761

  • Wojcik, S., & Jakubowska, M. (2021). Deep neural networks in profiling of apple juice adulteration based on voltammetric signal of the iridium quadruple-disk electrode. Chemometrics and Intelligent Laboratory Systems, 209, Article 104246. https://doi.org/10.1016/j.chemolab.2021.104246

  • Yu, H., Yang, L. T., Zhang, Q., Armstrong, D., & Deen, M. J. (2021). Convolutional neural networks for medical image analysis: State-of-the-art, comparisons, improvement and perspectives. Neurocomputing, 444, 92-110. https://doi.org/10.1016/j.neucom.2020.04.157

  • Yulia, M., & Suhandy, D. (2017). Indonesian palm civet coffee discrimination using UV-visible spectroscopy and several chemometrics methods. Journal of Physics: Conference Series, 835, Article 012010. https://doi.org/10.1088/1742-6596/835/1/012010

ISSN 0128-7702

e-ISSN 2231-8534

Article ID


Download Full Article PDF

Share this article

Recent Articles