Disruption Prediction Investigations Using Machine Learning Tools On DIII-D and Alcator C-Mod

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Plasma Physics and Controlled Fusion

PAPER

Disruption prediction investigations using Machine Learning tools on


DIII-D and Alcator C-Mod
To cite this article: C Rea et al 2018 Plasma Phys. Control. Fusion 60 084004

View the article online for updates and enhancements.

This content was downloaded from IP address 128.111.121.42 on 19/06/2018 at 02:47


Plasma Physics and Controlled Fusion

Plasma Phys. Control. Fusion 60 (2018) 084004 (13pp) https://doi.org/10.1088/1361-6587/aac7fe

Disruption prediction investigations using


Machine Learning tools on DIII-D and
Alcator C-Mod
C Rea1 , R S Granetz1 , K Montes1 , R A Tinguely1 , N Eidietis2 ,
J M Hanson3 and B Sammuli2
1
MIT Plasma Science and Fusion Center, Cambridge, MA 02139, United States of America
2
General Atomics, PO Box 85608, San Diego, CA 92186-5608, United States of America
3
Columbia University, New York, NY 10027-6900, United States of America

E-mail: crea@mit.edu

Received 27 February 2018, revised 21 April 2018


Accepted for publication 25 May 2018
Published 18 June 2018

Abstract
Using data-driven methodology, we exploit the time series of relevant plasma parameters for a
large set of disrupted and non-disrupted discharges to develop a classification algorithm for
detecting disruptive phases in shots that eventually disrupt. Comparing the same methodology
on different devices is crucial in order to have information on the portability of the developed
algorithm and the possible extrapolation to ITER. Therefore, we use data from two very different
tokamaks, DIII-D and Alcator C-Mod. We focus on a subset of disruption predictors, most of
which are dimensionless and/or machine-independent parameters, coming from both plasma
diagnostics and equilibrium reconstructions, such as the normalized plasma internal inductance ℓi
and the n=1 mode amplitude normalized to the toroidal magnetic field. Using such
dimensionless indicators facilitates a more direct comparison between DIII-D and C-Mod. We
then choose a shallow Machine Learning technique, called Random Forests, to explore the
databases available for the two devices. We show results from the classification task, where we
introduce a time dependency through the definition of class labels on the basis of the elapsed
time before the disruption (i.e. ‘far from a disruption’ and ‘close to a disruption’). The
performances of the different Random Forest classifiers are discussed in terms of several metrics,
by showing the number of successfully detected samples, as well as the misclassifications. The
overall model accuracies are above 97% when identifying a ‘far from disruption’ and a
‘disruptive’ phase for disrupted discharges. Nevertheless, the Forests are intrinsically different in
their capability of predicting a disruptive behavior, with C-Mod predictions comparable to
random guesses. Indeed, we show that C-Mod recall index, i.e. the sensitivity to a disruptive
behavior, is as low as 0.47, while DIII-D recall is ∼0.72. The portability of the developed
algorithm is also tested across the two devices, by using DIII-D data for training the forests and
C-Mod for testing and vice versa.

Keywords: cross-device study, Machine Learning, disruptions


(Some figures may appear in colour only in the online journal)

1. Introduction unstable regime has not yet been reached. Lacking a com-
prehensive theoretical model, scientists have addressed
The physics of disruptions in present tokamak devices still disruptions using advanced statistical analysis [1], and
remains a challenge for the fusion community. A thorough, recent efforts have seen a boosted interest in the exploita-
physical understanding of the transition mechanisms that tion of state-of-the-art Machine Learning techniques [2] to
drive the plasma away from a stable phase into an develop data-driven predictors for disruption avoidance or

0741-3335/18/084004+13$33.00 1 © 2018 IOP Publishing Ltd Printed in the UK


Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

