A Self-Adaptive Wildfire Detection Algorithm with Two-Dimensional Otsu Optimization

,e gradual increase in wildfires has caused frequent trips and outages along electrical transmission lines, which is a serious threat to the operational stability of power grids. A self-adaptive wildfire detection algorithm has been developed and tested in this paper. Most of existing wildfire detection methods employed fixed thresholds to identify potential wildfire pixels while the background pixels were ignored. By calculating two-dimensional histogram of the brightness temperatures of mid-infrared channel, the threshold selection is self-adaptive and potential pixels containing scenes of fire can be distinguished automatically. Based on the two-dimensional Otsu method and contextual test algorithm, an improved wildfire detection algorithm that uses multitemporal Visible and Infrared Radiometer (VIRR) data is described. ,e wildfire detection results within three kilometers of electrical transmission lines demonstrate the effectiveness of the proposed method, which has accurate low-temperature wildfire detection ability.


Introduction
Wildfires often happen around the world, and they are associated with lightning, human causes, and other naturally occurring phenomena [1]. Wildfires near electrical transmission lines pose a significant risk to the operational stability of power grids [2]. A large-scale wildfire can simultaneously cause trips and outages of multiple electrical transmission lines. e total number of tripping incidents in state grid areas affected by wildfires reached about 200 annually. Accurate and timely fire detection for electrical transmission line safety provides essential information for fire extinction. Satellite remote sensing data have been extensively used in the study of fire detection, which provide large area coverage while capturing a comprehensive view of wildfires [3].
For more than three decades, the spatial, spectral, and temporal characteristics of remote sensing detectors have been constantly improving, and new methods for fire detection systems have been developed [4][5][6]. e Advanced Very High Resolution Radiometer (AVHRR) [7,8] was the first applied to provided mid-infrared (MIR) and thermal infrared (TIR) data to assess temperature variations of earth. After that, the Moderate Resolution Imaging Spectroradiometer (MODIS) [9] and the Visible Infrared Imaging Radiometer Suite (VIIRS) [10] are two popular satellite sensors used for many purposes, including fire detection, which provide 1 km and 375 m spatial resolution data with a revisit cadence of four and two times daily, respectively. In terms of advanced spatial resolution necessary for accurate fire detection, the sea and land surface temperature radiometer [11], the infrared sensor [12], and the Landsat class sensor [13] provide 30 m spatial resolution data. e main drawback of these advanced sensors is their coarse temporal resolution, which cannot meet the requirements for realtime fire detection. In addition, many geostationary satellites have also been used for wildfire detection, which do possess the ideal temporal resolution.
e main drawback of these geostationary satellites is their coarse spatial resolutions of around 2-4 km [10]. In terms of fire detection near electrical transmission lines when considering their characteristics of small size and short-lived, polar-orbiting satellites are more suitable than geostationary satellites [2].
For wildfire detection algorithms, the concept of fire detection at the subpixel level in TIR data was first introduced in the study by Dozier [4]. By utilizing the forward fixed threshold method, Flasse and Ceccato [8] introduced a contextual fire detection algorithm that uses dynamic thresholds, which relies on the contrast between a potential wildfire pixel and its background pixels. e contextual algorithms proved to be more effective and flexible than other fire detection products, and it had a lower false alarm rate [9,18,19]. An advanced contextual wildfire detection algorithm was then proposed and applied with MODIS data in the study by Giglio et. al. [20], which achieved a lower false alarm rate by using several rejection tests. Taking forward the above contextual-based algorithm, Kalpoma and Kudoh [21] introduced the normalized difference vegetation index (NDVI) to exclude nonwildlife pixels, while Wang et al. [22] introduced a smoke detection algorithm to identify fire areas. However, these algorithms employed fixed potential thresholds to identify potential wildfire pixels. In practice, the setting of fixed threshold to identify potential wildfire pixels is difficult since it is relative to a specific region and different environmental conditions [23,24]. In view of the above shortcomings, thresholds were set dynamically by calculating the gradient lines in TIR data and the average of each MODIS scan sample, respectively, in studies by Du et. al. and Giglio et. al. [25,26]. e brightness temperatures of whole scene pixels were analyzed in a study by Lin et. al. [27] where the percentage threshold was set to the top 0.01% of all considered pixels. However, these characteristic value-based wildfire detection methods are not selfadaptive enough for different regionals, and therefore, more flexible threshold value calculation methods are needed.
In this paper, the existing contextual fire detection algorithm is enhanced by employing the potential thresholds dynamically to identify potential wildfire pixels. A two-dimensional (2D) Otsu method [28,29] is employed to select the threshold of potential wildfire pixels automatically. e advantage of the proposed method is to automatically calculate optimal brightness temperature threshold values that are used to separate potential wildfire pixel from its background pixels based on a histogram distribution. For the confirmation of potential wildfires, a contextual test method is employed due to its success in MODIS version 4 algorithms [20]. e main modules of the proposed method are constructed around an analysis of multitemporal VIRR data. However, the algorithm can also be used to other satellite sensors to make the utmost of background pixels information. e article is organized as follows. In Section 2, the data sources and study area are introduced. In Section 3, the algorithm developed in this study is described, and different modules that constitute the algorithm are described in detail in the subsections. Application cases are presented and discussed in Section 4. e main advantages of the proposed algorithm are considered in the conclusions.

