roast level coffee
roast level coffee
924-932
1. INTRODUCTION
Coffee is a plantation commodity that has a large share in the Indonesian economy, in addition to oil and gas
(Marhaenanto et al., 2015). Indonesia occupies the fourth position as the largest coffee producer in the world, after
Brazil, Vietnam, and Colombia. About 67% of the total domestic coffee production is exported, while the remaining
33% is used to meet domestic needs. Indonesian coffee exports cover five continents with the main share in the
European market. In 2021, the total volume of exported coffee reached 387 thousand tons. Apart from the product
market opportunities that are increasingly open, the local coffee market is also very large (BPS, 2022).
One of the important stages in coffee processing is the roasting process. The taste of coffee can be changed
accordingly, depending on how the roasting process is done (Batubara et al.,, 2019). Roasting is one of the stages of
processing food or agricultural products through heat treatment without oil applied to the material for a certain period
of time (Radi et al., 2020). Coffee is an agricultural product, which is usually served as an aromatic beverage (Rivai et
al., 2020). Roasting is the process of forming the taste and aroma of coffee beans. The maturity level in the roasting
924
Pakaya et al.: Classification of Roasting Level of Coffee Beans…..
process is generally divided into three parts: light, medium, and dark (Tyas, 2022). A controlled roasting process is one
way to maintain the taste and aroma properties of coffee drinks. Some parameters that can be set in the roasting
process include time, temperature, and the color level of the coffee beans when they are roasted (Hernández et al.,
2008).
Currently, coffee bean classification is still deemed mostly done visually and depends on human subjective
judgment. However, this method has a subjective nature, so it has the potential to cause human error due to fatigue or
negligence (Radi et al., 2016). Finally, the classification of coffee roasting levels cannot work properly without the
help of modern technological innovations. An alternative approach using technology is expected to increase the
effectiveness of the classification of roasted coffee beans to be much better and more efficient (Winjaya, 2017). One of
the technologies developed to determine the roasting level of coffee is computer vision (Radi et al., 2016).
Computer vision is a technology that enables machines to have the ability to see, identify, and extract information
from an object to complete certain tasks (Hendriyana & Maulana, 2021). Computer vision software includes
algorithms of image processing and machine learning for identification or interpretation (Radi et al., 2020). The work
function of computer vision is similar to that of the human eye, where images or pictures of objects are introduced into
the system to extract information and classify them based on their type. In the field of computer vision technology,
there are various approaches that can be used, one of which is a methodology that utilizes Artificial Neural Networks,
which are inspired by the workings of the human brain and then develop further in the Deep Learning method (Lecun
et al., 2015). The Deep Learning method that has achieved significant results so far is the Convolutional Neural
Network (CNN) (Azizah et al., 2018). Research on application of computer vision applied on coffee bean have been
conducted and provided good result (Radi et al., 2015a; 2015b).
Convolutional Neural Network (CNN) is a Deep Learning method that can see and distinguish objects in
computerized images (Muresan & Oltean, 2018). This achievement was largely due to advances in more powerful
computing, the use of large datasets, and strategies to practice deeper networks. CNN is considered one of the best
methods related to object identification and recognition. However, like other Deep Learning methods, CNN also has
drawbacks in the training process which requires quite a long time (Santoso & Ariyanto, 2018). To speed up the
training process, you must use the right architecture, and one of the architectures that has been proven to have optimal
execution is MobileNet (Howard et al., 2019). MobileNet is centered on creating a light and optimal network in terms
of speed (Hendriyana & Maulana, 2021).
There have been many studies on the classification of coffee roasting levels using digital image processing.
Nugraha & Wiguna (2018), for the first time, developed a system for identifying the roasted level of coffee using an
artificial neural network resulting in an accuracy of 76.7%. In addition, Putra et al., (2020) also developed a system
for determining the roasting level of coffee based on roasting results using the RGB detection method and minimum
distance classification, with the resulting accuracy of 89.63%. Then Prastyaningsih & Kusrini's (2021) research about
the identification of coffee bean roasting levels using color feature extraction with an image retrieval system produces
an accuracy of 97.67%. However, the fundamental weakness of these models is that the computation is quite heavy,
and errors in detecting objects (Raysyah et al., 2021).
Michael et al., (2020) succeeded in applying the Convolutional Neural Network (CNN) method with a
combination of architectures between LeNet5, AlexNet, and MiniVGGNet for the classification of coffee roasted
levels based on Android, resulting in an accuracy of 98%. This model has advantages in terms of speed of detection,
relatively easy to modify, and fast computation time. However, the resulting model output is considered large and
quite heavy to use in the applications.
Based on the potential of computer vision technology and the CNN method, this research was conducted to
develop a coffee bean roasting level classification method for Android implementation. The CNN model that will be
developed uses the MobileNet architecture so that the resulting model output is smaller and lighter to use in the
applications. This research was expected to present a new concept in the classification of coffee bean roasting levels,
namely by utilizing an Android-based classification system so that it can be used anytime and anywhere. This
mechanism is expected to simplify and speed up the coffee classification process, thereby increasing its overall
efficiency and accuracy.
925
Jurnal Teknik Pertanian Lampung Vol. 13, No. 3 (2024): 924 – 932
Figure 1. Scheme for the development of a coffee bean roasting level classification system
926
Pakaya et al.: Classification of Roasting Level of Coffee Beans…..
be tested using training data to assess model performance and identify the level of classification accuracy. Further, an
analysis of the results of the CNN model training and application testing was carried out to evaluate the suitability and
efficiency of the developed classification system. After obtaining the model with the best testing accuracy, the model
would be implemented into an Android application to make it easier to assess the roasting level of coffee beans
accurately. Application performance would be tested using a new image that was not used during the training and
testing process. After that, it would be assessed whether the integration of CNN with the MobileNet architecture into
an Android-based application was successful or not. It was expected that the designed system and application would
change the method of classifying coffee bean roasting levels.
927
Jurnal Teknik Pertanian Lampung Vol. 13, No. 3 (2024): 924 – 932
predictions compared to the total amount of data. Recall measures how many actual positives were correctly identified
(Ibrahim et al., 2022). Here is the mathematical equation to calculate accuracy, precision, and recall:
𝑇𝑃
Precision (%) = x 100% (1)
𝑇𝑃 + 𝐹𝑃
𝑇𝑃
Recall (%) = x 100% (2)
𝑇𝑃 + 𝐹𝑁
𝑇𝑃 𝑎𝑙𝑙
Accuracy (%) = x 100% (3)
𝑇𝑃+𝑇𝑁+𝐹𝑃+𝐹𝑁
where TP (true positive) is data that is actually classified by the system as a positive (true) value; TN (true negative) is
true data is classified by the system as a negative (true) value; FP (false positive) is incorrect (negative) data but
classified by the system as true (positive) data; and FN (false negative) is the data is correct (positive) but is classified
by the system as incorrect (negative) data.
Figure 3. The research block diagram on the CNN model uses the MobileNet architecture
928
Pakaya et al.: Classification of Roasting Level of Coffee Beans…..
Based on the test results, it was found that the optimal image input to be used was 70x70, the learning rate value was
0.0001 and the epoch value was 100 for both models, then model prediction test was carried out.
Based on the test results, For model training, CNN Alpha achieved an accuracy of 97% with a training time of 6.41
minutes, while CNN Beta achieved an accuracy of 98% with a training time of 6.40 minutes. For model testing, CNN
Alpha achieved an accuracy of 73% with a training time of 0.0013 minutes, while CNN Beta achieved an accuracy of
88% with a training time of 0.0012 minutes. Based on the training and testing outcomes, the model selected for
implementation into the Android platform is CNN Beta due to its higher accuracy in testing data and faster training
time compared to CNN Alpha.
929
Jurnal Teknik Pertanian Lampung Vol. 13, No. 3 (2024): 924 – 932
The testing process was carried out using a smartphone that had been installed with a coffee bean roast-level
classification application. Figure 5 demonstrates the application interface for the classification of coffee bean roasting
levels.
(a) (b)
Figure 6. a. Open directory, b. The results of the classification and prediction of coffee beans
930
Pakaya et al.: Classification of Roasting Level of Coffee Beans…..
Figure 6 shows the results of the classification process for the roasting level of coffee beans with the output being
the name of the coffee roasted level and the percentage of accuracy. The coffee image data used was limited to 120 test
data images from different datasets, where each roasting level had 30 images. The results of these tests can be seen in
Table 3.
Table 3 is a table of classification results for test data. The system successfully classified all images with dark,
green, and light roasted levels. Meanwhile, for the medium image, 26 images were successfully classified and 4 were
identified incorrectly. There was an incorrect prediction in the medium image because the color at the medium
maturity level was almost similar to light so some were predicted to be light as shown in Table 3. While those in Table
4 are the results of system performance obtained by calculating accuracy, precision, and recall. Based on the testing,
the accuracy value obtained was 93.55% and the precision, and recall values were 97.06% and 96.67% respectively.
4. CONCLUSIONS
The coffee bean roasting level classification system developed using CNN with the MobileNet architecture can be
used to predict the maturity level of coffee. The model training and testing results in the highest accuracy of 98-88% in
6.40-0.0012 minutes. While the application performance test shows the best accuracy of 93.55% and the value of
precision, recall is 97.06% and 96.67% respectively. These results indicate that the coffee bean roasting level
classification system using the Convolutional Neural Network method with the MobileNet architecture can be
considered to work well. For better results, model evaluation and optimization can be done by increasing the number
of iterations and evaluating the amount of training data.
ACKNOWLEDGMENT
The researcher would like to express his gratitude to the Agri-CR Research Group and all parties who have given
valuable assistance in completing this research.
REFERENCES
Azizah, L.M., Umayah, S.F., & Fajar, F. (2018). Deteksi kecacatan permukaan buah manggis menggunakan metode deep learning
dengan konvolusi multilayer. Semesta Teknika, 21(2), 230–36. https://doi.org/10.18196/st.212229.
BPS (Badan Pusat Statistik). (2022). Statistik Kopi Indonesia 2021. Badan Pusat Statistik. Jakarta.
Batubara, A., Yusuf, A., & Widyasanti, A. (2019). Uji kinerja dan analisis ekonomi mesin roasting kopi (Studi kasus di Taman
Teknologi Pertanian Cikajang-Garut). Teknoktan Journal, 13(1), 1–7. https://doi.org/10.24198/jt.vol13n1.1.
931
Jurnal Teknik Pertanian Lampung Vol. 13, No. 3 (2024): 924 – 932
Hendriyana, H. & Maulana, Y.H. (2021). Identifikasi jenis kayu menggunakan convolutional neural network dengan arsitektur
mobilenet. Jurnal Resti, 4(1). https://doi.org/10.29207/resti.v4i1.1445.
Hernández, J.A., Heyd, B., & G. Trystram. (2008). Prediction of brightness and surface area kinetics during coffee roasting.
Journal of Food Engineering, 89(2),156–63. https://doi.org/10.1016/j.jfoodeng.2008.04.026.
Howard, A.G., Wang, W., Sandler, M., Zhu, Y., Chu, G., Chen, L.C., Chen, B., Ruoming, P., Vasudan, V., Le, Q.V., Adam, H., &
Tan, M. (2019). Searching for mobilenetV3. Computer Vision and Pattern Recognition.
Ibrahim, N., Lestary, G.A., Hanafi, F.S., Saleh, K., Pratiwi, N.K.C., Haq, M.S., & Mastur, A.I. (2022). Klasifikasi tingkat
kematangan pucuk daun teh menggunakan metode convolutional neural network. Jurnal Teknik Energi Elektrik, 10(1), 162–
76.
Lecun, Y., Bengio, Y., & Hinton, G. (2015). Deep Learning. Nature, 521, 436–44. https://doi.org/10.1038/nature14539
Marhaenanto, B., Soedibyo, D.W., & Farid, M. (2015). Penentuan lama sangrai kopi terhadap variasi derajat sangrai menggunakan
model warna RGB pada pengolahan citra digital (digital image processing). Jurnal Agroteknologi, 09(02), 102–11.
Michael, E.H., Prilianti, K.R., & Subianto, M. (2020). Rancang bangun aplikasi klasifikasi tingkat kematangan sangrai kopi melalui
citra digital menggunakan CNN (Convolutional Neural Network) berbasis android. Jurnal Ilmiah Sainsbertek, 1(1), 1–11.
Muresan, H., & Oltean, M. (2018). Fruit recognition from images using deep learning. Sapientiae Informatica 10(1), 26–42.
https://doi.org/10.2478/ausi-2018-0002.
Nugraha, D.A., & Wiguna, A.S. (2018). Klasifikasi tingkat roasting biji kopi menggunakan jaringan syaraf tiruan backpropagation
berbasis citra digital. SMARTICS Journal, 4(1), 1–4. https://doi.org/10.21067/smartics.v4i1.2165.
Prastyaningsih, Y., & Kusrini, W. (2021). Sistem temu kembali citra pada level roasting biji kopi menggunakan ekstraksi fitur
warna. Jurnal Inovtek Polbeng, 6(2), 222–33. https://doi.org/10.35314/isi.v6i2.2086.
Putra, A.F.S.J., & Santoni, M.M. (2020). Penentuan level kematangan kopi berdasarkan hasil roasting menggunakan etode Deteksi
RGB dan klasifikasi minimum distance. Seminar Nasional Mahasiswa Ilmu Komputer dan Aplikasinya, 1(2), 481-492.
Radi, R., Rivai, M., & Purnomo, M.H. (2015a). Combination of first and second order statistical features of bulk grain image for
quality grade estimation of green coffee bean. ARPN Journal of Engineering and Applied Sciences, 10(18), 8165-8174.
Radi, R., Rivai, M., & Purnomo, M.H. (2015b). GA-SVC based search applied for optimization of image features subset in quality
estimation system of bulk green coffee bean. ARPN Journal of Engineering and Applied Sciences, 10(22), 17177-17185.
Radi, R., Rivai, M., & Purnomo, M.H. (2016). Study on electronic-nose-based quality monitoring system for coffee under roasting.
Journal of Circuits, Systems and Computers, 25(10), 16501164. https://doi.org/10.1142/S0218126616501164.
Radi, R., Saragih, E.P., Pratama, B., & Fitri, W.K. (2020). Performance analysis of fuzzy logic controller applied on portable
roaster. IOP Conference Series: Earth and Environmental Science, 757. https://doi.org/10.1088/1755-1315/757/1/012022.
Raysyah, S., Arinal, V., & Mulyana, D.I. (2021). Klasifikasi tingkat kematangan buah kopi berdasarkan deteksi warna
menggunakan metode KNN dan PCA. Jurnal Sistem Informasi, 8(2), 88–95. https://doi.org/10.30656/jsii.v8i2.3638.
Rivai, M., Radi, R., Purnomo, M.H., Purwantana, B., Purwanto, D., & Sujiati, L. (2020). Electronic nose method for classification
of coffee, in comparison with laboratory instrument and sensory test. International Agricultural Engineering Journal, 29(2),
363-375.
Santoso, A., & Ariyanto, G. (2018). Implementasi deep learning berbasis keras untuk pengenalan wajah. Jurnal Teknik Elektro
18(01), 15–21. https://doi.org/10.23917/emitor.v18i01.6235.
Tyas, S.A. (2022). Pengaruh Suhu dan Waktu Roasting Terhadap Kualitas Hasil Roasting Kopi Arabika. [Undergraduate Thesis].
Politeknik Enjinering Pertanian Indonesia, Tangerang.
Winjaya, F. (2017). Rancang Bangun Mesin Pemanggang Biji Kopi berbasis Image Processing dan Akustik. [Master Thesis].
Institut Teknologi Sepuluh Nopember, Surabaya.
932