A Transductive Model-Agnostic Contrastive Learning Framework for Few-Shot Learning
摘要
Few-shot learning is critical in data mining systems where new or long-tail categories appear with only a few labeled examples. We propose MACL, a transductive and model-agnostic contrastive learning framework for robust few-shot classification. MACL contains two branches. The contrastive branch learns margin-aware embeddings through hard-negative mining, boundary-sensitive reweighting, and semi-positive construction. The transductive branch refines class weights by maximizing mutual information over the entire query set with support supervision. A lightweight gradient-based scheme adaptively balances the loss terms, and parameter-efficient tuning with adapters, LoRA, and visual prompts enables scalable adaptation across convolutional and transformer backbones. We construct controlled few-shot evaluations based on miniImageNet and tieredImageNet to assess robustness under spurious correlations, label noise, and open-set queries. Experiments show that MACL and its ViT-based variant consistently outperform strong inductive and transductive baselines in accuracy, calibration, and robustness. Overall, the results suggest that MACL benefits from a tightly coupled contrastive and transductive design in which margin-aware supervised contrastive learning shapes the posteriors optimized by the InfoMax objective under adaptive balancing. This cooperative mechanism goes beyond a simple combination of SupCon, TIM, and gradient reweighting and provides a unified and scalable solution for few-shot learning in practical data mining and knowledge discovery tasks.