betaFeedback

WorksPhysics and Astronomy

CNN-Based Locked Mode Detection and Prospects for Prediction Utilizing Density Fluctuation Signals

Abstract

The deceleration of Magnetohydrodynamic (MHD) modes in tokamak plasmas is an observed behavior commonly associated with growing mode amplitude. As rotating MHD modes decelerate to a non-rotating state, they can form Locked Modes (LMs), which can degrade plasma confinement and cause disruptions. LMs therefore pose a serious threat to the sustained operation of otherwise-stable plasmas in Fusion Pilot Plants (FPPs). Identification of MHD modes and any subsequent locking is typically performed with an array of magnetic signals; these magnetic signals may not survive in the harsh reactor environment of an FPP and external magnetic measurements are delayed by magnetic diffusion through the tokamak shielding. This work uses the Radial Interferometer Polarimeter (RIP) as an alternative diagnostic to identify the slowing of rotating MHD modes into LMs. Because this fluctuation-based approach relies on observing prior mode rotation, detection and prediction are restricted to LMs with prior rotation and exclude born-locked modes. Labels were constructed to train a Convolutional Neural Network (CNN) to distinguish MHD modes that lock from those that may appear to approach a locking state but ultimately do not lock. The trained CNN learned to identify low-frequency, descending MHD modes but struggled to distinguish modes that would continue toward locking from those that would not. A second-stage detection method significantly improved performance, detecting 88.5% of LMs with a precision of 83.7% by applying persistence and classification-margin filters to the CNN output. These results demonstrate the capability of an FPP-relevant, non-magnetic diagnostic for accurate LM detection while also identifying fundamental limitations in the achievable prediction time using a fluctuation-based approach.

Introduction

As the fusion community works toward a Fusion Pilot Plant (FPP), the need for FPP-relevant tools grows. Many of the diagnostics used by DIII-D and other tokamaks for plasma analysis and control will not be operable in an FPP due to either limited port space or a reactor environment hostile to their function. The focus of this work is Locked Mode (LM) detection and prediction using the FPP-relevant Radial Interferometer Polarimeter (RIP) [3]. LM analysis is typically conducted with magnetic signals [18, 9]; despite their ubiquitous use in magnetic confinement fusion, these diagnostics may not survive the reactor environment and external magnetic measurements will be limited by diffusion through the tokamak shielding [22, 2]. RIP offers a way to observe rotating MHD modes through density fluctuations, and through this, a way to analyze LMs with prior rotation. This study will omit the analysis of born-locked modes, LMs that emerge from the noise floor without ever showing significant rotation. Additionally, the study will be agnostic to the poloidal and toroidal mode number, only observing the presence of MHD modes and analyzing their behavior.

It has been observed across many tokamaks that MHD modes can exhibit a reduction in frequency as they grow in amplitude; when the frequency drops to zero, or near zero, the mode is considered locked. The rotation of magnetic islands is governed by the nonlinear interactions between the island, 3D magnetic fields, plasma rotation, and the surrounding conducting wall [20, 23, 30].

Locked Modes are dangerous to the operation of a tokamak as they are known to cause disruptions and degrade confinement. Sweeney et al. [33] found that approximately 18% of disruptions at DIII-D were attributable to locked modes with rotating precursors. The physics of how LMs cause disruptions is not fully understood, but it has been proposed that LMs can cause a severe collapse in confinement that precedes and may trigger the thermal quench [32]. The disruptions caused by LMs pose a serious threat to FPPs and next-generation tokamaks; as a result, LM control and avoidance are significant control targets in their design [21, 24, 34].

Various control techniques for LMs have been developed. 3D magnetic field coils have been used to compensate for the error fields that produce resonant magnetic islands [28]. If an LM has already formed, there are techniques for unlocking it and allowing it to rotate once more to prevent disruption; this has been done with resonant magnetic perturbation techniques [17] and electrode biasing [6]. LMs that are in the process of forming can be prevented through the use of electron cyclotron current drive [7] and magnetic perturbations [36].

Applications of machine learning (ML) to LM detection and prediction have been growing in recent years [1, 27]. Prominent examples using experimental data commonly rely on magnetic signals [12, 14, 10]. The work in [12] demonstrates the use of CNNs to analyze magnetic spectrograms, similar to the use of CNNs to analyze RIP spectrograms in this work. Prediction of LM-induced disruptions is another active area of research [8].

As LMs pose a serious threat to future tokamaks, an FPP-relevant approach to their detection and prediction is needed to enable the various LM control and unlocking techniques discussed above. This work aims to provide such a method using the FPP-relevant RIP diagnostic. Observation of mode rotation in RIP-based spectrograms has enabled CNNs to be trained to identify a mode’s progression toward locking. The CNN model has been benchmarked through a 10-fold cross-validation process to strictly assess its generalizability to unseen discharges. This process divides the dataset into 10 folds, each containing chronologically contiguous discharges, with eight folds used for training, one for validation, and one for testing. Ten separate models are trained, with each fold serving as the test set exactly once. This approach enables the evaluation of model performance across different subsets of unseen discharges, providing a measure of its generalizability and variability in performance.

The Radial Interferometer Polarimeter

The Radial Interferometer Polarimeter (RIP) is a high-frequency interferometer-polarimeter diagnostic capable of simultaneously measuring line-integrated electron density and magnetic-field information in the plasma. RIP uses right- and left-handed circularly polarized electromagnetic probe waves to measure the Faraday effect, allowing the polarimetric phase to be expressed as [4]:

