Spices

Six different types of spices were chosen and purchased from the retail outlets. Table A5 in Appendix A provides the brand names of the spices evaluated in the study.

Most of the ground spices used in this study are fine powders, although the classic nutmeg is roughly milled powder. The red pepper comes as flakes, which splash easily when hit by laser shots. Therefore, we employed a sample holder when performing the measurements.

#### *2.2. Benchtop and Handheld LIBS Systems Setup*

The custom-built benchtop LIBS system is shown in Figure 1a and consists of a Nano SG 150-10 pulsed Nd:YAG laser (Litron Lasers, Bozeman, MT, USA). The laser had a pulse width of 4 ns; a pulse energy of 62 mJ was used in this study. The ablation laser's spot size was approximately 700 μm. Details on the optics used to direct the alignment and the ablation laser beams were described previously [57,58]. Emissions were detected by an AvaSpec-Mini-VIS-OEM spectrometer (Avantes, Apeldoorn, the Netherlands), which has a 350–600-nm spectral range with 0.33-nm resolution. Target samples were placed on a motorized XYZ stage. The stage height was adjusted so that the crosshairs of the two lasers assisting in sample positioning were visible at the surface of the samples. A digital delay pulse generator controlled the triggering of the ablation laser, motorized stage, and spectrometer. The delay between the ablation pulse and spectrometer data acquisition was 1.17 μs.

The Z-300 LIBS Analyzer (SciAps, Inc., Boston, MA, USA) is a commercially available handheld LIBS system. The laser, spectrometer, optics, argon gas cartridge, electronics, and control module were housed in a gun-shaped enclosure, as illustrated in Figure 1b. Measurements were performed when the sample window (3 cm by 3 cm) was covered with samples, followed by laser activation. The LIBS analyzer uses a pulsed laser, 5–6 mJ/pulse, and 1- to 2-ns pulse width. The laser spot size was 100 μm. The spectral range was approximately 190–950 nm. The settings for rastering location and repetition rate were controlled in the Profile Builder software (SciAps, Inc.) as needed.

All measurements were taken at 25 different locations across a 5 × 5 rastering array of four different specimens representing each individual food product. The measurements of cheeses were repeated at multiple time points (Figure 2). Each spot was ablated with a single laser shot. Accordingly, 100 spectra per food type per time point were analyzed for classification. LIBS measurements were performed using both benchtop and handheld systems for each type of food sample involved in the study.

**Figure 1.** Schematic diagram of LIBS system setup; (**a**) benchtop system and (**b**) handheld system.

**Figure 2.** Diagram illustrating the variety of food examples and the testing procedures employed in the presented experiments. Each food product was represented by multiple specimens, each of which was interrogated repeatedly by LIBS. Please note that only cheeses were sampled at multiple time intervals.

#### *2.3. Classification Procedures*

Raw spectra were filtered to eliminate low signal-to-noise instances due to faulty sample positioning or similar technical problems. Spectral normalization and a median filter were applied to reduce the effects of variations in emission intensity coming from plasma fluctuations. Subsequently, every spectral feature was used in multiple ANOVA models as a dependent variable in order to select the features associated with large effect sizes (η2) [59]. This was followed by the training of a regularized multinomial logistic regression elastic net model (ENET), which provides multivariate feature selection as well as classification (prediction) [60,61]. ENET combines LASSO and ridge regression techniques. Although the use of the ENET approach in LIBS data analysis has been reported before [62], despite its advantages, it is still a very uncommon method for this field, which

traditionally relies on well-established chemometric techniques such as PLS-DA [63–66]. Importantly, in the n p setting, it retains the sparse features of LASSO regression and the stability of ridge regression. Note that the number of selected features per food type could differ for each ENET model. The ENET prediction quality was evaluated using 10-fold cross-validation.
