# Efficient Open-Set Recognition for Interference Signals Based on Convolutional Prototype Learning
## 4 Proposed Method
### Feature Extractor and Prototype Classifier
#### 4.1.2 Hybrid Domain Attention Module  
SENet [37] applies the idea of an attention mechanism to the CNN to recalibrate channel-wise feature responses by explicitly modeling interdependencies between channels adaptively. However, in 1 DCNN, except the channels, different time points should also be given different attention. Therefore, we propose a hybrid domain attention module (HDAM) to recalibrate the time-wise and channel-wise feature responses by constructing a global attention matrix automatically. The HDAM structure is shown in Figure 3, which recalibrates two domains while the SENet recalibrates one domain, i.e., channel-wise. Figure 2: Feature reuse structure with a TAM. \(X\) is the input feature map of HDAM, \(A\) is the global attention weight matrix, \(\mathbf{X}^{\prime}\) is the output feature map of HDAM and their elements are \(\mathbf{X}(t,c)\), \(A(t,c)\) and \(\mathbf{X}^{\prime}(t,c)\), respectively. First, to get time-wise and channel-wise statistics, the HDAM adopts time-wise and channel-wise global average pooling for the feature map, as shown in Equations (6) and (7):  
\[\mathbf{y^{1}}=F_{time}^{sq}(\mathbf{X})=\frac{1}{C}\sum_{c=1}^{C}\mathbf{X}(:,c) \tag{6}\]  
\[\mathbf{z^{1}}=F_{channel}^{sq}(\mathbf{X})=\frac{1}{T}\sum_{t=1}^{T}\mathbf{X}(t,:) \tag{7}\]  
where \(F_{channel}^{sq}(\cdot)\), \(F_{time}^{sq}(\cdot)\), \(\mathbf{y^{1}}\) and \(\mathbf{z^{1}}\) indicate the time-wise global average pooling function, channel-wise global average pooling function, time-wise statistics and channel-wise statistics, respectively. Then, two bottlenecks with two fully connected (FC) layers are used to learn time-wise and channel-wise dependencies automatically, and one-dimensional attention weight vectors are obtained as follows:  
\[\mathbf{y^{2}}=F_{time}^{ex}(\mathbf{y^{1}};W_{t})=\sigma(\delta(\mathbf{y^{1}}W_{t}^{1})W _{t}^{2}) \tag{8}\]  
\[\mathbf{z^{2}}=F_{channel}^{ex}(\mathbf{z^{1}};W_{c})=\sigma(W_{c}^{2}\delta(W_{c}^{1} \mathbf{z^{1}})) \tag{9}\]  
where \(F_{time}^{ex}(\cdot)\), \(F_{channel}^{ex}(\cdot)\), \(\mathbf{y^{2}}\) and \(\mathbf{z^{2}}\) indicate a time-wise bottleneck, channel-wise bottleneck, time-wise attention weight vector and channel-wise attention weight vector, respectively. \(\delta(\cdot)\) refers to the ReLu function, \(W_{t}^{1}\in\mathbb{R}^{C\times\frac{C}{\delta}}\), \(W_{t}^{2}\in\mathbb{R}^{\frac{C}{\delta}\times C}\), \(W_{c}^{1}\in\mathbb{R}^{\frac{C}{\delta}\times T}\), \(W_{c}^{2}\in\mathbb{R}^{T\times\frac{T}{\delta}}\) and \(q\) is the compression rate. Using a one-shot activation function will lead to the feature of only one channel and one time position being emphasized, while the rest of the features are suppressed, so \(\sigma(\cdot)\) should be a sigmoid function, which controls the magnitude of the attention weight vector units. Note that \(\mathbf{y^{1}}\) and \(\mathbf{y^{2}}\) are row vectors, while \(\mathbf{z^{1}}\) and \(\mathbf{z^{2}}\) are column vectors. The global attention weight matrix \(A\) is obtained by multiplying \(\mathbf{y^{2}}\) and \(\mathbf{z^{2}}\):  
\[\mathbf{A}=\mathbf{z^{2}y^{2}} \tag{10}\]  
Specifically, \(\mathbf{A}(t,c)\) indicates how much attention should be paid to the data of time point \(t\) of the \(c\)-th channel. Finally, the recalibrated output feature map \(\mathbf{X}^{\prime}\) is obtained by element-wise multiplying \(A\) and \(\mathbf{X}\):  
\[\mathbf{X}^{\prime}=\mathbf{A}\odot\mathbf{X} \tag{11}\]  
where \(\odot\) is the Hadamard product. Since the receptive fields of the convolution kernel of the CNN are local, each unit of the feature map cannot exploit the contextual feature information outside of the corresponding time window. However, the HDAM can aggregate the global information in the pooling stage of the channel domain and the dependent learning stage of the time domain, so that all units can obtain the information outside the time window in the middle layer, unlike  
Figure 3: HDAM structure.