Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Convolutional neural networks for the Hass

avocado classification using LabVIEW in an agro-


industrial plant
Jose Emmanuel Cruz de la Cruz Oscar Jhon Vera Ramirez
Electronic Engineering Electronic Engineering
Universidad Nacional del Altiplano Universidad Nacional de Moquegua
Puno, Perú M oquegua, Perú
josecruz@unap.edu.pe overar@unam.edu.pe

Abstract— Peru is currently the world's third-largest exporter of industrial products such as: Date fruits using SVM [2],
Hass avocados according to the latest statistics from FAOSTAT. To Strawberry Ripeness classification using multi-class SVM [3];
classify avocados efficiently in size and maturity, a robust artificial pomegranates using neural networks [4], maturity classification
intelligence plant was implemented to classify avocados into 5
of passion fruit using K-means and neural networks [5].
categories. This grading technique differs from traditional grading in
that it is non-invasive, reducing avocado damage by manually Implementations are also performed using National Instrument
inspecting and grading. The plant comprises the step of hardware, LabView software such as: tomato maturity classification [6],
consisting of Aca2500 Basler camera, lens HR 2mm / F1, illuminated, small food container classification [7], or object classification
and the conveyor belt 1200. The step s7 PLC software: TIA PORTAL with low-resolution cameras [8].
(OPC), a sequential algorithm, and convolutional neural network This work is a real implementation of artificial vision using
decision in which the selection parameters size and color of avocado NI Labview image acquisition, using the IMAQ Clamp
include. The classification process fulfills three main stages: image Horizontal Max VI and IMAQ Clamp VerticalMax VI tool and
acquisition, processing, and recognition. Convolutional neural integration of hardware systems with the purpose of classifying
networks were used for image treatment, obtaining an average
avocados by size and color. The convolutional neural networks
classification precision of 60% in real-time. From the results obtained,
were used.
we see that the classification can be improved.

Keywords: Classification, convolutional networks, avocados, II. SYSTEM DESCRIPTION


LabVIEW. Figure 1 shows the plant implemented at the National
University of Moquegua
I. INT RODUCT ION
Currently, there are around 500 varieties of avocado in the
world, of which the most cultivated are Hass, Fuerte, Bacon,
Reed, Pikerton, Gween avocado. Globally, almost 80% of the
world avocado trade is of the Hass variety. In Peru, the avocado
agribusiness is growing, being our country the third world
exporter of HASS variety avocados [1].
Today the medium and small scale agro-industrial industry
has limitations of qualified personnel, processing times, which
translates into inefficient production. One of the most critical
processes is the classification of products. This process is
Figure 1: Avocado sorting plant
usually done manually with the vision of human beings. In this
type of process, there are drawbacks such as long working
hours for the sorters, loss of sorting quality due to fatigue. If we There is the hardware stage, made up of the Basler Aca2500
start to automate this process we will have advantages such as camera with resolution of 2592px X 1944 px, HR 2mm / F1
optimal quality levels, savings in classification time, improved lens, the Core I7 data processor (PC) with 16G RAM, the
quality levels, flexible production, and improved data flow. The classification plant which has the conveyor belt with 1HP and
classification technology can be divided into wired -physical 1/2 marks. HP and the s7 1200 6-cylinder pneumatic selection
technologies and programmable technologies. In the latter, mechanism and PLC. The software stage: TIA PORTA L
PLCs (programmable logic controllers) and software are used (OPC), a sequential algorithm and the convolutional neural
to adapt the devices to the needs of industrial processes. network of the decision in which the size and color selection
Together with this type of classification, we will use the parameters of the avocado
conveyor belt, which is generally used in the large-scale
industry. There are studies on the classification of various agro -

978-1-7281-9377-9/20/$31.00 ©2020 IEEE