mitigation [3–12]. Current devices are not extremely 2. The DIII-D and C-Mod disruption databases
affected by these unforeseen discharge terminations;
nevertheless, the consequences of disruption events for The physical processes that lead up to a disruption are com-
future tokamaks and reactors could be disastrous, given the plex [19], but based on extensive empirical experience, it is
energy scale and size. generally believed that changes in behavior of some routinely
Disruption precursors can be very different, and their measured plasma parameters are correlated with the approach
phenomenology strongly depends on the analyzed device. of a disruption. Therefore, our database currently consists of
Inspiring work has been published so far [13], presenting the time series values of ∼45 disruption-relevant signals,
manual classifications of the chain of events that can lead to sampled simultaneously throughout the duration of all 2146
disruptions in tokamak plasmas. From these, one could plasma discharges in the 2015 campaign on DIII-D, which
implement advanced statistical techniques to automatically includes 678 disruptions, and all 1821 plasma discharges in
classify such transitions and thus define a possible disruption the 2015 campaign on Alcator C-Mod, which includes 643
predictor. Other approaches foresee the incorporation of disruptions. We include data from both disruptive and non-
physics-based first-principle models in a complex statistical disruptive discharges because, in addition to predicting
learning architecture [14]. impending disruptions with high accuracy, we want to avoid
These studies require an intense and expensive human predicting disruptions on discharges that will not disrupt (i.e.
intervention in the definition of the different cause-effect false positives).
sequences that can be identified during the transition to a The times at which the data are sampled consist of two
distinct sets for each machine. For all shots in the DIII-D
disruptive end, under the most varied operational conditions,
database we sample every 25 ms, starting at t=0.100 s and
which might indeed be very device-dependent. Most fre-
continuing until the end of the discharge. (Typical DIII-D
quently, these studies are not affordable in terms of either
shot durations range from 3 to 8 s.) For disruptive shots, we
time or human resources. The approach we propose in this
add a set of samples taken at 2 ms intervals for the 100 ms
paper follows the data science paradigm of letting the algo-
period preceding the disruption4. For all shots in the C-Mod
rithm learn from the data, with as little as possible human
database, we sample every 20 ms, starting at t=0.060 s and
interference. Statistical inference, developed after the algo-
continuing until the end of the discharge. (The typical C-Mod
rithm has learned from the provided data, can provide shot duration is 2 s.) For disruptive shots, we add a set of
important physics insights on the disruption dynamics, samples taken at 1 ms intervals for the 20 ms period preceding
especially when comparing a similar predictive methodology the disruption. On each machine, in order to avoid overlap
on two very different devices. between the two sampling sets, we remove the slow-sampled
In this paper we present the results regarding the appli- points during the pre-disruption period of high-frequency
cation of the Random Forests algorithm [15] to two datasets sampling.
coming from two very different tokamaks, DIII-D and Alcator Our choice of parameters to include in the databases is
C-Mod. The construction of the databases, as well as the based partly on our own tokamak operational experience, and
selection of the relevant input features for our algorithms, will partly on those specified in the relevant literature [12, 20].
be discussed in section 2. In section 3, we will discuss and These include plasma parameters directly measured by diag-
compare in detail the behavior of two plasma signals as dis- nostics, such as radiated power Prad and density, as well as
ruption precursors, the normalized internal inductance ℓi and those derived from EFIT equilibrium reconstructions [21],
the n=1 mode amplitude. We will then thoroughly describe such as q95, elongation, and ℓi. We initially included a few
the Random Forests algorithm in section 4: this is a popular plasma parameters that are explicit time derivatives, such as
and very powerful Machine Learning algorithm, widely used dWth dt (where Wth is the stored plasma energy), but we
in many different applications [16–18]. The results of its found that the noise in these time derivative signals was much
application to DIII-D and C-Mod data will be presented in larger than any observed changes due to impending disrup-
section 5. Since a binary classification scheme is adopted, one tions, and therefore not useful. There are also several control-
efficient way of displaying the results is through the utiliza- related parameters, such as the programmed plasma current
tion of a confusion matrix. The number of correctly classified Iprog (useful for separating data into the rampup, flattop, and
samples as well as the misclassified ones are reported, from rampdown phases of the discharges), a power supply status
which we can extract several performance metrics. We will flag, an intentional disruption flag, etc. Many of the plasma
also discuss the ranking of the relatively most important input parameters can be cast in a normalized form, such as
variables in our binary classification scheme for both the Greenwald fraction and Prad/Pinput, which is useful for cross-
devices. In section 6 we will also test the portability of machine analyses.
Random Forests across the two different devices; we will There are a number of additional factors that were con-
show the results coming from the algorithm trained on DIII-D sidered in the design of the database. Since the ultimate goal
data and tested on C-Mod and vice versa. Finally, conclusions is to develop a real-time disruption warning algorithm, we
are drawn in section 7, where we will discuss the reasons that 4
The disruption time tD is defined to be the time of max (∣dIp dt∣), which is
led to have such different predictive capabilities on DIII-D typically about halfway down the decay of the plasma current, i.e. current
and C-Mod. quench.

2
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

Table 1. List of signals considered for Machine Learning Even adding data from other campaign years is feasible, with
applications on DIII-D and C-Mod. the primary effort being the need to run dedicated EFITs as
Signal description Variable name described previously.
Each record in our SQL database consists of the values of
Percent error between measured and
ip_error_frac the ∼45 parameters at a single time on a single shot. The shot
programmed plasma cur- number and the time are two of the parameters (the primary
rent, (Ip - Iprog ) Ip
keys) in each record. The time_until_disrupt is
Poloidal beta, βp betap
another parameter in each record, but it is only defined for
Greenwald density fraction, n/nG n/nG
shots that disrupt. (For non-disruptive shots, it has a null
Safety factor at 95% of minor radius, q95
q95 value, or NaN in Matlab.) The ∼45 parameters can be thought
Normalized internal inductance, ℓi li of as columns of the database. There are typically 200–250
Radiated power fraction, Prad/Pinput prad_frac records (i.e. time slices) for each of the 2146 shots in the DIII-
Loop voltage, Vloop (V) Vloop D database, totaling nearly 0.5 million records, and contain-
Stored plasma energy, Wth (J) Wmhd ing ∼22 million parameter values, and 80–100 records
n=1 mode amplitude, for each of the 1821 shots in the C-Mod database, totaling
n_equal_1_normalized
normalized to Btor 0.2 million records and containing ∼7.7 million parameter
Electron temperature profile width, values.
normalized to plasma minor radius Te_width_normalized For the Machine Learning studies described in the
-not available for C-Mod-
following sections of this paper, a subset of 10 particular
parameters was chosen, based on the literature on disruption
chose only parameters that, in principle, can be available in prediction [5, 7–12]. One of the chosen plasma parameters,
real-time to the plasma control system. This precludes the use the electron temperature profile width normalized to the
of parameters that may be very useful for disruption warning, plasma minor radius, was not available for most of the 2015
but which require extensive offline analysis to derive. On C-Mod database and was therefore neglected from the spe-
DIII-D (and several other tokamaks) a highly optimized cific Machine Learning application on C-Mod. The subset of
version of EFIT runs in real-time in the plasma control system chosen signals, reported in table 1, contains mostly machine-
[22], so we are justified in including EFIT-derived data in our independent and dimensionless parameters, which can there-
database. The goal of a real-time disruption predictor intro- fore enable cross-device analysis and comparisons. Each
duces another constraint on the data, namely the avoidance of signal’s description is given together with the associated
non-causal filtering. Several of the desired parameters, such as name of the variable as it appears in the figures and tables of
Prad, are available from the MDSplus archiving system [23], the following sections.
but have been processed using non-causal smoothing win- We report in table 2 a schematic summary of the number
dows. Incorporation of these data into the disruption database of disrupted and non-disrupted discharges used for Machine
could lead to incorrect identification of these parameters as Learning applications on DIII-D and C-Mod.
useful for disruption prediction. Therefore we have re-ana- For these initial studies, we have chosen to concentrate
lyzed the offending signals to avoid or minimize non-causal only on the flattop phase of discharges and on shots that
filtering. disrupted during flattop. Furthermore, we did not use the data
Although real-time EFITs are done on DIII-D, we have from disruptions that were caused by hardware (power sup-
elected to use EFIT-derived data from full EFIT reconstruc- ply) failures, nor intentionally-triggered disruptions (usually
tions done after the shot, since they are more accurate. for studies of disruption mitigation). These restrictions leave
However, the standard post-shot EFITs are not done at the us with a set of 194 discharges that disrupted during the
higher sampling rates that we desire prior to disruptions. In flattop on DIII-D and 189 discharges that disrupted during
order to avoid excessive interpolation, we have rerun EFIT on flattop on C-Mod. We complemented these with data from
all the shots in our database, using the sampling times that we the flattop of 1366 non-disruptive DIII-D discharges and 1160
desire. For these custom EFITs, we also reduced the non- C-Mod discharges, preferentially from the same experimental
causal filtering of the magnetic diagnostic signals upon which runs. This will ensure similar operational spaces for our
the Grad–Shafranov reconstructions are based. The data from analyses. Thus for each of the 10 selected parameters, we are
these custom EFITs are archived in an alternative MDSplus using a total of ∼253 000 records from the DIII-D database,
EFIT tree for each shot. selected from a total of 1562 discharges, and ∼74 000 records
The data are stored in an SQL relational database and can from the C-Mod database, selected from a total of 1349
be retrieved by any analysis software that supports SQL discharges.
queries, including Matlab, IDL, Python, etc. Population of the
database is done with a Matlab main program that loops
through a specified list of shots, calling Matlab subroutines to 3. Univariate data analysis
extract and process the relevant parameter data from
MDSplus for each shot, and interpolating data at the desired Before presenting the results related to the application of
times. This architecture makes it rather easy to incorporate Machine Learning techniques, we present a detailed analysis
additional parameters, which we continue to do occasionally. on some of the parameters of interest for both devices.