φFR=12(φR−φL)=2.63×10−13λ2∫neB∥ dl(1)\varphi_{FR} = \frac{1}{2}(\varphi_R - \varphi_L) = 2.63 \times10^{-13}\lambda^2 \int n_e B_{\parallel}\,\mathrm{d}l \tag*{(1)}

where φR\varphi_R and φL\varphi_L are the phase changes in radians of the right- and left-handed waves, respectively, λ\lambda is the wavelength of the probe waves, nen_e is the electron density, and B∥B_{\parallel} is the magnetic field parallel to the probe beam. The line integrated density is given by [26]:

φI=12(φR+φL)=2.82×10−15λ∫ne dl.(2)\varphi_I = \frac{1}{2}(\varphi_R + \varphi_L) = 2.82 \times10^{-15}\lambda\int n_e\,\mathrm{d}l. \tag*{(2)}

The fluctuating component of the interferometric phase therefore provides a measurement of the line-integrated electron-density fluctuation, δne\delta n_e, while the fluctuating Faraday phase provides information about magnetic-field fluctuations [26].

RIP is attractive as an FPP-relevant diagnostic because it provides non-perturbing measurements of internal plasma fluctuations using electromagnetic probe beams while allowing sensitive source and detection hardware to be located remotely from the plasma. On DIII-D, RIP consists of four radial chords (although only the one chord at the midplane was used for the models constructed in this paper, making the model insensitive to the location of the mode) and has demonstrated simultaneous measurements of density and magnetic fluctuations with high temporal resolution [5, 4]. This provides an alternative to relying exclusively on magnetic sensing coils located outside of the plasma.

RIP was chosen for this work because of its demonstrated ability to observe MHD modes and their rotation frequencies. Previous work has used RIP to detect tearing modes and track their frequency evolution, including modes detected by RIP before they become observable using external magnetic sensing coils [25]. RIP has also been developed for toroidal mode-number measurements and the observation of high-frequency MHD activity [26]. Of particular relevance to this work, both magnetic and density fluctuations measured by RIP have been shown to contain coherent signatures of tearing-mode activity, including modes that decelerate and subsequently lock [5].

Although MHD analysis with RIP has commonly used the magnetic-fluctuation measurement obtained through Faraday-effect polarimetry, this work instead uses the interferometric density-fluctuation signal. The density-fluctuation signal, measured in units of 1/m21/\mathrm{m}^{2}, exhibits a higher signal-to-noise ratio than the polarimetric magnetic-fluctuation signal while retaining clear signatures of the same coherent MHD activity [4]. Additionally, the interferometric measurement avoids the processing required to infer magnetic fluctuations from the polarimetric measurement. The resulting density-fluctuation spectrograms provide the CNN with the presence and frequency evolution of rotating MHD modes, allowing the model to identify their progression toward locking.

Training a CNN on Spectrogram Data

Label Criteria For Manual Labeling

The construction of an ML model that can detect and predict LMs required careful consideration regarding the structure of the training labels. Locking events were broken down into time periods to label the degree of danger an MHD mode presents (if one is present). Inspiration for this idea came from [14], where an unstable period of 60 ms was designated before every LM. This idea has been expanded upon to create a three-label system that follows these criteria:

  • Label 1 (No Warning): All times when an early warning or emergency warning is not warranted.

  • Label 2 (Early Warning): The MHD mode is greater than 5 kHz and shows a clear, sustained decrease in rotation frequency. Label 2 may persist below 5 kHz, but cannot originate there.

  • Label 3 (Emergency Warning): The MHD mode is less than or equal to 5 kHz, decreasing in rotation frequency, and will lock within 100 ms.

These criteria were carefully chosen so that an emergency warning is assigned only when a decreasing MHD mode is sufficiently slow and is known from the labeled data to lock within 100 ms. This choice trains the model to distinguish between low-frequency MHD modes (<5< 5 kHz) that continue toward locking and those that slow but do not lock within 100 ms. This creates an additional, intended challenge for the ML model: a slowly rotating MHD mode (<5< 5 kHz) that decreases in frequency but does not lock within 100 ms is assigned Label 1. This label assignment is intended to train the model to use all available information to recognize, if possible, the cues that distinguish near-miss slowing modes from those that will lock. As discussed in § 3, the model ultimately struggles with this distinction, suggesting that the RIP spectrogram alone may contain limited information for reliably predicting whether the mode will continue slowing.

The dataset consists of 121 shots containing 139 locked modes with prior rotation. The dataset spans approximately one year, from May 2024 through May 2025, and is limited to cases in which RIP was recording and LMs formed with prior rotation. Figure 11 in the appendix outlines the spread of relevant physics parameters across the dataset.

Figure 11. This collection of histograms outlines the dataset coverage of locked-mode-relevant physics parameters. Note that the injected torque is a time-averaged metric (averaging over the previous 50 ms).

Labels were generated through manual analysis of magnetic diagnostic signals using MODESPEC and SLCONTOUR. These tools were used to identify rotating modes that decelerated and subsequently locked, according to the criteria outlined above [31].

Substantial class imbalance must be accounted for in this ML problem, as the No Warning class (Label 1) comprises over 90% of the dataset, while the most important class, Emergency Warning (Label 3), comprises only 3.5%. To account for class imbalance during model training, a weighted cross-entropy loss function was used, with weights determined by the frequency of each class in the training set. The class weight is defined as:

wc=NKNc(3)w_c = \frac{N}{K N_c} \tag*{(3)}

where NN is the total number of data points, KK is the number of classes, and NcN_c is the number of data points in class cc. The weighting of the loss function ensures that each class has an equal aggregate weight during training. This helps prevent the model from becoming biased toward the most ubiquitous class.