Overview of Wildfires near Electrical Transmission Lines.
With the development of the electrical power grid, more and more electrical transmission lines are passing through high mountains and lofty hills. At the same time, with the implementation of the "returning farmland to forest" policy in China [30], trees and weeds are always present within transmission line corridors. Fires near electrical transmission lines are mostly caused by human behavior, e.g., the Qingming Festival, which is a memorial ceremony where people burn fake money. When a wildfire occurs near electrical transmission line, the insulation between ground and electrical transmission line decreases sharply, which causes an electrical transmission line trip and power outage [31]. A distribution map of transmission lines over 220 kV and the study area is illustrated in Figure 1.

Overview of Visible and Infrared Radiometers.
e FengYun-3C satellite flies at an altitude of 836 km (i.e., sunsynchronous orbits) with an equator crossing local time between 10 : 00 and 10 : 20 in descending node and between 13 : 40 and 14 : 00 in ascending node, which provides images with a spatial resolution of 1.1 km. In this paper, the input data are from the FengYun-3C VIRR sensor, which contains ten channels extending from the visible to the TIR spectral region, and the FengYun-3C data were obtained by the ground receiving station located in the author's department. e distribution of VIRR spectral features is shown in Table 1 [32]. According to the Planck radiation formula, the spectrum of the radiation shifts toward shorter wavelengths as the temperature of the radiator is increased. e derivative of the Planck equation with respect to wavelength yields the Wien displacement law (i.e., equation (1)) that gives the wavelength λ m for which maximum radiation occurs for a given temperature T [4]. (1) For the VIRR instrument, channel 3 has a spectral response covering from 3.55 μm to 3.93 μm, which means a peak spectral radiance for blackbodies emitting at temperatures between 737 K and 817 K. erefore, it is appropriate for identifying wildfire pixels from background image as based on the above Wien displacement law. However, channel 3 has a pixel saturation temperature at 350 K [33]. Complementing the channel 3 data, the 4 th channel, which is centered at 10.80 μm, is used to detect wildfire pixel and to exclude cloud pixels. In addition, channels 1, 2, and 6 of the VIRR cover the visible (0.58-0.68 μm), near-infrared (0.84-0.89 μm), and the shortwave infrared (1.55-1.64 μm) and are used to exclude false alarm pixels. erefore, the main applications of the VIRR channels are cloud, sun glint, and water masking through channels 1, 2, and 6, and fire detection and false-alarm elimination through MIR channel 3 and TIR channel 4.

