Introductions

The increasing acceleration of climate change and its consequences has recently emphasised the need for humanity to find clean sources of energy and in particular of electricity1. In the medium and long term, thermonuclear fusion could potentially become a very important ingredient in a sustainable energy mix on a planetary scale2. This approach to electricity generation is based on coalescing the nuclei of hydrogen isotopes; the resulting defect of mass translates into very efficient energy production3. Indeed, nuclear fusion is the most exoenergetic reaction in the known universe and it is the power sources of stars such as our sun.

On earth, the most practical reaction is the one between two hydrogen isotopes: deuterium (D) and tritium (T). However, their nuclei, in order to fuse, need to overcome the repulsive Coulomb barrier and come very close, to distances of the same order as the nuclear radius. Unfortunately this is not easy to achieve in the laboratory. The most advanced alternative consists of heating the fuel, to produce the fourth state of matter in the form of very high temperature plasmas. These plasmas, routinely reaching temperatures higher than the core of the sun, cannot come in contact with material surfaces and must be confined by other means. One potential solution is based on containing them with very strong magnetic fields. This is the approach called Magnetic Confinement Nuclear Fusion (MCNF)4.

The tokamak remains the most realistic magnetic configuration in the perspective of developing a commercially viable thermonuclear fusion reactor5. The topology of the magnetic fields in a tokamak is shown graphically in Fig. 1a. Unfortunately, the configuration is affected by macroscopic instabilities, which are called disruptions6,7 and can cause the abrupt extinction of the plasma current, with potential disastrous consequences for future large machines, such as ITER (the international tokamak under construction in the south of France) and DEMO (the demonstrative reactor)8,9. The qualitative evolution of the main plasma quantities, in the phase approaching and during a disruption, are reported in Fig. 1b. The disruption proper start with a thermal quench, in which almost all the thermal energy of the plasma is lost to the wall on time scales of milliseconds. In future devices, such as DEMO, in this phase the energy loads on the plasma facing components could cause the melting of even the most resistant present-day materials. The plasma current decays on much longer time scales, during the so called current quench. Also this phase can be very dangerous though, due to the ensuing induced electromagnetic loads. In ITER, the forces on the metallic structures surrounding the plasma could be higher than the weight of an Airbus A380 plane. Consequently, in reactor scale devices it will be imperative to limit the number of disruptions, not only to guarantee continuity of operation but also to preserve the structural integrity of the machines. Fortunately, several signals show an anomalous behaviour in the phases leading to the beginning of the current quench. Detecting these precursors and interpreting them, in order to provide the control system with clear indications about the criticality of the plasma state, is the objective of disruption predictors (see section ‘Methods’).

Fig. 1: Magnetic topology and disruption precursors.
figure 1

a Topology of the magnetic fields in a tokamak. b Time evolution of typical disruption precursors during normal operation and in the phase leading to a disruption. In agreement with the literature, the beginning of the current quench is considered the disruption time. Avoidance consists of the remedial actions, allowing to recover a healthy plasma state to continue the experiments. Prevention measures are meant to terminate the discharge quickly, before the actual occurrence of the disruption. When a disruption is unavoidable, because there is no time for avoidance or prevention, mitigating its consequences with appropriate tools, such as shattered pellets or massive gas injection, is the only remaining option7.

To reduce the tritium inventory in their vacuum vessels, the next generation of devices will be equipped with metallic plasma facing components. The Joint European Tokamak (JET) is one of the largest tokamaks ever operated in the world and it is also fitted with a metallic wall: Be in the main chamber and W in the divertor10. JET is also the only present device with the capability of using the fuel of the reactor. In the second half of 2021, the most ambitious series of experiments in the world, scanning systematically the isotopic composition from pure hydrogen to full tritium and 50-50 DT, was carried out on JET11.

Unfortunately, operation with metallic walls is proving particularly vulnerable to disruptions also in present-day devices. On JET at high currents and powers, the disruptivity of both the baseline and the hybrid scenarios exceeds by about an order of magnitude the maximum levels admitted in ITER at target values, let alone DEMO, as shown in Table 112. This a consequence of the fact that disruptions are a very complex and nonlinear phenomenon, involving several entangled effects: the peaking of the density profile, the hollowing of the temperature profile, the transport of impurities, the pedestal properties, centrifugal forces, plasma rotation, local radiation emission to mention just a few13.

Table 1 Database statistics

Even if no first principle models exist, which can predict the occurrence of all the types of the plasma collapse, in the community there is a general consensus about the main stages of plasma dynamics leading to disruptions14. Various factors, ranging from human errors to anomalies in the radiation, temperature or density, can cause modifications of the pressure and current profiles, which destabilise macroscopic instabilities. These electromagnetic modes typically slow down and stop rotating with respect to the vacuum vessel, becoming even more unstable, to the point that the magnetic configuration is so altered that cannot be sustained. A good understanding of these physical mechanisms seems essential, to predict these catastrophic collapses and to develop real-time compatible avoidance, prevention and mitigation strategies (see caption of Fig. 1). Determining how close the plasma is to the boundary between the safe and disruptive regions of the operational space is an essential task usually referred to as proximity detection.

The subject of the present work consists of overviewing the physics of the plasma dynamics leading to disruptions, with the aim of devising reliable disruption predictors, capable of providing the control systems of next-generation devices with enough warning time to implement realistic strategies to handle the problem. To this end, the qualitatively and quantitatively most ambitious JET database has been built and analysed with real-time compatible tools: all the discharges of JET campaigns, from the middle of 2019 to the end of 2021, have been investigated. These campaigns are particularly relevant because they cover experiments of different fuel mixtures: discharges with all the hydrogen isotopes (H/D/T) separately and the reactor 50-50 DT mixture, including the top performance experiments ever performed on JET11. The analysed database consists of 1683 discharges, of which 542 disruptive. The global statistics, obtained with a dedicated relational database, are reported in Table 1.

In the following, the first subsection of the Results describes the original aspects of the developed predictors. The second subsection of the Results introduces the observers developed to identify the plasma state for control purposes. In the third subsection of the Results, the modelling of the plasma dynamics leading to the main types of disruptions is discussed in detail. The investigation of the possible strategies of avoidance and prevention, which could be realistically implemented in real time in the next generation of devices, is the subject of the last subsection of the Results. The discussion section of the paper is devoted to a brief overview of the work and the lines of future research, including the prospects of transferring the present experience to future devices. More details about the diagnostics, the analysis techniques and the control tools can be found in the section ‘Methods’ and the supplementary material.

Results

An advanced, control-oriented approach to disruption prediction

The availability of reliable disruption predictors is a prerequisite to the deployment of any form of avoidance or remedial action. The development of such tools requires investigating in detail the sequence of macroscopic anomalies in the magnetic topology, kinetic profiles and radiation emission, to determine the proximity of the plasma to the disruption boundary. In the last decades, the potential of machine learning methods for this task has been studied in detail as overviewed briefly in section ‘Methods’ and in more detail in ref. 7. Despite quite encouraging results, disruption predictors, relying on traditional machine-learning technologies, have shown some inherent fundamental weaknesses related to: (a) the approach to learning; (b) the mathematical form of the models; (c) the choice of the input signals or features.

With regard to the first issue, most predictors, reviewed in section ‘Methods’, implemented a closed-world approach to learning. This method needs all the information required for the training to be available prior to the first prediction. Moreover, their performances are predicated on the assumption of absolute stationarity, in the sense that the training data, the test data and the inputs in the actual deployment must be generated by identical systems. Such a hypothesis is systematically violated, due to the rapid evolution of experimental programmes. Consequently classifiers based on closed-world training, having no capability of adapting to different regimes or unexplored physics, present some quite significant practical flaws. They tend to require very large amounts of data for the training, impossible to collect in future devices, and they lack generality, because the quality of their predictions tend to degrade quickly even when the experiments present properties only slightly different from those in the training data. Moreover, the deployment of predictors, trained in the traditional way, is typically limited to their tokamak of origin15,16,17.