Data ImbalanceLabel 1Label 2Label 3
Total Data3885823021487
Percent Data91.1%5.4%3.5%
Class Weight0.376.189.56

Table 1. The dataset consists of 139 LMs across 121 shots. This table shows the breakdown of data for each of the three labels defined above. The global class weights are included for illustrative purposes; during training, these weights are recalculated using the available training data.

10-fold Cross-Validation Training CNNs

Model training was carefully set up to provide insight into how the model will perform on unseen DIII-D discharges. A common approach in ML is to randomly shuffle data into an 80-20 train-test split; however, this approach would greatly inflate test performance and give undue confidence in the model’s performance on new experiments. This performance inflation would occur because DIII-D data are highly correlated across nearby time steps, resulting in significant temporal leakage between the training and test datasets. Additionally, data collected from shots on the same experimental day can contain similar features, introducing another potential source of leakage. This leakage problem is addressed with a 10-fold cross-validation setup [15].

The 10-fold cross-validation procedure partitions all shots into 10 folds organized chronologically. For each iteration, eight folds are used for training, one for validation, and one for testing, resulting in an 80-10-10 training-validation-test split. This ordering limits leakage caused by chronologically nearby shots with similar features appearing across the training, validation, and test sets. The validation fold is always two folds ahead of the test fold, with one training fold between them to provide additional chronological separation. Throughout this work, model selection and tuning are performed using the validation fold, while final performance is evaluated on the held-out test fold. Because no data from the test shots are included during model training or selection, these shots serve as proxies for unseen DIII-D discharges. This procedure requires training 10 separate CNNs, with aggregate test performance obtained by evaluating each model on its corresponding held-out test fold. This setup provides insight into how the trained models generalize to unseen data and new discharges.

The data are preprocessed using min-max scaling to normalize the spectral amplitudes between 0 and 1 using global min-max parameters. A Short-Time Fourier Transform (STFT) is applied to the RIP data using 5 ms windows to produce spectra at 10 ms intervals [11]. At each time step, the STFT window contains only the preceding 5 ms of data, preventing future information from leaking into the model input. The CNN input is constructed by taking the logarithm of the magnitude of the complex STFT coefficients before applying min-max normalization. Each CNN input contains 10 time slices separated by 10 ms, spanning the current time and the preceding 90 ms. The resulting CNN input has dimensions 10×12610 \times126 (time frames ×\times frequency bins), spanning 90 ms in time and 0–25 kHz in frequency with approximately 0.2 kHz frequency spacing. Higher frequencies available from RIP are truncated because they are not relevant to the MHD behavior considered in this work and would unnecessarily increase the model input size. See Figure 1 for a depiction of the spectrogram that CNN receives.

RIP spectrogram shot 198355

Figure 1. RIP provides rapidly sampled line-integrated density measurements that can be transformed into spectral data capable of observing rotating MHD modes. Spectrogram values are calculated from the logarithm of the magnitude of the complex STFT coefficients and normalized using min-max scaling. The CNN receives 10 time slices spanning 90 ms, as shown here, for shots in the training, validation, and test datasets.

The 10-fold cross-validation procedure trains 10 separate CNNs, with model selection based on maximizing the validation macro F1 score. The macro F1 score is the unweighted average of the individual F1 scores across all three classes, giving each class equal importance regardless of class imbalance. The Adam optimizer and weighted cross-entropy loss function are used for training [19]. Training is limited to a maximum of 150 epochs, with early stopping after 25 epochs without improvement in validation macro F1 to reduce overfitting and improve generalization to the test data. The model checkpoint with the highest validation macro F1 is retained for test evaluation.

The CNN architecture follows a standard structure using 3×33 \times3 convolutional kernels and alternating convolutional and pooling layers [29]. An ablation study was performed to select the best-performing architecture on the validation data while minimizing model complexity for computational efficiency. The various approaches in the ablation study attempted to capture the curves of descending MHD modes; pooling size, network depth and size, and input window length were varied. Additional preprocessing methods were also considered. Denoising using median filtering and ridge identification using Frangi filters were evaluated but failed to improve performance while increasing computational overhead [13]. The final model is displayed in Figure 2.

Figure 2. This is the final CNN architecture selected through an ablation study that maximized validation macro F1 while varying network size and depth, pooling configuration, and input window length. This architecture provided the best validation performance while maintaining minimal model complexity.

After training all 10 CNNs for the 10-fold cross-validation experiment, the results can be seen in Table 2. Parameters of the preprocessing and training are shown in Table 3.

CNN PerformanceValidationTest
Accuracy94.5±3.1%94.5 \pm3.1\%93.6±3.4%93.6 \pm3.4\%
Balanced Accuracy82.0±4.6%82.0 \pm4.6\%79.7±3.7%79.7 \pm3.7\%
Macro Precision77.5±5.4%77.5 \pm5.4\%75.1±7.6%75.1 \pm7.6\%
Macro Recall82.0±4.6%82.0 \pm4.6\%79.7±3.7%79.7 \pm3.7\%
Macro F179.4±4.8%79.4 \pm4.8\%76.5±5.1%76.5 \pm5.1\%
Label 3 Precision76.3±11.0%76.3 \pm11.0\%73.1±14.2%73.1 \pm14.2\%
Label 3 Recall82.0±6.4%82.0 \pm6.4\%77.3±6.9%77.3 \pm6.9\%
Label 3 F178.6±7.4%78.6 \pm7.4\%74.1±7.0%74.1 \pm7.0\%

