# An Introduction to Machine and Deep Learning Methods for Cloud Masking Applications
## 3 Machine Learning Methods
### Advantages and Challenges of Traditional Machine Learning for Cloud Masking  
One notable advantage of using traditional ML methods over thresholding-based ones is their ability to manage complex and nonlinear patterns and provide good generalization performance. This proves particularly valuable when dealing with intricate and variable cloud patterns that defy simple rule-based models [56]. Using labelled data for training enables these algorithms to understand cloud and clear-sky characteristics and generalize this knowledge to new data. ML models, can handle noisy and large data-sets and high-dimensional feature spaces. The examination of high-resolution satellite images and the incorporation of multiple input features, permit the detection of small-scale cloud features that can be overlooked by traditional rule-based methods.  
However, there are challenges in their application. In very-high-resolution imagery, the finer resolution, while providing more detail and thus greater spectral heterogeneity in neighbouring features, can also increase the problematic nature of cloud edges and thin clouds, as well as highlighting small bright objects on the ground that have the same brightness as the clouds. In this case, for example, RF algorithms for cloud segmentation, which are trained from datasets of individual pixels with unrelated features in their neighbourhood, perform worse than a convolutional neural network (CNN) that inherently utilizes spatial context in addition to the spectral features of pixels.  
Preparing extensive labelled data for algorithm training can be resource-intensive and time-consuming, limiting its applicability in certain scenarios [57; 58]. In addition, the creation of adequate training data-sets is a significant challenge. It requires knowledge of spectral properties of clouds as well as of image analysis methods. Furthermore, it is difficult to consider all possible cloudy combinations in advance of constructing a classifier, particularly for rare or localized conditions. Satellite images present various spectral information, different spatial resolutions, and a great variety of complex land types, which should be taken into account for the adaptability of the model. Additionally, the performance of the sensor can limit the effectiveness of the model. For instance, the lack of key wavelengths can make it difficult to find features that can reduce the frequency of incorrect cloud discrimination. Finally, the lack of spatial information, in terms of spatial correlation between neighbouring pixels, that is typical of single-pixel methods, can significantly reduce accuracy.  
These critical aspects of the traditional ML models are improved or overcome by the application of Deep Learning methods. Deep Learning algorithms have excelled in image classification due to their superior feature representation, enhancing the final accuracy. Instead of manually choosing the appropriate characteristics of reference data, these algorithms autonomously learn spatial and semantic features directly from training data, reducing the subjectivity. The multi-layered architecture significantly amplifies the richness and variety of extracted features, thereby elevating classification accuracy, as discussed in the next sections.