# Sunspot Detection Using YOLOv5 in Spectroheliograph H-Alpha Images
## 5 Experiments and Results
### Discussion  
In the first experiments, although many tests reached good precision rates, they were achieved very early in the training process and they were not always repeatable in other test sets. This likely happened because the datasets were too small, so the results were mostly randomly overfit to those particular samples. The experiments show that a minimum of 1000 manually annotated images were necessary to train a robust model and have some confidence in the results obtained. The results also show that YOLO benefits from images that are as large as possible. When the frames and annotations around the images were removed, the performance improved significantly. Processing the images using contrast enhancing techniques did not contribute to improving the results. The results above were obtained using the smallest model of the YOLOv5 family, which is YOLOv5s. Additional experiments were performed with more powerful models, namely the m and l versions. A comparison of the relevant results is shown in Table 3.  
The results presented show the main differences between the YOLO models. The table shows the best precision, recall, objectness (Obj) and mean average precision (mAP) with confidence 0.5 and 0.95. It also shows the time required to train each model. As the table shows, the larger models have a slightly better precision. However, that comes at the cost of much longer training times. This may be an obstacle for training with larger datasets. For inference, however, that problem is less important because the network only needs to process each image one time. The results obtained in the present experiments are inferior to many described in Section 2. However, other authors use images which are obtained using satellites or telescopes in outer space. Images obtained from space do not suffer from atmospheric conditions. They are cleaner, clearer and show the sunspots in greater detail. The atmosphere adds different types of noise to the images, where many particles in the air interfere with the light coming from the sun, absorbing or reflecting part of it. Comparing to previous work that uses images from the OGAUC, namely [PERSON] et al. [9], the YOLOv5 neural network achieved a slightly higher detection accuracy on a much larger dataset, even though the version implemented will only return the bounding box and not additional spot information. Additional information, such as the sunspot area or umbra, as reported by [PERSON] et al., may be detected by segmentation models. Table 4 shows a summary of the best precisions reported by [PERSON] et al., using mathematical morphology, pixel intensity, and the YOLO models. YOLOv5s offers a precision which is 2.60% higher than the mathematical morphology method, and YOLOv5l has a precision 1.15% higher than the smaller architecture. It should be noted that all the images used in all the tests are from the same OGAUC dataset and the same solar cycle. Nonetheless, the subset used by [PERSON] et al. is smaller than the subsets used for the experiments with YOLO models, in part because training for deep neural networks requires larger numbers of samples when compared to mathematical morphology and pixel intensity models. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **Time** & **Precision** & **Recall** & **Obj** & **mAP@.5** & **mAP@.95** \\ \hline YOLOv5s & \(\sim\)3 h & 88.85\% & 82.31\% & 2.76\% & 90.43\% & 49.14\% \\ YOLOv5m & \(\sim\)4 h 15 m & 88.90\% & 82.95\% & 2.64\% & 91.14\% & 51.44\% \\ YOLOv5l & \(\sim\)6 h 15 m & 90.00\% & 82.38\% & 2.69\% & 91.53\% & 52.71\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Summary of the best results obtained with the different models trained. Compared with other authors, for example, [PERSON] et al., described in Section 3, the precision of the YOLO models is lower. [PERSON] et al. achieved up to 98%. [PERSON] et al. achieved 98.5%. [PERSON] et al. achieved 99.92%. The difference comes from the different types of images used--[PERSON] et al.