Estimation of nitrogen content in cucumber plant (Cucumis sativus L.) leaves using hyperspectral imaging data with neural network and partial least squares regressions
Abstract
Producción Científica
Full text
Estimation of nitrogen content in cucumber plant (Cucumis sativus L.) leaves using hyperspectral imaging data with neural network and partial least squares regressions Sajad Sabzi a , Razieh Pourdarbani b , ** , Mohammad H. Rohban a , Gin es García-Mateos c , Juan I. Arribas d , e , * a Department of Computer Engineering, Sharif University of Technology, Tehran, Iran b Department of Biosystems Engineering, University of Mohaghegh Ardabili, Ardabil, Iran c Department of Computer Science and Systems, University of Murcia, 30100, Murcia, Spain d Department of Electrical Engineering, University of Valladolid, 47011, Valladolid, Spain e Castilla-Leon Neuroscience Institute, University of Salamanca, 37007, Salamanca, Spain ARTICLE INFO Keywords: Cucumber Hyperspectral imaging Image processing Leaf Machine learning Nitrogen Optimization Plant Prediction Regression ABSTRACT In recent years, farmers have often mistakenly resorted to overuse of chemical fertilizers to increase crop yield. However, excessive consumption of fertilizers might lead to severe food poisoning. If nutritional deficiencies are detected early, it can help farmers to design better fertigation practices before the problem becomes unsolvable. The aim of this study is to predict the amount of nitrogen (N) content ðmg l1Þin cucumber (Cucumis sativus L., var. Super Arshiya-F1) plant leaves using hyperspectral imaging (HSI) techniques and three different regression methods: a hybrid artificial neural networks-particle swarm optimization (ANN-PSO); partial least squares regression (PLSR); and unidimensional deep learning convolutional neural networks (CNN). Cucumber plant seeds were planted in 20 different pots. After growing the plants, pots were categorized and three levels of nitrogen overdose were applied to each category: 30%, 60% and 90% excesses, called N 30% ,N 60% ,N 90% , respectively. HSI images of plant leaves were captured before and after the application of nitrogen excess. A prediction regression model was developed for each individual category. Results showed that mean regression coefficients (R) for ANN-PSO were inside 0.937–0.965, PLSR 0.975–0.997, and CNN 0.965–0.985 ranges, test set. We conclude that regression models have a remarkable ability to accurately predict the amount of nitrogen content in cucumber plants from hyperspectral leaf images in a non-destructive way, being PLSR slightly ahead of CNN and ANN-PSO methods. 1. Introduction In recent years, agricultural producers have increased the application of chemical fertilizers per unit area, instead of using modern agricultural knowledge to increase production. The fallacy of increased yield due to increased use of water and chemical fertilizers has led to excessive application of fertilizer resources. However, continuation over time of these actions may pose serious risks of contamination and threat to human health, not to mention financial losses and intensification of nutrient imbalances in soil [1,2]. For example, nitrogen (N) fertilizer, which is consumed in large quantities due to its low cost, is converted to nitrate being a known carcinogen with the potential of causing endocrine and immune systems disorders which might lead to gastrointestinal cancer [3]. The first symptom of nitrogen poisoning in cucumber plants includes the appearance of a yellow spot on the surface of plant leaves, which subsequently expands so that it may cover the entire leaf surface, except where its veins remain green. In most cases, nitrogen poisoning can be eliminated by heavy irrigation and proper environmental control. Thus, early detection of plant poisoning may help to reduce the severity of this problem as soon as possible [4]. Plant leaves are an important source of information for plant recognition, identification and health monitoring. The development of intelligent computer systems based on leaf analysis can help in non- * Corresponding author. Department of Electrical Engineering, University of Valladolid, 47011, Valladolid, Spain. ** Corresponding author. E-mail addresses: r_pourdarban[email protected] (R. Pourdarbani), [email protected]va.es (J.I. Arribas). Contents lists available at ScienceDirect Chemometrics and Intelligent Laboratory Systems journal homepage: www.elsevier.com/locate/chemometrics https://doi.org/10.1016/j.chemolab.2021.104404 Received 31 March 2021; Received in revised form 11 August 2021; Accepted 13 August 2021 Available online 17 August 2021 0169-7439/©2021 The Author(s). Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/bync-nd/4.0/). Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404
destructive and real-time assessment of plants [5]. So far, several methods have been developed for non-destructive prediction of agricultural products, using plant leaves. With the advancement of machine vision and machine learning, significant progress has been made recently in recognizing plant characteristics [6–8]. The performance of these methods depends on two factors: a) the accuracy of these methods depends on the extraction and selection of measurable (often visual) features; and b) noise in the images that is largely unavoidable under real farm conditions. Several types of technologies have been used so far to identify products, including electrical resistance spectroscopy [9], reflectance spectroscopy [10], Fourier infrared spectroscopy [11] and fluorescence spectroscopy [12]. Among the most promising techniques for non-destructive monitoring of plant leaves properties, we can find many recent advances in hyperspectral imaging (HSI). HSI integrates both spectroscopic and imaging techniques into a system capable of computing a spatial map of the spectral content variations [13–15]. For example, Serranti et al. [16] monitored fertilizer production process using HSI. They studied different mixtures of urban organic waste to find correlations between parameters such as pH, electrical conductivity, soluble nitrogen and soluble carbon. The results revealed a correlation coefficient between 0.85 and 0.96 for all parameters, indicating the ability of HSI for non-destructive monitoring of waste-derived fertilizer production. More recently, Zhou et al. [17] predicted the germination of sugar beet seeds using HSI with an accuracy of 89% over the test set. Several other works can be found in the literature concerning the estimation of the chemical properties of the plants using spectroscopy, and more specifically HSI. As an example, Eshkabilov et al. [18] studied on the detection of the level of nutrients in lettuce. Partial least squares regression (PLSR) and principal component analysis (PCA) were used. They captured hyperspectral images of lettuce leaves using a hyperspectral camera at wavelength range of 400–1000 nm. The most effective wavelengths were found at 506–601 nm and 634–701 nm ranges. Nutrient content including soluble solid content, pH, nitrate, calcium, potassium and total chlorophyll, were predicted by both PLSR and PCA optimization algorithms. Results showed a determination coefficient (R 2 ) in the range of 0.784–0.987 in predicting nutrients content. Closely related to our problem, Chen et al. [19] predicted nitrogen content in apple-trees using HSI. Original wavelengths were preprocessed by different smoothing filters, including multiplicative scatter correction (MSC), Savitzky-Golay (SG) smoothing, normalization by the mean (NME), standard normal transformation (SNV), and first-order derivative (FD) or second-order derivative (SD). Results showed that SNV-FD had the best performance. Then, features were extracted by the successive projection algorithm (SPA), random frog (Rfrog), and partial least squares (PLS). According to the results, Rfrog-Extreme Learning Machine (ELM) had the best accuracy, with an R 2 of 0.843, RMSE 2.461 g kg 1 , and relative percent deviation RPD of 2.508. Other types of chemical elements have also been analyzed using HSI technologies. Wang et al. [20] estimated Sodium (K) and Potassium (P) content in tea leaves using HSI and chemometrics. The key spectrum wavelengths were selected by SPA algorithm, and regression coefficients (RC) of PLSR model. Successive projections algorithm-multiple linear regression (SPA-MLR) achieved a good performance with correlation coefficients of 0.9423 for P, and 0.9168 for K. Sun et al. [21] accomplished a study on the estimation of water content in corn leaves by hyperspectral images. Again related to nitrogen content, Liu et al. [22] used aerial hyperspectral data to model nitrogen in potato at three growth stages and two growing seasons. The results revealed that short-wave infrared (SWIR) wavelengths are important for modelling both crop variables and either cultivar or season-specific models, but showing a systematic prediction bias. Amoah et al. [23] treated freezing injury treatment in tea leaves with nitrogen and assessed the effect of nitrogen using HSI, analyzed with PLSR, Principal Component Regression, and Linear Models. They concluded that the wavelength at which absorption bands occur can influence the model performance significantly. As can be inferred from previous introduction, hyperspectral images can be used for reliable diagnosis of the nutritional status of agricultural products, obtaining accurate and powerful tools in farm managing. In this context, the present study aims to predict excess nitrogen content in cucumber plants using HSI data from plant leaves, in a non-destructive way. First, the most effective wavelengths for the case of study are extracted using a machine learning method. Then, the information in the selected wavelengths is analyzed with three regression methods (a hybrid artificial neural networks and the particle swarm optimization (ANN-PSO), partial least squares regression (PLSR), and a deep learning Table 1 Statistical analysis of ANOVA to evaluate the significance difference between spectral data of categories. Sum of Squares Degrees of freedom Mean Square F-test Significance Between Groups 2.015E11 3 6.715E10 723.600 .000* Within Groups 3.666E10 395 9.280E7 Total 2.381E11 398 Table 2 Duncan test for evaluating the significance difference between spectral data categories. Pot n Control pot Excess N (30%) Excess N (60%) Excess N (90%) Excess N (90%) 100 4.9128E3 Excess N (30%) 100 5.1189E4 Excess N (60%) 100 5.4648E4 Control pot 100 6.2398E4 Significance 1.000 1.000 1.000 1.000 Table 3 Structure of the hidden layers of the ANN-SA to select the most effective spectral wavelengths. radbas: radial basis function. trainrp: resilient backpropagation algorithm. learnh: Hebb learning function. Number of hidden layers Number of neurons per layer Transfer function Backpropagation training function Back-propagation weight learning/ bias 212&17 radbas trainrp learnh Table 4 Structure of the convolutional neural network (CNN) used to estimate nitrogen content in cucumber plant leaves. Input is a (327 1) vector of light absorbance values corresponding to spectral sample wavelengths. The total number of parameters of the network is 551,617. Layer type Convolution size Output shape (width features) Number of params. Convolution þReLu 7 1 321 32 256 Max pooling 160 32 – Convolution þReLu 5 32 156 64 10304 Max pooling 78 64 – Convolution þReLu 5 64 74 128 41088 Max pooling 37 128 – Convolution þReLu 3 128 35 256 98560 Max pooling 17 256 – Convolution þReLu 3 256 15 512 393728 Flatten 7680 – Dense 1 7681 S. Sabzi et al. Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404 2
method based on convolutional neural networks (CNN)) in order to detect potential nitrogen excessive levels as early as possible. 2. Materials and methods A global outline of the research procedure applied in the present study is depicted in Fig. S1. The process begins with data acquisition, which includes plant cultivation, application of different fertilizer contents, and HSI acquisition of cucumber plant leaves. Data is analyzed, producing either a joint prediction model or individual models for each treatment depending on their statistical significance differences. Then, the most effective wavelengths are extracted using a machine learning approach. Finally, three regression methods are applied and compared for the estimation of nitrogen (N) content in plant leaves: ANN-PSO, PLSR and CNN. 2.1. Data collection Cucumber seeds (Super Arshiya-F1 variety) were planted in 20 pots, as shown in Fig. S2a, to prepare samples with standard nitrogen and nitrogen excess contents. The fertilizer used was a compound of urea and ammonium, and it was applied with irrigation water at a standard concentration of 2 g/l. Whenever leaves were grown, approximately 3 months after planting, pots were categorized into four groups: pots with standard nitrogen content (0% N excess), and pots with applied nitrogen excess by 30%, 60% and 90%, respectively. First, 50 leaves were Fig. 1. Examples of cucumber plant leaves images, including visible range RGB (left) and both effective (optimal) (center) and not-effective (right) hyperspectral wavelengths. Rows indicate nitrogen treatment class: normal, 30%, 60%, and 90% nitrogen excess. S. Sabzi et al. Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404 3
collected from the first group (control pot) and were imaged by a hyperspectral camera. A total of 24 h after the application of nitrogen excess, 50 leaves from each of the three plant categories were picked and imaged, resulting 100 plant leaves for each N content plant category (totaling 300 plant leaves images). Hyperspectral images were also captured 48 h and 72 h after the over-application of N. Since the ultimate goal of prediction was to early recognize nitrogen-rich leaves, the data related to the first 24 h after nitrogen application were analyzed first. In the event that results were not acceptable (accurate enough), the remainder plant leaves data would be entered into system (48 h and 72 h). 2.2. Extraction of spectral information from plant leaves In order to extract spectral information from each leaf, a hyperspectral camera (Physics Noor Co., Fanavaran, Kashan, Iran) in the visible and near-infrared (Vis/NIR) range (400–1000 nm) was used. The HSI camera (shown in Fig. S2b) was placed inside an illumination chamber (Fig. S2c) equipped with two tungsten halogen lamps SLI-CAL (StellarNet, Tampa, Florida, USA) to prevent disturbing ambient light. The samples were located at a horizontal distance of 1 m from the camera and were illuminated by both lamps. Also, a conventional laptop (Intel Corei5, 2430 M at 2.40 GHz, 4 GB of RAM, Windows 10) was used to store and process the data. The HSI camera captured a total of 327 images from each plant leaf, each of them corresponding to an specific wavelength inside 400–1000 nm range. Thus, these images contain the reflectance information of the samples at each point. Rossel [24] observed that using absorption spectra is more adequate than reflection data, since the former presents a linear relationship with the molecular concentration of the samples. Consequently, images were converted to absorption information using the following equation: Bx;y¼log 1 =Aðx;yÞ(1) where Ais input image (reflectance) data, Bthe resulting output image (absorption) data, and (x,y) are all pixels inside a two-dimensional image. 2.3. Extraction of nitrogen (N) content using laboratory analysis Besides hyperspectral data, the actual nitrogen (N) content of plant leaves was also measured using a standard chemical procedure [25]. First, leaves were dried and pulverized. To determine total nitrogen, a Gerhardt Vap20 digester (Gerhardt GmbH &Co., K€ onigswinter, Germany) was used. After the digestion step, refrigerant was used to distill the sample and finally titrated. After the titration step, the total nitrogen content was obtained by calculating the consumption of acid (c.f. Fig. S3). For this purpose, equation (2) is used: Ntotal ¼ðvs vbÞ md NH2SO40:014 meq N 100 (2) where vs is the consumed volume of the sample, vb is the consumed volume of the control treatment, NH2SO4is the normality of sulphuric acid at 0.014 meq, and md is the dry weight of the sample. Measured nitrogen values are used as the ground-truth for the three proposed regression methods. 2.4. Statistical analysis of the spectral data As early presented in the schematic Fig. S1, before developing a regression model for the prediction of nitrogen (N) content in cucumber plant leaf images, the entire data should be statistically examined to observe the differences between the treatments. If there is a statistically (a) (b) (c) Fig. 2. Scatter plot of regression analysis for mean estimated and measured nitrogen content ðmg l1Þ, in the treatment of nitrogen excess by 30%, after 100 iterations (test set): (a) ANN-PSO, (b) PLSR, and (c) CNN. S. Sabzi et al. Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404 4
significant difference between the data, each category should be modeled separately. Two statistical test were performed on the extracted spectral images: an ANOVA test to analyze the differences among all the categories, and a Duncan test to analyze the differences between each pair of treatments. The results of the ANOVA test are shown in Table 1, and the results of Duncan test in Table 2. The tests were run with the help of SPSS software (IBM, New York, USA). According to Tables 1 and 2, the differences between all treatments are statistically significant. This means that we can find differences between the HSI images obtained after the first day of over-dose of nitrogen fertilizer, allowing an early detection of this potential problem. This also supports the idea of generating a separate regression model for each plant category (30%, 60% and 90% nitrogen excess), as described in the following sections. 2.5. Selection of the most effective (optimal) wavelengths for nondestructive estimation of nitrogen The ultimate goal of the prediction algorithm is to develop a portable predicting device for nitrogen content in plants. Given that the cost and (a) (b) Fig. 3. Boxplots of the five criteria for evaluating the performance of ANN-PSO (top row), PLSR (middle row) and CNN (bottom row) regression methods for estimating nitrogen content in 30% nitrogen excess treatment in cucumber plant, after 100 iterations (test set): (a) Error criteria (MSE, RMSE and MAE), (b) Regression (R) and determination (R 2 ) coefficients. S. Sabzi et al. Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404 5
processing time of portable devices are limiting factors, it is therefore desirable that the number of wavelengths involved in the prediction phase be as low as possible. Therefore, selection of the most effective (discriminant, optimal) spectral wavelengths is important. In this study, a hybrid artificial neural network and simulated annealing (ANN-SA) algorithm was used to select these effective spectral wavelengths. The SA algorithm is a meta-heuristic algorithm developed by Van Laarhoven and Aarts [26], that solves optimization problems in large input search spaces. The gradual annealing technique is used by metallurgists to achieve a state in which the solid is well organized and its energy is minimized (stable alloy). The aim is to maximize the size of the crystals in the solid state of material. This technique involves placing the material at a high temperature and then gradually lowering its temperature. The founders of this algorithm proposed a method based on gradual and slow annealing technique to solve complex optimization problems, which used computer-based simulation to find the global minimum answer, avoiding being trapped in local minima. In the annealing-based method, each point sin the search space is similar to a state of a physical system, and the function EðsÞto be minimized is similar to the internal energy of the system in that state. The goal is to transfer the system from the desired initial state to the state in which the system has least energy possible [27]. In the hybrid ANN-SA approach, the SA method works as a metaheuristic algorithm controlling the different executions of the ANN, as presented in Fig. S4. The ANN is a regression neural network which takes as input a tuple of wavelength values taken from the pixels of the (a) (c) (b) Fig. 4. Measured (true) versus estimated (mean) nitrogen content ðmg l1Þin 30% treatment in 100 cucumber plants after 100 iterations (test set). (a) ANN-PSO, (b) PLSR, and (c) CNN. S. Sabzi et al. Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404 6
hyperspectral images of cucumber leaves, and the expected output is the corresponding nitrogen (N) content values measured by the Kjeldahl method (gold standard), as shown in Fig. S4a. The dataset is decomposed into 70% training, 15% test and 15% validation samples, being all them disjoint sets. The ANN performs a complete training/testing process, obtaining the mean squared error (MSE) over the test set. Resulting accuracy depends on the wavelengths that are used in the input data. For example, if we select wavelengths (600, 800, 1000 nm), this means that the input of the ANN is a tuple of 3 wavelength absorbance ðBÞvalues, corresponding to pixels inside HSI images of plant leaves at the given wavelength values. Obviously, background pixels (not belonging to plant leaves) are removed from this process. The structure of the hidden layers of the multilayer (MLP) ANN is given in Table 3. The selection of the most effective wavelengths is done by the SA algorithm. First, it performs an initial random selection of 3 HSI image absorption wavelength values, and applies the ANN with them. The objective function to minimize is the MSE produced by the ANN, which is computed on the test set. If convergence is not reached, the energy of the system is reduced, and a different selection of wavelengths is done, evolving the current selection according to the current energy of the system. Initially, the variations are larger, and as the system cools down changes get smaller. Then, the ANN is applied again on the new selection of winning wavelengths, and the process is repeated. Finally, the set of wavelengths which produced the least MSE is selected as the optimal set of most effective (discriminant) wavelengths. This process was done in MatLab software (MathWorks, Natick, Massachusetts, USA). More details of the optimization algorithm can be also found in Ref. [27]. 2.6. Non-destructive estimation of nitrogen content in cucumber plant leaves After selecting the most effective wavelengths data with the help of abovementioned ANN-SA method, the next step is to estimate nitrogen (N) content in plant leaves using a regression estimation algorithm. For this purpose, three methods have been implemented and compared next: a hybrid artificial neural network and the particle swarm optimization algorithm (ANN-PSO); partial least squares regression (PLSR); and a convolutional neural network (CNN). These methods are described in the following subsections. 2.6.1. Nitrogen content estimation by an ANN-PSO PSO is a group-search algorithm that models the social behavior in flocks of birds [28]. The concept of particle refers to a certain solution of the optimization problem. Initially, these particles are randomly located in the solution space. During the execution of the algorithm, particles evolve towards the optimal solution. For doing so, each particle considers its own information and the movement of the neighboring particles. As a result, the swarm of particles tends to move near the best solutions of the problem, according to an objective function to be either maximized or minimized. In our case, the purpose of the hybrid ANN-PSO approach is to adjust the parameters of the ANN used to estimate nitrogen content in plants. Thus, each particle is a tuple that contains the following parameters: number of hidden layers; number of neurons per hidden layer; transfer function in each layer; back-propagation function; and weight/bias learning function. The number of hidden layers can be selected from 1 to 3, and the maximum number of neurons per hidden layer has been set to 25. The transfer function is selected among 13 different transfer functions available in the neural network toolbox in MatLab; similarly, the backpropagation method is selected among the 19 different functions available, and the weight/bias function among the 15 available methods. So, each particle defines the structure of an ANN, whose input is the tuple of spectral image values at the optimal wavelengths, the output is the estimation of nitrogen content, and the objective function is the MSE, as measured over the test set. The procedure is similar to the algorithm described for the ANN-SA algorithm. In this way, PSO acts as a metaheuristic algorithm that controls the execution of the ANN for different combinations of the parameters. Fig. S5 presents a diagram of the main steps of the algorithm. For each combination, or particle, the ANN is trained on the train set and tested on the test set. The process begins with a random set of particles, which are evaluated by the ANN; particles move towards the optimal values, until either convergence or a certain number of iterations is reached. Finally, the combination that produced the least MSE value is selected as the optimal configuration of the ANN for the estimation of nitrogen content [29]. A total of 100 replications were executed to evaluate the reliability of the network. Among a total of 100 input samples, 60% were uniform randomly used as training data, 10% as validation data and the remainder 30% as test data, being all them disjoint sets. 2.6.2. Nitrogen content estimation by linear PLSR Partial least squares regression (PLSR) method is often called component-based structural equation modeling. It is a linear statistical method proposed by Geladi and Kowalski [30]. Contrary to other methods, such as principal components analysis (PCA), that search for hyperplanes of maximum variance between the output and input variables, PLSR projects the output and input variables into a new space, and then finds a linear regression method in the projected space. PLSR is a non-parametric method, it is robust with respect to the sample size, and does not require any data normalization [24]. Although it was originally applied in econometrics, it has been frequently used also in chemometrics, due to its positive properties in this field. For example, this method is very useful when the effects of several Fig. 5. Scatter plot of regression analysis for mean estimated and measured nitrogen content ðmg l1Þ, in the treatment of nitrogen excess by 60%, after 100 iterations (test set): (a) ANN-PSO, (b) PLSR, and (c) CNN. S. Sabzi et al. Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404 7
input variables on one or more output variables have to be analyzed. PLSR method can fit the effects of the input, or independent variables, on the output, or dependent variable, as a regression or structural model. If the goal is exploratory predicting or modeling, the application of PLS method is recommended because it does not require any assumptions. It can be applied to a small number of samples and the results are stable against missing information. Technically, the main difference between the PLSR and other regression methods is that the independent variables are placed in several more general factors, so that these factors explain the most of changes in the dependent variables. Further information about PLS regression method can be found in Ref. [31]. For the application of PLSR method to our problem in hand, ParLeS chemometric software was used [24]. While ANN methods (ANN-PSO and CNN) divide the dataset into train/test/validation disjoint subsets, in the case of PLSR only the train and test sets are needed. For consistency in the comparison with the MSE RMSE MAE 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 RR2 0.4 0.5 0.6 0.7 0.8 0.9 1 MSE RMSE MAE 0 0.005 0.01 0.015 0.02 0.025 RR2 0.9 0.92 0.94 0.96 0.98 MSE RMSE MAE 0 0.01 (a) 0.02 0.03 0.04 RR2 0.8 0.85 0.9 0.95 1 (b) Fig. 6. Boxplots of the five criteria used for evaluating the performance of ANN-PSO (top row), PLSR (middle row) and CNN (bottom row) regression methods for estimating nitrogen content in 60% nitrogen excess treatment, after 100 iterations (test set): (a) Error criteria (MSE, RMSE and MAE), (b) Regression (R) and determination (R 2 ) coefficients. S. Sabzi et al. Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404 8
remainder methods, the same partitions were used for all three regressors, including 70% training set and 30% test set in PLSR, being again disjoint sets. 2.6.3. Nitrogen content estimation by a CNN Third proposed regression system for the estimation of nitrogen content in cucumber leaves is based on recent advances on deep learning (DL), and more specifically on convolutional neural networks (CNN) [32], which can still be considered as a part of a more general Machine Learning framework and thus as ANN architectures. As is well-known, the structure of CNNs is inspired by the visual cortex of the human brain. In 1962, Nobel prize winners Hubel and Wiesel, conducted an interesting experiment, observing that edges in different shapes stimulated certain cells in the visual cortex of the brain [33]. CNN network architecture is based in the behavior of the visual cortex of the brain. In fact, on a CNN there are several layers, each specific to identify certain brain items. They are also considered as a type of deep learning algorithm, in the sense that they use neural networks with a large number of hidden layers. These methods require less pre-processing and feature extraction than other classification and regression algorithms, since those steps are done as a part of the network itself. In our case, the input to the CNN is a 1-dimensional signal given by the 327 wavelength values corresponding to each pixel of hyperspectral plant leaf images. Observe that, in this method, the regressor is not limited to the 3 most effective wavelengths, as in ANN-PSO and PLSR. A typical structure of CNN consists of different layers of convolutions, with ReLu (rectified linear) non-linear activation function, and max pooling, finishing with a dense layer, as depicted in Fig. S6. The output is a single 0 102030405060708090100 Cucumber sample # 4 4.05 4.1 4.15 4.2 4.25 4.3 Cucumber Nitrogen content true and mean estimated Cucumber Nitrogen content (100 Cucumber database, test set) true estimated (mean) 0 102030405060708090100 Cucumber sample # 4 4.05 4.1 4.15 4.2 4.25 4.3 4.35 Cucumber Nitrogen content true and mean estimated Cucumber Nitrogen content (100 Cucumber database, test set) true estimated (mean) 0 102030405060708090100 Cucumber sample # 4 4.05 4.1 4.15 4.2 4.25 4.3 Cucumber Nitrogen content true and mean estimated Cucumber Nitrogen content (100 Cucumber database, test set) true estimated (mean) (a) (b) (c) Fig. 7. Measured (true) versus estimated (mean) nitrogen content ðmg l1Þin 60% treatment in 100 cucumber plants after 100 iterations (test set): (a) ANN-PSO, (b) PLSR, and (c) CNN. S. Sabzi et al. Chemometrics and Intelligent Laboratory Systems 217 (2021) 104404 9