Proposed Algorithm Description
For wildfire detection methods, contextual test-based methods are the most widely used, such as "Collection 4" MODIS wildfire products [20]. e above method is composed of three major steps including thresholds to distinguish potential wildfire pixels, contextual tests to confirm wildfire pixels, and false alarm filtering. In this paper, the proposed algorithm is designed to reduce omission errors caused by the fixed potential wildfire pixels identification thresholds. In terms of small-size wildfire detection near transmission lines, it was found in the studies by Wang et. al and Cheng et al. [34,35] that brightness temperatures at the MIR channel of wildfire pixels are lower than their 320 K or 315 K fixed potential wildfire thresholds. In contrast, the potential wildfire thresholds cannot set to be low enough, which will cause an increase of omission errors. Taking forward the contextual test method, the 2D Otsu method has been introduced to automatically calculate the threshold of potential wildfire pixels. e framework of the proposed approach is illustrated in Figure 2. e detailed calculation process can be divided into four primary steps: initial data screening, potential wildfire identification, potential wildfire confirmation, and false alarm filtering, which are described in the following sections, respectively.

Initial Data
Screening. Similar to the study by Lin et al. [27], a daytime pixel is considered as cloud covered if it satisfies condition 2 e reflectance and the brightness temperature with channel i th is denoted as r i and T i , respectively. For the nighttime pixels, cloud pixels are identified by channel 3 and channel 4 as follows: e water pixels were then classified based on the "Land and Sea Mask" dataset provided with the VIRR original image [26]. e proposed wildfire detection algorithm does not process any pixels that are identified as cloud or water pixels, and all these pixels are excluded from the effective background pixels.

Potential Wildfire Identification.
A pixel is considered as potential wildfire pixel if it satisfies condition 4: where ΔT � T 3 − T 4 , and T * 3 and ΔT * are thresholds for potential wildfire identification.
In previous algorithms, T * 3 and ΔT * were set as fixed values. However, potential wildfire thresholds for regional fire detection should be set according to a specific region and different environmental conditions. In this paper, the basic idea of the proposed algorithm is to select self-adaptive brightness temperatures threshold to separate potential wildfire pixels from the background pixels using 2D histogram distribution and the 2D Otsu method, which are presented below.

Construction of 2D Histogram Distribution.
e Otsu algorithm was proposed by Otsu in 1979 [36] and is widely used as an effective threshold calculating method to separate object regions from their background. However, it fails when applied to images with low signal-to-noise ratios since it depends solely on a 1D histogram. As an enhanced method, the 1D histogram is extended to a 2D histogram in a study by Liu et al. [29], which considers both the value of a pixel and the dependency of pixels in its neighborhood. In this paper, the brightness temperature value of a pixel is calculated for the 2D histogram analysis. Assume that the size of a VIRR scanned image is M × N. e brightness temperature value of a pixel with coordinates (x, y) is defined as f(x, y). e brightness temperature values of the pixel are between 270 and 350 since the saturation temperature of channel 3 is350K as mentioned in Section 2.2. e brightness temperature of a noncloud pixel is over 270 K as mentioned in condition 2.
Let g(x, y) be the local average brightness temperature value of a pixel f(x, y) neighborhood, then where n is the width of neighborhood. By using the 2D vector [f(x, y), g(x, y)] to express a VIRR scanned image and letting r ij be the total occurrence frequency of pair (i, j), which represents pixel [f(x, y), g(x, y)] with f(x, y) � i and g(x, y) � j, then the corresponding joint probability density function p ij is given by where i, j � 270, . . . , 350, and 350 i�270 350 j�270 p ij � 1.

Optimal reshold Calculating
Using the 2D Otsu Method. Let us now define two clusters C 0 and C 1 as, respectively, representing the object and background by a threshold pair(s, t). e probabilities of C 0 and C 1 can be denoted as follows [37]: e mean intensity vectors of C 0 and C 1 can be expressed as follows: e between-class discrete matrix is defined as By using the trace of σ B as the measurement of betweenclass variance, there is A threshold vector (S, T) is then selected by maximizing the quantity t r σ B as e basic idea of the potential wildfire identification algorithm that uses the 2D Otsu method is to select the optimal threshold (S, T), calculate the largest value of the quantity t r σ B (i.e., equation (12)), and automatically separate potential wildfire pixels from the background.
In earlier wildfire detection algorithms, T * 3 and ΔT * were set as fixed values at 315 K or 320 K (305 K at night) and 20 K (10 K at night) [20], respectively. In the MODIS collection 6 wildfire detection algorithm [26], a potential fire threshold is calculated for each sample position by applying a 5 K offset to the large-window averages T 3 and ΔT. In order to reduce the omission errors, the dynamic threshold T * 3 should be lower than the fixed threshold value. According to the above 2D histogram distribution analysis, S represents the brightness temperature value of a pixel and T represents the local average brightness temperature value. For pixels in the neighborhood of an edge between the wildfire and the background, the brightness temperature value T 3 of a pixel differs fairly from its local average value, which means a higher value for S − T. erefore, a potential wildfire threshold is then independently calculated for each sample position by where ΔT is the mean value of ΔT among the neighborhood pixels.

