# E-Eye-Based Approach for Traceability and Annuality Compliance of Lentils
## Materials and Methods
### Asca  
ANOVA-simultaneous component analysis (ASCA) was employed as an exploratory method to perform an ANalysis Of Variance (ANOVA), which is generally used to confirm the significance of factors on a single variable in a complex multivariate system [30]. The ASCA can be schematically explained by two steps [31]:  
1. The mean-centered experimental data matrix \(\mathbf{X}\) (N \(\times\) V), where N is the number of analyzed samples and V is that of measured variables, is decomposed, following the ANOVA approach, into individual matrices accounting for the effects of each design term. For instance, if two factors are controlled in the design, here labeled as \(\alpha\) and \(\beta\), the ANOVA decomposition can be expressed as: \[\mathbf{X}=\mathbf{X}_{\alpha}+\mathbf{X}_{\beta}\ +\mathbf{X}_{\alpha\beta}\ +\mathbf{X}_{E}\] (1)  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Harvesting Year and Number of Retailers**} \\ \cline{2-6}
**Origin** & **2021** & **2020** & **2019** & **2018** & **2017** & **2016** \\ \hline L’Aquila (AQ) & 0 & 0 & 0 & 2 & 3 & 0 \\ Colfiorito (COL) & 0 & 0 & 0 & 2 & 3 & 0 \\ Castelluccio di Norcia (CDN) & 2 & 6 & 3 & 4 & 4 & 1 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Origin, harvesting year, and the number of retailers of the investigated lentil samples.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Harvesting Year and Number of Samples**} \\ \cline{2-6}
**Origin** & **2021** & **2020** & **2019** & **2018** & **2017** & **2016** \\ \hline L’Aquila (AQ) & 0 & 0 & 0 & 42 & 84 & 0 \\ Colfiorito (COL) & 0 & 0 & 0 & 40 & 60 & 0 \\ Castelluccio di Norcia (CDN) & 40 & 85 & 55 & 55 & 79 & 20 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The number of investigated samples divided according to the origin and the harvesting year.  
where \(\mathbf{X}_{a}\) and \(\mathbf{X}_{\beta}\) are the arrays accounting for the main effect of the factors, while \(\mathbf{X}_{a\beta}\) describes the binary interaction among them, and \(\mathbf{X}_{E}\) contains the residual variability, i.e., the portion of the experimental variance not approximated by the ANOVA model. Although for balanced designs this decomposition can be obtained from the simple \"differences of means\" procedure, a more general approach relies on expressing the ANOVA model as a linear regression problem, according to the following relation:  
\[\mathbf{X}=\mathbf{D}\mathbf{\theta}+\mathbf{X}_{E} \tag{2}\]  
where \(\mathbf{D}\) (N \(\times\) P) is the design matrix that encodes the levels of the factors and their interaction (s) and consists of P columns, while \(\mathbf{\theta}\) (P \(\times\) V) is the matrix of regression coefficients. The peculiarity of both matrices \(\mathbf{D}\) and \(\mathbf{\theta}\) is that they are block-partitioned so that an individual linear equation can be written for each design term as follows [32]:  
\[\mathbf{X}_{i}=\mathbf{D}_{i}\ \mathbf{\theta}_{i}=\mathbf{D}_{i}\ \left(\mathbf{D}_{i}^{T}\mathbf{D}_{i }\ \right)^{-1}\mathbf{D}_{i}^{T}\mathbf{X}\ \text{with}\ i=\alpha,\beta,\alpha\beta \tag{3}\]  
where it is apparent that each effect matrix is obtained by projecting the experimental data matrix onto the suitably coded design sub-matrix corresponding to the specific term.  
(2) The second step consists of the Principal Component Analysis, performed separately on each effect matrix, thus:  
\[\mathbf{X}_{i}=\mathbf{T}_{i}\ \mathbf{P}_{i}^{T}\ \text{with}\ i=\alpha,\beta,\alpha\beta \tag{4}\]  
where \(\mathbf{T}_{i}\) and \(\mathbf{P}_{i}\) are the scores and loadings matrices for each factor. The significance of the effects and related loadings was performed by using a permutation test and bootstrap procedure, respectively.