# DMA-Net: Decoupled Multi-Scale Attention for Few-Shot Object Detection
## 3 Proposed Methods
### Module Architecture
#### 3.2.1 Decoupled Multi-Scale Attention Module  
How to manage the relationship between the support and query branches is the key point of FSOD networks based on a meta-learning strategy. In the previous methods, such as those in [25; 26], support information was only used as the object of attention after RPN. Similarly, [51; 52; 53] utilized support information solely to enhance the classification ability after RPN, without considering the use of multi-scale or single-scale features. Although [47; 52] extracted multi-scale features, they only added support information to the detection module without applying multi-scale feature extraction to the support branch, followed by multi-scale attention operation to fuse features from the two branches before RPN. Moreover, [28; 32] simply performed a single-size fusion operation prior to RPN. They ignored the significance of the RPN module, which generates anchors and performs preliminary proposal screening, directly impacting subsequent classification performance. We also analyzed the contradiction difference between the proposed model and the original Faster R-CNN [3], and identified a problem of inconsistent parameter properties between the two branches. Therefore, we propose a novel module called the Decoupled Multi-scale Attention Module (DMAM), which takes into account the location and mode of support information fusion while ensuring the uniformity of the gradient and update parameters. Figure 3 consists of three primary parts, each of which will be described in detail below. Figure 2: Architecture of DMA-Net. We used a weight-shared network to perform feature extraction on both the query image \(I_{q}\in\mathbb{R}^{H_{q}\times W_{q}\times C}\) and the support images \(S=\left\{S_{1},\ldots,S_{n}\right\}_{n=1}^{N}\). In particular, the support features fed into DMAM came from the prototype of \(K\) positive support images \(S_{p}=\left\{S_{p}^{1},\ldots,S_{p}^{k}\right\}_{k=1}^{K}\). The prototype was simply the mean of \(S_{p}\), which can be defined as:  
\[I_{s}=\frac{1}{K}{\sum}_{i=1}^{K}\,S_{p}^{i},S_{p}^{i}\in S_{p},I_{s}\in \mathbb{R}^{H_{q}\times W_{q}\times C}, \tag{1}\]  
We fed the support image \(I_{s}\) and query image \(I_{q}\) into ResNet50 to extract corresponding preliminary features \(f_{s}\) and \(f_{q}\). Subsequently, we applied a fusion operation to combine the support information with the query features before the RPN, allowing the support features to participate in proposal generation. Therefore, the RPN had a stronger ability to filter anchors based on the foreground and background, which reduced the burden of passing many irrelevant objects to the subsequent tasks of the detector and performed better when using the detector with the help of support information. The processing of the features which were input into the RPN consisted of two parts, feature extraction and feature fusion, which will be introduced next. (1) Feature Extractor  
The FSOD task is still an object detection task in essence, and faces the problem of recognizing small objects, which becomes more serious in the case of rare samples. Training with multi-scale features is an important operation that can ameliorate the problem of small objects and enrich available feature information as much as possible when the sample information is sparse. We use a feature pyramid network (FPN) [19] to extract multi-scale features. After a bottom-up pathway in Resnet50, we implemented the outputs of the last residual blocks in each stage and denoted the outputs of conv2, conv3, conv4, and conv5 as [C2, C3, C4, C5]. After the set of feature maps had been determined, a top-down pathway was applied. As shown in Figure 4, we used a \(1\times 1\) convolutional layer to perform channel dimension alignment, and the feature dimension was set to \(d=256\) in this paper.