Another category of drawbacks is a consequence of the mathematical form of the models, implicitly assumed by the traditional machine learning tools such as SVM or neural networks. Whatever the application, most machine learning tools basically fit only a specific class of functions to the data. This means that their models have no relation to the actual plasma dynamics, are difficult to interpret and whether they can be extrapolated to future, larger devices is doubtful18.

The third class of weaknesses is related to the choice of the input signals, which has not been always optimised. Better profile indicators are required (see section ‘Methods’). Moreover, a fundamental direction for future improvements involves a better detection of radiation anomalies, which are localised patterns of high emission. Most disruptions are indeed preceded or caused by anomalous radiation events, which often constitute the earliest macroscopic precursors by a quite ample margin19. The three most common anomalous radiation patterns leading to disruption on JET are reported in Fig. 2 (and the tools developed to detect them in real time are described in detail in section ‘Methods’).

Fig. 2: Main radiation patterns.
figure 2

The main radiation patterns leading to a radiation collapse of the plasma in JET with a metallic wall, as revealed by the maximum likelihood tomography and visible imaging. a Anomalous high radiation in the core due to accumulation of high Z impurities, mainly W. b Anomalous low field radiation. The crescent shape excessive emission of is typically an effect of heavy impurities in configurations, in which, due to the combination of neoclassical and anomalous transport, they accumulate in the outer equatorial plane. c Radiation instability of the MARFE (Multifaceted Asymmetric Radiation from the Edge) type14,15, typically consequence of impurity seeding or excessive high density in the attempt to reduce the power load on the divertor. d MARFE radiation observed by the visible camera (colour proportional to pixel intensity).

The consequences of the just described limitations are particularly unsatisfactory also because natural forms of intelligence can cope quite well with these cognitive problems. Various animals, and humans in particular, can learn effectively from few examples, can adapt quickly to changing situations and have also the capability of transferring knowledge from one problem to similar ones. It is the contention of the present work that these gaps between natural and artificial forms of intelligence can be reduced, by developing adaptive tools, less abstract and closer to the actual physics and dynamics of the phenomena under study. They will require original data processing techniques to analyse and interpret the available measurements in real time. In this perspective, the tools developed in the context of the present work rely on real time compatible measurements and signal processing techniques and present the following four innovative characteristics: (1) they utilise physics-based but control-oriented indicators as inputs (see section ‘Methods’); (2) they output not only alarms but also a classification of the type of anomaly detected (see section ‘Methods’ for details); (3) they implement an automated adaptive form of training to follow the evolution of the experimental programme see (section ‘Methods’); (4) they operate in the two-dimensional space of probability and time; they therefore provide both the disruption probability and an estimate of the time remaining before the beginning of the current quench inputs (see section ‘Methods’ for the details). Of course, all these aspects are of great help for the control system to optimise any form of remedial strategy.

Characterising the plasma state for proximity control

The research in the last years has revealed that the essential diagnostics, for proximity control and mitigation, are: global indicators of the magnetic configuration state, the kinetic profiles, visible imaging and bolometric tomography. Their role in predicting the occurrence of disruptions is overviewed in this subsection.

Global indicators of the magnetic configuration are important to determine the proximity of the plasma to the disruption boundary (see section ‘Methods’). Two quantities, which have proved very useful, and which will be available also in the next generation of devices, are the normalised internal inductance li and the safety factor at 95% of the plasma minor radius q95. The best estimates of li and q95 are the output of quite sophisticated equilibrium codes, whose description is beyond the scope of the present work5. However, intuitively the internal inductance provides an indication about how peaked the current profile is. Small values of li correspond to a broad current profile. This is important for stability and to interpret other signals such as the locked mode amplitude (see later and ref. 20). The safety factor indicates how much stabilising toroidal field is used in a certain configuration, again quantifying the vulnerability of the configuration to become instable. Other things being equal, plasmas at higher q95 are more stable. At values of q95 ≈ 3, the reference of ITER baseline scenario, the plasma disruptivity of present-day tokamak can exceed 60%, absolutely incompatible with the operation of a reactor level device. When macroscopic electromagnetic instabilities, capable of leading to disruptions, stop rotating in the frame of reference of the lab, their amplitude increases and their magnetic signature is picked up by large saddle coils located around the vacuum vessel. This so-called Locked Mode (LM) amplitude signal is important because almost all disruptions on JET are preceded by an anomalous increase of this quantity21.

Anomalies in the electron temperature profile can also play a fundamental role in destabilising various macroscopic instabilities, namely MHD modes, which then grow, lock to the wall and finally lead to disruptions14. The so called electron temperature hollowness and edge cooling are the two most evident and potentially harmful temperature anomalies.

The hollowing of the electron temperature Te is a situation, in which the maximum temperature is not reached in the centre of the plasma but off-axis, resulting in a double bumped profile (see section ‘Methods’). In metallic devices, such an unhealthy plasma condition is typically caused by an excessive emission of radiation in the core, mostly a consequence of the accumulation of heavy impurities, mainly tungsten. The consequent modifications of the local resistivity \(\eta \sim {Z}_{{{{{{\rm{eff}}}}}}}/{T}_{{{{{{\rm{e}}}}}}}^{3/2}\,\), cause changes of the plasma current profile, which often lead to the destabilisation of macroscopic modes14.

Analogous destabilising effects, due to the alterations of the current profile, may be caused by the dynamics at the plasma edge. In this case, excessive local density or radiation, typically due to the attempt to reduce the power loads on the divertor, induce a reduction in the peripheral temperature, with consequent contraction of the current profile, leading to tearing mode destabilisation14.

An important point to appreciate is that unhealthy modifications of the temperature profile can occur significantly in advance of the destabilisation of the fatal MHD modes, giving more time to intervene. The availability of robust and reliable indicators of anomalies in the electron temperature profile is therefore a crucial ingredient in the development of predictors for prevention and avoidance. The ones implemented in the present work are overviewed in the section ‘Methods’ and in ref. 22.

In the whole analysed database (see introductory section), only 7 disruptions do not show any anomalous radiation pattern. Properly measuring the total emission of radiation will be therefore a crucial and delicate task in all future machines. The main radiation patterns leading to the plasma collapse on JET are reported in Fig. 2. All these emission events are cases of radiation positive feedback instabilities, because the impurities have a radiation function increasing with the inverse of the temperature. Consequently, when the local radiation is sufficiently high to provoke a reduction in the temperature, the impurities radiate more, causing a further decrease of the temperature, which results in higher emission, in a vicious positive feedback loop. The most important point to appreciate is that the radiation anomalies are normally the first ones to appear and therefore it is essential to detect them for avoidance and prevention purposes (see next subsection).

The accurate determination of the radiation losses on JET requires tomographic inversion of the bolometric signals, which is a very ill-posed problem. This aspect has been addressed on JET with the combination of a sophisticated tomographic method, called the Maximum Likelihood (ML), and a fast high time resolution algorithm for deployment in real time (see section ‘Methods’). Most radiation problems in the high-field side (such as Multifaceted Asymmetric Radiation from the Edge or MARFEs) appear also very clearly in the frames of the visible cameras and do not require particularly sophisticated image processing algorithms to be followed in real time (see section ‘Methods’).

Modelling the plasma thermal dynamics leading to disruptions

