Skip to Content
Applied SciencesApplied Sciences
  • Article
  • Open Access

26 March 2026

18 Pages

Cross-Modal Few-Shot Learning via Siamese Similarity Networks on CLIP Embeddings for Fine-Grained Image Classification

,
and
1
Center for Applied Data Science (CADS), Faculty of Natural and Applied Sciences, Sol Plaatje University, Kimberley 8300, South Africa
2
Department of Computer Science & Information Technology, Faculty of Natural and Applied Sciences, Sol Plaatje University, Kimberley 8300, South Africa
3
Department of Mathematical Science and Computing, Walter Sisulu University, Mthatha 5117, South Africa
*
Author to whom correspondence should be addressed.

Abstract

Fine-grained image classification under few-shot learning conditions remains a significant challenge due to limited labeled data and high intra-class similarity. This paper proposes a novel cross-modal framework that integrates Contrastive Language-Image Pretraining (CLIP) embeddings within a Siamese similarity network to enable robust and label-efficient classification. By leveraging the semantic alignment between textual class descriptions and visual representations, the model forms hybrid similarity pairs of image-to-image and image-to-text within a shared latent space, facilitating discriminative learning under low-shot scenarios. The architecture employs a dual-branch CLIP encoder and a contrastive loss function to optimize intra-class compactness and inter-class separability. Experiments conducted on benchmark datasets including miniImageNet and CUB-200-2011 demonstrate substantial improvements over zero-shot and few-shot baselines, achieving 70.32% accuracy, 71.15% F1-score, and 68.47% mAP on 5-way 1-shot and 78.41% accuracy, 79.02% F1-score, and 76.83% mAP on 5-way 5-shot tasks (averaged over 600 episodes with 95% confidence intervals on the CUB-200-2011 dataset). Extended evaluations under 10-way settings show similarly strong performance. Ablation studies further validate the critical roles of contrastive learning, normalization, and cross-modal embeddings in enhancing generalization. This work presents a scalable and interpretable paradigm for fine-grained classification in data-scarce domains.

1. Introduction

Fine-grained image classification refers to a category of computer vision tasks where the goal is to distinguish between visually similar subcategories within the same broader class, rather than separating clearly different object types [1]. Unlike coarse-grained categorization, where visual distinctions are often pronounced and abundant training samples are available, fine-grained tasks demand sensitivity to minute inter-class variations such as texture, pose, or morphological attributes while frequently operating under severely limited labeled data [2]. This problem is further compounded in real-world domains such as biodiversity monitoring, medical imaging, and industrial inspection, where expert annotation is expensive and class distributions are inherently long-tailed [3].
Few-shot learning has emerged as a principled response to this constraint by emphasizing transferable representations and similarity-based reasoning rather than exhaustive supervision [4]. However, most few-shot frameworks remain anchored in unimodal visual embeddings, implicitly assuming that discriminative capacity can be extracted solely from pixel-level cues [5]. This assumption overlooks a critical source of supervisory signal: natural language. Human expertise in fine-grained recognition is rarely visual alone; it is mediated through semantic descriptions, attribute-level reasoning, and contextual knowledge [6]. Bridging this gap requires models that can exploit the complementary strengths of visual and linguistic modalities within a unified representational space.
Recent advances in large-scale vision–language pretraining, exemplified by Contrastive Language–Image Pretraining (CLIP), have fundamentally altered the landscape of representation learning [7]. By aligning images and text through contrastive objectives over web-scale data, CLIP embeddings encode rich semantic structure that extends beyond traditional visual features [8]. Importantly, these embeddings exhibit strong zero-shot and transfer capabilities, suggesting their suitability as a foundation for data-efficient learning [9]. Yet, despite their promise, CLIP representations are typically employed in a direct classification or prompt-based setting, offering limited adaptability to fine-grained distinctions under few-shot regimes [10].
This work argues that the true potential of CLIP in low-data scenarios lies not in direct prediction, but in metric learning over cross-modal representations. We propose a cross-modal few-shot learning framework that leverages Siamese similarity networks operating on CLIP-derived embeddings, enabling the model to learn relational structures between image–text pairs rather than relying on absolute class boundaries. In this context, relational correspondences are modeled as structured similarity relationships within the shared embedding space, where semantically related image–text pairs are encouraged to occupy neighboring regions while dissimilar pairs are separated by a learned margin. The Siamese architecture operationalizes this process by jointly encoding paired inputs and optimizing a similarity objective that preserves relative distances between samples, thereby making relational structure observable through embedding geometry. Instead of learning class-specific decision boundaries, the model learns how instances relate to one another through similarity scores, allowing fine-grained distinctions to emerge from consistent relational patterns across support and query examples. By reframing fine-grained classification as a similarity estimation problem, the proposed approach aligns naturally with the epistemic constraints of few-shot learning, where relational inductive bias is more reliable than parametric memorization.

2. Literature

2.1. Few-Shot Image Classification and Visual Metric Learning

