Korean fog probability retrieval using remote sensing combined with machine-learning

ABSTRACT Fog is a phenomenon that occurs very close to the ground or sea level, and when detected by satellite, it is difficult to distinguish it from the low-level cloud. Logistic regression can help identify the false detection of the low-level cloud as fog and improve the accuracy of fog detection. In this study, a Korean fog detection algorithm was developed by using a machine learning-based logistic regression model (LRM) at three time points throughout the day (daytime, nighttime, and dawn/dusk) according to the solar zenith angle. The visible reflectance (Ref) and infrared brightness temperature (BT) of Himawari-8, solar zenith angle, land/sea mask, digital elevation angle, clear-sky Ref, and clear-sky BT excluding cloud pixels, from 2017 to 2018, were used as training data. The model was constructed by selecting variables with high correlation with the target data through a stepwise elimination method among input data having independent relationships between variables. Cross-validation using test data (20% of training data) contributed to the optimization of LRM. The fog detection performance of LRM confirmed by cross-validation has a stability of 83%–94% with high accuracy. For quantitative validation in 2019 using a 3 × 3-pixel validation method, the average probability of detection (POD) in the spring was 0.89–0.92, while the false alarm rate (FAR) was 0.39–0.41; in autumn, the POD was 0.9–0.97 and FAR was 0.29–0.4. The sophistication of the threshold between fog and non-fog can affect the performance improvement of the model. Further evaluation of the fog detection accuracy confirmed the reliability of the fog probability based on the stepwise probability. Satellite images enabled quantitative comparisons and validation of the proposed method; the results indicate that the approach is stable, reliable, and accurate. LRM fog detection will contribute to the Korean fog detection forecast with high performance, while the machine learning method used to build LRM can improve the performance of other meteorological forecast systems.


Introduction
The deterioration of horizontal visibility caused by fog often results in land and sea traffic accidents around the Korean Peninsula, causing significant economic losses. The combination of fog and dust threatens human health and degrades the quality of life. Fog is classified based on the complex topography and fog generation mechanism (Lee et al. 2010;Won et al. 2000;Heo and Ha 2004). Ground-level observational data have been essential for forecasting and analyzing fog events; however, their use is limited as observational data over the sea at ground level are scarce and infrequent. Thus, the ground observation data that can be used to monitor fog events continuously and simultaneously on the Korean Peninsula are limited.
Notably, geostationary-orbit satellites have become the most efficient way to provide data for real-time fog monitoring over the Korean Peninsula. Various technologies for fog detection have been developed using satellite data (Ahn, Sohn, and Hwang 2003;Yoo et al. 2006Yoo et al. , 2010Lee, Chung, and Ou 2011). Fog can be mainly detected by estimating cloud altitudes through the visible (VIS) channel during the daytime and the infrared (IR) channel at night; however, it is difficult to obtain the altitude when the temperature difference between the ground and clouds is extremely minimal (Ernst 1975;Eyre, Brownscombe, and Allam 1984). For nighttime fog detection, the dual-channel difference method (Eyre, Brownscombe, and Allam 1984) is typically used. Specifically, fog can be detected based on the difference in brightness temperature between the shortwave infrared (SWIR: 3.9 μm) and IR(10.4 μm) wavelengths. In mid-and high-level clouds at night, the emissivity of the 3.9 μm channel is greater than that of the 10.4 μm channel, whereas in fog, the emissivity of the 3.9 μm channel is lower than that of the 10.4 μm channel; thus, it is easier to distinguish fog (low-level clouds) at night (Ellord 1995;Lee, Turk, and Richardson 1997;Wetzel, Borys, and Xu 1996). The Communications, Ocean, and Meteorological Satellite (COMS), a geostationary satellite that launched in June 2010, provided fog detection images every 15 min over the Korean Peninsula until the end of its mission in March 2020; overall, its fog detection rate has been favorable, excluding the false detection of low-level clouds and brief discontinuities at dawn and dusk (Lee, Chung, and Ou 2011). Various methods and techniques for fog detection have been developed using COMS data. For instance, Suh et al. (2017) developed a fog detection method using optical textures measured with the normalized local standard deviations of the IR1 and VIS channels. Yang et al. (2019) suggested a method to detect low stratus clouds and fog at dawn using data from two geostationary orbital satellites (COMS and Chinese Feng Yun).
Additionally, the recent development of geostationary satellites with advanced optical sensors capable of observing high-resolution multi-channels presents an opportunity to increase the accuracy of fog detection. Since the Himawari-8 satellite was launched in Japan in 2015, 16-channel data at 2 km resolution observed by the Advanced Himawari-8 Imager (AHI) have been accumulated and are provided by the National Meteorological Satellite Center (NMSC) in near real time for the Korean Peninsula. More recently, the Geo-Kompsat-2A (GK-2A) equipped with a next-generation COMS -the Advanced Meteorological Imager -was launched in Korea. Since completing an experimental phase, 16 channels of GK-2A have provided various meteorological outputs observed at 2 min intervals over the Korean Peninsula. In preparation for the release of the GK-2A outputs, several studies related to fog detection have been performed using data from the Himawari-8 satellite, which has optical properties similar to that of GK-2A. Utilizing Himawari-8 data, Han, Kim, and Suh (2017) presented a daytime fog detection method using the normalized albedo and local standard deviation and applying the differences between the sea-surface temperature and fog-top temperature to differentiate fog from low clouds. Kim et al. (2019) performed nighttime fog detection using Himawari-8 satellite data and found that the average probability of detection (POD) was 0.64 (0.24-0.89) and the average false alarm rate (FAR) was 0.56 (0.33-0.71), where both quantities varied with the fog intensity and weather conditions.
Others have attempted to address the challenges of natural phenomena such as weather, agriculture, and forests -all of which have several unpredictable variables -through machine learning using highperformance computers (Dengzin and Yang 2010; Rasouli, Hsieh, and Cannon 2012;Cramer et al. 2017;Lee et al. 2017;Sokolov et al. 2020;Berndt et al. 2019). There have been several attempts to develop fog detection technology by combining satellite data and machine learning methods related to fog. Kim et al. (2020) developed a marine fog detection method based on the decision tree method using Geostationary Ocean Color Imager observations with Himawari-8 satellite data. Recently, the GOES-R Algorithm Working Group developed a method of determining hazardous low cloud probabilities using a naive Bayesian classifier by combining satellite data with numerical weather prediction (NWP) models, sea surface temperature (SST) analysis, and other data sets (e.g. digital surface elevation, surface emissivity, and surface-type maps) (Calvert et al. 2017).
In satellite remote sensing, the false detection rate is inevitably high due to the low-level clouds, haze, and mist, which are optically very similar to fog. Addressing these problems is challenging with the channel emission rate threshold of the satellite, and false detection rate reduction is therefore required. However, machine learning has the advantage of being able to detect fog by statistically finding the relationships between the multi-channel variables and fog, and continuously expand variables related to fog. In particular, logistic regression, which is a type of learned based on supervised learning, is suitable for categorical data and is very useful for distinguishing between fog and non-fog in satellite images since the probability of fog is calculated as a probability ranging from 0 to 1. In this study, three fog detection models, day, night, and dawn/dusk, were developed using logistic regression-based machine learning and Himawari-8 satellite data. Before developing the machine learning-based fog detection algorithm, we developed a Fog Probability Index (FPI) with fog detection algorithm using the Himawari-8 data. The previously developed fog detection algorithm can also detect fog with a reflectivity of 0.64 µm (VIS) during the day and with brightness temperature differences (BTD: 3.9-11.2 µm) at night. The key aspect of the FPI is that it calculates the fog probability based on three-dimensional (3D) linear discriminant analysis (LDA) for the three 3 μm) most closely related to the fog probability. The FPI is classified as high (FPI < -2.5, red), moderate (-2.5 < FPI < 0, orange), or low (FPI > 0, yellow) to reflect the possibility of fog on the ground. However, the FPI does not provide fog probabilities at a detailed step, and the false detection rate remains higher than expected with regard to the detection of haze and mist as fog. Therefore, it is necessary to improve the FPI so that it can provide detailed fog information with high accuracy and eliminate the false detection of low-level clouds as fog in moderate fog conditions.
Rather than improving the FPI by updating the LDA discriminant coefficient and probability level thresholds, we developed the LRM proposed herein for fog detection. Our approach utilizes machine learning to detect fog accurately with a step-by-step probability. Hereafter, we demonstrate the advantages of the fog detection LRM over the existing algorithm in terms of its ability to provide fog probabilities with improved accuracy.
Section 2 describes the study area, data used, Himawari-8, Korea Meteorological Administration(KMA) Automatic Weather Station (AWS) visibility, and details regarding pre-processing methodologies, logistic regression, and ROC curve test. Section 3 includes the results of quantitative and qualitative validation of LRM along with case analysis. LRM model performance and limitation are discussed in Section 4. Lastly, A summary and the conclusions are presented in Section 5. Figure 1 indicates the study area with the locations of in-situ measurements (KAM AWS). As shown in Figure 1, the AWSs are mostly located on land. The image of LRM fog detection in the same format as Figure 1 corresponds to 900 × 900 pixels in 2 km, where the center latitude and longitude correspond to 38 °N and 126.5 °E, respectively. For input data training, the Himawari-8 satellite data of 2 km resolution were matched to the closest data obtained from ground observations at 232 sites in 1 h intervals. Although the satellite data have channel information for the entire Korean peninsula, as shown in Figure 1, most of the ground observation data are distributed over land, therefore, the training data were limited to those corresponding to land. In this study, the fog performance was verified in these two seasons because fog mainly occurs in spring and autumn in Korea. In addition, in address the shortage of direct observation data from the sea, a machine learningbased fog detection algorithm was developed using satellite data. After explaining the data and methods in this section, Section 3 will present the results in detail.

