Meta-Transfer Derm-Diagnosis: Exploring Few-Shot Learning and Transfer Learning for Skin Disease Classification in Long-Tail Distribution
Zeynep Özdemir Hacer Yalim Keles Ömer Özgür Tanrıöver

V^2A-Mark: Versatile Deep Visual-Audio Watermarking for Manipulation Localization and Copyright Protection
    
Xuanyu Zhang1,2, Youmin Xu1, Runyi Li1, Jiwen Yu1, Weiqi Li1, Zhipei Xu1, Jian Zhang1,2 

1 School of Electronic and Computer Engineering, Peking University

2 Peking University Shenzhen Graduate School-Rabbitpre AIGC Joint Research Laboratory

    April 29, 2024
=========================================================================================================================================================================================================================================================




Addressing the challenges of rare diseases is difficult, especially with the limited number of reference images and a small patient population. This is more evident in rare skin diseases, where we encounter long-tailed data distributions that make it difficult to develop unbiased and broadly effective models. The diverse ways in which image datasets are gathered and their distinct purposes also add to these challenges. Our study conducts a detailed examination of the benefits and drawbacks of episodic and conventional training methodologies, adopting a few-shot learning approach alongside transfer learning. We evaluated our models using the ISIC2018, Derm7pt, and SD-198 datasets. With minimal labeled examples, our models showed substantial information gains and better performance compared to previously trained models. Our research emphasizes the improved ability to represent features in DenseNet121 and MobileNetV2 models, achieved by using pre-trained models on ImageNet to increase similarities within classes. Moreover, our experiments, ranging from 2-way to 5-way classifications with up to 10 examples, showed a growing success rate for traditional transfer learning methods as the number of examples increased. The addition of data augmentation techniques significantly improved our transfer learning based model performance, leading to higher performances than existing methods, especially in the SD-198 and ISIC2018 datasets. All source code related to this work will be made publicly available soon at the provided https://github.com/zeynepozdemir/MetaTransferURL.









§ INTRODUCTION


Over the past decade, the field of medical image analysis has witnessed remarkable advancements, primarily driven by the development of deep convolutional neural networks and the availability of extensive labeled image datasets. These advancements have notably impacted various tasks, including organ segmentation <cit.>, tumor segmentation <cit.>, and disease detection <cit.>. Although abundant data exists for common diseases, a significant gap persists in data availability for the over 6,000 known rare diseases, affecting approximately 7% of the global population <cit.>. The diagnosis of these rare diseases, including some skin conditions, presents unique challenges, particularly due to the limited number of clinical examples available for training deep learning models. The automatic classification of skin lesions exemplifies these challenges, as it is complicated by the long-tailed distribution of skin disease datasets, the subtle variations in lesion appearances, and the overall scarcity of sufficient image data <cit.>.



Various studies have been conducted to address the problem of skin disease classification using deep learning approaches. Recent advancements in this field are mainly in three categories: methods based on transfer learning <cit.>, those relying on few-shot learning <cit.>, and approaches using cross-domain few-shot learning <cit.>. The state of the art models in this domain, such as Meta-DermDiagnosis, MetaMed, and PCN models <cit.>, are designed to extract and learn high-level, domain-specific features during their training process.

In their study on the ISIC2018 dataset, Li et al. (2020) introduced the Difficulty Aware Meta-Learning (DAML) model, recognizing that randomly selected tasks vary in difficulty <cit.>. They proposed optimizing the meta-optimization process by dynamically assessing the significance of challenging tasks. Similarly, Mahajan et al. (2020) developed the Meta-DermDiagnosis model, experimenting with the SD-198, Derm7pt, and ISIC2018 datasets <cit.>. This model innovatively replaced traditional convolutional layers in Prototypical Networks and Reptile with Group Equivariant Convolutions, enhancing resistance to data transformations like symmetry and rotation, thus yielding robust features. However, this method received critique for its reliance on datasets with symmetric orientation. On a related note, Singh et al. (2021) highlighted the efficacy of MixUp, CutOut, and CutMix as data augmentation techniques in the medical field when integrated with the MAML algorithm in their MetaMed model, particularly on the ISIC2018 dataset <cit.>. Both MetaMed and Meta-DermDiagnosis models aim to enhance feature representation by broadening data augmentation and diversification. Further, Prabhu et al. (2019) proposed the Prototypical Clustering Networks (PCN) model, designed to effectively handle intra-class variability in few-shot learning scenarios <cit.>. 