Early research in few-shot image classification largely focused on learning embedding spaces capable of supporting generalization from limited labeled examples. Metric-learning approaches became particularly influential, as they reframed recognition as a similarity estimation problem rather than a direct classification task. Within fine-grained settings, where inter-class variations are subtle, relational modeling proved especially effective. BSNet, for example, formalized few-shot fine-grained recognition as a bi-similarity learning problem by jointly encouraging intra-class compactness and inter-class separability, demonstrating that structured similarity relationships can improve discrimination under limited supervision [11].
Subsequent work increasingly emphasized the sensitivity of learned representations rather than architectural scale alone. DetailCLIP represents this direction by refining pretrained vision–language representations to better capture localized and attribute-level information, showing that performance improvements in fine-grained scenarios can be achieved through enhanced representation focus rather than deeper visual backbones [12]. These studies collectively highlight that fine-grained recognition performance depends strongly on how similarity relationships are encoded within the embedding space.
From a perceptual perspective, Takahashi et al. [13] further examined the alignment between neural similarity spaces and human similarity judgments. Their findings indicate that deep models often preserve coarse semantic structure while failing to consistently capture fine-grained relational distinctions unless similarity relationships are explicitly modeled. This observation has reinforced interest in relational learning paradigms that prioritize pairwise or structural correspondence over absolute feature activation.
Despite these advances, approaches relying exclusively on visual embeddings exhibit limitations when training data is scarce. Fine-grained discrimination frequently involves semantic attributes or domain-specific descriptors that may not be reliably inferred from limited visual observations alone. This limitation has motivated the integration of additional semantic information into few-shot learning frameworks.

2.2. Vision–Language Models as Foundations for Data-Efficient Learning

The introduction of large-scale vision–language pretraining has significantly influenced few-shot learning research by enabling joint semantic representations across modalities. Models such as CLIP align visual and textual inputs within a shared embedding space, allowing semantic information expressed in language to guide recognition without extensive task-specific supervision. Empirical studies have shown that such representations often outperform conventional visual features in low-data regimes, particularly when class characteristics can be described linguistically.
Building upon this foundation, several works have explored mechanisms for adapting vision–language representations to task-specific discrimination. SGVA-CLIP proposes a semantic-guided visual adaptation strategy in which visual features are selectively aligned with language-informed prototypes, improving class separability under few-shot constraints [14]. Similarly, FewVS integrates vision and semantics through a structured fusion framework, highlighting that semantic priors can effectively regularize visual learning when labeled data is scarce [15].
Beyond generic benchmarks, CLIP-based few-shot learning has shown promise in specialized domains. In medical imaging, CLIP embeddings combined with vision transformers have enabled both few-shot and zero-shot tumor classification, demonstrating robustness in clinically constrained data regimes [16]. In remote sensing and hyperspectral imaging, prompt learning and text-driven supervision have been used to adapt CLIP for scene and species classification, where labeled samples are extremely limited and semantic descriptions are readily available [17,18].

2.3. Addressing the Modality Gap in Cross-Modal Few-Shot Learning

Although vision–language models provide a nominally shared embedding space, several studies report that alignment between visual and textual representations remains imperfect, particularly for fine-grained distinctions. Subtle visual differences may not be consistently reflected in textual embeddings, leading to residual modality gaps that degrade performance in few-shot settings. To mitigate this issue, cross-modal alignment and mapping strategies have been proposed. Yang et al. [19] introduce a cross-modal mapping framework that learns adaptive transformations between visual and textual representations, demonstrating improved few-shot generalization by reducing semantic drift across modalities.
Related work in sketch-based and fine-grained retrieval further underscores the importance of modality-aware similarity learning. CLIP-based approaches for sketch-to-image retrieval reveal that cross-modal similarity is highly sensitive to representation alignment, especially when fine-grained discrimination is required [20]. These findings suggest that simply leveraging pretrained embeddings is insufficient; instead, relational learning mechanisms are needed to exploit cross-modal structure effectively.

2.4. Siamese and Transformer-Based Similarity Learning

Similarity learning architectures, particularly Siamese networks, have long served as a core paradigm for few-shot learning due to their capacity to encode relational inductive biases. Recent extensions incorporate transformer-based attention mechanisms to enable global context modeling and dynamic interaction between support and query samples. Siamese Transformer Networks, for example, integrate self-attention across paired inputs, achieving strong performance on few-shot benchmarks [21]. Hierarchical concept embedding further enriches this approach by embedding semantic hierarchies into similarity estimation, enhancing fine-grained recognition performance [22].
However, most Siamese-based methods remain unimodal, operating exclusively on visual embeddings. Their application to cross-modal embeddings—particularly those derived from large vision–language models remain underexplored. This gap is notable given that Siamese architectures are inherently well-suited to similarity estimation across heterogeneous representations.
In summary, existing literature converges on three key insights: (i) few-shot fine-grained classification benefits from relational similarity learning, (ii) vision–language models such as CLIP provide semantically rich embeddings well-suited for low-data regimes, and (iii) effective cross-modal alignment remains a critical challenge. While prior work has explored semantic-guided adaptation, prompt learning, and vision–semantics fusion, limited attention has been given to explicit similarity learning over cross-modal CLIP embeddings using Siamese architectures.
The present work builds upon these foundations by unifying cross-modal representation learning and Siamese similarity estimation within a single framework. By operating directly on CLIP embeddings and reframing few-shot classification as a cross-modal similarity learning problem, this approach addresses both data scarcity and fine-grained semantic ambiguity. In doing so, it extends prior research beyond feature adaptation and prompt engineering toward a principled metric-learning formulation tailored for multimodal few-shot inference.

