## 4 Experiments
### Hyperparameter and Evaluation Metrics  
Before the main experiments, the MNIST and FashionMNIST datasets were used as benchmarks to initially assess the range of hyperparameter settings. To validate the success of the experiments, this paper compares the results of the proposed model with other models, including Vision Transformer (ViT) and its variant RepViT, U-Net and its variant U-Net++, as well as YOLOv8, using the same experimental setup.  
All of the experiments used the SGD optimizer, which was found to outperform the Adam optimizer for this model. The optimal hyperparameter settings determined with the SGD optimizer were as follows: a learning rate of 0.01 and a maximum of 70 training epochs. Due to hardware limitations, the maximum batch size for 64-pixel images was 20. Five different batch sizes were tested (4, 8, 16, 18, and 20), with 16 providing the highest efficiency.  
For the learning rate, 0.001 and 0.01 were tested, and a final decision was made to use a learning rate of 0.003. Although a learning rate of 0.01 led to faster convergence, 0.001 sometimes resulted in the model getting stuck in local optima, preventing it from achieving satisfactory accuracy.  
In terms of training epochs, based on the benchmark results, the CIFAR-10 dataset typically converged within 10 epochs, so a slightly higher range of 10 to 20 epochs was used. For the ImageNet-100 dataset, 30 epochs were sufficient to achieve good performance and avoid overfitting. The ImageNet-1k dataset, with its 1000 classes, posed potential memory issues due to large weight matrices, leading to a reduction in the batch size to 8.  
After multiple rounds of training, the model with the highest accuracy was saved for testing on the test set. The evaluation of the experimental results was based on two metrics: accuracy and precision.  
1. Accuracy: Accuracy is the proportion of correctly classified samples to the total number of samples, used to evaluate the overall classification capability of the model. The formula is as follows: \[\text{Acc}=\frac{C_{1}}{N}\times 100\%\] (8) where \(C_{1}\) represents the number of correctly predicted samples, and \(N\) represents the total number of samples. Since the dataset in this experiment does not exhibit class imbalance, this metric can effectively evaluate the experimental results. Additionally, the Top-5 accuracy metric is introduced, which measures the proportion of samples where the correct class is within the top 5 predicted classes. Its formula is: \[\text{Top-5 Acc}=\frac{C_{5}}{N}\times 100\%\] (9) where \(C_{5}\) represents the number of samples where the true class is among the top five predicted probabilities.
2. Precision: In multiclass classification tasks, precision refers to the proportion of samples predicted as a certain class that are actually of that class. Precision in multiclass problems is usually computed using either the macro average or micro average. For class-balanced datasets, macro average precision is more suitable, and its formula is: \[\text{Macro Precision}=\frac{1}{N}\sum_{i=1}^{N}\frac{\text{TP}_{i}}{\text{TP} _{i}+\text{FP}_{i}}\times 100\%\] (10) where \(\text{TP}_{i}\) and \(\text{FP}_{i}\) represent the number of true positives and false positives for class \(i\), respectively, and \(N\) is the total number of classes.