The studies previously discussed have employed episodic learning as a means to acquire knowledge that can be transferred to new classes. This approach involves the arrangement of learning problems into episodes, each composed of small training and validation subsets, designed to simulate the scenarios encountered during evaluation. However, <cit.> criticized this method, arguing that the constraints of episodic learning are unnecessary and that using training groups in this manner is data-inefficient. Similarly, <cit.> argued that in tasks involving rare classes, the effectiveness of rapid adaptation is more attributable to the quality of the learned representation than to the few-shot learning algorithm itself. They incorporated self-supervised learning in their model to enhance this representation. In a similar context, <cit.> proposed the concept of Meta-transfer learning, which is aimed at refining the learned representation. They conducted various experiments to compare the effectiveness of fine-tuning pre-trained Deep Neural Network (DNN) models with and without episodic learning. Their findings underscore the significance of integrating transfer learning with few-shot learning methodologies.

The existing literature consistently highlights the ongoing challenge of effectively managing the issue of long-tailed data distribution in skin disease studies <cit.>. Although current methods show promise in specific dataset contexts, their ability to generalize broadly remains limited. Most research in this field has been directed towards developing dataset-specific solutions, addressing the unique challenges and sensitivities arising from variations in class counts, data formats, and other critical characteristics.

In our study, we aim to conduct an in-depth analysis of the benefits and drawbacks of integrating few-shot learning, episodic learning, and transfer learning. Our main focus is on developing a foundational framework specifically designed to utilize the inherent properties of long-tailed skin datasets. While acknowledging the potential benefits of performance-enhancing methods, our base approach distinctly diverges from such techniques.

In this context, we implemented four distinct training methods, each evaluated using consistent metrics for newly introduced classes. Our first method, Few-Shot Episodic Transfer Learning (FETL), involves adapting the model for the dataset through fine-tuning weights that were initially pre-trained on ImageNet, coupled with episodic few-shot learning. The second strategy, Few-Shot Episodic Learning (FEL), diverges from the first by employing episodic learning on models without any pre-training. The third approach, Deep Transfer Learning (DTL), focuses on fine-tuning models using deep neural networks (DNN) with pre-trained ImageNet weights, but notably omits episodic learning. Lastly, our fourth method, Deep Learning (DL), acts as a  baseline, utilizing pre-trained ImageNet weights without additional adjustments or fine-tuning. Following the establishment of our approach, we aimed to enhance performance by incorporating well-known data augmentation techniques such as CutMix, MixUp, and ResizeMix into the DTL model.

To evaluate the effectiveness of our proposed methodologies, we carried out extensive testing across three benchmark skin disease datasets: SD-198, Derm7pt, and ISIC2018. This comprehensive analysis provided us with critical insights into the most effective strategies for tackling the challenge of long-tailed data distribution in skin diseases. The key contributions of our study are summarized as follows:


    
  * We introduce a novel methodology designed to evaluate various model training approaches, using a consistent benchmark test set specifically made for long-tail distributions in rare skin diseases. This evaluation is conducted through episodic testing. To the best of our knowledge, this is the first time such a thorough methodological analysis has been conducted in this domain.

    
  * By comparing episodic and traditional training methods, our findings indicate that traditional training becomes increasingly beneficial as the number of shots (training examples) grows.
        
    
  * We demonstrated that combining transfer learning with few-shot learning significantly enhances both the learned representation and the testing performance in the context of rare skin diseases. Using our proposed model based on transfer learning, along with augmentation techniques like MixUp, CutMix, and ResizeMix, has helped us surpass state-of-the-art results in some settings on the SD198 and ISIC2018 datasets.
  



§ RELATED WORKS




 §.§ Transfer Learning for Medical Image Domain


In deep learning, a powerful transfer learning method involves adapting a pre-trained model for a new task, commonly referred to as fine-tuning (FT). Models that have been pre-trained on extensive datasets have demonstrated superior generalization performance compared to models initialized randomly <cit.>. Various techniques are employed to facilitate the transfer of knowledge between different source-target domains <cit.>.

Transfer learning (TL) is frequently applied in addressing the classification problem of skin diseases. For instance, <cit.> aimed to improve performance on the ISIC2018 dataset by using ISIC2016 and ISIC2017 as source datasets and EfficientNetB0/B1, SeReNext50 as backboned models. <cit.> performed transfer from the ImageNet dataset to the ISIC2018 dataset using ResNet50. Similarly, <cit.> employed ImageNet, ResNet, and DenseNet architectures for transfer to the ISIC2017 dataset. <cit.>, with a similar objective, experimented with the VGG16 architecture. A common inference drawn from these studies is that the use of transfer learning, particularly when ImageNet or various dermatological datasets are used as source datasets and supported by architectures like ResNet or DenseNet, contributes significantly to addressing this problem. A more comprehensive literature discussion is provided in <cit.>.