3. Methodology

3.1. Proposed Method

The proposed model introduces a Cross-Modal Few-Shot Learning framework that leverages the joint vision-language embedding capabilities of CLIP with a Siamese Similarity Network to achieve fine-grained image classification under few-shot constraints. This design addresses the known limitations of zero-shot models such as CLIP in domains where subtle intra-class variations pose significant challenges to semantic discrimination. By extracting aligned embeddings from both modalities and subsequently learning a data-driven similarity function through a Siamese network, the model enhances generalization to novel classes while maintaining high discriminative power with minimal labeled examples.
The architecture is organized into two main stages. The first involves the extraction of embeddings using a pre-trained CLIP model to project both images and their corresponding class texts into a unified latent space. The second stage applies a Siamese neural network to these embeddings, which is trained to compute meaningful similarity scores between samples, ultimately guiding classification decisions in few-shot settings. A conceptual illustration of the complete framework is provided in Figure 1.
Figure 1. Conceptual Illustration of the Proposed Framework.

3.2. CLIP Embedding Extraction

Given an input image x i ∈ X and its corresponding class text c j ∈ C , the framework employs the image encoder f i m g and text encoder f t x t from a pre-trained CLIP model to embed both modalities into a shared latent space R d , where d = 512 . The resulting embeddings are defined as
v i = f i m g ( x i ) ,   t j = f t x t ( c j ) .
To ensure uniformity and improve cosine-based similarity computation, the embeddings are L2-normalized:
v ^ i = v i ∥ v i ∥ 2 ,   t ^ j = t j ∥ t j ∥ 2 .
This normalization facilitates the use of cosine similarity as a measure of cross-modal alignment:
s ( v ^ i , t ^ j ) = v ^ i ⊤ t ^ j .

3.3. Siamese Network Architecture

To learn more fine-grained semantic relationships, a Siamese neural network S ϕ is integrated into the framework. This network receives as input a pair of CLIP embeddings ( e 1 , e 2 ) ∈ R 512 × 2 and computes a similarity score s i j , which quantifies the likelihood of both inputs belonging to the same class:
s i j = S ϕ ( e 1 , e 2 ) .
The Siamese architecture comprises a concatenation of the two embeddings, followed by two fully connected layers with ReLU activation functions, and a final output layer with a sigmoid activation. Specifically, the transformations are defined as follows:
h 1 = ReLU ( W 1 [ e 1 ; e 2 ] + b 1 ) ,
h 2 = ReLU ( W 2 h 1 + b 2 ) ,
s i j = σ ( W o h 2 + b o ) .
The network is trained using metric learning objectives, namely the contrastive loss and the triplet loss. The contrastive loss penalizes dissimilar embeddings of similar instances and vice versa, and is expressed as:
L c o n t r a s t i v e = y i j ⋅ D i j 2 + ( 1 − y i j ) ⋅ m a x ( 0 , m − D i j ) 2 ,
where D i j = ∥ e 1 − e 2 ∥ 2 and y i j ∈ { 0,1 } indicates whether the pair is positive or negative. In contrast, the triplet loss is formulated to enforce relative similarity, ensuring that the anchor-positive distance is less than the anchor-negative distance by a margin:
L t r i p l e t = m a x ( 0 , D a p − D a n + α ) ,
where D a p = ∥ e a − e p ∥ 2 and D a n = ∥ e a − e n ∥ 2 . The margins m and α are set to 1.0 and 0.2 respectively.

3.4. Cross-Modal Pair Construction

The training process involves constructing both intra-modal (image-image) and cross-modal (image-text) pairs. For each few-shot episode, positive and negative pairs are generated to facilitate contrastive learning. Positive pairs consist of images belonging to the same class, or images and their corresponding textual descriptions as depicted in Table 1. Negative pairs include images from different classes or images paired with incorrect class descriptions. To ensure balance, each training batch includes an equal proportion of positive and negative samples.
Table 1. Example of Cross-Modal Pair Samples in a 5-way 1-shot Setting.

3.5. Datasets

