# Adaptive Feature Fusion for Small Object Detection
## 2 Materials and Methods
### Methods
#### 2.2.2 MMF-PANet Feature Fusion Module  
The network mainly relies on shallow features to detect small objects because the shallow features contain the complete shape and position information of the small objects, which are still in the initial stage of the network and have not been fully processed. The ability to express features is limited, and the receptive field is small. The global contextual information perception is weak and cannot be well adapted to small object detection. Therefore, in order to allow the shallow features to retain the spatial location information of their small objects, increase the connection of contextual information so that it can be fused with high-level semantics, and improve the utilization of foreground information, we propose a cross-scale, multi-path, and multi-flow feature fusion module with fusion factors, referred to as MMF-Net, which adds adaptive weights to each fusion branch, and its structure is shown in Figure 2.  
As can be seen from Figure 2, MMF-Net is composed of the fusion of features between different scales including two bidirectional fusion paths, namely the top-up and top-down paths. Compared with the original feature fusion network, five branches are added, two of which are the direct fusion of features across multiple levels and three skip connections, which can avoid the loss of object information during downsampling or pooling operations. The deep features are first fused with adjacent layers through the top-down path, while further feature extraction is completed, and P\({}_{3}\), P\({}_{2}\), P\({}_{1}\), P\({}_{0}\) are obtained, respectively. Then, when passing through a bottom-up aggregation path, it is fused with the features of the top-up path output and the output of the backbone network to obtain D\({}_{0}\), D\({}_{1}\), and D\({}_{2}\), respectively. In addition, considering that feature extraction at the same time as layer-by-layer splicing will lead to the loss of some feature information. In the feature fusion module, we added multiple radial paths of features feat1, feat2, and feat3 produced by the backbone network to P\({}_{0}\), D\({}_{0}\), D\({}_{1}\), and D\({}_{2}\), respectively. Its calculation process can be expressed as:  
\[P_{3}=f_{conv}^{1\times 1}(feat3) \tag{1}\]  
\[P_{2}=Cat(P_{3},feat2) \tag{2}\]  
\[P_{1}=Cat(f_{conv}^{1\times 1}(f_{conv}^{1\times 1}(P_{2})),feat1) \tag{3}\]  
\[P_{0}=Cat(Cat(f_{conv}^{1\times 1}(f_{conv}^{1\times 1}(P_{1})),\epsilon),feat3) \tag{4}\]  
Figure 2: The MMF-PANet module structure with the branch fusion factor. \[D_{0}=f_{conv}^{1\times 1}(f_{conv}^{1\times 1}(P_{0})) \tag{5}\] \[D_{1}=Cat(f_{conv}^{3\times 3}(D_{0}),P1)\] (6) \[D_{0}=Cat(Cat\left(Cat\left( \begin{pmatrix}f_{conv}^{3\times 3}(I_{ conv}^{1\times 1}(I_{conv}^{1\times 1}(D_{1}))),\\feat2&\\ f_{conv}^{1\times 1}(P_{2})&\end{pmatrix} ,feat3)\right),feat3) \tag{7}\]  
Equations (1)-(7) clearly show the direction of each feature in each path in the feature fusion module MMF-Net. In the formula, \(f_{conv}^{3\times 3}\) and \(f_{conv}^{1\times 1}\) represent the conventional convolution operations with convolution kernel sizes of \(3\times 3\) and \(1\times 1\), respectively, Cat represents feature map stitching operation, \(feat3,\ feat2,\ feat1,\ feat0\in R^{C\times H\times W}\). The feature fusion module that adds multiple paths can bring a large number of other size features to each level, alleviating the limitation of a fixed size. The feature information carried by each scale feature map has its own characteristics. For example, the shallow features focus on the location, contour, and other information of the object, and the receptive field is relatively small, which is not sensitive to global information and depends on the context content. The deeper features mainly express the detailed information such as the texture semantics of the object, and the receptive field is relatively large, which can take into account the overall situation.