Table 2. CNN performance for the validation and held-out test folds after model selection based on validation macro F1. Macro-averaged metrics are reported along with Label 3 metrics because Label 3 is the primary class of interest for LM detection and prediction. Values represent the mean and standard deviation across the 10 cross-validation folds.

Model ParametersValue
MIN0
MAX8.96
Window length90 ms
Frequency Range0–25 kHz
CNN input dimension10×12610 \times126
OptimizerAdam
Loss FunctionWeighted Cross Entropy
Learning Rate10−310^{-3}
Batch Size128
Max Epochs150
Patience25

Table 3. Min-max normalization is applied to the log-magnitude spectral data using global normalization bounds of 0 and 8.96. Values below the lower bound are clipped to exclude excessively small spectral amplitudes; no upper-bound clipping is applied. The remaining parameters describe the CNN input and neural-network training procedure.

CNN Performance and Errors

The performance of the CNN on the test data outlined in Table 2 indicates that the model struggles to consistently align with the pre-defined labels. An exploratory analysis was conducted to identify possible causes of this non-ideal performance, offering both statistical and anecdotal insight into the CNN’s behavior. This analysis also provides guidance for improving LM detection and prediction.

An error analysis was conducted by examining shots with the lowest recall (fraction of actual positives correctly identified) and lowest precision (fraction of positive predictions that are correct). Examples of a low-recall and a low-precision shot are shown in Figure 3 and Figure 4, respectively. While anecdotal, these examples provide insight into how the model interprets the data, indicating that it is sensitive to low-frequency descending modes irrespective of their future evolution. § 3 uses the behavior observed in these examples to guide the construction of a more accurate LM detection method built around the CNN output.

Low recall shot: 203273

Figure 3. This is an example of a low-recall shot. The upper plot shows the RIP spectrogram and the lower plot lists the class output of the CNN in the test fold. This plot demonstrates a limitation of using global classification statistics for an event-detection problem: the CNN is alert to the LM both before and after the true Label 3 interval despite failing to consistently align with the predefined labels. This example is particularly difficult for the CNN because the MHD mode exhibits step-like frequency evolution; without a clear negative slope, the CNN struggles to consistently identify the imminent LM. While the predictions are temporally misaligned with the true labels, nearby Label 3 predictions can still be used to detect the LM, as discussed in § 3.

Low precision shot: 200263

Figure 4. This is an example of a low-precision shot. The upper plot shows the RIP spectrogram, while the lower plot shows the class output of the CNN in the test fold. While this is only one example, it provides insight into how the CNN assigns its labels. At approximately 3800 ms, the CNN raises an emergency warning (Label 3), without knowing that the MHD mode frequency will briefly remain steady before continuing its descent into an LM at approximately 4000 ms; similar behavior occurs again at 4600 ms. This indicates that the CNN can identify low-frequency MHD modes that are rapidly descending but cannot reliably predict whether that behavior will continue. Erroneous single-time-slice Label 3 predictions around 4100 ms result from noisy perturbative data influencing the CNN output; § 3 addresses how these predictions are handled.

A physically relevant feature available to the CNN is the downward frequency evolution associated with the slowing of an MHD mode toward locking. A crude representation of this behavior can be obtained by fitting a line to the lowest-frequency spectral ridge within each window predicted as Label 3 in the test set. A simple peak-finding algorithm identifies spectral peaks at each time slice, from which the lowest-frequency peak is selected to represent the mode. These points are then fit with a line. For windows with a negative fitted slope, extrapolating the line to 0 kHz provides a rough estimate of the time at which the mode would lock if the observed frequency evolution continued linearly. Recall that the Label 3 training criteria require the LM to form within ≤100\le100 ms. Figure 5 shows the distribution of extrapolated times to 0 kHz, illustrating the tendency for both true-positive and false-positive Label 3 predictions to contain rapidly descending MHD modes.

Figure 5. The linear slope extrapolation analysis compares the time of the last time slice in the predicted Label 3 window to when the fitted line intersects with the x-axis where frequency would be 0 and an LM would be predicted to form. Even when the CNN incorrectly predicts a Label 3, it does so because it frequently sees a descending MHD mode. As shown in Table 4, 85% of true-positive predictions and 64% of false-positive predictions linearly extrapolate to 0 kHz within 1000 ms. The limitations of this crude linear extrapolation should be emphasized; the analysis is intended to characterize the frequency evolution associated with CNN predictions rather than provide an accurate estimate of the physical locking time.

Table 4 lists the results of this analysis and shows that both true-positive and false-positive Label 3 predictions have a strong bias toward windows containing a decreasing MHD mode. As expected, the true-positive predictions show a stronger bias toward descent. Positive fitted slopes can result from noisy window data, blunt thresholding, or, in the case of false-positive predictions, MHD modes rebounding to higher frequencies after previously descending. This analysis is intentionally crude and its results are not definitive, but it provides additional insight into the behavior learned by the CNN.

Extrapolated Time to 0 kHzValue
True L3, ≤ 1000 ms85%
True L3, ≤ 300 ms79%
False L3, ≤ 1000 ms64%
False L3, ≤ 300 ms50%
Threshold0.5
Skip4

Table 4. The results and method parameters for the linear extrapolation analysis are recorded here. Lock times listed in this table are estimations based on linear extrapolation of fitted lines, not true locking times. The results are for the true-positive and false-positive Label 3 predictions by the 10 CNNs on their respective test data. The Threshold parameter specifies the minimum normalized spectral amplitude required for inclusion in the (X,Y)(X,Y) fit. Skip excludes the first four spectrogram entries, which generally contain large low-frequency components that do not correspond to the MHD modes of interest.

