## 2 Materials and Methods  
### Preclinical Study on Mice's Stomach  
In a previous paper, the reflectance of the stomach has been studied on mice infected by \(H\). _pylori_, a bacteria involved in the development of gastritis on mice and humans [23]. The mice were sacrificed at different time-point after infection and their stomach resected for multispectral analysis with a spectrometer. The work on mice can be seen as a preliminary work in which a classification pipeline has been developed. This pipeline allowed us to separate spectra between control and inflamed mice with good accuracy of 98% and, more interestingly, to identify two wavelength ranges in the red/infrared ranges that are discriminant for the classification: [620, 668 nm] and [668, 950 nm]. This study proves that analyzing reflectance spectra is a promising way to detect pathologies. We re-use the methodology and the pipeline for the processing of in vivo human's data as presented in the following paragraphs. The data that are acquired consist of a set of spectra. More precisely, two sets of spectra, one in the visible range with wavelengths between 400 and 630 nm with a 10 nm step (thus, 24 points by spectra) and in the near-infrared with wavelengths between 610 and 840 nm with a 10 nm step (also 24 pointsby spectra). It is interesting to examine the correlation between the wavelengths (i.e., the 24 points). Figure 1a,b show this correlation. The value of each point (_i,j_) of these correlation matrices corresponds to the correlation between reflectance spectra at wavelengths \(i\) and \(j\). In both images, red squares can be observed along the diagonal. These squares indicate that some wavelengths are highly correlated, especially the ranges around [410, 480 nm] and [520, 580 nm] in the visible and around [610, 690 nm] and [780, 840 nm] in the near-infrared. This observation motivates us to cluster the spectral bands into coherent groups. Figure 1c,d show the results of the band clustering algorithm. A median spectrum is presented with vertical black lines allowing the visualization of borders. For the visible (VIS) camera, eight bands are obtained, and, for the near-infrared (NIR) camera, seven bands are obtained. To obtain these results, we recursively merge the neighboring bands that are correlated more than 90%. At every iteration, the correlation between neighboring bands is computed, and the two most correlated bands are merged. The detailed algorithm is presented in Algorithm 1. The algorithm uses the same scheme as hierarchical clustering with an additional connectivity constraint. At the beginning of the algorithm, every wavelength is a cluster, and at each iteration, two clusters are merged. A version of this algorithm exists with connectivity constraints. In our case, only neighboring wavelengths can be merged. This algorithm is unsupervised because the label (i.e., control, chronic gastritis, or metaplasia) is not used. Figure 1: Correlation between wavelengths. The wavelengths that have been clustered are reduced to their spectral mean \(\mu_{i}\) on the cluster range according to Equation (1):  
\[\mu_{i}=\frac{1}{N_{i}}\sum_{\lambda=\lambda_{i}}^{\lambda_{i+1}}S_{\lambda} \tag{1}\]  
where \(N_{i}\) is the number of wavelengths in the range [\(\lambda_{i}\), \(\lambda_{i+1}\)] and \(S_{\lambda}\) is the reflectance of the spectra at \(\lambda\). After the reduction of the number of wavelengths, features are extracted. Three types of features are investigated: either the reduced bands are directly used, or the features are computed as the ensemble of all possible subtractions or divisions. More formally, we denote the ratios as \(R_{i,j}\) and the differences as \(D_{i,j}\). They are defined in Equations (2) and (3):  
\[R_{i,j}=\frac{\mu_{i}}{\mu_{j}}, \tag{2}\]  
\[D_{i,j}=\mu_{i}-\mu_{j}. \tag{3}\]  
Then, a univariate selection step is performed to reduce the complexity of the classifier. Reducing complexity helps us to avoid over-fitting problems.