To predict and interpret the plasma evolution in the precursor phase leading to the disruption, a model of the radiation dynamics is necessary. The one described in the present subsection has been conceived with real-time applications in mind; attention has been paid to finding an appropriate trade-off between accuracy and real-time compatibility. In this perspective, to model quantitatively the processes in Fig. 2 for prediction purposes, the most suitable indicator proves to be the ratio of the radiated power divided by the plasma thermal energy. This quantity is much more useful than the traditional ratio of radiated power divided by input power, which can diverge and become misleading, for example during the ramp down of the plasma current, when the additional heating systems are switched off 23. In terms of this quantity, the balance equation, to analyse the radiation anomalies leading to radiative collapse, can be written as:

$$\frac{1}{{E}_{{{{{{\rm{p}}}}}}}(\rho,\theta )}\frac{d{E}_{{{{{{\rm{p}}}}}}}(\rho,\theta )}{{dt}}=\frac{{P}_{{{{{{\rm{in}}}}}}}\left(\rho,\theta \right)}{{E}_{{{{{{\rm{p}}}}}}}(\rho,\theta )}-\frac{{P}_{{{{{{\rm{rad}}}}}}}\left(\rho,\theta \right)}{{E}_{{{{{{\rm{p}}}}}}}(\rho,\theta )}+\frac{{P}_{{{{{{\rm{t}}}}}}}\left(\rho,\theta \right)}{{E}_{{{{{{\rm{p}}}}}}}(\rho,\theta )}$$
(1)

Where Ep is the plasma thermal energy, Pin the input power, Prad the local radiated power, Pt the power due to transport. Equation (1) is particularised for each macropixel of the plasma cross-section and ρ and θ are the polar coordinates of the considered region barycentre (see Fig. 3). The shape and size of the macro-pixels are determined by the layout of JET bolometric diagnostic (see section ‘Methods’). The local plasma energy has been calculated employing the measurements of the High Resolution Thomson Scattering (HRTS) over the macropixels, under the usual approximations that electrons and ions have the same temperature and density i.e. Te = Ti, ne = ni (see section ‘Methods’).

Fig. 3: Fast time resolution tomography regions.
figure 3

The four macro regions, whose emitted power is determined with the fast time resolution tomography described in the section ‘Methods’.

Within the help of Eq. (1) and the high time resolution tomography, it has been possible to study the dynamics of the plasma leading to the disruptions in hundreds of discharges. A threshold level Λith of Λi=Prad/Ep, for each of the 4 regions shown in Fig. 3, can be set by the user, depending on the needs of the experimental programme and its potential danger for the device. In the following, the reported threshold levels Λith have been chosen so that, above the corresponding value of the ratio, the plasma has more than 50% probability to be in a state with excessive radiation, tending to develop temperature and magnetic anomalies. The details about the calculation of the various disruption probabilities are provided in section ‘Methods’.

The distribution of the first alarms, due to radiation anomalies in disruptive discharges, is reported in the top histogram of Fig. 4. It has been checked on a well-documented set of discharges that the alarms of the predictors developed in the present work precede the interventions of JET control system in practically all cases, as documented in section ‘Methods’. In all regions, significantly more disruptions occur in the ramp down of the plasma current than during the flat top. Radiation anomalies appear also in discharges that in the end do not disrupt, as reported in the bottom histogram of Fig. 4. In these occurrences, the safe ending of the pulse is often due either to positive interventions of the control system or to rapid terminations of the discharge, not allowing the plasma dynamics to evolve naturally. Moreover, it has also been verified that remedial actions, of the type advocated in the next subsection, would be always beneficial and improve the performance of the plasma even if implemented in the discharges not disrupting. Indeed, after the appearance of the detected radiation anomalies, if not remedial actions of the type proposed in this work were taken (see next subsection), these experiments would be typically compromised anyway, even if they did not disrupt, and would not provide any useful information.

Fig. 4: Alarm statistics.
figure 4

a Distribution of the first alarms in disruptive pulses, particularised for the current flat top and ramp down. b Distribution of the first alarms in safe pulses, also particularised for the current flat top and ramp down. The locked mode does not trigger any false alarms, therefore not causing any unnecessary mitigation. The majority of the first alarms in safe discharges are due to the appearance of blobs of radiation in the core. The presence of such anomalies has been checked with the ML tomography; consequently these alarms would not result in negative interventions by the control system, because the proposed remedial action of increasing the power deposition in the core would only improve the plasma performances.

Since 1/Λi has the dimension of time, it can be interpreted as a cooling time. As mentioned, the traditional approaches to proximity assessment estimate either the probability of disruption or the time remaining to the onset of a macroscopic MHD mode. With the model just described it is possible to combine these two quantities and operate in the bi-dimensional space of time and probability.

It should be emphasised that all the results reported in the present work have been obtained with a fully adaptive technique from scratch to update the Λi values, as described in section ‘Methods’. The first guess has been obtained with only the first disruptive and three non-disruptive discharges, and the thresholds have been updated with adaptive techniques on a shot-to-shot basis15,16,17,18. It is also important to mention that all the proposed indicators and used measurements are available in real time. All the quantities utilised in this paper can be comfortably calculated within JET real time network cycle time of 2 ms.

The strategy for proximity control

Coming to the relationship between the radiation emission and the dynamics of the plasma kinetic quantities, the statistical results, covering the sequence of the various anomalies, are reported in Table 2. The intervals between the various types of anomalies are overviewed in Table 3.

Table 2 Sequence of anomalies
Table 3 Time between anomalies

The collected evidence indicates that the increase in the locked mode is almost always preceded by some other anomalies. Excessive radiation alarms precede the temperature hollowness in about 90% of the cases. Radiation anomalies in the edge are detected earlier than edge cooling in about 80% of occurrences. The intervals between the preceding alarms and the subsequent ones vary but are typically enough to undertake remedial actions (before having to trigger mitigation).

Coming to the exploitation of the evidence just discussed for control purposes, the approach pursued in the present work consists of estimating the proximity to the disruption boundary in three different steps. First, the radiation patterns and their criticalities are estimated, secondly, the anomalies of the temperature profiles are assessed. The healthiness of magnetic configuration is determined last.

With these objectives and in the light of the evidence just overviewed, a reasonable control strategy can be devised, whose main elements are shown in the block diagram of Fig. 5. Starting from the beginning of the current quench and moving backward in time, the approach could consist of triggering mitigation actions immediately after a locked mode alarm. Following a warning due to excessive cooling of the edge, the time remaining before the beginning of the current quench is compatible only with prevention and therefore the control system should immediately activate the sequence of actions to terminate the discharge safely. In case of anomalies in the radiation patterns, the heating is to be increased in the affected regions. With sufficiently flexible additional heating schemes, such as those already deployed to avoid MHD instabilities24,25, the regions of excessive radiation could be targeted, avoiding the radiation collapse (and consequently avoiding the disruption).

Fig. 5: Control logic.
figure 5

Block diagram of the detection and control logic proposed in the present work.

The proposed control logic has been implemented in fully compatible real-time conditions, which means that all diagnostics, indicators and predictors would have worked exactly in the same way in closed feedback loop. Assuming that 100 ms warnings for temperature hollowness and edge cooling are sufficient to undertake successful remedial action (and 10 ms warning time is enough for mitigation), for the considered database the proposed control logic provides the performances reported in Tables 4 and 5. Keeping in mind that the predictors implementing the technologies developed in refs. 15,21 are almost 100% successful for mitigation, the outcomes of the proposed strategy look quite promising. Indeed more than 50% of the disruptions could be avoided and a quarter prevented. It should also be emphasised that, in almost all the safe discharges, in which unnecessary mitigations would have been triggered, the alarms are raised after the intervention of JET control system and therefore these plasmas do not disrupt only because termination actions had already been undertaken. All things considered, therefore the obtained results would be compatible with ITER requirements. It is also worth noting that about 85% of the first warnings, triggered by the proposed detection strategy, precede any action of JET control systems (the Real Time Central Controller RTCC and the Plasma Event TRiggering of Alarms PETRA26,27) and are therefore reaction to the natural evolution of the plasma (a detailed comparison of the proposed tools’ performances and the interventions of JET control system is the subject of section ‘Methods’). Some examples of JET discharges, proving the viability of the proposed strategy, are reported in section ‘Methods’ as well.

