1. Introduction
Fog, a weather phenomenon of visual obstruction, is formed by tiny water droplets or ice crystals floating in the air [
1]. The observation of fog plays a significant role in weather and climate analysis inn meteorology. In daily life, fog forecasting have important applications for aviation safety, agricultural production, and environmental monitoring [
1,
2]. According to its density, fog is typically classified into five grades as the light fog, the moderate fog, the dense fog, the thick fog, and the very thick fog. The horizontal visibility caused by different fog density is shown in
Table 1 [
3].
In early fog meteorological observation, observers identified targets at varying distances from their location to estimate fog density using the naked eye [
4]. Currently, automated instruments such as transmissometers and scatterometers [
4,
5] are employed to observe horizontal visibility, which is derived from atmospheric optical processes. However, automatic observation systems often suffer from limited representativeness when local optical characteristics differ from those of the broader environment. Additionally, large-scale and high-density deployments of these systems are prohibitively expensive. Satellite-based fog remote sensing also faces challenges, particularly due to cloud interference, which reduces accuracy [
6]. In recent years, the widespread use of surveillance cameras across various industries has sparked research into optical recognition, image denoising, and fog visibility observation, becoming a focal point in the fields of image recognition and artificial intelligence [
7,
8,
9,
10,
11,
12,
13,
14,
15,
16].
Currently, fog density estimation based on optical images can be divided into two categories: traditional computer vision methods and neural network-based approaches.
Traditional computer vision methods estimate visibility using image processing techniques, extracting features such as Region of Interest (ROI) extraction, edge detection, vanishing points, and horizon detection, and applying linear statistical equations to estimate fog visibility. Among these methods, Busch et al. [
17] introduced a visibility estimation method using B-spline wavelet transforms. Hautière et al. [
18] calculated fog visibility distance by extracting road and sky regions. Negru et al. [
19] proposed a method for detecting fog from moving vehicles by analyzing inflection points and the horizon in images. Guo et al. [
20] developed a visibility estimation technique using ROI extraction and camera parameter estimation. Wauben et al. [
21] presented a series of techniques for fog visibility estimation, including edge detection, contrast reduction between consecutive images, decision tree methods, and linear regression models. Yang et al. [
22] introduced an algorithm for visibility estimation under dark, snowy, and foggy conditions, combining dark channel prior, support vector machines, and weighted image entropy. Cheng et al. [
23] proposed an improved visibility estimation algorithm using piecewise stationary time series analysis and image entropy, incorporating subjective assessments to judge fog and haze visibility. Zhu et al. [
24] estimated fog density in weather images by analyzing saturation and brightness in the HSV color space. Despite the effectiveness of these image feature-based methods, they face challenges such as limited generalization ability and low flexibility.
Deep learning has achieved remarkable success in computer vision (CV), natural language processing, and video/speech recognition [
25]. Numerous studies have applied these methods to fog image estimation. Tang et al. [
7] predicted visibility in various weather conditions by training a random forest model [
8] using dark channel, local contrast, and saturation features. Jonnalagadda and Hashemi [
11] introduced an autoregressive recurrent neural network that leverages the temporal dynamics of atmospheric conditions to predict visibility. Li et al. [
9] enhanced visibility detection accuracy through transfer learning, where pre-trained models improve prediction accuracy without requiring large amounts of training data. Li et al. [
12] proposed a meteorological visibility estimation method based on feature fusion and transfer learning, integrating multiple data sources for more accurate estimations. Lo et al. [
13] experimentally evaluated a transfer learning method using particle swarm optimization (PSO) for meteorological visibility estimation. Liu et al. [
14] introduced an end-to-end visibility estimation network (FGS-Net) based on statistical feature streams, which demonstrated high effectiveness in fog-prone areas. Choi et al. [
15] developed an automatic sea fog detection and visibility estimation method using CCTV images, achieving accurate sea fog detection and visibility distance estimation. Zhang et al. [
16] proposed a deep learning method for visibility estimation in traffic images, where deep quantification techniques improved visibility prediction accuracy.However, these methods typically rely on training with large, balanced datasets. While deep learning models such as VGG16 and ResNet50 perform well on large-scale datasets, their accuracy significantly declines when sufficient data is not available. In this study, we compare the performance of VGG16, ResNet50, DenseNet169, and our improved Random Forest (RF) model. VGG16/19 [
26] employ multiple convolutional layers and max-pooling for feature extraction, though their depth results in high computational costs. ResNet50 [
27] addresses the vanishing gradient problem using residual modules, enabling deeper networks with better performance on complex tasks. DenseNet169 [
28] improves efficiency through dense connections, while Random Forest [
29] enhances model stability by reducing overfitting in decision trees.Furthermore, the dataset we collected often lacks extreme data, resulting in a low proportion of extreme categories. This uneven distribution creates an imbalanced dataset for training purposes, presenting additional challenges in model performance.
When the dataset is unevenly distributed, as observed with the QVEData used in [
16] and the private dataset in [
30], the methods suffer from poor generalization ability. The scarcity of image samples under conditions of dense fog and very dense fog limits the diversity available during training, leading to reduced estimation accuracy. Moreover, algorithm convergence remains a significant challenge. Many traditional methods require extended training times to achieve convergence, especially when handling complex foggy images [
31,
32]. In cases of imbalanced or insufficient data, overfitting becomes a common issue, resulting in poor algorithm convergence and reduced method efficiency.
To improve the performance of the RF model in estimating fog on insufficient and imbalanced data, we propose a GAN-based data augmentation technique to increase the proportion of low-representation grades in the dataset. This approach reduces reliance on naturally imbalanced datasets, where high fog density grades are underrepresented. By applying StyleGAN2-ADA [
33] for dataset augmentation, the issue of imbalanced data distribution is mitigated. The generated virtual images increase and balance the dataset across different fog density grades, addressing training challenges posed by limited and imperfect data. Furthermore, by incorporating hierarchical and k-medoids clustering within the Random Forest model [
8], this method enhances observation accuracy and accelerates training convergence on imbalanced datasets, outperforming algorithms such as VGG16, VGG19, ResNet50, and DenseNet169.
4. Conclusion and Discussion
In this paper we proposes an image-based fog observation method, an improved Random Forest model integrated with the hierarchical and k-medoids clustering, on the StyleGAN2-ADA data augmentation, which addressing the issue of dataset imbalance. Key fog-related features were studied. Performances of VGG16, VGG19, ResNet50, and DenseNet169 were compared and analzed. Experiment shows that the improved RF approach has gained significantly an increased observation accuracy and a decreased computational cost.
(1)The StyleGAN2-ADA for data augmentation effectively mitigated the issue of dataset imbalance. Through increasing the proportion of the dense fog grades, it reduces the risk of overfitting greatly, especially with limited dataset. Additionally, data augmentation accelerated the model’s training convergence speed by 30%-50%.
(2) Key fog-related features were identified through the feature aggregation test for fog density estimation. 5 features are discarded. 11 features which have bigger correlation with fog density were selected such as MSCN variance, dark channel, and chroma, to name a few. These features describe the fog image characteristics best, which are capable of improving both computational efficiency and estimation performance.
(3) To overcome the limitations of traditional Random Forest models in handling high-dimensional data and complex nonlinear relationships, the hierarchical and k-medoids clustering is integrated with the RF model. Performance comparison with other deep learning models , the VGG16, the VGG19, the ResNet50, and the DenseNet169, is made both on the initial dataset and the augumented dataset.
(4) When initial dataset is used, the ResNet50 model performed the best in terms of average accuracy. The improved Random Forest model matches with the ResNet50 in terms of the average accuracy, but gains high performance in lighter fog conditions.
(5) With data augmentation, the estimation accuracy of all models improved significantly. Notably, the improved Random Forest model achieved further enhancements in accuracy across all fog grades, reaching 89.8% in very dense fog and 91.7% in dense fog, with an average accuracy increase to 93.0%., which outperformed other deep learning models , with accuracy improvements ranging from 1.8% to 6.8%.
It is noted that the experiment was very short and the image dataset was limited on space and time. Despite the model’s very good performance, further validation is still needed in future work. Furthermore, the algorithm still needs optimization in practical application. A more effective feature extraction method should be developed. The classified light fog is minted with the haze, who is similar in terms of visibility but is different in local humidity. In practice, according to the meteorological regulation, the haze can be distinguished from the fog whose relative humidity is over 80%. For light fog image-based estimation, humidity observation is needed for the future work.