3
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

Table 2. Number of DIII-D and C-Mod discharges considered for Table 3. Performance metrics for DIII-D and C-Mod binary
Machine Learning applications during 2015 campaigns. classification tasks. All the indices are limited between 0 and 1, with
1 representing optimal performances.
Disrupted Non-disrupted
Accuracy Precision Recall F1 score
DIII-D 194 1366
C-Mod 189 1160 DIII-D 0.983 6 0.819 6 0.720 5 0.766 8
C-Mod 0.978 5 0.814 6 0.468 8 0.595 1

Machine Learning is a powerful way to discern more com-


plicated relationships, but the observations from simple con-
where tD - t > 0.35 s and tD is the time of the disruption
ventional studies of the database should be reflected in the
event. These overlapping distributions are in turn fairly well
Machine Learning results. Therefore, we highlight differences
separated from the distribution related to all those time slices
and similarities in the behavior of disruption-relevant plasma
close to the disruption event, i.e. tD - t < 0.35 s. This
signals, such as the normalized internal inductance ℓi and the
behavior is also seen for the Greenwald density fraction and
n=1 mode amplitude.
the width of the normalized electron temperature profile (not
shown here). By contrast, for C-Mod the ℓi distribution for
3.1. The normalized internal inductance times close to the disruption in figure 2(b) overlaps much
more with the other distributions and does not show the same
The available databases for Alcator C-Mod and DIII-D can degree of separation.
also be queried in a conventional sense to study the behavior In order to better understand the dependence on the
of individual signals prior to disruptions. threshold in time for the discrimination of sample distribu-
An example of this is given in figure 1, which shows the tions that would be far from and close to the disruption event,
behavior of the normalized internal inductance5, ℓi, versus the we analyzed the median of ℓi distributions at different time
elapsed time before the disruption event, for all the considered ranges for both databases. Results are shown in figure 3.
flattop disruptions in this cross-device study. To reduce the For the DIII-D case, shown in red in figure 3 (left), we
clutter of the signal’s time traces we used different greyscale have divided the ℓi data into 100 ms windows based on the
colors depending on the initial value of ℓi. time before the disruption: 0.1–0.2 s, 0.2–0.3 s, 0.3–0.4 s, and
The orange-colored time traces in figure 1 (top) highlight so on until 1.0–1.1 s range. Then we have computed the
that for a significant fraction of DIII-D flattop disruptions ℓi histograms for each time range. However, a plot with all 10
starts to increase (i.e. the current density profile peaks up) histograms superimposed is too crowded to be useful. So we
near the disruption event. The normalized internal inductance computed the median value of the ℓi distribution for each
is seen to rise from a plateau below 1 to a value between 1.1 of the 10 time range distributions and plotted it versus
and 1.3 starting around −0.35 s or earlier in ∼32% of all time_until_disrupt. We can see in figure 3 that the
considered DIII-D disruptive discharges. In contrast, when median value of ℓi gradually increases until about 0.4 s before
analyzing non-disruptive discharges during the flattop phase, a disruption, and then increases much more rapidly. This
a similar behavior is only reproduced in about 5% of the corroborates our choice to divide the data into the time ranges
cases. However, it is difficult to recognize any noticeable ℓi greater than 0.35 s and less than 0.35 s before the disruption.
rise in figure 1 (bottom) for C-Mod disruptive data. A similar analysis was done for C-Mod using 100 ms
To investigate the differences in the behavior of ℓi for time windows from 0.2 to 1.1 s, but we can see from
C-Mod and DIII-D, we analyzed the probability histograms figure 3(left) that the median of ℓi is varying slowly in this
for the two different groups of discharges present in both time frame. However, an additional sorting was done into
databases: disruptions and non-disrupted shots. higher resolution 20 ms frames from 20 to 200 ms before the
We report in figure 2 the relevant histograms for the disruption time. It is possible to see from the zoomed-in view
considered discharges. The blue distributions describe ℓi in figure 3 (right) that there is indeed a noticeable increase in
behavior during the flattop phase of all non-disruptive dis- the distribution of the median of ℓi, but such rise is smaller in
charges. In orange and yellow we can see the probability magnitude and localized much closer to the disruption event if
histograms for disrupted discharges (always during the flattop compared to DIII-D.
of the plasma current) but at different times with respect to
disruption event. The threshold in time is device-dependent,
in particular for the DIII-D case it has been chosen on the 3.2. The n=1 mode indicator
basis of figure 1, where a bifurcation can be seen around
Tearing modes that rotate very slowly (quasi-stationary
350 ms before the disruption event. If we consider only DIII-
modes), or not at all (locked modes), can grow to large
D histograms in figure 2(a), it is seen that there is an overlap
of the non-disruptive probability distribution and the dis- amplitude, and frequently lead to disruptions. For example,
detailed studies on JET [13] have shown that mode-locking is
tribution of ℓi for all times far from the disruption event, i.e.
involved in approximately 90% of all disruptions. Modes with
5
The normalized internal inductance is an EFIT-derived measure of the poloidal/toroidal mode numbers m/n=2/1 are known to
peakedness of the plasma current profile. strongly degrade confinement, not only in DIII-D and C-Mod,