Potential Wildfire
Confirmation. Similar to the study by Giglio et al. [26], the absolute threshold test for pixels is given by To supplement the above fixed wildfire threshold test, the contextual wildfire threshold tests are then constructed, which make full use of neighborhood information and provide better sensitivity for smaller wildfire pixels. e potential wildfire confirmation contextual tests are expressed as where T 3 and δ 3 are the mean and mean absolute deviation of T 3 , respectively, T 4 and δ 4 are the mean and mean absolute deviation of T 4 , respectively, ΔT and δ ΔT are the respective mean and mean absolute deviation of ΔT, and δ 3 ′ is the mean absolute deviation of T 3 within the background wildfire pixels.

False Alarm Filtering.
After the process of initial data screening, potential wildfire identification, and potential wildfire identification, the tentatively detected wildfire pixel still has a high false alarm due to the high reflectivity of some land areas such as sun glint and the coastal period. In order to address these, false alarm filter tests were applied to all the detected potential wildfire pixels. e false alarm filtering tests are expressed as where θ g is the angle between vectors pointing to the surface-to-satellite and specular reflection directions. If the above test (16) is satisfied, the tentative wildfire pixel is rejected and detected as nonwildfire.

Results and Discussion
To quantify the accuracy of the proposed 2D Otsu-based fire detection method and test its effectiveness in various situations, we analyzed a series of VIRR images that cover the period from 13 to 20 February 2018, which is the Spring Festival of China. During this holiday period, most people celebrate by igniting firecrackers, which can inevitably cause a lot of wildfires. All the VIRR image data were acquired through the ground receiving station in the author's department, which can also be found on the Fengyun Satellite Data Center website (http://satellite.nsmc.org.cn/PortalSite/ Default.aspx). Corridor areas within 3 km from electrical transmission line towers were selected as the study area ( Figure 1). Considering the fact that environments vary from Mathematical Problems in Engineering place to place, potential wildfire thresholds should be adjusted to local conditions.