Authorized licensed use limited to: Middlesex University. Downloaded on November 03,2020 at 13:12:22 UTC from IEEE Xplore. Restrictions apply.
The conveyor belt conveyor is powered by a 1 Hp three- vertical Max VI. Two main variables were taken in imag e
phase motor, at a constant speed, it is put into operation by a s7 processing, which is size and color. (Figure 4)
1200 PLC, which consists of a frequency inverter.
The avocados are deposited on the conveyor belt, go
through the Basler Aca2500 chamber and the constant lighting
system. The camera detects the size and color of the avocados
and sends the information to Labview, who will classify it into
the following categories: Ripe / Large, Unripe / Large, Ripe /
Medium, Unripe / Medium, Malograde, and others. Utilizin g
pistons activated by pneumatic actuators, the silver will be
deposited in the containers of the respective categories. The
presence of avocados is detected by infrared sens ors (06) who
send information to Labview to count the number of avocados
classified. The length of the conveyer belt is 5 m. The infrared
sensor is placed at a distance of 5 cm next to the laminated
conveyor belt, the distance between the camera and the Figure 4. Routines to matrix the image and start the network análisis
conveyor belt is 40 cm, the distance between sensors is 25 cm. convolutional.
For the classification in software there are three stages:
Acquisition stage: In the image acquisition stage, two In the next part of the graphic coding, a timer was chosen,
factors were taken into account: the device that captures the which restarts the image capture and processing process after a
image and the type of lighting. Implemented a routine (IMA certain time. Great care should be taken in calibrating based on
Qdx configure grabVI, IMA Qdx configure open camera VI, machine response time and camera response interface to
IMA Qdx configure grab2 VI and display image display) determine optimal processing speed. Although the time given
starting in NI LabVIEW (Figure 2). in figure 5 gives us the optimal response for the current system,
we must take it into account and modify it according to the
artificial intelligence algorithm used.

Figure 2: NI LABVIEW startup routine

As you can see in figure 3, the red box is the code section
that allows us to modify or manage the area of interest (ROI)
according to the working conditions, and the green box is an
additional segment that allows us to mark the contour and be
able to visualize the area of interest (ROI) as we modify it.

Figure 5. Restart timer routine.

Figure 3. Routine to define the size of the ROI, and routine to mark the Image recognition stage: In the recognition stage,
outline of the ROI. (in the learning stage).
responsible for identifying the decision-making for each
avocado and describing its characteristics, taking the structural
Processing stage: For image processing, once the imag e
decision method as a reference. Which takes as reference the
has been acquired in RGB format, the analysis is carried out
data acquired in the learning stage.
utilizing the acquisition of images from NI LabVIEW, using the
The learning must indicate the size of the avocado, as well
tools IMAQ horizontal clamp Max VI and IMAQ clamp
as whether it is ripe or immature, all these data are saved in an

Authorized licensed use limited to: Middlesex University. Downloaded on November 03,2020 at 13:12:22 UTC from IEEE Xplore. Restrictions apply.
Excel table and will provide us with our base sampling for the Like all machine learning algorithms, there are two stages:
selection in the image, the interface of the learning stage. Two Training stage and test stage. For the training stage we will use
convolutional neural networks were used, one in charge of the following interface:
green, the second in charge of greenish-brown, and greenish-
black tones. In figure 6 we can see one of the convolutional
neural networks as well as its layers

Figure 6.- Convolutional neural network routine

III. RESULTS AND DISCUSSION


The flow chart for the classification is as follows

Figure 8.- Interface of the selection stage

By having the result of the camera, the classification process


is carried out.
The image that will be analyzed to obtain the avocado data
both in size and maturity, will only be made when the camera
detects a color variation concerning the background, that will
be the signal to take the image and analyze it. Then the plc uses
that data and orders based on the presence sensors and the
pistons to move the avocado to the indicated classification .

The tools were generated to be able to process the dynamic


signals, this means that each value of percentage of maturity or
immaturity can be labeled in the database format, for more
effective control or monitoring. In figure 9 we show how the
data is saved in Excel and its respective labels for each signal.

Figure 9. File saved in Excel obtained by the learning stage, you can see
the labels of the signals in each column, that helps us to monitor the data.

The results of the tests carried out are shown in the


following table:
T ABLE1: RESULT S

Figure 7.- Flow chart of the sorting plant