4
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

Figure 1. Normalized internal inductance, ℓi, as a function of time before disruption during the flattop phase of all the considered disrupted
discharges. To reduce the clutter of the signal’s time traces we used different greyscale colors depending on the initial value of ℓi. For DIII-D
(top), starting from approximately −0.35 s or earlier, ℓi starts to increase on a large fraction of discharges; the orange-colored time traces help
highlighting such behavior. For C-Mod (bottom), a less obvious increase in ℓi starts ∼60−50 ms before the disruption time.

but also in other tokamaks [24–26], and are responsible for vacuum coupling. Detailed discussion on the technique
most locked mode disruptions. adopted for the detection of n=1 modes can be found
Statistical analysis of m/n=2/1 modes conducted in in [28].
[27] on a database including 22 500 discharges on DIII-D The raw ESLD saddle loop signals are archived for all
showed that more than 18% of disruptions between 2005 and discharges. However, the real-time n=1 amplitude signal is
2014 were due to locked or slowly rotating modes. only available and archived for those discharges that require
For DIII-D, an estimate of the perturbed radial field of the PCS ‘Alarms’ category to be enabled during the experi-
non-rotating modes is provided in real-time to the Plasma ment. For the analyzed 2015 database, the n=1 amplitude
Control System (PCS) ‘Alarms’ category by the difference indicator was missing on ∼38% of the discharges. For these
pairs of the integrated external saddle loops (ESLDs). These discharges, we reconstructed an equivalent n=1 amplitude
consist of a toroidal array of six external saddle loops, posi- signal by performing the same computation on the ESLDs as
tioned at 60◦ intervals around the outboard midplane, capable done in the PCS. To speed up the analyses of thousands of
of resolving modes with toroidal number 0  n  2. A discharges, we used the recently developed tool TokSearch
compensation matrix is used to account for the pickup of the [29], which automates parallel processing of discharges on
driven non-axisymmetric coils (I-coils and C-coils) and the multiple nodes.

5
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

Figure 2. For (a) DIII-D and (b) Alcator C-Mod discharges, probability histograms of the normalized internal inductance, ℓi, are shown for all
non-disruptive discharges (blue) and disruptive discharges, where the latter data is split into times far from (orange) and close to (yellow) the
disruption. Note that the thresholds between ‘far from’ and ‘close to’ disruption data are different for C-Mod and DIII-D.

Figure 3. Median of ℓi probability distributions, for DIII-D (red) and Alcator C-Mod (blue) discharges, extracted at different time ranges
before the disruption event. On both machines there is an increase in the median value of ℓi before disruptions, but both the warning time and
the magnitude of the increase is noticeably smaller for C-Mod. The gray box in the left plot identifies the zoomed-in region in the right plot.

Alcator C-Mod did not have functional saddle loops, so series: A1 (t ) + A2 (t ) cos (f ) + A3 (t ) sin (f ). The n=1 mode
we used the analog-integrated signals from 4 poloidal amplitude at each time is A22 + A32 . This amplitude is then
magnetic field Bp sensors located on the internal surface of the normalized by dividing by the toroidal field at each time.
vacuum vessel, near the outboard midplane. These sensors are A statistical analysis, similar to the one described above
sensitive also to rotating modes and not only to locked ones, for ℓi, can also be done for the n=1 mode amplitude nor-
unlike the saddle loops used for the DIII-D analysis. The 4 Bp malized to the value of the toroidal magnetic field on-axis.
sensors were all at the same poloidal location, and were tor-
Figure 4 (top) and (bottom) show the database parameter
oidally distributed at roughly 90° intervals. (These 4 Bp
n_equal_1_normalized as a function of the time before
sensors were a subset of the 104 Bp sensors used for real-time
the disruption event, for all the analyzed flattop disruptions on
control and for EFIT equilibrium reconstructions.) The Bp
signals were compensated for baseline offsets, integrator DIII-D and C-Mod, respectively. There is an obvious differ-
drifts, and toroidal field pickup. However, the contribution of ence in the average magnitude of Bpn = 1 Btor between the two
applied non-axisymmetric magnetic fields from external error machines, with C-Mod values being about 3× higher. Both
field coils has not yet been compensated for. At each sam- machines also show a general trend of increasing Bpn = 1 Btor
pling time we used a least-squares fit to fit the 4 signals to the as the disruption time is approached.

6
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

Figure 4. For DIII-D (top) and C-Mod (bottom), n=1 mode amplitude normalized to the value of the toroidal magnetic field as a function of
time before disruption during the flattop phase for the set of disrupted discharges.

Better quantification of this behavior can be seen in the available DIII-D and Alcator C-Mod databases. We chose to
evolving probability distributions displayed in figure 5(a) adopt the scikit-learn [30] implementation: this is an
and (b). A significantly larger fraction of impending disrup- open-source Python library for Machine Learning that we
tions on DIII-D exhibit an increase in Bpn = 1 Btor compared to used through the OMFIT framework [31].
C-Mod, and the increases tend to occur much earlier before The Random Forests algorithm is among the most ver-
the disruption. satile advanced statistical models. The details of such algo-
Future work will focus on removing from the reconstructed rithm have already been discussed in a previous paper [18], to
C-Mod signal the contribution of external error fields as well as which we refer for a detailed discussion of the algorithmic
the contribution of rotating modes, in order to have a more methodology. It belongs to the family of ensemble learners:
direct comparison with the DIII-D n=1 mode indicator. the forests are grown by developing parallel sets of predictors,
thus collecting a large number of independent and identically
distributed, de-correlated decision trees [32]. The trees are
4. Random Forests for disruption prediction usually fully grown and the final prediction is aggregated,
using majority voting, from a very large number of trees. A
In this paper we present the application of a supervised, representation of a single tree in a forest is given in figure 6.
classification algorithm, called Random Forests [15], to the These individual learners (i.e. the trees) can be defined as

