**4. Discussion**

#### *4.1. Sample Preparation*

Solid specimens were successfully analyzed without any processing. Grinding samples into powder and pressing them into a pellet is a popular preparation method for solid foods [68,69]. For instance, Iqbal et al. [70] reported that samples were finely powdered and vacuum-dried at 370 K for 10 h. The sample was then compressed for 20 min at 30 T hydraulic pressure into pellets that were 3 mm thick and 1.3 cm in diameter. However, the preparation of pellets or tablets is an important limiting factor and cannot be easily used for in-situ analysis. In contrast, in our experiments, solid food samples like Alpine cheeses and coffee were tested without any preparation. The samples were immobilized for an easy location adjustment to ensure coverage of the whole sample surface by laser shots during the collection of complete elemental profiles.

Regarding measurement preparation for powders (spices), we utilized a custom sample holder to confine the samples. To overcome blowing off and scattering during laser-matter interaction, a layer of powdered material was applied to a double-sided piece of tape that covered and adhered to the bottom of the sample holder.

To prevent splashing and the formation of surface ripples caused by the shock wave of LIBS, as well as to achieve a lower limit of detection, better repeatability, and greater sensitivity when working with liquid food samples, the formation of a gel using commercial collagen is commonly performed, followed by drying in an air-assisted oven [50,71,72]. However, the dry gel emission signals cannot be simply subtracted, and additional chemometric spectral treatments are necessary. In our study, we employed a nitrocellulose paper-based sample-preparation approach that is highly compatible with liquid food samples owing to its porous structure, hydrophilic property, and minimal effect on the sample spectra. This approach has been successfully used by other researchers when utilizing

LIBS to measure the presence of metals in water or oil [73–76]. Moreover, this method is simpler and more efficient than the commonly used gel-formation technique [77]. The characteristic peaks of the nitrocellulose membrane do not interfere with the elemental profiles of foods and can be easily distinguished from the LIBS spectral matrix. This is the first report on the use of nitrocellulose membranes with LIBS for the classification of liquid food samples. Compared to the commonly used methods, our approach requires little or no sample preparation. It is simple, rapid, and cost-effective. Consequently, it is more practical and compatible with envisioned usage scenarios involving wholesalers, food inspectors, and customs officers that examine traded agricultural products. However, we must stress that the viability of using nitrocellulose paper may depend on the viscosity of the sample. We have not tested a sufficient range of liquid products to endorse this method unreservedly.

#### *4.2. Water Activity*

Most of the 16 types of cheese showed a small but statistically significant difference in water-activity values between the beginning of storage and 42 days later. However, despite these small changes in water activity, the classification of cheeses with LIBS systems remained stable and robust. Interestingly, one recent LIBS application was to measure the moisture content in cheese, using oxygen emission normalized by CN emission as the indicator [78]. Another study performed by Ayvaz et al. [79] investigated the potential of using LIBS with partial least squares regression to determine the chemical quality-control parameters for cheese samples, such as moisture, dry matter, salt, total ash, total protein, and pH. In general, our results indicate that small variations in aw are unlikely to be limiting factors for the use of LIBS in authentication, provided that the classification system is paired with an appropriate feature-selection strategy.

#### *4.3. Spectral Classification*

As anticipated, the LIBS spectra of all the analyzed food items exhibit remarkably similar spectral characteristics due to their comparable elemental composition. Clearly, the significant resemblance between these spectra makes their classification challenging, at least visually. For the differentiation and classification of food samples based on their LIBS spectra, it is therefore required to employ statistical machine-learning approaches.

We chose ENET as the primary tool for analyzing LIBS spectra due to its embedded feature selection capability, which is crucial given the usage of high-resolution spectra and a restricted number of food samples [60,61]. The ENET method classifies products using LIBS while identifying the most relevant chemical constituents that support the classification results. It is important to note, however, that features identified by ML algorithms may not always represent identifiable elemental peaks and may also come from "background". Matrix effects play a big role in how complex samples (like food) are measured by spectroscopy, and multivariate approaches may exploit the matrix effects when fingerprinting is performed [80].

To the best of our knowledge, relatively few published studies apply LIBS supported by machine-learning algorithms to discriminate/classify food samples based on their geographical origins or detection of adulteration. As for liquid food samples, three research reports have indicated that LIBS techniques paired with machine-learning approaches were employed with success for the discrimination/classification of several olive oils according to their acidity and geographical origin [54–56]. The olive oils tested in these studies are distinct in geographical origin and oil quality, i.e., extra virgin olive oil quality or typical commercial edible oils. Oil samples were placed in shallow, uncovered glass Petri plates such that a focused laser beam could reach their free surface to generate plasma. In these studies, classification accuracy rates of more than 90% were achieved, indicating the promise of this method. Considering the limitations and difficulties of working with aqueous samples, researchers developed a liquid-to-solid transformation of red wine using a dry collagen gel to increase the analytical performance. The LIBS

technique combined with neural networks provided a classification procedure for the quality control of red wines with PDO [50]. Furthermore, the identification of milk fraud, as well as the adulteration ratios, were reported using LIBS coupled with visual clustering following principal component analysis (PCA) [29].

Previous studies reported using the combination of LIBS and chemometric and/or machine-learning methods to identify coffee varieties [16] and detect adulteration of wheat, corn, and chickpeas in Arabica coffee [68]. The samples were ground and pressed into pellets for LIBS measurements. Zhang et al. tested multiple classifiers (including support vector machines, neural networks, and partial least squares (PLS) regression), some of which provided an accuracy of around 80% [16]. In our study, we achieved a higher classification accuracy by employing the elastic net approach. In the other study, all major and minor elemental composition differences present in the LIBS spectra of coffee were identified using traditional chemometric techniques such as PCA and PLS [81]. In contrast, in our study, the most critical spectral features associated with elemental differences were identified using the embedded feature selection ability of the ENET model. These findings confirmed that the combination of LIBS and the ENET classifier has the potential to be used as a routine technique for determining coffee bean authenticity and detecting adulteration. It is becoming increasingly important to employ chemometrics and machine-learning methods in food authentication systems [82–84]. The fact that ENET allows for simultaneous feature selection (providing insights into the elemental composition), as well as classification, demonstrated that it is a method exceptionally well-suited for this food analysis task.

As far as we know, this study is the first time that LIBS and chemometric methods were used together to classify 16 types of cheese. The results showed that this combination could be a useful and practical way to find food fraud in cheese products without a lot of sample preparation. Also, this is the first study to utilize LIBS assisted by machine-learning methods to efficiently classify powdered spices using direct analysis, i.e., without making pellets. Thus, our results demonstrated that LIBS, aided by suitable statistical methods, can be an effective technique for verifying the quality and safety of spices and similar powdered products.

It is astonishing that there are discernible spectral differences between closely related cheeses. One probable explanation is that artisanal Alpine-style cheeses are produced seasonally in particular regions, and the bacteria responsible for cheese ripening and maturation are distinctively associated with geographical location and changing seasons [85–89].

Even though our classification experiments show a remarkably high degree of accuracy, it is important to note a critical limitation. For each example presented, the tests assume a supervised learning environment with an exhaustively defined training set. In other words, we assume that all classes are known beforehand (including the classes describing possibly fraudulent or inferior products). This cannot be guaranteed in many instances, resulting in the so-called non-exhaustive learning problem, which necessitates simultaneous class discovery and classification [90]. We plan to address this issue in future research using our prior experience with non-exhaustive training sets, such as those emerging in food safety applications [91].