Wildfire Detection Example.
During the Spring Festival, the first wildfire point was observed at 10 : 46 local time on 13 February, which was located in Yiyang city of Hunan province. e VIRR local area scanned image that contains this hotspot is shown in Figure 3(a). For a better display of the wildfire pixel feature information, we enhanced the original satellite monitoring images using the following steps: the VIS spectrum is displayed in blue as the first channel, the NIR spectrum is displayed in green as the second channel, and the TIR spectrum is displayed in red as the third channel. Used for processing the VIRR images, the 2D histogram of the selected area is shown in Figure 4 with neighborhood width n � 3. e potential wildfire identification threshold T * , as determined via the 2D Otsu method, is 308.3 K, and the ΔT * of potential wildfire threshold is 16.6 K according to equation (12). Compared with the traditional-fixed potential threshold method, the proposed method can automatically select the threshold of the potential wildfire detection according to the distribution of the brightness temperature of the background pixels in each subregion. Based on the above threshold segmentation, the distribution of potential wildfires is shown in Figure 3(b). It can be seen that the wildfire area, which has a high brightness temperature, has been identified effectively. e potential wildfire pixels were then confirmed with the potential wildfire confirmation method described in Section 3.3. e confirmed fire pixels were finally marked as red points as shown in Figure 3(c). e brightness temperature measured by channel 3 and channel 4 are 315.2 K and 296.7 K, respectively. It can be seen that the brightness temperature values of the marked wildfire pixel have a low intensity, which would have been omitted if the potential wildfire threshold was set to a fixed value. e longitude and latitude data of this wildfire pixel imply that the distance d between the wildfire point and the electrical transmission line tower is 1278 m (equation (17)); its close proximity will, therefore, affect the operation of the electrical transmission line, and the wildfire alarm information is then sent out immediately.
where d is the spherical distance between the wildfire pixel and the electrical transmission line tower, x 0 and y 0 are the longitude and latitude of the wildfire pixel, respectively, lon nst and lat nst are the longitude and latitude of the nearest electrical transmission line tower, respectively, and R 0 is the mean radius of the Earth. For the computation cost of the proposed method, the study area was divided into several subregions of 1°× 1°in size as shown in Figure 5. e selected study area, Hunan province, contains 25 subregions, and each subregion contains 100 × 100 pixels. For the calculation of the potential wildfire threshold vector (S, T), the traditional enumeration method costs a lot of time, and a fast-iterative algorithm is employed as described in the study by Chen et al. [37]. Take the partial derivatives of t and s and set them equal to zero according to equation (12) as Compared with the original enumeration method, the computation time has been greatly reduced, and it just costs 0.04 second for each subregion, while the original method takes hundreds of time longer. It can be seen from Figure 5 that the potential wildfire identification threshold values vary greatly with the degrees of longitude and latitude. For the subregion in different selected area, the threshold value of the low latitude region ( Figure 5(a)) is significantly higher than that of the high latitude region ( Figure 5(b)) as it has higher background temperature. In the proposed method, the selection of the threshold is completely intelligent, and the algorithm makes full use of the background information of satellite imagery, which can be applied to different latitude regions and seasons.

Regional Performance.
e proposed algorithm was then applied to the VIRR satellite images that cover the same period (13-20 February 2018), i.e., when the bulk of the wildfire events burst in Hunan province. ree hundred and twenty-nine wildfires were detected where 31 of them were located within corridor areas of electrical transmission lines as shown in Table 2. It can be seen that most wildfire occurs on 14 th February, which is the day before Chinese Spring Festival. Affected by customs, a large number of farmers burn garbage and grass on that day, and most of the wildfires near electrical transmission lines were located near residential areas. For wildfires around cities, due to the urban thermal effect, the temperature difference of the wildfire pixels and nonwildlife pixels is small, and the identification of wildfires is more difficult. Figure 6 illustrates four fire events (Figures 6(a)-6(d)). It can be seen that the algorithm is effective to detect the colder or smaller wildfire pixels. However, some of the wildfire events were omitted due to the effect of cloud cover on 18 th February and 19 th February. e size of the minimum detectable wildfire (Figures 6(e)-6(i)) relies on the wildfire intensity and on the radiative temperature of the environment. e advantage of the proposed algorithm is its self-adaptive and its ability to generate the wildfire threshold automatically, which avoids the limitations of human subjectivity. According to the application statistics during the year of 2018, the algorithm provides an omission error of less than 10%. In terms of sensitivity to radiative temperature variations, better results will be obtained when the temperature contrast between wildfires and the background environment increased. It is possible to draw a conclusion that the proposed algorithm can also be effective when applied to other similar sensors, such as AVHRR and MODIS, to take full advantage of the available data and reduce errors to a minimum.