Table 4 Warning time statistics
Table 5 Control performances

It should also be mentioned that, by choosing different probability thresholds, the user can find a different trade-off between the need for mitigation and the risk of perturbing discharges that would not disrupt. The estimates of the time to the onset of a MHD macroscopic instabilities could also allow further optimisation of the control strategies. The quality of such estimates, obtained with a dedicated neural network, are described in section ‘Methods’, from which it can be concluded that the accurate measurement of the radiation losses could help significantly in deciding the best actions to take particularly for avoidance. It is worth mentioning that information about the time to the disruption has not been used in the logic of the controller because this is an aspect, whose transfer from one device to another has not been proven yet18.

Discussion

Understanding and predicting the sequence of macroscopic anomalies leading to disruptions will be essential elements of any realistic strategies of proximity control and avoidance in the next generation tokamaks. The presented work shows that, to achieve these tasks, sufficiently resolved measurements of the magnetic configuration, kinetic quantities and radiation emission are essential. The derived indicators have to be physics based but at the same time sufficiently robust and informative about the future evolution of the plasma, to constitute good inputs to the control system. The probability of disruption allows optimising the remedial strategies and fine tuning them depending on the specific needs of the experiments. The estimates of the time remaining to the beginning of the current quench constitute another important piece of information for optimising the control system interventions.

From a diagnostic perspective, the spatially involved nature of the various paths to collapse implies that the tokamak, even if not spatially complex as the stellarator, requires at least 2D measurements to be fully understood and controlled, not an easy proposition for the reactor. However, better diagnostic capability of the emitted radiation would provide essential advantages in terms of disruption prevention and avoidance. Bolometry and visible imaging, if implemented with the appropriate time and spatial resolution, can indeed provide significantly earlier warning that the discharge is drifting toward dangerous operational conditions. Careful detection of the kinetic profiles main features will also be essential to optimise the remedial strategies. Indeed in the reactor false alarms will have very undesirable consequences as well, because they might interrupt the production of electricity in critical moments.

It is also worth emphasising that the indicators devised do not show any significant dependence from the isotopic composition. This is a very important aspect, because it can potentially lead to feedback strategies, which are not too dependent on a plasma quantity, the fuel mixture, which is very delicate to control. Since the tools developed in this work are all adaptive and real-time compatible, they constitute a quite encouraging package. Indeed, they have managed to follow the evolution of the experimental programme in probably the most ambitious and varied set of campaigns ever carried out on JET. Moreover, given the fact that the indicators tested are based on normalised quantities or ratios, they are expected to be easily transferrable to other devices. Indeed, the implementation of some of the proposed tools on ASDEX Upgrade (the second largest metallic device in Europe), the second largest metallic tokamak in Europe, has already started and the preliminary indications are very positive.

The proposed control logic, implemented in completely real-time compatible conditions, results in no missed alarms, 65% of avoided and prevented disruptions and almost no wrong actions. Consequently, the developed tools, which work equally well with all reactor-relevant hydrogen fuel mixtures, are expected to satisfy ITER requirements, which will have better actuators to implement any remedial action. On the other hand, in the future, the technique will have to be tested and optimised in more reactor-relevant conditions, i.e. in experiments at high density28,29, with full detached divertors and radiated fraction of about 90%. Small ELMs regimes and negative triangularity configurations will require specific and detailed investigations as well.

From a methodological perspective, a potentially very significant improvement would consist of state aware tools, particularised for the main phases of the discharge: ramp up, flat top and ramp down of the plasma current. Indeed the plasma behaviour in these different phases is not exactly the same and the performance of specific predictors could be significantly better than those of the general ones developed so far. Such a step would require implementing trajectory learning solutions, i.e. techniques that can take into account the history of the discharge and that do not consider only individual time slices of the data15,16,30,31.

Methods

Brief history of machine learning-based disruption predictors in tokamaks

Reliable prediction is an essential ingredient of any strategy to overcome the problem posed by disruptions. Unfortunately, there are no first principle plasma models capable of predicting the occurrence of disruptions even offline, let alone in the short times required for real time applications. The international community, recognising the importance of developing reliable predictors, has promoted the development of data-driven empirical models since some time. The simple ones, devised manually, unfortunately have provided very disappointing performances particularly on JET with a metallic wall20. Consequently, given also the huge amounts of data collected in modern devices, data mining techniques have become increasingly popular in the last decades. These methodologies will become even more crucial in the future since, for example, ITER is expected to produce 50 Gbytes of data per second (2 Petabytes per day), an amount of information impossible to process with traditional, human-centred techniques32.

Disruption prediction is usually conceptualised as a binary classification problem. The machine learning tools are required to divide the operational space into two regions, the disruptive and the safe one. Various forms of training have been tested, from traditional supervised to adaptive, including even reinforcement learning strategies33. The derived models of the boundary are then to be deployed in real time during the discharges with a typical time resolution of the order of milliseconds.

The signals to be processed are time series, consisting of sequences of data points indexed in time. The choice of the features to be provided as inputs to the predictors are typically identified manually by the experts and require various forms of pre-processing. All the main real-time signal processing techniques available both in the time domain34,35,36,37,38,39,40,41,42,43,44 and in the frequency domain45 have been implemented. Approaches based on mixture of time and frequency domains, such as wavelet transforms, have not been neglected either46.

So far, all the main families of existing real-time compatible classifier technologies have been explored, including support vector machines, artificial neural networks, generative topographic mapping, fuzzy logic and deep learning. They have also been applied to the data of many tokamaks of various generations: ADITYA (India)47, ASDEX Upgrade (Germany)48, DIII-D (US)49,50,51, J-TEXT (China)52, NSTX (US)53, ALCATOR C-MOD (US)54, JT-60U (Japan)55, EAST (China)56,57,58, HL-2A (China)59 and JET (UK)7. Up to now only three machine-learning-based predictors have been implemented in JET’s real-time network, APODIS60, SPAD61, and the centroid-based method21.

The requirements of diagnostics and data analysis tools

In general, the diagnostics for disruption prediction have to provide more stringent performances than the measurements for the understanding of the physics. Certainly the RAMI (Reliability, Availability, Maintainability, Inspectability) risk control requirements are much more severe, because the needed measurements have to be always available in practically all phases of the experiments62. Spatial and time resolutions have also to be carefully considered, since the causes of disruptions are multiple, some quite local and evolving on fast time scales. On top of that, depending on their objectives (mitigation, prevention or avoidance), the various predictors have to rely on different signals. In particular, the measurements for proximity control, for assessing how close to the disruption boundary the plasma state is, have to provide sufficient warning times. For mitigation, the premium of course is on accuracy, since non-mitigated disruptions are particularly bad and probably cannot be tolerated in devices of the size of DEMO12.

Whatever the source of information, the adopted metrics to analyse the experimental signals for disruption prediction should present the following desirable properties:

  1. 1.

    Sensitive, in the sense of being capable of detecting the anomalies at an early stage.

  2. 2.

    Specific, which means triggering a very small number of false detections.

  3. 3.

    Deployable in real-time.

  4. 4.

    Easily portable from one tokamak to another.

All the diagnostics and derived quantities proposed in the present work satisfy these criteria quite well, as discussed in detail in the following subsections. They are also expected to be available in DEMO and the reactor. The order follows the time proximity to the beginning of the current quench: mitigation, prevention and then avoidance.