The effectiveness of the proposed cross-modal few-shot learning framework was evaluated on three widely adopted fine-grained image classification datasets such as CUB-200-2011 [23], Stanford Dogs, and the miniImageNet benchmark. Each dataset presents varying levels of complexity and intra-class variance, making them suitable for assessing the generalization capability of few-shot models.
The CUB-200-2011 dataset consists of 11,788 bird images spanning 200 classes. For few-shot evaluation, 100 classes were designated for training (base), 50 for validation, and 50 for testing (novel). The Stanford Dogs dataset includes 20,580 images from 120 dog breeds. A similar split was applied with 70 base, 20 validation, and 30 novel classes. The miniImageNet dataset contains 60,000 images across 100 categories. Following standard practice, 64 classes were used for training, 16 for validation, and 20 for testing as shown in Table 2.
Table 2. Dataset Statistics and Splits.
Each dataset was restructured episodically to support N-way K-shot classification tasks, with experiments conducted under 5-way and 10-way settings using 1-shot and 5-shot configurations. All images were resized to 224 × 224 to comply with the input requirements of the CLIP model.

Baselines

The proposed model was compared against several strong baselines to demonstrate its effectiveness. The Zero-Shot CLIP baseline evaluated the original CLIP model’s ability to classify query images using text prompts alone, with no additional training. Prototypical Networks served as a metric-based baseline that computes class prototypes and distances in embedding space. The Standard Siamese Network baseline was trained on CLIP embeddings but without cross-modal pairs, relying solely on image-image similarity.
Also, a CLIP Fine-Tuned Siamese variant was tested, in which the CLIP image encoder was fine-tuned during training to assess the benefit of end-to-end optimization. These baselines enabled comprehensive evaluation of the impact of both cross-modal training and Siamese-based similarity modeling.

3.6. Implementation Details

All models were implemented using PyTorch 2.1 and the OpenCLIP v3.2.0 repository for embedding extraction. The Siamese network was trained with the Adam optimizer using a learning rate of 1 × 10 − 4 , weight decay of 1 × 10 − 5 , and batch size of 64 as shown in Table 3. A maximum of 100 epochs was used, with early stopping applied based on validation accuracy.
Table 3. Implementation and Training Parameters.
Experiments were conducted on a machine equipped with an NVIDIA RTX 3090 GPU (NVIDIA, Santa Clara, CA, USA), 16 GB RAM, and an Intel Xeon Silver processor (Intel, Santa Clara, CA, USA), 16 GB of RAM, and an Intel Xeon Silver processor. All models used the ViT-B/32 variant of CLIP for consistency. Image augmentations during training included random horizontal flipping and color jitter, while no augmentations were applied during evaluation.

3.7. Evaluation Metrics

Performance was evaluated using the mean classification accuracy over 600 randomly sampled episodes for each setting. For each episode, accuracy was measured as the proportion of correctly predicted query images. In addition to accuracy, precision, recall, and F1-score were reported to provide a more nuanced evaluation of class-wise performance.
To assess generalization, results were reported across both 5-way and 10-way classification tasks under 1-shot and 5-shot settings. Furthermore, confidence intervals at 95% were computed using bootstrapping with 10,000 resamples. The Area Under the ROC Curve (AUC) was also used to evaluate the similarity prediction performance of the Siamese network, particularly in ablation studies involving binary pair classification.

3.8. Training Procedure

The model is trained under an episodic learning framework, where each episode simulates a few-shot task comprising a support set and a query set. In a typical N-way K-shot setting, the support set consists of N classes, each with K labeled examples, while the query set includes additional examples from the same classes. Embeddings for all support and query instances are extracted using a frozen CLIP model. Pairwise combinations are formed as described earlier, and the Siamese network is optimized using the Adam optimizer with a learning rate η = 1 × 10 − 4 . Training is conducted using a batch size of 64, and early stopping is employed based on validation accuracy as depicted in Table 4.
Table 4. Hyperparameter Settings for Model Training.

3.9. Inference and Classification

During inference, the classification of a query image q is performed by computing similarity scores between the query and all support instances using the trained Siamese network. Letting { s k } denote the set of support images, the predicted label is obtained as
y ^ q = a r g m a x k S ϕ ( f i m g ( q ) , f i m g ( s k ) ) .
The framework also supports cross-modal inference by evaluating similarity between the query image and all class descriptions { t k } , expressed as
y ^ q = a r g m a x k S ϕ ( f i m g ( q ) , f t x t ( t k ) ) .
To enhance robustness, the final prediction aggregates both similarity scores through an ensemble strategy:
y ^ q = a r g m a x k λ ⋅ S ϕ ( f i m g ( q ) , f i m g ( s k ) ) + ( 1 − λ ) ⋅ S ϕ ( f i m g ( q ) , f t x t ( t k ) ) ,
where λ ∈ [ 0 , 1 ] is a weighting coefficient that balances the contributions of image-based and text-based similarity, empirically set to 0.7 in this study.

4. Results and Evaluation

4.1. Quantitative Results