In addition to traditional learning methods, transfer learning has also been explored in the Few-Shot Learning (FSL) domain for the classification problem of skin diseases. For instance, the MetaMed study <cit.>, working with FSL algorithms on the ISIC2018 dataset, compared and interpreted the results of models trained through TL with their proposed method. In this process, they employed a shallow-layered architecture in the TL model and conducted training using only base classes. In contrast, as indicated in the literature, we adapted the MobileNet and DenseNet architectures to the Few-Shot Learning domain by utilizing pre-trained weights from ImageNet. We discussed detailed comparison results in Section <ref>.



 §.§ Few-Shot Learning in Computer Vision


Few-shot learning (FSL) aims to recognize novel classes with only a few labeled examples, leveraging a substantial number of examples from base classes. FSL algorithms can be broadly categorized into three groups: initialization-based methods, metric learning-based methods, and hallucination-based methods.

In this context, initialization-based methods take a learning to fine-tune approach. They aim to acquire an effective model initialization, specifically the neural network parameters. This facilitates the adaptation of classifiers with limited labeled examples through a few gradient update steps for new classes <cit.>. Another strategy involves distance metric learning methods, embracing a learning to compare paradigm for few-shot classification. These methods are foundational approaches utilizing encoded feature vectors and a distance measurement metric based on the nearest-neighbor principle to assign labels. For instance, Prototypical Networks <cit.> utilizes Euclidean distance, Matching Networks <cit.> employs cosine similarity, and Relation Networks <cit.> utilizes its own CNN-based measurement module for this purpose <cit.>. Additionally, hallucination-based methods directly address data scarcity through learning to augment. Here, hallucination involves generating data not derived from real examples or direct observations. The generator's objective is to transfer appearance variations present in the base classes to novel classes <cit.>. 

The mentioned FSL methods adopt an episodic training approach during the training of the data (base classes). However, some studies have shown that training the data by dividing it into tasks leads to inefficient use of the available data <cit.>. Additionally, <cit.> has demonstrated, contrary to the prevailing notion, through experiments conducted with benchmark datasets and fundamental FSL algorithms, that an increase in task diversity, proportional to the increase in classes and data, does not lead to an improvement in success. Therefore, we can categorize FSL approaches into two groups based on their training processes: meta-learning-based and transfer-learning (TL)-based methods.
Among TL methods, S2M2-R <cit.>, Baseline <cit.>, PT-MAP <cit.>, and Meta-Transfer Learning <cit.> train on base classes using a standard classification network and fine-tune the classifier head on episodes generated from new classes. These methods aim to train a powerful feature extractor that produces transferable features for the new class. Experimental methods have demonstrated that these approaches can achieve more effective and higher performance compared to previous FSL methods, utilizing a simpler and more efficient process. Due to the superior performance of TL-based methods, we explored this approach in conjunction with Prototypical Networks as a way to predict rare skin diseases.



 §.§  Few-Shot Learning for Skin Disease Classification


The imbalanced distribution of skin disease classes and factors such as limited image availability in rare diseases necessitate the application of few-shot learning methods. As a solution to this challenge, <cit.> proposed the Difficulty-Aware Meta-Learning (DAML) model based on Meta-Learning. This model adjusts the losses for each task, increasing the weight of challenging tasks while decreasing that of easier tasks, thereby emphasizing and increasing the importance of difficult tasks. This study, aiming to highlight more distinctive features for each class, can be categorized as initialization-based FSL. On the other hand, the model named MetaMed, evaluated in both initialization and hallucination-based  FSL categories, by <cit.>, combines advanced data augmentation techniques such as mixup, cutout, and cutmix with the reptile model during training to enhance its generalization capabilities. Working with the ISIC2018 dataset, they compared the transfer learning approach of their proposed model with other studies, reporting an average improvement of up to 3% in performance. In the metric-based branch, several methods have been proposed. <cit.> advocated for the superiority of the Query-Relative loss over the Cross-Entropy loss commonly used in FSL. Additionally, <cit.> suggested the utilization of Temperature Networks alongside Prototype Networks. They adapted specific temperatures for different categories to reduce intra-class variability and enhance inter-class dispersion. Moreover, they applied penalization based on the proximity of query examples. <cit.> introduced a model named Meta-DermDiagnosis, aiming to obtain invariant features after various transformations by replacing traditional convolutional layers with group-equivariant convolutions, similar to Prototypical Networks and Reptile.

In the context of transfer-learning-based algorithms, <cit.> proposed a model named PFEMed, suggesting a dual-encoder structure. This brings about one encoder with fixed weights pre-trained on large-scale public image classification datasets and another encoder trained on the target medical dataset. On the other hand, <cit.> designed a dual-branch framework and improved performance using a model employing prototypical networks and contrastive loss. To address the challenge of observing diverse subgroups within dermatological disease clusters, <cit.> introduced the Sub-Cluster-Aware Network (SCAN) model. SCAN utilizes a dual-branch structure to enhance feature explanation, learning both class-specific features for disease differentiation and subgroup-related features.

