370
Figure 9. Confusion matrix showing the classification results
of the cloud detection model. Class 0 represents cloud-free
areas, class 1 corresponds to thin clouds, and class 2 refers to
thick clouds.
The confusion matrix shows that the classifier
performed exceptionally well in distinguishing cloud-
free areas (class 0), achieving a perfect classification
with 23 correctly identified samples and no
misclassifications. Thin clouds (class 1) were classified
correctly in 16 instances, while 1 instance was
misclassified as class 0 and 6 as class 2, indicating some
spectral overlap with both neighbouring categories.
For thick clouds (class 2), the model achieved 30 correct
classifications, with minor confusion: 1 sample was
misclassified as class 0, and 6 as class 1. Overall, the
classifier demonstrated high accuracy across all
categories, though further refinement could enhance
the discrimination between thin and thick clouds.
To quantitatively evaluate the classification model,
precision and recall were calculated for each class
(Tab. 2).
Table 2. Precision and recall values calculated for each class
based on the confusion matrix.
The evaluation metrics indicate that the model
excelled in identifying cloud-free areas (class 0),
achieving both high precision (0.92) and perfect recall
(1.00), which means that no cloud-free samples were
misclassified. For thick clouds (class 2), the model also
demonstrated strong performance, with balanced
precision (0.83) and recall (0.81), suggesting
dependable detection of dense cloud structures.
The lowest precision and recall were observed for
thin clouds (class 1), with values of 0.73 and 0.70,
respectively. This result suggests that thin clouds are
more challenging to classify accurately, likely due to
their lower spectral contrast and partial transparency,
which can create confusion with both clear sky and
thick cloud classes. Incorporating additional spectral
indices or training samples may improve the
classification of this category in future work.
4 CONCLUSIONS
This study demonstrated the effectiveness of a hybrid
cloud detection method that combines selected spectral
indices (NDVI, NDSI, CDI) with Sentinel-2 spectral
bands and a supervised learning approach using a
machine learning algorithm (Random Forest). The
proposed approach enabled accurate identification of
various cloud types over a spectrally complex coastal
region in northern Poland.
The results indicated that the model excelled in
detecting cloud-free areas, achieving a precision of 0.92
and a perfect recall of 1.00. Thick clouds were also
classified reliably (precision = 0.83; recall = 0.81), while
thin clouds posed the greatest challenge due to their
spectral similarity to both clear skies and thick clouds
(precision = 0.73; recall = 0.70). These findings
emphasize the importance of combining spectral
indicators with effective classification techniques to
reduce misclassification in complex land–water
environments.
The method’s simplicity, flexibility, and relatively
low computational cost make it suitable for operational
maritime applications, including coastal monitoring,
hydrographic data preprocessing, shoreline mapping,
vessel detection support, and navigation-related
environmental monitoring. By improving the
reliability of cloud-free Sentinel-2 products, the
proposed approach may support safer and more
efficient decision-making in coastal and marine
environments. Future research may explore
integrating additional spectral features, time series
analysis, or deep learning-based models to enhance the
detection of optically thin clouds and haze layers.
REFERENCES
[1] D. Phiri, M. Simwanda, S. Salekin, V. R. Nyirenda, Y.
Murayama, and M. Ranagalage, “Sentinel-2 data for land
cover/use mapping: A review,” Remote Sensing, vol. 12,
no. 14, p. 2291, Jul. 2020, doi: 10.3390/rs12142291.
[2] F. Rodríguez-Puerta, R. L. Perroy, C. Barrera, J. P. Price,
and B. García-Pascual, “Five-year evaluation of Sentinel-
2 cloud-free mosaic generation under varied cloud cover
conditions in Hawai’i,” Remote Sensing, vol. 16, no. 24, p.
4791, 2024, doi: 10.3390/rs16244791.
[3] B. Zhou, S. Gao, Y. Yin, Y. Zhang, Y. Yu, Q. Qian, and M.
Zhu, “Enhancing active fire detection in Sentinel-2
imagery using GLCM texture features in random forest
models,” Scientific Reports, vol. 14, p. 31076, 2024, doi:
10.1038/s41598-024-81976-w.
[4] WeatherSpark, “Average weather in Gdynia, Poland, year
round.” [Online]. Available:
https://weatherspark.com/y/84137/Average-Weather-in-
Gdynia-Poland-Year-Round
[5] European Space Agency, “Sentinel-2 User Handbook,”
ESA Standard Document, 2015. [Online]. Available:
https://sentinel.esa.int/documents/247904/685211/Sentine
l-2_User_Handbook
[6] European Space Agency, “Sentinel-2 MSI Technical
Guide,” 2023. [Online]. Available:
https://sentinel.esa.int/web/sentinel/technical-
guides/sentinel-2-msi
[7] S. Huang, L. Tang, J. P. Hupy, G. A. Wang, and J. Shao, “A
commentary review on the use of normalized difference
vegetation index (NDVI) in the era of popular remote
sensing,” Journal of Forestry Research, vol. 32, pp. 1–6,
2021, doi: 10.1007/s11676-020-01155-1.