# A Novel Hierarchical Adaptive Feature Fusion Method for Meta-Learning
## 3 Method
### Feature Fusion  
This section describes the feature fusion method. In convolutional neural networks, the shallow feature contains a lot of low-level information. It is more concerned with details, while the deep feature contains a lot of high-level information and is more concerned with semantics. In Feature Pyramid Network [24], the input image is deeply convolved first, then the feature output from stages 2 and 4 are added, and the obtained results are fed into stage 5 to obtain strong semantic information and improve detection performance. In this work, the adaptive feature fusion method is used to obtain strong expression features to mine and effectively utilize different stages' information.  
First of all, the meta training set is used for training according to GEFS [23] to obtain a good embedding model, as depicted in Figure 3.  
After obtaining a good embedding model, the N-way K-shot strategy on the meta-evaluation set/meta-testing set is used to obtain the support set and the query set. The embedding model is used to extract the features of the support and query sets. To obtain good performance feature, features are output and pooled at each stage of the embedding model. The calculations are as follows:  
\[\widehat{f}_{l}=Pooling(layer_{l}(\mathbf{x}_{i})) \tag{7}\]  
where \(\widehat{f}_{l}\) represents the output features of each stage after pooling. _Pooling_ () represents pooling operation, and \(layer_{l}(\mathbf{x}_{i})\) represents the feature extraction operation of the \(l\)-th stage.  
The output features of each stage are transformed to the same dimension. The features are spliced according to this dimension to achieve a combination of low-level and high-level information and obtain strong semantic information. The calculations are as follows:  
\[\mathbf{f}_{l}=Resize(\widehat{f}_{l}) \tag{8}\]  
_Resize_ () in Equation (8) indicates the dimensional unity of the feature.  
Furthermore, the predicted values are obtained and compared using the output feature of each stage. It is concluded that the features of each stage have different influences on  
Figure 3: Schematic diagram of embedding model training in adaptive feature fusion method. Training the embedding model \(\phi\) using the merged meta-training set. Stage \(l\) represents each stage of the embedded model structure.  
meta-learning accuracy. Therefore, during the feature fusion, the features of each stage have different weights, as shown in Equation (9).  
\[\mathbf{F}=Concat(\lambda_{1}\mathbf{f}_{1},\lambda_{2}\mathbf{f}_{2},\lambda_{3}\mathbf{f}_{3}, \lambda_{4}\mathbf{f}_{4}) \tag{9}\]  
where \(\lambda\) represents the weight of the output feature with a different stage in feature fusion. _Concat_ () indicates feature splicing, and \(\mathbf{F}\) represents the fusion feature with a different weight.  
After the feature fusion process is complete, the fused features are fed into the classifier for prediction:  
\[y^{\textit{predict}}=Classifier(\mathbf{F}_{\textit{last}}) \tag{10}\]  
_Classifier_ () represents the classifier. The classifier training process is the same as the testing process.  
The method of feature fusion is shown in Figure 4.