In this study, we integrate Prototypical Networks from Few-Shot Learning (FSL) algorithms with transfer learning techniques. This fusion involves adapting MobileNetV2 and DenseNet121 backbone architectures, coupled with pretrained ImageNet weights, specifically to tackle the challenge of rare skin disease identification. Our experimental analysis highlights the limitations of episodic training in optimally leveraging data. Central to our approach is the establishment of a foundational framework that relies solely on the inherent properties of the long tailed datasets, without the necessity for supplementary data. This includes strategies aimed at enhancing model performance, such as extensive data augmentation techniques like MixUp, CutMix, and ResizeMix. The utilization of these techniques contributes to achieving our research objectives.



§ DATASETS AND EVALUATION





The SD-198 dataset <cit.> comprises 198 detailed categories of skin diseases, including eczema, acne, rosacea, and various cancer conditions. These categories contain 6584 clinical images contributed by patients and dermatologists, showcasing diverse characteristics like color, exposure, lighting, and size. The dataset captures a wide range of patients in terms of age, gender, disease location, skin color, and disease stage. Originally divided into a 50% training set and a 50% test set, the images are captured at 1640 × 1130 pixels using digital cameras or mobile phones. To align with the comparison criteria set by Meta-DermDiagnosis <cit.> and SCAN <cit.>, we resized all data to 224 x 224 pixels. For testing, we focused on 70 classes representing rare diseases, each having fewer than 20 images, while the remaining 128 classes were used for training. The dataset distribution is visualized in Figure <ref>, and sample images are provided in Figure <ref>-a.

The Derm7pt dataset <cit.> comprises over 2,000 clinical and dermoscopy images grouped into 20 distinct classes. This dataset, comprising both clinical and dermoscopic images, provides predictions based on a 7-point checklist for the malignancy of skin lesions, making it suitable for training and evaluating computer-aided diagnosis (CAD) systems. The original images have dimensions of 768 × 512 pixels; however, for the purpose of our experimental studies, they have been resized to 224 × 224 pixels. To facilitate the comparison of our experimental results with the Meta-DermDiagnosis and SCAN study, we adopted similar train-test set differentiations. Within the Derm7pt dataset, two categories are excluded from our experiments: 'miscellaneous' (encompassing unspecified skin diseases) and 'melanoma' (due to its solitary instance, preventing a train-test division). Among the 18 lesion categories in this dataset, 13 classes are allocated for training, while the remaining categories are reserved for testing. The novel set consists of 5 classes, with each class containing 10 to 34 images. This distinction strategy aims to mimic the ability to generalize to infrequent skin diseases by placing classes with limited data in the test set. For visual reference, selected examples of skin lesion images can be found in Figure <ref>-b. The dataset distribution is also shared in Figure <ref>.

The ISIC 2018 Skin Lesion dataset <cit.> comprises 10,015 dermoscopic images that are categorized by expert pathologists into seven distinct skin lesion classes. Within this dataset, 7,515 images are allocated to the training set, while the remaining 2,500 images constitute the test set, following a standardized partition. Dermoscopic images often position the target lesion at the center. We adhered to similar scaling and data partitions as the Meta-DermDiagnosis<cit.> and PFEMed <cit.> study for our experiments. Consequently, the image resizing process transforms images from 600 × 450 pixels to 224 x 224 pixels, and a subset comprising four base classes and three novel classes is selected to form few-shot classification tasks. Refer to Figure <ref>-c for exemplar images drawn from the dataset. For data distribution, please see Figure <ref>.







§ THE METHODOLOGY


This section outlines the core methodologies deployed in our study, starting with the Meta-Transfer Derm-Diagnosis Framework. This framework is pivotal for assessing four distinct model training strategies that are particularly valuable in scenarios with limited data samples. These strategies are Few-Shot Episodic Transfer Learning (FETL), Few-Shot Episodic Learning (FEL), Deep Transfer Learning (DTL), and Standard Deep Learning (DL).

We implement a precise evaluation process, employing a combination of the selected benchmark datasets (Section <ref>), and a specialized testing approach. This ensures a comprehensive and fair analysis of each training method. Subsequently, we provide an overview of Prototypical Networks and Transfer Learning. 



 §.§ Meta-Transfer Derm-Diagnosis Framework


The proposed Meta-Transfer Derm-Diagnosis Framework is used to effectively combine few-shot training methods with transfer learning. This integration is specifically designed to improve model performance for tail classes, which often have limited data, thereby leveraging the complementary strengths of both methodologies.

Few-shot classification operates with two distinct datasets: the base dataset, denoted as D_base, and the novel dataset, denoted as D_novel. The novel dataset, D_novel, is utilized for the actual classification task, while the base dataset, D_base, helps in training the classifier by transferring essential knowledge from it. Additionally, during training, ImageNet dataset  is also used and will be referred to as the domain D_imgnet. For clarity and coherence, let us include two definitions adapted to our framework from prior literature <cit.> that are related to our study's context in few-shot learning. These definitions will help in framing our approach and methodology.