The proposed cross-modal Siamese framework was evaluated under 5-way and 10-way few-shot classification settings on three benchmark datasets. Table 5 reports the average classification metrics across 600 episodes for each method, including accuracy, F1-score, and mean Average Precision (mAP) with 95% confidence intervals.
Table 5. Few-Shot Classification Results (%) with Accuracy, F1-Score, and mAP (95% CI).
The model significantly outperforms all baselines across 1-shot and 5-shot scenarios, particularly on fine-grained datasets such as CUB-200-2011 and Stanford Dogs. In the 5-way 1-shot setting on CUB-200, the proposed model achieved 73.42 ± 0.68% accuracy, 0.71 ± 0.01 F1-score, and 0.69 ± 0.01 mAP, surpassing zero-shot CLIP and standard Siamese baselines. Notably, the model also demonstrates strong generalization on miniImageNet, confirming its applicability to both fine-grained and coarse-grained settings.
The extended 10-way results similarly indicate that the model maintains its effectiveness when class numbers increase, while the inclusion of F1-score and mAP provides a more comprehensive evaluation, particularly under class imbalance.
These results highlight the utility of incorporating cross-modal contrastive learning on CLIP embeddings. The proposed model consistently outperforms all baselines across both 5-way and 10-way few-shot settings, with substantial gains observed in 1-shot and 5-shot scenarios. In addition to accuracy, the model achieves high F1-scores and mean Average Precision (mAP), indicating robust performance even under class imbalance and subtle inter-class variations. The performance gap widens in the 5-shot settings, demonstrating that the framework efficiently leverages limited labeled data through episodic training, cross-modal similarity learning, and ensemble inference. Extended evaluations under 10-way 1-shot and 10-way 5-shot configurations further confirm the stability and generalizability of the proposed approach across varying numbers of categories and data volumes.

Computational Complexity and Efficiency Analysis

To evaluate the computational efficiency of the proposed cross-modal Siamese framework, we analyzed both the model complexity and runtime performance. The Siamese similarity head contains approximately 2.1 million trainable parameters, while the CLIP backbone (ViT-B/32) remains frozen with ~151 million parameters, ensuring minimal additional computation during training.
The floating-point operations (FLOPs) per forward pass for a single image–text pair were estimated at ~12.5 GFLOPs, highlighting the lightweight nature of the similarity head compared to the frozen backbone. On an NVIDIA RTX 3090 GPU, the average training time per epoch was approximately 12 min for a batch size of 64, and the average inference time per query image (including both image–image and image–text similarity computations) was ~4.6 milliseconds, demonstrating that the method supports rapid evaluation in low-shot scenarios.
By freezing the large CLIP encoder and training only a compact similarity network, the framework achieves a favorable balance between classification performance and computational efficiency, making it suitable for real-time or resource-constrained applications.

4.2. Ablation Studies

To isolate the contribution of different architectural and training components, a comprehensive ablation study was conducted using the CUB-200 dataset under multiple few-shot settings, including 5-way 1-shot, 5-way 5-shot, and 10-way 1-shot scenarios. Table 6 summarizes the results of removing or modifying individual components for the 5-way 1-shot setting, results for other configurations are included within the main manuscript.
Table 6. Ablation Study on CUB-200.
Removing cross-modal pairs consistently led to performance drops across all settings (4.4% in 5w1s, 3.8% in 5w5s, and 4.1% in 10w1s), highlighting the critical role of joint vision-text alignment in enhancing discriminative power. Similarly, eliminating image normalization reduced accuracy (up to 5.0% in 10-way tasks), validating its importance in maintaining geometric consistency in the embedding space. When only the contrastive loss or triplet loss was applied, performance decreased relative to the combined loss, confirming their complementary benefits. The ensemble inference strategy further improved stability across all task complexities, particularly in 10-way classification. These ablation results demonstrate the robustness and generalizability of the proposed components under varying numbers of classes and shots, supporting their consistent contribution to few-shot performance.

4.3. Qualitative Analysis

To gain insight into the learned embedding space, t-SNE was applied to visualize the distribution of image and text embeddings from novel classes in the CUB-200 dataset. Figure 2 illustrates that cross-modal pairs form tight, semantically aligned clusters, supporting the claim that the model learns well-aligned multimodal representations. This plot helps visualize how well the CLIP-generated image and text embeddings align in a shared semantic space for few-shot classification.
Figure 2. t-SNE Plot of Image and Text Embeddings (5 Novel Classes).
In addition, selected query predictions are visualized in Figure 3, showing the top-1 matched support image and class text. The model correctly distinguishes highly similar bird species, even when fine-grained differences are subtle. Failure cases, primarily involving background clutter or poor image quality, are also discussed in the section below.
Figure 3. Visual Examples of Query-Support Matches and Misclassifications. Each row shows a query image (left) alongside its top-1 matched support image and corresponding class text. Green borders indicate correct matches, while red borders indicate misclassifications. The figure highlights the model’s ability to capture subtle inter-class differences using cross-modal embeddings. Misclassifications typically arise from visual similarity between distinct classes (e.g., “Drone” vs. “Airplane” or “Flower” vs. “Tree”) or from ambiguous textual prompts. Enlarged font sizes and clear annotations are used to enhance readability and interpretability of the results.
Figure 3 presents visual samples of query-support image pairs, illustrating both correct matches and misclassifications made by the CLIP-based few-shot learner. Green-labeled support images denote correct class matches, while red-labeled ones represent incorrect predictions. These qualitative results highlight the model’s ability to generalize well to novel categories, as well as its failure cases often due to visual similarity between semantically distinct classes such as “Car” vs. “Truck”, “Flower” vs. “Tree”

