## 2 Materials and Methods
### Data Acquisition and Preprocessing  
The presented bimodal system can acquire multispectral images at approximately one image per second. This exposure time is due to the low power of light that comes back in the fiber. Figure 2(a) shows an example of a multispectral image acquired in the stomach. The image is rearranged in 16 small images to show the 16 bands of the VIS camera. We can see the disk in the center, which is the area covered by the fiberscope. All images do not necessarily contain useful information. In general, multispectral images are often blurry. This phenomenon is due to the movements of the endoscope, the poor spatial resolution, the fiberscope, and the high exposure time. Then, it is challenging to use textural information as some parts of the image could be too dark or over-exposed. Therefore, we make sure to keep only pixels whose maximum is under 512. Indeed, the camera's technical documentation specifies that if the 10 th bit is set to 1, then the pixel is considered saturated. In the same manner, pixels whose spectral mean does not exceed 128 are considered too dark to be exploited. To understand this choice, we present an example in Figure 2(b). Three pixels are compared: in blue, a pixel which is too dark, in green, a valid pixel, and in red, a saturated pixel.  
A linear transformation described in a previous paper [29] is applied to the spectral radiance to get estimated reflectance spectra (Figure 2(c)) i.e., to estimate the 24 points in the VIS and the 24 points in the NIR from the original 16 bands of the VIS camera and the 25 bands of the NIR camera.  
Figure 2: Functional scheme of the prototype.  
As the multispectral images are difficult to interpret directly, an experienced gastro-endoscopist selected NBI endoscopic images in which the fiber is focused on a significative zone of the pathology. Then we can select the temporally nearest multispectral image for the analysis.  
The image should then be filtered with a low-pass filter to reduce the noise. Although it exists a various number of filtering like the use of wavelets [31]. In our case, we have chosen to use a simple pyramidal filter:  
\[\begin{bmatrix}1&2&3&4&3&2&1\\ 2&4&6&8&6&4&2\\ 3&6&9&12&9&6&3\\ 4&8&12&16&12&8&4\\ 3&6&9&12&9&6&3\\ 2&4&6&8&6&4&2\\ 1&2&3&4&3&2&1\end{bmatrix}.\]  
Figure 3: Example of the extraction of spectra from the multispectral image.  
Then, spectra are taken on a grid by considering 1 pixel over 7 (vertically and horizontally). We gathered data for 16 patients. The Table 1 classifies them according to their histological results. For all these patients, 200 valid spectra were randomly taken among the valid spectra to have the same number of spectra for each patient.  
Figures and results from the two cameras are intentionally separated. Cameras acquire images independently, and in practice, if no pixel in an image is valid (i.e., either too dark or over-exposed), the image is removed.  
The two Figure 4 show median spectra of the 16 patients after calibration, respectively for VIS camera (Figure 3(a)) and NIR (Figure 3(b)). The color indicates histological results: blue for control, green for chronic gastritis, and red for intestinal metaplasia. We do not see specific behavior in the visible range, but control spectra seem clustered for the NIR camera, they have a lower derivative. On the spectral range [610, 730 nm], plots corresponding to metaplasia are under the plots of control class and inversely for the spectral range [730, 840 nm].  
The obtained spectra are then processed by the pipeline detailed in Section 2. The next sections give the classification results obtained separately with VIS and NIR data.