7
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

Figure 5. For (a) DIII-D and (b) C-Mod, histograms of n_equal_1_normalized during the flattop of non-disruptive discharges (blue
distribution), and disruptive discharges, separated into far from (orange) and close to (yellow) disruption datasets.

Figure 6. Graphical depiction of an individual tree in a Random Forest, zoomed-in the first three layers. We can see that in the root node, at the
very top, we have all the bootstrapped samples (100%) with a class composition given by [0.96, 0.04] reflecting the [‘non-disruptive’,‘disruptive’]
classes population in the whole DIII-D dataset. Nodes are then branched on the basis of real values of input features; the feature chosen as the best
candidate to reduce the impurity measure at each split can be picked from a random subset of the initially available input features. This
mechanism strongly reduces the correlation among the grown trees [15]. The blue and brown colors represent the two different classes in the
binary classification task. The classes population is reported in each node. The color at each node is assigned depending on the majority of the
classes of the samples populating that node.

hierarchical data structures that are grown through a divide- particular, it is defined as:
and-conquer strategy. When dealing with a supervised clas- K
sification problem, this means that the original input space is Gini = å pˆtk (1 - pˆtk ) , (1 )
recursively partitioned until the almost complete separation of k= 1

samples belonging to different labels. Starting from a root where pˆtk is the proportion of class k observations in node t. For
node, the data is split on the input feature that results in the two classes, if p is the proportion in the positive class:
largest information gain, and this process is recursively Gini = 2p (1 - p ). It can be seen in figure 6 that each node is
repeated until the decision tree ends with nodes as pure as associated to a specific impurity measurement given by the Gini
possible. For the purpose of estimating the information gain, index and a Gini closer to zero indicates that the node contains
several equivalent metrics can be adopted; in particular we almost all samples belonging to just one of the two classes.
adopt the Gini impurity measure. Such measure is differ- Random Forests have the great advantage of being a
entiable, and hence amenable to numerical optimization. In Machine Learning model with low bias and low variance due

8
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

set in order to be able to generate correct predictions to


unseen instances. The training ensemble is then used to build
the algorithm’s rules, and the test set is used to check the
generalization capabilities and the predictive power of the
constructed model. Data from time slices of each shot are
either all included in the training or the test set, so that data
belonging to the same discharge cannot be partly found both
in the training and in the test set.
We split the available discharges into a (train/test) ratio
of (80/20)%, keeping approximately 50% of the disrupted
discharges in each of the training and the test sets. Non-
disrupted discharges are treated in the same way. The per-
formances of the trained model, when analyzed using the test
Figure 7. Out-Of-Bag error rate for DIII-D (red) and Alcator C-Mod set, are typically interpreted as an accuracy metric to deter-
(blue) as a function of the number of estimators, i.e. the individual mine the suitability of the constructed algorithm. One com-
trees in the forest. The grey-shaded region highlights the chosen mon way of displaying the results, when dealing with a binary
number of estimators (500) for which the OOB error rate stabilizes.
OOB error rate curves were scaled by their mean values to be able to classification task, is through the utilization of a confusion
represent both curves on the same plot scale. Even though the OOB matrix, also called a contingency table [35].
error rate stabilizes around 300 trees, we choose a high number of In section 5 we show the confusion matrices resulting
trees, following Breiman’s recommendations in [15]. from the application of the Random Forests classifier to both
DIII-D and C-Mod databases. A detailed discussion about the
to the exploitation of bootstrap aggregation (bagging [33]). performance metrics is also given.
By using this model, we do not need to adopt computationally It is important to notice that Random Forests are unaware
expensive techniques to assess hyperparameter values; the of any temporal dependence in both training and test obser-
main parameter that needs to be chosen is the number of trees vations. The training samples are passed to the forest under the
in the forest. For the application reported in this paper, we  
form of (x , y)train , where x is an N-dimensional feature vector
decided to build a forest of 500 decision trees (or estimators), (one value for each of the N parameters listed in table 1 ) and
and this number was chosen on the basis of the Out-Of-Bag y is the associated class label. The test samples are the ones
(OOB) error rate stabilization, shown in figure 7 for both for which we ask the Random Forest to guess the correct
DIII-D and C-Mod. 
prediction from the input data x test .
Tree-based models are attractive due to their accessible Through the appropriate definition of the class labels in
interpretability: the Gini index is the key metric to extract our binary classification tasks, we can introduce temporal
useful information from the algorithm, such as the estimate of information to properly interpret the results of the Random
the relative importance of the predictor variables. In sci- Forests predictions on the test set. Even though Random
kit-learn, the importance measure is implemented as Forests naturally present the capability of multiclass classifi-
described by Breiman [15, 32]. The importance metric is cations, we decided to assign two different labels to our data
generally referred to as mean decrease impurity or Gini samples under this supervised classification scheme. The
importance, when the Gini index is used as the impurity basic assumption is that the discharges that eventually disrupt
measure. present a transition from a safe to a disruptive phase in the
To evaluate the importance of the variable Vj, all the plasma parameter space. By discriminating a pre-disruptive
nodes t in which Vj appears are considered: phase in disruptive discharges, as further discussed in
1 M
⎡N ⎤ section 5, it is consequently possible to separate samples
importance (Vj ) =
M
å å ⎢⎣ Nt Di (st , t ) ⎥⎦ , (2 ) belonging to disruptive shots on the basis of a threshold in
m = 1 t Î jm j
time that differentiates between times close to and far from
where N is the total number of samples and Nt is the number the disruption event. We therefore decided to assign the
of samples reaching node t. For such nodes, the impurity ‘disruptive’ label to those samples of disruptive discharges
decreases (Di (st , t )) after the split st are added up, weighted that are close to the disruption event, while the samples of
by the proportion of samples that reach the node, and then disruptive discharges far from the disruption and all the
averaged over all the trees jm (for m=1, K, M, in our case samples belonging to non-disrupted discharges are labeled as
M=500) in the forest. Table 4 in section 5 reports on the ‘far from disruption or non-disruptive’.
relative importance ranking extracted from the training set
used to develop the algorithms on the different devices.
In the study presented in this paper, we aim to develop an
analogous methodology for the C-Mod and the DIII-D dis- 5. Results from binary classification using DIII-D and
ruption databases. The Machine Learning approach chases the C-Mod databases
realization of a model being able to perfectly generalize its
predictions for unseen cases [34]. Therefore, the idea is that The definition of the threshold in time for the discrimination
we need to split the available data into a training set and a test of a disruptive versus a far from disruption phase during

