## 3 Materials and Methods
### Performance Metrics  
To evaluate the performance of individual models such as the proposed SkinSwinViT, this study considers the following performance metrics.  
To measure the performance indicators of multi-classification, after data enhancement technology processing, the number of pictures in each category is the same, and there is no imbalance in the number of samples, so this paper adapts the Macro-average method. In multiclass classification problems, Macro-average calculates the indicators of each category and then averages the indicators of all categories. This is equivalent to setting the weights of all categories to be consistent. The specific formula is as follows:  
\[Accuracy\ =\frac{1}{n}{\sum\limits_{i=1}^{n}Accuracy_{i}}=\frac{1}{n}{ \sum\limits_{i=1}^{n}{\frac{TP_{i}\ +TN_{i}}{TP_{i}+TN_{i}+FP_{i}\ +FN_{i}}}} \tag{11}\]  
\[Recall=\frac{1}{n}{\sum\limits_{i=1}^{n}{Recall_{i}}}=\frac{1}{n}{\sum\limits _{i=1}^{n}{\frac{TP_{i}}{TP_{i}+FN_{i}}}} \tag{12}\]  
\[Precision=\frac{1}{n}{\sum\limits_{i=1}^{n}{Precision_{i}}}=\frac{1}{n}{\sum \limits_{i=1}^{n}{\frac{TP_{i}}{TP_{i}+FP_{i}}}} \tag{13}\]  
\[Specificity=\frac{1}{n}{\sum\limits_{i=1}^{n}{Specificity_{i}}}=\frac{1}{n}{ \sum\limits_{i=1}^{n}{\frac{TN_{i}}{TN_{i}+FP_{i}}}} \tag{14}\]  
\[F1\ Score=2\times\frac{Precision\times Recall}{Precision+Recall} \tag{15}\]  
\(Accuracy_{i}\) represents the accuracy of prediction of a certain category among the seven categories of skin diseases. \(i\) represents one of the seven types of skin diseases. The same applies to other indicators, where n represents the number of classification categories. In this article, \(n=7\), and the summation symbol \(\sum\) is used to accumulate all categories. The indicators referred to in this study, by default, refer to the above-average indicators.  
\(TP_{i}\) (True Positive): Refers to the number of instances that are correctly predicted to be a certain type of skin disease. \(FN_{i}\) (False Negative): Refers to the number of instances that are incorrectly predicted to be not a certain type of skin disease. \(FP_{i}\) (False Positive): Refers to the number of non-skin disease instances that are incorrectly predicted to be a certain type of skin disease. \(TN_{i}\) (True Negative): Refers to the number of cases of  
Figure 4: TL-based fine-tuned model training.  
non-skin diseases that are correctly predicted to be non-skin diseases. Recall quantifies the frequency with which a classifier accurately predicts a positive outcome among all samples that should have been classified as positive. High precision indicates the test's ability to precisely identify positive samples, thereby mitigating the occurrence of false positives. Elevated specificity signifies the accurate exclusion of negative samples and a diminished risk of misdiagnosis. The F1 score, as the harmonic mean of precision and recall, offers a comprehensive assessment of a classifier's accuracy in predicting positive instances.  
This study employs the ROC (Receiver Operating Characteristic) curve and AUC (Area Under the Curve) value for separate analyses of each category. The ROC curve plots the False Positive Rate (FPR) on the x-axis and sensitivity on the y-axis. Sensitivity measures the correct identification of positive examples, while the false positive rate represents the incorrect identification of negative examples. The formula for calculating the false positive rate is as follows:  
\[FPR=\frac{FP_{i}}{TN_{i}+FP_{i}} \tag{16}\]  
The AUC is a metric that measures the overall performance of a classification model by calculating the area under the ROC curve. A higher AUC indicates better classification effectiveness for the model. The AUC value typically falls between 0.5 and 1.0, where 0.5 represents a random classifier, and 1.0 represents a perfect classifier.