As the emergency warning label is the primary focus of this tool, it is informative to examine its performance as a function of time to locking. Figure 6 shows the precision and recall of the CNN throughout the final 100 ms preceding an LM. Precision reaches 100% immediately before the LM, which has to happen by definition (as all LMs in the dataset have a Label 3 immediately before them, negating the possibility of a false positive at this time). Recall increases as the locking event approaches, reaching 91.4% immediately before locking.

Figure 6. CNN precision and recall improve as MHD modes approach the locking state. The recall provides the more informative trend: as a mode approaches locking, the CNN becomes increasingly likely to identify it as an emergency warning. Statistics are aggregated across the 10 CNNs evaluated on their respective held-out test folds.

CNN Filters and Locked Mode Detection

Identifying Filters for Improved Locked Mode Detection

The CNN analysis performed in the previous section indicates that the locked mode detector performs better than the global statistics listed in Table 2 would imply. Inspired by the prior analysis, an approach based on event detection, rather than time-slice accuracy, is developed. This approach is defined by a second-stage detection method referred to as the ”Block Approach,” which examines collections of contiguous predicted Label 3s rather than individual time-slice predictions. If there exists even a single Label 1 or Label 2 prediction between sets of Label 3 predictions, the two blocks of Label 3s are treated as separate blocks. This approach evaluates the metrics associated with blocks of Label 3s rather than the individual metrics associated with the time slices that comprise those Label 3 predictions.

Blocks of Label 3s are considered true-positive blocks if they contain at least one correctly predicted Label 3 time slice. This approach was found to be the most effective, but creates two issues. The first issue is that if the CNN predicts a continuous sequence of Label 3s containing at least one true Label 3, the entire sequence will be considered a true-positive block despite potentially persisting for a nonphysical length of time. Analysis in § 4 shows this not to be an issue, and an upper limit on block duration could be imposed if necessary. The second issue arises when two or more nearby true-positive blocks correspond to the same LM. In this work, these blocks are not counted as multiple true-positives; instead, blocks corresponding to the same LM are counted as a single successful detection, including in the results presented in Table 5. In practice, closely spaced blocks could provide

Block DetectionValidationTest
Precision87.4%83.7%
Recall89.9%88.5%
F188.7%86.0%
Blocks before filtering256310
Blocks after filtering143147
Persistence50 ms50 ms
Margin0.30.3

Table 5. The results presented in this table show the performance of the final block-based LM detector. Metrics are calculated by aggregating all 139 LM events across all folds rather than averaging fold-level statistics; therefore, standard deviations across folds are not reported. The filter values used for block acceptance, tuned exclusively on the validation set, are also presented.

an additional source of error that could be mitigated by limiting how close separate LM detection times can occur. Table 6 demonstrates the accuracy with which LM times can be calculated to support such an approach.

Lock Time EstimationValidationTest
Correct Within ±10\pm10 ms74.0%69.1%
Correct Within ±20\pm20 ms82.7%78.0%
Correct Within ±30\pm30 ms87.4%82.9%
Correct Within ±50\pm50 ms96.1%95.1%
Correct Within ±100\pm100 ms100%99.2%
Error Standard Deviation22.2 ms26.4 ms
Mean Absolute Error13.5 ms15.9 ms
Prominence0.10.1
Consecutive Failure Limit22
Shift+10 ms+10 ms

Table 6. The analysis of using a simple ridge detection algorithm and following the ridge to termination has provided an accurate way to estimate the time of LM formation. This method was only applied to true-positive blocks of predicted Label 3s (using the blocks for each respective validation/test CNN). The parameters of the algorithm are listed along with the results; these parameters were tuned on the validation set and then applied unchanged to the test set.

Collecting all contiguous blocks of Label 3 predictions results in 274 blocks in the validation set and 335 blocks in the test set. Feature selection and filter development were performed exclusively using the validation blocks. A broad analysis of statistical and model-based features was conducted on the validation blocks to identify features capable of separating false-positive from true-positive Label 3 blocks. This analysis revealed two prominent features for filtering false-positive blocks. The first and more significant feature is block duration, defined as the length of time for which the Label 3 prediction persists. A significant number of false-positive blocks persist for only 10 or 20 ms and are assumed to result from large perturbations or noise in the data. The second, less significant feature is the median classification margin across the block. At each time slice, the margin is calculated as the difference between the predicted probability of Label 3 and the larger of the predicted probabilities for Labels 1 and 2. These results are outlined in Figure 7 and Figure 8.

Figure 7. This histogram depicts the significant number of short-duration false-positive blocks and the high concentration of long-duration (≥50\ge50 ms) true-positive blocks. The clear separation between the blocks provides strong support for duration as a filtering metric for improving LM detection.

Figure 8. This histogram displays the difference in median margin between the true and false-positive blocks. It is evident that the true-positive blocks are associated with a stronger probability metric, and this can be used to filter out some of the false-positive blocks, but not as acutely as the duration filter.

A coarse parameter sweep was performed across the validation predictions to identify the filter parameters; recall that the 10-fold cross-validation procedure con-

sists of 10 separately trained CNNs, each with a corresponding validation fold. These same folds and CNNs were retained for this analysis. To choose the persistence threshold, a region of high validation F1 score (88–90%) was identified for persistence values of 40–60 ms. A value of 50 ms was selected as the midpoint of this high-performance region. A similar approach was used for the classification margin, with an optimal plateau identified between 0.2 and 0.4. A margin threshold of 0.3 was therefore selected. With these filters applied, the final LM detector identifies 88.5% of LMs with a precision of 83.7%, representing a substantial improvement over the CNN-only approach presented in the previous section.

