# Sunspot Detection Using YOLOv5 in Spectroheliograph H-Alpha Images
## 4 Materials and Methods
### Data Sets of Selected Images  
The set of images used for the present work consisted of 2000 H\(\alpha\) continuum images, with resolution \(1200\times 1000\) pixel. Those images were taken at the OGAUC spectroheliograph, between 15 February 2012 and 26 April 2019, so they correspond to solar cycle 24. They were obtained from the public repository Bass2000 Solar Survey Archive ([[https://bass2000.obspm.fr/accessed](https://bass2000.obspm.fr/accessed)]([https://bass2000.obspm.fr/accessed](https://bass2000.obspm.fr/accessed)) on 26 April 2023). The images contain the solar disk and side annotations, as shown in Figure 2. As happens with images taken from the earth's surface, the quality depends on the atmospheric conditions of the day they were taken. That means the quality of the images is not always the same. Figure 2 in particular shows an image that was taken in a cloudy day, so the quality is very poor and only the larger sunspot is clearly visible. Additionally, the images were captured using a composition process that sometimes results in images shown as a number of different slices. Those characteristics make them harder to analyze than other sun images, especially those takenfrom outer space by satellites or telescopes in orbit, where there is no influence of the earth's atmosphere.  
Throughout the study, a number of different experiments were performed in order to determine the best image-marking methods and parameters of the YOLO models, as well as the pre-processing methods to be used. Therefore, six different smaller datasets were created, named A to F, to perform different experiments. The main difference between datasets is the number of images. Smaller datasets were created for faster experiments and larger datasets for more accurate results. A more detailed description is as follows:  
* Dataset A--a small subset, to experiment with the annotation software and create the first models. It consists of 50 images, which were expanded to 120 using data augmentation methods, namely flip, rotate and shear.
* Dataset B--consists of 932 images, expanded to a total of 2076 through data augmentation processes flip, rotate and shear.
* Dataset C--a total of 1000 images, expanded to 2379 through data augmentation processes. This dataset was created in order to experiment with more precise annotation of the dataset.
* Dataset D--dataset of cropped images. The frame around the solar circle was removed so that only the relevant part was maintained. From 500 spectroheliograms, 958 images were generated through data augmentation processes, in this case, just flipping the image.
* Datasets E and F--created as the final dataset for the work. Dataset E is the first half of the final dataset, which is dataset F. The first and second halves of dataset F consist of 1919 and 1928 images, respectively, generated from 1000 images each, through data augmentation processes (again, just flipping).  
For datasets D, E and F, the images were cropped in order to reduce the pixel loss when scaled for the network input. Cropping consisted of removing the letters and most of the black area around the sun disc, leaving just the relevant area. Cropping removes data which are not relevant and also makes the sunspots larger and easier to identify, so this pre-processing step was assumed important and used in the final experiments.  
Dataset F is divided into train and validation sets with 3247 and 600 images, respectively.