Evaluation Metrics.
e validation evaluation in this section aimed to test the accuracy of the proposed algorithm using omission error rate and commission error rate. To achieve this goal, MODIS active wildfire products and wildfire-detected results using the previous VIRR algorithm were used. e MODIS active wildfire products based on the collection 6 algorithm (MOD14A1-C6) have been utilized in various scientific research projects and practical operations for decades. ese wildfire events can be found on NASA Earth Observatory website [38]. ere was a possibility that the difference in imaging times from VIRR and MODIS instrument could affect the results, but these data were still able to provide sufficient information about wildfire events. Considering the divergence in imaging time between the Aqua satellite and FengYun-3C satellite is more obvious than that between Terra and FengYun-3C, and only the wildfire events from Terra satellite are selected for the validation evaluation. For the previous VIRR algorithm, T * 3 and ΔT * were set as fixed values at 315K (305K at night) and 15K (10K at night), respectively.
True-and false-detected VIRR active wildfire events are computed, respectively, for the omission error rate and commission error rate. Any MODIS fire pixels without corresponding VIRR detection will be marked as omission error. For the calculation of commission error rate, the true wildfire detection event indicates the number of VIRR wildfire pixels that have MODIS wildfire pixels within a 1pixel buffer, or the wildfire event is verified by the operator on duty. e buffer is introduced to take account of the differences between the instruments. Besides, the entire detected wildfire results using the proposed algorithm will be reported to the appropriate authorities by the duty room, and the feedback message whether the wildfire event is true or false is collected.

Results and Discussion.
To quantify the accuracy of the proposed algorithm and test its effectiveness in various situations, the available samples covering the period from January 2019 to April 2019 is used, and the target area is extended to nine different target province areas, which are shown in Figure 7. Corridor areas within 3 km of the electrical transmission lines over 220 kV in the above target areas were selected as the study area, which is introduced in Section 2.1. e detailed comparison results regarding both the commission and omission errors rate are shown in Figures 8 and 9.
It can be seen that the proposed algorithm achieves over 10% decline than the previous algorithm for the omission errors rate. e employment of the 2D Otsu method makes it possible to find a smaller size wildfire event. For the omission errors in Figure 8, in most cases, the errors come from the difference in imaging times from the VIRR and MODIS instruments. Among the target areas, it can be seen that a higher omission errors rate occurs in the southern of China, such as the Jiangxi and Hubei province area. For the most omission errors in these areas, one obvious type of mistake occurs in areas where there are cloud bodies, and fires are omitted automatically by the cloud mask. he superiority of the proposed algorithm compared to the previous algorithm is shown in Figure 10, in which a typical example of improvement made by the proposed algorithm is due to the detection of wildfire event 2 on 2 nd April 2019. e detected wildfire occurs in the Shanxi province area, and the wildfire event 1 as shown in Figure 10 contains over 8 wildfire pixels with the maximum brightness temperatures reaching 349 K. While the maximum brightness temperatures of T 3 in the wildfire event 2 is just 314 K and the wildfire pixel marked in yellow has a brightness temperature with 311 K, which are both lower than the fixed threshold values. Figure 11 shows the probability distribution of T 3 for all the pixels in the selected area. In this daytime case, 92% of pixels had a brightness temperature T 3 below the 315 K fixed value used in the previous algorithm. However, almost 30% of the pixel had a brightness temperature difference threshold (ΔT) that exceeded the fixed value of 15 K, which will cause commission errors. e above condition has been verified in Jiangxi and Shanxi province areas, in which the commission errors rate of the previous method is higher than the proposed method. e commission errors made by the proposed algorithm are mainly due to the loose constraint in the dynamic T 3 thresholds. For the most commission errors in Jiangxi and Hubei province areas, it has been proven to be caused by an industrial boiler. Moreover, the high temperatures in nonfire areas occur in Liaoning and Jinin province areas and maybe also an important factor for the commission errors. Overall, although the commission errors still exists, the proposed algorithm produces improved wildfire detection results compared with the previous algorithm, both in terms of increased accuracy and reduced errors.

FY3C-2019_04_02_11_02_VIRR
Wildfire event 2 Wildfire event 1 Figure 10: Active wildfire detection results for a typical example.

Conclusions
In this paper, we introduced a new wildfire-detection algorithm based on the 2D Otsu method and contextual tests.
In this algorithm, a 2D histogram of the brightness temperatures is constructed, and the potential fire threshold is selected automatically. e following conclusions can be drawn: (1) the introduction of the 2D Otsu method makes the selection of the potential fire threshold automatic, which avoids the limitations associated with human subjectivity.
(2) e algorithm makes full use of the background information of satellite imagery, which has accurate low-temperature wildfire detection ability.

Data Availability
e data used to support this study are included within this article and will be made available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.