# A Study on Small-Scale Snake Image Classification Based on Improved SimCLR
## 3 Results
### Experimental Results
#### 3.3.2 Impact of Different Approaches  
To evaluate the impact of different feature coding backbones on the contrastive learning framework, we compared three representative architectures--ResNet-50, ViT, and Swin Transformer--as summarized in Table 5.  
The ResNet-50, a classical convolutional neural network, achieved a validation accuracy of 0.8705 with a relatively high training loss of 2.1411. While effective, it shows limitations in modeling long-range dependencies and complex structures, which may affect its capacity to learn discriminative representations in the contrastive setup. In contrast, the ViT architecture significantly outperformed ResNet-50 with an accuracy of 0.9532 and a notably lower training loss of 0.2634. This suggests that its global self-attention mechanism is better suited for capturing the holistic structure of snake images, even without convolutional priors. Further improvement was observed when using the Swin Transformer, which combines the advantages of both convolution and attention through a hierarchical window-based attention design. It achieved the highest accuracy of 0.9748, with a training loss of 2.1211. Despite the slightly higher loss than ViT, the Swin model demonstrates better generalization, likely due to its stronger inductive bias and better spatial locality modelling. In summary, Transformer-based feature encoders--particularly Swin Transformer--are more effective than conventional CNNs in contrastive learning for fine-grained snake species recognition, owing to their superior ability to capture global context and local structures. To further evaluate the generalization of the Swin Transformer, we conducted a 5-fold cross-validation. As shown in Table 5, the model achieved an accuracy of \(0.9811\pm 0.0015\), surpassing the original single-split result of 0.9748, confirming the model's robustness. To further evaluate the classification performance of different backbone networks, we conducted a detailed per-class comparison using precision (P), recall (R), and F1-score metrics, as summarized in Table 6. The visual image is shown in Figure 7. The results demonstrate the superiority of Transformer-based models over the traditional convolutional backbone (ResNet50) in almost all categories. 1. Overall Trends:  
The Swin Transformer achieved the highest macro and weighted averages of precision (0.98 and 0.97), recall (0.96 and 0.96), and F1-score (0.97 and 0.96), indicating robust performance and strong generalization across all classes. ViT followed closely with a macro F1-score of 0.93, significantly outperforming ResNet50, whose macro F1-score was only 0.87. ResNet50 showed inconsistent per-class performance, with some classes (e.g., Class \begin{table}
\begin{tabular}{c c c} \hline \hline
**Data Augmentation Strategies** & **Accuracy** & **Training Loss** \\ \hline conventional augmentation methods & 0.9676 & 2.1096 \\ conventional augmentation methods \(+\) RandomGrayscale & 0.9712 & 2.1207 \\ conventional augmentation methods \(+\) RandomGrayscale & 0.9748 & 2.1211 \\ \(+\) Random Erasing & & \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Impact of different data augumentation methods. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature Coding Module** & **Accuracy** & **Training Loss** \\ \hline ResNet50 (single split) & 0.8705 & 2.1411 \\ ViT (single split) & 0.9532 & 0.2634 \\ Swin Transformer (single split) & 0.9748 & 2.1211 \\ Swin Transformer (5-fold CV) & 0.9811 \(\pm\) 0.0015 & – \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Impact of different feature coding modules. 11, 7, and 6) exhibiting notably low recall and F1-scores, suggesting challenges in capturing subtle inter-class differences due to limited spatial context modelling. 2. Per-Class Observations:  
Classes such as 10, 12, 13, and 17 were consistently classified with high precision and recall by all models, indicating that they are relatively easier to distinguish.