9
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

disrupted discharges varies when considering DIII-D or


C-Mod data.
For DIII-D, we chose to distinguish the observations on the
basis of a threshold in time fixed at 0.35 s before the disruption
event. This particular threshold was chosen also given the uni-
variate analysis conducted on parameters such as ℓi, n/nG, or the
normalized electron temperature width, which show different
patterns after 0.35 s, as already discussed in section 3 and as
reported in figures 1 and 2 for the normalized internal inductance.
For C-Mod, we conducted a similar univariate analysis
on all the signals used for training (table 1). From the uni-
variate analysis it emerges that only ℓi shows some detectable
change in its behavior starting from ∼0.06–0.05 s (see right
plot in figure 3), while all other signals show little change
until just 3–4 ms before disruptions occur. This is far too short
of a warning time for any kind of successful mitigation and/
or avoidance action to be taken, and therefore is not of much
practical use.
To define the threshold in time for the identification of the
‘disruptive’ class on C-Mod, we trained several Random Forests
at different time thresholds. Data not reported in this paper
Figure 8. Confusion matrix for the binary classification task using
shows that the model’s performances are insensitive to the DIII-D data. The number of samples correctly detected are displayed
choice of a specific threshold. Therefore we chose to adopt as diagonal elements in green, while the misclassifications are shown
40 ms as a conservative threshold, given that mitigation tech- in red as off-diagonal terms.
niques on C-Mod are estimated to take 10–20 ms to be effective.
As a comparison, on ITER the minimal response time for
the proposed mitigation system is 30–40 ms [36], and much
longer warning times are needed to successfully execute
disruption avoidance procedures.
For both DIII-D and C-Mod cases, the trained Random
Forests reach an overall model accuracy6 greater than 97%
when tested for the capability of discriminating between
samples belonging to a ‘disruptive’ versus a ‘far from disrup-
tion or non-disruptive’ class, ffd-nd for short, in the available
discharges. Nevertheless, the results are intrinsically very dif-
ferent when comparing the individual confusion matrices
obtained in the two cases. These are reported in figures 8 and 9.
Each row in a confusion matrix represents the actual or true
class, while each column represents the predicted class.
We use as a reference the data reported in figure 8 to
define some useful terminology. In figure 8 the first row of the
matrix considers the ffd-nd samples (the negative class): more
than 35 400 of them were correctly classified as ffd-nd sam-
ples (true negatives) while the remaining ∼200 were wrongly
classified as ‘disruptive’ (false positives). The second row
considers only the samples belonging to the ‘disruptive’ class
Figure 9. Confusion matrix for the binary classification task using
(the positive class): 388 were misclassified as ffd-nd samples
Alcator C-Mod data. The number of samples correctly detected are
(false negatives), while the remaining 1000 samples were displayed as diagonal elements in green, while the misclassifications
correctly classified as time slices close to the disruption event are shown in red as off-diagonal terms.
(true positives).
The numbers representing the true positives (TP), true models accuracies are comparable (see table 3). To be able to
negatives (TN), false positives (FP) and false negatives (FN) have a direct comparison between the model’s performances
substantially differ when we compare the two confusion on DIII-D and C-Mod, it is possible to adopt different per-
matrices for DIII-D and C-Mod, even though the reported formance indicators [37] that can be extracted directly from
6
In the binary classification context, the accuracy refers to the fraction of
the confusion matrix.
TP
correct predictions normalized to the total number of available sam- We first introduce the classifier’s precision, TP + FP , i.e. the
TP + TN
ples: TP + FP + TN + FN . fraction of positive predictions weighted by the number of false

10
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

Table 4. Relative variable importance for binary classifications on DIII-D and C-Mod. C-Mod ranking is reported for completeness, but given
the poor performances of the classifier, the feature importance is not related to the true disruptivity on C-Mod.
DIII-D C-Mod
Parameter Importance Parameter Importance
q95 0.241 ip_error_frac 0.168
n_equal_1_normalized 0.235 n/nG 0.155
n/nG 0.170 li 0.123
li 0.079 n_equal_1_normalized 0.114
betap 0.066 q95 0.106
Wmhd 0.059 Vloop 0.096
Te_width_normalized 0.047 Wmhd 0.083
Vloop 0.047 betap 0.081
ip_error_frac 0.034 prad_frac 0.071
prad_frac 0.020

