# Automatic Bird Species Recognition from Images with Feature Enhancement and Contrastive Learning
## 2 Materials and Methods
### Multi-Scale Feature Fusion  
Bird images often exhibit significant variations in size. Traditional single-scale feature extraction approaches might miss crucial details, leading to inaccurate classification. To address this challenge, we propose a novel multi-scale feature fusion module (Figure 2) that captures both local fine-grained details and global structural information from the bird image. This comprehensive feature representation ultimately improves bird image classification performance.  
Figure 1: The overall framework of our method. It leverages a Siamese network architecture with three shared classifiers equipped with multi-scale feature extraction and feature enhancement. During training, the network learns from triplets (similar/dissimilar images) using Triplet and Softmax losses. In testing, a new bird image fed into each classifier generates a rich feature vector for classification.  
Figure 2: The framework of multi-scale feature fusion module. The module combines features from different levels of feature maps to capture both local and global information.  
We leverage a pre-trained ShuffleNetV2 [29; 30] model for its efficient architecture, strong feature extraction capabilities, and transfer learning potential. This efficient model excels at balancing accuracy and computational cost, making it suitable for our task. As shown in Figure 2, the ShuffleNetV2 model takes an input image of size 224 \(\times\) 224 and processes it through multiple convolutional layers. The lower layer captures fine-grained details like feather textures and eye shapes. To maintain this spatial resolution for detailed information, we employ max pooling to downsample the feature map from its original size 112 \(\times\) 112 to 56 \(\times\) 56. The intermediate layer captures a balance between local and global information. The feature map from this layer already has a resolution of 56 \(\times\) 56, so no further scaling is necessary. The higher layer captures global structural information about the bird's pose and overall body shape. To increase the resolution and incorporate more contextual information, we use a deconvolutional operation to upsample the feature map to 56 \(\times\) 56.  
All the processed feature maps from the three scales (each with a resolution of 56 \(\times\) 56) are concatenated into a single high-dimensional feature representation, which we refer to as the \"output cube\". This concatenation process allows us to comprehensively capture the semantic information extracted at different resolutions (refer to Figure 2). The output cube encodes both the fine-grained details from the lower layer, local and global information from the intermediate layer, and global structural information from the higher layer, providing a richer and more informative representation for bird image classification [31].  
To further reduce the computational complexity and memory footprint of the model, we apply a combination of convolution and pooling operations to the output cube, compressing its spatial dimensions from 56 \(\times\) 56 to 28 \(\times\) 28. The resulting compressed output, now with a size of 28 \(\times\) 28, serves as the multi-scale feature representation for the bird image classification task. This compressed representation retains the essential information extracted from different scales while reducing the computational burden, making the model more efficient for both training and inference [32].