## 2 Materials and Methodology
### Local Feature Detection  
The third step of our proposed approach is to find local features in the spectral images, which are detected in both breathing phases, and estimate the 2D displacement to assess the feature location. In earlier work, we demonstrated the feasibility of MSI for the improved detection of skin features after a simulated 2D rigid image shift [25]. We have analyzed MS images for 30 human subjects at eight different wavelengths, achieving high accuracy in detecting the simulated 2D applied displacement with on-body features (with an error lower than 40 \(\upmu\)m). In addition, we have shown the feasibility of skin feature detection using handcrafted local feature algorithms, such as Speed Up Robust Feature, (SURF) [25; 33] and Maximal Stable Extremal Region (MSER) [35], as possible methods which are capable of detecting veins, moles and skin patterns. We thus apply the same concept for the processing of the HS images, detection of the skin features and the matching of those features to estimate the 2D-Euclidean distance after one-to-one-matching. For each subject, we consider a pair of HS data cubes obtained in the different phases of breathing. To detect the desired features, it is crucial to extract informative regions or points on the skin, which should be invariant to geometric transformations and insensitive to degradation effects, such as illumination changes and intensity changes produced by noise. We first detect skin features by applying SURF as a feature detection algorithm [33; 36] to obtain the best performance. We then adapt the algorithm for this study where real subject motion is included, as described in the experimental protocol (Section 2.2). The SURF algorithm exploits integral images to build the scale space. This is an approximation of the Gaussian scale space that reduces the computation time. Regarding the descriptor, it is formed only by 64 dimensions, and the orientation is estimated using the Haar wavelet [37]. As an alternative to handcrafted local descriptors, convolutional descriptors extracted from convolutional neural networks (CNNs) have recently shown promising results [38; 39]. A new architecture has been proposed that learns and extracts multi-scale, local descriptors, called deep local features (DELF) [39]. Compared to conventional handcrafted local feature detection algorithms, the DELF framework offers a more accurate feature matching and geometric verification through an attention-based mechanism that learns which features are most discriminative. The DELF module is designed for image retrieval and consists of the following four steps: dense localized feature extraction, key point selection, dimensionality reduction and image retrieval. To evaluate this method for our purpose, we execute it in parallel to the conventional SURF approach. The learned feature extraction process can be divided into two steps: first, dense features are generated from images with a fully convolutional network (ResNet-50), which is initially trained for the classification of ImageNet [40]. Then, the obtained feature maps are regarded as a dense grid of local descriptors. The features are localized based on their receptive fields, which can be computed by considering the configuration of convolutional and pooling layers of the fully convolutional network (FCN). The pixel coordinates of the center of the receptive field are used as the feature location. Second, an attention score function is trained to assess the relevance of the extracted features. The algorithm handles different image scales by constructing an image pyramid and applying an FCN to each level, meaning that is possible to obtain features that describe an image region at different scales. As in the original approach, we scale our images with the following coefficients: 0.25, 0.3536, 0.5, 0.7071, 1.0, 1.4142, 2.0. In the dimensionality-reduction step, the feature dimension is reduced by PCA. The features produced are vectors of length 1024.