## 2 The Proposed Method
### TVF and Screening Candidate Targets  
Over the past few decades, a range of approaches have been developed in the detection of small moving targets in infrared (IR) sequences. Among them, by using consecutive frames information to calculate the difference between the background and the target, the temporal contrast filter (TCF) has been used successfully to detect point targets. The key part of the TCF is the background signature estimation by the minimum filter to maximize the signal-to-noise ratio, however, when the illumination changes with a flicker, using the minimum brightness in consecutive frames as the background brightness value will make the detection effect worse. In order to avoid the influence of illumination change on the detection results, unlike TCF, our moving target detection uses temporal variation filtering rather than minimum filtering, so it is called TVF. If \(I(i,j,k)\) denotes the intensity of the \((i,j)\) pixel at the current k-th frame, the TVF at \((i,j,k)\) is defined by Equation (1) in which the buffer size k is selected by trading off the accuracy of the background estimation against the complexity of the TVF algorithm, which is an empirical value that is set to six in the experiment, and \(k-1\) frames are used to estimate the background intensity by the averaging function \(mean()\). One of the reasons for choosing the mean method rather than the median method for background estimation is that the former is faster. Another reason is that when a flicker slightly lower than the target brightness value appears in consecutive frames only once, the median method will reduce the difference between the current pixel and the predicted background, resulting in a failure of target detection. \[TVF(i,j,k)=I(i,j,k)-\underset{n=1,2,\cdots,k-1}{\mathrm{mean}}(i,j,n) \tag{1}\]  
Figure 1: The flow chart of the proposed bird detection algorithm. \[\text{Bi}(\text{i},\text{j},\text{k})= \begin{cases}1,&\text{TVF}(\text{i},\text{j}, \text{k})>\text{Thr}(\text{k})\\ 0,&\text{TVF}(\text{i},\text{j},\text{k})\leq\text{Thr}(\text{k})\end{cases}  \tag{2}\]  
\[\text{Thr}(\text{k})=\mu_{\text{TVF}}(\text{k})+\text{a}\sigma_{\text{TVF}}( \text{k}) \tag{3}\]  
The adaptive threshold segmentation is conducted by using Equation (2), where \(\mu_{\text{TVF}}(\text{k})\) and \(\sigma_{\text{TVF}}(\text{k})\) represent the mean and the standard deviation of the k-th frame image of TVF over along spatial dimension, respectively. If \(\text{TVF}(\text{i},\text{j},\text{k})\) is greater than a predefined threshold, Thr(k), the current-pixel Bi(\(\text{i},\text{j},\text{k})\) is binarized to 1, otherwise it is binarized to 0. We execute the open source Opencv library function cv2.findContours (Bi, cv2.RETR_TREE, cv2.CHIAN_APPROX_SIMPLE) to extract the target contour in which the arguments Bi, cv2.RETR_TREE, cv2.CHIAN_APPROX_SIMPLE denote the input image, retrieval mode, and approximate method, respectively; and, the region within the contour is declared a detected candidate target. It can be seen from the first-stage detection results in Figure 2 that the TVF algorithm can accurately detect the moving area. However, it is difficult to distinguish birds that are close to each other or overlap in space. In this way, identifying multiple birds as a single bird will inevitably lead to a certain degree of deviation in airport bird detection and prediction. Aiming at the problem that the first-stage detection algorithm is difficult to segment the clustered birds, this paper proposes a Gaussian heat map-aware bird target detection network to re-segment the candidate targets screened from the primary detection results so as to accurately locate the single birds appearing in the clustered area. Because the birds flying together basically belong to the same species and their size is similar to a certain degree, whether the detection result is a single bird can be judged according to the similarity between the candidate target area and the average area of birds.