Diagnostics of the magnetic configuration

Following electrical engineering standards, the internal inductance is based on the magnetic energy W stored in the poloidal field in the region enclosed by the plasma boundary. Its normalised version, used for ITER design, is defined as \(\,{l}_{{{{{{\rm{i}}}}}}}=\frac{2V < {B}_{{{{{{\rm{p}}}}}}}^{2} > }{{\mu }_{0}^{2}{I}^{2}{R}_{0}}\) where V is the plasma volume, R0 is the major radius of the magnetic axis, Bp the poloidal component of the magnetic field, <> indicate volume average, I is the plasma current and μ0 is the vacuum magnetic permeability.

The safety factor essentially measures the "windiness" of the magnetic field at a certain radius and in general can be conceived as its pitch: q = dϕ/ where ϕ is the toroidal angle and θ the poloidal one (see Fig. 1a). In practice it is typically expressed in terms of the fields as q = rBϕ/RBθ where r is the minor radius, R the major radius, Bϕ and Bθ are the toroidal and poloidal component of the magnetic field respectively. The indicator q95 is the value of the safety factor at 95% of the plasma radius, which has proved to be a very good indicator of the plasma stability.

As mentioned, the locked mode amplitude is the most important signal for mitigation on JET7. The relationship between li and the locked mode was investigated in ref. 20. Recently the slowing down of the large electromagnetic modes, preceding the disruption, has been detected using this signal63. On the other hand, the anomaly in the locked mode amplitude typically manifests itself too late for prevention and avoidance and therefore this signal is useful only for mitigation. Indeed, macroscopic alterations to the current profile and the destabilisation of macroscopic electromagnetic instabilities are typically the last stage of the pre-disruptive plasma evolution.

Diagnostics of the kinetic profiles

A literature survey has been performed to investigate the performances of the available kinetic profile indicators for both anomalous behaviours: the hollowing of the profile in the core and the cooling of the edge. With regard to the core hollowness, all the most widely used criteria rely either on the ratios of the temperatures in different regions of the plasma (the “core vs all” peaking factor64 or the core-middle-edge average temperature ratios14,65), or on the combination of cumulative profiles obtained weighting differently the core and the edge66 An innovative indicator, called Gaussian Fitted Hollowness (GFH), has been recently devised, in the framework of the present work22. The approach consists of fitting the electron temperature profile with a bimodal Gaussian. Indeed, healthy, safe electron temperature profiles are unimodal, i.e. present a peak only at or near the plasma centre, whereas hollow profiles are bimodal (see Supplementary Fig. 1). Consequently, detecting and quantifying bimodality is an alternative way to determine the degree of hollowness. The developed indicator relies on the Bhattacharya distance (DB)67 which was originally devised to quantify the distance between two Gaussian distributions and is defined as:

$${D}_{B}=\frac{1}{4}\log \left(\frac{1}{4}\left(\frac{{\sigma }_{1}^{2}}{{\sigma }_{2}^{2}}+\frac{{\sigma }_{2}^{2}}{{\sigma }_{1}^{2}}+2\right)\right)+\frac{1}{4}\left(\frac{{\left({\mu }_{1}-{\mu }_{2}\right)}^{2}}{{\sigma }_{1}^{2}+{\sigma }_{2}^{2}}\right)$$
(2)

Where μi are the centres and σi the standard deviations of the Gaussians.

Given the symmetries imposed by the topology of present day and future devices, it has proved sufficient to fit the profile with a symmetric bimodal Gaussian function (\({A}_{1}={A}_{2}=A,\,{\mu }_{1}=-{\mu }_{2},\,{\sigma }_{1}={\sigma }_{2}\)). Particularised for this case, the Bhattacharyya distance becomes \({D}_{B}=\frac{{\mu }^{2}}{2{\sigma }^{2}}\) and therefore the GFH has been defined as:

$${GFH}=\frac{\mu }{\sigma }=\sqrt{2{D}_{B}}$$
(3)

The GFH indicator is therefore the distance, between the peak and the valley of the bimodal distribution, divided by the standard deviation of the single Gaussians (see Supplementary Fig. 1). A comparison of the performance of the proposed indicator and the most widely ones used in the community is reported in the Supplementary Fig. 2. These results have been obtained with a series of numerical tests and confirmed by the analysis of a comprehensive set of JET discharges22. The superiority of the proposed GFH indicator emerges quite clearly from all the relevant metrics considered.

Criteria for the edge cooling are much less developed than those for the hollowness. In the literature12 it is reported that on JET the edge cooling indicator traditionally used relies on the average temperature in the middle region divided by the average temperature in the external region. Since its performances are not satisfactory, a series of alternatives has been explored. The most performing indicator found computes the cumulative distribution function (CDF), normalised to its maximum. On the basis of the CDF, it is possible to calculate the plasma radius (ρ98) at which the CDF reaches the value of 98%:

$$\begin{array}{c}{CD}{F}_{T}\left(r\right)={\int }_{-a}^{r}{T}_{e,{norm}}{dr}\to \\ \to {\int }_{-a}^{{\rho }_{98}}{T}_{e,{norm}}{dr}=0.98\end{array}$$
(4)

Since this radius shrinks with the plasma cooling down, the Cumulative Based Cooling (CBC) parameter \({CBC}=1/{\rho }_{98}\) is calculated, to obtain a quantity increasing with the edge cooling for coherence with the literature. The performances of the proposed indicator are compared with the most widely used alternatives in Supplementary Table 1. Again this index outperforms quite systematically all the indicators reported in the literature22.

The density profile is much more resilient to perturbations than the temperature one. Incipient anomalies in the density at the edge are typically detected much earlier and more reliably by measurements of the radiation (for example MARFEs, see next subsection). The core density also tends to react more slowly than the temperature and becomes hollow less frequently. Density profile indicators are therefore less useful for both proximity control and disruption prediction. However, to preserve the pressure, the hollowing of the temperature is often accompanied by a peaking of the density profile. A reliable density peaking factor can therefore be a useful complement to the temperature profile indicators just described. In this perspective, given the basic consistency of the density profiles, a ratio based on the average temperature within 0.3 and within 0.8 of the normalised radius has proved to be more than adequate:

$${N}_{{peaking}}(t)=\frac{\frac{1}{0.3}{\int }_{0}^{0.3}{n}_{e}\left(r,t\right){dr}}{\frac{1}{0.8}{\int }_{0}^{0.8}{n}_{e}\left(r,t\right){dr}}-1$$
(5)

With regard to the computational times, by far the most demanding indicator is GHF. Even this one though requires of the order of 1 ms to be calculated on a lap top computer with a Matlab routine. Consequently, all the developed profile indexes are fully compatible with any realistic real-time application.

Diagnostics of the radiation emission

The next generation of devices will have to operate at radiated fractions of about 90% and detached divertors. Routinely available estimates of the radiation emission and its accuracy will therefore be essential to control these plasmas and ensure safe operation. At the edge, early detection of MARFEs onset is particularly relevant. The main idea behind the proposed method relies on the already mentioned observation that MARFE instabilities typically start developing in the divertor region or just above it (X-point radiator)68. In a safe shot, the centroid of the visible radiation would remain close to the divertor throughout the entire shot. On the contrary, in disruptive discharges the blob of high radiation typically moves up and down along the wall on the high field side. Consequently, to detect the onset of a MARFE, the coordinates of the emission centroid are evaluated and compared with the ones of the previously processed frame. The developed algorithm acts on individual frames and converts them to a grey-scale image. After thresholding, the resulting binary image contains the brightest zones of the original frame. On JET, when the centroid of the high emitting region moves vertically more than 20 pixels between two frames (corresponding to about 15 cm in physical space), a MARFE instability has typically started to develop68.

