# E-Eye-Based Approach for Traceability and Annuality Compliance of Lentils
## 3 Results and Discussion
### SPORT Classification According to the Harvesting Year, the Origin, and the Edibility
#### 3.2.2 Classification of the Samples According to Their Harvesting Year  
A model to discriminate the samples according to their harvesting year was built and validated. In this case, the 560 samples were split into a training and a test set by means of the Duplex algorithm applied category-wise with a 70:30 splitting ratio. Accordingly, 383 samples (13 from 2016, 153 from 2017, 97 from 2018, 35 from 2019, 60 from 2020, and 25 from 2021) were included in the training set, while the remaining 177 (7 from 2016, 70 from 2017, 40 from 2018, 20 from 2019, 25 from 2020, and 15 from 2021) were left out to constitute the external test set. The training samples were then used to build the SPORT classification model, whose optimal complexity, estimated in cross-validation, resulted to be 11 and 3, for the mean-centered and autoscaled colorgram, respectively. The results are summarized in Table 4.  
While the results in the calibration phase (i.e., when the model is applied to the same samples used for calculating its parameters) were very good, with an overall accuracy higher than 96%, those in cross-validation and prediction (i.e., on the external test set) were significantly lower, though comparable with one another. Indeed, the overall accuracy on the test set was about 69% and the mean correct classification rate was slightly less than 71%. This was mainly due to the inaccuracy associated with samples harvested in 2018, 2020, and, to a lesser extent, 2016, whose correct classification rates were 40.0%, 48.0%, and 57.1%, respectively. On the other hand, the odd harvesting years were accurately predicted; in fact, the model properly classified 100% of samples grown in 2021 and 2019, and 78%  
\begin{table}
\begin{tabular}{l c c c c c c c c c} \hline \hline  & **LVs** & & & & **Sensitivity (\%)** & & **Specificity (\%)** & \\ \cline{2-10}  & **MC** & **AS** & **Accuracy\%** & **Mean CCR\%** & **AQ** & **COL** & **AQ** & **COL** & **CDN** \\ \hline Calibration & & & 96.7 & 96.3 & 94.3 & 97.1 & 97.4 & 99.3 & 97.5 & 98.1 \\ CV & \multirow{2}{*}{\(11\)} & \multirow{2}{*}{\(3\)} & 90.1 & 89.5 & 84.1 & 92.9 & 91.5 & 98.0 & 92.9 & 93.7 \\ Prediction & & & 87.5 & 88.0 & 86.8 & 90.0 & 87.0 & 93.8 & 94.2 & 92.6 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Results of the SPORT-LDA modeling for the discrimination of samples according to their geographical origin (Model I).  
of those from 2017. Inspection of the confusion matrix for the test set evidenced how the wrongly predicted 2016 samples were mostly classified as being from 2018 and only to a lesser extent as from 2017. On the other hand, the 2017 and 2018 samples were mostly confused with one another: 17.1% of the 2017 samples were predicted as 2018, while 42.5% of the 2018 samples were classified as 2017. Finally, the misclassified sample from 2020 was mostly predicted as 2018 and, to a lesser extent, as 2017. When trying to rationalize these results, it was found that, taking into account the climatological variables of the area, no direct and straightforward interpretation was possible for the area. Indeed, climatic information can only suggest that there was no actual heat stress. On the other hand, except for the year 2016, which was the wettest year, the crops were affected by water stress for all the sampled production years, with a peak in 2021 [42]; additionally, this phenomenon is known to affect plant composition [43]. One could then think that the less than completely satisfactory results observed on the test set may be related to the uneven distribution of samples among the geographical origins and years (with lentils of different origins being available only for two years, 2017 and 2018), or to the natural aging of the specimens, which could play a significant role in the data variability.