# A Novel Hierarchical Adaptive Feature Fusion Method for Meta-Learning
## 1 Introduction  
Over the past several years, deep learning has made a significant breakthrough in computer vision [1, 2]. However, traditional supervised learning relies on many annotated samples, and acquiring and annotating samples is time-consuming [3]. In the field of typical industrial object detection, where the probability of anomalous events is low, the acquisition of samples is more difficult, but the accuracy of recognition is still required to be high. Therefore, the study of few-shot learning [4] becomes particularly important. Meta-learning [5, 6] is used to solve the few-shot problem, eliminating the disadvantage caused by the limited sample size. Meta-learning uses prior knowledge to achieve rapid learning of new tasks and to make the model learn. There are three types of meta-learning methods: metric-based meta-learning [7, 8, 9, 10, 11, 12], external memory-based meta-learning [13, 14, 15, 16], and initialization method with strong generalization [17, 18, 19, 20]. Compared to the former, the latter two have various model parameters, the training is more complex, and the design of some tasks limits the overall learning ability of the model. As a result, the focus of this study is on metric-based meta-learning. Metric-based meta-learning can measure features using a distance metric formula [7, 8, 9, 10] or machine learning model [21, 22, 23]. Compared with the distance metric formula, the machine learning model has stronger generalization performance. Embedding model-based meta-learning is the current well-performing meta-learning method, which can essentially becategorized as measuring sample features with a machine learning model. The main process of embedding model-based meta-learning is described as: the sample is mapped into the feature space using the embedding model, and then a particular stage of the embedding model is used to extract the feature to the classifier, allowing the classifier to quickly adapt to the new task and determine the feature distribution. However, the output feature of convolutional neural networks (CNNs) at different layers have their characteristics [24; 25]. The feature near the top layer contains richer semantic information, while the bottom feature near the original sample input contains richer visual information. The visualization method of class activation map (CAM) [26] is adopted to present the output features of an image at different stages of the embedding model in the form of heat map, as shown in Figure 1. The different heat regions indicate the degree to which the neurons at a particular stage of the embedding model respond to different features. It can be concluded that there are differences in the output features of different stages of the embedding model. In view of the differences between the output features at different stages of the embedding model and the different impact of the information carried by different features on the performance of the classifier, in this work, we propose a meta-learning method based on adaptive feature fusion and weight optimization to mine and effectively utilize the information of different stages. The first stage involves combining all meta-training tasks into a single task, training the embedding model on this combined dataset, and outputting features from each stage of the embedding model. In the second stage, the impact of different stages' output features on classifier performance is investigated and the output features of the embedding model's different stages are fused to obtain the feature expression with good performance. The optimization algorithm is used to determine the optimal fusion weight on the meta-evaluation set. We use the meta-evaluation function as a fitness function to evaluate each group of weights in the algorithm, and the optimal fusion weight is then used for meta-testing.