1. Introduction
Neutral beam injection (NBI) serves as a core heating and current drive method for enhancing plasma performance. Precise interpretation of the characteristic emission spectra induced by neutral beam injection (NBI) serves as a direct means to obtain key plasma parameters such as ion temperatures and rotational velocities. Among these techniques, Beam Emission Spectroscopy (BES)—based on the Doppler effect of ion emission spectral lines—has emerged as a key tool for obtaining plasma microdynamics information due to its high temporal and spatial resolution [
1,
2,
3,
4].
However, limited by the neutral beam attenuation, background radiation noise, and complex electromagnetic interference, neutral beam injection (NBI) spectral signals often show low signal-to-noise ratio characteristics, and traditional peak detection methods such as the sliding window threshold method and the first-order derivative method have a false detection rate of more than 30% at signal-to-noise ratios of less than 3 dB, which results in a significant reduction in diagnostic reliability [
5,
6]; and the spectral data are high in dimensionality and non-uniformly distributed—these spectral data exhibit high-dimensional characteristics with a shape of (1, 2, 1024). It is important to note that “multi-dimensional spectral data” is a composite data system integrating “physical dimensions + feature dimensions”, not merely referring to the structural dimensions of the data. Specifically, in the data shape (1, 2, 1024), the first dimension corresponds to the single acquisition sample dimension, the second dimension is the core physical dimension consisting of wavelength and intensity, and the third dimension is the sequence dimension composed of 1024 discrete sampling points. Due to this high-dimensional nature, the traditional fixed block strategy is difficult to adapt to local features due to a single block size. The traditional fixed chunking strategy has a single chunking granularity—referring to a uniform and preset partition size that remains unchanged throughout the entire spectral analysis process, with no adjustment based on local signal characteristics such as peak density, width, or noise distribution—which makes it difficult to adapt to localized features [
7]. For instance, if a fixed chunk size is set to match the average width of spectral peaks, it may either over-segment narrow peaks or merge adjacent overlapping peaks in dense peak regions, while in sparse noise regions, the overly large chunk size tends to include irrelevant background signals, leading to increased false detections or missed detections of weak peaks. Recent advances in machine learning-assisted diagnostics, such as convolutional neural networks (CNNs) for automated peak identification and recurrent neural networks (RNNs) for temporal spectral analysis [
8,
9], have demonstrated improved robustness against noise. However, these data-driven approaches often require large labeled datasets and lack interpretability in physical constraints, limiting their applicability in low-data plasma scenarios. Meanwhile, alternative adaptive segmentation techniques like wavelet-based multi-scale decomposition and dynamic time warping (DTW) address non-uniform peak distributions but struggle with real-time processing due to computational complexity.
These limitations motivate the development of our hybrid method, which integrates physics-informed feature engineering with adaptive clustering to balance accuracy and efficiency. Therefore, the development of feature extraction methods adapted to low signal-to-noise ratio (SNR) and complex peak shape distribution is of great significance for optimizing the operation of plasma devices and studying physical mechanisms. Specifically, the target features to be extracted include two core categories: first, the intrinsic physical features of NBI-induced spectral characteristic peaks, such as peak wavelength, intensity, full width at half maximum (FWHM), and skewness; second, the multi-scale auxiliary features constructed for enhancing detection robustness, including normalized wavelength/intensity, gradient, curvature, morphological gradient, frequency-domain harmonics, and local SNR. These features are extracted targeting the characteristic emission spectra generated by neutral beam injection (NBI) in magnetic confinement plasmas, aiming to accurately identify valid spectral peaks from interference such as noise, peak overlapping, and dynamic broadening, thereby providing reliable input for deriving key plasma parameters.
To address the aforementioned challenges, we propose a spectral feature extraction method based on morphological segmentation and optimized clustering. The method innovatively combines an adaptive chunking strategy, multi-scale morphological feature extraction, and the Density-Based Spatial Clustering of Applications with Noise (DBSCAN) algorithm [
10,
11], aiming to enhance the accuracy and robustness of spectral feature peak extraction. Specifically, the spectral data are first preprocessed through wavelet denoising [
12] and Savitzky–Golay smoothing [
13,
14] to suppress noise interference while preserving spectral features. Adaptive chunking is then applied to divide the spectral curve into multiple simplified subregions based on the local gradient, Laplacian, and curvature characteristics of the data, thereby reducing complexity and facilitating subsequent analyses. During the feature extraction stage, multi-scale morphological analysis is employed to capture local structural features of the spectral data across varying scales, which strengthens the recognition capability for feature peaks with diverse shapes and widths. Subsequently, the DBSCAN clustering algorithm is utilized to analyze the extracted features: by defining appropriate density thresholds and distance parameters, points with similar characteristics are clustered to precisely identify feature peak locations and other key parameters. Furthermore, postprocessing techniques such as morphological closure operations [
15] are implemented to refine clustering results and improve detection reliability.
4. Experiment
4.1. Data Sources
All experimental data were acquired from the diagnostic systems of the EAST device during deuterium plasma discharges. The NBI system parameters were as follows: extraction voltage = 46 kV, beam current = 28.8 A.
The spectral data (stored as NBI__23983.sif) were acquired using a high-resolution spectrometer (model: Andor Shamrock 500i) with a wavelength range of 650–660 nm and a spectral resolution of 0.08 nm. The five known characteristic peaks were determined by the following: (1) a Hα line from background hydrogen; (2) four deuterium impurity lines verified by EAST’s auxiliary optical diagnostic system. The specific parameter settings are shown in
Table 2.
4.2. Multi-Scale Feature Fusion for Optimal Clustering Detection
In order to verify the effectiveness of multi-scale feature fusion in spectral data clustering analysis, especially for the enhancement of spectral peak detection performance, this study selects the complete waveform segments from the preprocessed spectral data file “NBI__23983.sif”, see
Figure 3, and employs two processing methods, multi-scale feature fusion and single feature extraction, and combines them with the DBSCAN clustering algorithm to compare and analyze the performance difference between the two in the spectral data clustering task. Two processing methods, multi-scale feature fusion and single feature extraction, are combined with the DBSCAN clustering algorithm to compare and analyze the performance difference between the two in the spectral data clustering task.
Single-scale feature extraction used only normalized spectral intensity as the input feature, ignoring structural and domain-specific information.
Figure 4 demonstrates the multi-scale feature information, where a 7-dimensional feature matrix was constructed by normalizing and integrating multi-dimensional information, including normalized wavelength, normalized intensity, gradient, curvature, local maxima, frequency domain harmonic amplitude, and local SNR. DBSCAN parameters were optimized via the k-distance method (k = 5, consistent with the minimum number of points required for a valid peak), with ε = 0.3 ± 0.02 and min_samples = 5 for multi-scale features and ε = 0.5 ± 0.03 and min_samples = 3 for single-scale features. Clustering quality was assessed using the silhouette coefficient (SC = 0.72 ± 0.03) and cluster purity (CP = 0.91 ± 0.02) for multi-scale feature fusion, outperforming single-scale feature extraction (SC = 0.45 ± 0.05, CP = 0.63 ± 0.04), where SC > 0.5 indicates good intra-cluster homogeneity and CP = 1 means all clusters contain only valid peak points.
Using the DBSCAN clustering algorithm, whose parameters are dynamically calculated based on the local characteristics of the data, ensures that the clustering results are adapted to the distribution of the data, and the quality of the clustering is assessed using contour coefficients. To verify the necessity of feature selection, the indispensability of each feature is clarified by sequentially removing individual features and comparing the changes in clustering performance.
A visualization of the clustering results is shown in
Figure 5, with scatter colors characterizing the cluster labels to which they belong. From left to right and top to bottom, each panel displays the result obtained after sequentially removing one feature. Compared with non-full-feature clustering, the full multi-scale feature-fusion strategy clearly splits the main peak into two independent clusters: No speckle points appear between groups, the boundary is sharp, and the transition zone is extremely narrow, which shows that data points within each group are highly consistent while data points from different groups are distinctly different. As features are progressively discarded, the overlapping area between groups expands, boundary ambiguity increases, and the clustering process degenerates into a simple intensity-threshold segmentation, completely losing its ability to identify manifold structures. This enhanced topological discriminability effectively decouples the coupled physical process features embedded in the spectrum. Experiments confirm that the multi-scale feature-fusion strategy offers significant advantages in excavating deep correlation features within spectral data.
4.3. Dynamic Threshold Quantile Parameter p and Three-Signature Fusion Mechanism
Three sets of typical NBI spectral data from the EAST device (NBI__23984.sif, NBI__23983.sif, NBI__23982.sif) were selected. To comprehensively investigate the impact of the quantile P on the performance of peak boundary detection in spectral data analysis, a series of controlled experiments were conducted. Three key quantile values, namely p = 0.9, p = 0.95, and p = 0.99, were selected as the test parameters. For each quantile, peak boundary detection was performed on three sets of spectral data. The evaluation of the detection results was carried out from three critical aspects: peak boundary accuracy, false boundary rate, and weak peak edge retention rate.
In
Figure 6, the test results reveal distinct performance characteristics for different quantile values. In terms of peak boundary accuracy, the case of
p = 0.95 exhibited the optimal performance, with all the tested spectral data achieving a 100% accuracy rate. When
p = 0.9, the accuracy rate ranged from 94.4% to 95.0%. In contrast, for
p = 0.99, the accuracy rate decreased, falling within the range of 88.9–90.0%.
Regarding the false boundary rate, the p = 0.95 scenario showed almost no false boundaries, with a false boundary rate of 0. For p = 0.9, the spectral data 23983 had a relatively high false boundary rate of 15%. When p = 0.99, the spectral data 23983 also exhibited a false boundary rate of 5.9%.
In the aspect of a weak peak edge retention rate, all the spectral data maintained a 100% retention rate across the three different p values. This indicates that the algorithm has a high stability in detecting weak peak edges, and the detection result is not significantly affected by the variation in the quantile p.
As shown in
Figure 7, the wavelength interval of interest is from 655.0 nm to 659.0 nm. (a) Plot of gradient variation: The gradient peaks near the wavelength of 656.35 nm, indicating that the rate of change in the signal is the largest here, which is the starting position of the peak. In addition, there is also a significant gradient change near 658.0 nm. (b) Plot of Laplacian: The plot shows a significant negative spike around 656.4 nm followed by a positive spike near 656.5 nm, indicating that the concavity of the signal changes here, which is the edge location of the peak. (c) Plot curvature: The curvature peaks around 656.4 nm, indicating that the signal here has a great degree of curvature and is the location of the inflection point of the peak. (d) Figure chunking boundary: This is located in the region where the signal characteristics change significantly. For example, at the wavelength of 656.4 nm, the signal shows an obvious peak, and the chunking boundary is positioned near the start and end of this peak, specifically at 656.28 nm and 656.48 nm, approximately. This demonstrates that the adaptive chunking strategy can reasonably divide the region based on the characteristic changes in the signal.
4.4. Comparative Analysis of Adaptive Chunking and Fixed Chunking Strategies
The core region of the NBI spectrum contains approximately 2500 data points, within which 3–5 characteristic peaks are distributed, with each peak having an average width of 120 data points. To systematically evaluate the performance of the fixed chunking strategy and avoid subjectivity in parameter selection, this study selected three representative chunk sizes for testing: 60 data points (0.5 times the average peak width), 120 data points (matching the average peak width), and 150 data points (1.3 times the average peak width, balancing integrity and computational efficiency). This design not only meets the core requirement of completely containing individual peaks but also verifies the robustness of the results through multi-size comparison.
The adaptive chunking strategy divides spectral data into dynamic chunks based on three local features: gradient, Laplacian second-order derivative, and curvature. The chunk size is adaptively adjusted within the range of 90–130 data points: smaller chunks are employed in peak-dense regions to capture adjacent peaks, while larger chunks are used in sparse regions to suppress noise.
In
Figure 8, there are significant differences among different chunk sizes. A chunk size of 30 data points is an overly small chunk. Since it is much smaller than the spectral peak width, a single peak is over-segmented into small chunks, and the algorithm cannot recognize the complete peak shape, with the missed detection rate being as high as about 95%. Meanwhile, overly small chunks usually only contain noise and do not trigger the detection threshold, so the false positive rate is as low as about 0%. A chunk size of 60 data points belongs to a moderate-sized chunk. When the chunk size is close to the peak width, the algorithm is sensitive to local noise and tends to misjudge fluctuations as peaks or over-segment adjacent peaks into pseudo-peaks, causing the false positive rate to surge to about 90%. Moreover, this size can cover the complete peak shape, and most real peaks are effectively captured, with the missed detection rate significantly reduced to about 20%. Chunk sizes of 90–180 data points are overly large chunks. When the chunk size exceeds the peak width, it may merge multiple peaks or cause false peaks due to background noise, and the false positive rate remains at a high level of 85–95%. Additionally, overly large chunks tend to mask weak peaks and overlapping peaks, resulting in some real peaks being merged and submerged, and the missed detection rate fluctuates and rises to 40–75%, and increases as the chunk size grows.
Figure 9 and
Figure 10 show the differential performance of the fixed chunking strategy and adaptive chunking strategy in feature clustering and candidate peak recognition effects, respectively. In DBSCAN clustering, labels are used to mark the cluster that data points in the same high-density connected region belong to with non-negative integers, and to mark noise points with −1; these serve as the basic identifier for distinguishing clusters from noise and conducting subsequent analysis of clustering results.
The fixed chunking in
Figure 9 is limited by its preset division dimension, which can easily cause feature dimension collapse in complex data space: uniform chunking ensures the consistency of the peak area, but leads to the breakage of DBSCAN density clusters in non-uniform distribution scenarios, resulting in damage to the topological integrity structure; the noise of feature sparsity area can be easily misclassified as a peak, resulting in a high false alarm rate; although it is simple to implement, there are the overall problems of poor feature continuity and high sensitivity to noise, and the processing performance is obviously weaker than the dynamic strategy. Although it is simple to implement, the overall feature continuity is poor, the noise sensitivity is high, and the processing performance is obviously weaker than that of the dynamic strategy.
As can be seen in
Figure 10, the adaptive chunking and fixed chunking strategies show significant differences in processing non-uniform spreading spectral data. Adaptive chunking adjusts the chunk size adaptively, uses smaller chunks to accurately capture neighboring peaks in the feature-dense area, expands the chunks to suppress noise in the sparse area, and the candidate peaks are concentrated in the real peaks with a low false alarm rate, which has both high specificity and sensitivity. Its flexible demarcation effectively maintains the continuity of features and is suitable for processing complex spectral data.
Integrating the detection data across different signal-to-noise ratios (SNRs) in
Table 3’s comparison of adaptive chunking and fixed chunking detection results reveals that the fixed chunking strategy exhibits significant performance sensitivity to SNR variations: In low SNR scenarios, its missed detection rate reaches 100%, with false positive rates consistently maintaining between 75 and 100%, indicating its near-total inability to effectively identify true characteristic peaks under noise interference. In contrast, the adaptive chunking strategy demonstrates robust stability across the full SNR range (5–14 dB), with missed detection rates consistently controlled between 0 and 20% and false positive rates limited to 16.67–50.00%. Notably, even under extremely low SNR conditions (5–7 dB), it still achieves 0% missed detection. These results confirm that dynamically adjusting chunk size based on local spectral features effectively enhances the ability to identify characteristic peaks, thereby simultaneously reducing both false positives and missed detections compared to the fixed chunking approach with uniform partition granularity.
To more intuitively compare the robustness performance between dynamic chunking and fixed chunking methods under low signal-to-noise ratio (SNR) conditions, we selected three spectral samples with varying intensities and SNRs ranging from 5 to 9 dB for testing based on the data shown in
Table 3. The test samples included data files NBI_110195.sif, NBI_110067.sif, and NBI_110069.sif, with particular focus on evaluating their peak identification accuracy and localization precision in high-noise environments.
As shown in the spectral detection results in
Figure 11, the proposed method demonstrates superior performance compared to the fixed chunking approach, effectively suppressing background noise interference and accurately distinguishing true peaks from noise signals. It achieves precise identification even for weak peaks with signal intensities approaching noise levels. For three spectral datasets with different signal-to-noise ratios (SNRs), the detected peak centers are precisely localized with consistently low miss rates, fully demonstrating its excellent robustness against signal intensity fluctuations.
5. Conclusions
Experimental results based on the measured spectral data from EAST device have comprehensively verified the superiority and robustness of the proposed morphological segmentation and optimized clustering detection method. Through systematic comparative analysis, the multi-scale feature fusion strategy—integrating standardized basic features, differential features, morphological gradients, frequency-domain harmonics, and local signal-to-noise ratio (SNR) characterization—significantly outperforms single-scale feature extraction, achieving a silhouette coefficient of 0.72 ± 0.03 and a cluster purity of 0.91 ± 0.02. Feature selection experiments confirm that full-feature fusion ensures that data points within each group are highly consistent and those between different groups are distinctly different, effectively decoupling the coupled physical process features in the spectrum. In contrast, sequential feature removal degrades clustering into simple intensity-threshold segmentation, resulting in blurred boundaries and overlapping clusters. The optimal quantile parameter for the dynamic threshold is determined as p = 0.95, which achieves 100% peak boundary accuracy and a 0% false boundary rate across all tested datasets while maintaining a 100% weak peak edge retention rate. Compared with p = 0.9 and p = 0.99, this parameter achieves a better balance between boundary precision and weak feature preservation. Comparative evaluations of adaptive and fixed chunking strategies show that the adaptive method—dynamically adjusting chunk sizes (90–130 data points) based on gradient, Laplacian, and curvature features—outperforms fixed chunking (60, 120, 150 data points) across the entire SNR range (5–14 dB). Fixed chunking is highly sensitive to chunk size and noise: overly small chunks (30 data points) lead to a missed detection rate of approximately 95%, moderate chunks (60 data points) cause the false positive rate to soar to around 90%, and large chunks (90–180 data points) result in a missed detection rate of 40–75% and a false positive rate of 85–95%. In contrast, the adaptive chunking strategy controls the missed detection rate within 0–20% and the false positive rate within 16.67–50.00%, achieving 0% missed detection even under low SNR conditions (5–7 dB). Specifically, in low SNR environments, compared with fixed chunking, adaptive chunking reduces the mean false alarm rate by 41.5% and the mean missed alarm rate by 66.7%; in extreme noise scenarios, its correct detection rate remains higher than that of fixed chunking, with a 60% reduction in the false alarm rate. Collectively, these results demonstrate that the proposed method effectively addresses key challenges in Beam Emission Spectroscopy diagnostics, including low SNR, peak overlapping, and dynamic broadening, providing a reliable and efficient solution for high-precision plasma parameter extraction.