# A Spatio-Temporal Model for Forest Fire Detection Using HJ-IRS Satellite Data
## 3 Methodology
### Overview of the Improved Algorithm
#### 3.2.4 Relative Fire Pixel Judgment Based on STM  
In the contextual algorithm, potential fire pixels whose observed BT values were significantly different from the background intensities (predicted BT values) were considered to be actual fire points. Thus, the background BT prediction played an important role in the fire detection. The mean value of the valid neighboring pixels was regarded as the background intensity in the contextual algorithms. However, it was occasionally difficult to use that value to indicate the characteristics of the background because of spatial heterogeneity. For example, the mean value in frame \(t_{3}\) (Figure 7) cannot be taken as the background intensity of the question mark because 15 is a better choice than 30 according to the data distribution in frames \(t_{1}\) and \(t_{2}\). It is obvious that the strong correlations between the center grid and its neighboring grids in frames \(t_{1}\) and \(t_{2}\) are helpful for predicting the background intensity of the center grid in frame \(t_{3}\). Spatial heterogeneity is a common phenomenon in remote sensing images. Figure 8 shows the BT changes of an inspected pixel and its neighboring pixels over time. The size of each image is \(21\times 21\), and we had 441 time series with lengths of 13 frames. The correlation coefficients between the inspected time series and the neighboring time series are shown in Figure 9. The mean of the correlation coefficients was 0.8021, which indicates a high correlation. Thus, a spatio-temporal model can be built using the correlation relationship between the pixels to predict the background intensity with multi-temporal images. Figure 8: BTs distribution from band 7 for 13 IRS images. The red pixel is the inspected pixel in the window. Figure 7: Background intensity prediction for frames with spatial heterogeneity. Background BT Prediction  
In the proposed model, let SC\({}_{t_{n}}=\{T_{t_{n}}(i,j)|lx-l\leqslant i\leqslant lx+l,ly-l\leqslant j \leqslant ly+l,i\
eq lx,j\
eq ly\}\) be the spatial context of pixel \((lx,ly)\), where \((2l+1)\times(2l+1)\) is the window size, \((i,j)\) is the index of a pixel in the image, and \(T_{t_{n}}(i,j)\) represents the BT value at pixel \((i,j)\) in the image acquired at time \(t_{n}\). The spatial relationship between \(T_{t_{n}}(lx,ly)\) and each of its neighboring pixels in \(SC_{t_{n}}\) is simply defined by the following equation:  
\[f_{t_{n}}(i,j)=\frac{T_{t_{n}}(lx,ly)}{T_{t_{n}}(i,j)} \tag{9}\]  
where \(n=1,2,\ldots,N\), and \(N\) is the number of images used in the fire detection algorithm. The spatial relationship is updated using  
\[F_{t_{n+1}}=\rho_{1}\times f_{t_{n}}+(1-\rho_{1})\times F_{t_{n}}\ \ (0\leqslant\rho_{1}\leqslant 1) \tag{10}\]  
where \(f_{t_{n}}\) is the spatial relationship computed by Equation (9) in the \(n\)-_th_ image, \(F_{t_{1}}(i,j)=1\), \((i,j)\in SC_{t_{n}}\), and \(\rho_{1}\) is a learning parameter that controls the weights of the images acquired at different time points. In particular, the spatial relationship between the inspected pixel and its neighboring pixels is only decided by its previous image when \(\rho_{1}=1\), and the previous one does not contribute to the spatial relationship calculation when \(\rho_{1}=0\). In STM, an ideal hypothesis is that the spatial relationship remains unchanged over time. The spatial relationship of the current pixel should be decided by all of the previous images to meet this requirement. Thus, \(\rho_{1}\) should not be larger than 0.5. To obtain satisfactory fire pixels detection results, \(\rho_{1}=0.25\) is a good choice. The background BT can then be computed by  
\[T^{\prime}{}_{t_{n}}(lx,ly)=\frac{1}{(2l+1)\times(2l+1)-1}\sum_{(i,j)\in SC_{ t_{n}}}[F_{t_{n}}(i,j)\times T_{t_{n}}(i,j)] \tag{11}\]  
where \(T^{\prime}{}_{t_{n}}(lx,ly)\) is regarded as the background BT at time \(t_{n}\). For the first image (\(n=1\)), the mean value of the valid neighboring pixels is regarded as the background BT. Importantly, the pixels in the background BT calculation must be valid.