Himawari-8
Himawari-8 is a geostationary orbiting satellite operated by the Japan Meteorological Agency and equipped with AHI optical sensors to observe 16 bands; the spatial resolution is 0.5 or 1 km for the VIS and near-IR (NIR) bands and 2 km for the IR bands. The AHI band of Himawari-8 observes three VIS bands (0.47, 0.51, and 0.64 μm) and 13 IR bands (6.2,6.9,7.3,8.6,9.6,10.4,11.2,12.4,and 13.3 μm), including NIR (0.86, 1.6, and 2.3 μm) and SWIR (3.9 μm). Table 1 shows the band information about the Himawari-8 satellites. The observation area of Himawari-8 is provided as a full disk and five observation areas (Calvert et al. 2017). As the Himawari-8 satellite has accumulated multi-channel data since its launch in 2015, its data are suitable as training data for machine learning because they contain multiple long-term input variables. As Himawari-8 satellites observe the Korean Peninsula with channel information corresponding to bands similar to those of GK-2A, the successor to COMS-1, the machine learning-based fog detection model developed in this study could be replaced and developed by using GK-2A data. We analyzed the characteristics of the channels observed by the Himawari-8 satellite and set a threshold to distinguish fog from other clouds and yellow dust (Section 2.3.1).

KMA AWS visibility
The KMA built a visibility and present weather system on AWS in 2009 for fog and visibility observations. Visibility, which had been assessed only with the naked eye, has been observed since 2017 by performing verification, whereas in the case of present weather, data for only 22 points are provided by naked-eye observation. The AWSs can objectively analyze the present weather, such as visibility, temperature, dew point, wind speed, and rain versus snow, but the precision of meteorological phenomenon observations differs depending on the sophistication of the instruments and algorithms included in the equipment. The quality of the AWSs has been verified and reported by the KMA based on the present weather observed by the naked eye at 22 stations. The accuracy of the present weather was reported to be as high as 97.8% in the case of fog from January to November 2017, although the accuracy differed for each piece of observation equipment (Jeon 2017;Lee et al. 2019). In the Republic of Korea, the AWS system has 494 ground-level stations, and the related Automatic Surface Observation System has 96 locations. Among them, 232 of the stations measure the horizontal visibility and provide the present weather.
The visibility measured directly with a visibility meter built on an AWS has relatively high accuracy and has been used to validate data from other radar,  satellites, or numerical models. The AWS categorizes the horizontal visibility, measured with a backscattering millimeter sensor, into the following categories: 0-1 km for fog (with 0-200 m being thick fog) and 1-10 km for mist and haze. Humidity > 80% is classified as fog, while that < 75% is mist and haze. The present weather discriminant of the system of visibility/present weather uses the decision algorithm of the manufacturer, and the detailed method is not disclosed . Haze or mist that is easy to mistake for fog is classified differently according to the visibility and humidity conditions. Haze is a phenomenon in which visibility is hindered by dust or smoke in the air, and mist, which occurs through the same mechanism as fog, is the phenomenon in which very small water droplets and moist hygroscopic particles float in the air but visibility is more than 1 km. Lee and Suh (2018) also reported that the accuracy of the visibility reports is 96%-97%, as verified by 21 naked-eye observations of radiation and advection fog cases in 2016. They also showed that the visibility meters observe fog more often than the naked eye, with 1.2%-1.8% bias.
Along with visibility, a vital and commonly used parameter to identify fog is the relative humidity threshold (Sokolov et al. 2020;Doyle and Dorling 2002;Ding and Liu 2014;Liu et al. 2012). The KMA AWS visibility has an average relative humidity of 97.4% for 21 radiation and advection fog events in 2016, with the highest visibility accuracy occurring when the relative humidity was > 88% (Lee and Suh 2018). Thus, we used the visibility (< 1 km) and humidity conditions (> 90%) for the target value. In this study, to control the visibility quality, the minimum values calculated in 10 min intervals were used to exclude large values that were incorrectly measured due to temporary equipment errors in the visibility system. Figure 2 shows a flow chart of the entire process of constructing a machine learning model based on logistic regression, including the pre-processing of the input data. The sequence of the machine learningbased fog detection algorithm is as depicted in Figure 2. The input data are the training data, which are mainly based on the Himawari-8 satellite channel data, and the ground observation data, which are the target data, are matched with respect to time and space in 1 h intervals during the period from 2017 to 2018. Next, after removing the cloud pixels through the cloud removal process, the input data were divided into day, night, and dawn/dusk according to the solar zenith angle (SZA) to construct each LRM model. At this stage, each model was randomly divided into training data and test data without duplication, and initial verification was performed on the model built based on the test data. After model building, ROC analysis was performed for the same period as that corresponding to the training data, from 2017 to 2018, to set the boundary value of the probability of distinguishing between fog and non-fog. After the model had been optimized and thresholds had been set, the fog detection algorithm was completed. After that, a model was selected for the new period data based on the SZA, and the fog probability was finally calculated according to the selected model. The calculated probability value between 0 and 1 was divided into fog and non-fog based on the set threshold. The machine learning-based fog detection algorithm is described below and further in sections 2.3.2 and 2.3.3.