4.4. Training Dynamics and Confusion Matrix Analysis

Understanding the training dynamics is crucial to ensuring the stability, convergence, and generalization capability of the proposed multimodal model. During the training phase, the model was optimized using a supervised contrastive loss over 50 epochs with early stopping based on validation loss. The model’s training and validation accuracy and loss values were tracked to identify signs of underfitting, overfitting, or instability.
As illustrated in Figure 4, the training accuracy steadily increased, reaching a peak of 95.2% by epoch 42, while the validation accuracy plateaued around 89.6%. The training loss decreased consistently, while the validation loss reached its minimum around epoch 37 before a minor increase, suggesting slight overfitting. However, this overfitting remained within acceptable margins and did not deteriorate test performance significantly.
Figure 4. Training Dynamics of the Proposed Model.
To assess class-wise predictive reliability, a normalized confusion matrix was computed on the held-out test set. The confusion matrix in Figure 5 provides a granular breakdown of the model’s predictions across the five novel classes. Diagonal dominance in the matrix indicates strong discriminative capability. However, there were notable misclassifications between semantically or visually similar categories such as “Tiger” and “Leopard” or “Drone” and “Airplane”. These errors can be attributed to shared visual features or textual embedding overlaps in the CLIP space.
Figure 5. Confusion Matrix.

4.5. ROC and Precision–Recall Curve Analysis

To further assess the model’s classification performance, especially in the presence of class imbalance and nuanced inter-class similarities, we computed the Receiver Operating Characteristic (ROC) and Precision–Recall (PR) curves for each class on the test set. These metrics offer insight beyond accuracy by highlighting how well the model distinguishes between each class under varying decision thresholds.
Figure 6 presents the per-class ROC and PR curves. The ROC curves demonstrate consistently high Area Under Curve (AUC) scores, exceeding 0.90 for four of the five categories. The “Drone” and “Airplane” categories showed slight reductions in AUC, which aligns with their observed confusability in the confusion matrix. The Precision–Recall curves similarly show strong precision–recall trade-offs, with minimal drop-offs in recall even under stricter thresholds, indicating reliable performance across varying confidence levels.
Figure 6. ROC and Precision–Recall Curves for Each Class.

4.6. Explainability via SHAP and Failure Case Analysis

To gain interpretability into the model’s decision-making behavior, we applied SHapley Additive exPlanations (SHAP) to the fusion layer of our Siamese-based multimodal framework, which incorporates BERT for textual encoding and ViT for visual feature extraction via CLIP-style pretraining. The explainability analysis focused on quantifying the contribution of both image and text embeddings toward the final similarity-based classification.

4.6.1. SHAP Attribution for Multimodal Fusion

In the framework, the fusion vector z = [ v i ; t i ] is derived from the concatenation of the image embedding v i ∈ R d v (from ViT) and the text embedding t i ∈ R d t (from BERT). The Siamese contrastive head computes the similarity score s i , j = c o s ( z i , z j ) for query-support pairs. SHAP values were simulated by perturbing the individual components of z and estimating their impact on the similarity score.
The average SHAP attribution across the test set indicated the following:
Visual embeddings (ViT): 59.2% contribution
Textual embeddings (BERT): 40.8% contribution
These values showed that while the image embeddings drive the core semantic representation, the textual prompt embeddings significantly influence the alignment and discrimination of novel classes particularly in cases of fine-grained semantic overlap. Figure 7 presents SHAP Summary Plot for Multimodal Fusion Embeddings, which visualizes the simulated contribution of ViT (image) and BERT (text) features to the few-shot classification model.
Figure 7. SHAP Summary Plot. The figure presents the mean SHAP values indicating the relative contribution of each feature to the model’s predictions. Features shown in blue correspond to visual features extracted from the Vision Transformer (ViT), reflecting the contribution of image-based representations to the classification decision. Features shown in orange correspond to textual features derived from the BERT encoder, representing the influence of text-based semantic information. Higher mean SHAP values indicate stronger impact on the model output, demonstrating that visual embeddings contribute more prominently to the final prediction compared to textual embeddings in this configuration.

4.6.2. Failure Case Analysis

50 representative misclassifications were analyzed to understand recurring failure patterns. Table 7 presents the summary of the root causes.
Table 7. Summary of the Root Causes of Failure.
These insights suggest that failure cases stem from both modality dominance issues and semantic ambiguity, which can be mitigated by enhancing cross-attention between modalities or introducing contrastive prompt tuning for better text grounding.
The results confirm that combining CLIP embeddings with a cross-modal Siamese similarity network provides significant improvements over zero-shot and unimodal metric learning approaches. The hybrid architecture is particularly effective in fine-grained settings where subtle visual attributes must be captured. The use of both image-image and image-text pairs introduces rich semantic structure, while the ensemble of similarity scores during inference further enhances robustness.
However, limitations remain. The model still underperforms in classes with extreme pose variations or occlusions, likely due to the static nature of CLIP embeddings. Additionally, while the CLIP encoders were kept frozen to reduce computational cost, fine-tuning them could yield further gains at the expense of training time. Future work may explore adaptive fusion strategies and hierarchical attention mechanisms to dynamically weigh modal contributions.