A database of JET videos has been built, to evaluate the performances of the proposed MARFE detection algorithm. A total of 44 shots, 28 disruptive and 16 safe, have been carefully selected from the high power deuterium, hydrogen and full tritium campaigns (C39 and C40). The discharges have been chosen to cover a wide range of experimental conditions, to prove the general applicability of the algorithm. For these two campaigns, videos from the wide angle operational visible camera have been analysed. For each video, the presence or absence of a MARFE has been evaluated by an expert. With the aforementioned threshold, the algorithm manages to identify all the MARFEs in the database correctly, without any false positive or false negative68. Also in this case, the processing times are of the order of one ms by MATLAB routines, therefore much shorter than the camera frame rate and not problematic to implement in real time.

Even if the visible cameras can allow following quite well the movements of MARFEs, the determination of the actual power emitted requires bolometric measurements. For the purposes of control, an estimate of the uncertainties in the reconstructed emissivity is also extremely relevant. The only tomographic inversion method that can provide this information routinely is based on the Maximum Likelihood (ML). The implementation of the ML algorithm with computerized tomography is well-documented in the literature69. The technique was originally based on the assumption that both each of the “n” pixel of the emissivity \({f}_{{{{{{\rm{n}}}}}}}\) and the line integrated measurements \({g}_{{{{{{\rm{m}}}}}}}\) follow poissonian statistics. It has been demonstrated that this hypothesis can be relaxed and the method can be extended to measurements obeying Gaussian distributions70. The conditional probability of detecting \({{{{{\bf{g}}}}}}\) measurements from a two-dimensional emissivity \({{{{{\bf{f}}}}}}\), can therefore be written as the likelihood of a poissonian pdf:

$$L\left({{{{{\bf{g}}}}}},|,{{{{{\bf{f}}}}}}\right)=\mathop{\prod}\limits_{m}\frac{1}{{g}_{m}!}{\left(\overline{{g}_{m}}\right)}^{{g}_{m}}\times \exp \left(-\overline{{g}_{m}}\right)$$
(6)

In Eq. (6), \(\overline{{g}_{m}}=E\left\{{g}_{m}|{{{{{\boldsymbol{f}}}}}}\right\}\) is the conditional expectation of \({g}_{m}\) events collected by line of sight m, given \({{{{{\boldsymbol{f}}}}}}\), the emissivity profile. In practice, the ML algorithm is implemented with an iterative formula, derived from a specific version of the Expectation Maximization algorithm, to converge on the final estimate \({{{{{{\bf{f}}}}}}}_{{{{{{\bf{ML}}}}}}}^{{{{{{{\boldsymbol{(}}}}}}{{{{{\bf{k}}}}}}}^{{{{{{\boldsymbol{*}}}}}}}{{{{{\boldsymbol{)}}}}}}}\) of \({{{{{\bf{f}}}}}}\). Using the same notation as in ref. 69, in terms of the sensitivity \({s}_{n}=\mathop{\sum}\limits_{m}{H}_{{mn}}\), the following equation holds:

$$\overline{{g}_{m}}={H}_{{mn}}{f}^{n}$$
(7)

Where the matrix H, describing the contribution of each pixel to each detector, is obtained as usual from the layout of the bolometer lines of sight and their etendues.

The iterative formula, to solve the inversion problem by updating the 2D profile until a convergence criterion is satisfied, can be written as:

$${f}_{n}^{\left(k+1\right)}=\frac{{f}_{n}^{\left(k\right)}}{{s}_{n}}\left({g}_{m}/{H}_{{mj}}{f}^{j(k)}\,\right){H}_{n}^{m}$$
(8)

The initial guess can be either uniform or a specific distribution. The former solution is more general and computationally faster but the latter approach has demonstrated to reduce drastically the occurrence of artefacts71.

The ML approach has the competitive advantage of computing also the covariance matrix \({{{{{{\bf{K}}}}}}}_{{{{{{\bf{ML}}}}}}}^{({{{{{{\rm{k}}}}}}}^{*})}\) and therefore, for each 2D emissivity distribution, an estimate of the uncertainty associated to each pixel can be provided routinely, without making recourse to delicate and time-consuming Monte Carlo techniques. All the details can be found in ref. 69. It should be noted that the capability of the ML to provide confidence intervals in the solutions is due also to the fact that the algorithm does not include any mathematical regularization. The only imposed constraint, common to all the tomographic inversion techniques implemented on JET, consists of smoothing the reconstructed tomograms along the magnetic surfaces. Examples of reconstructions are reported in Fig. 2. It should be also emphasised that, with adequate specific refinements, the ML algorithm can be modified to take into account the most important sources of errors on the measurements, such as outliers, faulty or missing detectors and uncertainties in the estimates of the magnetic topology72,73.

Notwithstanding its competitive advantages, the ML tomography shares with the other inversion methods an important drawback; its computational times are not compatible with real-time applications. Completing the calculations for a single time slice typically requires several seconds, a time span far too long for the task of predicting the occurrence of disruptions. Acceleration techniques are under investigation but the deployment of the ML tomography in feedback remains far in the future74. The ML tomography algorithms are therefore utilised in the present work only as a benchmark.

For real-time deployment, therefore, a simplified algorithm has been developed. The main idea consists of trading spatial resolution for speed. To this end, the lines of sights of the two bolometric cameras have been divided in three macro-views each (see Supplementary Fig. 3). Their intersection results in 8 macro-pixels, which cover the entire plasma cross section and have enough spatial resolution to allow identifying all the major radiation anomalies detected on JET. To obtain the local emissivity one has to invert the following systems of equations:

$${{{{{{\rm{P}}}}}}}_{{{{{{{\rm{H}}}}}}}_{1}}={{{{{{\rm{R}}}}}}}_{{{{{{\rm{Div}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{Div}}}}}},{{{{{{\rm{H}}}}}}}_{1}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{LFB}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{LFB}}}}}},{{{{{{\rm{H}}}}}}}_{1}}$$
$${{{{{{\rm{P}}}}}}}_{{{{{{{\rm{H}}}}}}}_{2}}={{{{{{\rm{R}}}}}}}_{{{{{{\rm{HFL}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{HFL}}}}}},{{{{{{\rm{H}}}}}}}_{2}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{Core}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{Core}}}}}},{{{{{{\rm{H}}}}}}}_{2}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{LFR}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{LFR}}}}}},{{{{{{\rm{H}}}}}}}_{2}}$$
$${{{{{{\rm{P}}}}}}}_{{{{{{{\rm{H}}}}}}}_{3}}={{{{{{\rm{R}}}}}}}_{{{{{{\rm{HFT}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{HFT}}}}}},{{{{{{\rm{H}}}}}}}_{3}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{Top}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{Top}}}}}},{{{{{{\rm{H}}}}}}}_{3}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{LFT}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{LFT}}}}}},{{{{{{\rm{H}}}}}}}_{3}}$$
$${{{{{{\rm{P}}}}}}}_{{{{{{{\rm{V}}}}}}}_{1}}={{{{{{\rm{R}}}}}}}_{{{{{{\rm{LFB}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{LFB}}}}}},{{{{{{\rm{V}}}}}}}_{1}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{LFR}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{LFR}}}}}},{{{{{{\rm{V}}}}}}}_{1}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{LFT}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{LFT}}}}}},{{{{{{\rm{V}}}}}}}_{1}}$$
$${{{{{{\rm{P}}}}}}}_{{{{{{{\rm{V}}}}}}}_{2}}={{{{{{\rm{R}}}}}}}_{{{{{{\rm{Div}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{Div}}}}}},{{{{{{\rm{V}}}}}}}_{2}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{Core}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{Core}}}}}},{{{{{{\rm{V}}}}}}}_{2}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{Top}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{Top}}}}}},{{{{{{\rm{V}}}}}}}_{2}}$$
$${{{{{{\rm{P}}}}}}}_{{{{{{{\rm{V}}}}}}}_{3}}={{{{{{\rm{R}}}}}}}_{{{{{{\rm{HFT}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{HFT}}}}}},{{{{{{\rm{V}}}}}}}_{3}}+{{{{{{\rm{R}}}}}}}_{{{{{{\rm{HFL}}}}}}}{{{{{{\rm{F}}}}}}}_{{{{{{\rm{HFL}}}}}},{{{{{{\rm{V}}}}}}}_{3}}$$