Pre-processing of input data
We generated the training data by matching the Himawari-8 channel input data with 2 km spatial resolution in terms of time and space to the closest pixel selected among the 232 points from which the AWS target data were obtained. The input data used for training were as follows: Himawari-8 VIS (0.46, 0.51, and 0.64 μm) and NIR (0.86 and 1.6 μm) reflectance, IR (3.9,8.6,9.6,10.4,11.2,12.4,and 13.3 μm) BT, SZA, landsea mask (LSM), altitude of digital elevation model (DEM), normalized reflectance (NRef) (0.46, 0.51, 0.64, 0.86, and 1.6 μm), clear-sky reflectance (CSRef), and clear-sky BT. The Digital Elevation Model (DEM) is used to calculate the altitude, slope, and aspect of the terrain using remote sensing techniques (Jee et al. 2019). The reflectivity and BT for the clear-sky for 900 × 900 pixels were calculated every 10 min using the 15-day minimum reflectivity and maximum BTs of 0.64 μm and 10.4 μm, respectively. As the VIS channel reflectance has high variability due to the orbit and rotation period of the Earth, normalization of the VIS channel reflectance is required to achieve stable daytime fog detection. The normalization operator equation for the VIS channel reflectance An NRef of 0.64 μm in the fog area appears around 10%-65%. Even when the NRef is applied, the maximum and minimum values differ slightly depending on the season, hence we attempted to minimize the false detection rate using the difference between the NRef and normalized CSRef. The BT and CSRef for 900 × 900 pixels were estimated as the minimum Ref (0.64 μm) and maximum BT (11.2 μm) for 15 days using Himawari-8 and were used on-time data among the data calculated every 10 min. In the case of the daytime model, all variables were used, but the VIS channel and DEM variables were excluded from the nighttime and dawn/dusk models, and the SWIR channel was also excluded from the dawn/dusk model. These items were excluded because the 3.9 μm channel emissivity is added to the ground reflectance by sunlight during the daytime. We also used the major BTDs (3.9-11.2, 10.4-11.2, 11.2-12.4, 12.4-13.3, and 11.2-8.6 μm) as input variables. These training variables were utilized again as input data after the model had been built. The training period was from 2017 to 2018, and the data were obtained in 1 h intervals. The training data were used after removing cloud and dust pixels by setting the BTD thresholds in Table 2 based on the Himawari-8 channel analysis. Satellite-based remote sensing requires high sensitivity to distinguish between low clouds and fog, making cloud removal a very important process for fog detection.
In this study, we constructed a cloud removal method by investigating and analyzing the characteristics of the AHI band of the Himawari-8 satellite as follows. The BTD between the 10.4 and 11.2 μm channels, which is the atmospheric window, can be used to distinguish between the area in which water droplets are distributed in the low-level cloud, including fog, and the upper clouds. We found that the BTD between 10.4 and 11.2 μm appears to be negative (-) for fog or low-level clouds, positive (+) for high-level clouds, and zero for clear skies. Figure 3a shows the BTD between the 10.4 and 11.2 μm channels at 1100 Korean Standard Time (KST) on 19 April 2019. Figures 3c and 3e respectively provide the COMS-1 Cloud Top Height (CTH) and an RGB fog image. The CTH and RGB fog image show that fog occurs on the Table 2. Thresholds of brightness temperature difference (BTD) for cloud removal using Himawari-8. BTD Cutoff value Explanation Ch.13-14(10.4-11.2 μm) <0.5 K low-level cloud removal Ch.14-15(11.2-12.4 μm) >−0.5 K, <3.5 K dust removal Ch.15-16(12.4-13.3 μm) >8.5 K mid-level cloud detection Ch.14-11(11.2-8.6 μm) >1.4 K, <4.5 K cirrus detection west coast and inland north. The BTD between the 10.4 and 11.2 μm channels is red (+) in upper middle clouds and blue (-) in the fog and low-level clouds. Next, for the CO 2 channel (13.3 μm), which peaks at 900 hPa (Li and Shibata 2006), the BTD between the window channel (12.4 μm) and the CO 2 channel decreases as the cloud height increases. Therefore, we could easily remove the middle and upper-level cloud pixels by finding statistically appropriate thresholds of the BTD between the CO 2 and water vapor channels. In addition, we found that the BTD between the 12.2 and 13.3 μm channels is typically lower than 7 K for low clouds and greater than 12 K for fog and has a linear correlation with the cloud altitude. The 10.4-11.2 BTD in Figure 3a is negative for both fog and low-level clouds, whereas the 12.2-13.3 BTD in Figure 3b distinguishes between fog and lowlevel clouds. In the 12.2-13.3 BTD, fog corresponds to values greater than 11 K, with a dark orange color, whereas the low-level clouds appear mostly in light green, with values of 9 K or less. Next, we found that the BTD between the 8.6 and 11.2 μm channels can clearly distinguish fog given that the BTDs are less than 1 K in cirrus clouds and that the 8.6 μm channel is sensitive to cirrus clouds, making such clouds easily removable. At 1000 KST on 24 September 2019, the upper middle clouds can be confirmed in the GK-2A 0.64 VIS channel (Figure 3f), and the upper middle clouds are clearly distinguished by less than 1 K in BTD ( Figure 3e). Generally, as the reflectance of the VIS channel of yellow dust in the daytime is similar to that of fog, it is necessary to remove yellow dust for fog detection. It is possible to distinguish between yellow dust and fog using the 11.2 and 12.4 μm channels; this phenomenon is related to the optical thickness. At 0900 KST on 29 October 2019, the GK-2A Dust output ( Figure 3h) indicated yellow dust (dark yellow) in the south of China, and the BTD (Figure 3g) was less than -0.4 K (dark blue) in the yellow dust area. On the other hand, the fog appeared above 0 K (pale blue) on the land of the Korean Peninsula. We additionally analyzed the cloud removal performance. Under the cloud removal conditions used for training, it is possible that the low-level clouds were not properly removed by applying as large of a threshold as possible to minimize the possibility of fog being included when removing the low-level clouds. In order to remove the low-level clouds more clearly, the threshold can be reduced as much as possible while not removing the fog. At this time, if the boundary value of BTD ch.13-14 is changed from 0.5 to -0.2 and that of BTD ch.15-16 is changed from 8.5 to 11.6, the low-level clouds can be more completely removed than under the previous conditions. Therefore, we compared and analyzed the performance achievable using cloud removal condition 1 for training and subsequently cloud removal condition 2 ( Table 3). The verification period was evaluated by dividing it into day, night, and dawn/dusk in March and September of 2019. The results confirmed that 50% and 80% of the cloud area was removed when cloud detection conditions 1 and 2 were used, respectively. Therefore, condition 2 yielded 20%-40% higher performance than condition 1, and its false detection rate was not significantly different from that of condition 1. Thus, in order not to miss the fog pixels as much as possible, the fog probabilities were calculated using the model trained on the input data from which the clouds were removed according to condition 1, but condition 2 was used when removing the clouds after producing the LRM fog detection probability.

