# Sunspot Detection Using YOLOv5 in Spectroheliograph H-Alpha Images
## 5 Experiments and Results
### Experiments with Different Datasets  
Several training experiments were performed, with the different datasets described in Section 4. Table 2 shows a summary of the main experiments, including the relevant parameters and the results obtained. \begin{table}
\begin{tabular}{c c c c c} \hline
**Dataset (Size)** & **File** & **Epochs** & **Batch Size** & **Best Precision** & **Epoch** \\ \hline A (120) & Standard Train & 5000 & 12 & 33.33\% & 73 \\ \hline \multirow{8}{*}{B (2076)} & Standard Train (1) & 200 & 12 & 42.74\% & 95 \\  & Standard Train(2) & 200 & 12 & 86.53\% & 47 \\  & Incremental Train(p1) & 500 & 12 & 63.55\% & 203 \\  & Incremental Train(p2) & 500 & 12 & 62.15\% & 304 \\  & Incremental Train(p3) & 500 & 12 & 62.99\% & 220 \\  & Several Steps(p1) & 500 & 173 & 61.65\% & 398 \\  & Several Steps(p2) & 500 & 12 & 63.46\% & 7 \\  & Several Steps(p3) & 500 & 6 & 65.47\% & 320 \\ \hline C (2379) & Standard Train & 1000 & 13 & 90.53\% & 156 \\ \hline \multirow{8}{*}{D (958)} & Cropped(1) & 500 & 12 & 83.61\% & 209 \\  & Cropped(2) & 300 & 12 & 79.76\% & 291 \\  & Cropped(3) & 300 & 12 & 79.69\% & 233 \\  & Cropped(4) & 300 & 12 & 80.12\% & 126 \\  & Cropped(5) & 300 & 12 & 81.81\% & 221 \\  & Erosion & 300 & 12 & 81.03\% & 298 \\  & Equalize Hist(1) & 300 & 12 & 93.67\% & 9 \\  & Equalize Hist(2) & 300 & 12 & 83.23\% & 8 \\  & Equalize Hist(3) & 300 & 12 & 99.41\% & 6 \\  & Equalize Hist(4) & 300 & 12 & 79.59\% & 277 \\  & CLAHE(1) & 300 & 12 & 79.45\% & 184 \\  & CLAHE(2) & 300 & 12 & 77.46\% & 197 \\  & CLAHE(3) & 300 & 12 & 96.24\% & 6 \\  & CLAHE(4) & 300 & 12 & 77.17\% & 219 \\ \hline \multirow{8}{*}{E (1929)} & Standard Train (1) & 500 & 12 & 86.91\% & 206 \\  & Standard Train (2) & 500 & 12 & 85.94\% & 266 \\ \cline{1-1}  & Standard Train (3) & 500 & 12 & 86.12\% & 271 \\ \cline{1-1}  & Standard Train (4) & 500 & 12 & 86.01\% & 184 \\ \hline \multirow{8}{*}{F (3827)} & Standard Train (1) & 300 & 12 & 84.77\% & 108 \\ \cline{1-1}  & Standard Train (2) & 300 & 12 & 83.77\% & 111 \\ \cline{1-1}  & Standard Train (3) & 300 & 12 & 88.85\% & 245 \\ \hline \end{tabular}
\end{table} 
Table 2: Summary of the experiments performed and results obtained with YOLOv5s. The first column specifies the dataset name and the number of images it comprises. The other columns refer to the name of the file where the results were saved; number of epochs of training; batch size defined for training; best precision achieved; and epoch in which the best result was achieved. The table shows the results of various experiments performed in order to determine the best values for the hyperparameters. The first experiment had the purpose of evaluating whether the YOLO model was learning, or how fast it was learning. The result was very unsatisfactory due to the small amount of images to train with, but it still showed the ability of the model to learn and achieved a precision of 33.33% after 73 epochs with a batch size of 12. Example of the sunspot detection using the best weights obtained with the various network structures L, M and S show in Figure 3.  
Using dataset B, three different experiments were performed in order to glean insight into the performance of each method and determine the best one for the present problem. The methods were as follows:  
* Standard train--consists of a 200 epochs training;
* Incremental train--the weights generated by a training experiment are used in the following one, counting up to three instances;
* Train with several steps--the batch size starts large and then decreases;  
Dataset C was used for a single experiment. The results were apparently good since the precision was over 90%. However, that was at the cost of data augmentation. For better confidence in the results, more images were marked later, and larger datasets were constituted. Dataset D was used to test different pre-processing methods, as described in Section 4. First, the images were cropped, removing the frame around the solar disk.