Definition 1. For the training and testing phases, the novel dataset D_novel is split into two subsets: the support set (D_S) and the query set (D_Q). In a typical few-shot classification scenario, the support set D_S contains only a few samples per class, often ranging from 1 to 5. The primary goal in few-shot classification is to train a classifier, f: X_novel→ Y_novel, using the limited data in D_S. This classifier should then be able to accurately categorize instances in the query set D_Q. If D_S includes N distinct classes with K labeled examples per class, this scenario is defined as an N-way K-shot classification. The case with only one labeled example per class is termed one-shot classification.

Definition 2. A few-shot classification task is referred to as cross-domain few-shot classification when the train dataset D_train and the novel dataset D_novel are sourced from distinct domains. 

To further clarify our methodology, we define the datasets used. The base dataset is defined as D_base = { (x_i, y_i) ;  x_i ∈ X_base, y_i ∈ Y_base}_i=1^N_base, where x_i represents the feature vector of the i-th image, and y_i is its corresponding class label. The novel dataset is similarly represented as D_novel = { (x̃_j, ỹ_j) ; x̃_j ∈ X_novel, ỹ_j ∈ Y_novel}_j=1^N_novel. It is crucial to note that the class labels in D_base and D_novel are mutually exclusive, i.e., Y_base∩ Y_novel = ∅. In a similar manner, D_imgnet is represented as:  { (x̅_k, y̅_k) ; x̅_k ∈ X_imgnet, y̅_k ∈ Y_imgnet}_k=1^N_imgnet. 

To rigorously evaluate the framework we devised, detailed in Figure <ref>, we maintained a consistent evaluation by keeping  D_novel fixed. Here, D_train denotes the datasets used during training. We formulated four distinct training methodologies, each independently designed: FETL, where D_train = D_imagenet + D_base* ; FEL, where D_train = D_base*; DTL, where D_train = D_imagenet + D_base; and DL, where D_train = D_imagenet. The notation D_base* indicates episodic training, while the others involve traditional large-scale training approaches for the corresponding datasets in that domain.


In accordance with these definitions, as is summarized in Figure <ref>, our FETL, FEL, and DTL models utilize D_base and D_novel classes from the same domain for training and testing as specified in Definition 1. On the other hand, the proposed DL model utilizes two separate domains for training and testing, hence it aligns with Definition 2. Therefore, three out of our four proposed analysis include adapted few-shot training and testing methodologies considering the data extracted carefully from the same long-tail distributions (FETL, FEL and DTL), while the last one (DL) corresponds to a cross-domain evaluation. 






The evaluation of our classifier in N-way K-shot classification is outlined in Algorithm 1. This process includes a series of episodes, each presenting a unique classification task, allowing for a thorough assessment of the classifier's performance. In this procedure, as the initial step, we randomly select N classes from the novel set. Following this, we randomly choose K samples from each of these N classes to constitute a support set. Concurrently, we select M samples from the remaining instances in these classes to form a query set. For each episode, denoted as the e'th episode, the query set's instances and labels are represented as x̃^(e) and ỹ^(e), respectively. A learning algorithm is then applied, utilizing the model that is pretrained with D_train and tuned to the support set of the e'th episode, D_S^(e). This algorithm yields a classifier that predicts labels for the instances in the query set. To quantify the classifier’s performance, we calculate the classification accuracy for each episode, referred to as a^(e). The overall effectiveness of the learning algorithm is then determined by averaging these classification accuracies across all episodes.



 §.§ Prototypical Networks 


As depicted in Figure <ref> (top right section), we used Prototypical Networks <cit.> for both episodic training and testing. It is a meta-learning approach, which is designed to represent each class through a prototype vector, based on distance metrics. This vector is an average of embedded instances in a support set, specifically linked to that class. Formally, for a set of N classes, the support set S ={ (x_1, y_1), ..., (x_N, y_N)} is constructed, where each x_i ∈ℝ^D is a D-dimensional feature vector, and y_i is its corresponding label in the range {1, . . . , K}.

Each class prototype c_k ∈ℝ^M is computed as the mean vector of its associated embedded instances, using an embedding function f_ϕ : ℝ^D →ℝ^M with learnable parameters ϕ. The prototype for class k is derived as:


    c_k = 1/|S_k|∑_(x_i, y_i) ∈ S_k f_ϕ(x_i).


The network utilizes a distance function d : ℝ^M×ℝ^M→ [0, +∞) to calculate the probability distribution across classes for a query point x, based on the softmax of distances between the query point and class prototypes:


    p_ϕ(y=k |x) = exp(-d(f_ϕ(x),c_k))/∑_k'exp(-d(f_ϕ(x),c_k')).


