# Multiscale Dynamic Attention and Hierarchical Spatial Aggregation for Few-Shot Object Detection
## 1 Introduction  
Object detection involves identifying and categorizing objects within images, typically by enclosing them in bounding boxes [1]. As a critical domain in computer vision, object detection has numerous applications, ranging from autonomous driving to surveillance. However, deep-learning-based object detection methods require extensive instance-level annotations for network training. Due to the inherent long-tail distribution of real-world data [2], obtaining sufficient annotated samples is challenging for many categories. Additionally, image annotation is labor-intensive and prone to inaccuracies, while model training demands substantial computational resources. Therefore, achieving high-quality object detection with a limited number of samples remains a pressing challenge that requires urgent attention [3].  
In the context of the aforementioned research, few-shot object detection (FSOD) has emerged as a promising solution. FSOD aims to detect novel object classes with minimal annotated samples by leveraging pretrained models on base classes [4]. FSOD algorithms are generally categorized into two main approaches: transfer-learning-based methods andtwin-network-based methods [5]. Transfer-learning-based methods fine-tune pretrained models on small datasets of novel class samples [6], with notable examples including TFA [7], FSCE [8], and MPSR [9]. In contrast, twin-network-based methods, such as Meta-RCNN [10], Attention-RPN [11], and FSDetView [12], detect objects by comparing the similarity between novel and base classes using paired identical subnetworks that share weights [13].  
However, as shown in Figure 1, few-shot scenarios often exhibit diverse and imbalanced scale distributions, with a scarcity of extreme-scale samples. Additionally, the insufficient sample quantities restrict a model's ability to generalize rich feature representations, resulting in poor detection accuracy and robustness. To address these issues, existing methods such as MPSR [9] fuse multiscale information through refined positive samples and an enhanced feature pyramid network: FSOD-MFSR [14] improves feature representation via multiscale feature re-weighting and attention mechanisms; FSCE [8] employs a contrastive learning framework to strengthen the robustness and discriminative power of features. While these approaches introduce various innovations in feature representation and multiscale fusion, methods like contrastive learning [15] and feature re-weighting are characterized by high computational costs and complexity. Moreover, the multiscale feature fusion in existing approaches remains insufficiently comprehensive, failing to effectively accommodate object categories with large-scale variations.  
To address the aforementioned challenges, we propose MDA-HAPP, a lightweight yet highly flexible framework that seamlessly integrates multiscale features. Through two key innovations, our method optimizes feature representation and detection architecture, overcoming the limitations of existing methods in feature extraction and multiscale handling. The major contributions of our work are summarized below.  
Figure 1: Scale distribution imbalance in few-shot learning for the cow category: comparison between full training set and few-shot training set.