Estimating Lock Times

Determining the locking time of an LM given a true-positive block is a straightforward process that can be accurately achieved with a simple algorithm. Using the find-peaks algorithm from [35], the MHD modes can be identified by the prominence of their peaks. These peaks can be followed during their descent into the formation of an LM. The algorithm goes as follows:

  • Start at the first time slice, t0t_0, of the true-positive block and apply the find-peaks algorithm to the nor-

malized RIP spectrum at this time.

  • Record the lowest-frequency peak as f0f_0. If no peak is found, iterate forward in time until one is identified.

  • Move forward one 10 ms time step and identify the spectral peaks. If any peaks exist such that fnew≤f0+2f_{\mathrm{new}} \leq f_0 + 2 kHz, record the lowest peak frequency as the new f0f_0 and continue tracking forward in time.

  • If no peak satisfies this condition, retain the previous f0f_0 and increment a consecutive-failure counter. Continue to the next 10 ms time step.

  • If a subsequent time step satisfies the tracking condition, update f0f_0 and reset the consecutive-failure counter to zero.

  • When the consecutive-failure counter reaches a specified limit, terminate the ridge tracking and return the time of the last successful detection plus a flat shifting parameter as the estimated LM time.

  • Ridge tracking is restricted to a maximum search window extending 100 ms beyond the end of the predicted Label 3 block.

The Prominence, consecutive-failure limit, and shifting parameters were tuned on the validation set through a coarse parameter sweep, selecting for a balance of low error standard deviation and high accuracy within ±10\pm10 ms. Figure 9 and Table 6 show the resulting performance.

Figure 9. This histogram displays the results of the LM time estimation algorithm applied to the true-positive test blocks after being tuned to the true-positive validation blocks. Outside of a few anomalous errors, the simple method closely times many of the LMs. All predictions terminated through the consecutive ridge-failure criterion rather than reaching the maximum search horizon of 100 ms beyond the end of the true-positive block.

Prediction Capability of the Model

The model has been extensively trained and tuned to attain accurate detection levels; the prediction task, however, is more challenging for this approach. Table 7 and Figure 10 outline how much warning time this model can give Plasma Control Systems (PCS) to respond to an imminent LM [16]; unfortunately, it would appear that about half the LMs with prior rotation will lock before this method can raise the alert. In addition to this, the amount of warning time for the LMs that are detected early enough to alert the PCS may only amount to tens of ms. This problem arises due to the need to enforce a persistence filter of 50 ms to filter out false-positives.

Warning DistributionValidationTest
0-50 ms49.6%56.9%
60-100 ms34.4%31.7%
110-200 ms15.2%8.9%
210-300 ms0.8%2.4%
300+ ms0%0%

Table 7. This table outlines the warning times from both the validation and test blocks that survived filtering. To ensure an emergency warning outputted by the model is accurate, the persistence filter dictates that it must last 50 ms. This delays the warning, resulting in about half of the LMs being predicted too late.

Figure 10. This histogram outlines the spread of warning times (the locked mode time minus the time of the first predicted Label 3 in a true block) across the 121 test shots from their respective folds in the 10-fold cross-validation. A dashed vertical line is included at 50 ms to separate LMs for which the persistence requirement consumes the entire available warning time from those for which some advance warning remains.

This 50 ms restriction can be loosened for the sake of tokamak safety if a higher false-positive rate can be tolerated or if the procedure for preventing an LM is non-disruptive enough to warrant stronger reactions. Retuning of the CNN to provide longer lead times could improve this metric as well, but may come at the cost of a less effective LM detector. Alternatively, the Label 2 early-warning alert can be used to provide greater warning lead time. A similar analysis to what has already been performed with Label 3 could be performed with Label 2 in future work. The greatest limiting factor is built into the approach: the reactive observation of slowing MHD modes by RIP. This process can happen slowly or quickly, and it may not always be possible to confidently detect it in time using a spectrogram-based approach.

Conclusion and Future Work

This body of work has extended the existing overarching research goal of developing FPP-relevant tools for plasma state estimation. The capabilities and limitations of models trained on RIP data for LM detection and prediction have been thoroughly explored and benchmarked. The block-based detection technique has been shown to be quite accurate, identifying 88.5% of LMs with a precision of 83.7% and an F1 score of 86.0%, while the lock time can be estimated with a mean absolute error of only 15.9 ms. While we were able to filter out many aber-

rations in the data, low-frequency, decelerating modes that do not ultimately lock remain difficult to distinguish from genuine locking events and may contribute to reduced precision. The prediction capability of LMs with RIP has proven to be a more difficult challenge than detection, limited by the required persistence of 50 ms of consistent emergency warning labels. Overall, the technique has thoroughly explored the capabilities of what can be done to analyze LMs without any magnetic diagnostics, established a viable method for LM detection and limited prediction, and benchmarked the results for future work. The technique is agnostic to the poloidal and toroidal mode number, only identifying the presence of any mode and analyzing its behavior.

Strict adherence to sound machine-learning principles was maintained through the use of a 10-fold cross-validation procedure designed to limit temporal and shot-based leakage between the training, validation, and test sets. In addition, validation data were used for model selection and hyperparameter tuning while preserving the held-out test data for unbiased evaluation. This approach provides a rigorous estimate of how the developed techniques generalize to unseen DIII-D discharges despite the limitations of the available dataset.