Training involves minimizing the negative log likelihood J(ϕ) = -log p_ϕ(y = k | x) of the true class k, using Stochastic Gradient Descent (SGD). 



 §.§ Regularization via Image Augmentation 


Regularization techniques are essential in preventing overfitting and enhancing the generalization capabilities of deep models. Among these techniques, image augmentation stands out as a crucial method in supervised learning, well-known for its efficacy in regularization. While conventional augmentation methods like rotation, horizontal flips, and vertical flips are widely used, they often prove inadequate in domains characterized by limited data, such as medical imaging. 
Consequently, advanced approaches such as MixUp <cit.>, CutMix <cit.>, and ResizeMix <cit.> have received significant attention due to their ability to address the challenges posed by data scarcity and variability.These methods provide advanced solutions that extend beyond conventional techniques, facilitating the generation of diverse training samples and enhancing model robustness from various perspectives.



 §.§ MixUp


MixUp generates synthetic samples by blending features and labels from two different images using weighted blending. Let (x_i, y_i) and (x_j, y_j) represent the features and labels of two images, respectively. MixUp combines these two images with weighted blending to create a new synthetic sample:


    x̃ = λ x_i + (1 - λ) x_j


    ỹ = λ y_i + (1 - λ) y_j


Here, λ∈ [0, 1] is a random weight value.



 §.§ CutMix


CutMix creates synthetic samples by replacing regions of an image with patches from another image, controlled by a cut ratio (λ). Let (x_i, y_i) and (x_j, y_j) denote the features and labels of two images, respectively. CutMix blends these two images according to the cut ratio to create a new synthetic sample:


    x̃ = M · x_i + (1 - M) · x_j


    ỹ = λ y_i + (1 - λ) y_j


Here, M is a mask matrix, and λ is a random cut ratio.



 §.§ ResizeMix


ResizeMix merges images of different sizes by resizing them and then blending them using weighted blending. Let (x_i, y_i) and (x_j, y_j) represent the features and labels of two images, respectively. ResizeMix resizes one image to the size of the other and blends them with weighted blending to create a new synthetic sample:


    x̃ = λ x_i + (1 - λ) resize(x_j, size(x_i))


    ỹ = λ y_i + (1 - λ) y_j


Here, resize(x_j, size(x_i)) resizes x_j to the size of x_i, and λ∈ [0, 1] is a random weight value.



§ EXPERIMENTS AND DISCUSSION




















 §.§ Implementation Details


The implementation of our study is carried out using the Python programming language with the PyTorch library. Nvidia 1080Ti GPU is employed during the model development. To ensure a fair comparison with the Meta-DermDiagnosis <cit.> model, we aligned the distinctions between base and novel classes in the datasets and ensured the similarity of deleted classes. All datasets are resized to 224x224x3 dimensions. ISIC2018 consists of 4 base and 3 novel classes, Derm7pt includes 13 base and 5 novel classes, and SD-198 encompasses 128 base and 70 novel classes. In contrast to the Meta-DermDiagnosis study, we partitioned the SD-198 base classes into training and validation sets. Classes with fewer than 20 data points are designated as novel, while those with 20-30 data points are assigned to the validation set. To ensure a standardized testing environment for the four differently trained models, we employed a seed and deterministic mode, which worked in allowing each model to be tested on tasks of the same difficulty and order. Hyperparameters such as batch size used during testing were structured similarly for FETL and FEL models, with the only difference being the query set size set to 5 due to data insufficiency in novel classes. Data augmentation techniques are not applied to novel classes. All experiments are conducted using MobileNetV2 and DenseNet121 backboned models.

The sole distinction between the FEL (Few-Shot Episodic Learning) and FETL (Few-Shot Episodic Transfer Learning) models lies in the use of pretrained ImageNet weights for the backbone models in the FETL model. In contrast, the FEL model is trained on backbone models with random initialization. Data augmentation techniques such as RandomResizedCrop, RandomFlip, and ColorJitter are employed. In this framework, our models are trained with a 5-way 5-shot configuration, and all layers of the backbone models are fully opened for training.

Both DTL (Deep Transfer Learning) and DL (Deep Learning) models utilize ImageNet weights, but the DTL model is fine-tuned with the base classes of the datasets. The DL model, serving as a baseline, is chosen to compare performance without any fine-tuning, using ImageNet weights. In the DTL model, traditional training methods are employed instead of episodic training. For instance, in the case of the SD-198 dataset, 10% of the 128-class base section are allocated as the validation set. The MobileNetV2 model with ImageNet weights are then trained, aiming for the model to learn generalized features from the dataset. During testing, this model is used with ProtoNet in an episodic structure to evaluate and compare its performance.

