Improvement of the classification of green asparagus using a Computer Vision System

The aim of this work was to improve the classification of green asparagus in an agro-export company by way of a Computer Vision System (CVS). Thus, an image analysis application was developed in the MATLAB® environment to classify green asparagus according to the absence of white spots and the width of the product. The CVS performance was compared with a manual classification using the error in the classification as the quality indicator; the yield from the raw material (%) and line productivity (kg/h) as the production indicators; and the net present value (USD) and internal rate of return (%) as the economic indicators. The CVS classified the green asparagus with 2% error; improved the yield from the raw material from 43% to 45%, and line productivity from 5 to 10 kg/h; and increased the net present value by 102,609.00 USD, yielding an Internal Rate of Return of 156.3%, much higher than the Opportunity Cost of the Capital (8.6%). Hence the classification of green asparagus by a CVS is an efficient and profitable alternative to manual classification.


Introduction
Peru is the world's leading exporter of green asparagus (Asparagus officinalis) due to its all-year-round agricultural production (Schuster & Maertens, 2015;Vázquez-Rowe et al., 2016).This vegetable, traditionally consumed throughout the world, is highly perishable and its quality easily lost, and hence its processing and commercialization must be fast as well as efficient (Lill, 1980;Wu & Yang, 2016).
One of the critical spots in asparagus processing is its classification (Donis-González & Guyer, 2016).This activity is done manually in Peruvian agro-exporter companies, which is costly, slow and subject to involuntary errors caused by worker fatigue, which, in severe cases, leads to unnecessary expenses for product reclassification or dealing with client complaints.Thus, the development and implementation of new technologies for a rapid and contact-free classification of vegetables helps to avoid the disadvantages and minimize the errors of manual classification (Mohd Ali et al., 2017;Mahendran et al., 2012;Siche et al., 2016).One of these technologies with relative low cost is the Computer Vision System (CVS), which provides an objective control with constant criteria of the whole production in real time by way of digital image analysis with computer algorithms (Arakeri & Lakshmana, 2016;Ercisli et al., 2012;Fuentes et al., 2014;Saldaña et al., 2013).
The CVS were proposed for the inspection of asparagus in the 90s (Rigney et al., 1992).However, to our knowledge, no subsequent works reported on a broad evaluation of how a CVS improved the classification of green asparagus, which could help in decision making concerning the implementation of CVSs in the industry.
Thus, this work aimed to improve the quality, production and economic indicators of the classification of green asparagus at an agro-export company by way of a CVS.

Product
The green asparagus (asparagus officinalis) shoots came from the Viru Valley (Peru).A sample size of 384 units was calculated considering a very large population (industrial scale) at a 95% confidence level and expected proportion of 0.5.The shoots were randomly selected and separated from the conventional processing line (1.25 ton/h) to be classified by the CVS in an environment isolated from the regular activities of the agro-export company.The dimensions of the samples varied from 8 to 16 mm in width, and from 12.3 to 17.4 cm in length or height.

Computer Vision System
The CVS works in two steps, image acquisition by a digital camera (LG-G2 mini, LG electronics, South Korea) in a cover and support platform, and image analysis using a computer (HP Pavilion 15-cd007la, HP, USA) that contains an application developed in the MATLAB® environment to classify the asparagus according to the absence of white spots and the height, with simultaneous measurement of the width, which can be monitored at the user interface (Figure 1a).The algorithm of the application followed a linear and sequential model that emphasized a short development life cycle (Figure 1b) and began with the identification Braz.J. Food Technol., Campinas, v. 22, e2018140, 2019 | https://doi.org/10.1590/1981-6723.140183/5 of samples without white spots, followed by an evaluation of the height of the sample considering the desirable range for the product (14 to 16 cm) with a tolerated deviation of 0.5 cm.A pitch depth of 8 bits per RGB channel was considered, giving a total of 24 bits per pixel in all the grayscale captures.

Evaluation indicators
Different indicators were used for the CVS evaluation, as follows: error in the evaluation of the height and the diameter and absence of white spots as the quality indicators; line productivity (kg / h) which is the result of the division of the production (kg) by the number of "man-hours" (h); and the yield from the raw material (%) which is the result of the division of the production (kg) by the weight of raw material (kg), as the production indicators; net present value (USD) which is the value of a certain number of cash flows originating from investment and the internal rate of return as the economic indicators.The internal rate of return (%) is defined as the interest rate obtained from the investment balance not recovered from a project, such that at the end of the project the non-recovered balance is zero, that is when the net present value is equal to zero (Park, 1997).
In addition, to assess the internal rate of return, the opportunity cost of capital was calculated, which is the minimum rate of return that is expected to be obtained by the investment in the project.The net present value and internal rate of return were calculated for a 2-year-period operation of the CVS, since the cash flow of the production line is evidence that despite the high initial investment for classification with CVS, the cash flow is significantly higher than for classification without CVS (Table 1).The calculation of the net present value was carried out using Equation 1.
( ) Where: V t = net cash flow at the end of the period "t"; n = economic life of the project; k = type of interest; I 0 = initial investment of the project.
The opportunity cost of capital was calculated using Equations 2 and 3. .

OCC K
Country risk .
Where: λ = the adjustment constant (1.5); β = the risk index of the particular action; r f = the risk-free rate; (r m -r f ) = the premium risk over average stock.

Results and discussion
A comparison of some indicators in the classification of green asparagus with CVS and without CVS (manual classification) is presented in Table 2.In general, the classification of green asparagus with a CVS was better for all the indicators evaluated (Table 2).As regards quality, the CVS had a 2% error in the evaluation of the absence of white spots and product height.This can be considered acceptable since in a manual classification, worker fatigue makes the performance inconsistent and relative.Another effect is the null loss of product quality by manipulation during the classification because the CVS is contact-free technology.
For the production indicators (Table 2), the implementation of the CVS doubled the line productivity (from 5 to 10 kg/h) and slightly improved the yield from the raw material (from 43% to 45%).This is a consequence of the absence of workers for the classification task.Thus, the classification stopped being the "limiting operation" and became fast, continuous and efficient since a greater capacity can be used in the blanching tunnels without the need to store the asparagus for classification.
For the economic evaluation (Table 2), it can be seen that 2 years after implementing the CVS, the net present value doubled its value when compared with the manual classification.Likewise, the internal rate of return was determined at 156.3%, which is a much higher value than the opportunity cost of capital (8.6%), indicating that the investment in the CVS implementation was profitable for the agro-export company.These results highlight the improvement in process efficiency that resulted in a reduction of workers on the production line, from 11 to 5.

Conclusion
In this work, a computer vision system for the classification of green asparagus was designed, implemented and evaluated as an alternative to manual classification in an agro-export company.The computer vision system performed with a 2% error of classification, slightly increased the yield from the raw material (from

Figure 1 .
Figure 1.Application of the Computer Vision System: interface (a), and flow diagram of the interpretation phase (b).

Table 1 .
Cash flow (USD) of the production line with and without the Computer Vision System (CVS).

Table 2 .
Comparative evaluation of green asparagus classification with and without the Computer Vision System (CVS).