## 2 Materials and Methods
### Spectra Collection and Analysis
The latter location, above the zygomatic arch and anterior to the tragus, corresponds to a region commonly used in transcranial Doppler studies, benefiting from a thinner cranial bone structure. The contact probe was aligned parallel to the zygomatic arch. From each cranial site, 20 spectra were collected per subject (for a total of 40 spectra), with a total acquisition time of approximately 40 s per individual. The extracranial sites were located on the dorsal and ventral portions of the arm, as determined by the motor point of the biceps and triceps muscles. The muscle was kept relaxed during the spectral data collection, with the segment fully supported and the limb held in a fixed position (elbow angle of 90\({}^{\circ}\)). In total, 50 spectra were collected from each extracranial site (100 spectra per patient), in about 100 s per subject. Each subject contributed 50 spectra per extracranial site and 20 spectra per cranial site, resulting in 650 and 260 spectra, respectively, for each group. Chemometric analyses were performed exclusively within the SWIR wavelength range of 1000 to 2500 nm (each spectrum contains 1501 wavelengths in the 1000-2500 nm range), excluding the visible range, for several key reasons. Primarily, the visible region (400-1000 nm) is highly susceptible to variability caused by skin pigmentation, hemoglobin concentration, and other superficial chromophores, which can introduce significant inter-subject noise and reduce the robustness and generalizability of the models. The approach starts with a specific set of preprocessing techniques designed to eliminate physical phenomena and improve multivariate analysis [17]. The preprocessing workflow included the application of Extended Multiplicative Scatter Correction (EMSC), class-based Generalized Least Squares Weighting (GLS-W) with \(\alpha\) = 0.002 to enhance spectral filtering, followed by mean centering (MC) algorithms. Principal Component Analysis (PCA) was then applied to the reflectance spectra to reduce data dimensionality by extracting orthogonal components formed from linear combinations of the original variables, effectively capturing the underlying variance structure [18]. The number of principal components (PCs) retained was determined by evaluating the eigenvalues plot, while potential outliers were detected and excluded on the basis of [PERSON]'s T2 versus Q residuals analysis. A total of four separate PCAs were conducted on the primary dataset, each corresponding to a pairwise comparison of measurements obtained from one of four anatomical regions (biceps, triceps, brainstem, and cortical regions):  
* MS biceps (\(n\) = 650 spectra) vs. Normal biceps (\(n\) = 650 spectra);
* MS triceps (\(n\) = 650 spectra) vs. Normal triceps (\(n\) = 650 spectra);
* MS brainstem (\(n\) = 260 spectra) vs. Normal brainstem (\(n\) = 260 spectra);
* MS cortical (\(n\) = 260 spectra) vs. Normal cortical (\(n\) = 260 spectra). We applied Partial Least Squares Discriminant Analysis (PLS-DA) to classify and predict whether participants belonged to the MS or control group, based on reflectance spectra collected from both cranial and extracranial anatomical sites. The calibration and validation sets were generated using the Kennard-Stone (K-S) algorithm [19]. Model cross-validation and the selection of the optimal number of latent variables (LVs) were carried out using the Venetian Blinds (VBs) method. To evaluate the performance of the classification models, metrics such as sensitivity, specificity, error rate, precision, and overall accuracy were calculated from the confusion matrix [20]. Variable Importance in Projection (VIP) scores were computed for each classification model to assess the relative contributions of individual wavelengths to class separation. VIP scores provide a way to evaluate the importance of each variable within the model's projection [21]. Variables with VIP values around or above 1 were considered influential, while those exceeding a threshold of 2 were highlighted as particularly important.