Various augmentation techniques are employed in different training iterations of the DTL model to compare their effects and success rates. While the DTL-base model utilizes RandomResizeCrop and 50% Horizontal RandomFlip in the SD-198 and ISIC2018 datasets, Resize and 45% Horizontal and Vertical RandomFlip are used in the Derm7Pt dataset. Subsequently, the DTL-Base section is kept constant, and batch augmentation techniques such as CutMix, MixUp, and ResizeMix are added for comparison. Each added technique is labeled in the result tables as DTL-CutMix or DTL-ResizeMix. Our model named DTL-All-Augment represents a comprehensive model incorporating all three techniques on top of DTL-Base.





 §.§ Experimental Analysis


In order to evaluate our framework and assess the effectiveness of our proposed methods, we performed experiments using 2-Way 1-Shot to 10-Shot and 5-Way 1-Shot to 10-Shot setups. These tests are conducted using three datasets: SD-198, Derm7pt, and ISIC2018. The comprehensive results of our model tests are detailed in Tables <ref>, <ref>, and <ref>. Moreover, we executed additional experiments based on the parameters specified in Tables <ref>, <ref>, and <ref>. These experiments are designed to compare our model's performance against benchmarks set in prior research, such as SCAN <cit.>, MetaMed <cit.>, and PFEMed <cit.>, using the datasets referred to in Section <cit.>. In all these tables, the highest accuracy values are highlighted in bold, and the second highest results are underlined. 



The SD-198 dataset contains 198 classes and consists only of clinical images. In contrast, the Derm7pt dataset has 18 classes with a mix of clinical and dermoscopic images. The ISIC2018 dataset, with its 7 classes, mainly features dermoscopic images. Although each of these three datasets shows a long-tail distribution, their unique features affect how models perform. Additionally, the number of parameters and the performances of the backbone models also play essential role in the overall model performance. For instance, MobileNetV2 has approximately 3.4 million parameters, while DenseNet121 boasts 8.1 million parameters. Furthermore, while episodic learning is employed in FEL and FETL models, transfer learning based training is utilized in DTL and DL models, a distinction that significantly impacts model performance. As can be observed in Figure <ref>, in all three datasets, FETL models consistently outperform FEL models, while DTL models demonstrate superior performance compared to DL models. Except for some rare cases, depending on the number of shots and dataset conditions, our experimental results indicate that the most successful approach in the proposed framework is the deep transfer learning based DTL model. As the number of shots increases, the performance of transfer learning-based DTL and DL models improves. 



When comparing our models without utilizing augmentation techniques, datasets containing  relatively large number of classes, such as SD-198 and Derm7pt, exhibit similar behaviors. Episodic learning-based models tend to be more successful when the number of shots is low (i.e. 1 or 2 shots), while DTL and DL models show a tendency to outperform as the number of shots increases. For instance, with MobilNetV2 model on the SD-198 dataset, for a 5-Way 1-Shot scenario, the FETL model achieved 65.85%, whereas the DTL model achieved 64.06%. For a 5-Way 10-Shot scenario, the FETL model achieved 86.36%, whereas the DTL model achieved 91.37% (Table <ref>). The behaviour of the models are similar in Derm7pt dataset as well (Table <ref>). The reason behind this phenomenon lies in the adaptability of episodic learning, which performs better in scenarios with fewer shots due to the large number of classes. Additionally, clinical images inherently encapsulate various differences, making models trained in an episodic manner more inclined to tolerate these diversities. As the number of shots increases, models trained non-episodically become more successful in classifications.

Since the ISIC2018 dataset comprises dermoscopic data, the discriminative power of domain-specific features becomes more crucial. Hence, transfer learning-based DTL and DL models outperform FETL and FEL models. For instance, for MobileNetV2, the accuracy rates are 58.49% for 2-Way 1-Shot with FETL and 64.83% with DTL, and 68.82% for 2-Way 10-Shot with FETL and 85.18% with DTL (Table <ref>).  Episodic learning-based methods tend to remain superficial in training. Additionally, in parallel with the SD-198 dataset, models tend to become more successful as the number of shots increases in ISIC2018 and Derm7p datasets. The MobileNetV2 and DenseNet121 models tend to yield complementary outcomes. DenseNet121, with its greater parameter count, is more susceptible to overfitting while training. Conversely, MobileNetV2, with its simpler architecture, is better suited for practical applications in this setting.

In all three datasets we studied, transfer learning methods generally perform better than episodic few-shot training in learning distinct features, except in cases where there is only one example provided. This observation suggests that even though episodic few-shot training is a more intricate approach, it may not be as effective as transfer learning in most scenarios. The exception is when extremely limited data is available, which is when episodic few-shot training can be valuable. This finding is consistent with recent research (<cit.>) that questions the practicality of complex few-shot training methods.



 §.§ Comparison with Current State-of-the-Art