Logistic regression
Logistic regression is a statistical method used to predict the likelihood of an event through a linear combination of independent variables. It is also a probability model that presents the relationship between the target data and independent variables as a specific function. In some ways, logistic regression is similar to linear regression, which describes the target data as a linear combination of independent variables; however, in a logistic model, the target variable is a categorical variable such as a specific factor and dividing categorical data by 0 or 1 is not appropriate for linear regression. Theoretically, an LRM can be created through logit transformations of the odds. Conceptually, the odds refer to the ratio of the probability that a random event will occur to the probability that it will not occur. In general, logistic regression refers to a binomial problem with dependent variables (i.e. two valid categories). There are also multinomial (or polynomial) logistic regressions in which a feature having two (or more) groups is the target.
In order to build the LRMs, we changed the target variable with visibility and humidity conditions to a factor of 0 (clear sky) or 1 (fog) and randomly divided the training and testing data according to an 8:2 ratio. Conventionally, 70%-80% of the data are used for training in machine learning, with the remainder used for testing. We changed the ratio several times and chose to apply the 8:2 ratio for the model construction after finding that it yielded the highest accuracy. In order to select the best model, we performed cross-validation (CV) 20 times in the process of constructing and verifying the model through step-by-step elimination of variables for the training and testing data randomly extracted according to the 8:2 ratio. The model with the highest AUC and R 2 was selected as the best model. Here, R 2 is the standardized value of the mean square error (MSE) as the coefficient of determination. In order to train a regression model, the MSE is useful when comparing other regression models in CV. The R 2 and the MSE is as follow. Here, the total sum of squares (SST) is a measure of the total sample variance.
In this CV process, the AUC had almost identical performance, confirming the stability of the model ( Table  4). The AUC test results also confirm that the training model has high accuracy ( Table 4). The AUC of a receiver operating characteristic (ROC) curve is a measure of the accuracy of a quantitative diagnostic test (DeLong, DeLong, and Clarke-Pearson 1988). We also investigated the impact of changing the fog to non-fog (clear-sky) ratio on the AUC when iteratively training the input variable of the training data on the target value. At this time, the accuracy of the training data was verified. We confirmed that a 1:1 ratio yielded extremely high accuracy and could reduce the training time. To create a 1:1 ratio, we performed downward selection (i.e. choosing non-fog pixel data fitted to the number of fog pixels) rather than upsampling in order to save time and achieve the same quality. In this study, we divided the input data by the SZA to construct three LRM models for the three-time sectors: day (SZA ≤ 83°), night (SZA > 90°), and dawn/ dusk (83° < SZA ≤ 90°). The numbers of data points (pixels) for the training period were 13,160 in the daytime model, 39,880 in the nighttime model, and 5,758 in the dawn/dusk model. After the model had been built, its characteristics, such as estimations, standard errors, z-statistics, and p-values, were confirmed. The p-value represents statistical significance when it is less than 0.05, and a small p-value indicates greater predictive power.
To build an optimal model, we applied stepwise elimination to remove or add variables. This stepwise elimination method was utilized to construct a model with variables that had high correlations with the target variables. Table 5 summarizes the characteristics of the final daytime model constructed by stepwise variable elimination, shows the significance of predictor variables as well as the coefficients, standard errors, chai-squares, and significance for the selected variables. Here, chai-square is used for two or more variables; the two variables are independent and show authenticity. Significance identifies the correlation with the target data and is determined by < 0.001, < 0.01, < 0.05, or < 0.1, based on the chai-square. When the Chai-square is < 0.05, the correlation is high, and therefore these variables are selected for model construction. In this way, the three LRMs were constructed; Table 6 shows the variables and coefficients for each constructed model.

