Few-shot image classification aims to recognize novel classes from only a handful of labeled examples, a challenge in domains where data collection is costly or impractical. Existing solutions often rely on meta learning, fine tuning, or data augmentation, introducing computational overhead, risk of overfitting, or are not highly efficient. This paper introduces ProbaCLIP, a simple training-free approach that leverages Kernel Density Estimation (KDE) within the embedding space of Contrastive Language-Image Pre-training (CLIP). Unlike other CLIP-based methods, the proposed approach operates solely on visual embeddings and does not require text labels. Class-conditional probability densities were estimated from few-shot support examples, and queries were classified by likelihood evaluation, where Principal Component Analysis (PCA) was used for dimensionality reduction, compressing the dissimilarities between classes on each episode. We further introduced an optional bandwidth optimization strategy and a consensus decision mechanism through cross-validation, while addressing the special case of one-shot classification with distance-based measures. Extensive experiments on multiple datasets demonstrated that our method achieved competitive or superior accuracy compared to the state-of-the-art few-shot classifiers, reaching up to 98.37% accuracy in five-shot tasks and up to 99.80% in a 16-shot framework with ViT-L/14@336px. We proved our methodology by achieving high performance without gradient-based training, text supervision, or auxiliary meta-training datasets, emphasizing the effectiveness of combining pre-trained embeddings with statistical density estimation for data-scarce classification.
Creating an annotated medical image dataset is challenging and traditionally reliant on labor-intensive manual annotations. Additionally, these datasets often present substantial imbalances regarding sensing devices, class of medical disorders, and patient ethnicity and phenotype. Recently, there has been a research interest in mitigating these issues by employing data augmentation with generative models. However, the quality of images and semantics in medical image datasets are critical for computer vision tasks such as image segmentation. This paper presents DatasetGAN2-ADA, which aims to mitigate these difficulties by presenting an innovative deep-style interpreter robust against anomalous synthesis and designed to automate annotated image generation entirely. By leveraging the capabilities of StyleGAN2-ADA with an improved architecture of DatasetGAN and an enhanced execution framework integrated with an anomaly detector based on custom features, we propose a combined strategy for eliminating flawed synthetic images and masks. Furthermore, we propose exploiting image projections and preexisting semantics, eliminating the need for manual annotations to train our deep-style interpreter. The experimental results obtained with a magnetic resonance image (MRI) dataset demonstrate that DatasetGAN2-ADA is strongly effective in improving the efficiency and quality of synthetic generation, rejecting the synthesis of a substantial amount of low-quality images and masks. Then, an extension of this method is evaluated for detecting anomalous latent vectors a priori of the image synthesis, achieving up to 95.24% precision and illustrating its compelling potential for practical applications in medical imaging.