# Hyperspectral Imaging for Detecting Plastic Debris on Shoreline Sands to Support Recycling
## 2 Materials and Methods
### Applied HSI Procedure  
Starting from the acquired HS images representing the known particles, average spectra were extracted by sampling specific Regions of Interest (ROIs). The data were pre-processed to attenuate any noise due to scattering and/or other physical phenomena, and then principal component analysis (PCA) was performed to assess data variability and remove any outliers [37; 38]. PCA is a technique used in multivariate statistics to simplify the analysis of complex data. It is often the initial step when working with multivariate data. PCA serves as a powerful tool for exploratory data analysis, enabling the evaluation of the entire matrix of spectral data to describe the structure of the samples and variables involved, as well as to examine potential correlations between them. The purpose of PCA is to reduce the number of original variables to a smaller set of principal components (PCs), which are linear combinations of the original variables [39]. These PCs are organized so that the first component captures the maximum variance in the data, followed by additional components that capture progressively smaller portions of the remaining variance. PCA accounts for both significant variations in the data and random measurement errors. The PCs explain the variance in cumulative percentages, with the  
Figure 4: The HSI acquisition system equipped with the NIR Spectral CameraTM embedding an ImSpector N17 ETM (SPECIM Ltd., Oulu, Finland). first PCs capturing most of the variance and later components explaining smaller variances often associated with noise or random errors. The applied pre-processing methods were standard normal variate (SNV), Savitzky-Golay (S-G) smoothing, S-G derivative, and mean center (MC). SNV is generally used to reduce the effects of scattering and/or the influence of different particle sizes analyzed in the spectra [40; 41]. S-G smoothing enhances the signal-to-noise ratio by averaging adjacent data points to filter out high-frequency noise [42]. While derivative methods are generally used to improve signal resolution, separate overlapping peak contributions in spectral data, highlight small differences in nearly identical signal structures, and remove baseline offsets. The simplest approach for calculating derivatives is the finite difference method. In this technique, the first derivative is approximated by taking the difference between two consecutive spectral measurement points. The second derivative is subsequently estimated by determining the difference between two adjacent points on the first-order derivative spectrum. Finally, MC is a technique that highlights variable differences by centering data around the mean without altering the variance. After that, the Partial Least Squares Discriminant Analysis (PLS-DA) method was adopted to be applied to the HS images representing the collected materials (i.e., plastic, other materials or sand) on the three different sand samples. PLS-DA classification assigns the most probable category in the training set to each sample in the validation set [43; 44]. In more detail, three different PLS-DA classification models were built:  
* _Sand/plastic/other materials_: This model recognizes plastic samples, other sample types (i.e., natural materials and pollutants such as paper, glass, and aluminum), and sand. It was applied in the _first experimental setup_. * _Sand/plastic_: This model recognizes plastic samples from sand, regardless of the type of sand. It was applied in the _second experimental setup_. * _Polymer type_: This model classifies the type of polymer constituting the plastic particles after the background removal of the HS images (i.e., sand). It was applied both in the _first and the second experimental setups_. Classifier performances were assessed through the confusion matrix and two statistical parameters evaluated during the calibration and cross-validation phases: sensitivity and specificity [45].