Chilli Quality Classification Using Deep Learning
Chilli Quality Classification Using Deep Learning
Abstract—Chilli peppers (Capsicum annuum) are potential to 316.75 thousand hectares in 2019. The projection for the
commodities in Indonesia that have relatively high economic harvested area until 2023 is expected to continue to increase
value. Sorting and grading of chilli peppers after harvesting is at an average rate of 2.66% per year [2]. This gives the chilli
very important for separating the post-harvest results to commodity in Indonesia a tremendous economic potential.
determine whether the chillies are in good or bad conditions.
Currently, these activities are still done manually using visual Maximize the existing potential, chilli production and
observation. The problem of using this manual method is that marketing must go hand in hand, especially after harvest.
the process often becomes time-consuming. Another drawback Curly red chilli is a perishable commodity, in this case post-
of utilizing manual methods is that it has often inconsistent harvest handling cannot be separated from production
results. This study aims to develop a decision support system for activities. Several factors to consider in post-harvest
classifying the quality of chillies using deep learning. The processing is the sorting of chilli. Sorting is done to separate
development of the science and technology of digital image healthy red chilli that is identified using attributes related to
processing makes it possible to sort agricultural and plantation shape, health and freshness. Delays in the sorting process
products automatically. In this research, we employ “You Only increases the opportunity for rot.
Look Once” (YOLO) method which is one technique of the deep
learning methods that is widely used for image recognition in The conditions in the field regarding the process of sorting
real-time. Simulation results from the custom model show that chilli are generally done manually and involve humans as
the classification accuracy obtained from the simple test is decision-makers. This standard process is used by various
99.4% and the challenging test is 75.6%. processing industry companies such as exporters and chilli
farmers who plant curly red chillies. The manual identification
Keywords—chilli pepper, classification, deep learning, image process has many weaknesses: including a relatively long time
processing, yolo taken; humans tend to tire and become bored when doing
monotonous activities; differences in perceptions of quality;
I. INTRODUCTION
variations in product are also obtained due to limitations with
Horticulture is a potential commodity in Indonesia that has human visual capacity; and sorting decisions are influenced
high economic value. One type of horticultural commodity by the observer's psychological condition. This can also result
that has potential and is already established is the red chilli in inconsistencies in the selection process. The manual
pepper; especially curly red chilli because it is needed by method is too time-consuming, so if applied on a large
households [1]. The chilli family of plants (Capsicum industrial scale, machine assistance is needed during the
annuum) in Indonesia consists of various types including: two process.
large chilli varieties - one with large red chillies (cabai besar),
and another with curly red chilli (cabai keriting). As well, Various technologies have contributed to the sorting
there is a cayenne variety consisting of green cayenne and red process as a decision-making about chilli quality. Among
cayenne. Of the various types, curly red chilli is the most those technologies based on image processing are detecting
commonly consumed chilli in Indonesia [1]. the quality of chillies with maturity levels using YCbCr Color
Transformation [3]; classification of chilli pepper maturity
National chilli consumption per annum for all major cities based on image HSV features with Fuzzy K-Nearest Neighbor
with a population of 1 million or more is around 800,000 tons [4]; classification chilli quality with Convolutional Neural
per year; or 66,000 tons per month. The need for chilli on Networks (CNN) [5]; bell pepper quality based on NIR-HSI
religious holidays and the festive season has increases demand [6]; and sorting on red chilli based on color and texture with
by approximately 10-20% from normal needs. The projected Artificial Neural Network (ANN) [7]. Importantly, from the
demand for chilli commodity is expected to rise until 2023 research that has been conducted, detecting the quality of
with an average annual growth of around 3.36%. While the chilli is not yet real-time because there is a delay when
chilli consumption growth is projected to increase from 1.52 processing information sourced from sensors or cameras.
thousand tons in 2018 to 1.67 thousand tons in 2023 with the
average growth per year is calculated at 2.16%. It is predicted In this study, the solution offered applies the YOLO (You
that production will begreater than consumption, thus creating Only Look Once) method, because YOLO is an object
a surplus of chilli until 2023. The surplus will increase from detection method that has better speed and accuracy than other
571.95 thousand tons in 2018 to 786.96 thousand tons in 2023 methods such as R-FCN, SSD321 [10]. Moreover, you can
[2]. On the other hand, the chilli harvest area in 2019 is easily tradeoff between speed and accuracy simply by
estimated to increase by 2.66% or 8,203 hectares. This is changing the size of the model, no retraining required. YOLO
compared to the change in 2018 of 308.56 thousand hectares is a deep learning algorithm that utilizes convolutional neural
978-1-7281-6907-1/20/$31.00
Authorized ©2020
licensed use limited to: Auckland University IEEE
of Technology. Downloaded on December 23,2020 at 16:54:42 UTC from IEEE Xplore. Restrictions apply.
2020 International Conference on Computer Science and Its Application in Agriculture (ICOSICA)
Truth
networks (CNN) for detecting objects. YOLO’s algorithm will Conf(class) = Pr(class) × IOU Pred (1)
divide the image according to an s × s grid, then each grid
square will predict bounding boxes and class maps. If a grid is
predicted by an object, then the bounding box will surround Where ( ) is the probability of an object
Truth
the object. The confidence value will be calculated on each appearing in a region and IOU is the Intersection Over
Pred
bounding box which will then be selected based on the values Union ratio between the prediction box and the ground
obtained [8]-[10]. truth box. Pred is the area in the prediction box, Truth is
the area in the ground truth. The greater the IOU value,
Therefore, the purpose of this study is to create a decision the higher the detection accuracy level [11].
support system for classifying the quality of chillies in real-
time based on the sensing. The chillies that are detected will • Each bounding box has five information values namely
then be classified based on information from expert data in x, y, w, h, and c. The values of x and y are the coordinates
order to determine the quality of chilli classified into proper of the predicted midpoint of the bounding box, the values
and improper categories. Subsequently, from this research, it of w and h are the ratio of the width and height relative
is expected to provide a solution for chilli farmers or traders to the grid, and c is the value of the confidence bounding
who need to determine the quality of chilli before being box.
distributed to the market or buyer. • In the YOLO algorithm, each grid will predict the
This paper is described in the following order: the material probability class value for the object selected within
section and the method that explains the steps of the YOLO equation 2. During testing, YOLO will multiply the class
method; information about experts; dataset type and pre- probability value with the confidence value of the
training configuration; the results section that reviews the bounding box [8].
performance and evaluation of the system that we are At test time, the model designates each box with its
proposing; simple testing and challenging testing; the class-specific confidence score by multiplying the
conclusions and recommendations section reports the findings confidence score of each box with its respective class-
for future research.
conditional probabilities, these scores evaluate the
II. MATERIAL AND METHOD probability of the class appearing in the box, and how
precise the box coordinates are.
The material used in this study comprises chilli image data
that is adjusted with information from experts.
Pr (Classi )|Object) × Pr(Object) × IOU = Pr(Classi) × IOU (2)
Truth Truth
Pred Pred
Trained Model Central Base Line cm 1.5 - 1.7 1.3 - 1.5 < 1.3
User
Authorized licensed use limited to: Auckland University of Technology. Downloaded on December 23,2020 at 16:54:42 UTC from IEEE Xplore. Restrictions apply.
2020 International Conference on Computer Science and Its Application in Agriculture (ICOSICA)
Fig 3. Results in the average loss in 10,000 iterations of the model created
Authorized licensed use limited to: Auckland University of Technology. Downloaded on December 23,2020 at 16:54:42 UTC from IEEE Xplore. Restrictions apply.
2020 International Conference on Computer Science and Its Application in Agriculture (ICOSICA)
1 2 3 5
4
80
value
60
40 25.2
20
0
0 2000 4000 6000 8000 10000 12000
Iteration
1
2 4
5
TABLE V
VALUE ACCURACY CONDITIONS WITH CHILLI OVERLAPPING
Of the 10 iterations described in Table IV, the trained The actual conditions curly red chilli has clustered and
models tested at steps 9000 to 10,000 produce the greatest overlapping characteristics, this is a very possible outcome in
accuracy value. The iteration steps both have an average the processing environment. Therefore, we tested the results
accuracy value of 99.4%. Steps 9000 and 10,000 are the most of the model against the overlapping chilli conditions as
stable trained models for classifying the quality of chilli shown in Fig. 6. We use the best iteration results in previous
precisely. tests, namely iteration 9000 and 10,000. From the tests we
Authorized licensed use limited to: Auckland University of Technology. Downloaded on December 23,2020 at 16:54:42 UTC from IEEE Xplore. Restrictions apply.
2020 International Conference on Computer Science and Its Application in Agriculture (ICOSICA)
have conducted, the model with iteration 9000 has better [3] Ananto, I.D, Murinto. 2015. Aplikasi Pengolahan Citra Mendeteksi
accuracy than the model with iteration 10,000. Because in the Kualitas Cabai Berdasarkan Tingkat Kematangan Menggunakan
Transformasi Warna YCBCr. Jurnal Informartika UAD, 9(2).
9000 iterations, the model can be accessed and object
[4] Liantoni, F. and Annisa, F.N., 2018. Fuzzy K-Nearest Neighbor Pada
classification precisely. The accuracy obtained at iteration Klasifikasi Kematangan Cabai Berdasarkan Fitur HSV Citra. JIPI
step 9000 has an average accuracy of 75.6% (Table V). (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika), 3(2).
[5] Purwaningsih, T., Anjani, I.A. and Utami, P.B., 2018, August.
IV. CONCLUSION Convolutional Neural Networks Implementation for Chilli
In this research, we have developed a decision-making Classification. In International Symposium on Advanced Intelligent
Informatics (SAIN) (pp. 190-194). IEEE.
system with deep learning. The method we use is YOLO. We
make models for chilli quality classification. Simulation [6] Rahman, A., Faqeerzada, M.A., Joshi, R., Lohumi, S., Kandpal, L.M.,
Lee, H., Mo, C., Kim, M.S. and Cho, B.K., 2018. Quality Analysis of
results show that the number of iterations influences the level Stored Bell Peppers Using Near-Infrared Hyperspectral Imaging.
of accuracy of detection and the success of chilli Transactions of the ASABE, 61(4), pp.1199-1207.
classification. The iteration value of 9000 is the most perfect [7] Khuriyati, N., Nugroho, D.A. and Wicaksono, N.A., 2020, January.
trained models to detect and classify chilli according to the Quality assessment of chillies (Capsicum annuum L.) by using a
best detection accuracy values of 99.4%. However, for smartphone camera. In IOP Conference Series: Earth and
Environmental Science (Vol. 425, No. 1, p. 012040). IOP Publishing.
classification with overlapping curly red chilli conditions, the
accuracy value obtained from iterative step 9000 is the most [8] Redmon, J., Divvala, S., Girshick, R. and Farhadi, A., 2016. You only
look once: Unified, real-time object detection. In Proceedings of the
accurate at 75.6%. IEEE conference on computer vision and pattern recognition (pp. 779-
788).
Suggestions for the next study, the model can do a
comprehensive sorting of chilli quality (all regions of chilli). [9] Redmon, J. and Farhadi, A., 2017. YOLO9000: better, faster, stronger.
In Proceedings of the IEEE conference on computer vision and pattern
recognition (pp. 7263-7271).
ACKNOWLEDGMENT
[10] Redmon, J. and Farhadi, A., 2018. Yolov3: An incremental
We would like to thank the Department of Computer improvement. arXiv preprint arXiv:1804.02767.
Science, IPB University and PasTi Scholarship for supporting [11] Lan, W., Dang, J., Wang, Y., & Wang, S. 2018. Pedestrian Detection
this research financially. Based on YOLO Network Model. Proceedings of 2018 IEEE
International Conference on Mechatronics and Automation, 1547-
REFERENCES 1551.
[12] BSN. 1998. Standar Nasional Cabai Merah Segar: SNI 01-4480-1998.
[1] Yanuarti, AR. and Asfari, MD. 2016. Profil Komoditas Barang
Jakarta.
Kebutuhan Pokok dan Barang Penting Komoditas Cabai.
https://ews.kemendag.go.id/download.aspx?file=BK_CABAI_16-03- [13] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and Y.
2018-SP2KP.pdf&type=publication. Accessed june 18, 2020. LeCun. Overfeat: Integrated recognition, localization and detection
using convolutional networks. CoRR, abs/1312.6229, 2013.
[2] [PDSIP] Pusat Data dan Sistem Informasi Pertanian. 2019. Outlook
Cabai – Komoditas Pertanian Subsektor Hortikultura. Jakarta [ID].
Kementerian Pertanian. http://epublikasi.setjen.pertanian.go.id/arsip-
outlook/76-outlook-hortikultura/694-outlook-cabai-2027. Accessed
june 13, 2020.
Authorized licensed use limited to: Auckland University of Technology. Downloaded on December 23,2020 at 16:54:42 UTC from IEEE Xplore. Restrictions apply.