where the subscripts indicate the macro-pixels depicted in Supplementary Fig. 3 (HFL = high filed low; HFT = high field top; LFR = low field right; LFT = low field top; LFB = low field bottom; Cor = Core; Top = Top; Div = Divertor). The systems consists of 6 equations with 8 unknowns, which can be complemented with 8 weak constraints, by imposing that the emissivities are non-negative. The inversion of this set of equations has been performed with a non-negative least square minimisation method, as reported in ref. 75. The inversion software has proved to always converge and the obtained emissivity of the 8 macro-pixels are typically within ±20% of what would be obtained with the more sophisticated ML method. The results are always provided in less than 50 μs. Consequently, the fast tomographic approach just described has the accuracy and spatial resolution to identify all the major radiation anomalies affecting JET plasmas and its computational times are more than compatible with deployment in feedback. The 8 macro-pixels of Supplementary Fig. 3 are combined to obtain the four main regions depicted in Fig. 3.

The estimate of the macro-pixels’ internal energy

To apply the model formulated in Eq. (1), the internal energy of each macro-pixel must be determined with sufficient accuracy. The approach adopted, to obtain the results reported in the present work, is described in this section.

The plasma thermal energy per unit volume can be written as:

$$u=\frac{{p}_{i}+{p}_{e}}{\gamma -1}=\frac{{n}_{i}{T}_{i}+{n}_{e}{T}_{e}}{\gamma -1}$$
(9)

Where the subscript e indicates the electrons and i the ions. Assuming Te = Ti = T and deuterium fully ionized plasmas (ne = ni = n e γ = 5/3), one obtains:

$$u=3{nT}$$
(10)

The energy inside a certain volume V can then be calculated as:

$${E}_{V}={\int }_{V}3{nTdV}$$
(11)

To determine the plasma energy in a given region, one can therefore derive the magnetic topology from an equilibrium code and the temperature and density profiles from the Thomson scattering. Under the usual assumption that the magnetic surfaces are isobars, it is possible to calculate the temperature, density and pressure fields as shown in the example reported in Supplementary Fig. 4. From these maps, the energy in the regions of interest can be approximated with discrete integrals of the form:

$${E}_{k}={\int }_{{V}_{k}}3{nTdV}=6\pi \sum \sum 2{n}_{e,i,j}{T}_{e,i,j}{R}_{i,j}{dRdZ}$$
(12)

Where \({n}_{e,i,j}\) and \({T}_{e,i,j}\) are the density and temperature of the pixel, whose barycentre has the coordinates (i, j). dR e dZ are the dimensions along R and Z and Ri,j is the major radius of the corresponding pixel barycentre.

Unfortunately on JET there is no equilibrium real-time reconstruction code routinely available. A fall-back solution consists of fitting the HRTS profiles in the region from R = 3 to R = 3.9 m with a second-order polynomial. For new discharges, the energy in each macro-pixel is then determined by averaging the HRTS profiles in its volume. Supplementary Table 2 reports an estimate of the errors in the macro-pixels’ energy committed by adopting this approach. It is worth pointing out that this choice keeps the number of diagnostics required the entire methodology to a minimum since the HRTS is also the system used for the detection of hollowness and edge cooling.

The adaptive estimates of the probability and time to anomaly

In the present work, the probabilities of the various anomalies are obtained with basically the same mathematical procedure. The amplitude difference of the relevant signals between disruptive and safe examples are fitted with a sigmoid function, to obtain an output between 0 and 1. The fits are then updated with adaptive procedures, implemented with specific neural networks as described in the following. The delicate aspect is the determination of the thresholds, above which alarms are to be raised.

In the case of the locked mode, the approach of ref. 20 has been followed. The critical value of the dimensionless Locked Mode signal (the locked mode amplitude divided by the plasma current LMN) is linked to the internal inductance (li) by the equation:

$$L{M}_{N,{threshold}}=a{l}_{i}^{b}$$
(13)

The sigmoid function to determine the probability of the plasma disrupting is:

$${p}_{{LM}}={e}^{{d}_{1{LM}}\left(L{M}_{N}-L{M}_{N,{threshold}}\right)+{d}_{2{LM}}}/(1+{e}^{{d}_{1{LM}}\left(L{M}_{N}-L{M}_{N,{threshold}}\right)+{d}_{2{LM}}})$$
(14)

At the beginning of a new tokamak experimental campaign, no data is available and the therefore the algorithm starts with the values reported in ref. 20. Equation (14) is then updated with the incoming data with a dedicated neural network, using the cross entropy as loss function.

In the case of the temperature hollowness, the following treatment is implemented. The probability of the temperature profile becoming hollow is determined by the sigmoid:

$${p}_{{ETH}}={e}^{{d}_{1{ETH}}\left({ETH}-{ET}{H}_{{threshold}}\right)+{d}_{2{ETH}}}/(1+{e}^{{d}_{1{ETH}}\left({ETH}-{ET}{H}_{{threshold}}\right)+{d}_{2{ETH}}})$$
(15)

Since the indicator is a form factor (and not an absolute quantity), the numerical values of the ETH threshold and the other parameters in (15) are derived directly from ref. 20. With the evolution of the campaign, the sigmoid function is then updated with a dedicated neural network, using the cross entropy as loss function.

As already mentioned, the edge cooling (EC) is detected using the cumulative distribution function (CDF) of the normalised electron temperature profile and by calculating a “edge radius” ρ98 as the radius containing the 98% of the CDF. Again, by using a sigmoid function, the probability to have an EC is computed:

$${p}_{{EC}}={e}^{{d}_{1{EC}}\left({EC}-{{EC}}_{{threshold}}\right)+{d}_{2{EC}}}/(1+{e}^{{d}_{1{EC}}\left({EC}-{{EC}}_{{threshold}}\right)+{d}_{2{EC}}})$$
(16)

The first values of the coefficients d1 and d2 have been derived from the reference paper22. The sigmoid function is then updated along the campaign with a dedicated neural network, using the cross entropy as loss function.

In the case of radiation anomalies, a typical classification algorithm would not perform well because any automatic adaptive training set would have a couple of weaknesses. First it would be highly unbalanced, since for most time slices the plasma radiation is not anomalous. Secondly the safe set would unavoidably contain very misleading examples of anomalous patterns classified as safe (due for example to interventions of the control system). An effective way to counteract these problems consists of calculating the probability density function (pdf) of the various cooling factors for both safe and disruptive discharges. So, for each region, the pdfs of “safe” and “(potentially) anomalous” Λ are derived. At higher values of Λ the two pdfs diverge, because the one of the anomalous patterns becomes larger at larger Λ. An example for the core radiation is shown in the top plot of Supplementary Fig. 5. Consequently the cumulative density functions (CDF), integrals of the pdfs, tend to separate significantly as shown in the bottom plot of Supplementary Fig. 5. The true positive percentage (or sensitivity) trend is calculated as one minus the anomalous CDF, while the false alarm percentage (or 1 – specificity) is one minus the safe CDF. The results of the present work have been obtained with the following rules for determining the Λ thresholds:

  1. 1.

    Search for the threshold that ensure false alarms minor than 0.05% and a true positive larger than false alarms.

  2. 2.

    If no thresholds satisfy the previous rule, the false alarm limit is increased to 0.1%.

  3. 3.

    If no thresholds satisfy the previous rules, the false alarm limit is increased to 1%.