Table 5. The table reports on Random Forests performance when For DIII-D (table 4), these relative importance measures
trained on one device’s data and tested on the other. Performances represent a well known correlation between disruptivity,
are reported in terms of the F1 score. We also tested the algorithm
n=1 mode activity, and the safety factor.
against different thresholds in time for the discrimination of
‘disruptive’ class labels. Instead, given the poor classifier’s performances on
C-Mod data, we cannot rely on the variable ranking reported
Train Test Thr (s) F1 score in table 4. Since the Random Forests algorithm is capable of
C-Mod DIII-D 0.35 0.275 8 discriminating ‘disruptive’ labels in less than 50% of the
C-Mod DIII-D 0.04 0.177 2 cases, the relative ranking does not reflect any correlation
DIII-D C-Mod 0.35 0.174 6 between the input features and the actual disruptivity on
DIII-D C-Mod 0.04 0.011 4 C-Mod. It only reflects the relatively most important vari-
ables, e.g. ip_error_frac or n/nG, in detecting less than
a half disruptive samples.
positive misclassifications. In other words, it represents the
ability of the classifier not to label as ‘disruptive’ a sample that
belongs to the ‘far from disruption or non-disruptive’ class.
Precision needs to be evaluated along with another metric 6. The cross-device analysis
named recall, also called sensitivity or true positive rate: this
represents the ratio of ‘disruptive’ class instances that are In order to test the portability of the Random Forests predictive
TP
correctly detected by the classifier, i.e. TP + FN . algorithm across different devices, we selected from table 1
It is often convenient to combine precision and recall into those variables available for both DIII-D and C-Mod data,
a single metric called F1 score, which is obtained from the trained the Random Forests on one device’s dataset, tested
harmonic mean of precision and recall: F1 = 2TP +2TP . on the other, and vice versa. Results are reported in table 5;
FP + FN
Each of the performance metrics reported in table 3 we also trained the algorithm using the two different thresholds
in time that we adopted on DIII-D and C-Mod for the identi-
provides a piece of useful information. It is often instructive
fication of a ‘disruptive’ phase in disrupted discharges.
to report all of them to understand the classifiers differences.
In this analysis we used all the available dimensionless
From table 3 it is indeed possible to notice at first glance the
signals: we discarded Te_width_normalized because it
different performances of the Random Forest classifier on
was not available on C-Mod dataset and Vloop and Wmhd,
DIII-D and C-Mod data. In particular, the recall index and the
because they are not normalized quantities.
F1 score reveal the very poor predictive capabilities of the As we can see from the F1 score, the algorithm performs
classifier for C-Mod disruptive samples. The recall shows that rather poorly when trained on DIII-D data and tested on
a Random Forests trained on C-Mod data is capable of dis- C-Mod and vice versa. Relatively better models can be
criminating ‘disruptive’ samples in not even half of the obtained using C-Mod data as training set and predicting
available observations. The F1 score instead, provides a more DIII-D samples labels. Nevertheless, the predictive cap-
global view of the correct detection of the positive class, abilities of all the developed models are rather insufficient.
taking into account the global misclassification error. Apart from differences in geometry, configuration or material,
As introduced in section 4, Random Forests provide a the two devices are characterized by intrinsically different
relative importance ranking for the input features, i.e. plasma timescales for the evolution of the physics processes: the
signals, used as training set to build the model. The relative confinement time on DIII-D is of the order of 0.1 s, whereas
rank of a feature reflects the relative importance of that feature on C-Mod is around 0.04 s [38]; while the current relaxation
with respect to the predictability of the target variable, in our time is about 1 s for DIII-D and ∼0.2 s on C-Mod [39, 40].
case the discrimination of ‘disruptive’ class labels. These differences in timescales are likely one reason for the

11
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

poor performance. Further work shall be devoted to improve have shown the very poor predictive capabilities of the
the methodology and understand how to conciliate such Random Forests algorithm, training on one device’s data and
intrinsic differences. testing on the other’s (and vice versa), even when using
dimensionless parameters as input variables.
This does not bode well for the realization of a ‘uni-
7. Discussion and conclusions versal’ classifier, capable of predicting disruptions in ITER
with sufficient warning time. Nevertheless, different strategies
In this paper we presented a comparative study between DIII- can still be explored. Different Machine Learning algorithms
D and C-Mod using Machine Learning algorithms for dis- dealing with data as a full time series could have better results
ruption prediction. The chosen methodology is explained in for predicting disruptions, especially on a device character-
detail in section 4: Random Forests is a very powerful and ized by such fast timescales as C-Mod. Furthermore, the
versatile Machine Learning technique, allowing the extraction incorporation of more dimensionless and device-independent
of valuable information from the database, such as the relative quantities might provide more information for developing an
importance ranking for the input features. efficient disruption warning algorithm. In terms of the
We chose to adopt the same set of features for the two applicability to ITER, the experience on machines with
machines, listed in table 1, with the exception of the electron similar characteristics has to be explored to extrapolate all the
temperature data, which was not available on a large fraction possible knowledge that can be used to predict disruptive
of 2015 C-Mod data. Both the constructed algorithms show behaviors or assess the predictive algorithm itself. It may be
accurate predictions when analyzing ‘far from disruption or possible that all the efforts developed on currently available
non-disruptive’ samples, incurring in a very low percentage of data will have limited effect in the realization of a disruption
false positive misclassifications. When asked to identify warning algorithm for ITER. Given the gradual transition to a
‘disruptive’ time slices in discharges that eventually disrupt, full performance, though, an adaptive retraining on initially
the classifier’s performances differ substantially with the available low-power and low-current data could be exploited,
C-Mod case showing percentages of correct classifications by including also data coming from simulations. Finally,
actually worse than a random guess. To better evidence this, cutting-edge techniques in Artificial Intelligence can prove to
we show in table 3 the recall index for both DIII-D and be beneficial in learning domain-invariant representations that
C-Mod cases. can be used to adapt the algorithm between different opera-
The poor performance of disruption prediction in C-Mod tional regimes and tokamaks.
may reflect the fact that some C-Mod disruptions are thought
to be caused by tiny flecks of molybdenum penetrating into
the plasma and very effectively radiating away its thermal
Acknowledgments
energy on a millisecond timescale, due to the high atomic
number. Though not reported in this paper, the analysis of the
This work was supported by the US Department of Energy
radiated power versus the time before the disruption shows
under DE-FC02-04ER54698, DE-SC0014264 and DE-FG02-
that on a fraction of C-Mod discharges, Prad has a very rapid
04ER54761.
increase starting a few milliseconds before the disruption
DIII-D data shown in this paper can be obtained in digital
event. The molybdenum injections presumably originate from
format by following the links at https://fusion.gat.com/
overheated edges/corners of the molybdenum tiles that
global/D3D_DMP.
comprise the plasma facing surface of the divertor. This is not
surprising, since the energy density is higher than all other
currently operating tokamaks. Since the B-field is also high,
the scrape-off width is smaller than all other tokamaks, Disclaimer
resulting in parallel heat fluxes to the divertor of order
0.5 GW m−2 near the strikepoints. This can lead to the This report was prepared as an account of work sponsored by
overheating of tile edges/corners. an agency of the United States Government. Neither the
In contrast, DIII-D has lower thermal energy density and United States Government nor any agency thereof, nor any of
lower B-field, and therefore less heat flux on the divertor. In their employees, makes any warranty, express or implied, or
addition, the plasma facing surface is graphite, not high-Z assumes any legal liability or responsibility for the accuracy,
metal and graphite in a hot plasma does not radiate as completeness, or usefulness of any information, apparatus,
effectively as high-Z metals. It should be noted that ITER will product, or process disclosed, or represents that its use would
have a high-Z divertor (tungsten), like C-Mod, and its thermal not infringe privately owned rights. Reference herein to any
energy density and B-field and parallel heat flux to the specific commercial product, process, or service by trade
divertor will be very similar to C-Mod, and therefore dis- name, trademark, manufacturer, or otherwise, does not
ruptions on ITER may be more like disruptions on C-Mod necessarily constitute or imply its endorsement, recommen-
than on DIII-D. dation, or favoring by the United States Government or any
All of these differences have to be taken into account agency thereof. The views and opinions of authors expressed
when testing the portability of the predictive model across herein do not necessarily state or reflect those of the United
DIII-D and C-Mod. Results from the cross-device analysis States Government or any agency thereof.