This work demonstrates that significant LM analysis can be performed using only a single interferometric chord measuring density fluctuations. These results are particularly promising for future FPP applications, where additional diagnostic measurements and larger training datasets may further improve model performance and predictive capabilities. Future work will expand on this to explore born-locked mode detection. Born-locked modes exhibit no prior rotation and therefore do not readily appear in the RIP spectrograms used by this approach. Without magnetic diagnostics, addressing born-locked modes may require spatially distributed measurements capable of observing emergent mode structures in the plasma; the electron cyclotron emission imaging (ECEI) diagnostic at DIII-D is a strong candidate for investigating this capability. Greater predictive power may also come from ECEI or another FPP-relevant diagnostic capable of providing additional information about the conditions leading to LM formation. The Label 2 early-warning class can also be explored further, using either RIP or additional diagnostics such as ECEI, to provide greater warning times and potentially more reliable predictions.

Data Availability Statement

All data that support the findings of this study are included within the article (and any supplementary files). Non-DIII-D data and labels can be provided upon request.

Acknowledgment

This material is based upon work supported by the U.S. Department of Energy, Office of Science, Office of Fusion Energy Sciences, using the DIII-D National Fusion Facility, a DOE Office of Science user facility, under Awards DE-FC02-04ER54698, DE-FG02-05ER54809, DE-FG02-97ER54415, DE-SC0019352, DE-SC0021150, and Next Step Fusion S.a.r.l. The authors would like to thank Justin Burzachiello, Jayson Barr, Nathan Richner, and Tyler Cote for fruitful discussions.

Disclaimer

This report was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor any agency thereof, nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.

Dataset Coverage