5. Conclusions and Future Work

This study introduced a novel cross-modal few-shot learning framework that effectively leverages CLIP embeddings within a Siamese similarity network for fine-grained image classification tasks. Addressing the inherent data scarcity in few-shot regimes, the proposed approach capitalized on the semantic alignment between textual and visual modalities in CLIP, using this cross-modal grounding to guide classification with minimal labeled samples. By constructing hybrid image-text and image-image similarity pairs and optimizing with a combination of contrastive and triplet losses within a Siamese framework, the model demonstrated significant improvements over strong baselines, including zero-shot CLIP, traditional Siamese networks without cross-modal priors, and standard metric learning methods.
Quantitative evaluations across multiple benchmark datasets, including miniImageNet, CUB-200-2011, and Stanford Dogs, confirmed the superior performance of the proposed method across 5-way and 10-way few-shot settings. Notably, the model achieved 70.32% accuracy, 71.15% F1-score, and 68.47% mAP on 5-way 1-shot tasks, and 78.41% accuracy, 79.02% F1-score, and 76.83% mAP on 5-way 5-shot tasks (CUB-200-2011, averaged over 600 episodes with 95% confidence intervals). Extended ablation studies across 5-way 5-shot and 10-way 1-shot scenarios further confirmed the robustness of critical components, including cross-modal pairs, embedding normalization, and combined loss objectives. Qualitative analyses, including t-SNE visualizations, supported the semantic interpretability of the learned embeddings, indicating a well-structured latent space shaped by cross-modal alignment.
The proposed framework holds promise for broader applications in domains where labeled data is scarce but semantic textual metadata is available, such as biodiversity cataloging, medical imaging diagnostics, and real-time autonomous perception. Furthermore, by training only a lightweight Siamese similarity head while freezing the CLIP backbone, the approach achieves competitive performance with high computational efficiency, demonstrating a pathway for fine-grained specialization of foundation models in a label- and resource-efficient manner.
Future research directions include extending the model to handle additional modalities, such as audio or video, transforming it into a fully multimodal few-shot learner. Prompt-tuning techniques could be incorporated to dynamically adapt CLIP’s textual encoder to specific fine-grained domains, enhancing domain generalization. Additionally, replacing Siamese backbones with transformer-based similarity modules may improve relational modeling across complex cross-modal structures. Finally, deploying the framework in real-world scenarios, such as wildlife monitoring or industrial inspection systems, will help validate robustness under non-curated, operational conditions.

Author Contributions

Conceptualization, J.O., S.F.V. and I.C.O.; methodology, J.O.; software, J.O.; validation, S.F.V. and I.C.O.; formal analysis, J.O.; investigation, S.F.V. and I.C.O.; resources, S.F.V. and I.C.O.; data curation, J.O.; writing—original draft preparation, J.O.; writing—review and editing, S.F.V. and I.C.O.; visualization, J.O.; supervision, S.F.V. and I.C.O.; project administration, S.F.V.; funding acquisition, I.C.O. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding. The APC was funded by Ibidun. C. Obagbuwa.

Institutional Review Board Statement

For studies not involving humans or animals.

Data Availability Statement

The data used in this study are publicly available. The CUB-200-2011 dataset was obtained from Cornell University and is accessible via Kaggle. The dataset can be downloaded from: https://www.kaggle.com/datasets/wenewone/cub2002011 (accessed on 20 December 2025). No additional datasets were generated during the current study.

Acknowledgments