12
Plasma Phys. Control. Fusion 60 (2018) 084004 C Rea et al

ORCID iDs [16] Saeys Y, Inza I and Larranaga P 2007 Bioinformatics 23


2507–17
C Rea https://orcid.org/0000-0002-9948-2649 [17] Danesi I L and Rea C 2016 A customer relationship
management case study based on banking data Lecture
R S Granetz https://orcid.org/0000-0002-6560-1881 Notes in Computer Science (Lecture Notes in Artificial
K Montes https://orcid.org/0000-0002-0762-3708 Intelligence and Lecture Notes in Bioinformatics) vol 10122,
R A Tinguely https://orcid.org/0000-0002-3711-1834 pp 224–35
N Eidietis https://orcid.org/0000-0003-0167-5053 [18] Rea C and Granetz R S 2018 Fusion Sci. Technol. 00 1–12
[19] De Vries P, Johnson M and Segui I 2009 Nucl. Fusion 49
055011
[20] Gerhardt S, Darrow D, Bell R, LeBlanc B, Menard J,
References Mueller D, Roquemore A, Sabbagh S and Yuh H 2013 Nucl.
Fusion 53 063021
[21] Lao L, John H St, Stambaugh R, Kellman A and Pfeiffer W
[1] Wroblewski D, Jahns G and Leuer J 1997 Nucl. Fusion 37 1985 Nucl. Fusion 25 1611–22
725–41 [22] Ferron J, Walker M, Lao L, John H S, Humphreys D and
[2] Baltz E A, Trask E, Binderbauer M, Dikovsky M, Gota H, Leuer J 1998 Nucl. Fusion 38 1055–66
Mendoza R, Platt J C and Riley P F 2017 Sci. Rep. 7 6425 [23] Stillerman J and Fredian T W 1999 Fusion Eng. Des. 43 301–8
[3] Hernandez J, Vannucci A, Tajima T, Lin Z, Horton W and [24] La Haye R J, Fitzpatrick R, Hender T C, Morris A W,
McCool S 1996 Nucl. Fusion 36 1009–17 Scoville J T and Todd T N 1992 Phys. Fluids B 4 2098–103
[4] Vannucci A, Oliveira K and Tajima T 1999 Nucl. Fusion 39 [25] Buttery R J et al 2000 Plasma Phys. Control. Fusion 42
255–62 B61–73
[5] Pautasso G et al (Team AU) 2002 Nucl. Fusion 42 100–8 [26] Wolfe S M et al 2005 Phys. Plasmas 12 056110
[6] Yoshino R 2003 Nucl. Fusion 43 1771–86 [27] Sweeney R, Choi W, La Haye R, Mao S, Olofsson K and
[7] Windsor C, Pautasso G, Tichmann C, Buttery R, Hender T, Volpe F 2017 Nucl. Fusion 57 016019
Contributors J E and (Team tAU) 2005 Nucl. Fusion 45 [28] Strait E J 2006 Rev. Sci. Instrum. 77 023502
337–50 [29] Sammuli B S, Barr J L, Eidietis N W, Olofsson K,
[8] Cannas B, Fanni A, Marongiu E and Sonato P 2004 Nucl. Flanagan S M, Kostuk M and Humphreys D 2018 Fusion
Fusion 44 68–76 Eng. Des. 29 12–5
[9] Cannas B, Cau F, Fanni A, Sonato P, Zedda M and [30] Pedregosa F et al 2012 J. Mach. Learn. Res. 12 2825–30
Contributors J E 2006 Nucl. Fusion 46 699–708 [31] Meneghini O et al 2015 Nucl. Fusion 55 083008
[10] Cannas B, Delogu R, Fanni A, Sonato P and Zedda M 2007 [32] Breiman L 1984 Classification and Regression Trees (London:
Fusion Eng. Des. 82 1124–30 Chapman and Hall)
[11] Cannas B, Fanni A, Sonato P and Zedda M K 2007 Nucl. [33] Breiman L 1996 Mach. Learn. 24 123–40
Fusion 47 1559–69 [34] Alpaydın E 2010 Introduction to Machine Learning 2nd edn
[12] Vega J, Dormido-Canto S, López J M, Murari A, Ramírez J M, (Cambridge, MA: MIT Press)
Moreno R, Ruiz M, Alves D and Felton R 2013 Fusion Eng. [35] Stehman S V 1997 Remote Sens. Environ. 62 77–89
Des. 88 1228–31 [36] IPEGoDPC, MHDBasis IP 1999 Nucl. Fusion 39 2251
[13] De Vries P, Johnson M, Alper B, Buratti P, Hender T, [37] Powers D 2011 J. Mach. Learn. Technol. 2 37–63
Koslowski H and Riccardo V 2011 Nucl. Fusion 51 053018 [38] Sauter O and Martin Y 2000 Nucl. Fusion 40 955–64
[14] Berkery J W, Sabbagh S A, Bell R E, Gerhardt S P and [39] Greenfield C M et al (Team tDD) 2004 Plasma Phys. Control.
LeBlanc B P 2017 Phys. Plasmas 24 056103 Fusion 46 B213–33
[15] Breiman L 2001 Mach. Learn. 45 5–32 [40] Wallace G et al 2013 Nucl. Fusion 53 073012

13

You might also like