References

  1. [1]Cihan Akçay, John M Finn, Dylan P Brennan, Thomas Burr, and Doğa M Kürkçüoğlu. Machine learning methods for probabilistic locked-mode predictors in tokamak plasmas. Physics of Plasmas, 28(8), 2021.
  2. [2]Wolfgang Biel, M Ariola, I Bolshakova, KJ Brunner, Marco Cecconello, I Duran, Th Franke, L Giacomelli, L Giannone, F Janky, et al. Development of a concept and basis for the DEMO diagnostic and control system. Fusion engineering and design, 179:113122, 2022.DOI
  3. [3]J Chen, DL Brower, T Benedett, G Prabhudesai, M Poulos, W Ding, D Finkenthal, F Khabnov, and Suk-Ho Hong. Multifunctional interferometry-polarimetry for fusion plasma control and physics applications. Review of Scientific Instruments, 97(10), 2026.DOI
  4. [4]Jie Chen, David Brower, Weixing Ding, Ryota Yoneda, and Daniel Finkenthal. Correlation polarimeter-interferometer in the DIII-D tokamak. Review of Scientific Instruments, 92(4), 2021.DOI
  5. [5]Jie Chen, WX Ding, DL Brower, D Finkenthal, C Muscatello, D Taussig, and R Boivin. Faraday-effect polarimeter diagnostic for internal magnetic field fluctuation measurements in DIII-D. Review of Scientific Instruments, 87(11), 2016.pubmed.ncbi.nlm.nih.gov/27910426
  6. [6]Zhipeng Chen, Tong Wang, Qingquan Yu, Qiming Hu, Da Li, Jie Yang, Dongliang Han, Chengshuo Shen, Minghui Xia, Hai Liu, et al. First observation of unlocking the locked mode by electrode biasing on J-TEXT tokamak. Nuclear Fusion, 61(2):026001, 2021.DOI
  7. [7]Wilkie Choi, RJ La Haye, MJ Lanctot, KEJ Olofsson, EJ Strait, R Sweeney, FA Volpe, and DIII-D Team. Feedforward and feedback control of locked mode phase and rotation in DIII-D with application to modulated ECCD experiments. Nuclear Fusion, 58(3):036022, 2018.DOI
  8. [8]Guo-Hong Deng, You-Wen Sun, Hui-Hui Wang, Tong-Hui Shi, Shuai Gu, Cheng Ye, Qun Ma, Qing Zang, Kai-Yang He, Da-long Chen, et al. Interpretability analysis and real-time prediction of locked mode-induced disruptions in EAST. Plasma Physics and Controlled Fusion, 67(7):075013, 2025.
  9. [9]YH Ding, NC Wang, B Rao, XS Jin, ZP Chen, QM Hu, H Jin, W Jin, JC Li, SJ Xie, et al. Analytical compensation of axisymmetric equilibrium fluxes picked up by locked mode detectors in tokamaks. Review of Scientific Instruments, 85(4), 2014.DOI
  10. [10]Yonghua Ding, Xuesong Jin, Zhenzhen Chen, and Ge Zhuang. Neural network prediction of disruptions caused by locked modes on J-TEXT tokamak. Plasma Science and Technology, 15(11):1154–1159, 2013.DOI
  11. [11]Lutfıye Durak and Orhan Arikan. Short-time fourier transform: two fundamental properties and an optimal implementation. IEEE Transactions on Signal Processing, 51(5):1231–1242, 2003.DOI
  12. [12]Diogo R Ferreira, Tiago A Martins, Paulo Rodrigues, and JET Contributors. Explainable deep learning for the analysis of MHD spectrograms in nuclear fusion. Machine Learning: Science and Technology, 3(1):015015, 2022.DOI
  13. [13]Alejandro F Frangi, Wiro J Niessen, Koen L Vincken, and Max A Viergever. Multiscale vessel enhancement filtering. In International conference on medical image computing and computer-assisted intervention, pages 130–137. Springer, 1998.
  14. [14]M Gambrioli, L Piron, A Pau, G Cunningham, C Piron, D Ryan, P Martin, team the MAST-U, and Tokamak Exploitation Team the EUROfusion. Machine learning methods for locked-mode predictions in MAST-U plasmas. Plasma Physics and Controlled Fusion, 67(4):045007, 2025.DOI
  15. [15]Trevor Hastie, Robert Tibshirani, Jerome H Friedman, and Jerome H Friedman. The elements of statistical learning: data mining, inference, and prediction, volume 2. Springer, 2009.
  16. [16]DA Humphreys, RD Deranian, JR Ferron, AW Hyatt, RD Johnson, RR Khayrutdinov, RJ La Haye, JA Leuer, BG Penaflor, JT Scoville, et al. Integrated plasma control in DIII-D. Fusion science and technology, 48(2):1249–1263, 2005.DOI
  17. [17]Hai Jin, Qiming Hu, Nengchao Wang, Bo Rao, Yonghua Ding, Da Li, Mao Li, and Shujia Xie. Locked mode unlocking by rotating resonant magnetic perturbations in J-TEXT tokamak. Plasma Physics and Controlled Fusion, 57(10):104007, 2015.
  18. [18]JS Kim, DH Edgell, JM Greene, EJ Strait, and MS Chance. MHD mode identification of tokamak plasmas from mirnov signals. Plasma physics and controlled fusion, 41(11):1399–1420, 1999.DOI
  19. [19]Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.arxiv.org/abs/1412.6980
  20. [20]RJ La Haye, R Fitzpatrick, TC Hender, AW Morris, JT Scoville, and TN Todd. Critical error fields for locked mode instability in tokamaks. Physics of Fluids B: Plasma Physics, 4(7):2098–2103, 1992.
  21. [21]Francesco Maviglia, Leonardo Pigatto, Fabio Villone, Hartmut Zohm, Christopher Albert, Pierluigi Bruzzone, Rico Buchholz, Ben Drumm, Jonathan Gerardin, Yueqiang Liu, et al. Studies on eu-DEMO 3d coils requirements and conceptual design for error field correction and plasma control. Fusion Engineering and Design, 196:114010, 2023.DOI
  22. [22]Ph Moreau, A Le-Luyer, P Hertout, F Saint-Laurent, W Zwingmann, JM Moret, and Y Martin. Design and performance analysis of ITER ex-vessel magnetic diagnostics. Fusion engineering and design, 84(7–11):1344–1350, 2009.DOI
  23. [23]MFF Nave and JA Wesson. Mode locking in tokamaks. Nuclear Fusion, 30(12):2575–2583, 1990.DOI
  24. [24]Richard Nies, Allan H Reiman, and Nathaniel J Fisch. On the stabilisation of locked tearing modes in ITER and other large tokamaks. Nuclear Fusion, 62(8):086044, 2022.DOI
  25. [25]MD Pandya, BE Chapman, KJ McCollam, RA Myers, JS Sarff, BS Victor, DP Brennan, DL Brower, J Chen, WX Ding, et al. Early internal detection of magnetic tearing and implications for tokamak magnetohydrodynamic stability. Physics of Plasmas, 31(7), 2024.DOI
  26. [26]G Prabhudesai, J Chen, DL Brower, and D Finkenthal. Upgrade of DIII-D radial interferometer-polarimeter for large bandwidth, low noise, and toroidal mode number measurements. Review of Scientific Instruments, 95(9), 2024.DOI
  27. [27]C Rea and S Benjamin. A review of machine learning-driven studies of tearing modes in tokamaks. Physics of Plasmas, 33(5), 2026.DOI
  28. [28]JT Scoville, RJ La Haye, AG Kellman, TH Osborne, RD Stambaugh, EJ Strait, and TS Taylor. Locked modes in DIII-D and a method for prevention of the low density mode. Nuclear Fusion, 31(5):875–890, 1991.DOI
  29. [29]Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.DOI
  30. [30]Andrei I Smolyakov, Akira Hirose, Enzo Lazzaro, GB Re, and James D Callen. Rotating nonlinear magnetic islands in a tokamak plasma. Physics of Plasmas, 2(5):1581–1598, 1995.DOI
  31. [31]EJ Strait. Magnetic diagnostic system of the DIII-D tokamak. Review of scientific instruments, 77(2), 2006.DOI
  32. [32]R Sweeney, W Choi, M Austin, M Brookman, V Izzo, M Knolker, RJ La Haye, A Leonard, E Strait, FA Volpe, et al. Relationship between locked modes and thermal quenches in DIII-D. Nuclear Fusion, 58(5):056022, 2018.DOI
  33. [33]R Sweeney, W Choi, RJ La Haye, S Mao, KEJ Olofsson, FA Volpe, and DIII-D Team. Statistical analysis of m/n= 2/1 locked and quasi-stationary modes with rotating precursors at DIII-D. Nuclear Fusion, 57(1):016019, 2017.DOI
  34. [34]R Sweeney, AJ Creely, J Doody, Tünde Fülöp, DT Garnier, R Granetz, M Greenwald, Linnea Hesslow, J Irby, VA Izzo, et al. MHD stability and disruptions in the SPARC tokamak. Journal of Plasma Physics, 86(5):865860507, 2020.DOI
  35. [35]Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson, C J Carey, İlhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman, Ian Henriksen, E. A. Quintero, Charles R. Harris, Anne M. Archibald, António H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17:261–272, 2020.
  36. [36]F. A. Volpe, A. Hyatt, R. J. La Haye, M. J. Lanctot, J. Lohr, R. Prater, E. J. Strait, and A. Welander. Avoiding tokamak disruptions by applying static magnetic fields that align locked modes with stabilizing wave-driven currents. Physical Review Letters, 115(17):175002, 2015.DOI

Paper details

vlnc:W_qbef4da8
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents