{'fraction_non_alphanumeric': 0.03178345934991036, 'fraction_numerical': 0.014907631148179905, 'mean_word_length': 4.958086613259027, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Self-Configuring CVS to Discriminate Rocket Leaves According to Cultivation Practices and to Correctly Attribute Visual Quality Level

Computer Vision Systems (CVS) represent a contactless and non-destructive tool to evaluate and monitor the quality of fruits and vegetables. This research paper proposes an innovative CVS, using a Random Forest model to automatically select the relevant features for classification, thereby avoiding their choice through a cumbersome and error-prone work of human designers. Moreover, three color correction techniques were evaluated and compared, in terms of classification performance to identify the best solution to provide consistent color measurements. The proposed CVS was applied to fresh-cut rocket, produced under greenhouse soilless cultivation conditions differing for the irrigation management strategy and the fertilization level. The first aim of this study was to objectively estimate the quality levels (QL) occurring during storage. The second aim was to nondestructively, and in a contactless manner, identify the cultivation approach using the digital images of the obtained product. The proposed CVS achieved an accuracy of about 95% in QL assessment and about 65–70% in the discrimination of the cultivation approach.


Introduction
Recently, there has been growing interest in contactless, non-destructive, rapid and accurate techniques for the evaluation of the quality of fruits and vegetables to replace the traditional sensory and conventional destructive methods. These methods are generally time-consuming, expensive, polluting and are not suitable for the application in an industrial line [1,2]. Moreover, it has been observed that more than in other agri-food sectors, consumers are particularly attentive to the sustainability of the vegetable production process as an important issue influencing their perception of quality [3]. Furthermore, the increasing sensibility of modern consumers toward the environmental impact of production processes has been the impetus for many researchers to develop non-destructive tools for the discrimination of production origin and agricultural practices, in order to better support the added value of the products.
Nowadays, the emerging non-destructive methods in food technology, include near infrared spectroscopy (NIR), hyperspectral imaging (HSI) and computer vision system (CVS). In relation to vegetables, most of the research have applied hyperspectral or multispectral techniques [4][5][6][7][8]. The complexity of spectroscopy and hyperspectral imaging, both in terms of time and costs required for the acquisition and for the following processing, makes the application of these techniques more difficult in a pervasive way along the supply chain to enable a continuous monitoring of the parameters of interest. On the contrary, CVS is simpler and can hopefully exploit cameras that are already available along the path from harvest to final consumers.
Increasing interest has been observed in the last few years in CVSs to automatically evaluate several properties of different products: They involve optical instrumentation, electromagnetic sensing, and digital image processing technologies [9]. This technology mimics human visual evaluation of quality, acquiring images of the whole visible surface of products. These digital images are analyzed by extracting the most discriminative colors among the large set of possible visual characteristics (such as shape, color, and defects) and processing the data through suitable regression or classification models and algorithms [1].
Normally, human designers exploit previous experiences and use a trial-and-error process to select the features used by the classification/regression methods or a vocabulary of features out of which algorithms can extract the most effective subset. In many recent research, CVS have been used to evaluate the quality level (QL) of fresh and fresh-cut fruits, such as table grape [10], fresh-cut nectarines [11] and apples [12]. As reported by many authors, CVS have also been used to evaluate the QL, chlorophyll and ammonium content of leafy vegetables. The authors in [13] demonstrated that two color features detected by the CVS were able to evaluate the QL and the ammonium content (considered an indicator of senescence) in iceberg lettuce. Moreover, an innovative and automatic procedure, applied for the quality evaluation of fresh-cut radicchio allows a self-configuration of the CVS by optimizing its performance and limiting the subjective human intervention, was reported by [14]. The authors in [15] proposed a procedure to predict total chlorophyll content of rocket leaves using CVS and a machine learning model (Random Forest Regression) applied to manually selected features, obtaining higher performance (R 2 = 0.90) than the SPAD-meter (R 2 = 0.79). This work supports the relevance of the color information. The consistency of color information must be enforced using color correction methods based on the color reference provided by a color-chart inserted in the scene.
In machine learning, random forests represent an ensemble (a set) of tree predictors that can be used for both classification and regression. They exploit the principle that a group of weak learners can globally provide better results than a strong learner [16] and can reduce the risk of overfitting. Therefore, several instances of the selected models (trees) are trained, and the final predictions are made by combining the outputs of the models by voting (classification) or mean (regression). Specifically, random forest consists of an extension of bagging (bootstrap aggregating) ensemble [17], whereby each model is trained on a different set of training examples randomly sampled with repetition from the available data. Moreover, this method builds each tree using a randomly selected subset of the available features. This makes possible to use a quite large vocabulary of features without seriously impact on the efficiency of the method and without requiring the critical and often subjective choice of the most relevant features. The final performance of the random forest depends on the strength of the individual classifiers and on their independence from each other [16].
To the best of our knowledge, there is no general agreement regarding the best method to correct the colors and make them consistent among different acquisitions: This paper compares three different color correction methods, with different power and complexity. Their performance was measured, in terms of their effects on the classification accuracy. The simplest method (white balance) provided poor performance. The two other methods (linear correction and polynomial correction) provided similar performance with the second having a greater computational complexity. The linear correction is proposed as the best trade-off between efficacy and efficiency.
Moreover, the paper proposes the complete color histogram in the CIEL*a*b* color space as the vocabulary of features for the machine learning Random Forest model: This represents a relevant simplification of the CVS design that do not require the designer to select the features through a cumbersome and error-prone trial and error process.
Finally, the paper proposes to apply the same innovative approach to CVS design to different tasks: To obtain a non-destructive contactless and objective evaluation of the QL of rocket leaves during storage and to identify different fertilization levels (sustainable or not) using two irrigation management approaches applied during the cultivation. To the best of our knowledge, there are no previous application of CVS to the latter task. It is relevant that the same framework can be used to solve these two different tasks without changes in the architecture of the CVS: The only difference is in the final Random Forest classification. This final phase uses the same model for the two tasks but learns proper parameters for each of them by providing different expected values as input data.

Plant Material, Growing System, Water and Fertilizers Use Efficiency
Rocket (Diplotaxis tenuifolia L. cv Dallas) was cultivated under soilless cultivation growing system in the autumn-winter (2019-2020) period in an unheated greenhouse at the experimental farm 'La Noria' of the Institute of Sciences of Food Production (CNR-ISPA), located in Mola di Bari (Puglia, South of Italy). A randomized blocks experimental design was adopted with 3 replications; each block consisted of 4 sub-blocks, each one hosting one of the four cultivation treatments under comparison. Plastic pots, 20 per each sub-block, were filled with a 3:1 (v:v) peat (Brill 3 Special, Brill Substrate GmbH & Co., Georgsdorf, Germany): perlite (Agrilit 3, Perlite Italiana, Corsico, MI, Italy) mixture as a substrate.
Two irrigation management strategies (Timer and Sensor) and two fertilization levels (FL_1 and FL_2) were applied, following a factorial combination resulting in four agronomic treatments (Timer-FL_1; Timer-FL_2; Sensor-FL_1; Sensor-FL_2). In detail, in Timer the irrigation was empirically managed with a timer providing a fixed irrigation schedule, periodically adjusted on the basis of the amount of the drainage fraction (about 35% according to the common practice). Whereas, in Sensor the irrigation was automatically applied through dielectric sensors (GS3, Decagon Devices, Pullman, WA, USA) based on real time measurement of the substrate volumetric water content variations, thus reflecting plant water consumption and needs and resulting in a more sustainable use of irrigation water. A 0.35 m 3 m −3 volumetric water content irrigation set-point was adopted, corresponding to a moisture level slightly lower than substrate maximum water holding capacity. The sensor-controlled automatic irrigation system, composed by a CR1000 datalogger and a SDM16AC/DC relay driver (Campbell Scientific, Logan, UT, USA), turned on irrigation valves based on real-time sensor readings and maintained substrate volumetric water content close to the irrigation set-point. Tensiometers (one per experimental unit) were used to monitor the substrate matric potential, which showed a mean value of −25 hPa over the growing cycle with similar values in all the experimental units. In relation to fertilization, a mix of Osmocote Exact and Osmocote CalMag, (ICL Specialty Fertilizers, Treviso, Italy) was used in the substrate in a dose of 3.75 and 1 g L −1 , respectively, for FL_1, while a 40% reduced dose was provided in FL_2.
The doses of fertilizers (FL_1 and FL_2) were selected according to the standard recommendations provided in the label of the fertilizer products used in the experiment, reporting indications for "high dosage" or "low dosage", respectively. Water Use Efficiency (WUE) was calculated at crop level as yield (expressed as grams of product marketable fresh weight) per liter of applied irrigation water [18]. Similarly, Fertilizers Use Efficiency (FUE) was calculated as grams of product fresh weight per grams of applied fertilizer.
After each harvest time the fresh-cut rocket leaves were immediately transported in refrigerate conditions to the Postharvest laboratory.

Sensory Classification of Rocket Leaves Visual Quality Level during Storage
Rocket leaves at each harvest time, separated for each treatment, were selected in order to avoid damaged samples and put in 50 × 30 cm open polyethylene bags (Orved, Musile di Piave (VE), Italy) containing each one about 350 g of product. In total, 12 bags (3 replicates × 4 agronomic treatments) were prepared after each harvest and stored at 10 • C (as commonly occur in the market) for 12 days for the H1 and for 18 days for the H2 and the H3. The length of storage was defined by the number of days required to reach the lowest QL, as reported in [10]. Therefore, at a proper time during storage, the amount (about 70 g) of sample to analyze was taken from each bag and subjected to a sensory evaluation by a group of 6 panelists using the following 5 to 1 QL scale ( Figure 1): 5 = very good (very fresh, no signs of yellowing, bright, dark and uniform green, no defects), 4 = good (fresh, slight signs of yellowing, light green, slight loss of texture), 3 = fair (slight wilting, moderate signs of yellowing, slight discoloration, minor defects, loss of texture), 2 = poor (wilting, evident yellowing, discoloration, severe loss of texture), 1 = very poor (unacceptable quality due to decay, severe wilting and yellowing, complete loss of texture and other evident defects). A score of 3 was considered to be the limit of marketability, while a score of 2 represented the limit of edibility. marketable fresh weight) per liter of applied irrigation water [18]. Similarly, Fertilizers Use Efficiency (FUE) was calculated as grams of product fresh weight per grams of applied fertilizer.
After each harvest time the fresh-cut rocket leaves were immediately transported in refrigerate conditions to the Postharvest laboratory.

Sensory Classification of Rocket Leaves Visual Quality Level during Storage
Rocket leaves at each harvest time, separated for each treatment, were selected in order to avoid damaged samples and put in 50 × 30 cm open polyethylene bags (Orved, Musile di Piave (VE), Italy) containing each one about 350 g of product. In total, 12 bags (3 replicates × 4 agronomic treatments) were prepared after each harvest and stored at 10 °C (as commonly occur in the market) for 12 days for the H1 and for 18 days for the H2 and the H3. The length of storage was defined by the number of days required to reach the lowest QL, as reported in [10]. Therefore, at a proper time during storage, the amount (about 70 g) of sample to analyze was taken from each bag and subjected to a sensory evaluation by a group of 6 panelists using the following 5 to 1 QL scale ( Figure 1): 5 = very good (very fresh, no signs of yellowing, bright, dark and uniform green, no defects), 4 = good (fresh, slight signs of yellowing, light green, slight loss of texture), 3 = fair (slight wilting, moderate signs of yellowing, slight discoloration, minor defects, loss of texture), 2 = poor (wilting, evident yellowing, discoloration, severe loss of texture), 1 = very poor (unacceptable quality due to decay, severe wilting and yellowing, complete loss of texture and other evident defects). A score of 3 was considered to be the limit of marketability, while a score of 2 represented the limit of edibility. Images of rocket leaves at each QL were acquired and processed by CVS and the same samples were subjected to postharvest quality evaluation.

Computer Vision System Color Analysis
For the H1 and the H2, images of the samples of products were taken at 0, 4, 7 and 12 days, corresponding to QL from 5 to 2. For the H3, images of the samples were taken at 0, 4, 7, 12 and 18, corresponding to QLs from 5 to 1. At each acquisition, a sample of about 60 g of product was taken from each of the 12 bags prepared for that harvest (3 replications for each agronomic treatment). The 12 samples were analyzed by the CVS. Two images were acquired for each sample, by stacking randomly the leaves before each Images of rocket leaves at each QL were acquired and processed by CVS and the same samples were subjected to postharvest quality evaluation.

Computer Vision System Color Analysis
For the H1 and the H2, images of the samples of products were taken at 0, 4, 7 and 12 days, corresponding to QL from 5 to 2. For the H3, images of the samples were taken at 0, 4, 7, 12 and 18, corresponding to QLs from 5 to 1. At each acquisition, a sample of about 60 g of product was taken from each of the 12 bags prepared for that harvest (3 replications for each agronomic treatment). The 12 samples were analyzed by the CVS. Two images were acquired for each sample, by stacking randomly the leaves before each acquisition to maximize the surface seen by the CVS as reported in Figure 2. Therefore, 24 images were available at each time (2 images for each of the 3 replications for each of the four agronomic treatments). acquisition to maximize the surface seen by the CVS as reported in Figure 2. Therefore, 24 images were available at each time (2 images for each of the 3 replications for each of the four agronomic treatments). Data extracted from the patches of the color chart have been used to evaluate the parameters of the three different correction models compared. For each of them, a histogram was evaluated, such as the one shown for the linear model, which provides the best trade-off between efficacy and computational complexity.
The final dataset was composed by 96 images for each of the H1 and H2, and by 120 images for the H3. The complete collection was composed by 312 images. We did not distinguish the images coming from different harvests. Therefore, the final image dataset was composed by 72 images for each quality from 5 to 2 and 24 images for quality 1. In relation to the irrigation and fertilization management, the image dataset were composed by 78 images for each combination of IS and FL. These data are reported in the Table 1.
The following paragraphs will describe all the processing steps used by the CVS. All the software was developed using Matlab 2019a (Mathworks Inc., Natick, Massachusetts, Figure 2. The figure shows the flow chart of the processing done on the images. It is possible to appreciate the effects of each step on the input image and the results provided to the following steps. Data extracted from the patches of the color chart have been used to evaluate the parameters of the three different correction models compared. For each of them, a histogram was evaluated, such as the one shown for the linear model, which provides the best trade-off between efficacy and computational complexity.
The final dataset was composed by 96 images for each of the H1 and H2, and by 120 images for the H3. The complete collection was composed by 312 images. We did not distinguish the images coming from different harvests. Therefore, the final image dataset was composed by 72 images for each quality from 5 to 2 and 24 images for quality 1. In relation to the irrigation and fertilization management, the image dataset were composed by 78 images for each combination of IS and FL. These data are reported in the Table 1.
The following paragraphs will describe all the processing steps used by the CVS. All the software was developed using Matlab 2019a (Mathworks Inc., Natick, Massachusetts, United States). A flowchart of these processing steps, along with examples of their effects, is shown in Figure 2.

Acquisition of Calibrated Color Images
To acquire calibrated color images, color changes due to environment conditions (lighting, geometry, sensor instability) were evaluated and reduced to the minimum. Images were acquired using the set-up reported in [14,15,19,20], using a 3CCD (with a dedicated Charged Coupled Device for each color channel) digital camera (JAI CV-M9GE) having a resolution of 1024 × 768 pixels. The imaged area is about 32 × 24 cm. A 3CCD sensor has been used to avoid the artifacts introduced by the demosaicing methods required to record color information using a single CCD. The optical axis of the LinosMeVis 12 mm lens system was perpendicular to the black background. Two DC power suppliers delivered current to eight halogen lamps, placed along two rows at the two sides of the imaged area and oriented at a 45 • angle with respect to the optical axis. All the images were saved using the uncompressed TIFF format to avoid the artifacts introduced by compression algorithms.

Color-Chart Processing and Foreground Segmentation
A small X-Rite color-chart with 24 patches of known colors was placed into the scene to measure color variations due to environmental conditions and sensor characteristics by comparing the expected numerical values released by the manufacturer with the ones acquired by the camera. The color-chart was automatically detected regardless of its position and orientation [15]. Its white patch was used by the white-balance algorithm. All the colors in the color-chart were used to estimate the linear and polynomial transformations used for color correction.
Image processing worked only on the part of each image belonging to the product at hand (foreground). The background was discarded. The CVS automatically separated foreground and background without any human intervention: Two thresholds were derived from the analysis of the whole image in the HSV color space, as described in [15]. The segmentation was identified the region belonging to the product as a whole and did not separate its different parts, and neither discarded any region of the leaves. It was designed to be conservative, that is to discard all the background pixels even at the cost of removing some marginal borders of the product. It removed also background area inside the stack of leaves as long as part of the leaves are too dark (for example for self-shadowing of the product) to provide meaningful color information.

Color Correction
Color correction needs to be effective (to provide consistent color measurements) and efficient (computationally simple enough to be suitable for real applications along the supply chain). Three different color correction models, with increasing level of complexity, were compared to compensate the change in color rendering due to acquisition environment. Let it be r i e g i e b i e T and r i m g i m b i m T the expected and the measured RGB values respectively for the i-th patch i = 1, . . . ,24. Let it be [r we g we b we ] T and [r wm g wm b wm ] T the expected and measured whites respectively. The simplest model was white balance (WB).
Using the white patch in the color chart, a different correction coefficient was evaluated for each channel, as reported below (1): The three correction coefficients were used to correct the corresponding channel by multiplying the corresponding color component of each foreground pixel. A linear correction (LC) (a 3 × 3 matrix) was evaluated to reduce the distance between the expected and the measured values on the color chart (2):  are the colors corrected using the matrix whose elements were evaluated using a least-square approach applied on all the patches of the color-chart. The same matrix was therefore used to correct all the foreground pixels of the image. The last transformation was a polynomial correction (PC) (with degree 2) where all the linear and quadratic elements were considered (r, g, b, rg, rb, gb, r 2 , g 2 , b 2 ). The coefficients of such transformation were again evaluated using a least-square approach (3).
All the foreground pixels were corrected using the same matrix. The transformations provided by the three methods were different for each image (they were evaluated from the color-chart appearance in each specific image) to adapt to the specific conditions of each acquisition.
The time required by the three-color correction methods is different. Using the MAT-LAB code used in the experiments, without specific optimization or the use of special hardware, the application of the white balance to an image takes 70 ms. The linear correction requires 73 ms while the polynomial correction requires 89 ms. In an industrial application of the system, the difference between linear and polynomial corrections can negatively affect the maximum speed achievable by the production. Therefore, it is important to evaluate if the performance gain justifies the loss of productivity.

Features Extraction
On the base of previous experiences, the device independent and perceptually uniform CIE L*a*b* color space was chosen to accomplish color analysis. Given that the L* component is fragile, being too sensible to not uniform illumination levels across the scene, the complete histogram in the a* b* plane of the foreground pixels was used as feature set for the classification. The color histogram represents the number of occurrences of each color, that is of each (a*, b*) pair, in all the foreground pixels. It represents the property of the whole observed product. The continuous (a*, b*) plane has been discretized using 30 bins for each axis (a* and b*): therefore, the complete histogram was a matrix with 900 elements. This representation is more detailed than statistical measures, such as mean, median or standard deviation: it describes completely the palette of colors present in the scene and their relative relevance. The hypotheses were that such information was able to represent the appearance of new colors due to senescence as far as the effects of the cultivation management on product appearance, if any. To achieve the goal of avoiding any human intervention in the identification of proper color features, the complete matrix containing all the values of the bins of this histogram was reshaped as a vector and passed to the classification phase. The use of a quite large vector (900 elements in our case) was feasible as the ensemble method used for classification can sample for each tree a subset of features from even a quite large set. This approach automatically identifies their best use, while keeping reasonable the computational complexity. Even if it is not possible to identify few specific colors suitable to discriminate product quality or cultivation management, the ensemble of trees exploits a quite large subset of the provided features, that is (a*, b*) pairs, which globally achieve the desired classification.

Classification
Random Forest models were trained to assign the QL to the product and to identify the treatment used. The values of the cells of the histogram in the a* b* plane (of the CIE L*a*b* color space) of each image provided the vocabulary of features used for training the models. The approach for training each tree involved randomly sampling the available training data (to select the training examples) and then randomly selecting a set of features (in this case randomly selecting which values of the histogram to use to build the tree at hand). Each tree of the forest allows a maximum of 10 branches. Due to the limited number of samples, a 10-fold cross validation approach was used. The available data were divided into 10 groups (folds), each having approximately the same number of elements. The partition was made with stratification. Therefore, each group approximated the same distribution of classes of the whole training set. According to the 10-folds validation strategy, the training was done 10 times. At each round, a different fold was separated for testing the results while the other nine folds were used for training. The average of the results obtained in the ten rounds estimated the performance of the method. Accuracy is used as a quick indication of the performance of classification in the results' section but, to provide a complete description of the obtained results, the confusion matrices are provided. In fact, they provide all the information needed to describe the behavior of the method. To increase the robustness of performance measures, the 10-fold cross-validation process was repeated 20 times. The confusion matrices and accuracy values represent the average of the values over these 20 different repetitions. At each repetition, a new stratified partition of training data into 10 folds was randomly generated. That increases the significance of the obtained results by making less relevant the effects of chance in sampling training data and features. In spite of the significative number of trees in the resulting forest (200 trees were allowed for each forest) the increase in accuracy provided by their combination does not require high computational costs. The code, written in Matlab without any specific optimization, requires about 25 s for building the Random Forest model and about 0.13 s to apply the model to a new sample and to classify it.

Color Analysis by Colorimeter
Color parameters (L*, a* and b*) were measured, for each replicate, on 3 random points on the surface of 10 rocket leaves using a colorimeter (CR400, Konica Minolta, Osaka, Japan) in the reflectance mode and in the CIE L* a* b* color scale. Colorimeter was calibrated with a standard reference having values of L*, a* and b* corresponding to 97.44, 0.10 and 2.04, respectively. To measure color variations on each sensory evaluation, ∆E* was calculated according to the following Equation (4) [21]: where L* 0 , a* 0 and b* 0 represents color parameters detected on fresh samples. Yellowness index (YI) was calculated from primary L*, a* and b* readings, while the degreening index (DI) was obtained by the Hunter L a b values (obtained converting the CIE L* a* b* readings), according to the following Equations (5) and (6) [22,23]:

Respiration Rate, Electrolyte Leakage and Total Chlorophyll Content
The respiration rate of rocket leaves was determined at 10 • C initially and at each sampling time using a closed system as reported by [24]. In particular, about 50 g of product for each replicate were put into 3.6 L sealed plastic jar (one jar for each replicate) where CO 2 was allowed to accumulate up to 0.1% as the concentration of the CO 2 standard. The time taken to reach this value was detected by taking CO 2 measurements at regular time intervals. The CO 2 analysis was conducted by taking 1 mL of gas sample from the head space of the plastic jars through a rubber septum and injecting it into a gas chromatograph (p200 micro GC-Agilent, Santa Clara, CA, USA) equipped with dual columns and a thermal conductivity detector. Carbon dioxide (CO 2 ) was analyzed with a retention time of 16 s and a total run time of 120 s on a 10-m porous polymer (PPU) column (Agilent, Santa Clara, CA, USA) at a constant temperature of 70 • C. The respiration rate was expressed as µmol CO 2 kg −1 s −1 .
To determine electrolyte leakage, the method reported by [25] was used with slight modifications. About 2.5 g of disks obtained using a cork borer (ø8 mm) were placed in plastic tubes and immersed in 25 mL of distilled water. After 30 min of storage at 10 • C, the conductivity of the solution was measured using a conductivity meter (Cond. 51+-XS Instruments, Carpi, Italy). Then, the tubes with samples and solution were frozen at-20 • C and, after 48 h, the conductivity was detected after thawing and considered as total conductivity. Electrolyte leakage was calculated as the percentage ratio of initial over total conductivity.
The total chlorophyll content was detected according to the spectrophotometric method reported by [26]. In detail, 5 g of chopped rocket leaves was extracted in acetone/water (80:20 v/v) with a homogenizer (T-25 digital ULTRA-TURRAX ® -IKA, Staufen, Germany) and then centrifuged at 15,000 rpm for 5 min. To remove all pigments, the extraction was repeated 5 times and extracts were combined. The absorbance was read immediately after the extraction procedure on extracts proper diluted using a spectrophotometer (UV-1800, Shimadzu, Kyoto, Japan) at three wavelengths, at 663.2 nm, 646.8 nm, and 470 nm. The total chlorophyll content was expressed as mg per 100 g of fresh weight using the equation reported by [27].

Statistical Analysis
The relationship among QLs and the postharvest quality parameters (color, respiration rate, electrolyte leakage and total chlorophyll content of rocket leaves) was tested by performing a one-way ANOVA. Then, a multifactor ANOVA was performed with the aim to evaluate the effects of fertilization levels (FL_1 or FL_2) and irrigation management approach (Timer or Sensor) on WUE, FUE, visual quality, color parameters, respiration rate, electrolyte leakage and total chlorophyll content.
The mean values were separated using the Student-Newman-Keuls (SNK) test and Statgraphics Centurion (version 18.1.12, Warrenton, VA, USA) was used for statistical analyses.

Effects of Agronomic Treatments on Water and Fertilizers Use Efficiency and Postharvest Quality Parameters
Treatments resulted in a substantial differentiation of the sustainability of the production process expressed in terms of resources (water and fertilizers) use efficiency. Mean values of WUE were 21.4 and 34.4 g L −1 , on average, in Timer-based and Sensor-based irrigation treatments respectively, with no effects of the fertilization level. On the other hand, treatments showed a significant interaction on FUE, as reported in Figure 3. 646.8 nm, and 470 nm. The total chlorophyll content was expressed as mg per 100 g of fresh weight using the equation reported by [27].

Statistical Analysis
The relationship among QLs and the postharvest quality parameters (color, respiration rate, electrolyte leakage and total chlorophyll content of rocket leaves) was tested by performing a one-way ANOVA. Then, a multifactor ANOVA was performed with the aim to evaluate the effects of fertilization levels (FL_1 or FL_2) and irrigation management approach (Timer or Sensor) on WUE, FUE, visual quality, color parameters, respiration rate, electrolyte leakage and total chlorophyll content.
The mean values were separated using the Student-Newman-Keuls (SNK) test and Statgraphics Centurion (version 18.1.12, Warrenton, VA, USA) was used for statistical analyses.

Effects of Agronomic Treatments on Water and Fertilizers Use Efficiency and Postharvest Quality Parameters
Treatments resulted in a substantial differentiation of the sustainability of the production process expressed in terms of resources (water and fertilizers) use efficiency. Mean values of WUE were 21.4 and 34.4 g L −1 , on average, in Timer-based and Sensorbased irrigation treatments respectively, with no effects of the fertilization level. On the other hand, treatments showed a significant interaction on FUE, as reported in Figure 3. subjected to different irrigation strategies (timer-based or sensor-based) and two fertilization levels (FL_1, high fertilization level; FL_2 low fertilization level). "Irrigation management strategy × Fertilization level" interaction significant at p < 0.001. Different letters above the columns indicate significant difference between the treatments (p < 0.05, means separation performed with SNK test).
Greenhouse soilless production can boost intensive cropping systems with impressive efficiency on water and nutrients use, and very high product yield and quality [28]. Both sensor-based irrigation management [29][30][31] and the rational application of fertilizers [32,33] have been identified as promising approaches in combining high product quality with sustainable use of resources in greenhouse soilless vegetables production.
In relation to the effects of fertilization levels (FL_1 or FL_2) using the Timer or Sensor irrigation management approach, results obtained from the multifactor ANOVA showed Figure 3. Fertilizer use efficiency (FUE), of greenhouse soilless rocket (Diplotaxis tenuifolia L.) subjected to different irrigation strategies (timer-based or sensor-based) and two fertilization levels (FL_1, high fertilization level; FL_2 low fertilization level). "Irrigation management strategy × Fertilization level" interaction significant at p < 0.001. Different letters above the columns indicate significant difference between the treatments (p < 0.05, means separation performed with SNK test).
Greenhouse soilless production can boost intensive cropping systems with impressive efficiency on water and nutrients use, and very high product yield and quality [28]. Both sensor-based irrigation management [29][30][31] and the rational application of fertilizers [32,33] have been identified as promising approaches in combining high product quality with sustainable use of resources in greenhouse soilless vegetables production.
In relation to the effects of fertilization levels (FL_1 or FL_2) using the Timer or Sensor irrigation management approach, results obtained from the multifactor ANOVA showed that all factors (irrigation management strategies, fertilization levels and their interaction) did not influence the visual quality, the respiration rate, the color parameters and the total chlorophyll content of rocket leaves While, the electrolyte leakage was affected only by the irrigation management strategies ( Table 2). In detail, fresh-cut rocket irrigated with the Sensor approach showed a mean value slightly higher (23.3 ± 5.2%, on average) than that reported in samples irrigated with the Timer strategy (19.7 ± 6.2%, on average), probably as a result of the lower water availability [34]. Table 2. Effects of irrigation management strategies (Timer or Sensor) (A), fertilization levels (FL_1 or FL_2) (B) and their in-teraction on visual quality, physical and chemical parameters of rocket leaves stored at 10 • C. A 5 to 1 rating scale was used for visual quality, where 5 = very good (very fresh, no signs of yellowing, bright, dark and uniform green, no defects), 4 = good (fresh, slight signs of yellowing, light green, slight loss of texture), 3 = fair, limit of marketability (slight wilting, moderate signs of yellowing, slight discoloration, minor defects, loss of texture), 2 = poor, limit of edibility (wilting, evident yellowing, discoloration, severe loss of texture), 1 = very poor (unacceptable quality due to decay, severe wilting and yellowing, complete loss of texture and other evident defects). The results are provided as the mean values of 6 samples for irrigation management strategies and fertilization levels (3 replicates × 2 irrigation management strategies or 2 fertilization levels). The mean values followed by different letters (a, b) are significantly different (p ≤ 0.05), according to Student-Newman-Keuls test.
In the present study, the respiration rate of rocket leaves at harvest (QL5) was 35.52 ± 5.7 µmol CO 2 kg −1 s −1 and it remained rather low in all QLs, showing a slight decrease from QL5 to QL2 and increasing in QL1 rocket leaves, discriminating only the QL5 from the other levels ( Table 3). The authors in [35] reported values of respiration rate in Diplotaxis tenuifolia L. stored at 4 • C of about 8.5 µmol CO 2 kg −1 s −1 , while in [36] the respiration rate in wild rocket stored at 17 • C was about 32.8 µmol CO 2 kg −1 s −1 . According to [37], the differences on this parameter in rocket are related to the storage temperature and to the maturity of the leaves at harvest: they reported that young wild rocket leaves at 10 • C had higher (79.8 µmol CO 2 kg −1 s −1 ) respiration rate than the old ones (47.7 µmol CO 2 kg −1 s −1 ). Table 3. Respiration rate, color parameters, electrolyte leakage and total chlorophyll content in rocket leaves stored at 10 • C, at each quality level (QL). In the present research, electrolyte leakage was able to discriminate the marketable samples (QL5 and QL4) from the QL3 and the waste (QL2 or QL1) ones. Furthermore, these two classes of waste were well discriminated by electrolyte leakage ( Table 3).

Parameters
The same discrimination was observed in the case of total chlorophyll content, that showed a decrease of about 37% from the QL5 to QL1 (Table 3). In particular, this parameter well separated the marketable samples (QL5 and QL4) from the QL3 and QL2; moreover, the waste samples (QL1) were well discriminated from the edible ones. The authors in [38] reported that the chlorophyll degradation, which causes yellowing leaves, is related to the quality loss of the product. Indeed, the total chlorophyll content is considered a good objective parameter for the QL assessment.

Application of Self-Configuring CVS to Objectively Attribute the Visual Quality Level of Rocket Leaves and to Discriminate Them According to Preharvest Practices
The goal of the CVS was to reproduce the QL sensory evaluation of rocket leaves and to identify agronomic treatments in an objective, non-destructive and contactless way by simply imaging the product in proper conditions. Since color is the key information aspect used by the CVS, it was necessary to make its measurement as consistent as possible.
The color-chart, introduced in the scene, provided a reference that was used to measure, and then minimize the effects of any uncontrolled change in the acquisition environment. This was carried out by correlating the 24 expected color values provided by the manufacturer with the values measured in each image. This correlation was used to determine the parameters of the model that was used for correcting all the colors of the image. The three previously presented color correction models were applied and quantitatively compared to point out the best model for such kind of application. Two metrics to measure the effectiveness of color corrections models were considered. The first one evaluated their ability to reduce the distance between expected and measured color on the 24 patches of the color chart. The second one measured their effects on final classification accuracy, keeping unchanged all the following processing on images. The former method evaluated the correction on the same data used to estimate the parameters of the model: This made the response weaker and less reliable. This paper proposes the latter method to achieve a better evaluation using the accuracy of the classification process applied to the images corrected using the three different color correction models. In this way, the data (the colors of the product) on which the models are compared are different from the ones used during the model construction. Moreover, the effectiveness of color correction is evaluated on the task of interest. The experiments pointed out that the two metrics do not provide always the same answer. As shown in Figure 4, the global distance between the expected and the measured values on the color chart patches was still large for WB, much smaller for LC and minimum for the PC. This was a natural result of the higher degrees of freedom of the PC that made easier to correct the 24 colors of the color-chart. When applied to the evaluation of QL of rocket leaves and to the identification of the Timer and Sensor approaches, the differences between LC and PC were small and could be considered negligible. different color correction models. In this way, the data (the colors of the product) on which the models are compared are different from the ones used during the model construction. Moreover, the effectiveness of color correction is evaluated on the task of interest. The experiments pointed out that the two metrics do not provide always the same answer. As shown in Figure 4, the global distance between the expected and the measured values on the color chart patches was still large for WB, much smaller for LC and minimum for the PC. This was a natural result of the higher degrees of freedom of the PC that made easier to correct the 24 colors of the color-chart. When applied to the evaluation of QL of rocket leaves and to the identification of the Timer and Sensor approaches, the differences between LC and PC were small and could be considered negligible. In the experiments, all the images were corrected using all the three exposed models. Three different image datasets were generated, each associated to a different color correction model. The same subsequent processing and classification process, which was based on a Random Forest approach, was applied to the histograms associated with the three datasets. The corresponding performances were then measured. The classification was accomplished using two different resolutions of practical relevance. In the first case, the product completely marketable (QL5-QL4-QL3) was separated from the product just below the marketable limit (QL2) and from the not edible items. This may be useful because the leaves belonging to QL2 might be reusable to reduce waste. In the second case, the marketable product (QL5-QL4-QL3) was separated from unmarketable leaves (QL2-QL1): this might be a valid solution for commercial applications where it is important only to recognize the unmarketable product to remove it from the shelves.
Moreover, the classification was tried on the task of recognizing leaves from the Timer vs Sensor and those from FL_1 vs FL_2 treatments. The Table 4 shows the Confusion Matrices obtained by the Random Forest applied to the problem of distinguishing the marketable product (QLs 5-4-3) from the edible one (QL 2) and from In the experiments, all the images were corrected using all the three exposed models. Three different image datasets were generated, each associated to a different color correction model. The same subsequent processing and classification process, which was based on a Random Forest approach, was applied to the histograms associated with the three datasets. The corresponding performances were then measured. The classification was accomplished using two different resolutions of practical relevance. In the first case, the product completely marketable (QL5-QL4-QL3) was separated from the product just below the marketable limit (QL2) and from the not edible items. This may be useful because the leaves belonging to QL2 might be reusable to reduce waste. In the second case, the marketable product (QL5-QL4-QL3) was separated from unmarketable leaves (QL2-QL1): this might be a valid solution for commercial applications where it is important only to recognize the unmarketable product to remove it from the shelves.
Moreover, the classification was tried on the task of recognizing leaves from the Timer vs Sensor and those from FL_1 vs FL_2 treatments. The Table 4 shows the Confusion Matrices obtained by the Random Forest applied to the problem of distinguishing the marketable product (QLs 5-4-3) from the edible one (QL 2) and from the waste (QL 1). The accuracy obtained by applying WB was 93%, by applying LC was 96%, by applying the PC was 95%. In this case the PC behaved slightly worse than LC even if on the color-chart the results were opposite. Table 4. Confusion Matrices obtained by the classification working on the datasets coming from the three different color correction models and with the task of separating marketable product (QL 5-4-3) from the edible (QL 2) and from the waste (QL 1) ones. The Table 5 shows the Confusion Matrices obtained by applying the classification to the task of separating marketable product (QL5-4-3) from non-marketable product (QL 2-1). The accuracy obtained by applying WB was 93%, by applying LC was 96%, by applying the PC was 97%. Table 5. Confusion Matrices obtained by the classification working on the datasets coming from the three different color correction models and with the task of separating marketable product (QL 5-4-3) from non-marketable product (QL 2-1). There was a light improvement in the accuracy of LC and PC while the difference between them was still negligible. In this case, PC slightly outperformed LC in accord with the results on the color-chart but with a much smaller difference. The experiments pointed out that the two models produce mostly the same effects on the task. Therefore, is natural to use the LC model, which exhibits a lower computational complexity. The proposed self-configuring CVS used for the QL classification of rocket leaves allowed an objective system to be obtained, that can reproduce the human sensory evaluation, that consider a set of descriptors (such as color, defects and texture) as reference ( Figure 1). Therefore, the proposed system, based on the extraction of color features, classified rocket leaves miming the end users involved in the visual QL assessment [1]. Tables 6 and 7 show the Confusion Matrices associated to the tasks of recognizing the fertilization levels (FL_1 vs FL_2) using the irrigation management approach Timer and Sensor, respectively. The accuracies were quite low; approximately 70% using Timer and 66% using Sensor. LC and PC behaved similarly on irrigation management approach while LC outperformed PC on FL.  The results obtained by recognizing the differences in the fertilization treatments (sustainable or conventional) were weaker. Nonetheless, these results were in accord with the indications provided by the statistical analysis of the measures supplied by the colorimeter and by the destructive tests made in laboratory. The performance is due to the small differences between products obtained by different treatments. This substantially uniform product quality confirmed that reducing water and fertilizer supply to exactly match real plant needs, without excesses, provides adequate growing conditions.

Conclusions
The experiments proved that the adopted agronomic treatments significantly improved the sustainability of the production process. This is demonstrated by the high values of WUE and FUE, obtained using sensors and reducing fertilizer inputs, while guaranteeing high product quality in all treatment conditions.
The proposed CVS was based on calibrated color images: Linear color correction proved to represent the best trade-off between efficacy and efficiency in making consistent color measurements. The proposed new form of integration of the Random Forest model in the color analysis was able to define and select color features suitable for classification without any human intervention. This new CVS achieved a high accuracy (about 95%) in evaluating the rocket quality levels during storage. The same system was used to recognize traits related to the sustainability of the cultivation management with specific reference to water and nutrients use. In this second task, performance was lower and not relevant for practical application. However, it was fully in accord with the results provided by the standard methods currently used (colorimeter and destructive analytical tests in laboratory). Therefore, the different cultivation approaches did not significantly affect the characteristics of the product. For this last task, further investigations are needed.
The proposed computer vision system is cheap, fast and can be easily moved to an industrial production line. Given that the system is non-destructive and contactless, it enables an extended monitoring of products along the whole supply chain, thereby providing the opportunity for timely detection quality change and a reduction in economic losses and production waste.
Author Contributions: Methodology, formal analysis, investigation, writing-original draft preparation, M.P.; conceptualization, writing-review and editing, supervision, B.P. and M.C.; agronomic data, formal analyses, writing-review and editing, F.S. and F.F.M.; conceptualization, review and editing, supervision, G.C.; conceptualization, methodology, formal analyses, writing-review and editing, supervision, G.A. All authors have read and agreed to the published version of the manuscript.
Funding: This research was funded by the project Prin 2017 "SUS&LOW-Sustaining low-impact practices in horticulture through non-destructive approach to provide more information on fresh produce history and quality" (grant number: 201785Z5H9) from the Italian Ministry of Education University is kindly acknowledged.
Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: Not applicable.