mobile computational vision system in the identification
TRANSCRIPT
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 8, 2021
436 | P a g e
www.ijacsa.thesai.org
Mobile Computational Vision System in the
Identification of White Quinoa Quality
Percimil Lecca-Pino1, Daniel Tafur-Vera2, Michael Cabanillas-Carbonell3
Facultad de Ingeniería, Universidad Privada del Norte
Lima, Perú
José Luis Herrera Salazar4
Facultad de Ingeniería y Negocios
Universidad Norbert Wiener
Lima, Perú
Esteban Medina-Rafaile5
Escuela Profesional de Ingeniería de Sistemas e Informática
Universidad Nacional Santiago Antúnez de Mayolo
Áncash, Perú
Abstract—Quinoa is currently in high commercial demand
due to its large benefits and vitamin components. The process of
selecting this grain is mostly done manually, being prone to
errors, because many times this work is subject to fatigue and to
subjective criteria of those in charge, causing the quality to
decrease due to not making an adequate selection subject to
standards. For this reason, a study focused on determining the
influence of the computer vision system for the identification of
the quality of white quinoa, based on the standards and
techniques for the development of a computer vision system
through the phases of PDI. Managing to determine the influence
of this, concluding that it is possible to ensure the implementation
of robust systems to solve problems by applying computer vision
thanks to technological advances for mobile devices.
Keywords—Computer vision system; quinoa quality; digital
image processing
I. INTRODUCTION
La Quinoa is an Andean grain with great biological diversity. It is a product with a high content of macronutrients, amino acids and minerals, and is the basis of the diet of the inhabitants of the Andean areas [1]. According to WHO and FAO [1][2], quinoa is the ideal food for humans, because its protein contains the best balance of amino acids, including the eight essential amino acids, which cannot be produced by the human body. It is an easily digestible food, recommended for coeliacs, diabetics and those with lactose intolerance; due to its nutritional characteristics it is a substitute for meat or milk.
According to data provided by FAO [2], the main producing countries are Peru and Bolivia. Our country is the first producer of quinoa followed by Bolivia, leading the world production of quinoa with approximately 52% of world production and Bolivia with 45% [3].
Peru has become one of the largest exporters around the world. The global showcase of quinoa and the high pressure of its demand allowed the improvement of its prices and the incentive to plant larger areas of quinoa, especially in certain regions of the coast where it had not been produced before, such as Arequipa (coastal part), Lambayeque, La Libertad, Tacna, Lima and Ica. Production was also expanded and
consolidated in highland regions such as Ayacucho, Junín and Huánuco. [1].
Quinoa for its commercialization and export [3] has to go through different post-harvest processes, the last one being the classification and selection stage, in some places this process has ceased to be manual, giving way to technification, where the grains are passed through a sorting machine with different mesh sizes, thanks to these processes, the product acquires a quality to be sold in markets or supermarkets. This method has very high costs due to the machinery used.
The selection process consists of classifying the grain according to size, weight and color through a manual or mechanized method; the first is appropriate for small quantities and the second for large volumes, in this process air and sieve machines, densimetric or predator table and the optical selector can be used [4][5].
One of the factors that can affect the final quality of the grain is the presence of a certain number of defects that are called "percentage values of its characteristics" such as: broken grains, immature grains, contrast and impurities, as well as the average diameter of the grains. [6]. The identification of quinoa grain quality is one of the most important criteria for commercialization, since the costs of national and international markets vary according to the quality level of the product. For this reason, a mobile computational vision system positively influences the identification of white quinoa quality.
In [7], a research was carried out where a classification of wheat varieties was made using computer vision, the use of image classification using eFV and CNN algorithms was proposed. To compare the different methods proposed, the accuracy of each of them was evaluated in the evaluation set, which was composed of 195 samples. The result was an accuracy of 95% in the classification of a dataset of seeds of 6 varieties of wheat grain.
In another research [8], an image processing system was developed for the classification of green coffee, which has an inaccurate selection by human personnel and high cost due to the use of machinery, for which an evaluation of the total efficiency of the algorithm was carried out, i.e. the amount of
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 8, 2021
437 | P a g e
www.ijacsa.thesai.org
good beans that pass for bad (false rejection), as well as the amount of bad beans that pass for good (false acceptance), obtaining results such as: false rejection 16.7% and false acceptance 7.3%.
The research [9] addressed the problem of rice grains, which present variations in their characteristics in relation to size, cooking consistency, aromatic qualities and grain color, also to identify if the grains have any defects. The OpenUp software methodology was used, making use of MatLab with the Toolbox Image Processing. Reliability results were obtained: 95% for discrimination according to class, 96% for discrimination according to type of defect and 100% for grain count.
The objective of this research is to determine the influence of a mobile computational vision system on the identification of the quality of white quinoa through the evaluation of its level of efficacy, sensitivity and specificity.
II. METHODOLOGY
Computational vision can be defined as the processes of obtaining, characterizing and interpreting information from images taken from a tridimensional world [10].
The purpose of this research is to identify the quality of white quinoa through a mobile computer vision system (hereinafter MCVS), being experimental and pre-experimental.
A. Population
Images of white quinoa portions of 5gr. Peru - La Libertad are based on the antecedent Control of grain quality for mobile devices using image processing.
B. Procedure
Here we describe the phases to develop a mobile computational vision system with the objective of identifying the quality of white quinoa, under the Android platform in Java language, using algorithms and functions from the OpenCV and TensorFlow library. This research project is developed under the cascading life cycle.
1) Analysis: To identify the quality of the processed
quinoa, we base our analysis on its physical characteristics
such as shape, color and size, as indicated in the specifications
of the Peruvian Technical Standard (NTP) [6], specified in
Table I and Table II, as well as the American Society for
Testing and Materials (ASTM).
TABLE I. CRITERIA FOR THE CLASSIFICATION OF QUINOA GRAIN
ACCORDING TO SIZE
Size of grains Average kernel diameter,
expressed in mm Mesh
Extra large Greater than 2.0 85 % retained on mesh ASTM 10
Large greater than 1.70 up to 2,0
85 % retained on mesh ASTM 12
Medium greater than 1.40 up to
1.69
85 % retained on mesh
ASTM 14
Small less than 1.40 85 % passing through mesh
ASTM 14
TABLE II. CRITERIA FOR THE CATEGORIZATION OF QUINOA GRAINS
ACCORDING TO PHYSICAL CHARACTERISTICS - NTP 205.062:2009
Sensory Parameters Unit Category 1 Category 2 Category 3
Whole grains (A) % 96 90 86
Broken grains (B) % 1,5 2,0 3,0
Immature grains (C) % 0,5 0,7 0,9
Contrasting grains (D) % 1,0 2,0 2,5
Total impurities (E) % 0,25 0,30 0,35
Physical characteristics considered for analysis based on the NTP, expressed in Table II. Where graph “A” in Fig. 1 refers to whole kernels, graph “B” to broken kernels, “C” to immature kernels, “D” to contrasting kernels and “E” to impurities.
Fig. 1. Physical Characteristics Considered for the Analysis based on the
NTP.
C. Design
1) Capture: The following characteristics were taken into
account for capture in a controlled environment (Fig. 2):
Size set at 20cm x 20cm on a white background.
Resolution: 3024x3024.
Image color model: RGB.
Fig. 2. Sample Capture in a Controlled Environment.
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 8, 2021
438 | P a g e
www.ijacsa.thesai.org
2) Preprocessing: The most suitable technique to smooth
the image is the Gaussian low pass filter, because it is the
most computationally efficient and smoothes the image better
for segmentation.
a) Feature enhancement techniques: The feature
enhancement technique used is contour detection, which
allows to better highlight the external details of the analyzed
elements, for this purpose the Canny algorithm was applied.
b) Morphological operator techniques: The
morphological operator technique "closure" is used to
eliminate internal noise and the morphological operator
"dilation" is used to highlight details.
Fig. 3. Function for the Application of Image Preprocessing.
In Fig. 3, the Gaussian filter was applied and returns image with the first HSV channel.
Detail interface (image preprocessing):
Fig. 4. Image Processing.
3) Segmentation: The segmentation method that best suits
our project, is “thresholding”. In Fig. 4, the OpenCV method
is applied with the Otsu technique of inverted binarization
which allows to calculate the threshold automatically + the
morphological operator Cierre to eliminate noise.
4) Description:
a) Feature extraction techniques. Region descriptors are
used in this phase, which allow us to extract features such as
the area through its pixels in a binarized image free of noise.
b) Region of interest: It is determined that a quinoa
grain of extra-large class does not exceed 15.36 pixels, and
will always be within the region of interest of 24x24 pixels
(Fig. 5).
Fig. 5. Feature Extraction.
Detailed interfaces (segmentation and description): Shown in Fig. 6.
Fig. 6. Segmentation and Description Interface.
5) Recognition: Based on the contours and the region of
interest found in the previous phase, in this stage the different
types of elements are classified.
a) Classification of elements through convolutional
neural network: Specifically a convolutional neural network
(CNN).
b) Architecture of the proposed convolutional network:
The input is defined with an image of size 224x224 and depth
of 3 RGB (Fig. 7), this is received by the input layer causing
the pixel to be driven with a neuron reaching 150,528 neurons.
In the first hidden layer the regular convolution is specified,
from the second hidden layer a deep convolution and a point
Minimum of contour-based
rectangles
Region of interest 24x24
Contour detection
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 8, 2021
439 | P a g e
www.ijacsa.thesai.org
convolution are rotated, reducing the resolution and increasing
the channels. Then the average Pooling is run to reduce the
image leaving 1x1x1024. Finally, in the output layer, the
Softmax activation function is executed, which returns the
probability of the type of element to which the entered image
belongs.
Fig. 7. Architecture of the MobileNet CNN Network Model for Element
Classification.
Detailed interfaces (recognition): Shown in Fig. 8.
Fig. 8. Recognition Interfaces.
6) Interpretation: With the information obtained in the
recognition phase: quantity of elements identified according to
their type (whole grains, broken grains, immature grains,
impurities and contrasting grains) and the quantity of grains
according to their size (extra-large, large, medium and small)
according to the standards specified in Tables I and II, the
interpretation is performed (Fig. 9).
Fig. 9. Architecture of the SVCM in the Identification of White Cinchona
Quality.
D. Implementation: for the Implementation of the Mobile
Computer Vision System, the following was Considered
1) Technologies used: Android Studio 3.1.3 (IDE),
OpenCV 3.4.0 and TensorFlow 1.11.0 (Library), Phyton 3.7.0.
2) Dataset for training: For the training of the network, a
set of images is prepared with the different classes of elements
to be identified (whole quinoa grains, broken quinoa grains,
contrast quinoa grains, immature grains and impurities
(weeds).
The following were collected 3000 images with 48x48 resolution, of the five types of elements distributed as follows (Fig. 10):
800 whole class images.
700 images of broken class.
600 contrast class images.
500 immature class images.
400 weed class images.
Fig. 10. Images of the Entire Quinoa Class for CNN Network Training.
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 8, 2021
440 | P a g e
www.ijacsa.thesai.org
3) Testing: In this phase, black box testing was
performed, to measure the results of our application. Some
examples of tests are detailed below:
Case 1
Input: 10 grains of extra-large quinoa, 6 grains of
large quinoa, 5 grains of medium quinoa, 4 grains of
small quinoa (Fig. 11).
Output:
Fig. 11. Test Results Obtained by Size.
Case 2:
Input: A complete sample was loaded into the mobile
computer's vision system (Table III) with the
following expected result (Fig. 12).
TABLE III. EXPECTED RESULT OF A SAMPLE BASED ON NTP
Criteria
Analyzed
Manual según NTP
Quantity
Results Total grains
analyzed 1191.00
Small grains 1 0.08%
71.43% Medium grains 36 3.04%
Large grains 301 25.44%
Extra large grains 845 71.43%
Whole grains 1183 99.33% Category 1
Broken grains 2 0.17% Category 1
Contrast grain 2 0.17% Category 1
Immature grains 2 0.17% Category 1
Total, impurities 2 0.17% Category 1
CLASS No class 71.43%
CATEGORY Category 1
Output:
Fig. 12. Results obtained from Testing a Sample based on the NTP.
III. RESULT
For the analysis of the results, 385 samples were used, which were obtained randomly from different types of commercial quinoa, which were evaluated by the manual method based on the Peruvian technical standard using a digital balance and a digital vernier.
For the treatment of the results, a multiclass confusion table analysis was used, for which the following considerations are taken:
True Positive (TP). When the actual class is correctly classified by the MCVS.
False Negative (FN). When a real class is classified by the MCVS as another class.
False Positive (FP). When actual classes are misclassified by MCVS as an evaluated class.
True Negative (TN). When classes other than an evaluated class the MCVS classifies them as classes other than the evaluated class.
A. Efficacy Analysis
Two aspects are evaluated for our research:
From a total of 385 samples evaluated by the MCVS, 370 correct results (TP) in class prediction have been obtained, reaching an efficiency of:
𝑀𝐶𝑉𝑆 𝐸𝑓𝑓𝑒𝑐𝑡𝑖𝑣𝑒𝑛𝑒𝑠𝑠 (𝑐𝑙𝑎𝑠𝑠) =370
385𝑥100 = 96.10%
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 8, 2021
441 | P a g e
www.ijacsa.thesai.org
On the other hand, out of a total of 385 samples when using the S to determine the category, we obtained 373 correct results (TP) in category prediction, reaching an efficiency:
𝑀𝐶𝑉𝑆 𝐸𝑓𝑓𝑒𝑐𝑡𝑖𝑣𝑒𝑛𝑒𝑠𝑠 (𝑐𝑎𝑡𝑒𝑔𝑜𝑟𝑦) =375
385𝑥100 = 97.40%
The total efficiency of the MCVS is obtained by applying the arithmetic mean of the two efficiencies:
𝑀𝐶𝑉𝑆 𝐸𝑓𝑓𝑒𝑐𝑡𝑖𝑣𝑒𝑛𝑒𝑠𝑠 (𝑇𝑜𝑡𝑎𝑙) =96.10 + 97.40
2= 96.75%
Fig. 13. Efficiency Analysis.
B. Sensitivity Analysis
Sensitivity obtained for the prediction in each class by the MCVS.
𝑀𝐶𝑉𝑆 𝑆𝑒𝑛𝑠𝑖𝑡𝑖𝑣𝑖𝑡𝑦 (𝑇𝑜𝑡𝑎𝑙) =80.58 + 83.52
2= 82.05%
Fig. 14. Result of the Sensitivity Analysis.
C. Percentage of Specificity
Specificity is the percentage that the MCVS predicts an element other than the one evaluated as such. For our research two aspects are evaluated Specificity (class) and Specificity (category). The total specificity of the MCVS is obtained by applying the arithmetic mean to both specificities.
𝑀𝐶𝑉𝑆 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 (𝑇𝑜𝑡𝑎𝑙) =98.90 + 99.32
2= 99.11%
Fig. 15. Specificity Analysis.
IV. DISCUSSION
In the present investigation, it can be stated that the Mobile Computer Vision System has reached an efficiency level of 96.75%, a sensitivity of 82.05% and a specificity of 99.11%. However, the results achieved with processed white quinoa samples were obtained under a controlled environment. For the analysis, only the physical characteristics of the grains, such as shape, color and size specified in the Peruvian technical standard, were considered. With the result it was identified that a quinoa grain of extra-large class does not exceed 15.36 pixels, and will always be within the region of interest of 24x24 pixels.
The finding in the efficiency indicator (Fig. 13) is slightly higher by more than 1% with respect to the previous research carried out in Argentina on the classification of wheat seed by means of computer vision [7], this could be due to the fact that in this research they used a convolutional neural network based on "AlexNet" which has a lower classification accuracy than the "MobileNet" model, in addition, this previous research used only 315 images for the training of its CNN network.
The result of the developed MCVS reaches a sensitivity of 82.05% as shown in Fig. 14, which is 11.40% lower than the research conducted in Peru on pattern recognition for polished rice grain by image processing [9], which evaluated 215 grains for discrimination according to their class and type, being this grain approximately 4 times larger than a quinoa, also for the capture they used as a controlled environment a scanner which provides constant illumination. Therefore, it is suggested for future work to acquire the sample in an environment with constant illumination.
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 8, 2021
442 | P a g e
www.ijacsa.thesai.org
As for the analysis of specificity, it was achieved 99.11% as shown in Fig. 15, surpassing by 8.20% the research conducted in Colombia [8] for the classification of green coffee beans, where they obtained a specificity of 90.91%; this could be due to the fact that this research had to classify among 10 varieties of beans based on different characteristics of color, shape and borer. Therefore, they had to implement classification algorithms for each scenario with dispersed results.
The results for the extra-large class have a sensitivity of 100%, while for the small class 50%, due to the fact that the small grains in the classification by the CNN network are in some cases mistaken for grains of the immature type since they share similar characteristics.
V. CONCLUSION
With the present research, it was possible to determine the influence of a mobile computer vision system in the identification of the quality of white quinoa, by means of image processing techniques and algorithms.
A mobile computational vision system was developed to identify the quality of white quinoa with a sensitivity level of 82.05%. This is due to the fact that in some cases the CNN network confuses small grains with immature ones, and also in the sample space, due to the number of grains, they are difficult to separate, which complicates their measurement.
Thanks to technological advances for mobile devices, it is now possible to ensure that it is possible to implement robust systems to solve problems by applying computer vision on this platform.
REFERENCES
[1] MINAGRI, “La quinua: producción y comercio del Perú,” Boletín Perf. Técnico n° 2, vol. Marzo, pp. 1–8, 2017, [Online]. Available: http://quinua.pe/la-quinua-produccion-y-comercio-del-peru/.
[2] V. Apaza, G. Cáceres, R. Estrada, and R. Pinedo, Catálogo de Variedades Comerciales de Quinua en Perú, Primera ed. Lima-Peru: Organización de las Naciones Unidas para la Alimentación y la Agricultura Representación de la FAO en el Perú / Instituto Nacional de Innovación Agraria (INIA), 2013.
[3] Fairlie.A, La quinua en el Perú cadena exportadora y políticas de gestión ambiental, Primera ed. Lima-Peru: Pontificia Universidad Católica del Perú. Instituto de Ciencias de la Naturaleza, Territorio y Energías Renovables (INTE-PUCP), 2016.
[4] Z. Apaza, “Propuesta de diseño del sistema de costos por proceso para el sector agro industrial, Juliaca,” pp. 8–10, 2015.
[5] Ministerio de Desarrollo Agrario y Riesgo, “Analisis de mercado - Quinua 2015-2020,” 2020, [Online]. Available: https://cdn.www.gob.pe/uploads/document/file/1479275/Análisis de Mercado - Quinua 2015 - 2020.pdf.
[6] INDECOPI, “Norma Tecnica Peruana NTP 205.062.” Primera Edición, Lima-Peru, 2009, [Online]. Available: http://www.conal.gob.ar/CONASE/actas/ActaCONASE_2013_04Abr18_AnexoII.pdf.
[7] J. A. Redolfi, D. Gonz, and A. Pucheta, “Clasificación de Variedades de Semillas de Trigo usando Visión por Computadora,” 8° Congr. AgroInformática, p. 29, 2016, [Online]. Available: http://sedici.unlp.edu.ar/bitstream/handle/10915/57672/Documento_completo.pdf-PDFA.pdf?sequence=1&isAllowed=y.
[8] M. Arias, J. Sierra, Z. Sandoval, and F. Prieto, “Procesamiento de imágenes para la clasificación de café verde,” 2016, [Online]. Available: http://www.redalyc.org/pdf/4962/496250975010.pdf.
[9] J. Palomino, “Software automático de reconocimiento de patrones para la discriminación de granos de arroz pulido basado en procesamiento digital de imágenes,” Universidad Nacional José María Arguedas, 2014.
[10] W. Jara, “Visión Artificial : Análisis Teórico del Tratamiento Digital de Imágenes Para su aplicación en la identificación de objetos.,” p. 151, 2006.