# Solar Filament Detection Based on an Improved Deep Learning Model
## 4 Method
### CNN Decoder  
The CNN Decoder uses Decoder Blocks to restore the size of the image while integrating the information provided by the skip connections. The structure of the Decoder Block is shown in Figure 9.  
In the Decoder Block, the feature is first enlarged using a 2 \(\times\) 2 linear interpolation. Subsequently, feature concatenation is performed with the skip connection. Additionally, a Deformable Large Kernel Attention (DLKA) [31] is employed to better integrate the feature with the information from the skip connection. Finally, a 3 \(\times\) 3 convolution is used to extract features and adjust the number of feature channels.  
During training of the model, continuous convolving can easily lead to the loss of filament edges and detailed information. However, information in different spatial locations in the filament feature map is of varying degrees of importance and should therefore be assigned different weights. The integration of an attention mechanism into the network can adjust the weights of different locations in the filament feature map, focusing on key feature areas with high weights and ignoring irrelevant information with low weights. By incorporating DLKA into the Decoder Block, the network can pay attention to the key features of filaments while better integrating local detail information preserved by the CNN Encoder with high-level global features in the CNN Decoder.  
During solar filament feature extraction, the larger the convolution kernel size, the more comprehensive the information that the model can access. However, using large-size convolution kernels may introduce too many model parameters and reduce training efficiency. To avoid this issue, large kernel convolution can be decomposed into depthwise convolutions [32], depthwise dilated convolutions, and \(1\times 1\) convolutions. This decomposition method can effectively reduce the number of parameters while achieving equivalent convolutional effects to large-size convolution kernels [33]. Figure 10 demonstrates the process of decomposing a 7 \(\times\) 7 large kernel convolution into a 3 \(\times\) 3 depthwise convolution, a 3 \(\times\) 3 depthwise dilated convolution, and a 1 \(\times\) 1 convolution.  
While decomposing a large kernel convolution, DLKA introduces deformable convolutions into the depth convolution [34]. The structure of DLKA is shown in Figure 11, which is composed of a deformable depth convolution (Deform-DW Conv), a deformable depth dilation convolution (Deform-DW-D Conv), and a 1 \(\times\) 1 convolution.  
Figure 9: Structure of the Decoder Block.  
The structure of the deformable depthwise convolution (Deform-DW Conv) is shown within the dashed box in Figure 11. It adds offsets to the depthwise convolution kernel, allowing adaptive adjustment of the kernel shape, thus accommodating the variable shapes of the solar filaments. The deformable depthwise dilated convolution (Deform-DW-D Conv) is similar to the deformable depthwise convolution, except that it uses a depthwise convolution kernel with a dilation rate. Subsequently, an attention map is obtained through a \(1\times 1\) convolution. Finally, the obtained attention map is multiplied with the input solar filament features to adjust the weights of different locations in the feature map.  
DLKA uses deformable convolutions to adapt to different shapes of solar filaments and can adjust the attention weights channel by channel. The method described in this article uses DLKA in CNN Decoder to help the model pay more attention to solar filament features while suppressing unnecessary information and fully integrating encoder and decoder information.