Appendix D — Cloud masking methods for Sentinel-2

Cloud and cloud-shadow detection is the single most consequential preprocessing step for any Sentinel-2 workflow that operates on individual scenes rather than aggregated composites. The choice of method involves a trade-off along three axes: detection quality (does it correctly flag thin cirrus, cloud edges, and cast shadows?), computational cost (can it run at archive scale on available infrastructure?), and operational availability (is it pre-computed and shipped with the product, or must it be run separately?). No single method dominates on all three axes, and the appropriate choice depends on the use case: a global mapping pipeline running monthly composites has different requirements from a single-scene change-detection workflow where every false negative becomes a visible artifact.

Table D.1 compares the methods in current use. We distinguish the algorithmic family (rule-based, classical ML, or deep learning), the form of the output (binary mask versus continuous quality score), and the practical considerations that govern whether a given method is realistic to deploy at scale.

Table D.1: Cloud and cloud-shadow masking methods for Sentinel-2 data. \(^*\)On Google Earth Engine. \(^{\dagger}\)On Sentinel Hub.
Method Family Output Pre-computed
SCL [1] Rule-based Multi-class label
Fmask [2] Physics-based and ML Multi-class label ×
Cloud Score+ [3] Deep learning Continuous probability \(^*\)
s2cloudless [4] ML Continuous probability \(^{\dagger}\)
KappaMask [5] Deep learning Multi-class label ×
CloudSen12 [6] Deep learning Multi-class label ×
OmniCloudMask [7] Deep learning Multi-class label ×

A few practical considerations are worth highlighting. The SCL layer is the path of least resistance: it ships with every L2A product, requires no additional compute, and is sufficient for the dominant use case of cleaning cloudy pixels before median compositing. Its known weaknesses — conservative cirrus detection, missed cloud edges, occasional confusion between bright surfaces and clouds — become problematic when working with single scenes or when the application is sensitive to false negatives in cloud detection. Fmask, originally developed for Landsat, offers a more physics-informed and well-validated alternative, but is slower than SCL and must be run separately. s2cloudless occupies the opposite end of the efficiency spectrum: it is lightweight, fast on CPU, and widely used in operational pipelines.

Cloud Score+ [3] occupies an unusual position because of its continuous output. Rather than committing to a binary mask, it returns a per-pixel quality score that the downstream user can threshold according to the sensitivity of the application. This is convenient when the same archive must serve multiple workflows with different tolerances. The principal limitation is operational: Cloud Score+ is exposed natively only through Google Earth Engine, so workflows running outside that ecosystem cannot use it directly. CloudSen12, trained on hand-labeled patches stratified across biomes, and OmniCloudMask address the same need with self-hostable models at the cost of having to run inference oneself.

The deep learning methods (KappaMask, CloudSen12, OmniCloudMask) generally outperform the rule-based and classical-ML alternatives on hand-labeled benchmarks, but the magnitude of the gain depends on the region, the scene composition, and the specific failure modes the benchmark is designed to expose. [7] report computational efficiency for OmniCloudMask against several alternatives on an NVIDIA RTX 4090, providing a useful reference point for relative throughput on consumer-grade hardware. Whether the accuracy gain justifies the additional compute and infrastructure complexity is a judgment that should be made against the requirements of the specific mapping task: for global-scale composite-based workflows, the marginal benefit over SCL is often modest; for single-scene applications or studies in cloud-prone regions such as the humid tropics, it can be decisive.

Finally, none of these methods is sensor-agnostic by default with the exception of OmniCloudMask. Methods originally developed for Sentinel-2 can be retrained on other optical sensors, but doing so requires either a labeled dataset for the target sensor or a sufficiently large labeled Sentinel-2 dataset together with a domain adaptation strategy. Practitioners working across multiple optical missions should weigh this carefully, as the cost of maintaining one cloud-masking pipeline per sensor can rapidly exceed the cost of the inference itself.

[1]
J. Louis et al., Sentinel-2 SEN2COR: L2A Processor for Users;(Special Publication) ESA SP-740.” European Space Agency: Prague, Czech Repubic, 2016.
[2]
S. Qiu, Z. Zhu, and B. He, Fmask 4.0: Improved cloud and cloud shadow detection in Landsats 4–8 and Sentinel-2 imagery,” Remote Sensing of Environment, vol. 231, p. 111205, 2019, doi: 10.1016/j.rse.2019.05.024.
[3]
V. J. Pasquarella, C. F. Brown, W. Czerwinski, and W. J. Rucklidge, Comprehensive quality assessment of optical satellite imagery using weakly supervised video learning,” in 2023 IEEE/CVF conference on computer vision and pattern recognition workshops (CVPRW), IEEE, 2023, pp. 2125–2135. doi: 10.1109/cvprw59228.2023.00206.
[4]
A. Zupanc, Improving Cloud Detection with Machine Learning.” Sentinel Hub Blog, Dec. 2017. Available: https://medium.com/sentinel-hub/improving-cloud-detection-with-machine-learning-c09dc5d7cf13
[5]
M. Domnich et al., KappaMask: AI-Based Cloudmask Processor for Sentinel-2,” Remote Sensing, vol. 13, no. 20, p. 4100, Oct. 2021, doi: 10.3390/rs13204100.
[6]
C. Aybar et al., CloudSEN12, a global dataset for semantic understanding of cloud and cloud shadow in Sentinel-2,” Scientific Data, vol. 9, no. 1, Dec. 2022, doi: 10.1038/s41597-022-01878-2.
[7]
N. Wright, J. M. A. Duncan, J. N. Callow, S. E. Thompson, and R. J. George, Training sensor-agnostic deep learning models for remote sensing: Achieving state-of-the-art cloud and cloud shadow identification with OmniCloudMask,” Remote Sensing of Environment, vol. 322, p. 114694, May 2025, doi: 10.1016/j.rse.2025.114694.