# Spectral Information Divergence-Driven Diffusion Networks for Hyperspectral Target Detection
## 3 Proposed Method
### Background Learning Based on Diffusion Model  
This paper builds on the diffusion model in the BSDM proposed by [PERSON] et al. (2018), using a Gaussian distribution \(\mathbf{N}\sim\mathcal{N}\big{(}\mu,\sigma^{2}\big{)}\), with the same mean and variance as the input HSI as the pseudo background noise, where \(\mu\) is the mean of the background samples and \(\sigma\) is the standard deviation of the background samples. Figure 3 illustrates the schematic of the forward noise addition process and the denoising network in the diffusion model. The zero-moment data \(b_{0}\) is sampled from the background data distribution \(q(x)\), i.e., \(b_{0}\sim q(x)\). The forward diffusion process involves the gradual addition of \(T\) noises to \(b_{0}\), where \(\epsilon_{0},...,\epsilon_{t-2},\epsilon_{t-1}\) all follow a Gaussian distribution \(\mathbf{N}\sim\mathcal{N}\big{(}\mu,\sigma^{2}\big{)}\). This entire process is represented mathematically in Equation (7):  
\[ \begin{split} q(b_{t}\mid b_{t-1})=\mathcal{N}\Big{(}& b_{t};\sqrt{1-\beta_{t}}b_{t-1}+\mu\sqrt{\beta_{t}},\sigma^{2}\beta_{t} \mathbf{I}\Big{)}\\ &\text{s.t., }\beta_{t}=\frac{\lambda t}{T}\end{split}  \tag{7}\]  
where \(b_{t}\) represents the background sample after t-step diffusion, \(\beta_{t}\) represents the noise intensity, \(\lambda\) is a hyperparameter controlling \(\beta_{t}\), and and \(\mathbf{I}\) is the identity matrix.The forward process can be regarded as a Markov process since each moment \(t\) is only related to the \(t-1\) moment, so the relationship between the \(t\) moment and the initial moment can be recursively introduced as shown in Equation (8):  
\[q(b_{1:T}\mid b_{0})=\prod_{t=1}^{T}q(b_{t}\mid b_{t-1}) \tag{8}\]  
To simplify the calculation, this paper uses the reparameterization technique in DDPM and defines \(\sqrt{\alpha_{t}}=\sqrt{1-\beta_{t}}\), \(\tilde{\alpha}_{t}=\prod_{t=1}^{T}\alpha_{i}\), so that \(b_{t}\) can be expressed as Equation (9):  
\[ \begin{split} b_{t}&=\sqrt{\alpha_{t}}b_{t-1}+ \sqrt{1-\alpha_{t}}\epsilon_{t-1}\\ &=\sqrt{\alpha_{t}\alpha_{t-1}}b_{t-2}+\sqrt{1-\alpha_{t}} \alpha_{t-1}\epsilon_{t-2}\end{split}  \tag{9}\]  
Figure 3: Schematic of the forward noise addition process and the denoising network in the diffusion model. Since \(\epsilon_{t-1}\) and \(\epsilon_{t-2}\) both follow a Gaussian distribution, they can be combined based on Gaussian properties, with \(\epsilon\) representing the resulting distribution. Equation (10) is derived through recursion. \[b_{t} =\sqrt{\bar{\alpha}_{t}}b_{0}+\theta_{t}\epsilon\] (10) s.t., \[\theta_{t}\epsilon \sim\mathcal{N}\Big{(}\mu\theta_{t},(1-\bar{\alpha}_{t})\sigma^{2} \Big{)}\]  
\(\epsilon\) represents a Gaussian function comprising multiple moments, and \(\theta_{t}=\sum_{k=0}^{t-1}\sqrt{\frac{\bar{\alpha}_{t}\bar{\alpha}_{t-k}}{ \bar{\alpha}_{t-k}}}\). Substituting this into Equation (8) results in Equation (11):  
\[q(b_{t}\mid b_{t-1})=\mathcal{N}\Big{(}b_{t};\sqrt{\bar{\alpha}_{t}}b_{t-1}+ \mu\theta_{t},(1-\bar{\alpha}_{t})\sigma^{2}\mathbf{I}\Big{)} \tag{11}\]  
The above describes the forward diffusion process of the diffusion model, which obtains the distribution of background samples at \(T\) moments. This process is expressed in Equation (12):  
\[\mathbf{B}^{t}=\mathbf{B}\oplus_{t}\mathbf{N}=\sqrt{\bar{\alpha}_{t}}\mathbf{ B}+\theta_{t}\mathbf{N} \tag{12}\]  
The inverse process of the diffusion model is typically denoised using a deep neural network with the structure of the denoising network illustrated in Figure 3. The spectral vector in \(\mathbf{B}^{t}\) serves as the input,while the estimated noise \(\mathbf{n}^{i}\) at the \(t\)-th step is the output, as expressed in Equation (13):  
\[\mathbf{n}^{i}=f\big{(}\mathbf{B}^{t};\gamma\big{)} \tag{13}\]  
where \(f\) represents the deep learning network and \(\gamma\) denotes its parameters. The network f primarily comprises a temporal embedding layer and a differential Transformer. This paper initially adopts the same temporal embedding method as DDPM.