# Hybrid Multi-Granularity Approach for Few-Shot Image Retrieval with Weak Features
## 3 Model Architecture
### AugNet Algorithm  
The AugNet algorithm [8] trains a deep convolutional neural network to extract image features in an unsupervised manner, and it represents images as low-dimensional vectors while preserving inter-image similarities. The method is based on the intuition that, in a parameterized embedding space, variants generated from the same source image via data augmentation should exhibit compact feature distributions, while those from different sources should maintain sufficient dissimilarity. This study employed a batch processing method, where each batch comprises \(\text{N}\times\text{M}\) images derived from \(N\) distinct source images, with each source image enhanced to generate \(M\) variants. Each enhanced view retains only partial regions of the source image, encouraging the network to learn the relationships between different regions (e.g., foreground and background) rather than merely learning the augmentation methods. The embedding vector is defined as follows:  
\[e_{ij}=\tanh(f(x_{ij};w)). \tag{1}\]  
where the output of the entire neural network is denoted as \(f(x_{ij};w)\), where w represents all parameters of the network, \(x_{ij}\) denotes the image data, and \(e_{ij}\) is the embedding vector of the i-th enhanced image from the j-th source image. The contrastive loss is defined using positive and hardest negative pairs:  
\[L_{ij}=d(e_{ij},c_{i})-\min_{ \begin{subarray}{c}1\leq k<N\\ k\
eq l\end{subarray} }d(e_{ij},c_{k}), \tag{2}\]  
\[c_{i}=\frac{1}{M}\sum_{j=1}^{M}e_{ij}. \tag{3}\]  
where \(d(\cdot,\cdot)\) represents the \(L_{2}\) distance. For datasets with few samples, small targets, and weak features, the following image augmentation techniques were applied. 1. Rotation: Targets in real-world scenarios often exhibit diverse orientations due to viewpoint changes or motion. To address this, this paper adopted a rotation augmentation method, which enhances the model's generalization to varying target angles and mitigates the overfitting caused by uneven angle distributions in training data. The rotation angle is randomly sampled from a uniform distribution \(U(-35,35)\);
2. Noise: Noise is a common factor affecting image data, particularly under low-light, low-contrast, or high-compression conditions. By deliberately adding noise during training, the model learns to separate signals from background interference, reducing noise's negative impact on accuracy and improving generalization. This paper focused on superimposing noise from a Gaussian distribution \(N(0,10)\) onto the input images;
3. Cropping: Targets in real images may not always occupy central or specific regions. Random cropping enhances the model's adaptability to positional variations and scale changes, improving performance for small targets in low-resolution scenarios. Figure 1: The overall framework of the model. A square sub-region is cropped from the original image and resized to the target dimensions (e.g., \(224\times 224\)). The side length ratio of the square to the shorter edge of the original image is sampled from a uniform distribution \(U(0.2,1)\), where the lower bound is specified by the minimum crop ratio parameter \(CR_{min}\);
4. Resolution: Image resolution is often affected by device performance and shooting conditions. Downsampling strategies simulate resolution degradation, training the model to recognize targets under incomplete information and improving robustness to compression or blur. Images are first downsampled by a ratio randomly selected from \(U(0.1,1)\) and then resized back to their original dimensions;
5. Hue: As an attribute of image color, hue is susceptible to lighting and environmental conditions. To enhance the model's adaptability to color variations, a hue adjustment strategy is proposed. The hue is dynamically adjusted by randomly sampling from a uniform distribution \(U(-25,25)\), simulating diverse lighting conditions and improving robustness;
6. Saturation: Saturation fluctuations occur in real-world images due to varying shooting environments.