## 2 Materials and Methods
### Statistical Analysis  
An analysis of variance (ANOVA) was conducted using the data from e-nose and GC-MS to assess significant differences (p <0.05) among samples and least significant difference (LSD) post hoc test for pairwise comparisons (\(\alpha\) = 0.05) using XLSTAT v.2020.3.1 (Addinsoft, New York, NY, USA). Furthermore, a multivariate data analysis based on principal component analysis (PCA) was conducted using the volatile aromatic compounds' peak area and constructed with Matlab(r) R2020b to assess relationships among some of the variables and identify associations with the samples. Furthermore, the PCA was developed to assess groupings among the samples according to the roasting intensity level. The principal components (PC) one and two were selected based on them summing \(>\) 60% of  
Figure 1: Data extraction from e-nose outputs using a supervised customized code written in Matlab. Initial (**a**) and final (**b**) stable signal detection and automatic subdivision in ten equidistant sampling intervals to obtain ten averages. data variability, which is the cutoff point considered to test the significance of the PCA [52]. Factor loadings (FL) of the most representative variables of each PC were obtained. A total of 25 supervised ML classifiers available in Matlab(r) R2020b Classification Learner in the Statistics and Machine Learning Toolbox 12.0, which consist of decision trees (three algorithms), discriminant analysis (two algorithms), logistic regression (one algorithm), naive Bayes (two algorithms), support vector machine (SVM; six algorithms), k-nearest neighbor classifiers (KNN; six algorithms), and ensemble classifiers (five algorithms, were tested (data not shown). Along with this, 17 artificial neural network (ANN) algorithms [47; 53] were tested using a code written in Matlab(r) R2020b to assess all different training algorithms in a loop and find the most accurate models based on the correlation coefficient/accuracy and performance. For Model 1, the best results were obtained using pattern recognition ANN with the mean values of ten sections of the highest and stable segment of each sensor's curve as inputs to classify samples into i) low (3-5), ii) medium (6-9), and iii) high (10-13) intensity (Figure 2). For this model, the Bayesian regularization training algorithm resulted in the highest accuracy and no overfitting signs. Data division was random, with 70% of the samples used for training and 30% for testing using a means squared error (MSE) performance algorithm. This is a two-layer feedforward model with a tan-sigmoid function in the hidden layer and a Softmax function in the output layer. Statistical data reported for this model consists of accuracy (%), error (%), MSE values and receiver operating characteristics (ROC) curve. For Model 2, which was a regression model, only the 17 ANN supervised training algorithms [47; 53] were tested as other ML techniques do not allow multiple targets. This model consisted of using the mean values of ten sections of the highest and stable segment of each sensor's curve as inputs to predict 45 volatile aromatic compounds (Figure 2). The Levenberg-Marquardt training algorithm was selected as the best based on the highest correlation coefficient (R) and performance with no overfitting signs. Data were divided randomly as 70% for training, 15% for validation using an MSE performance algorithm, and 15% for testing. For both models, a neuron trimming test (3, 5, 7, and 10 neurons) was performed to select the models with no under- or overfitting signs, resulting in 10 the optimal number of neurons for the two models. This is a two-layer feedforward model with a tan-sigmoid function in the hidden layer and a linear transfer function in the output  
Figure 2: Diagram of the pattern recognition Model 1 (top) to classify samples into low-, medium-, and high-intensity, and regression Model 2 (bottom) to predict the peak area of 45 volatile aromatic compounds using the outputs from the electronic nose as inputs for both models.