<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Exploring Deep Learning for Full-disk Solar Flare Prediction with Empirical Insights from Guided Grad-CAM Explanations</title></titleStmt>
			<publicationStmt>
				<publisher>IEEE</publisher>
				<date>10/09/2023</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10526212</idno>
					<idno type="doi">10.1109/dsaa60987.2023.10302639</idno>
					
					<author>Chetraj Pandey</author><author>Anli Ji</author><author>Trisha Nandakumar</author><author>Rafal A Angryk</author><author>Berkay Aydin</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Abstract-This study progresses solar flare prediction research by presenting a full-disk deep-learning model to forecast &#8805;Mclass solar flares and evaluating its efficacy on both central (within &#177;70 &#8226; ) and near-limb (beyond &#177;70 &#8226; ) events, showcasing qualitative assessment of post hoc explanations for the model's predictions, and providing empirical findings from humancentered quantitative assessments of these explanations. Our model is trained using hourly full-disk line-of-sight magnetogram images to predict &#8805;M-class solar flares within the subsequent 24-hour prediction window. Additionally, we apply the Guided Gradient-weighted Class Activation Mapping (Guided Grad-CAM) attribution method to interpret our model's predictions and evaluate the explanations. Our analysis unveils that full-disk solar flare predictions correspond with active region characteristics. The following points represent the most important findings of our study: <ref type="bibr">(1)</ref> Our deep learning models achieved an average true skill statistic (TSS) of &#8764;0.51 and a Heidke skill score (HSS) of &#8764;0.38, exhibiting skill to predict solar flares where for central locations the average recall is &#8764;0.75 (recall values for X-and M-class are 0.95 and 0.73 respectively) and for the near-limb flares the average recall is &#8764;0.52 (recall values for X-and Mclass are 0.74 and 0.50 respectively); <ref type="bibr">(2)</ref> qualitative examination of the model's explanations reveals that it discerns and leverages features linked to active regions in both central and near-limb locations within full-disk magnetograms to produce respective predictions. In essence, our models grasp the shape and texturebased properties of flaring active regions, even in proximity to limb areas-a novel and essential capability with considerable significance for operational forecasting systems.</p><p>Index Terms-Solar flares, Deep learning, xAI, Interpretability</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>Solar flares are transient but intense outbursts of energy that emanate from the Sun's surface in the form of extreme ultraviolet and X-ray radiation and are one of the central phenomena in space weather forecasting. Flares are typically classified in five different classes based on their peak X-ray flux by National Oceanic and Atmospheric Administration (NOAA) <ref type="bibr">[1]</ref>, where flare intensities are characterized by a major class (i.e., A, B, C, M, and X) and a numerical strength value within a class (from 1.0 to 9.9). These indicate the order of magnitude of the peak X-ray flux in a logarithmic scale (e.g., X-ray flux values for B3.7 is 3.7 &#215; 10 -7 W m -2 , C7.2 is 7.2 &#215; 10 -6 W m -2 , M1.4 is 1.4 &#215; 10 -5 W m -2 , or X2.1 is 2.1 &#215; 10 -4 W m -2 ). M-and X-class solar flares are relatively scarce events and significantly more powerful than the other flare classes which garner the attention of researchers due to their potential to cause near-Earth impacts that pose a substantial risk to both space-based and terrestrial infrastructures, disrupting satellite communications, power grids, and aviation, making solar flare prediction a complex and critical area of research in space weather forecasting <ref type="bibr">[2]</ref>.</p><p>Active regions (ARs) on the Sun represent areas where the sun's magnetic field experiences disruptions, leading to a variety of solar phenomena such as solar flares, coronal mass ejections (CMEs), and solar energetic particle (SEP) events. The majority of solar flare prediction models concentrate on these regions of interest, offering forecasts for each AR, as they are primarily responsible for space weather events. To generate a comprehensive forecast using an ARcentric model, the likelihood of a flare occurring within each AR (P F L (AR i )) is usually consolidated utilizing a heuristic function as described in <ref type="bibr">[3]</ref>. The equation for this aggregation is</p><p>, which computes the probability of having a minimum of one flaring AR, under the assumption that flares from different ARs occur independently and infers that all ARs hold equal significance in the combination. This constrains an accurate assessment of the full-disk flare prediction probability.</p><p>Furthermore, the magnetic field measurements, which underpin AR-based forecasting techniques, are influenced by projection effects when ARs are in proximity to the limbs <ref type="bibr">[4]</ref>. Consequently, the data is restricted to ARs situated within a range of &#177;30 &#8226; <ref type="bibr">[5]</ref> to &#177;70 &#8226; <ref type="bibr">[6]</ref> of the solar disk due to significant projection effects <ref type="bibr">[7]</ref>. The full-disk models, however, utilize magnetograms corresponding to the entire solar disk to rely on shape-based features such as size, directionality, shapes of sunspots, and polarity inversion lines similar to the findings from <ref type="bibr">[8]</ref>- <ref type="bibr">[11]</ref>. While projection effects persist in these images, we show that the full-disk models are capable of learning and predicting flare productivity of areas close to the limb of the Sun, offering an essential component for operational systems.</p><p>Recently, many studies (e.g., <ref type="bibr">[3]</ref>, <ref type="bibr">[5]</ref>, <ref type="bibr">[12]</ref>- <ref type="bibr">[18]</ref>) have led to the successful application of machine learning and deep learning methods in predicting solar flares. These methods have shown promising experimental results, indicating their potential to improve forecasting accuracy in the field of solar flare prediction. However, deep learning models are often considered black-box models due to their complex data representations, making it challenging to understand the reasoning behind their predictions. This lack of transparency can pose problems in critical applications like solar flare prediction, where the model's reliability is crucial. The absence of transparency in the decision-making process lowers confidence in the accuracy and reliability of the predictions made. Post hoc explanations offer insights into a model's decisionmaking process, enabling the identification of potential errors and biases in the data, and subsequent improvements to the model's performance and reliability, which addresses the issue of transparency and makes it more trustworthy for critical applications. While post hoc explanations effectively highlight crucial input features and enhance trust, a gap persists in our understanding due to the inherent opacity of these models' decision-making processes. Therefore, an approach for meaningful translations remains essential for fully understanding these explanations. This paper serves as an initial step in shedding light on our models' effectiveness by clarifying the model's reasoning with post hoc explanations and enhancing confidence in the model's reliability and accuracy, especially in cases where incorrect predictions could result in substantial consequences, such as in space weather forecasting.</p><p>The focus of this paper is to study whether full-disk models for solar flare prediction can be relied upon for operational forecasting applications as this exploration extends to the prediction of near-limb flare events with model explanations, which hold a notably critical role. This paper builds upon the convolutional neural network (CNN) based model in <ref type="bibr">[19]</ref> to predict &#8805;M-class flares, trained with compressed full-disk line-of-sight magnetograms. The novel contributions of this paper are as follows: (i) We highlight the overall improved performance of our solar flare prediction model exhaustively with quantitative analysis of predictive performance on nearlimb and central locations, (ii) We utilized a recent attribution method to explain and interpret the decisions of our deep learning model and present a case study that shows the explanations of model's decision in spatiotemporal progression, and (iii) More importantly, for the first time, we provide empirical evidence that our models can tackle the prediction of flares appearing on near-limb regions of the Sun by analyzing the explanations with quantitative human-centered approach <ref type="bibr">[20]</ref>.</p><p>The remainder of the paper is structured as follows: Section II provides an overview of existing studies on machine learning and deep learning-based data-driven solar flare prediction models. In Section III, we detail the process of data collection with labeling and explain the subsequent data distribution. In Section IV, we outline our methodology by describing the architecture of our flare prediction model and providing a detailed explanation of the method used for explanation. In Section V, we present our experimental design and findings from the model evaluation. Furthermore, we offer case-based qualitative interpretations of explanations for limited instances and a quantitative analysis of explanations for entire X-class flares in our dataset. Finally, in Section VI, we summarize our findings and suggest avenues for future research.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. RELATED WORK</head><p>Currently, to the best of our knowledge, four strategies are employed for flare prediction: (i) empirical human prediction (e.g., <ref type="bibr">[21]</ref>, <ref type="bibr">[22]</ref>), (ii) statistical prediction (e.g., <ref type="bibr">[23]</ref>, <ref type="bibr">[24]</ref>), (iii) physics-based numerical simulations (e.g., <ref type="bibr">[25]</ref>, <ref type="bibr">[26]</ref>), and (iv) machine learning and deep learning approaches (e.g., <ref type="bibr">[3]</ref>, <ref type="bibr">[5]</ref>, <ref type="bibr">[14]</ref>- <ref type="bibr">[18]</ref>, <ref type="bibr">[27]</ref>). With the rapid progress in machine learning and deep learning techniques, their application to solar flare prediction has significantly expedited research efforts. For instance, in <ref type="bibr">[13]</ref>, a multi-layer perceptron-based model was employed for predicting &#8805;Cand &#8805;M-class flares. The model utilized 79 manually selected physical precursors extracted from multi-modal solar observations.</p><p>Deep learning models have recently emerged as a prominent choice for solar flare prediction. In <ref type="bibr">[5]</ref>, a CNN-based model was trained using AR patches extracted from line-of-sight magnetograms within &#177;30 &#8226; of the central meridian to predict &#8805;C-, &#8805;M-, and &#8805;X-class flares. Similarly, <ref type="bibr">[14]</ref> developed a CNN-based model that issued binary class predictions for &#8805;Cand &#8805;M-class flares within 24 hours using Space-Weather Helioseismic and Magnetic Imager Active Region Patches (SHARP) data <ref type="bibr">[28]</ref>. The SHARP data was extracted from solar magnetograms using AR patches located within &#177;45 &#8226; of the central meridian. Notably, both models had limited operational capability, as they were restricted to small portions of the observable disk in central locations (&#177;30 &#8226; and &#177;45 &#8226; ).</p><p>In the context of explainability in solar flare prediction models, <ref type="bibr">[29]</ref> used an occlusion-based method to interpret a CNN-based solar flare prediction model trained with AR patches. Similarly, <ref type="bibr">[30]</ref> presented visual explanation methods for a deep learning-based flare prediction model. They used Grad-CAM <ref type="bibr">[31]</ref>, and Guided Backpropagation <ref type="bibr">[32]</ref> to show the relationship of physical parameters of ARs with flare activity in the context of the daily occurrence of C-, M-, and X-class flares. They used daily observations of solar full-disk line-of-sight magnetograms at 00:00 UT, and their models show limitations for the near-limb flares. Similarly, <ref type="bibr">[33]</ref> assessed two additional attribution methods, DeepLIFT <ref type="bibr">[34]</ref> and Integrated Gradients <ref type="bibr">[35]</ref>, for interpreting CNNs trained to predict solar flares. Their study used tracked AR patches within a range of &#177;70 &#8226; , where the interpretations are confined to central locations.</p><p>Furthermore, we presented deep learning-based full-disk flare prediction models trained with limited data in <ref type="bibr">[15]</ref>, <ref type="bibr">[16]</ref> as preliminary studies on their feasibility for a complementary approach to operational forecasting systems. These models collectively showed relative success highlighting a promising direction for the development of more comprehensive full-disk models. However, a common limitation across both models was the lack of explainability. More recently, we presented explainable full-disk flare prediction models <ref type="bibr">[19]</ref>, <ref type="bibr">[36]</ref>, utilizing attribution methods to comprehend the models' effectiveness for near-limb flare events. We provided explanations for a limited set of near-limb flares through a case-based qualitative analysis. In this paper, we extend our approach beyond the case-based qualitative analysis by employing a questionnairebased evaluation scheme to quantitatively measure post hoc explanations for X-class flares in our dataset. This addition enhances our ability to show the efficacy of our model's predictions for both near-limb and central locations while also verifying its feasibility for operational forecasting systems. Total number of magnetogram instances in our dataset &#8804;C M X 1 10 100 1000 10000 Fig. 2. The total number of hourly sampled magnetogram images per flare classes. Note that the length of the bar is in logarithmic scale.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. DATA</head><p>We used full-disk line-of-sight solar magnetograms obtained from the Helioseismic and Magnetic Imager (HMI) <ref type="bibr">[37]</ref> instrument onboard Solar Dynamics Observatory (SDO) <ref type="bibr">[38]</ref> available as compressed JPEG 2000 (JP2) images in near real-time publicly via Helioviewer <ref type="bibr">[39]</ref>. We sampled the magnetogram images every hour of the day, starting at 00:00 and ending at 23:00, from December 2010 to December 2018. We collected a total of 63,649 magnetogram images and labeled them using a 24-hour prediction window based on the maximum peak X-ray flux (converted to NOAA/GOES flare classes), as illustrated in Fig. <ref type="figure">1</ref>. To elaborate, for a magnetogram instance at timestamp (T), if the maximum X-ray intensity of a flare was weaker than M within the next 24 hours, we labeled the observation as "No Flare" (NF: &lt;M), and if it was &#8805;M, we labeled it as "Flare" (FL: &#8805;M). This resulted in 54,649 instances for the NF class and 9,000 instances for the FL class. The detailed class-wise distribution of our data is shown in Fig. <ref type="figure">2</ref>. Finally, we created a non-chronological split of our data into four temporally nonoverlapping tri-monthly partitions introduced in <ref type="bibr">[15]</ref> for our cross-validation experiments, as shown in Fig. <ref type="figure">3</ref>. Since M-and X-class flares are relatively scarce events, for &#8805;M-class flares the overall distribution of the data becomes highly imbalanced resulting in the FL to NF ratio in our dataset to be &#8764;1:6.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. MODEL AND EXPLANATION</head><p>3&#215;3 Conv, 3 Binary Output (FL or NF) 11&#215;11 Conv, 64 ReLU 3&#215;3 Max-Pool 5&#215;5 Conv, 192 ReLU 3&#215;3 Conv, 384 ReLU 3&#215;3 Conv, 256 ReLU 3&#215;3 Max-Pool 3&#215;3 Conv, 256 6&#215;6 Avg-Pool 3&#215;3 Max-Pool ReLU Log-softmax FC, 2 ReLU FC, 4096 Dropout, 0.5 ReLU Dropout, 0.5 Flatten, 9216 FC, 4096 Input (512 &#215; 512) In this work, we utilized the AlexNet-based <ref type="bibr">[40]</ref> full-disk flare prediction model in <ref type="bibr">[19]</ref>. Our model extends the pretrained AlexNet model to accommodate 1-channel input magnetogram images by introducing an additional convolutional layer at the beginning of the network that uses a 3&#215;3 kernel, size-1 stride, and outputs three feature maps. This allows the network to take advantage of the pre-trained weights while processing the 1-channel magnetogram images. Moreover, the original AlexNet model is designed to handle 224&#215;224, 3channel images, whereas our input images are 1-channel, 512&#215;512 images. To address this discrepancy, an adaptive average pooling layer is used after the feature extraction process using the convolutional layer and before the fullyconnected layer. This step ensures that the dimensions of the input images are matched to those expected by the pre-trained model. As a result, the model has six convolutional layers, three max pool layers, one adaptive average pool layer, and two fully connected layers. The architecture of the extended AlexNet model used in this study is illustrated in Fig. <ref type="figure">4</ref>.</p><p>Deep learning models have become increasingly complex, creating difficulties in understanding the intricate data representations they learn. As a result, inconsistencies can arise in the patterns discovered by these models <ref type="bibr">[41]</ref>. To address this, attribution methods have been proposed to aid in the interpretation of neural networks' decision-making process. Attribution methods use post hoc attention techniques to generate an attribution vector, or heat map, of the same size as the input, which visualizes how specific input sections contribute to the model's decision without influencing the decisionmaking process during model training and evaluation. There are mainly two categories of attribution methods: perturbationbased (e.g., Occlusion <ref type="bibr">[42]</ref>) and gradient-based. Perturbationbased methods can lead to inconsistent interpretations due to the creation of Out-of-Distribution data caused by random perturbations <ref type="bibr">[43]</ref>, while gradient-based methods calculate the gradients of the output with respect to the extracted features or input using backpropagation, enabling attribution scores to be estimated more efficiently and robustly compared to input perturbations <ref type="bibr">[44]</ref>. In this study, we employ a gradient-based method namely Guided Grad-CAM <ref type="bibr">[31]</ref> to evaluate models and visualize their decisions, identifying the characteristics of magnetogram images that trigger specific decisions to help with operational forecasting under critical conditions.</p><p>The Guided Grad-CAM technique <ref type="bibr">[31]</ref> is a fusion of the Grad-CAM and guided backpropagation <ref type="bibr">[32]</ref> methods. Grad-CAM is a model-agnostic approach that does not require model retraining, and it employs the class-specific gradient data flowing into the final convolutional layer of a CNN to generate a rough localization map of the image's significant regions. Guided Backpropagation is based on the notion that neurons function as detectors for certain image characteristics. As a result, it computes the output gradient with respect to the input, but it only backpropagates the non-negative gradients through ReLU functions, emphasizing the pixels that are important in the image. Although the attributions generated by Grad-CAM are class-discriminative and localize relevant regions of the image, they do not highlight the pixellevel importance as accurately as guided backpropagation <ref type="bibr">[45]</ref>. Guided Grad-CAM merges the globally precise details of guided backpropagation with the coarse localization advantages of Grad-CAM and is computed as the element-wise product of guided backpropagation with the upsampled Grad-CAM attributions. We used Captum <ref type="bibr">[46]</ref> library to compute the Guided Grad-CAM attributions and the detailed steps used are enumerated as follows:</p><p>1) Load the pre-trained model and the desired input image X converted to a tensor. Run the forward pass of the model to obtain the final predictions y and the activations A from the last convolution layer. 2) Compute the gradient dyc dAi of the target class score y c with respect to the activations A at location i. This shows how sensitive the class score is to changes in the activations.</p><p>3) Calculate the weight w i for each activation location by averaging the gradients along the channels and spatial di-mensions. Compute the Grad-CAM heatmap by performing a weighted sum of the activations followed by Rectified Linear Unit (ReLU) activation:</p><p>To compute the guided backpropagation mask: a) Set the gradient of the target class score y c with respect to the model output as 1, and all other gradients as 0. b) Perform the backward pass through the network, calculating gradients for all activations and weights. During this process, all negative gradient values are set to 0 at each ReLU activation function. Hence, the backpropagation process propagates only positive gradients. c) The output of the guided backpropagation will be a mask M , which highlights the pixels in the input that contribute positively to the target class score y c . 5) Combine the Grad-CAM heatmap and guided backpropagation mask by multiplying L c (upsampled to the input size) element-wise with M to obtain the Guided Grad-CAM heatmap</p><p>c is normalized and we can visualize it with or without overlaying on the original image, to identify the important regions contributing to the final prediction.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. EXPERIMENTAL EVALUATION</head><p>In this section, we describe our experimental settings, including the augmentations used to balance the data, as well as the model implementation and hyperparameter configurations utilized in this study. Furthermore, we present the results and observations drawn from our experiments, with a particular focus on the locations of flares (near-limb flares), which are critical aspects of an operational forecasting system. In addition to reporting on the predictive performance of our models, we also present our findings on post-hoc explanations for X-class flares, which are the most relevant class of flares for Earth-impacting events. To quantify the quality of these explanations, we conducted a questionnaire-based assessment of their reliability, which is also described in this section.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Experimental Settings</head><p>The full-disk flare prediction model used in this study is trained using Stochastic Gradient Descent (SGD) as the optimizer and Negative Log-Likelihood (NLL) as the objective function. The model is initialized with pre-trained weights from the AlexNet Model <ref type="bibr">[40]</ref>, then further trained for 40 epochs with a batch size of 64 while employing a dynamic learning rate (initialized at 0.0099 and decreased by 5%). To overcome the issue of class imbalance, we utilized data augmentation and class weights in the loss function. Specifically, we used three augmentation techniques: vertical flipping, horizontal flipping, and rotations ranging from +5 &#8226; to -5 &#8226; . We applied augmentation to both classes, tripling the number of augmented samples for the entire FL class and randomly augmenting the NF class. After augmentation, we adjusted the class weights inversely proportional to the class frequencies to penalize misclassifications in the minority class.</p><p>The overall performance of our models is evaluated using two widely-used forecast skills scores: True Skill Statistics (TSS, shown in Eq. 1) and Heidke Skill Score (HSS, shown in Eq. 2), derived from the elements of confusion matrix: True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN). In the context of our solar flare prediction task, the FL class is considered as the positive outcome, while the NF class is negative.</p><p>where N = T N + F P and P = T P + F N .</p><p>TSS and HSS values range from -1 to 1, where 1 indicates all correct predictions, -1 represents all incorrect predictions, and 0 represents no skill. In contrast to TSS, HSS is an imbalance-aware metric, and it is common practice to use HSS for the solar flare prediction models due to the high classimbalance ratio present in the datasets. In solar flare prediction, TSS and HSS are the preferred evaluation metrics over commonly used ones in image classification, such as accuracy. This preference is because they offer a more thorough and dependable way to assess how well predictions work, especially when dealing with imbalanced class distributions. Lastly, we report the subclass and overall recall (shown in Eq. 3) for FL class instances (M-class and X-class) to demonstrate the prediction sensitivity in central and near-limb regions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Recall = T P T P + F N</head><p>(3)</p><p>To reproduce this work, the source code and experimental results can be accessed from our open-source repository <ref type="bibr">[47]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Model Evaluation</head><p>The aggregated results from the 4-fold cross-validation experiments are as follows: Our models have on average TSS&#8764;0.51 and HSS&#8764;0.38, which improves over the performance of <ref type="bibr">[15]</ref> by &#8764;4% in terms of TSS (reported &#8764;0.47) and &#8764;3% in terms of HSS (reported &#8764;0.35). In addition, on evaluating our results for correctly predicted (TP) and missed flare (FN) counts for class-specific flares (X-class and M-class) in central locations (within &#177;70 &#8226; ) and nearlimb locations (beyond &#177;70 &#8226; ) of the Sun as shown in Table <ref type="table">I</ref>, we observe that our models made correct predictions for &#8764;95% of the X-class flares and &#8764;73% of the M flares in central locations. Similarly, our models show a compelling performance for flares appearing on near-limb locations of the Sun, where &#8764;74% of the X-class and &#8764;50% of the Mclass flares are predicted correctly <ref type="foot">1</ref> . This is important because, to our knowledge, the prediction of near-limb flares is often overlooked. More false positives in M-class are expected because of the model's inability to distinguish bordering class (C4+ to C9.9) flares from &#8805;M1.0-class flares, which we have observed empirically in our prior work as well. Overall, we observed that &#8764;90% and &#8764;66% of the X-class and M-class flares, respectively, are predicted correctly by our models.</p><p>TABLE I COUNTS OF CORRECTLY (TP) AND INCORRECTLY (FN) CLASSIFIED X-AND M-CLASS FLARES IN CENTRAL (|longitude|&#8804; &#177;70 &#8226; ) AND NEAR-LIMB LOCATIONS. THE RECALL ACROSS DIFFERENT LOCATION GROUPS IS ALSO PRESENTED. COUNTS ARE AGGREGATED ACROSS FOLDS. Within &#177;70 &#8226; Beyond &#177;70 &#8226; Flare-Class TP FN Recall TP FN Recall X-Class 637 31 0.95 157 55 0.74 M-Class 4229 1601 0.73 1143 1147 0.50 Total (X&amp;M) 4866 1632 0.75 1300 1202 0.52</p><p>We evaluated the effectiveness of our models both quantitatively and qualitatively by spatially analyzing their performance with respect to the locations of M-and X-class flares responsible for the labels. To conduct our analysis, we spatially binned the responsible flares based on their location in the Heliographic Stonyhurst (HGS) coordinate system, where each bin represents a 5 &#8226; by 5 &#8226; spatial cell in terms of latitude and longitude. Then, we analyzed the predictions of our models in the validation set from the 4-fold cross-validation experiments to determine whether the instances were correctly or incorrectly predicted. We calculated the recall separately for M-class, X-class, and both M-and X-class flares in each spatial cell to assess the models' sensitivity at a fine-grained level. The heatmaps that illustrate the spatial distribution of recall scores for our models can be found in Fig. <ref type="figure">5</ref>. This allowed us to pinpoint the locations where our models were more effective in making accurate predictions and vice versa.</p><p>Our research findings indicate that our models are capable of effectively predicting even near-limb flares, particularly for Xclass flares in both central and near-limb locations. However, we observed a higher number of false negatives in the nearlimb areas for M-class flares. This represents a new capability in space weather forecasting, as we can now predict flares in regions where the magnetic field is distorted and pinpoint the locations of relevant active regions that are more likely to flare, which is critical for operational forecasting methods.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Evaluating Post hoc Explanations</head><p>In this section, we present a comprehensive analysis of the explanations generated using the Guided Grad-CAM attribution method for X-class flares. We focus on X-class flares because they are the most significant contributors to Earth-impacting extreme space weather events, such as the Halloween and Bastille Day Superstorms <ref type="bibr">[48]</ref>. Our analysis encompasses both qualitative and quantitative evaluations of the generated explanations, providing a more detailed understanding of the attribution method's effectiveness in predicting Heliographic Latitiude FL-Class: 'X' FL-Class: '&#8805;M' FL-Class: 'M' Fig. <ref type="figure">5</ref>. A heatmap to assess the performance of our models in terms of recall for individual FL-Class (X-and M-class flares) and when combined (&#8805;M-class flares) binned into 5 &#8226; &#215; 5 &#8226; flare locations used as the label. The flare events including and beyond &#177;70 &#8226; longitude (separated by a vertical red line) are represented as near-limb events. Note: (i) Red cross in white grids represents locations with zero correct predictions while white cells without red cross represent unavailable instances. (ii) These results are aggregated from the validation sets of 4-folds.</p><p>X-class flares. By examining the results closely, we aim to improve our ability to forecast these powerful flares and mitigate their potential impacts.</p><p>For qualitative analytics, we evaluate the visual explanations with their temporal progression and interpret them by showcasing two examples of correctly predicted near-limb flares on both the East and West limbs of the Sun. Firstly, we present the explanation of our model for an East-limb X1.4-class (note that East and West are reversed in solar coordinates) flare observed on 2011-09-22 at 10:29:00 UTC with visualizations generated using Guided Grad-CAM, denoted as GGCAM-MAP in Fig. <ref type="figure">6 (a)</ref>. For this, we used three input images, each separated by an hour starting at 2011-09-22 02:00:00 UTC (denoted as T), until the sunspot for the corresponding flare starts to become more visible in the magnetogram image. With temporal progression, we observed that as soon as a region becomes visible, the pixels covering the AR on the East limb are activated as shown in Fig. <ref type="figure">6</ref>  TABLE II TOTAL COUNTS OF GUIDED GRAD-CAM (TRUE WHEN ACTIVATED AND FALSE OTHERWISE) THAT CORRESPONDS TO THE FLARE LOCATION (FLOC: LOCATION OF MAXIMUM PEAK X-RAY FLUX USED TO LABEL EACH MAGNETOGRAM INSTANCES) FOR CORRECTLY (TP) AND INCORRECTLY (FN) CLASSIFIED X-CLASS FLARES IN CENTRAL (|longitude|&#8804; &#177;70 &#8226; ) AND NEAR-LIMB LOCATIONS. Within &#177;70 &#8226; Beyond &#177;70 &#8226; Full-disk (Total) Prediction True False True False True False TP 635 2 149 8 784 10 FN 31 0 55 0 86 0</p><p>on specific ARs including the relatively smaller area AR (in terms of pixels) on the East limb, even though other ARs are present in the magnetogram image. The visualization of attribution maps suggests that for this particular prediction, although only partially visible due to rotation and projection effects, the region responsible for the flare event is attributed to be important and hence contributes to the consequent decision. Similarly, we analyze another case of correctly predicted near-limb flare (West-limb) of the Sun. For this, we provide a case of X2.3-class flare observed on 2013-10-29 at 21:42:00 UTC. For this, we again used three input images, each separated by three hours starting on 2013-10-29 at 00:00:00 UTC (denoted as T) shown in Fig. <ref type="figure">6 (b</ref>). We observe that for the duration of six hours (until 16 hours prior to the flare event with three input images), the model's activation for AR on the West-limb remains intact and it remains so as long as the AR corresponding to the flare is visible on the fulldisk, indicating it is an important region for corresponding correct prediction. While there are several larger ARs present in the magnetogram, it focuses on specific ARs including the relatively smaller AR on the West limb. This shows that our models were able to learn shape-based features from compressed images and use them effectively for predicting flares, even in the presence of severe projection effects.</p><p>In addition, we conducted a rigorous quantitative evaluation of explanations for X-class flares, which comprised 880 instances in our dataset. We adopted a human-centered approach, as mentioned in <ref type="bibr">[20]</ref>, and designed a set of questionnaires addressing each instance to validate the explanations. The questionnaires were structured as follows: 1) Determine the activation of the location of the responsible X-class flare, denoted as FL, with maximum peak X-ray flux used to label the image. Assess the activation using a binary response format, with True (T) indicating activation and False (F) indicating non-activation. The location of FL is denoted as FLOC={T, F}. 2) Determine the activation of any other X-class flare locations besides the maximum flare location (FLOC) used to label the instance (i.e., FL) that coexisted within the 24hour prediction window. Use a ternary response format, with 'T' indicating activation, 'F' indicating non-activation, and Not Applicable (N/A) indicating the absence of other X-class flares in the prediction window. This is denoted as XLOC={T, F, N/A}.</p><p>3) Determine the activation of any M-class flare locations that coexisted with FL within the 24-hour prediction window. Use a ternary response format, with 'T' indicating activation, 'F' indicating non-activation, and 'N/A' indicating the absence of M-class flares in the prediction window. This is denoted as MLOC={T, F, N/A}. 4) Determine the activation of any C-class flare locations that coexisted with FL within the 24-hour prediction window. Use a ternary response format, with 'T' indicating activation, 'F' indicating non-activation, and 'N/A' indicating the absence of C-class flares in the prediction window. This is denoted as CLOC={T, F, N/A}. After examining the outcomes of question (1), which evaluated the activation of location for flare with maximum peak Xray flux (FLOC) for X-class flares in our dataset, we found that FLOC was activated in 870 out of 880 instances, as presented in Table <ref type="table">II</ref>. We subsequently conducted a separate evaluation of the outcomes for instances predicted correctly (TP) and incorrectly (FN) in both central and near-limb locations <ref type="foot">2</ref> . Upon analyzing the results, we discovered that in every false negative (FN) instance, the model was able to locate the location of the flare but could not classify it accurately. Additionally, we observed that there were 10 instances (&#8764;1.1% of total X-class flares), of which 8 were located in near-limb regions, while the remaining 2 were located in central locations, that were predicted correctly. However, the FLOC was not activated because other active regions were also activated, and those regions produced one or more M-and C-class flares. The location of the responsible flares was partially or completely invisible while in the near-limb region. Nevertheless, the model was able to predict these instances correctly.</p><p>In addition to question (1), we also incorporated the results of questions (2), (3), and (4) to examine the impact of other flares on the corresponding predictions, as presented in Table <ref type="table">III</ref>. Notably, in instances where the FLOC is activated, we observed that only 23 instances had all other flare locations (i.e., XLOC, MLOC, and CLOC, if not N/A) activated. Furthermore, we found that all of the CLOC (if not N/A) were activated, even when the MLOC and FLOC were not activated. Overall, the majority of instances (&#8764;53%) showed activations for both MLOC and CLOC (if they coexist) along with FLOC. Our findings here point to a well-known phenomenon that flares productive active regions emit flares and eruptions in a clustered fashion <ref type="bibr">[49]</ref>, <ref type="bibr">[50]</ref>. Moreover, we observed that, for almost 39% of the instances, where M-class locations were absent, only CLOC along with FLOC were activated. This may be due to the higher rates of occurrence of C-class flares, which constitute approximately 40% (25,150 instances) of the entire dataset and the model struggles to distinguish them from the FL-class as observed in our prior work <ref type="bibr">[16]</ref>. Despite this, we observed the model's adept ability to accurately identify</p><p>TABLE III TOTAL COUNTS OF GUIDED GRAD-CAM THAT CORRESPONDS TO THE RESPONSIBLE FLARE LOCATION (FLOC), OTHER X-FLARES LOCATION (BESIDE MAXIMUM INTENSITY FLARE EVENT, I.E., FL-CLASS) DENOTED AS XLOC, OTHER M-FLARES LOCATION DENOTED AS MLOC, AND OTHER C-FLARES LOCATION DENOTED AS CLOC, WHICH COEXISTS WITHIN THE PREDICTION WINDOW OF 24 HOURS. THE COUNT IS PRESENTED FOR CORRECTLY (TP) AND INCORRECTLY (FN) CLASSIFIED X-CLASS FLARES (FL) IN CENTRAL (|longitude|&#8804; &#177;70 &#8226; ) AND NEAR-LIMB LOCATIONS. relevant locations for the corresponding prediction, even for near-limb events, which emphasizes the utility of the full-disk model as a valuable contribution to operationalization efforts. Furthermore, it's important to note that the explanations show our model's ability to selectively highlight specific ARs that are more likely to initiate flares. This aspect is crucial for localizing flare-productive ARs, which is of utmost importance when performing long-term SEP event prediction <ref type="bibr">[51]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. CONCLUSION AND FUTURE WORK</head><p>In this work, we used a gradient-based attribution method, namely, Guided Grad-CAM to interpret the predictions of our binary ( &#8805;M1.0-class) full-disk flare prediction model. We addressed the highly overlooked problem of flares appearing in near-limb locations of the Sun, and our evaluation shows a compelling performance of a full-disk model for such events. Furthermore, we evaluated our model's predictions with visual explanations and showed that the model's decisions are primarily based on characteristics corresponding to the relevant active regions in the magnetogram instances. As an extension, we plan to develop an automated method of evaluating explanations and incorporate the M-class flares as well to make this study more comprehensive. Furthermore, at this point, our models consider only the point-in-time spatial raster features in our data, and we intend to widen this work toward building models that can capture the temporal evolution of these features to improve predictive performance.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>It is important to note that there are certain flares that may not be predicted at all with current observational capabilities, particularly when the active region responsible for the flare is not visible or only partially visible on the East limb up to</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="24" xml:id="foot_1"><p>hours prior to the occurrence of the flare.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_2"><p>Note that the central and near-limb locations referred to are only for the corresponding FL location (FLOC), and the evaluations are presented irrespective of the locations of other coexisting X, M, and C-class flares. Furthermore, the activations maps for incorrectly predicted instances (FN) are also generated and evaluated for positive class labels.</p></note>
		</body>
		</text>
</TEI>
