## 2 Materials and Methods  
### Data  
The data for this paper were originally obtained in a previous clinical study [27] that performed a comparison between dermoscopy and RCM modalities in the diagnosis of benign lesions such as solar lentigo and malignant tumors by focusing essentially on LM/LMM. These images were acquired by three specialists, experts in regard to non-invasive skin imaging tools, by use of a hand-held VivaScope(r) 3000 camera that uses a laser with a wavelength of 830 nm and images to a depth of up to 250 \(\upmu\)m. In addition, these data included lesions that can be highly misleading for dermatology specialists. From an ethical perspective, this study was conducted following the Declaration of Helsinki and the protocol was approved by the Ethics Committee of the University Hospital of Saint-Etienne (Institutional review board number 672016/CHUSTE). Only images considered relevant for the diagnosis by two out of the three investigators were retained, at different depths of the skin: the epidermis, the dermal-epidermal junction (DEJ), and the dermis. However, most of the information was acquired at the DEJ. Each RCM image corresponding to a horizontal 920 \(\upmu\)m \(\times\) 920 \(\upmu\)m section of the skin at a selected depth with a lateral resolution of 1 \(\upmu\)m and axial resolution of 3 \(\upmu\)m to 5 \(\upmu\)m. For specifications, these images have a spatial resolution of 1000 \(\times\) 1000 pixels with quantification on a single 8-bits channel. The relative position between images of a single patient was unknown, and this could not provide any further knowledge in the next part of this work. Furthermore, the metadata available regarding the age of the patients was not used as the purpose of this work was to evaluate the relevance of image classification techniques, although it was initially provided to the experts during their assessments. These data include 223 lesions from 201 patients, for a total of 7846 RCM images. Generally, one lesion is equal to one patient so we will discuss of a lesion as a patient in the next paragraphs. Each of these cases varies between 2 and 833 images (with a mean of 35 and a standard deviation of 64). For each patient, the data provided a diagnosis based on clinicopathological correlation that served as a reference basis and there was the following distribution of cases:  
* 135 patients had \"malignant\" tumors: 115 LM/LMM and 20 basal cell carcinoma (BCC). * 88 patients had \"benign\" tumors: mainly represented by solar lentigines. No collision tumors were included in this series. Also, the study [27] evaluated 21 experts, and they achieved a mean sensitivity of 0.80 (range 0.66-0.90, standard deviation 0.07) and a specificity of 0.81 (range 0.73-0.90, standard deviation 0.05), with an area under the curve (AUC) score of 0.89 for the detection of LM/LMM. In order to reduce the imbalance of the data, a further 28 additional benign tumors were provided by dermatologists, with the number of images per tumor varying between 4 and 103 images (608 images in total). These new patients were only considered for training purposes and they were not taken into account in Section 3. In addition, these data did not provide any information regarding individual images. As these annotations were required in the next part of the work, each of these images was annotated by a specialist, with the help of a graphical interface designed for this purpose. Images with BCC tumors were not considered as the objective is to be able to discern LM/LMM. Whereas the patient labels were \"benign\" or \"malignant\", some of the images could not be classified into either of these two categories because they did not contain any of these pathology signs. For this particular reason, a \"healthy\" label was introduced to characterize them. Figure 2 provides an overview of these different data.