## 2 LSDF-Net and Structural Optimization of the Network
### Sequential-Differential-Frame Input and Optimization  
The existing infrared dim small target detection algorithms can be divided into single-frame detection methods and sequential-frame detection methods. Much research progress has been made in the field of single-frame detection. However, single-frame detection methods lack temporal information and mainly rely on the gray-level and spatial information of infrared images to complete detection, usually resulting in a higher false-alarm rate in low SNR scenes. The input of the proposed LSDF-Net network is four time-sequential images. The four input images are differentiated frame by frame; the current frame is successively subtracted by the previous three frames. The differential layer diagram is shown in Figure 2, where X is the original sequence image with a size of M \(\times\) N \(\times\) 4, Y is the sequential-differential-frame image with a size of M \(\times\) N \(\times\) 3, and M and N are the width and height of the image. The sequential images contain gray-level, spatial, and temporal information, which significantly increases the amount of information in the input. After the sequential images are input, the images are differentiated to improve the SNR. Through network learning, small target motion information can be effectively used to improve the target detection rate and suppress the false-alarm rate. As shown in Figure 3, after image differentiating, most of the stationary background clutter is removed, while moving targets are not. Additionally, moving clouds and targets are distinguished based on their different shapes and sizes. Figure 1: Schematic diagram of the network structure. Figure 2: Schematic diagram of the sequential image differential. The differential image can highlight the changed area by calculating the pixel-level difference between sequential frames, which can effectively highlight the moving target and eliminate slow-moving background interference information, thus improving the SNR and facilitating subsequent target detection and tracking. Differential images are generated by the differential layer in the LSDF-Net. Introducing a differential layer into the network structure will increase both the number of layers and the inference time. To reduce the layers of the network, a sequential-differential acceleration method is proposed, which does not need to add an additional differential layer while completing the image differentiation. Firstly, the network is trained with the differential layer. Once the network training is complete, the parameters of the convolution layer are fixed, and the differential layer also has established parameters, allowing it to be combined with the adjacent convolution layer. The process of the differential layer of four-channel images is as follows:  
\[[X1\ X2\ X3\ X4]\left[ \begin{array}{ccc}1&1&1\\ -1&0&0\\ 0&-1&0\\ 0&0&-1\end{array} \right]=\left[X1-X2\ \ \ X1-X3\ \ \ X1-X4\right] \tag{1}\]  
where X1, X2, X3, and X4 are four time-sequential image inputs, and the output three-channel images are the inputs of the next convolution layer, with the convolution kernel Conv (\(\omega\), b), where \(\omega\) represents the weight of the convolution kernel, with a size of \(3\times 3\times 3\times 16\), and b represents the bias, with a size of \(1\times 1\times 16\). The convolution process of the channel differential image and Conv (\(\omega\), b) is as follows:  
\[=  
\[ \begin{bmatrix}X1-X2\\ X1-X3\\ X1-X4\end{bmatrix} * \begin{bmatrix}\omega_{1i}\\ \omega_{2i}\\ \omega_{3i}\end{bmatrix} =(\omega_{1i}+\omega_{2i}+\omega_{3i})X1-\omega_{1i}X2- \omega_{2i}X3-\omega_{3i}X4\\ = \begin{bmatrix}X1\\ X2\\ X3\\ X4\end{bmatrix} * \begin{bmatrix}\omega_{1i}+\omega_{2i}+\omega_{3i}\\ -\omega_{1i}\\ -\omega_{2i}\\ -\omega_{3i}\end{bmatrix} ,\;(i=1,2,\ldots,16)\end{bmatrix} \tag{3}\]  
Rewriting the above equation yields  
\[ \begin{bmatrix}X1-X2\\ X1-X3\\ X1-X4\end{bmatrix} *\omega+b=X*\omega_{diff-conv}+b \tag{4}\]  
where  
\[\omega_{diff-conv}=