Being based on the CDFs, these threshold are more robust against misclassifications in the training set. Once identified the thresholds, again the probability of a local radiation anomaly is calculated with a sigmoid function:

$${p}_{\Lambda }=={e}^{{d}_{1\Lambda }\left(\Lambda -{\Lambda }_{{threshold}}\right)+{d}_{2\Lambda }}\big/\left(1+{e}^{{d}_{1\Lambda }\left(\Lambda -{\Lambda }_{{threshold}}\right)+{d}_{2\Lambda }}\right)$$
(17)

Note that a Λthreshold is found for each macro region and an alarm is raised if one of the pΛ exceeds 0.5.

The just described classifiers are able to detect anomalies and label them with reference to the macro-pixels illustrated in Fig. 3. This is of course very valuable information. However, in order to optimise the remedial strategy, the control system would need also an estimate of the time available to undertake a certain action. To this end, three more predictors have been developed to estimate the time to mode locking, hollowness, and edge cooling (tr,LM, tr,ETH and tr,EC). This aspect is addressed as a supervised regression problem. For each event to forecast, a predictor in the form of a feed-forward neural network is used. The architecture implemented consists of three hidden layers with 20, 10 and 5 neurons respectively. The inputs are: the magnetic toroidal field (Bt), the plasma current (Ip), the dimensionless Locked Mode (LMN), the internal inductance (li), the electron temperature and density in the core, middle and edge regions, the electron temperature profile anomaly indicators (ETH and EC), the Λi in the four regions (Core, HF, LF and Div) and the Λheating. The outputs, i.e. the times to the anomaly, are predicted in the range from 1 ms to 2 s (2 s is considered the time horizon for reliably predicting the earliest events). The loss function is the mean square error of the differences between the predictions and the actual occurring times of the anomalies, weighting more small times to compensate the fact that at small times there are less data (for example, from 1 ms to 10 ms there are 10 points per pulse, while from 100 ms to 1 s there are 900 points). The implemented loss function can therefore be written as:

$${{loss}}_{W,{MSE},j}=\frac{\sum {W}_{i}{\left({\log }_{10}{t}_{r,j,i}-{\log }_{10}{y}_{r,j,i}\right)}^{2}}{\sum {W}_{i}}$$
(18)

Where:

$${W}_{i}=\frac{1}{{y}_{r,j,i}}$$
(19)

While \({t}_{r,j,{i}}\) and \({y}_{r,j,i}\) are the predicted and the target time to anomaly j of the i-th observation in region r. An example for the prediction quality that can be achieved with this approach is shown in Supplementary Fig. 6.

JET tools for radiation control and examples proving the added value of the proposed strategy

On JET with the metallic wall, the influx of high Z impurities and the consequent radiation emission have proved to be fundamental aspects influencing plasma stability and performances. The most harmful impurities are typically W sputtered by the divertor, Ni and copper, whose source are the neutral beam duct scrapers, and Ni coming from the ICRH antennas27. To reduce the influxes of these metal atoms, it is necessary to carefully control the plasma edge parameters, by fine tuning the density, the temperature and the ELM behaviour. The main actuators available on JET for this purpose are gas injection, the pellets of frozen hydrogen isotopes and vertical kicks (rapid movements of the plasma vertical position obtained by changing the radial magnetic field)27. Unfortunately, vertical kicks are not compatible with high current because of the risk of vertical displacement events. In its turn, the level of gas injection required to control the ELMs is typically so high as to compromise good confinement. The best strategy devised is therefore a suitable combination of gas fuelling and pacing pellets23. However, the fine tuning of these actuator has proved quite delicate, particularly because it is not straightforward to transfer the recipes optimised for deuterium to the other isotopic composition (full tritium and DT). Increasing the plasma mass indeed tends to results in slower ELMs dynamics with longer ELM-free periods, which can result in stronger penetration of the impurities. This problem is compounded by the different power deposition of the T beams, more peaked toward the edge, and the different behaviour of the tritium gas injection modules23. However, the indicators, tools and techniques developed in the present work are equally effective with all isotopic compositions. This fact proves their generality and is quite encouraging in view of their application to the next generation of devices.

For mitigation purposes, the main signal used by JET control system is the amplitude of the locked mode. As already discussed, to trigger a control plasma termination, excessive radiation is typically the earliest precursors. The radiation emission is therefore monitored by JET both real-time control systems: the Real Time Central Controller (RTCC) and Plasma Event TRiggering for Alarm (PETRA)27. RTCC relies on two main indicators related to the radiation emission: the radiation fraction (the total emission measured by the bolometers divided by the input power) and various peaking factors (the ratio of bolometric central and peripheral chords)23. In PETRA a convolutional neural network, trained with JET traditional tomographic inversion method, is deployed to monitor the radiation in two macro-regions in the centre and the edge23. All these systems allowed carrying out the DTE2 campaign quite effectively but provided performances, which are clearly insufficient in the perspective of ITER and DEMO, as documents by the statistics reported in Table 1.

All these JET metrics are clearly outperformed by the indicators developed in the present work. On the basis of the improved indicators and predictions JET control system would be provided with much better information. Supplementary Table 3 reports a comparison of the alarms detected by the indicators developed in the present work and the actions taken from the JET system. A set of 286 discharges has been analysed, in which the actions undertaken by RTCC and PETRA are clear and well-documented. Inspection of the top parts of the table reveals that, in JET safe discharges, when JET control system does not intervene also the proposed tools do not launch an alarm. However, the developed predictors would intervene in the disruptive discharges not mitigated by JET, showing the capability not to miss practically any disruption. In case of successful actions undertaken by RTCC and PETRA, the warning times provided by the indicators developed in the present work typically are much longer (see Supplementary Table 4). They would have therefore allowed implementing avoidance strategies in a good percentage of cases and better prevention and mitigation actions almost always.

The feedback schemes following the logic in the present work have not been implemented systematically on JET yet but there is ample evidence that they could be effective and results in significant improvements of JET performances in terms of disruption handling. Some representative case are reported in the following.

One example of recovered radiation anomaly in the core is shown in Supplementary Fig. 7. A minor core radiation/hollowness anomaly is observed at t ~ 9.5 s, which recovers probably due to high input power that avoids a critical electron temperature profile, giving the plasma enough energy to expel the impurities. A second most intense core radiation is observed from t = 10.8 s (Λcore > 1). This excessive emission leads to the fast cooling of the plasma and the hollowing of the electron temperature profile. However, thanks to the increase of the gas rate a t = 11 s, the plasma transits from H to L mode, ensuring a larger impurity transport from the core to the edge. This, together with enough input power to reheat the core, allows recovering a centre peaked temperature profile, avoiding the triggering of macroscopic MHD instabilities. The probabilistic maps of the reporting the level of hollowness and edge cooling vs the λ indicators show that the cause of the temperature anomaly is excessive radiation in the core (see Supplementary Fig. 8).

An interesting example of anomaly in the edge radiation is reported in Supplementary Fig. 9. In this case, JET control system does not undertake any remedial action. The developed indicators detect a MARFE at t = 15.973 s. An edge cooling alarm is triggered at t = 16.083 s and a locked mode is detected at t = 16.187 s. The MARFE is clearly seen also in the frames of the visible cameras, as shown in Supplementary Fig. 10. This sequence of events suggests that with adequate actuators sufficient margins would have been available to avoid this disruption. Moreover, it is not an uncommon occurrence on JET with the metallic wall that MARFEs last for much longer periods than the case of discharge 95993.