We also included a thorough analysis aimed at understanding how different skin disease datasets, each with unique features and conditions, influence the training process. We arranged the datasets in our research in a manner similar to SCAN <cit.> and PFEMed <cit.> studies  for a fair comparison of the model performances. Specifically, we examined the performance benchmarks set by the SCAN model on the SD-198 and Derm7pt datasets, and by the PFEMed model on the ISIC2018 dataset. 




In our research with the SD-198 dataset, we enhanced our Deep Transfer Learning (DTL) model by integrating various augmentation techniques, and compared these models with other state-of-the-art models in the field, particularly focusing on the SCAN model (Table <ref>). The SCAN model, which incorporates an unsupervised cluster branch, has been previously contrasted with the Meta-DermDiagnosis study. Our comparison also extended to various transfer learning-based Few-Shot Learning (FSL) methods; including the models like NCA <cit.>, Baseline <cit.>, S2M2_R <cit.>, NegMargin <cit.>, PT+NCM <cit.>, PEMbE- <cit.>, and EASY <cit.>. Notably, the SCAN model reported better results than these approaches in tests on the SD-198 dataset. The EASY model, which achieved results comparable to the SCAN model, used an ensemble technique and augmented images with a random resize crop method. Our approach, however, is different; we employ the MobileNetV2 model, leveraging ImageNet pre-trained weights instead of the typically used WRN-28-10 model. Our augmentation strategy is more varied; we combined traditional techniques like Random Flip and Random Resize Crop with advanced methods such as CutMix, MixUp, and ResizeMix (as used by MetaMed model). This approach enabled our models to exceed the existing state-of-the-art results. Even though we used simple transfer learning based methodology, with the data augmentations our model could efficiently learn and transfer feature embeddings from base classes to novel classes. 

Similarly, the PFEMed study compared its results on the ISIC2018 dataset  with benchmarks set by studies like MetaMed <cit.>, Meta-DermDiagnosis, PT-MAP <cit.>, Baseline, and NegMargin. The PFEMed approach involved a comprehensive model with a dual-encoder structure combined with a Variational Autoencoder, distinguishing between general and specific features, and achieving state-of-the-art results. In contrast, the MetaMed study explored models employing augmentation techniques (such as CutOut, CutMix, and MixUp) during episodic training with Reptile model, and compared these to Meta-DermDiagnosis. In this dataset, observing the potential success of our DTL model trained with MobileNetV2, we applied similar augmentation techniques to the training data. The experiment results depict that our model performs comparable results with the state-of-the-art models; producing second best results in 3-Shot and 5-Shot cases. Moreover, we obtain best results when the number of samples is increased (i.e. 10-Shot case) (Table <ref>).



We also compared our models with leading models on the Derm7pt dataset. The unique features of this dataset played a key role in improving performance, especially the sub-cluster aspect in the SCAN model. We included findings from the PFEMed study in our comparison. By using the DTL-MixUp model, based on the DenseNet121 framework, we achieved results that align with existing benchmarks in the 2-Way 5-Shot scenario, where our model ranked second in accuracy. Similar to what we observed in our early experiments without data augmentations, in one-shot settings, the DTL model didn't perform as well compared to other models (see Figure <ref>). It's important to note that our method relies solely on transfer learning techniques and enhances the pretrained ImageNet model with data augmentations. These outcomes indicate that this fundamental approach remains effective in managing long-tail distributions, without the need for intricate training methods.



§ CONCLUSION AND FUTURE WORK


In this study, we explore the effectiveness of episodic and traditional training methods combined with few-shot learning through transfer learning for classifying rare skin diseases in situations with limited data. Current literature emphasize that datasets with long-tail distributions present specific challenges, highlighting the necessity for specialized training approaches to achieve successful outcomes. But there is a lack of research combining basic few-shot training models with well-known transfer learning methodologies in this domain. Our study seeks to fill this gap by evaluating these established training methods on major datasets often used as benchmarks for long-tail distributions in skin diseases. In this context, we presented evaluations of three publicly available skin image datasets using the FETL, FEL, DTL, and DL models. Notably, the DTL model, which integrates transfer learning with conventional training techniques, consistently outperformed others in these datasets. By enhancing our models with MixUp, CutMix, and ResizeMix techniques, as recommended in existing literature, we were able to reach leading performance on the SD-198 and comparable performances with the state-of-the-art methods in ISIC2018 and Derm7pt datasets. 

These findings underline the effectiveness of transfer learning, a well-established method, in the context of few-shot learning for long-tail distributions in skin disease classification. We suggest that further improvements in accuracy and robustness can be achieved through expanded data augmentation and exploring different model architectures. Based on the insights gained from this study, we believe that further research is crucial, especially for dermoscopic datasets facing data scarcity. Moreover, applying these findings to a broader range of medical imaging datasets, including X-rays, CT scans, and MRIs, could be helpful in detecting and diagnosing new diseases.

 
unsrt  
 