ROC curve test
We confirmed that the optimized LRMs predicted fog probabilities well between 0 and 1 using test data. Accordingly, it was necessary to set the probability cutoff value between fog and non-fog. Therefore, the cutoff values were optimized by plotting monthly ROC curves for the training and testing data from 2017 to 2018. Generally, ROC curves in binary statistical modeling, such as logistic regression, are useful for assessing the accuracy of predictions regardless of the cutoff value and do not provide optimal cutoff values. However, as the degree of influence on the results differs according to the cutoff value, an appropriate cutoff value is a decisive factor in the quantitative evaluation of the model (Mcfall and Treat 1999;Swets 1988). Therefore, we determined the probability thresholds by picking the optimal point of the ROC curve based on the correlations between the POD and the probability of false detection (POFD).
We investigated the monthly cutoff values along with the overall cutoff value for the training period (2017-2018) and the cutoff value for the total period, considering the different fog generation mechanisms    Table 7 summarizes the monthly cutoff values. We confirmed that the accuracy was higher when the monthly cutoff value was used; therefore, verification was performed using the monthly cutoff value. To maximize the performance, the cutoff point of the POD versus POFD curve was determined by lowering the FAR (or POFD) to the maximum extent possible without causing the POD to drop significantly. The cutoff value is the probability at the point at which the curve meets the tangent line (inclination = 1).

