## 2 Materials and Methods
### Hyperspectral Data Transformations
#### 2.5.2 Gabor-like Feature Extraction for Spectral Data  
In addition to wavelet transformation, to extract meaningful features from the spectral data, we applied a Gabor filtering technique that utilizes convolution with a set of custom-designed 1D filters. Gabor-like filters are particularly effective for capturing both frequency and spatial (or temporal) information by combining a Gaussian envelope with a sinusoidal wave, making them well-suited for analysing signals with localized frequency characteristics. In the general form, a complex 1D Gabor filter can be represented as follows:  
\[g(x_{i}\ ;f,\sigma)=\exp\left(-\frac{x_{i}^{2}}{2\sigma^{2}}\right)\cdot\exp(i \cdot 2\pi fx_{i}), \tag{2}\]  
where \(\sigma\) controls the spread of the Gaussian envelope, and \(f\) denotes the frequency of the oscillatory component. The complex exponential can be expanded using [PERSON]'s formula:  
\[g(x_{i};f,\sigma)=\exp\left(-\frac{x_{i}^{2}}{2\sigma^{2}}\right)\cdot\left[ \cos(2\pi fx_{i})+i\cdot\sin(2\pi fx_{i})\right], \tag{3}\]  
For simplicity, we utilized only the real part of the 1D Gabor filter, given by:  
\[g(x_{i};f,\sigma)=\exp\left(-\frac{x_{i}^{2}}{2\sigma^{2}}\right)\cdot\cos(2 \pi fx_{i}), \tag{4}\]  
The real component effectively captures even-symmetric features in the spectral data, such as edges and peaks, which are often of primary interest when analysing spectral signals. The feature extraction process involved convolving the spectral data \(s(x_{i})\) with Gabor-like kernels at various frequencies and scales, defined by \(f\) and \(\sigma\). The 1D Gabor kernel used in the convolution is defined as:  
\[g(x_{i},f,\sigma)=\frac{\exp\left(-\frac{x_{i}^{2}}{2\sigma^{2}}\right)\cdot \cos(2\pi fx_{i})}{\sum_{j=1}^{L}\left|g(x_{j};f,\sigma)\right|}, \tag{5}\]  
where \(x_{i}\) represents the \(i\) position of the spectral data, \(f\) is the frequency, and \(\sigma\) controls the width of the Gaussian envelope, and \(L\) is the kernel length. The summation over \(j\) is computed once for the entire kernel to normalize it prior to convolution with the spectral data. The normalized kernel is then convolved with the spectral data by sliding it across the entire signal. At each position \(x_{i}\), the kernel is multiplied element-wise with the corresponding section of the spectral data, and the products are summed to produce the filtered signal. This convolution captures local frequency information in the spectral data, highlighting features such as peaks, and periodic structures. We selected a range of frequencies \(f\) and Gaussian widths (\(\sigma\)) to capture features at multiple scales and frequency resolutions. The filtered spectrum, \(S_{f}(x_{i};f,\sigma)\), was computed by convolving the input spectrum \(s(x_{i})\) with the Gabor kernel:  
\[S_{f}(x_{i};f,\sigma)=s(x_{i})*g(x_{i};f,\sigma). \tag{6}\]  
In this notation, \(*\) represents the discrete convolution operation, which slides the Gabor kernel across the entire spectrum \(s(x_{i})\). From the filtered spectrum, a set of statistical features was extracted. The feature is the mean absolute value of the filtered signal, which can be described as:  
\[Feature(f,\sigma)=\frac{1}{N}\sum_{i=1}^{N}\Bigl{|}S_{f}(x_{i};f,\sigma)\Bigr{|}. \tag{7}\]  
where \(N\) is the length of the spectrum. This feature reflects the overall intensity of the spectral signal at a given frequency and scale, summarizing the local frequency content of the data. We used 12 distinct frequencies (0.1, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, and 2.75) and 8 Gaussian widths (\(\sigma\)) ranging from 1 to 8 to create a comprehensive set of features. For each combination of frequency and sigma, a unique feature was computed, resulting in a feature vector of length 96 for each spectrum. This feature extraction method was applied to all spectral samples in the dataset, and the extracted features were subsequently used as input to machine learning models for classification and analysis.