Authorized licensed use limited to: Middlesex University. Downloaded on November 03,2020 at 13:12:22 UTC from IEEE Xplore. Restrictions apply.
In this step, the system test was performed. For this, the on Computing for Sustainable Global Development
avocados to be classified were divided into 4 blocks with a (INDIACom), New Delhi, India, 2020, pp. 235-239, doi:
number of different avocados. In each block, the three phases 10.23919/INDIACo m49435.2020.9083706.
of this system are tested: acquisition, processing, recognition, [3] I. Indrabayu, N. Arifin and I. S. Areni, "Strawberry
to then activate the hardware classification part. In the first, a Ripeness Classification System Based On Skin Tone Colo r
correct classification percentage of 62.50% was obtained, and using Multi-Class Support Vector Machine," 2019
in the following 70%, 44% and 60% respectively, so on average International Conference on Information and Communication s
we have a classification accuracy of 60%. We will mention Technology (ICOIACT), Yogyakarta, Indonesia, 2019, pp.
some of the factors that have a greater incidence on the system: 191-195, doi: 10.1109/ICOIACT46704.2019.8938457.
lighting, recognition and classification algorithm. [4] R. A. Kumar, V. S. Rajpurohit and V. B. Nargund, "A neural
network assisted machine vision system for sorting
pomegranate fruits," 2017 Second International Conference on
IV. CONCLUSIONS Electrical, Computer and Communication Technologies
A robust plant with artificial intelligence was implement ed (ICECCT), Coimbatore, 2017, pp. 1-9, doi:
to classify avocados into 5 categories. This sorting technique 10.1109/ICECCT.2017.8118046.
differs from the traditional one in that it is non-invasive, which [5] S. W. Sidehabi, A. Suyuti, I. S. Areni and I. Nurtanio,
reduces avocado damage by manually inspecting and sorting. "Classification on passion fruit's ripeness using K-means
The convolutional neural networks were used for imag e clustering and artificial neural network," 2018 International
processing. The first two to determine size and the third to Conference on Information and Communications Technology
determine maturity. 39 layers were used, obtaining an average (ICOIACT), Yogyakarta, 2018, pp. 304-309, doi:
classification precision of 60% in real time. From the results 10.1109/ICOIA CT.2018.8350728.
obtained, we can see that the classification can be improved , [6] M. J. A. Aviso, A. M. S. Cabao-an, N. A. P. Niverba and R.
implementing improvements in the lighting stage, training the M. Anacan, "Age Factor Identification of Tomato Using
neural network with the greatest number of tests. Also for future Labview via Image Processing," TENCON 2018 - 2018 IEEE
work, a detection stage of avocado diseases can be Region 10 Conference, Jeju, Korea (South), 2018, pp. 0066-
implemented, since they can be detected through color and 0071, doi: 10.1109/TENCON.2018.8650189.
texture [7] Y. Gangrekar and P. Chaudhari, "Automated Assembly
Line Sorting Using LabVIEW as SCADA," 2019 Glob al
A CKNOWLEDGMENT Conference for Advancement in Technology (GCA T),
We would like to thank all friends that actively collaborated BANGALURU, India, 2019, pp. 1-5, doi:
with this research. 10.1109/ GCAT47503.2019.8978382.
[8] R. Sahu, M. K. Swain, K. B. Swain and R. K. Patnaik,
REFERENCES "Productive and economical sorting of objects by low
resolution camera," 2017 IEEE International Conference on
[1] Romero, C. 2019 “La Situación del Mercado Internacional
Smart Technologies and Management for Computing ,
de la Palta”, Lima Perú, Minagri
Communication, Controls, Energy and Materials (ICSTM ),
[2] A. A. Abi Sen, N. M. Bahbouh, A. B. Alkhodre, A. M.
Chennai, 2017, pp. 290-294, doi:
Aldhawi, F. A. Aldham and M. I. Aljabri, "A Classificatio n
10.1109/ICSTM.2017.8089171
Algorithm for Date Fruits," 2020 7th International Conference

Authorized licensed use limited to: Middlesex University. Downloaded on November 03,2020 at 13:12:22 UTC from IEEE Xplore. Restrictions apply.

You might also like