# DIR-Net: Deep Residual Polar Decoding Network Based on Information Refinement
## 3 DIR-Net Method
### Attention-Based Denoising Subnetwork
Compared with direct learning, the residual method enables the network to converge more easily and achieve a better denoising effect. We connect an attention module after each residual block. Figure 3: Curves of (**a**) ReLU and (**b**) LReLU. Figure 2: Structure of residual block. The attention module learns to suppress noise and preserves only valid information. To improve the denoising performance of the network, multiple residual blocks and attention modules are cascaded as shown in Figure 3, such that the codeword can be refined by these blocks step-by-step. Consequently, the noise of the signal reaches a relatively low level, thereby laying a foundation for the subsequent decoding processing. We add two attention modules to the network for separating the signal and noise, namely, local and global attention modules. As an independent module, the attention module only changes the value of the feature without changing its shape. Thus, it can be inserted anywhere on the network. A local attention module is inserted between every two residual blocks to optimize local features. Furthermore, the output of the feature by the last residual block is optimized by a global attention module. The structure of the attention module is shown in Figure 4. For a feature with the shape \(C\times L\) that needs to be processed, it needs to be divided into two branches. Here, \(C\) is the number of feature channels, and \(L\) is the length of the feature. For the first branch, a global average pooling layer is utilized and the channel feature with shape \(C\times 1\) is outputted. For the other branch, an \(1\times 1\) convolution layer is used, and the spatial feature with shape \(1\times L\) is outputted. Both features are processed by the sigmoid function to limit the value to the range [0, 1]. They are multiplied with the original features as weights. Among them, the normalized channel feature is multiplied by the original feature on each channel. After that, the normalized spatial feature is multiplied by the channel-weighted features on every location in the spatial dimension. Unlike the local attention module, the attention weights of the global attention module derive from all shallow features. The features from all residual blocks are concatenated together, and a \(1\times 1\) convolution layer is utilized to generate the features that have the same shape as the final feature. The weight matrix is generated from this feature and applied to the final feature. In the last part of the subnetwork, a convolutional layer is used to map the codewords from the feature domain to the signal domain. A TanH activation function limits the signal value to [\(-1\), 1], which is defined as follows:  
\[TanH(x)=\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}. \tag{13}\]  
The detailed values of the denoising subnetwork parameters are listed in Table 1.  
Figure 4: Structure of (**a**) local attention module and (**b**) global attention module. In Table 1, \(k\) is the kernel and \(s\) is the stride. For example, \(k3s1\) denotes that the kernel is 3 and stride is 1. GAP represents global average pooling. In the training stage, the loss function (MSE) used to optimize the network is expressed as  
\[MSE=\frac{1}{m}\sum_{i=1}^{m}\left(\mathbf{y}_{i}-g(\mathbf{x}_{i})\right)^{2}, \tag{14}\]  
where \(\mathbf{y}_{i}\) and \(g(\mathbf{x}_{i})\) represent the true value and predicted value of the \(i\)-th sample, respectively, and \(m\) is the number of samples.