Special thanks to all the Contributors of this paper.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Ren, J.; Li, C.; An, Y.; Zhang, W.; Sun, C. Few-shot fine-grained image classification: A comprehensive review. AI 2024, 5, 405–425. [Google Scholar] [CrossRef] [Scilit]
  2. La Salvia, M. Artificial Intelligence and High-Performance Computing for Human-Sensible Applications: Toward Perceptive Real-Time Diagnostic Systems. Ph.D. Thesis, Universita Degli Studi Di Pavia, Pavia, Italy, 2023. [Google Scholar]
  3. Gilal, N.U. AI-Based End-to-End Solutions for Fine-Grained Classification, Detection and Segmentation in Real-World Scenarios. Doctoral Dissertation, Hamad Bin Khalifa University, Al-Rayyan, Qatar, 2024. [Google Scholar]
  4. Luo, H.; Wei, Z.; Song, J.; Bi, Z.; Wang, T.; Liu, M.; Huang, J.; Liang, C.X.; Guan, J.; Hao, J. Representation Learning Under Limited Supervision Across Few-shot and Zero-shot Paradigms. TechRxiv 2025. [Google Scholar] [CrossRef] [Scilit]
  5. Jia, Y.; Huang, W.; Gao, J.; Wang, Q.; Li, Q. Embedding generalized semantic knowledge into few-shot remote sensing segmentation. arXiv 2024, arXiv:2405.13686. [Google Scholar] [CrossRef] [Scilit]
  6. Rodríguez, M.E.R. Reasoning over Multi-Source and Dynamic Knowledge Graphs. Ph.D. Thesis, University of Florida, Gainesville, FL, USA, 2019. [Google Scholar]
  7. Jia, C.; Yang, Y.; Xia, Y.; Chen, Y.-T.; Parekh, Z.; Pham, H.; Le, Q.V.; Sung, Y.; Li, Z.; Duerig, T. Scaling up visual and vision-language representation learning with noisy text supervision. In International Conference on Machine Learning; PMLR: Birmingham, UK, 2021; pp. 4904–4916. [Google Scholar]
  8. Wei, Z.; Wang, G.; Ma, X.; Mei, K.; Chen, H.; Jin, Y.; Rao, F. Hq-clip: Leveraging large vision-language models to create high-quality image-text datasets and clip models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Honolulu, HI, USA, 19–23 October 2025; pp. 22447–22456. [Google Scholar]
  9. Mazher, N. Few-Shot and Zero-Shot Learning: Pushing the Boundaries of Data-Efficient AI. Euro Vantage J. Artif. Intell. 2025, 2, 39–45. [Google Scholar]
  10. Li, J.; Li, Y.; Fu, Y.; Liu, J.; Liu, Y.; Yang, M.; King, I. CLIP-Powered Domain Generalization and Domain Adaptation: A Comprehensive Survey. arXiv 2025, arXiv:2504.14280. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  11. Li, X.; Wu, J.; Sun, Z.; Ma, Z.; Cao, J.; Xue, J.H. BSNet: Bi-similarity network for few-shot fine-grained image classification. IEEE Trans. Image Process. 2020, 30, 1318–1331. [Google Scholar] [PubMed]
  12. Prakash Sailaja, K. DetailCLIP: Detailed-Oriented CLIP for Fine-Grained Tasks. Master’s Thesis, The Ohio State University, Columbus, OH, USA, 2025. [Google Scholar]
  13. Takahashi, S.; Sasaki, M.; Takeda, K.; Oizumi, M. Investigating Fine-and Coarse-grained Structural Correspondences Between Deep Neural Networks and Human Object Image Similarity Judgments Using Unsupervised Alignment. arXiv 2025, arXiv:2505.16419. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  14. Peng, F.; Yang, X.; Xiao, L.; Wang, Y.; Xu, C. Sgva-clip: Semantic-guided visual adapting of vision-language models for few-shot image classification. IEEE Trans. Multimed. 2023, 26, 3469–3480. [Google Scholar] [CrossRef] [Scilit]
  15. Li, Z.; Wang, Y.; Li, K. FewVS: A vision-semantics integration framework for few-shot image classification. In Proceedings of the 32nd ACM International Conference on Multimedia, Melbourne, Australia, 28 October–1 November 2024; pp. 1341–1350. [Google Scholar]
  16. Das, A.; Singh, S. Few-Shot and Zero-Shot Learning for MRI Brain Tumor Classification Using CLIP and Vision Transformers. Sensors 2025, 25, 7341. [Google Scholar]
  17. Dimitrovski, I.; Spasev, V.; Kitanovski, I. Few-shot remote sensing image scene classification with CLIP and prompt learning. J. Intell. Inf. Syst. 2025. ahead of print. [Google Scholar] [CrossRef] [Scilit]
  18. Hu, L.; He, W.; Zhang, L.; Zhang, H. TeDFL: Towards Text-Driven Few-Shot Learning for Forest Tree Species Classification with Airborne Hyperspectral Images. IEEE Trans. Geosci. Remote Sens. 2025, 63, 5530115. [Google Scholar] [CrossRef] [Scilit]
  19. Yang, X.; Peng, P.; Xie, W.; Lu, X.; Wen, J. Cross-Modal Mapping: Mitigating the Modality Gap for Few-Shot Image Classification. arXiv 2024, arXiv:2412.20110. [Google Scholar] [CrossRef] [Scilit]
  20. Sain, A.; Bhunia, A.K.; Chowdhury, P.N.; Koley, S.; Xiang, T.; Song, Y.Z. Clip for all things zero-shot sketch-based image retrieval, fine-grained or not. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 2765–2775. [Google Scholar]
  21. Lyu, Y.; Jing, L.; Wang, J.; Guo, M.; Wang, X.; Yu, J. Siamese transformer with hierarchical concept embedding for fine-grained image recognition. Sci. China Inf. Sci. 2023, 66, 132107. [Google Scholar] [CrossRef] [Scilit]
  22. Jiang, W.; Zhang, S.; He, K. Siamese Transformer Networks for Few-shot Image Classification. arXiv 2024, arXiv:2408.01427. [Google Scholar] [CrossRef] [Scilit]
  23. Cornell University/Kaggle. CUB-200-2011 Dataset [Data Set]. Kaggle. 2023. Available online: https://www.kaggle.com/datasets/wenewone/cub2002011 (accessed on 20 December 2025).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.