Decades of insitu solarwind measurements have clearly established the variation of solarwind physical parameters. These variable parameters have been used to classify the solarwind magnetized plasma into different types leading to several classification schemes being developed. These classification schemes while useful for understanding the solar winds originating processes at the Sun and early detection of space weather events have left open questions regarding which physical parameters are most useful for classification and how recent advances in our understanding of solarwind transients impact classification. In this work we use neural networks trained with different solarwind magnetic and plasma characteristics to automatically classify the solar wind in coronal hole streamer belt sector reversal and solar transients such as coronal mass ejections comprised of both magnetic obstacles and sheaths. Furthermore our work demonstrates how probabilistic neural networks can enhance the classification by including a measure of prediction uncertainty. Our work also provides a ranking of the parameters that lead to an improved classification scheme with inlineformula idIEq1mmlmathmmlmommlmommlmn96mmlmnmmlmi mathvariantnormalmmlmimmlmathinlineformula accuracy. Our new scheme paves the way for incorporating uncertainty estimates into spaceweather forecasting with the potential to be implemented on realtime solarwind data.
['Astrophysics - Solar and Stellar Astrophysics', 'Physics - Space Physics']
Classifying Different Types of SolarWind Plasma with Uncertainty Estimations Using Machine Learning
{'No Header': "Classifying different types of solar wind plasma with uncertainty estimations using machine learning  \nTom Narock 1 · Sanchita Pal 2 · Aryana Arsham 1 · Ayris Narock 3,4 · Teresa Nieves-Chinchilla 4  \n© The author(s) ····  \nAbstract Decades of in-situ solar wind measurements have clearly established the variation of solar wind physical parameters. These variable parameters have been used to classify the solar wind magnetized plasma into different types leading to several classification schemes being developed. These classification schemes, while useful for understanding the solar wind's originating processes at the Sun and early detection of space weather events, have left open questions regarding which physical parameters are most useful for classification and how recent advances in our understanding of solar wind transients impact classification. In this work, we use neural networks trained with different solar wind magnetic and plasma characteristics to automatically classify the solar wind in coronal hole, streamer belt, sector reversal and solar transients such as coronal mass ejections comprised of both magnetic obstacles and sheaths. Furthermore, our work demonstrates how probabilistic neural networks can enhance the classification by including a measure of prediction uncertainty. Our work also provides a ranking of the parameters that lead to an improved classification scheme with ∼ 96% accuracy. Our new scheme paves the way for incorporating uncertainty estimates into space weather forecasting with the potential to be implemented on real-time solar wind data.", 'Keywords:': 'B T.W. Narock  \nthomas.narock@goucher.edu  \n- 1 Department of Computer and Data Science, Goucher College, Baltimore, MD, 21204, USA\n- 2 NASA Postdoctoral Program Fellow, NASA Goddard Space Flight Center, Greenbelt, MD 20771, USA\n- 3 ADNET Systems Inc, Bethesda, MD, 20817, USA\n- 4 Heliophysics Science Division, NASA Goddard Space Flight Center, Greenbelt, MD 20771, USA', '1. Introduction': "The solar wind is a continuous outflow of magnetized plasma emanating from the Sun's outer atmosphere. Different types of solar wind plasma may emanate from the solar surface or develop in the interplanetary medium (e.g. Cranmer, Gibson, and Riley, 2017; Crooker, McPherron, and Owens, 2014; Luhmann, Petrie, and Riley, 2013; Kilpua, Koskinen, and Pulkkinen, 2017). The varying characteristics of this plasma have been used to categorise the solar wind into different types. The most obvious of the solar wind types are the fast and slow solar wind, but more subtle distinctions such as shocked plasma and structures involving various transient events have also been observed using in situ spacecraft observations. Borovsky, Denton, and Smith (2019) provide a detailed study examining the varying properties of the solar wind magnetized plasma.  \nIt is generally accepted that solar wind plasma can be categorised in three major types - (1) coronal-hole-origin plasma (CH) sometimes referred to as fast solar wind mostly originating from the interaction of open field lines and low-lying closed coronal loops, (2) streamer-belt-origin plasma (SB) sometimes referred to as slow solar wind originating from edges of coronal holes near streamer belt regions, the interchange reconnection between field lines from closed streamer belt and open magnetic field regions, and sometimes from the tip of the helmet streamers, and (3) plasma originating from solar transients like coronal mass ejections (CMEs). Xu and Borovsky (2015) show evidence for a fourth type named sector-reversal-region (SR) plasma, which is a sub-type of streamer belt plasma. Roberts et al. (2020) used a purely statistics based machine learning approach to determine the number of plasma states in the solar wind. While Roberts et al. (2020) agrees there is evidence for three or four major types, their study showed additional evidence that meaningful distinctions in solar wind plasma can be made up to at least eight types. There is even evidence for subdividing types and defining ten types with clearly identifiable refined categories of transients, such as very fast interplanetary CMEs (ICMEs) Roberts et al. (2020).  \nWhich parameters to use in solar wind classification is another debated topic in the literature. For example, an onboard solar wind classification algorithm was part of the Genesis spacecraft (Neugebauer et al., 2003; Reisenfeld et al., 2003). The automated algorithm required proton temperature, alpha-particle abundance, and the presence of bidirectional streaming suprathermal electrons to classify the solar wind into one of three types. Xu and Borovsky (2015) on the other hand, used proton-specific entropy ( Entropy ), the proton alfv'en speed ( V a ), and the proton temperature ( T p ) compared with a velocity-dependent expected temperature ( T expected ) to classify solar wind plasma into one of four states - CH, SB, SR and ICME. Other classification schemes utilize the ratio of number densities of heavy ion charge states (e.g. Zhao, Zurbuchen, and Fisk, 2009); yet, most solar wind spacecraft do not carry solar wind ion composition measurement instruments and therefore heavy ion ratios are generally not available in solar wind data sets (Xu and Borovsky, 2015). Alternative plasma state classification schemes have been proposed using only commonly available solar wind magnetic field and plasma parameters. Li et al. (2020), for example, have  \nproposed a machine learning based classification system using eight parameters - seven plasma characterising parameters and the magnetic field magnitude.  \nXu and Borovsky (2015) and many related studies (e.g. Camporeale, Car'e, and Borovsky, 2017; Roberts et al., 2020) mainly focus on magnetic clouds (MCs; Lepping, Wu, and Berdichevsky, 2005) to define the ICME-type of solar wind plasma, which they refer to simply as 'ejecta'. MCs are a subset of ICMEs containing an enhanced large-rotating magnetic field vector B suggestive of a flux rope field configuration, low T p and low plasma β (i.e. the ratio of gas pressure to the magnetic pressure). The definition of MCs is based on earlier work by Klein and Burlaga (1982). In recent years, Nieves-Chinchilla et al. (2018) have found the magnetic cloud definition to be too restrictive. They introduced the term 'magnetic obstacle' (MO) to signify more general magnetic configurations within solar wind transients. MOs generally follow the properties of ICMEs described by Jian et al. (2006) and are limited to cases that have low plasma beta.  \nWe first consider the simpler approach of Xu and Borovsky (2015) that classifies solar wind plasma in four types - CH, SB, SR and ejecta using three parameters Entropy , V a , and T ratio = ( T p /T exp ) - which we refer to as the 3-parameter scheme. These three quantities are easily computed from commonly available solar wind parameters including magnetic field magnitude, proton density, temperature, and speed. We are interested in assessing the utility of the 3-parameter scheme when the 'ejecta' category as considered by Xu and Borovsky (2015) is generalised to MOs. We use this as a starting point, noting that the number of solar wind plasma states - and the quantities needed to determine them - is still being debated. We use machine learning models trained with the 3-parameter scheme to classify the solar wind plasma as CH, SB, SR or MO. In this way, we assess whether MOs have plasma states similar to the idealized definition of what Xu and Borovsky (2015) call ejecta. Later, we expand our study to classify another solar wind plasma type that is the compressed regions called sheaths (SHs) that generally precede the MOs or MCs and mostly form during an ICMEs' interplanetary propagation (Kilpua, Koskinen, and Pulkkinen, 2017). To the best of our knowledge, no current plasma type classification scheme looks at the complex sheath region. The SHs are distinctly different from the ejecta definition of Xu and Borovsky (2015). They have larger B variations, much higher T p and plasma density. They are more turbulent than ejectas (Kilpua, Koskinen, and Pulkkinen, 2017). We attempt to classify the SH as a distinct plasma type. The properties of the SH can depend on the type of solar wind plasma preceding it, i.e. the presence of a shock, fast solar wind, or prior ejecta. Thus, a single SH category is likely not a sufficient long term strategy. However, given the lack of research on SH classification we focus here on the SH as a single category. We save for future research the machine learning workflow augmentations needed to identify sub-types of SH.  \nAdditionally, we explore the effectiveness of using more than three parameters to train our machine learning models and we introduce a measure of prediction uncertainty based on advances in probabilistic machine learning. We are interested in how knowledge of different plasma types can contribute to space weather assessments. For example, dos Santos et al. (2020), Narock et al. (2022), and  \nPal et al. (2024) used deep neural networks to identify MOs in the solar wind relying solely on magnetic field data and the presence of magnetic flux ropes. Yet, Nieves-Chinchilla et al. (2018) show that not all MOs exhibit a rotation in their magnetic fields indicative of flux ropes. Thus, involving plasma information in MO identification can potentially improve previously established solar wind auto-identification models that focus only on magnetic parameters and rotations of the magnetic field. The machine learning classification studies by Nguyen et al. (2019) and Rudisser et al. (2022) utilize both magnetic field and plasma parameters. However, those studies are window-based requiring a multidimensional time series as input. Our study, by contrast takes a multidimensional time point as input to a probabilistic neural network model. Classifying the solar wind point by point instead of over time intervals can provide additional benefits in forecasting and reduced training time.  \nOur manuscript is organised as follows. In Section 2 we discuss the data and their preprocessing to derive the solar wind parameters that we further use in this study. Section 3 discusses the machine learning model and the process of uncertainty estimation. Section 4 presents the results obtained from our model and discusses the evaluation of the results, and Section 5 summarises the study and presents our conclusions. An Appendix summarizing the acronyms used throughout is available at the end of the manuscript following Section 5.", '2. Dataset': "We used one minute resolution solar wind magnetic field and plasma data observed in situ by the Magnetic Field Instrument (MFI; Lepping et al., 1995) and the Solar Wind Experiment (SWE; Ogilvie et al., 1995) onboard the Wind spacecraft. We used these data obtained at 1 au to compute different magnetic and plasma properties that are then used as inputs to our models. The parameters are Entropy , V a , T ratio which are considered in the 3-parameter scheme of Xu and Borovsky (2015), solar wind turbulence properties - cross helicity σ c , residual energy σ r - that can serve as proxies for solar wind heavy ion composition (Roberts et al., 2020), the ratio of gas pressure to the magnetic pressure - plasma β also included in the study by Li et al. (2020), fluctuations of the magnetic field strength B rms that is an important distinguishing characteristic when studying SHs (Salman et al., 2021) and the total pressure ( P tot ) found useful in effectively distinguishing ICMEs from other solar wind structures (Jian et al., 2006). The definition of each parameters are given below:  \nV a = B √ µ 0 m p N p (1)  \nT ratio = T expected T p (2)  \nEntropy = T p N 2 / 3 p (3)  \nσ c = E + -E -E + + E -, (4)  \nwhere E ± represents the trace spectral densities of Elsasser variables z ± = V sw ± V a . The fluctuation in z + and z -represents Alfv'en wave propagating parallel and anti-parallel to the background magnetic field.  \nσ r = E v -E b E v + E b , (5)  \nwhere the trace spectral density of V sw and V a is represented by E v and E b , respectively.  \nB rms = √ √ √ √ n ∑ i =1 ( B i -< B > ) 2 n , (6)  \nwhere < B > represents the temporal average of the magnetic field strength B for 10 minute intervals. Equation 6 is Equation 4 from Salman et al. (2021).  \nβ = N p kT p B 2 / 2 µ 0 , (7)  \nwhere k is the Boltzman constant and  \nP tot = B 2 2 µ 0 + N p kT p . (8)  \nWhere B is the magnetic field magnitude, m p is the proton mass, N p is the proton density, T p is the proton temperature, T expected is the expected temperature defined as a function of solar wind speed ( V sw ) as V sw 258 3 . 113 (Xu and Borovsky, 2015), and N p is the solar wind density. V a is the Alfv'en speed in units of km/s and entropy is in units of eV.cm 2 .  \nThe MOs and SHs are collected from ICME Catalog. This catalog includes lists of manually identified ICME and MO start and end times. Our considered SHs are the region between the start of the ICME and the start of the MOs. In this catalog, the MOs are divided into five types: Flux-rope (Fr), Small rotation flux-rope (F-), Large rotation flux-rope (F+), Complex (Cx), and Ejecta (E) (note that here E has a different definition from ejecta defined in Xu and Borovsky (2015)) (Nieves-Chinchilla et al., 2018). Events without evident rotation (E) and those with more than one magnetic field rotation (Cx) were withheld from our machine learning training dataset. The rationale is to train on Fr, F+, and F- plasma characteristics and then evaluate if Cx and E events have similar characteristics. We imposed a 90% data availability criterion to avoid events with large data gaps. In the end, 308 events of Fr, F-, and F+ type from the ICME Catalog were used as our candidate MOs.  \nWe then randomly sampled from solar minimum (years 2020 through 2022) and solar maximum (years 2012 through 2014) of OMNI one-minute data (King and Papitashvili, 2020) collected at 1 au to obtain a comparable dataset of nontransient solar wind plasma types. Each data point of our OMNI sample was  \nclassified as CH, SB, or SR following the categorisation algorithm explained in Section 2.2 of Xu and Borovsky (2015). Any OMNI points classified as 'ejecta' were discarded. Next, we averaged Wind and OMNI data to 10 minutes to remove small-scale fluctuations. This resulted in a dataset of 12,239 CH, 12,255 SR, 12,248 SB, 12,239 MO, and 12,238 SH points. We note that our approach classifies the plasma state of each point in a time series. In other words, the inputs are the plasma characteristics of a single time point and the output is a classification of solar wind plasma types. We classify the plasma state at each time step and do not evaluate the time series as a whole. As such, we do not look for temporal changes such as rotations of the magnetic field. Instead, the aim of this work is to detect the plasma type at any given time point.  \nWe normalized our data using minimum and maximum values from the entire dataset (maximum of solar cycle 24 and the most recent minimum) as required by neural networks. Data are then randomly split with the standard 80% for training the neural networks and the remaining 20% used for evaluating the trained networks.", '3. Uncertainty Estimation': "This study utilises neural networks (NNs) consisting of an input layer, two hidden layers with 16 and 8 nodes, respectively, and a categorical distribution output layer, which is a discrete probability distribution of a random variable that can take one of K possible categories. Our output categorical distribution is implemented using the Tensorflow Probability software library (Dillon et al., 2017). The other layers in the NNs are standard Dense layers from the Keras library (Chollet and others, 2018).  \nPlacing a probability distribution over the NN output layer is method of capturing aleatoric uncertainty, which is uncertainty inherent in the observations. Aleatoric uncertainty is one of two main types of uncertainty that one can capture (Kendall and Gal, 2017). The other being epistemic uncertainty, which accounts for uncertainty in the model parameters. In a machine learning context, epistemic uncertainty captures our ignorance surrounding the optimal NN weights. Epistemic uncertainty can be reduced given enough data, as more training data leads to better refinement of model parameters. Aleatoric uncertainty, on the other hand, is irreducible.  \nMost traditional deep learning classification models use a softmax output layer. The softmax function transforms the output of the network into a normalized vector, which are often interpreted as probabilities. For example, given a binary classification problem, the softmax output of [0.8, 0.2] is interpreted as a 80% prediction for the first category. However, softmax outputs are not true probability distributions and can report high confidence for incorrect predictions when treated as such (Sensoy, Kaplan, and Kandemir, 2018).  \nWe quantify the aleatoric uncertainty using Shannon entropy, which is common for classification problems (Hullermeier and Waegeman, 2019). If p i denotes the probability that an observed event belongs to the plasma type i , i =1...K, the Shannon entropy is defined as H = -∑ i p i ln ( p i ). Entropy in information  \ntheory is analogous to entropy in statistical thermodynamics. Larger values of entropy, H , occur when probabilities are close to being equal. For example, when each state has equal probability of occurring then, p i = 1 K , for i = 1 ...K . This results in the maximum possible Shannon entropy H = -ln 1 k . In contrast, if the NN assigns a high probability to a particular class, close to one, the entropy will become close to 0. Therefore, H ranges from (0 , -ln 1 k ]. Larger values of H correspond to the NN being more uncertain about a particular prediction. In contrast, lower H occurs when an event has a higher probability of belonging to a particular type of solar wind plasma. We will refer H as 'uncertainty' from this point on.  \nTechniques for quantifying both aleatoric and epistemic uncertainty do exist (Kendall and Gal, 2017). However, there is still much debate surrounding approaches to quantify epistemic uncertainty in neural networks. We leave epistemic uncertainty for future research in which we will investigate how each of the various approaches impacts epistemic uncertainty quantification.  \nIn this work, a user-specified threshold for uncertainty is the maximum allowable H for a prediction. Our model outputs the probability of a solar wind time step belonging to each plasma type and the associated H . If the event has an uncertainty, H value, lower than the user-specified threshold the event is classified to the plasma type with the highest probability. In contrast, if the event has an uncertainty greater than or equal to the threshold, it is unclassified, as the uncertainty pertaining to that prediction exceeds the maximum threshold. Using a lower threshold for uncertainty results in fewer predictions, i.e. higher number of events will not be classified. However, the predicted events will have higher certainty. A higher threshold value results in more events being predicted, but the predicted events may have lower accuracy. Therefore, a riskaverse application can select a lower threshold value to ensure that predictions have lower uncertainty.  \nPrevious work by Camporeale, Car'e, and Borovsky (2017) introduced the notion of uncertainty in machine learning and its application to solar wind plasma type classification. That work leveraged a Gaussian Process method and provided a means of classifying an event as 'undecided'. We highlight the work of Camporeale, Car'e, and Borovsky (2017) as being one of the first to quantify uncertainty in space physics context, but note the differences in approach and means of uncertainty quantification. In this work, we explore an alternative means of quantifying and utilizing prediction uncertainty.", '4. Results and Discussion': 'In this Section, we provide the results obtained from our model trained with different sets of parameters to detect different types of solar wind plasma.', '4.1. Plasma state auto-identifications using 3-parameter scheme': "In our first experiment, we tested the 3-parameter scheme's ( V a , T ratio , Entropy ) ability to identify MOs using a probabilistic NN hereafter called 3PNN. This  \nFigure 2(a) shows the 3PNN model output applied to an event from the ICME Catalog during October, 2001. The top panel of the figure shows the plasma state prediction with blue indicating magnetic obstacle and red indicating one of the  \n<!-- image -->  \nFigure 1. Confusion matrix derived while evaluating (a) 3PNN model and (b) 8PNN model to classify magnetic obstacle (MO), coronal-hole-origin plasma (CH), streamer-belt plasma (SB), sector-reversal-region plasma (SR).  \n<!-- image -->  \nTable 1. Macro results showing the performance of 3PNN and 8PNN models in identifying CH, SR, SB and MO.  \nexperiment categorises solar wind plasma into four ( K = 4) different types: CH, SR, SB and MO. The output of our model is a probability distribution indicating the likelihood of each plasma type. The probability values were used to compute H as a measure of uncertainty. Figure 1 and Table 1 show the model evaluation results. All predictions were used in generating Figure 1 and Table 1, i.e. no uncertainty filtering was applied. Figure 1(a) indicates high model accuracy for CH and SR, but lower accuracy for MO and SB. Additional summary statistics are given in Table 1, which are based on the number of True Positive (TP), False Negative (FN), and False Positive (FP) predictions. These values are then combined to find: Recall = TP TP + FN , Precision = TP TP + FP , and F 1 score , which is the harmonic mean of Precision and recall : F 1 = 2 TP 2 TP + FP + FN . We mention these metrics in the first column of Table 1. We provide average precision, recall , and F 1 values across all categories when summarizing our results in tables. This is the so-called macro average, which is computed by taking the arithmetic mean (unweighted) across the categories. This approach treats each category with equal significance.  \nFigure 2. (a) Example of plasma state classification during 2021/10/31 13:00 - 2021/11/02 05:00 using 3PNN model. The top panel shows the classification with blue indicating MO and red indicating one of the other states. Prediction uncertainty, Entropy , T ratio , V a , β , P tot and B rms are shown from the top to bottom, respectively. (b) Feature importance analysis for the 8PNN model input.  \n<!-- image -->  \nother states. Vertical black lines indicate the start of an SH, an MO, and the end of an MO as determined by human experts in the catalog. At this stage, the SH is not considered as a separate plasma state. Therefore, we see our model output alternates between MO and other types during the SH. Results also indicate that our model's prediction uncertainty is highest during this SH period (Figure 2(a) 2nd panel). Uncertainty thresholding will be explored in later Sections. We note that this event is preceded by a shock, which is likely leading to the inaccurate prediction of plasma just before the SH. Shocks are known to impact the generally observed relationships among the three parameters of V a , T ratio , and Entropy in the 3PNN model (Xu and Borovsky, 2015).", '4.2. Plasma state auto-identifications using 8-parameter scheme': "The 3-parameter classification scheme of Xu and Borovsky (2015) is a good place to start given its utilization of readily available parameters and the ease of their calculation. However, as noted in Section 1, other studies have proposed additional parameters for classifying solar wind plasma type. We next expanded the number of inputs to the probabilistic NN model to include five additional parameters: σ c , σ r , B rms , plasma β , and P tot . This resulted in an 8-parameter classification scheme. Figure 1(b) shows the confusion matrix resulting from this 8-parameter neural network hereafter called 8PNN. Overall summary statistics for this model are given in the third column of Table 1.  \nImmediately evident when comparing the performance of 3PNN and 8PNN models provided in Figure 1 and Table 1 is the increase in prediction accuracy from additional inputs. Yet, neural networks are black-boxes in which it is difficult to assess how the inputs are leading to the outputs and which  \ninputs are most important. A commonly used techniques for quantifying input feature importance is Integrated Gradients (IG). The IG technique is a gradientbased explanation method that tries to explain a given prediction by using the gradient of the output with respect to the input features. Features with larger gradient magnitudes have a greater impact on the output and are considered more important. The IG results for the inputs of the 8PNN model are shown in Figure 2(b). From Figure 2(b) it is evident that despite σ c and σ r being proxies for the O 7+ /O 6+ ratio (Roberts et al., 2020), our model finds them of limited importance in our plasma type classifications. We find that the addition of P tot and plasma β are important in classification of solar wind plasma type.  \nThe confusion matrix provides the proportion of correct and incorrect answers. However, it does not tell us where within a MO interval predictions are incorrect. To explore this, we divided each MO into thirds and calculated the number of incorrect predictions in each third. We found that 2% of the first third, 1% of the middle third, and 5% of the final third predictions were incorrect. We hypothesize that the final third of the event has higher model inaccuracy as this is the trailing edge of the magnetic obstacle and there is not a clean transition from magnetic obstacle to other solar wind plasma types. This notion is supported by research on the presence of open field lines at MO trailing edges. A reconnection at MO front boundaries with the surrounding field lines may leave piled-up reconnected open field lines at the MO trailing edges (Ruffenach et al., 2015; Pal, Dash, and Nandy, 2020; Pal et al., 2022; Pal, 2022). This may peel off an MO's twisted outer layers (Pal et al., 2021), significantly impact the conservation of magnetic flux and helicity inside ICME flux ropes (Gopalswamy et al., 2018; Pal et al., 2017) and thus erode them.", '4.3. Identifying sheath as a separate plasma state': "The 3PNN and 8PNN models discussed above do not consider SHs that sometimes precede MOs as a separate plasma type. Identification of SHs is beneficial for space weather assessment as it can provide advanced notice of MOs and imminent geoeffective structures given that SH regions often preceed MOs and have been shown to sometimes contain structures capable of causing geomagnetic storms (Kilpua, Koskinen, and Pulkkinen, 2017). To accommodate SH identification, we train our 3PNN and 8PNN models with five output categories ( K = 5). The fact that SHs are known to be highly variable is reflected in the confusion matrices shown in Figure 3(a) and (b) for the 3PNN and 8PNN, respectively.  \nFrom Figure 3 and Table 2 it is evident that neither approach adequately distinguishes SHs. While the 8PNN does a better job compared to the 3PNN for SH identification, it still regularly misclassified SHs as MOs and vice versa. Our models' limited success in uniquely identifying SH seems to confirm recent research showing the leading edges and SHs of ICMEs to be chaotic and vary significantly from event to event (Kilpua, Koskinen, and Pulkkinen, 2017; Salman et al., 2020; Temmer and Bothmer, 2022). Interestingly, when more input features are used, our model is better able to distinguish the SH from CH, SR, and SB plasma; yet, this model still confuses SH and MO plasma states.  \nThe primary benefit of using probabilistic NNs is their ability to quantify prediction uncertainty. Our model captures the aleatoric uncertainty, which is  \nFigure 3. Confusion matrix for (a) 3PNN and (b)8PNN models for the classification of magnetic obstacle (MO), coronal-hole-origin plasma (CH), streamer-belt plasma (SB), sector-reversal-region plasma (SR), and sheath (SH).  \n<!-- image -->  \nTable 2. Macro results for 3PNN and 8PNN in classification of plasma in MO, CO, SB, SR, and SH.  \nFigure 4. (a) Prediction accuracy of 8PNN model as a function of user-specified uncertainty threshold. Lowering the threshold leads to a trade-off between making fewer predictions, but with increased accuracy. (b) Uncertainty values for correct and incorrect predictions of the 8PNN model. Incorrect predictions are generally associated with larger uncertainty values. Correct predictions are frequently associated with lower uncertainty values; however, there are a number of predictions that were correct but the algorithm still had a high uncertainty about its choice.  \n<!-- image -->  \nFigure 5. (a) Confusion matrix for the 8PNN model for the classification of ICME, CH, SB, and SR. (b) Confusion matrix of 8PNN classifying ICMEs as MOs and SHs. (c) Feature importance analysis for distinguishing between SHs and MOs.  \n<!-- image -->  \ndue to irreducible noise in the data and results from the stochastic nature of solar wind processes generating the data. We use this prediction uncertainty (discussed in Section 3) to assess if we should trust a prediction. Predictions with an uncertainty above a user-defined threshold are not trusted and reclassified as 'no prediction'. Figure 4(a) illustrates how Accuracy changes as this user-defined threshold is varied in the 8PNN model. Larger uncertainty threshold values in Figure 4(a) indicate the user is willing to accept predictions the model that has little confidence in. The vertical color bar in Figure 4(a) shows the percentage of predictions that are kept at that threshold. For example, with a threshold value of 0.75 the model is confident making predictions on ∼ 70% of the data resulting in an overall prediction accuracy of 85%. Uncertainty estimation helps avoid predicting when the model is unsure. Typically, incorrect predictions are associated with higher uncertainty values. However, as evident in Figure 4(b), this is not always the case. All the test data were passed through the 8PNN model. The resulting classification predictions were evaluated for correctness and their prediction uncertainty was recorded. Figure 4(b) shows the distributions of these correct and incorrect predictions. In some cases, the network is highly uncertain, but correct. In a few cases, the network is highly certain, but produces wrong classifications.  \nWe next combined MO and SH into a single category to account for the NNs inability to distinguish the two. This makes sense physically given that SHs often precede MOs and both can be considered as part of ICME structures. We indicate this category as ICME. We then re-trained our 8PNN model to identify solar wind plasma as CH, SR, SB or ICME. Figure 5(a) shows the confusion matrix of the model and Column 2 of the Table 3 shows the corresponding macro metrics.  \nWe also explored a two model hybrid approach to combat the challenges of classifying SH. In this approach, we cascade two probabilistic NNs with similar architectures except the output layers. The first model is the 8PNN to categorize plasma into CH, SR, SB and ICME and the second is a binary classification probabilistic NN to further categorize ICME values into MO and SH. The whole set up is hereafter called 'cascaded 8PNN'. Data points classified as ICME in the  \nTable 3. Macro results showing the performance of 8PNN in identifying (a) CH, SR, SB and ICME and subsequently distinguishing ICME values into (b) MO and SH.  \n<!-- image -->  \nFigure 6. NN model Accuracy as a function of user-specified uncertainty threshold for the (a) 8PNN model identifying CO, SB, SR and ICME and for the (b) binary classification NN model to classify identified ICME in SH and MO.  \n<!-- image -->  \nfirst model of cascaded 8PNN are passed to the second model, which attempts to disambiguate the ICME into MO, SH, or 'no prediction'. The confusion matrix for the second model of the cascaded 8PNN is shown in Figure 5(b) and the macro summary statistics are given in the Column 3 of the Table 3. The features important in distinguishing MO from SH are shown in Figure 5(c). It is evident from Figure 3 that a single NN cannot reliably distinguish between MO and SH. Creating two cascading models has practical benefits. Figure 5(a) shows that all four categories have high accuracy - false positives and false negatives are unlikely. Misclassifying MO as SH, and vice versa, in the second model is problematic, but we can still be highly confident we are observing an ICME.  \nReturning to uncertainty thresholds, we explored how varying this threshold impacted the number of predictions made and the Accuracy in both models of the cascaded 8PNN. The amount of allowed uncertainty is a subjective measure and our goal is to provide guidance for the user. Allowing more uncertainty leads to more predictions potentially resulting in higher misclassification. Figure 6(a) and (b) show the impact of varying the uncertainty threshold on the Accuracy of the two models classifying CH, SB, SR, ICME and SH, MO, respectively.", '4.4. Application to Complex and Ejecta Events': "Nieves-Chinchilla et al. (2018) define 'ejecta' (E) as solar wind transients without evident magnetic field rotation and those events with more than one magnetic  \nFigure 7. Boxplots comparing Cx/E observations with Fr/F-/F+ observations based on the 8 input features - plasma β , V a , T ratio , Entropy , σ c , σ r , P tot and B rms .  \n<!-- image -->  \nfield rotation as 'complex' (Cx). This is different from Xu and Borovsky (2015); Camporeale, Car'e, and Borovsky (2017) and Roberts et al. (2020) who use the term 'ejecta' to define ICME MCs. We applied our 8PNN model to all NievesChinchilla et al. (2018) defined E and Cx events in the ICME Catalog. We found that only 35% of Cx and E were correctly classified as MOs. 19% of Cx and E observations were incorrectly classified as CH, 14% of them were incorrectly classified as SR, and 32% of them were incorrectly classified as SB.  \nWe then divided the Cx and E events into thirds and investigated where incorrect predictions were being made. We found that 65% of the first third and middle third predictions were incorrect, and 64% of the final third predictions were incorrect. Unlike Fr, F+, and F- events, Cx and E predictions were consistently incorrect across the duration of the MOs. To understand the difficulty of classifying these observations, we examined the characteristics of the Cx and E observations and found them to have more extreme values than Fr, F+, and Fobservations. Comparison boxplots are shown in Figure 7.  \nThe middle fifty percent of Cx/E observations and Fr/F-/F+ observations are similar across all eight parameters. However, the range of values seen and the extent of outliers varies considerably between Cx/E and Fr/F-/F+ observations. Unlike Fr, F+, F- events, which have high prediction accuracy, Cx and E events have more extreme plasma characteristics. Therefore, NNs trained on Fr, F+, and F- events do not transfer well to Cx and E events. This is interesting given that Fr/F-/F+, Cx, and E are all sub-types of MOs. The Cx and E are distinct enough, at least in terms of the 8 parameters studied here, that a single NN does not work on them all.", '5. Summary and Conclusion': "This work combines solar wind characteristics with a probabilistic NN to identify different types of solar wind plasma depending on their origins. Following the study by Xu and Borovsky (2015), the NN was first trained with 3-parameter scheme V a , T ratio , and Entropy - to automatically classify solar wind plasma as CO, SB, SR or MO. We found that MOs are similar enough to MCs that the 3-parameter scheme can reliably detect this more general characterization of transients. The performance of the model increases when an additional five plasma parameters are included. These additional parameters σ c , σ r , B rms , plasma β and P tot - were then used in training subsequent models. The contribution of more plasma parameters - namely plasma β and P tot - increase the accuracy from ∼ 88% (in the case of 3PNN) to ∼ 96% (in the case of 8PNN). Despite σ c and σ r being proxies for the O 7+ /O 6+ ratio, we find them of limited importance in our plasma type classifications. In ICME Catalog, the MOs are categorised in three different types of flux ropes (Fr/F+/F-), ejecta (E) and complex (Cx). Although the catalog includes E and Cx as types of MOs, they have plasma characteristics distinct enough from Fr/F+/F- that both 3PNN and 8PNN trained on Fr/F+/F- perform poorly on E and Cx identifications.  \nPrior research on plasma state classification has not explored SH as a separate plasma state. The SH preceding the start of an MO is known to be highly variable, and sometimes not present at all. Our results demonstrate that the SH frequently has plasma characteristics similar to MOs. A clear distinction between the SH and MO is challenging at present for a machine learning model. In our study, we notice that the SH is most often misclassified as MO. Therefore, when the 8PNN model is used to classify plasma in five different categories (CO, SB, SR, MO and SH), 24% (19%) of SH (MO) cases are misclassified as MOs (SHs) and the model accuracy decreases to 76.94%. This results as both regions tend to have higher P tot , T ratio , and V a while having lower Entropy than the ambient solar wind. Our results show that a two step approach of first distinguishing ICMEs (a combined group of MO and SH) and then classifying ICME into MO and SH is more practically effective. We find that the 8PNN model has accuracy of 96.36% in classifying plasma in CO, SH, SB and ICME (MO+SH) and 77.13% in subsequently distinguishing ICME as SH or MO. Thus, a multi-model machine learning approach to space weather forecasting is likely to be the most beneficial.  \nFurther, our work demonstrates that distinguishing amongst various plasma types is complex, due to variability in the characteristics of these states. This issue highlights the need for uncertainty estimation when classifying solar wind plasma events. To account for this uncertainty, we developed a probabilistic NN that provides both classification of these events and associated uncertainty of the classification. Because it is user-specified, the uncertainty threshold can accommodate different risk aversion levels. For example, a researcher who is risk-averse may select a lower uncertainty threshold. This will result in fewer events being classified. However, the classified events will have higher accuracy. This work focused on determination of aleatoric uncertainty, i.e. irreducible variability due to data. In future work we will examine epistemic uncertainty, i.e., uncertainty due to training a model for solar wind plasma classification.  \nAlthough this work provides a machine learning approach to automatically classifying solar wind plasma originating from different solar sources including coronal holes and streamer belts, we pay close attention to accurately identifying plasma from solar transients, namely ICMEs. ICMEs are one of the major drivers of space weather and research in accurately forecasting and identifying ICMEs has received significant attention. Our approaches contribute to autoidentification of ICMEs through categorising plasma using probabilistic NNs. We further attempted to classify ICMEs as SHs or MOs which are important segments of ICMEs frequently being observed to carry southward interplanetary magnetic field vector driving geomagnetic storms. SHs commonly precede MOs, meaning auto-identification of SHs may allow early forecasting of MOs and their prolonged and intense southward interplanetary magnetic field that drives geomagnetic storms. Our approach has the potential to be implemented on realtime solar wind data and support space weather now-casting and forecasting operations.  \nAcknowledgements We acknowledge NASA's Coordinated Data Analysis System (CDAS) and the open-source catalog of Wind ICMEs. S.P is thankful for the support of NASA Postdoctoral Program fellowship. T.N-C. thanks the Solar Orbiter and Parker Solar Probe missions, Heliophysics Guest Investigator Grant 80NSSC23K0447 and the GSFC-Heliophysics Innovation Funds for support.", 'Appendix': 'Table 4. Summary of acronyms uses', 'Declarations': "Conflict of interest The authors declare that they have no conflicts of interest.  \nCode Availability Code used to train our neural networks, along with the trained model weights, are publicly available in our GitHub repository.  \nData Availability Wind and OMNI data were retrieved from NASA's Coordinated Data Analysis System (CDAS) using their Python-based library cdasws 1.8.2. The machine learning ready versions of the data used to train and test our models are available in the aforementioned GitHub repository.", 'References': "Borovsky, J.E., Denton, M.H., Smith, C.W.: 2019, Some Properties of the Solar Wind Turbulence at 1 AU Statistically Examined in the Different Types of Solar Wind Plasma. Journal  \n- of Geophysical Research (Space Physics) 124 , 2406. DOI. ADS.\n- Camporeale, E., Car'e, A., Borovsky, J.E.: 2017, Classification of Solar Wind With Machine Learning. Journal of Geophysical Research (Space Physics) 122 , 10,910. DOI. ADS.\n- Chollet, F., et al.: 2018, Keras: The Python Deep Learning library , Astrophysics Source Code Library, record ascl:1806.022. ADS.\n- Cranmer, S.R., Gibson, S.E., Riley, P.: 2017, Origins of the Ambient Solar Wind: Implications for Space Weather. Space Sci. Rev. 212 , 1345. DOI. ADS.\n- Crooker, N.U., McPherron, R.L., Owens, M.J.: 2014, Comparison of interplanetary signatures of streamers and pseudostreamers. Journal of Geophysical Research (Space Physics) 119 , 4157. DOI. ADS.\n- Dillon, J.V., Langmore, I., Tran, D., Brevdo, E., Vasudevan, S., Moore, D., Patton, B., Alemi, A., Hoffman, M., Saurous, R.A.: 2017, TensorFlow Distributions. arXiv e-prints , arXiv:1711.10604. DOI. ADS.\n- dos Santos, L.F.G., Narock, A., Nieves-Chinchilla, T., Nu˜nez, M., Kirk, M.: 2020, Identifying Flux Rope Signatures Using a Deep Neural Network. Sol. Phys. 295 , 131. DOI. ADS.\n- Gopalswamy, N., Akiyama, S., Yashiro, S., Xie, H.: 2018, Coronal flux ropes and their interplanetary counterparts. Journal of Atmospheric and Solar-Terrestrial Physics 180 , 35. Variability of the Sun and Its Terrestrial Impacts. DOI. https://www.sciencedirect.com/science/article/pii/S1364682617303607.\n- Hullermeier, E., Waegeman, W.: 2019, Aleatoric and Epistemic Uncertainty in Machine Learning: An Introduction to Concepts and Methods. arXiv e-prints , arXiv:1910.09457. DOI. ADS.\n- Jian, L., Russell, C.T., Luhmann, J.G., Skoug, R.M.: 2006, Properties of Interplanetary Coronal Mass Ejections at One AU During 1995 2004. Sol. Phys. 239 , 393. DOI. ADS.\n- Kendall, A., Gal, Y.: 2017, What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision? arXiv e-prints , arXiv:1703.04977. DOI. ADS.\n- Kilpua, E., Koskinen, H.E.J., Pulkkinen, T.I.: 2017, Coronal mass ejections and their sheath regions in interplanetary space. Living Reviews in Solar Physics 14 , 5. DOI. ADS.\n- King, Papitashvili: 2020, OMNI, Combined Solar Wind Plasma Moments and Interplanetary Magnetic Field (IMF) Time-Shifted to the Nose of the Earth's Bow Shock, plus Geomagnetic Indices, 1 min Data [Data set] , http://doi.org/10.48322/MJ0K-FQ60.\n- Klein, L.W., Burlaga, L.F.: 1982, Interplanetary magnetic clouds at 1 AU. J. Geophys. Res. 87 , 613. DOI. ADS.\n- Lepping, R.P., Wu, C.-C., Berdichevsky, D.B.: 2005, Automatic identification of magnetic clouds and cloud-like regions at 1 AU: occurrence rate and other properties. Annales Geophysicae 23 , 2687. DOI. ADS.\n- Lepping, R.P., Ac˜una, M.H., Burlaga, L.F., Farrell, W.M., Slavin, J.A., Schatten, K.H., Mariani, F., Ness, N.F., Neubauer, F.M., Whang, Y.C., Byrnes, J.B., Kennon, R.S., Panetta, P.V., Scheifele, J., Worley, E.M.: 1995, The Wind Magnetic Field Investigation. Space Sci. Rev. 71 , 207. DOI. ADS.\n- Li, H., Wang, C., Tu, C., Xu, F.: 2020, Machine Learning Approach for Solar Wind Categorization. Earth and Space Science 7 , e00997. DOI. ADS.\n- Luhmann, J.G., Petrie, G., Riley, P.: 2013, Solar origins of solar wind properties during the cycle 23 solar minimum and rising phase of cycle 24. Journal of Advanced Research 4 , 221. DOI. ADS.\n- Narock, T., Narock, A., Dos Santos, L.F.G., Nieves-Chinchilla, T.: 2022, Identification of Flux Rope Orientation via Neural Networks. Frontiers in Astronomy and Space Sciences 9 , 838442. DOI. ADS.\n- Neugebauer, M., Steinberg, J.T., Tokar, R.L., Barraclough, B.L., Dors, E.E., Wiens, R.C., Gingerich, D.E., Luckey, D., Whiteaker, D.B.: 2003, Genesis on-board determination of the solar wind flow regime. Space Sci. Rev. 105 , 661. DOI. ADS.\n- Nguyen, G., Aunai, N., Fontaine, D., Le Pennec, E., Van den Bossche, J., Jeandet, A., Bakkali, B., Vignoli, L., Regaldo-Saint Blancard, B.: 2019, Automatic Detection of Interplanetary Coronal Mass Ejections from In Situ Data: A Deep Learning Approach. Astrophys. J. 874 , 145. DOI. ADS.\n- Nieves-Chinchilla, T., Vourlidas, A., Raymond, J.C., Linton, M.G., Al-haddad, N., Savani, N.P., Szabo, A., Hidalgo, M.A.: 2018, Understanding the Internal Magnetic Field Configurations of ICMEs Using More than 20 Years of Wind Observations. Sol. Phys. 293 , 25. DOI. ADS.\n- Ogilvie, K.W., Chornay, D.J., Fritzenreiter, R.J., Hunsaker, F., Keller, J., Lobell, J., Miller, G., Scudder, J.D., Sittler, J. E. C., Torbert, R.B., Bodet, D., Needell, G., Lazarus, A.J.,  \nSteinberg, J.T., Tappan, J.H., Mavretic, A., Gergin, E.: 1995, SWE, A Comprehensive Plasma Instrument for the Wind Spacecraft. Space Sci. Rev. 71 , 55. DOI. ADS.  \n- Pal, S.: 2022, Uncovering the process that transports magnetic helicity to coronal mass ejection flux ropes. Advances in Space Research 70 , 1601. DOI. ADS.\n- Pal, S., Dash, S., Nandy, D.: 2020, Flux Erosion of Magnetic Clouds by Reconnection With the Sun's Open Flux. Geophys. Res. Lett. 47 , e86372. DOI. ADS.\n- Pal, S., Gopalswamy, N., Nandy, D., Akiyama, S., Yashiro, S., Makela, P., Xie, H.: 2017, A Sun-to-Earth Analysis of Magnetic Helicity of the 2013 March 17-18 Interplanetary Coronal Mass Ejection. Astrophys. J. 851 , 123. DOI. ADS.  \nPal, S., Kilpua, E., Good, S., Pomoell, J., Price, D.J.: 2021, Uncovering erosion effects on magnetic flux rope twist. Astron. Astrophys. 650 , A176. DOI. ADS.  \n- Pal, S., Lynch, B.J., Good, S.W., Palmerio, E., Asvestari, E., Pomoell, J., Stevens, M.L., Kilpua, E.K.J.: 2022, Eruption and Interplanetary Evolution of a Stealthy Streamer-Blowout CME Observed by PSP at ∼ 0.5 AU. Frontiers in Astronomy and Space Sciences 9 , 903676. DOI. ADS.\n- Pal, S., G. dos Santos, L.F., Weiss, A.J., Narock, T., Narock, A., Nieves-Chinchilla, T., Jian, L.K., Good, S.W.: 2024, Automatic Detection of Large-scale Flux Ropes and Their Geoeffectiveness with a Machine-learning Approach. Astrophys. J. 972 , 94. DOI. ADS.\n- Reisenfeld, D.B., Gosling, J.T., Forsyth, R.J., Riley, P., St. Cyr, O.C.: 2003, Properties of highlatitude CME-driven disturbances during Ulysses second northern polar passage. Geophys. Res. Lett. 30 , 8031. DOI. ADS.\n- Roberts, D.A., Karimabadi, H., Sipes, T., Ko, Y.-K., Lepri, S.: 2020, Objectively Determining States of the Solar Wind Using Machine Learning. Astrophys. J. 889 , 153. DOI. ADS.  \nRudisser, H.T., Windisch, A., Amerstorfer, U.V., Mostl, C., Amerstorfer, T., Bailey, R.L., Reiss, M.A.: 2022, Automatic Detection of Interplanetary Coronal Mass Ejections in Solar Wind In Situ Data. Space Weather 20 , e2022SW003149. DOI. ADS.  \nRuffenach, A., Lavraud, B., Farrugia, C.J., D'emoulin, P., Dasso, S., Owens, M.J., Sauvaud, J.-A., Rouillard, A.P., Lynnyk, A., Foullon, C., Savani, N.P., Luhmann, J.G., Galvin, A.B.: 2015, Statistical study of magnetic cloud erosion by magnetic reconnection. Journal of Geophysical Research (Space Physics) 120 , 43. DOI. ADS.  \nSalman, T.M., Lugaz, N., Farrugia, C.J., Winslow, R.M., Jian, L.K., Galvin, A.B.: 2020, Properties of the Sheath Regions of Coronal Mass Ejections with or without Shocks from STEREO in situ Observations near 1 au. Astrophys. J. 904 , 177. DOI. ADS.  \nSalman, T.M., Lugaz, N., Winslow, R.M., Farrugia, C.J., Jian, L.K., Galvin, A.B.: 2021, Categorization of Coronal Mass Ejection-driven Sheath Regions: Characteristics of STEREO Events. Astrophys. J. 921 , 57. DOI. ADS.  \nSensoy, M., Kaplan, L., Kandemir, M.: 2018, Evidential Deep Learning to Quantify Classification Uncertainty. arXiv e-prints , arXiv:1806.01768. DOI. ADS.  \nTemmer, M., Bothmer, V.: 2022, Characteristics and evolution of sheath and leading edge structures of interplanetary coronal mass ejections in the inner heliosphere based on Helios and Parker Solar Probe observations. Astron. Astrophys. 665 , A70. DOI. ADS.  \nXu, F., Borovsky, J.E.: 2015, A new four-plasma categorization scheme for the solar wind. Journal of Geophysical Research (Space Physics) 120 , 70. DOI. ADS.  \n- Zhao, L., Zurbuchen, T.H., Fisk, L.A.: 2009, Global distribution of the solar wind during solar cycle 23: ACE observations. Geophys. Res. Lett. 36 , L14104. DOI. ADS."}