# BA-YOLO for Object Detection in Satellite Remote Sensing Images
## 3 Materials and Methods
### Ba-Yolo
#### 3.2.2 BIFPN  
In remote sensing image object detection, there can be significant variations in the sizes of target objects, such as small vehicles and football fields. By propagating high-level features down to complement the semantics of lower-level features, it is possible to obtain high-resolution and semantically rich features, which are advantageous for the detection of small objects. Figure 1: The architecture of the BA-YOLO. The dashed lines in the figure represent weighted feature fusion. The architecture of the BA-YOLO. The dashed lines in the figure represent weighted feature fusion. The details of each module in the BA-YOLO are shown in the lower part of Figure 1.  
Figure 2: The overview of ACmix. PANet further explores cross-scale connections, as illustrated in Figure 3a. In this work, as depicted in Figure 3b, a simple yet efficient Weighted Bi-Directional Feature Pyramid Network (BiFPN) was introduced to optimize cross-scale connections. The introduction of BiFPN significantly improved the performance of EfficientDet [41]. It enabled the model to better handle objects of different scales and improved detection performance. BiFPN achieves effective integration of multi-scale features through the introduction of bidirectional cross-scale connections and fast normalization fusion with learnable weights. Firstly, we eliminated nodes with only one input edge. Furthermore, if the initial input node aligns with the output node at the same network level, we introduce an additional connection from the original input node to the output node. Secondly, BiFPN introduces learnable weights when merging low-level and high-level features to learn the importance of different input features, rather than simply summing or connecting them. Formally, given a list of multi-scale features \(\overset{\rightarrow}{P}=(P_{l1}^{in},P_{l2}^{in},\ldots)\), where \(P_{l1}^{in}\) presents the feature at level \(l_{i}\). The list of intermediate features on the pathway is represented as \(\overset{\rightarrow}{P}^{td}=(P_{l1}^{td},P_{l2}^{td},\ldots)\). Our goal is to find a method \(f:\overset{\rightarrow}{P}^{out}=f(\overset{\rightarrow}{P}^{in})\) that effectively aggregates different features and produces a set of new features as output. Figure 3a illustrates the conventional top-down and bottom-up PANet. It takes level 3-7 input features, \(\overset{\rightarrow}{P}^{in}=(P_{3}^{in},\ldots,P_{7}^{in})\), where \(P_{l_{i}}^{in}\) represents a feature level with a resolution of \(1/2^{i}\). The traditional PANet aggregates multi-scale features in a simple summation manner, for example, at layer 4:  
\[P_{4}^{td}=Conv(P_{4}^{in}+Resize(P_{5}^{td})) \tag{1}\]  
\[P_{4}^{out}=Conv(P_{4}^{td}+Resize(P_{5}^{out})) \tag{2}\]  
whereas _Resize_ is usually an upsampling or downsampling operation performed to match the resolution, _Conv_ is typically a convolution operation used for feature processing. BiFPN integrates bidirectional cross-scale connections along with fast normalization fusion with learnable weights. As a specific example, here, we describe the fusion of two features at level 4 in BiFPN, as shown in Figure 3b. \[P_{4}^{td}=Conv(\frac{w_{1}\cdot P_{4}^{in}+w_{2}\cdot Resize\left(P_{5}^{td} \right)}{w_{1}+w_{2}+\varepsilon}) \tag{3}\]  
\[P_{4}^{out}=Conv(\frac{w_{1}^{{}^{\prime}}\cdot P_{4}^{in}+w_{2}^{{}^{\prime}} \cdot Resize\left(P_{4}^{td}\right)+w_{3}^{{}^{\prime}}\cdot Resize\left(P_{3} ^{out}\right)}{w_{1}+w_{2}+w_{3}+\varepsilon}) \tag{4}\]  
Figure 3: Feature network design (**a**) PANet adds an additional bottom-up pathway on top of FPN. (**b**) BiFPN implements two optimizations for cross-scale connections. In the above formulas, \(P_{4}^{td}\) represents the intermediate feature at level 6 on the top-down pathway, and \(P_{4}^{out}\) represents the output feature at level 4 on the bottom-up pathway. All other features are constructed in a similar manner.