*2.3. Processing the Skin HSI*

HSI enables the collection of signals from samples, as well as the environment, instruments, and other non-sample factors. To eliminate the signals from the non-sample factors, all HSI data were input into the reflectance calibration procedure. Briefly, the raw data were calibrated with black and white correction. The white balanced image (*W*) was obtained by collecting the reflectance value from the Teflon white surface, while the dark image (*D*) was acquired by turning off the illumination source and collecting the hyperspectral data when the lens was completely covered with its cap. The calibration image (*I*) was calculated using the following equation:

$$I = \frac{I\_0 - D}{W - D} \times 100$$

where *I* represents the corrected reflectance hyperspectral image in a unit of relative reflectance (%); *<sup>I</sup>***<sup>0</sup>** represents the raw hyperspectral image; *<sup>D</sup>* stands for the dark image (0% reflectance); and *W* is the white reference image (100% reflectance) [26].

Then, we used the Savitzky–Golay (SG) smoothing method to preprocess the images and eliminate the putative effects from the sampling environment and instruments [27]. We selected a region of interest (ROI) to represent each skin region with the ROI function of Environment in the Visualizing Images software (ENVI v5.3, Exelis Visual Information Solutions, Inc., Boulder, CO, USA) [5]. The size of an ROI was 200 pixels × 200 pixels. For each wavelength, the average spectrum of an ROI was calculated by averaging the spectra of all pixels. The reflectance values of all pixels were averaged at each wavelength variable to obtain an average value representative of each sample.