Quantitative validation
Fog on the Korean Peninsula is influenced by the topography, geography, and climate, and characteristically tends to occur along the mountains, seas, and coasts in spring and summer and occurs more frequently inland in autumn (Lee et al. 2004(Lee et al. , 2010(Lee et al. , 2018. We verified the fog detection capabilities of the LRMs in spring (March-May) and autumn (September-November), considering the fog characteristics of the Korean Peninsula. For verification, we matched the Himawari-8 input data with a resolution of 2 km to the pixel closest to the ground observation position every hour in 2019. For the ground observation data, which were the  target values, the conditions under which the visibility was less than 1 km and humidity was more than 90% were set as fog. Next, we adopted a contingency test using a 2 × 2 confusion matrix to validate the LRM (Table 6) (Marzban 1998). The contingency test included four categories: hit, false, miss, and corrective negative, depending on whether the observations and predictions matched each other (Table 8). In this study, the quantitative verification was performed by selecting the cases in which fog was detected from both the satellite and the ground in each scene of 900 × 900 pixels with central coordinates of 39°N latitude and 126.5°E longitude.
We compared the results of each model to measure quantitatively the improvement in fog detection achievable by our proposed machine learningbased LRM compared with FPI of the previously developed fog detection algorithm. Even though the previously developed fog detection algorithm generates hourly output, comparison was performed only for the daytime and nighttime models, as the FPI at dawn and dusk bases its detection on whether fog has been identified during the previous 5 h. In order to compare and verify the LRM and FPI, we matched the pixels of the satellite data closest to the ground observation data without considering the navigation error. The LRM (FPI) yielded an average POD of 0.82 (0.58) and an average FAR of 0.59 (0.64) during the daytime. During the nighttime, the LRM (FPI) produced an average POD of 0.72 (0.60) and an average FAR of 0.55 (0.66). The POD of the LRM was higher than that of the FPI, while the FAR tended to be lower. According to the average verification results for day and night, the LRM performs better than the FPI. The POD of LRM was higher than that of FPI by approximately 9-26% (Table 9). Additionally, the Himawari-8 (LRM) fog detection method achieves approximately 34-62% higher performance than that of COMS, with the FAR being 17-20% lesser from January to June of 2019 (Table 10).
The satellite pixel and ground observation position could be different points, or the ground station could be positioned across two satellite pixels. Thus, we adopted a 3 × 3-pixel validation method to minimize the navigation errors due to the difference in viewing angle between the satellite and ground observations (Cermak and Bendix 2011). The 3 × 3-pixel environment was classified as a hit if the satellite detected one or more fog pixels surrounding the ground station when the ground was fog-covered; if none of the satellite pixels caught the fog, it was considered a miss. Further, if the ground station pixel was not covered by fog but the satellite detected fog for all pixels, it was classified as a false alarm. Finally, if one or more satellite pixels did not detect fog, it was a corrective negative. Figure 5 illustrates this principle.
Using the 3 × 3 verification protocol, the performance of the LRM for the fog cases was investigated for each month in spring and autumn. Here, monthly verification was performed on scenes containing one or more pixels that detected fog by ground observation among the scenes obtained in 1 h intervals in 2019. The average POD, FAR, and TS in spring were   respectively, during the day; 0.9, 0.36, and 0.59 during the night; and 0.97, 0.29, and 0.68 at dawn/dusk. In the validation results, we found a difference in seasonal performance, with higher performance in spring for the day model and in autumn for the night and dawn/dusk models based on the TS. We confirmed the reliability by decreasing the FAR as the probability increased step by step (see Section 4.2). For practical use, the FAR can be reduced by flexibly using the cutoff value boundary or by optimizing the boundary value by performing the ROC text using more data. Next, we qualitatively compared the fog detection performance of GK-2A with LRM from September to November of 2019 (Table 12), and verified it using a 3 × 3-pixel verification method. GK-2A fog detection is currently being operated and used by NMSC for forecasting. Unlike COMS or Himawari-8(FPI) fog algorithm, GK-2A fog detection in the dawn/dusk period is calculated by adding newly created fog detection and the previous time fog detection. So, we compared the performance between LRM and GK-2A fog for the day, night, and dawn/dusk period, respectively (Table 12). Tables 11 and 12 show that the performances of LRM are slightly different when compared to FPI and compared to GK-2A because the data selected for each comparison object is slightly different. We found that LRM had significantly higher PODs and FARs than those of GK-2A, but the differences in PODs were higher than those in FARs between the LRM and GK-2A by approximately 10-50%; TSs were also higher in LRM. Overall, LRM has a better performance than that of GK-2A. These performance differences are the   maximum during the dawn/dusk period, and followed by those in the night and day periods. In the dawn/dusk period, GK-2A fog detection is not directly produced, unlike that produced by the GK-2A's algorithms during the day and night because of the low performance and strong sensitivity to the threshold values used for day and night fog detection. Therefore, previous fog detection results are used in the dawn/dusk period, depending on the temporal continuity of fog during that time . Furthermore, since GK-2A uses the previous fog detection results depending on the temporal continuity, the accuracy may be significantly different at dawn/dusk than at other times. In conclusion, LRM has a slightly higher FAR than that of GK-2A; it exhibits a better performance because of higher POD and TS. We compared the spring performance of Himawari-8 (LRM) with COMS fog detection (not GK-2A) during the qualitative analysis of this study because GK-2A is being used for fog detection since August 2019; hence, previous data are lacking.

Fog detection images and qualitative validation
Fog in satellite images has characteristics that can be distinguished through its spatial homogeneity and temporal continuity since it does not move over time and does not disappear suddenly. We analyzed fog cases to verify the LRM probability using other satellite images (Himawari-8 FPI, COMS-1, and GK-2A) and KMA AWS visibility images. In general, a quantitative score can confirm the fog detection performance, but as this is not an absolute indicator of performance, qualitative verification should also be conducted. Moreover, as most ground-level AWS observations are obtained on land, there is a spatial limitation in performing quantitative verification of satellite fog. However, ground-level observational data are the most accurate verification data for satellite fog detection. We also performed qualitative analysis by comparing the developed satellite fog detection images with the VIS or IR images, the fog detection products of other satellites, and AWS visibilities. The FPI expressed in the previously developed Himawari-8 fog detection algorithm was calculated by multiplying the sum of the three major Then, we divided the three stages of the FPI according to the statistical accuracy obtained from January to December in 2016 using 22 KMA naked eye observations. In this accuracy investigation, the POD, FAR, and TS performances of each stage in the FPI were approximately 90%, 30%, and 50% for high; 75%, 75%, and 20% for moderate; and 40%, 90%, and 5% for low, respectively. The first case study was performed to distinguish between low-level clouds and fog in the LRM and examine the detailed fog probability reliability. Figure 6a, b, and c respectively show the cases of 0800 KST on March 15, 0300 KST on April 17, and 2400 KST on 29 April 2019. Further, Figure 6a was obtained using the dawn/dusk model, and Figure 6b and c are the results of the Nighttime model. Figure 6a provides high-accuracy probability information for a fog case occurring on the northwest coast and inland (near Seosan,Lat.: 36.8°N,Lon.: 126.5°E and Yeoncheon,Lat.: 38.1°N,Lon.: 127°E). In the case of sea fog detected in the southwest region (Lat.: 37° -38°N, Lon.: 124°-125°E) in Figure 6a, the LRM well detected the fog with high accuracy, whereas the FPI over-detected fog with a moderate level. In the COMS case, the fog area over the sea is expressed as the possibility of a low-level cloud, which can be expressed incorrectly as a low-level cloud because there is a gap between the sea level and surface temperature. According to COMS ATBD, the false detection rate is high over the sea because the same algorithm and threshold are used for the sea and land (NMSC 2012). Figure 6b shows that for a case of fog occurring inland on the northwestern coast, and the LRM and FPI well detected the fog, consistent with an area of less than 1 km of visibility on the ground. However, COMS over-detected a large area with fog, and the FPI similarly falsely detected the low-level clouds that occurred along the east coast boundary as fog. Figure 6c is also a case of inland fog. The FPI detected a large area with a high probability of fog, but COMS did not detect it at all. However, as the LRM expresses the detailed probability for a rather large area, it detects fog areas more accurately than the FPI when the probability is high. Therefore, the results in Figure 6 confirm that the high-accuracy LRM can overcome the problem of over-detecting low-level clouds as fog in spring experienced by the FPI.
The second case shows the enhanced performance of the LRM in autumn compared with the other satellite images and AWS visibility. Figure 7 depict a case of localized fog sporadically occurring inland. When comparing the other two satellite images with the LRM images, the FPI and GK-2A tend to over-detect fog. Figure 7a and b respectively show the cases of 0700 KST on October 19 and 0100 KST on 20 October 2019. Figure 7a is a case of sporadic fog occurring in the southern inland area of the Korean Peninsula. In the ground observation data, points with visibility less than 1 km are observed sporadically. The LRM detected the fog with high probability and best matched the ground observations. However, the FPI detected only a portion of the fog at a high level and the rest at a moderate level, and GK-2A over-detected the fog in the southeast with a high probability. Figure 7b shows a case of fog occurring over the southwestern inland area. The LRM displays relatively low probability near an area of high probability, and the high LRM probabilities show the highest accuracy among the three satellite images. Although the LRM detects a large area as fog, it calculates the fog probability in detail. Hence, if the fog has a significantly different intensity from the area around the fog, the actual fog area can be distinguished with high probability. On the other hand, the FPI and GK-2A falsely detected the area corresponding to haze or mist as fog because it was observed between 1 to 5 km according to the ground observations in the central western area (near Seosan, Lat.: 36.8°N, Lon.: 126.5°E). Further, GK-2A falsely detected fog over a large area in the eastern inland area with a high probability. Therefore, through qualitative comparative analysis with the ground observation results, we confirmed that the fog detection performance of the LRM in autumn was better than those of the other fog detection algorithms, and that the accuracy of the fog probability was well reflected in the detection results.

Discussion
Machine learning-based fog detection algorithms developed in this study provide the fog probability with high accuracy for the first time. We verified the accuracy of each model qualitatively and confirmed that each model's stability and seasonal performance were better than those of the previously developed Himawari-8 fog detection algorithm and GK-2A fog detection. The most important issue in the fog detection algorithm, falsely detecting low-level clouds as fog, was solved in LRM. In addition, since each model was constructed according to time, due to checking the continuity of the models, the discontinuity that appeared in the previously developed Himawari-8 and GK-2A fog detection algorithms did not appear. In addition, in the satellite fog detection algorithm, the fog detection discontinuity, which can occur frequently due to the discontinuity of the VIS light and SWIR channel (3.9 μm) during the dawn/dusk period, was not observed in the LRM. Meanwhile, the fog detection algorithm LRM applying machine learning is the first to provide fog as a probability, unlike other fog detection algorithms. The GOES-R Fog/Low Stratus (FLS) Probability product is an example of the accuracy of fog detection as a probability. Using the NWP model and GOES-R ABI channel data, the National Oceanic and Atmospheric Administration; National Environmental Satellite, Data and Information Service; and University of Wisconsin-Madison-Cooperative Institute for Meteorological Satellite Studies have developed an FLS that can contribute to the instrument flight rule (IFR) (GOES-R fog product examples). However, the GOES IFR does not distinguish between low-level clouds and fog to provide information about the probability of fog including low-level clouds for safety in the flight area, rather than providing information about fog on the ground. Kim at al. (2020) developed a sea fog detection algorithm by training single-channel GOCI satellite image data using machine learning and achieved good performance. However, the channel data of GOCI satellites enables sea fog detection only during the day based on VIS channel data. Meanwhile, stable performance of LRMs for day, night, and dawn/dusk, and the continuity between models and accuracy of the probability were confirmed. Examining the reliability of the fog probabilities generated by each model showed that the probability reflects the intensity of the fog, with the false detection rate decreasing as the probability increases. In the qualitative analysis, it was confirmed that the probability of LRM is expressed with a low probability even though the fog area is overdetected. Therefore, the probability has resulted in improving the fog detection performance.
However, in terms of the qualitative performance of the LRM, we found that occasionally in the sea, clouds were detected as fog with a high probability. As the LRM training data were used to build the model after removing the cloud pixels, the cloud pixels that were not removed from the input data were falsely detected as fog with a high probability. In particular, in the case of the sea, the proportion of the training data was relatively small compared to that of the land, making false detection inevitable. Conversely, considering that the fog formation mechanism differs between the land and sea, it may be beneficial to construct a separate machine learning model for the sea using ground observation data based on the naked eye observations made by the navy. However, we developed a single fog detection algorithm instead of individually developing models for the land and sea because some of the island data were included even though the training data were mainly distributed over the land. Developing a single algorithm for land and sea would allow for intuitive viewing at the same time without discontinuity on the land and sea. The reason why other data observed in the sea was not used together with land data when creating a single algorithm is that it is difficult to consistently correct bias of multiple observational data in order to avoid erroneous training.

Extension of input data
Through the qualitative verification process, we confirmed that the LRM detects fog well and provides sufficient probability information; however, we found that an inappropriate cutoff value caused a high FAR in the LRM. We verified the accuracy of these results by increasing the cutoff value of the monthly validation data of each LRM model ( Figure 8). We confirmed that the threshold value for lowering the FAR as much as possible without significantly lowering the POD differs from the cutoff value of the ROC test. If the cutoff value reaches the lowest FAR possible, fog and non-fog (clear sky) can be distinguished more accurately. Here, if the LRM probability does not accurately reflect the fog reliability, setting the cutoff value can be extremely important for the fog detection performance. Therefore, it is necessary to apply a new technical method such as flexibly optimizing the cutoff value according to various conditions such as the season and time, or to propose a guideline for fog detection analysis of the LRM output image.
Conversely, as the amount of data was insufficient to perform the ROC analysis every month, the cutoff value was not optimized monthly for all models and did not always agree with the new data, which affected the quantitative performance. Moreover, the amount of fog data used for training was limited to fog generated on land to match the input data and true AWS values. In the LRM training, we divided the target data into fog and non-fog (clear sky) conditions and randomly selected the same number of non-fog data points as the number of fog points selected. As a result, we constructed the daytime, nighttime, and dawn/dusk models using 13,012, 39,880, and 5,758 pixels of input data, respectively. Thus, the training data tended to be insufficient even though 2 years of data were utilized. When testing the LRM using machine learning in R, the error message suggested that the model could not be created because the data were insufficient for classifying fog and non-fog instances. Unfortunately, owing to the limited number of fog data points used for training, we often noticed low-accuracy cases in some seasons or models.
Regarding the lack of sea data in the training, we occasionally identified over-detection of low-level clouds as fog in the seas in day or dawn/dusk models. Figure 9 shows that the probability of the LRM is high for the sea to the east, with a mixture of low-level clouds and fog. The FDI detects this same area as fog of an intermediate level. Meanwhile, in this area, GK-2A did not detect fog (red) except as some low-level clouds (yellow green). However, because GK-2A detects fog in non-fog areas and low-level clouds in fog areas near the Shandong Peninsula, unlike the LRM and FDI, additional observational data is required for sea fog validation. In the case of GK-2A, fog is expressed in six stages, separated from the low-level clouds, according to the difference between the SST and cloud top temperature. GK-2A fog is also produced in the low-level clouds (light green) in the case of thick fog at sea. If the LRM falsely overdetected low-level clouds as fog in the sea to the east, this error could be interpreted as the result of poor training due to insufficient training data. When developing a machine learning-based sea-only fog detection model, the model could be improved in relation to over-detection on the sea using the SST. Therefore, to build a more sophisticated model, it is necessary to use training data containing several fog cases over the ocean or to extend the target value of the training data to the ocean.
Highly accurate models can be built with more training data. While we were building the LRM model using Himawari-8 data, GK-2A was launched (in 2018), and it is continuing to accumulate data. Machine learning will allow for building a more accurate fog detection model using these long-term input data. Furthermore, with data accumulation, we can construct individual models for the ocean and land to increase the model accuracy given the different formation mechanisms for each surface. In particular, machine learning is a powerful fog detection strategy since it can expand various satellite data, satellite-based outputs, and numerical model data as input data. In this study, all available satellite data were used, but the numerical model data were not used as training data because the first model accuracy must be secured to use the model output as input data. In addition, whenever the output of a numerical model is used as input into the LRM to perform fog detection, there is a time delay due to the calculation time required by the numerical model. In this study, for the first time, a model was developed to provide the probability of fog both over the sea and land of the Korean Peninsula through machine learning, and it was confirmed that the accuracy was higher than those of other fog detection products developed previously.

Reliability of fog probability
Our motivation for applying machine-learning logistic regression analysis for fog detection using satellite data was to predict fog with detailed probability and proven reliability. The reliability has already been qualitatively confirmed; we investigated the accuracy of each fog probability step. As the false detection rate decreased as the probability increased in 0.05 steps, it was confirmed that the fog detection accuracy increased as the probability increased ( Figure 10). As the probability increases, decreasing rates of FAR tend to be larger during autumn than spring. In addition, a quantitative result of LRM shows the performance tends to be better in autumn than in spring (Table 11). Therefore, the model is optimized for autumn, when fog frequently occurs inland, rather than in spring, when fog occurs near the west coast and over the sea to the west. The fact that our target data collectors were primarily distributed inland via KMA AWSs likely favored the increased inland accuracy, despite using data from satellites observing the entire Korean Peninsula for the training component.  Conversely, over-detection of fog was occurred in the images because the probability boundary value between fog and non-fog was not optimized; however, the boundary enabled us to determine where the fog probability differed significantly. In other words, the LRM model clearly distinguished between fog and non-fog conditions ( Figure 11).

Continuity of the three models
In the case of satellite-based weather output, time continuity is important because the VIS and SWIR channels are not available at dawn/twilight. The 3.9 μm channel is unique in that it detects both emitted terrestrial radiation and significant reflected solar radiation during the day . It is important to resolve the fog detection discontinuity at dawn/dusk as the satellite detects the fog that occurs frequently after sunset or just before sunrise using the difference BT between the IR channel of the SWIR channel at night and the VIS channel reflectivity in the daytime. In general, fog has a long duration and does not move, unlike other clouds or yellow sand, hence fog detection during dawn/dusk is mainly produced by reflecting the detection results of the previous time. In this study, a machine learningbased regression analysis model was individually designed for fog detection in the dawn/dusk period rather than reflecting the fog detection during the previous period. Fortunately, there are many cases of fog at dawn/dusk, so the dawn/dusk model was well trained and showed relatively high accuracy. We investigated whether any of the three different LRMs (daytime, nighttime, and dawn/dusk) provided consistent and continuous fog detection. Figure 12 shows the LRM, FPI, GK-2A, and AWS visibility images from 0600 to 1000 KST on 6 November 2019. The case is an example of inland fog occurring at dawn in autumn and gradually disappearing as the morning breaks. In the case of the LRM, although each of the three models was built separately, the fog area is continuously detected well, and the probability reflects the intensity of the fog. Conversely, in the FPI and GK-2A results, discontinuities occurred over large areas of the sea over time. In addition, at 2300 KST and 2400 KST on October 28, both the FPI and GK-2A overdetected low-level clouds over land, where they were more strongly detected by GK-2A.

Conclusions and summary
We developed a fog detection algorithm based on a machine-learning LRM using Himawari-8 satellite data, which could estimate the fog probability between fog and non-fog (low-level clouds or clearsky) conditions. For the model optimization, 20-fold CV and AUC tests were performed on training and test data. As a result, we confirmed the stability of the daytime LRM with an AUC of 90% or more, and  those of the night and dawn/dusk models with AUCs of approximately 85%. In addition, in the performance evaluation based on test data, we confirmed that the overall performance was high, with a POD and FAR of approximately 85% and 20%, respectively, in the day model, and approximately 80%-85% and 25%, respectively, in the night and dawn/dusk models. To set the boundary between fog and non-fog, we tested the ROC curves for each month and for the entire period, and to evaluate the performance of the LRM quantitatively, we firstly performed verification by comparison with the FPI of fog detection algorithm that we developed previously. The LRM and FPI were verified based on the ground observation data for each 1 × 1 pixel without considering the navigation error, and the results were compared. The LRM algorithm performance was superior to that of the FPI, also shown by qualitative comparative analysis. To better evaluate the LRM performance, verification was performed by introducing a 3 × 3 verification technique that is widely used to verify satellite data based on ground observation data. The average spring (autumn) PODs were 0.92, 0.89, and 0.89 (0.93, 0.90, and 0.97) and the average spring (autumn) FARs were 0.29, 0.41, and 0.39 (0.40, 0.36, and 0.29) for the day, night, and dawn/dusk models, respectively. In the reliability investigation of the fog probability, we found that the accuracy increases as the fog probability increases. Our LRM can discriminate between fog and low-level cloud with high accuracy.
In conclusion, LRM fog detection algorithm developed in this study exhibits better performance than the existing FPI fog detection algorithms and has the advantage of providing accurate information by producing detailed fog probabilities. In addition, as the LRM calculates probabilities, it has the advantage of providing information on the fog intensity. The false detection rate gradually decreased as the probability increased, proving the stepwise reliability of the fog probability. As a result, the fog probability improves the fog detection performance. LRM also has several positive development possibilities that can increase the accuracy of fog detection by expanding the input data using long-term input data or the addition of more variables such as SST, ground-level temperature, and fog surface homogeneity. Further, since GK-2A was released in 2018, 16 GK-2A channels similar to those of Himawari-8 have been collected. If the data are continuously accumulated, it will be possible to improve the LRM using long-term input data from GK-2A. The satellite fog detection algorithm cannot detect fog under clouds due to the characteristics of satellite observation, and there are many cases of discontinuity occurring at dawn/dusk due to discontinuity of the VIS and SWIR channels. In addition, as the low-level clouds and fog have very similar channel characteristics, false detection of low-level clouds as fog has often occurred due to the limitation of satellite observation. In this regard, there has been considerable demand to improve the accuracy of satellite fog detection algorithms. With the recent launch of highresolution multi-channel satellites, it is possible to develop highly accurate weather products by applying various observational data to machine learning. The high-accuracy LRM developed in this study exhibited substantial improvement in the qualitative analysis, in terms of the detection discontinuity occurring during the dawn/dusk period and the false detection of the low-level cloud. Finally, we developed an algorithm with an unprecedented machine learning logistic regression method that provides real-time fog detection probabilities without interruption across the entire Korean peninsula, for both the land and sea, and achieves high-performance, continuous fog detection in time and space. In particular, ground observation data have mainly been used thus far to report fog conditions in Korea, but it has been difficult to provide various information due to limitations in time and space. However, it is expected that it will be possible to provide accurate information about fog by employing the machine learning-based fog detection algorithm using satellite data developed in this study in areas or times that are not observed on the ground, and it will be useful for real-time fog forecasting.

Disclosure statement
No potential conflict of interest was reported by the author(s).

Funding
This work was funded by the Korea Meteorological Administration's Research and Development Program "Technical Development on Weather Forecast support and Convergence Service using Meteorological satellites" under Grand (KMA2020-00120).