# Accurate Tracking Algorithm for Cluster Targets in Multispectral Infrared Images
## 3 Methods
### Construction of the Target Observation Model  
Firstly, the SIR filter particle method [18] is used to construct the target observation model. The concrete steps include the selection of the particle state, the transfer of the system state, the construction of the observation model, the updating of the particle weight, and resampling. The operation steps are shown in Figure 2.  
Figure 1: PigNet network structure diagram. Figure 2: Process of construction of the target observation model. In the composition-building step of the SIR filter algorithm, one first selects the important probability function as:  
\[\text{q}(x_{k}^{(i)}|x_{k-1}^{(i)},y_{k})=p(x_{k}^{(i)}|x_{k-1}^{(i)}) \tag{5}\]  
Then, based on the particle weights:  
\[M_{k}^{(i)}\propto M_{k-1}^{(i)}\cdot\frac{p(y_{k}|x_{k}^{(i)})\cdot p(x_{k}^{ (i)}|x_{k-1}^{(i)})}{\text{q}(x_{k}^{(i)}|x_{k-1}^{(i)},y_{k})}=p(y_{k}|x_{k}^{( i)})\cdot M_{k-1}^{(i)} \tag{6}\]  
After resampling, again:  
\[M_{k-1}^{(i)}=\frac{1}{N} \tag{7}\]  
Finally, by simplification:  
\[M_{k-1}^{(i)}\propto p(y_{k}|x_{k}^{(i)}) \tag{8}\]  
This step realizes the theoretical derivation of the particle filtering algorithm. Here, \(M_{k}^{(i)}\) and \(M_{k-1}^{(i)}\) represent the \(k\) moments, \(k-1\) represents the particle weights, \(x_{k}\) represents the observed variable at moment \(k\), \(y_{k}\) represents the state at moment \(k\), \(p(y_{k}|x_{1:k})\) represents the posterior probability, \(q(y|x)\) represents the proposed distribution, and N represents the N samples sampled from the posterior probabilities. First, one selects the particle state using the following formula:  
\[W_{k}=(x,y,s) \tag{9}\]  
where \((x,y)\) represents the coordinates of the particles in the infrared image, that is, the center position of the particle rectangle; \(s\) represents the scale factor of the rectangle; and \(W_{k}\) represents the particle state. A total of 200 particles are selected from the SIR-filtered particles, and the selected particles are initialized and restored to their initial position at the center of the target frame. That is:  
\[W_{0}=(x_{0},y_{0},s_{0}) \tag{10}\]  
where \((x_{0},y_{0})\) represents the initial position of the center of the target box and \(s_{0}\) represents the scale factor of the initial change in the rectangular box. One initializes the particle scale to 1 and constructs the HSV color histogram of the initial position target box [19]. Then, the state of the system is transferred: the particle position is transferred from the previous frame to the next frame using the autoregressive second-order transfer model [20]. The autoregressive second-order transfer model randomly combines the previous particle states and predicts the particle position in the next frame based on the combined results. The specific expressions of the autoregressive second-order transfer model are as follows:  
\[X_{k}-\overline{X}=A_{1}\big{(}X_{k-1}-\overline{X}\big{)}+A_{2}\big{(}X_{k-2 }-\overline{X}\big{)}+R\cdot z \tag{11}\]  
where \(X_{k}\) represents the corresponding particle state at the time \(k\); \(\overline{X}\) represents the estimated mean value of all the particles; \(X_{k-1}\) represents the corresponding particle state at the time \(k-1\); \(X_{k-2}\) represents the corresponding particle state at the time \(k-2\); \(z\) stands for random noise; \(A_{1}\) and \(A_{2}\) are a pair of constants; and \(R\) represents the specific propagation radius of the particle. Then, one predicts the specific state of particles at the time \(k\) according to the above formula Then, we construct the observation model. After the particle position prediction in the next frame, we must observe the particles to judge the actual similarity between the target and the real state. If the actual similarity is high, it will be given a larger weight, and vice versa.