# An Introduction to Machine and Deep Learning Methods for Cloud Masking Applications
## 4 Deep Learning Methods
### Deep Learning for Cloud Masking
When employing Deep Learning-based methods, it is essential to use an extensive, independent set of labeled samples (ground truths) for training and testing purposes. This training dataset must be sufficiently diverse, encompassing various characteristics relating to geographical locations, different seasonality, terrain types, balanced and class-representative data, and, in addition, must have a considerable volume to achieve the full potential of Deep Learning. Consequently, the process of creating a verified dataset and developing a cloud detection algorithm via Deep Learning is extensive. Transfer learning techniques can capitalize pre-trained models on other datasets or tasks to initialize or fine-tune the Deep Learning model, which can reduce the amount of labelled data and accelerate the training process. Exploiting the existing labelled datasets of one satellite to train Deep Learning models suitable for other satellites is the subject of the articles in [95; 113; 114]. The transfer learning approach in [113] is applied between Landsat 8 and Proba-V sensors, that have different but similar spatial and spectral features, taking advantage of the existing labeled datasets. Different transfer learning strategies were experimented based on the distinction between transductive/inductive [115] transfer learning, after having applied a domain adaptation transformation from Landsat 8 to Proba V data. The results were compared with FMask, MSCFF, and RS-Net reporting remarkable detection accuracy despite the sensor differences. In [95; 116], the authors trained U-Net based architectures, on Landsat 8 dataset to transfer the model to Sentinel-2 images. In [95] the authors present a modified U-Net architecture with a moderate number of parameters, that gave rise to CD-FCNN (CD-FCNN: U-Net with two different Sentinel-2 band combinations: VNIR, RGBISWIR trained on the L8 Biome), which was part of the 10 cloud masking methods evaluated in the first Mask Intercomparison eXercise (CMIX) [117]. The aim of the work in [95] was twofold: to provide a model obtained from training on Landsat 8 data, to be applied to Sentinel 2 images, and to highlight the dependence of the performance evaluation on the datasets used for validation. The proposed model performance was competitive versus the reference methods for Landsat 8 and Sentinel-2. In [118], an extension of GANs was used to adapt the real Proba-V images to match the distribution of the transformed Landsat 8 data. These data and their ground-truths are used to predict clouds in Proba-V. The different specifications of the sensors on board the various satellites generate data that, even when the sensors are similar, are characterized differently. The previous works have shown the need to adapt the data in terms of spatial and spectral characteristics, e.g., by resampling operations or by discarding some spectral information, which leads to a lack of immediacy in the transfer of models from one sensor to another, as well as a lack of bands that may be meaningful for cloud detection. The sensor dependence of a model is addressed by [PERSON] et al. in [119]. The proposed Spectral Encoder for Sensor Independence (SEnSeI) new architecture, represents a notable advancement in remote sensing applications and in cloud masking in particular, functioning as a preprocessing module that translates data from various sensors into a unified format. In this way, a model can operate on the data regardless of the type of sensor that produced it. Unlike methods like transfer learning, SEnSeI does not adapt pre-trained features but rather integrates data from multiple sources, creating a broadly applicable model across different sensors. This approach is particularly useful in standardizing multi-spectral data, thus overcoming the challenge of sensor-specific data variability. This approach can have an immediate spin-off in the design of supervised cloud detection models prior to the launch of new satellites.