# Sunspot Detection Using YOLOv5 in Spectroheliograph H-Alpha Images
## 3 Related Work
### Hierarchical Method for Quick and Automatic Recognition of Sunspots  
[PERSON] et al. [20] proposed to develop a neural network based on YOLOv3, for the automatic recognition of sunspots. The dataset used consists of 700 continuum images obtained from SDO/HMI dataset for training, and continuum images randomly selected from 2010 to 2014 for testing. The final result shows that the entire processing flow achieves a 73.41% intersection ratio, 98.50% recognition rate and 0.60% false recognition rate. Regarding the recognition speed, this approach obtained much better results in comparison to other sunspot recognition algorithms. Fast Solar Image Classification Using Deep Learning and Its Importance for Automation in Solar Physics  
[PERSON] et al. [27] proposed a CNN for the classification of solar images, composed of 13 layers, characterized as one of the following types: convolutional, pooling and dense layers. Images obtained from Hinode Solar Optical Telescope (SOT) are analyzed by the mentioned neural network and classified into one of five classes: filaments, flare ribbons, prominences, sunspots, and quiet sun (absence of the previous four). The dataset was divided into training set and validation set. The training set consists of 11,857 \(H_{a}\) images from the SOT, classified manually into one of the classes mentionedabove. The validation set consists of 1318 Hinode/SOT \(H_{\alpha}\) images spread approximately equally between the classes. There is a total of 13,175 images used in the whole project. Regarding the initialization of the network, in order to reduce the number of training epochs, He initialization was employed. The optimization method used was SGD with Nesterov momentum, which is similar to the standard but has an additional parameter: velocity. This ensures better performance for the network. To improve the network stability and normalize the output of the convolution calculation, \"batch normalization\" was applied to the convolution operation's output. Additionally, to avoid the vanishing gradient problem, [PERSON] et al. used the rectified linear unit (ReLU) function. Maxpooling layers are used for downsampling the data in order to increase processing performance by reducing the number of parameters. The downsampling works by converting the image into square grids of 2 \(\times\) 2 pixels. This results in a new image in which each pixel represents four pixels of the input image. For the training phase, the loss function used is the \"cross entropy loss\", which is based on the discrete version of a multinomial logistic regression. The results obtained were very satisfactory, as the CNN reached an accuracy of 99.92%, which means that only 1 out of the 1318 images was misclassified. Automatic Analysis of Magnetograms for Identification and Classification of Active Regions Using Deep Learning  
[PERSON] et al. [28] proposed a deep learning technique in Python for the detection and classification of active regions. Several deep learning models were taken into account in order to compare the results between them and find the one(s) with the best accuracy. The goal of the methods developed was to classify the solar flares as one of the classes shown in Table 1.  
The dataset was obtained from The Helioiviewer Project (2019) ([[https://heloiviewer.org/](https://heloiviewer.org/)]([https://heloiviewer.org/](https://heloiviewer.org/)), accessed on 5 May 2023). The data were divided into two sets, according to the neural network to be trained. For the detection algorithm, 1000 magnetograms (that were labeled using Fiji software, with the ALP plugin) were used to train the first neural network. For the classification algorithm, the dataset consisted of 1548 images, divided into classes characterized by the magnetic configurations:  
* A (a): 223 images;
* AG (\(\alpha-\gamma\)): 111 images;
* B (\(\beta\)): 408 images;
* BG (\(\beta-\gamma\)): 774 images;  
Each sub-dataset was also divided into a training set (70% of the total dataset), validation set (20%), and test set (10%).