Depression electroencephalogram prediction model construction method and device, storage medium and computer program product
By extracting stable signal segments from EEG signals and performing filtering, feature sequences are saliency-selected, and a probabilistic prediction model is constructed. This solves the problem of poor model detection performance in existing technologies and improves the accuracy and robustness of auxiliary diagnosis of depression.
Patent Information
- Application Number
- CN202610466081.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-09
- Publication Date
- 2026-08-04
AI Technical Summary
In the existing technology, the auxiliary diagnostic model for depression based on EEG signals has the problem of poor model detection performance, mainly due to the lack of effective processing of noise interference and redundant information, resulting in insufficient accuracy, robustness and generalization ability.
Stable signal segments are extracted from the raw EEG signals, filtered to generate effective signal segments, feature sequences are extracted through saliency screening, and a probabilistic prediction model is constructed.
It significantly improves the model's learning efficiency and classification robustness under limited sample conditions, enhances the model's accuracy and generalization ability, and enables decision-making based on cleaner and more relevant physiological information.
Smart Images

Figure CN122498843A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of biomedical signal processing and machine learning technology, and in particular to a method, device, storage medium and computer program product for constructing a depression EEG prediction model. Background Technology
[0002] Depression, as a prevalent mental disorder worldwide, poses a serious threat to the physical and mental health of adolescents. Current clinical diagnosis mainly relies on psychological questionnaires and subjective interviews, which have problems such as strong subjectivity, delayed diagnosis, and low efficiency. Furthermore, adolescents' indirect expression of emotions and low willingness to seek medical treatment further exacerbate the difficulty of early identification.
[0003] To improve diagnostic objectivity, researchers have attempted to use electroencephalogram (EEG) signals as a physiological basis for identifying depression. EEG reflects the electrical activity of the cerebral cortex, and its frequency domain rhythms (such as alpha, beta, and theta waves) and nonlinear characteristics (such as sample entropy and fractal dimension) are sensitive to depressive states. However, current techniques using EEG for auxiliary identification of depression focus more on how to extract diverse features and construct complex detection models, neglecting the processing of EEG signals with noise and redundancy. This results in deficiencies in the accuracy, robustness, and generalization ability of the final detection models, failing to effectively assist doctors in making medical decisions. Therefore, current auxiliary diagnostic techniques for depression suffer from poor model detection performance.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a method, device, storage medium and computer program product for constructing a depression EEG prediction model, which aims to solve the technical problem of poor model detection effect in the current auxiliary diagnosis technology for depression.
[0006] To achieve the above objectives, this application proposes a method for constructing a depression EEG prediction model, the method comprising: Stable signal segments are extracted from the raw EEG signal, and the stable signal segments are filtered to generate effective signal segments; Each feature sequence is extracted from the effective signal segment, and the feature sequences are saliency-filtered to generate a target EEG signal feature set; A training sample set is generated based on the target EEG signal feature set, and a probabilistic prediction model is constructed using the training sample set.
[0007] In one embodiment, the step of extracting stable signal segments from the raw EEG signal includes: Based on each preset sliding window, the original EEG signal is traversed, the signal peak value of the original EEG signal in each preset sliding window is determined, the signal peak value is standardized, and a standardized score corresponding to each preset sliding window is generated. Each candidate stable window is determined based on the standardized score, wherein each candidate stable window is a preset sliding window whose absolute value of the standardized score is lower than a preset stability threshold. Each target window is determined within the boundary region of each candidate stable window, wherein each target window is a candidate stable window whose signal amplitude of the original EEG signal is lower than a preset amplitude threshold. The target windows are merged into continuous signal segments, and continuous signal segments with a duration greater than a preset duration threshold are designated as stable signal segments.
[0008] In one embodiment, the step of filtering the stable signal segment to generate an effective signal segment includes: The signal amplitude of the stable signal segment is adjusted to a preset amplitude range, and the signal sampling rate of the stable signal segment is adjusted to a target frequency to obtain a first signal; The second signal is obtained by filtering out power frequency interference noise, ultra-low frequency drift noise, and high frequency electromyography interference noise from the first signal. The second signal is decomposed into multiple scales to obtain wavelet coefficients. A noise threshold is determined based on the wavelet coefficients. The high-frequency coefficients in the wavelet coefficients are then subjected to soft threshold quantization using the noise threshold to obtain the third signal. The third signal is divided into frequency bands based on a preset neural oscillation rhythm, and each frequency band is used as a valid signal segment.
[0009] In one embodiment, the step of extracting each feature sequence from the effective signal segment includes: For any frequency band signal in the effective signal segment, feature sequences under each preset feature dimension are extracted from the frequency band signal, wherein each preset feature dimension includes time domain feature dimension, frequency domain feature dimension, time-frequency domain feature dimension and nonlinear feature dimension.
[0010] In one embodiment, the step of performing saliency screening on each feature sequence to generate a target EEG signal feature set includes: For any one of the feature sequences, determine whether the feature sequence conforms to a normal distribution to obtain a determination result; Based on the determination result, each significant feature is determined from the feature sequence; Calculate the linear correlation coefficient between each pair of the salient features, determine the target feature pairs whose absolute values of the linear correlation coefficients exceed a preset correlation threshold, and take any one of the salient features in the target feature pairs as the target EEG signal feature; A target EEG signal feature set is generated based on the target EEG signal features of each feature sequence.
[0011] In one embodiment, the step of determining each salient feature from the feature sequence based on the determination result includes: If the determination result is that the feature sequence conforms to a normal distribution, the statistical significance of the difference in the feature sequence is determined based on the parametric statistical test method. If the determination result is that the feature sequence does not conform to a normal distribution, the statistical significance of the difference in the feature sequence is determined based on a nonparametric statistical test method. The features in the feature sequence whose statistical differences reach a preset significance threshold are taken as each significant feature.
[0012] In one embodiment, the step of constructing a probabilistic prediction model using the training sample set includes: Extract each sample subset from the training sample set, and construct a decision tree for any sample subset in each sample subset; In the process of constructing each node of the decision tree, target sample features are selected from the sample subset, and node splitting is performed at the corresponding split point based on the target sample features. Among them, the target sample features result in the largest decrease in the impurity of the sample set when splitting the node. The decision tree that meets the preset growth conditions is used as the target decision tree of the sample subset, and the target decision trees corresponding to each sample subset are integrated into a random forest model. The network parameters of the random forest model are adjusted based on the training sample set, and the adjusted random forest model is used as a probabilistic prediction model.
[0013] Furthermore, to achieve the above objectives, this application also proposes a device for constructing a depression EEG prediction model, the device comprising: The signal processing module is used to extract stable signal segments from the raw EEG signal, filter the stable signal segments, and generate effective signal segments. The feature extraction module is used to extract each feature sequence from the effective signal segment, perform saliency screening on each feature sequence, and generate a target EEG signal feature set. The model building module is used to generate a training sample set based on the target EEG signal feature set, and to build a probabilistic prediction model using the training sample set.
[0014] In addition, to achieve the above objectives, this application also proposes an electronic device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the depression EEG prediction model construction method described above.
[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the depression EEG prediction model construction method described above.
[0016] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the depression EEG prediction model construction method described above.
[0017] This application provides a method for constructing a depression EEG prediction model. The method includes: extracting stable signal segments from the original EEG signal, filtering the stable signal segments to generate effective signal segments; extracting feature sequences from the effective signal segments, performing significance screening on each feature sequence to generate a target EEG signal feature set; generating a training sample set based on the target EEG signal feature set, and constructing a probabilistic prediction model using the training sample set.
[0018] This application addresses the fundamental problem of low signal-to-noise ratio caused by weak signal amplitude and susceptibility to transient artifacts by extracting stable signal segments from raw EEG signals. This provides a high-quality data foundation for subsequent analysis. Filtering the stable signal segments generates effective signal segments, removing noise and further purifying and separating effective physiological signal components. By extracting feature sequences from these effective signal segments and performing saliency screening, the most discriminative target feature set can be obtained. A probabilistic prediction model is then trained based on this target feature set, significantly improving the model's learning efficiency and classification robustness under limited sample conditions. Compared to related solutions that directly extract features and build models from raw EEG signals containing noise and redundant information, this application improves the usability and information purity of EEG signals from the source. This allows the final model to make decisions based on cleaner and more relevant physiological information, effectively overcoming the core problems of insufficient model accuracy, robustness, and generalization ability in existing EEG-based assisted diagnostic technologies due to insufficient data quality and feature validity. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating an embodiment of the method for constructing a depression EEG prediction model in this application. Figure 2 This is a schematic diagram of the classification process provided in Embodiment 1 of this application; Figure 3 This is a schematic diagram of the signal processing effect provided in Embodiment 1 of this application; Figure 4 The following are time-domain waveform diagrams for each frequency band provided in Embodiment 1 of this application; Figure 5 This is a flowchart illustrating Embodiment 2 of the method for constructing a depression EEG prediction model in this application. Figure 6 A flowchart for the saliency feature screening provided in Embodiment 2 of this application; Figure 7 This is a flowchart of the training and prediction process for the random forest model provided in Embodiment 2 of this application; Figure 8 This is a schematic diagram of the confusion matrix of the training set of the random forest model provided in Embodiment 2 of this application; Figure 9 This is a block diagram of the overall structure of the method for constructing a depression EEG prediction model provided in Embodiment 2 of this application; Figure 10 This is a flowchart of the adaptive stability pruning process provided in Embodiment 2 of this application; Figure 11 This is a schematic diagram of the module structure of the device for constructing a depression EEG prediction model according to an embodiment of this application; Figure 12 This is a schematic diagram of the hardware operating environment involved in the method for constructing a depression EEG prediction model in this application embodiment.
[0022] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0023] It should be understood that the first embodiment described herein is merely used to explain the technical solution of this application and is not intended to limit this application.
[0024] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0025] The main solution of the first embodiment of this application is: extracting stable signal segments from the original EEG signal, filtering the stable signal segments to generate effective signal segments; extracting each feature sequence from the effective signal segments, performing saliency screening on each feature sequence to generate a target EEG signal feature set; generating a training sample set based on the target EEG signal feature set, and constructing a probabilistic prediction model through the training sample set.
[0026] In the first embodiment, for ease of description, the following description uses the device for constructing a depression EEG prediction model as the main execution subject.
[0027] Because existing technologies using EEG for the auxiliary identification of depression focus more on how to use EEG to extract diverse features and build complex detection models, while neglecting the processing of EEG signals with noise interference and redundant information, the resulting detection models are lacking in accuracy, robustness, and generalization ability, and cannot effectively assist doctors in making medical decisions.
[0028] This application provides a solution that addresses the fundamental problem of low signal-to-noise ratio caused by weak signal amplitude and susceptibility to transient artifacts by extracting stable signal segments from raw EEG signals. This provides a high-quality data foundation for subsequent analysis. Filtering the stable signal segments generates effective signal segments, removing noise and further purifying and separating effective physiological signal components. By extracting feature sequences from the effective signal segments and performing saliency screening, the most discriminative target feature set can be obtained. A probabilistic prediction model is then trained based on this target feature set, significantly improving the model's learning efficiency and classification robustness under limited sample conditions. Compared to related solutions that directly extract features and build models from raw EEG signals containing noise and redundant information, this application improves the usability and information purity of EEG signals from the source. This allows the final model to make decisions based on cleaner and more relevant physiological information, effectively overcoming the core problems of insufficient model accuracy, robustness, and generalization ability in existing EEG-based assisted diagnostic technologies due to insufficient data quality and feature validity.
[0029] It should be noted that the executing entity of the first embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, or other electronic device, or a system, application, or program capable of realizing the above functions. The first embodiment and the following embodiments will be described using a device for constructing a depression EEG prediction model as an example.
[0030] Based on this, the embodiments of this application provide a method for constructing a depression EEG prediction model, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for constructing a depression EEG prediction model according to this application.
[0031] In this embodiment, the method for constructing a depression EEG prediction model includes steps S01 to S03: Step S01: Extract stable signal segments from the raw EEG signal, filter the stable signal segments, and generate effective signal segments; It should be noted that the raw EEG signal is a continuous voltage sequence collected from the user's scalp, reflecting the clustered electrical activity of neurons in the cerebral cortex. The stable signal segment is a continuous signal fragment extracted from the raw EEG signal, after eliminating abnormal fluctuations. Filtering involves a series of signal transformations and noise suppression operations applied to the stable signal segment to improve the quality of the EEG signal. The effective signal segment is the signal generated after filtering, which is available for feature extraction.
[0032] Additionally, it should be noted that lightweight EEG acquisition devices can be used to acquire raw EEG signals. These devices include a tablet computer (serving as a control center), an EEG strap, and an ear clip. The EEG strap contains Fp1 and Fp2 leads for recording electrical activity in the prefrontal cortex, and the ear clip contains a reference electrode as a baseline for potential comparison. The device synchronously acquires Fp1 and Fp2 leads via Bluetooth, ultimately generating the raw EEG signal.
[0033] Understandably, step S01 effectively solves the key problems of weak amplitude, susceptibility to electromyography artifacts and power frequency noise in the original EEG signal by extracting stable signal segments from the original EEG signal and performing filtering processing. This provides effective signal segments with high signal-to-noise ratio for subsequent analysis, ensuring the reliability of the analysis from the data source.
[0034] Step S02: Extract each feature sequence from the effective signal segment, perform saliency screening on each feature sequence, and generate the target EEG signal feature set; It should be noted that feature sequences are numerical sequences extracted from effective signal segments. Different numerical sequences have different preset feature dimensions, including time-domain feature sequences, frequency-domain feature sequences, time-frequency-domain feature sequences, and nonlinear feature sequences. Significance screening analyzes the significance of the distribution differences of each feature sequence among samples of different categories (e.g., disease groups and healthy groups), and removes linearly correlated redundant features, thereby selecting a subset of features that have statistical discriminative power for class differentiation and are complementary in information. The target EEG signal feature set is the set of all features retained after significance screening and ultimately used for model training. The features in this set are strongly correlated with the target state (e.g., EEG signal features corresponding to depression) and have low redundancy among themselves.
[0035] Understandably, step S02 extracts each feature sequence from the effective signal segment and performs significance screening. In response to the difficulty of overfitting the model due to the high dimensionality and redundant information of EEG features, the model reduces the computational complexity and risk of overfitting by screening out feature subsets that have significant differences between different category groups and low redundancy.
[0036] Step S03: Generate a training sample set based on the target EEG signal feature set, and construct a probabilistic prediction model using the training sample set.
[0037] It should be noted that the training sample set includes various training samples, each consisting of target EEG signal features and corresponding category labels (such as "illness" or "healthy"). The probabilistic prediction model is a mathematical function or model learned on the training sample set. It is used to identify the input signal features and output the probability of disease for doctors' reference, representing the likelihood that the signal feature belongs to a specific target category (whether or not the patient has the disease).
[0038] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 2 , Figure 2 A classification process diagram is provided. After obtaining the probability prediction model, the user's EEG signal is input into the probability prediction model, and the disease probability is output. The disease probability is compared with a preset probability threshold (e.g., 0.5). If the disease probability is greater than the preset probability threshold, the user is predicted to be a patient, and the auxiliary detection result "user has disease" is output. If the disease probability is less than or equal to the preset probability threshold, the user is predicted to be a healthy person, and the auxiliary detection result "user is healthy" is output.
[0039] Additionally, it should be noted that the probability prediction model is a detection model built for a specific type of disease to assist doctors in medical diagnosis. This disease can be depression or other diseases that use electroencephalogram (EEG) signals as the core basis for detection, such as epilepsy and encephalitis.
[0040] Understandably, step S03 constructs a training sample set based on the screened target feature set. The density of effective disease-related information contained in the limited sample set is significantly improved. By obtaining a probabilistic prediction model based on this training, the problem of insufficient model generalization ability in typical scenarios where clinical samples of adolescents are scarce (such as depression) is solved. Finally, a probabilistic prediction model that can be used to assist in diagnostic decision-making is constructed.
[0041] In one feasible implementation, step S01, the step of extracting stable signal segments from the raw EEG signal, includes steps A01 to A04: Step A01: Based on each preset sliding window, traverse the original EEG signal, determine the signal peak value of the original EEG signal in each preset sliding window, standardize the signal peak value, and generate a standardized score corresponding to each preset sliding window. It's important to note that a preset sliding window is a data segmentation rule with a fixed time length. It's used to progressively extract the original continuous signal at fixed step sizes, transforming the continuous time-series signal into a series of fixed-length subsequences for local statistical analysis. The signal peak value is the maximum amplitude of the original EEG signal within the time period covered by each preset sliding window, representing the local maximum fluctuation intensity within that window. Standardization is a statistical transformation operation. Specifically, it calculates the arithmetic mean and standard deviation of the peak sequence composed of signal peaks within each preset sliding window, then subtracts the arithmetic mean from each signal peak and divides by the standard deviation. Standardization aims to eliminate the overall amplitude baseline differences between individuals (signal peaks within each preset sliding window), transforming the fluctuation intensity (represented by signal peaks) of different preset sliding windows into comparable values with a uniform statistical scale. The standardized score, or Z-score, is the value calculated for each preset sliding window after standardization. It quantifies the degree of deviation of the signal fluctuation intensity within the preset sliding window from the overall fluctuation average level.
[0042] Step A02: Determine each candidate stable window based on the standardized score, wherein each candidate stable window is a preset sliding window whose absolute value of the standardized score is lower than a preset stability threshold; It should be noted that the preset stability threshold is a manually set boundary of the standardized score absolute value used to determine whether the signal fluctuation within the window belongs to the normal range. It is used as a classifier to distinguish abnormal windows with excessive fluctuations (such as those caused by sudden electromyographic artifacts) from windows with normal fluctuations. Candidate stable windows refer to preset sliding windows whose standardized score absolute values are lower than the preset stability threshold. These windows are relatively stable signal segments that have not been affected by severe transient disturbances.
[0043] Step A03: Determine each target window within the boundary region of each candidate stable window, wherein each target window is a candidate stable window whose original EEG signal amplitude is lower than a preset amplitude threshold. It should be noted that the boundary region is a buffer zone drawn inwards from the start and end times of the candidate stable window. Its purpose is to check for signal amplitude transitions caused by residual artifacts at the edges of the initially screened window. Signal amplitude refers to the instantaneous amplitude of the original EEG signal within the boundary region. The preset amplitude threshold is an amplitude threshold used to determine whether the signal within the boundary region is sufficiently stable. The target window refers to the candidate stable window within the boundary region where the signal amplitude is lower than the preset amplitude threshold.
[0044] Step A04: Merge each target window into a continuous signal segment, and take the continuous signal segment with a duration greater than the preset duration threshold as a stable signal segment.
[0045] It should be noted that a continuous signal segment is a time interval formed by merging and connecting the original signal intervals covered by temporally adjacent target windows. The preset duration threshold is a pre-defined standard for the minimum time length of a signal segment, used to ensure that the final retained continuous signal segments have sufficient duration. Segments with too short a duration may contain insufficient information and are therefore discarded.
[0046] For example, a preset sliding window with a preset time length (e.g., 200 sampling points) is used. The absolute value of the peak value of the EEG signal within each preset sliding window is calculated, and a peak sequence is generated. The peak sequence is standardized, and a standardized score (Z-score) is generated for each preset sliding window, reflecting the degree of deviation of its amplitude fluctuation relative to the overall peak sequence. Candidate stable windows with a standardized score absolute value lower than a preset stability threshold (e.g., 2.5) are selected. To further ensure the purity of the signal segment boundaries, a buffer zone (i.e., boundary region) is defined inward from the start and end positions of each candidate stable window. The signal amplitude within this region is checked to see if it is lower than a preset amplitude threshold (e.g., 0.6), thereby eliminating boundary residual artifacts caused by factors such as poor electrode contact or transient interference. Adjacent target windows are merged into continuous signal segments, and only signal segments with a duration exceeding a preset time threshold (e.g., 300 sampling points) are retained, thus obtaining the final, quality-controllable stable signal segments, providing reliable input for subsequent filtering processing.
[0047] In this embodiment, local signal volatility is quantified by peak extraction and standardization through a sliding window, providing a standardized metric for stability assessment. Candidate windows with smooth fluctuations are selected based on the standardized scores, effectively reducing signal segment contamination caused by sudden artifacts or abnormal fluctuations. An amplitude threshold check is applied to the boundary of the candidate window to further eliminate residual high-amplitude interference at the boundary, improving the purity within the signal segment. By merging and duration threshold screening, the continuity and minimum effective length of the final signal segment are ensured, providing a stable and reliable data foundation for subsequent processing. This improves the signal-to-noise ratio and stability of the original EEG signal, thus laying a crucial data quality foundation for improving the model's detection performance.
[0048] In one feasible implementation, step S01, which involves filtering the stable signal segment to generate an effective signal segment, includes steps A11 to A14: Step A11: Adjust the signal amplitude of the stable signal segment to a preset amplitude range, and adjust the signal sampling rate of the stable signal segment to the target frequency to obtain the first signal; It should be noted that the signal amplitude is the voltage value of the EEG signal, which is in the microvolt range. Due to its weakness, it needs to be adjusted to fit the numerical range of subsequent processing. The preset amplitude range is a pre-defined numerical range, such as [-1, 1]. By linearly scaling the signal amplitude of the stable signal segment to this range, data standardization is achieved. The signal sampling rate is the number of sampling points per second of the original stable signal segment, such as 250 Hz (i.e., 250 data points are collected per second). The target frequency is the preset desired sampling rate, such as 200 Hz. By converting the original sampling rate to this frequency, the requirement for sampling rate consistency is met. The first signal is the intermediate processing result obtained after the stable signal segment has undergone amplitude adjustment (scaling to the preset amplitude range) and sampling rate adjustment (resampling to the target frequency).
[0049] For example, the signal amplitude of the stable signal segment is normalized by the maximum absolute value, that is, the signal amplitude of all data points in the stable signal segment is divided by the maximum absolute value, thereby linearly scaling the signal amplitude to the interval [-1, 1]. Then, a polynomial resampling algorithm is used to reduce the sampling rate of the signal from the original 250Hz to 200Hz. The polynomial resampling algorithm is a digital signal processing technique that changes the signal sampling rate. It estimates the signal amplitude between the original sampling points at the new time point through polynomial interpolation (such as Lagrange interpolation), so that the waveform can be smoothly reconstructed when the sampling rate is reduced (such as from 250Hz to 200Hz). It aims to reduce spectral aliasing and signal distortion caused by directly extracting sampling points, while reducing the amount of data for subsequent calculations.
[0050] Step A12: Filter out power frequency interference noise, ultra-low frequency drift noise and high frequency electromyography interference noise from the first signal to obtain the second signal; It should be noted that power frequency interference noise is a periodic interference introduced by the AC power supply, with a center frequency typically of 50 Hz or 60 Hz, manifesting as stable high-frequency oscillations in the signal. Ultra-low frequency drift noise is a slow baseline fluctuation with a frequency below 0.5 Hz, often caused by changes in electrode contact impedance, sweating, or slight body movement. High-frequency electromyographic interference noise is an electrical signal generated by the contraction of facial, neck, or scalp muscles; its frequency components are usually significantly higher than the effective EEG signal (e.g., greater than 50 Hz), manifesting as irregular, sudden high-frequency spikes in the signal. The second signal is an intermediate processing result obtained after the first signal has been sequentially filtered by notch filtering (to remove power frequency interference noise) and bandpass filtering (to suppress ultra-low frequency drift noise and high-frequency electromyographic interference noise).
[0051] For example, the first signal is passed through two digital filters sequentially. First, it is passed through a Butterworth notch filter (a filter used to drastically attenuate signals in a narrow frequency range) with a center frequency of 50Hz to greatly attenuate the energy of that frequency and its surrounding narrow band, thereby suppressing power grid interference. Then, a bandpass filter with a passband frequency of 0.5-50Hz is applied. Its high-pass portion (0.5Hz) is used to cut off ultra-low frequency drift caused by breathing, sweating, etc., while its low-pass portion (50Hz) is used to filter out most high-frequency electromyography artifacts.
[0052] Step A13: Perform multi-scale decomposition on the second signal to obtain each wavelet coefficient, determine the noise threshold based on each wavelet coefficient, and perform soft threshold quantization on the high-frequency coefficients in each wavelet coefficient using the noise threshold to obtain the third signal. It should be noted that multi-scale decomposition refers to the operation of performing discrete wavelet transform on the second signal using wavelet basis functions. Wavelet coefficients are numerical sequences obtained after multi-scale decomposition, including approximation coefficients (representing the low-frequency profile of the signal) and multiple levels of detail coefficients (representing high-frequency details of the signal from coarse to fine). They contain joint information of the original signal in the time and frequency domains. The noise threshold is a numerical limit calculated based on the wavelet coefficients, used to distinguish between the parts of each wavelet coefficient mainly contributed by noise and those mainly contributed by the effective signal. High-frequency coefficients refer to the detail coefficients representing the high-frequency details of the signal in each wavelet coefficient, including a large amount of noise and some high-frequency details of the effective signal. Soft thresholding is a non-linear denoising operation. For each high-frequency coefficient, if its absolute value is less than the noise threshold, it is set to zero; if its absolute value is greater than or equal to the noise threshold, its value is shrunk towards zero (subtracting a sign multiple of the threshold). This operation can smoothly suppress noise while better preserving the edge features of the effective signal, reducing spurious oscillations (Gibbs phenomenon) caused by coefficient discontinuities, and achieving a better balance between denoising and preserving the true characteristics of the signal. The third signal is obtained by performing an inverse wavelet transform (reconstruction) on the wavelet coefficients after soft-threshold quantization. The inverse wavelet transform is the reverse process of wavelet decomposition. After soft-thresholding the high-frequency coefficients, the processed high-frequency coefficients are combined with the unprocessed low-frequency approximation coefficients, and reconstruction is performed using the same wavelet basis (db4) as during decomposition to generate the denoised time-domain signal, i.e., the third signal.
[0053] For example, the Daubechies 4 (db4) wavelet basis function is selected to perform a four-level multi-scale decomposition of the second signal, obtaining a series of low-frequency approximation coefficients and high-frequency detail coefficients. Subsequently, statistical analysis is performed on the high-frequency detail coefficients of the highest level based on the median absolute deviation method to estimate the noise standard deviation. Based on the noise standard deviation, a noise threshold (i.e., soft threshold) applicable to each level is calculated. The soft threshold function is applied to all high-frequency detail coefficients (the coefficient absolute value is set to zero if it is less than the threshold, and the threshold amount is shrunk to zero if it is greater than the threshold). Inverse wavelet transform is performed on all wavelet coefficients after threshold processing to reconstruct the denoised time-domain signal. Among them, the Daubechies 4 (db4) wavelet basis is a mother wavelet function used in wavelet transform. The Db4 wavelet has a fourth-order vanishing moment, which provides a good balance between the time domain and the frequency domain, and can effectively characterize local mutations and stationary oscillations in the signal. The shape of db4 has certain similarities with some transient features of EEG signals, making it suitable for multi-scale analysis of neural signals. The specific steps of the median absolute deviation method are as follows: calculate the median of the absolute values of the coefficients in the layer, then calculate the absolute value of the deviation of each coefficient in the layer from the median, take the median of these deviations, and multiply the median of these deviations by a proportionality constant (approximately 1.4826) to obtain a robust estimate of the standard deviation of Gaussian noise.
[0054] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 3 , Figure 3 A schematic diagram of the signal processing effect is provided, with the horizontal axis representing "Samples" (indicating sampling points) and the vertical axis representing signal amplitude. As shown in the diagram, after applying an adaptive stability pruning algorithm to the stable signal (preprocessed EEG signal), the waveform between "TimeStart" (pruning start point) and "Trim End" (pruning end point) is more stable than the unpruned signal (as can be seen from the waveforms at both ends of the diagram), ensuring the stability of the extracted features for subsequent filtering and feature extraction.
[0055] Step A14: Based on the preset neural oscillation rhythm, the third signal is divided into various frequency bands, and each frequency band is used as a valid signal segment.
[0056] It should be noted that the preset neural oscillation rhythm refers to a universally accepted standard in neuroscience and EEG research, used to divide the third signal into five standard frequency bands, based on specific frequency ranges associated with different brain functional states and cognitive processes. These standard frequency bands have been widely confirmed to be associated with specific neurophysiological mechanisms. The frequency band signal is the multiple sub-signals separated from the third signal after passing it through a set of digital filters with specific passbands. These sub-signals correspond to different neural oscillation rhythms, such as: Delta (0.5-4Hz), Theta (4-8Hz), Alpha (8-13Hz), Beta (13-30Hz), and Gamma (30-50Hz). The effective signal segment is the final set of frequency band signals obtained after the above multi-stage filtering and frequency band division processing. This signal segment has had major interference removed and has been decoupled according to physiological meaning, providing high-quality, structured input data for subsequent feature extraction.
[0057] For example, using a bandpass filter (or an equivalent filter bank) with a specific cutoff frequency, the third signal is divided into five sub-band signals. This division directly corresponds to the recognized brainwave oscillation rhythms in neuroscience. The extracted signals of each band are as follows: Figure 4 As shown, Figure 4 Time-domain waveforms for each frequency band are provided, with the waveforms corresponding to the Delta, Theta, Alpha, Beta, and Gamma bands from top to bottom, respectively. Delta (0.5-4 Hz): associated with deep sleep and unconscious state; Theta (4-8 Hz): associated with emotion regulation, memory, and introspection; Alpha (8-13 Hz): the dominant rhythm at rest with eyes closed; its asymmetry is a key indicator in emotion research. Beta (13-30 Hz): associated with alertness, active cognition, and anxiety. Gamma (30-50 Hz): associated with higher-order cognitive processing and information binding; This division decouples complex mixed EEG signals into components with different functional meanings, laying a direct foundation for subsequent frequency band feature extraction and greatly improving the targeting and physiological interpretability of feature extraction.
[0058] In this embodiment, standardization of signal amplitude range and sampling frequency eliminates scale inconsistencies, providing a unified benchmark for subsequent processing. By combining notch filtering and bandpass filtering, major power frequency interference in the environment, as well as ultra-low frequency drift and high-frequency electromyography artifacts in the signal itself, are specifically filtered out, significantly improving the overall signal-to-noise ratio. Wavelet multi-scale decomposition and adaptive soft threshold denoising based on statistical estimation effectively suppress non-stationary and non-Gaussian residual subtle noise, better preserving the original morphological characteristics of the signal while denoising. The signal is divided into specific frequency bands related to different neurophysiological functions, achieving functional decoupling of the signal. This allows subsequent analysis to focus on the neural oscillation patterns most related to the depressive state, providing a clean and highly concentrated effective signal segment for the feature extraction module. This ensures the physiological relevance and stability of the extracted features from the source, laying a crucial data foundation for building a high-performance classification model.
[0059] In one feasible implementation, step S02, the step of extracting each feature sequence from the effective signal segment, includes step A21: Step A21: For any frequency band signal in the effective signal segment, extract the feature sequence under each preset feature dimension from the frequency band signal. The preset feature dimensions include time domain feature dimension, frequency domain feature dimension, time-frequency domain feature dimension, and nonlinear feature dimension.
[0060] It should be noted that the preset feature dimensions are a set of analytical perspectives from different mathematical and physical levels, designed to comprehensively characterize EEG signals. The feature sequence is one or more feature values calculated for each time window after the frequency band signal is continuously segmented according to a fixed time window (e.g., a 200ms window with a 50ms step).
[0061] Additionally, it should be noted that the preset feature dimensions include time-domain feature dimensions, frequency-domain feature dimensions, time-frequency-domain feature dimensions, and nonlinear feature dimensions. The time-domain feature dimension is a statistical or morphological index extracted from the waveform of the frequency band signal's amplitude changing over time, used to reflect the amplitude distribution and waveform shape characteristics of the frequency band signal. The frequency-domain feature dimension is an index extracted based on the power spectrum or frequency distribution of the frequency band signal after it has been converted from the time domain to the frequency domain, used to reflect the energy distribution characteristics of different frequency components in the frequency band signal. The time-frequency-domain feature dimension is an index extracted to analyze how the frequency components of the frequency band signal change over time; it combines time and frequency information and is used to analyze non-stationary signals. The nonlinear feature dimension is an index extracted based on nonlinear dynamics or information theory methods, used to characterize the inherent characteristics of the complex dynamic system (such as the brain) behind the frequency band signal.
[0062] Correspondingly, the feature sequences under each preset feature dimension include time-domain feature sequences, frequency-domain feature sequences, time-frequency-domain feature sequences, and nonlinear feature sequences. The time-domain feature sequences include features such as mean, standard deviation, kurtosis, skewness, zero crossover rate, Hjorth parameter, amplitude envelope mean, and rate of change; the frequency-domain feature sequences include features such as band power spectral density, prefrontal alpha asymmetry (FAA), and spectral centroid (SC); the time-frequency-domain feature sequences include features such as wavelet energy after db4 wavelet decomposition, wavelet entropy (WE), and Hilbert-Huang spectral entropy obtained from empirical mode decomposition combined with Hilbert transform; and the nonlinear feature sequences include features such as Higuchi fractal dimension, Lempel-Ziv complexity, sample entropy, sorting entropy, and phase-locked value (PLV) of leads Fp1 and Fp2.
[0063] Specifically, in time-domain feature sequences, kurtosis is a statistic describing the steepness or flatness of the signal amplitude distribution curve. High kurtosis indicates that the signal contains more extreme amplitudes far from the mean (such as spike pulses), which may reflect transient fluctuations or artifacts in brain electrical activity. Low kurtosis indicates that the amplitude distribution is concentrated near the mean, and the signal is more stable. Skewness is a statistic measuring the asymmetry of the signal amplitude distribution. Positive skewness indicates a longer tail on the right side of the distribution (in the direction of high amplitude), while negative skewness has the opposite effect. It is used to identify whether there is an asymmetric offset or DC component in the signal. Zero-crossing rate is the number of times the signal crosses the zero level (or mean line) per unit time. It is coarsely correlated with the fundamental frequency of the signal. A high zero-crossing rate means that the signal has richer high-frequency components. The Hjorth parameter describes the time-domain characteristics of a signal, including activity (the variance of the signal, characterizing the total power of the signal), fluidity (the ratio of the first derivative variance to the activity, reflecting the average frequency or rate of change of the signal), and complexity (the ratio of the second derivative to the first derivative fluidity, used to characterize the complexity of the signal shape or its similarity to a sine wave). The amplitude envelope is the instantaneous amplitude of the signal obtained through the Hjorth transform, used to describe the contour of the signal amplitude change over time. The amplitude envelope mean is the mean of the amplitude envelope sequence, used to reflect the average energy level of the signal. The amplitude envelope rate of change is the standard deviation or similar measure of the amplitude envelope sequence, used to reflect the severity of the signal energy fluctuations.
[0064] Similarly, in frequency domain feature sequences, the band power spectral density is the integral or sum of the signal power distribution density with frequency within the alpha band, used to quantify the intensity of neural oscillations in that frequency band. The FAA (Factor-Average Alternating Ability) characterizes the difference in the natural logarithm of the power in the alpha band between the left and right prefrontal lobes (usually leads Fp2 and Fp1). A negative value (relatively lower power in the left prefrontal lobe) is associated with weakened approach motivation and depressive tendencies. The calculation formula is:
[0065] in, , These represent the power of channels Fp1 and Fp2 in the Alpha band, respectively.
[0066] SC is the centroid frequency of the signal power spectrum, which is the weighted average frequency of all frequency components weighted by their power. It reflects the main concentration location of signal energy in the frequency domain. The calculation formula is:
[0067] in, For the frequency band signal corresponding to the frequency, For frequency The corresponding power spectral density.
[0068] Similarly, in time-frequency domain feature sequences, wavelet energy is the sum of squares of wavelet coefficients at each decomposition level (corresponding to different frequency bands) after discrete wavelet decomposition (e.g., using db4 wavelets) of the frequency band signal, representing the signal energy at that scale (frequency band); WE is the information entropy calculated based on the proportion of wavelet energy at each level, quantifying the uniformity or orderliness of signal energy distribution across different scales (frequency bands). A high entropy value indicates a dispersed and disordered energy distribution, while a low entropy value indicates that the energy is concentrated at a few scales and is ordered. The calculation formula is:
[0069] in, Let j be the energy percentage of the j-th layer. To prevent tiny constants with a logarithm of zero, and Let be the energy of the signal at the j-th level after wavelet decomposition, and be the sum of the energies of all energy levels. To prevent tiny constants with a logarithm of zero.
[0070] Hilbert-Huang spectral entropy is constructed by first performing empirical mode decomposition on the signal to obtain several intrinsic mode functions, and then performing Hilbert transform on each intrinsic mode function to obtain the instantaneous frequency and energy. The resulting time spectrum is used to reflect the information entropy of the signal energy distribution in the frequency domain.
[0071] Similarly, in nonlinear feature sequences, the Higuchi fractal dimension is used to quantify the complexity and space-filling ability of the curve corresponding to the frequency band signal; a higher value indicates a more complex and irregular waveform. Lempel-Ziv complexity is an indicator of the randomness of a frequency band signal sequence; higher complexity indicates a more random and unpredictable sequence. Sample entropy is an indicator of the regularity of a frequency band signal time series, obtained by calculating the negative natural logarithm of the conditional probability of matching vectors of lengths m and m+1 in the sequence within a given tolerance range; a lower value indicates a more regular frequency band signal and higher self-similarity. Ordination entropy is an entropy measure based on ordinal pattern analysis, obtained by converting the frequency band signal sequence into an ordinal pattern sequence and calculating the information entropy of the probability distribution of different ordinal patterns; it is used to characterize the dynamical system order structure complexity of the frequency band signal. PLV is the amplitude of the complex average of the instantaneous phase difference sequence of two signals (such as leads Fp1 and Fp2) on the unit circle, ranging from 0 to 1. It reflects the strength and stability of the phase synchronization between two neural oscillation signals. A higher value indicates a stronger phase lock and a tighter functional connection. The calculation formula is:
[0072] in, , represents the instantaneous phase difference between the two leads, reflecting the phase synchronization between brain regions, where T is the total number of time points and t is the time index.
[0073] In this embodiment, a feature space with high information capacity is constructed by extracting feature sequences in four dimensions—time domain, frequency domain, time-frequency domain, and nonlinearity—from each functional frequency band signal. This overcomes the shortcomings of traditional methods, which have single feature dimensions and limited representation capabilities. Through this multi-dimensional, cross-frequency band joint representation, various physiological information patterns that are potentially related to disease states (such as depression) can be extracted to the maximum extent from the purified signal. This provides a comprehensive and highly discriminative original feature set for subsequent saliency screening, solving the problem of limited model learning ability and detection performance bottleneck caused by incomplete or insufficient feature representation.
[0074] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 5 In step S02, the steps of performing saliency screening on each feature sequence to generate the target EEG signal feature set include steps S11 to S14: Step S11: For any feature sequence in each feature sequence, determine whether the feature sequence conforms to a normal distribution and obtain the determination result; It should be noted that the normal distribution is a continuous probability distribution, and its graph resembles a symmetrical bell-shaped curve. The judgment result is a Boolean conclusion output after performing a normality test (such as the Kolmogorov-Smirnov test) on the characteristic sequence, namely "conforms to a normal distribution" or "does not conform to a normal distribution". The Kolmogorov-Smirnov (KS) test is a non-parametric statistical hypothesis testing method that determines whether the empirical distribution represented by a sample is consistent with a specific theoretical distribution (such as the normal distribution) or whether the empirical distributions of two samples come from the same distribution by comparing the maximum difference between their cumulative distribution functions.
[0075] Step S12: Determine each significant feature from the feature sequence based on the judgment result; In one feasible implementation, step S12 includes steps B01 to B03: Step B01: If the determination result is that the feature sequence conforms to a normal distribution, determine the statistical significance of the difference in the feature sequence based on the parametric statistical test method; It should be noted that parametric statistical tests are statistical inference methods based on the assumption of normal distribution. Their core is to estimate population parameters (such as mean and variance) using sample data and test the differences between groups based on these parameters. When the characteristic sequence conforms to a normal distribution, such methods will be used, such as the independent samples t-test (used to compare the differences in the means of two independent samples) or one-way ANOVA (used to compare the differences in the means of multiple samples).
[0076] Step B02: If the result indicates that the feature sequence does not conform to a normal distribution, determine the statistical significance of the difference in the feature sequence based on a nonparametric statistical test method. It should be noted that nonparametric statistical test methods are statistical inference methods that do not rely on specific population distribution assumptions. They are based on the rank or order of the data for analysis. When the characteristic sequence does not conform to a normal distribution, such methods will be used, such as the Wilcoxon rank-sum test (used to compare the distribution differences between two independent samples) or the Kruskal-Wallis H test (used to compare the distribution differences between multiple samples).
[0077] Step B03: Select the features in the feature sequence whose statistical difference reaches the preset significance threshold as each significant feature.
[0078] It should be noted that statistical significance is a probability value (p-value) calculated through parametric or nonparametric tests. It quantifies the probability that the observed difference between two groups (such as the difference in a certain characteristic between the diseased group and the healthy control group) is caused by random sampling error. The smaller the p-value, the greater the likelihood of a true systematic difference between the groups. The preset significance threshold is a pre-defined critical value for statistical significance used in decision-making (e.g., 0.05). When the statistical significance of a characteristic is less than this threshold, it is determined that the characteristic is significantly different between the two groups. Significant features are those whose statistical significance reaches the preset significance threshold. These features are considered to have statistically significant distinguishing power between the diseased group and the healthy control group, and are potential biomarkers. For example, prefrontal alpha asymmetry can be verified as a significant feature.
[0079] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 6 , Figure 6 A flowchart for screening significant features is provided. The KS normality test is used to determine whether the feature sequence conforms to a normal distribution. If it conforms to a normal distribution, the independent t-test can be used to screen significant features. If it does not conform to a normal distribution, the Wilcoxon rank-sum test can be used to screen significant features.
[0080] Step S13: Calculate the linear correlation coefficient between each pair of salient features, determine the target feature pairs whose absolute value of the linear correlation coefficient exceeds the preset correlation threshold, and take any salient feature in the target feature pair as the target EEG signal feature. It should be noted that the linear correlation coefficient refers to the Pearson correlation coefficient, an indicator used to quantify the degree of linear correlation between two salient features. It ranges between -1 and 1; the larger the absolute value, the stronger the linear association between the two features. The preset correlation threshold is a pre-set critical value (e.g., 0.8) used to determine whether features are highly linearly correlated, identifying feature pairs with overlapping information. A target feature pair refers to a pair of salient features whose absolute linear correlation coefficient exceeds the preset correlation threshold. This pair carries highly repetitive discriminative information and is redundant. The target EEG signal feature is the feature ultimately retained after redundancy removal. For a target feature pair, one feature is randomly removed or according to specific rules (e.g., retaining the one with higher correlation to the category). The retained feature becomes the target EEG signal feature.
[0081] Step S14: Generate a target EEG signal feature set based on the target EEG signal features of each feature sequence.
[0082] In this implementation, the statistical distribution characteristics of each feature sequence are clarified through normality testing, laying the foundation for selecting the correct difference testing method and ensuring the effectiveness of statistical inference. Appropriate parametric or non-parametric tests are selected based on the distribution characteristics to accurately quantify the statistical significance of each feature between the depression and healthy groups. Features reaching a preset threshold are selected, and noisy features unrelated to the depressive state are filtered out, significantly improving the discriminative specificity of the feature subset. By calculating the linear correlation coefficient and removing redundant features from highly correlated feature pairs, and integrating the aforementioned results to generate the final feature set, the problem of feature multicollinearity is effectively solved, reducing the dimensionality and information redundancy of the feature set. A low-dimensional, high-discriminative feature subset with significant inter-group differences and independence is extracted from massive initial features, solving the model overfitting problem caused by feature redundancy and noise. This significantly enhances the model's learning efficiency, robustness, and generalization ability under limited samples, thereby directly improving the detection effect.
[0083] In one feasible implementation, step S03, the step of constructing a probabilistic prediction model using a training sample set, includes steps B11-B14: Step B11: Extract each sample subset from the training sample set. For any sample subset in each sample subset, construct a decision tree for the sample subset. It's important to note that a sample subset is a collection of data obtained from the training sample set using bootstrap sampling (i.e., random sampling with replacement). The number of samples in each subset is typically the same as the original training set, but because sampling with replacement occurs, some samples are drawn repeatedly, while others are not selected. A decision tree is a tree-structured classification model that recursively splits data using a series of feature-based judgment rules (i.e., "if-then" rules). Starting from the root node, the data is divided into two subsets (corresponding to two child nodes) based on a certain feature and its split point. This process is repeated at each child node until the splitting condition is met. Finally, each leaf node is assigned a category label (such as "ill" or "healthy").
[0084] Step B12: In the process of constructing each node of the decision tree, target sample features are selected from the sample subset, and node splitting is performed at the corresponding split point based on the target sample features. Among them, the sample set impurity decreases the most when the target sample features are split at the node. It's important to note that the target sample feature is a subset of features randomly selected from all features of the current node when constructing a decision tree node to be split. Within this subset, the merits of each feature as a splitting criterion are evaluated. The target sample feature refers to the specific feature ultimately selected from the sample subset to perform the node split. The split point is a specific numerical threshold in the target sample feature, used to divide the sample data at the current node into two parts: samples with feature values less than or equal to the threshold enter one child node, and samples with feature values greater than the threshold enter the other child node. The reduction in sample set impurity measures the improvement in the purity of sample categories within the resulting child nodes after splitting the node data using the target sample feature and its split point. This can include the Gini index or information entropy. The difference between the node impurity before splitting and the weighted average of the impurities of the two child nodes after splitting is the reduction in impurity. A larger reduction indicates a purer category composition in the child nodes after the split.
[0085] For example, when it is necessary to split a node in a decision tree, a feature subset is randomly selected from the sample subset, and a detailed search is performed within this randomly selected feature subset. For each feature in the subset, all candidate split points for that feature are traversed (based on the midpoint of adjacent values after sorting the feature values). At each candidate split point, the decrease in the impurity of the sample set after splitting the current node's samples into left and right child nodes is calculated. This decrease is quantified by the Gini index gain, which is calculated as: the Gini impurity of the parent node minus the weighted average of the Gini impurities of the two child nodes. The larger the gain value, the more significant the improvement in the "purity" of the sample category is to this split. Among all the evaluated features and all their candidate split points, the feature that maximizes the Gini index gain and its corresponding specific split point are selected as the target sample feature and corresponding split point for this node split, and the actual split operation is performed, distributing the samples of the current node to the two new child nodes according to this rule.
[0086] Step B13: Use the decision trees that meet the preset growth conditions as the target decision trees of the sample subsets, and integrate the target decision trees corresponding to each sample subset into a random forest model. It's important to note that the preset growth conditions are pre-defined rules that must be met for the decision tree to stop splitting. These can be conditions such as the tree reaching its maximum depth, the number of samples within a node falling below a minimum, or the decrease in impurity falling below a certain threshold. The target decision tree is the decision tree formed after the complete growth of the corresponding subset of samples. The random forest model is an ensemble learning model composed of a large number of target decision trees. For a new input sample, each decision tree independently predicts the class, and the random forest model then aggregates the prediction results of all trees using either a voting method (taking the mode) or an averaging method (taking the average probability) as the final output.
[0087] Step B14: Adjust the network parameters of the random forest model based on the training sample set, and use the adjusted random forest model as the probability prediction model.
[0088] It should be noted that network parameters refer to the hyperparameters that need to be set or optimized in advance during the construction and training of the random forest model, such as the number of decision trees in the forest, the size of the feature subset randomly considered when each tree splits at a node, and the preset growth conditions that control tree growth (such as maximum depth and minimum number of samples per leaf node).
[0089] For example, the training sample set is divided into a training set and a test set according to a preset ratio (e.g., 7:3), and a multi-fold cross-validation strategy is used to optimize the parameters of the random forest model. For instance, the training set can be further divided into ten mutually exclusive subsets, with one subset used as the validation set and the remaining nine subsets used as the training subsets in turn, repeating the training and evaluation process. Through this iterative validation, the optimal combination of hyperparameters can be selected based on the average performance of the random forest model across multiple different data partitions, thereby maximizing the use of limited training data, preventing overfitting of the random forest model to specific data partitions, and improving its adaptability and stability to new data.
[0090] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 7 , Figure 7 It provides a flowchart for training and predicting random forest models. The feature data (i.e., the target EEG signal feature set used for modeling after adaptive preprocessing and multi-dimensional feature extraction and filtering) is scaled to a uniform dimension (such as [0,1] or conforming to a standard normal distribution) to eliminate the bias caused by the difference in magnitude of different features in model training, and achieve normalization. The normalized feature data is used for model training. The trained probability prediction model with fixed parameters is saved for subsequent deployment and application without repeated training. When there is a new subject's EEG signal to be diagnosed, the new data is predicted. After the same preprocessing, feature extraction and filtering, and normalization, it is input into the saved model to obtain the classification prediction result (such as the probability of disease). Finally, the predicted probability, classification label (depression / health) or other derived indicators of the model are presented in the form of charts, etc., to provide doctors or users with intuitive auxiliary diagnostic reference and realize the visualization of results.
[0091] Additionally, it should be noted that during the training and cross-validation of the random forest model, tools such as confusion matrices can be used to calculate and monitor multiple classification performance metrics in real time, including accuracy, precision, recall, and F1 score. These metrics quantify the model's performance on the validation set from different dimensions, providing clear quantitative basis for parameter optimization and comprehensively evaluating the model's classification ability, recognition accuracy for specific categories, and overall performance.
[0092] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 8 , Figure 8A diagram illustrating the confusion matrix of the training set for the random forest model is provided. A confusion matrix is a tool in machine learning used to visually represent the performance of a classification model on training data with known labels. It compares the model's predicted labels with the true labels of the data in matrix form. The numbers on the diagonal represent the number of correctly classified samples, and the numbers off-diagonally represent the number of misclassified samples. As shown in the diagram, the DE group (affected group) had 45 true positives, the HC group (healthy group) had 34 true positives, and 8 false negatives.
[0093] In this implementation, multiple training subsets are generated using a bootstrap sampling method, addressing the issue of large model estimation bias caused by a single training set under small sample conditions. Introducing data diversity lays the foundation for building robust base learners. At each node of the decision tree, the optimal splitting feature and splitting point are selected based on the principle of maximizing Gini index gain, ensuring that each tree can effectively learn the key feature combinations that distinguish between depression and health states, thus improving the discriminative power of a single decision tree. By integrating a large number of decision trees to construct a random forest model, the decisions of multiple weak classifiers are combined, effectively reducing the overfitting risk that is easily generated by a single decision tree, significantly improving the overall stability and robustness of the model. Cross-validation and other methods are used to fine-tune the parameters of the ensemble model, further optimizing the model's generalization performance on limited data. This effectively overcomes the fundamental problems of unstable model performance and poor generalization ability caused by scarce samples and complex features, thereby significantly improving the detection effect and reliability of the auxiliary diagnosis of depression.
[0094] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 9 , Figure 9 This paper provides an overall structural diagram of the method for constructing a depression EEG prediction model. The method involves acquiring raw EEG signals through signal acquisition; and then adaptively preprocessing the raw EEG signals to achieve noise reduction and quality optimization through adaptive stability pruning. Please refer to [the documentation / reference]. Figure 10 , Figure 10 An adaptive stability pruning flowchart is provided. Starting with EEG signal preprocessing, the signal is first segmented into analysis units. The signal amplitude scale is unified through normalization, and the temporal resolution is adjusted through resampling. The core filtering stage includes notch filtering and bandpass filtering. Notch filtering is used to remove specific frequency interference (such as power line noise), and bandpass filtering is used to extract the target frequency band signal. Finally, wavelet denoising is used to achieve fine noise suppression. After adaptive stability pruning of the original EEG signal, multi-dimensional feature extraction is used to quantify the signal characteristics from multiple feature dimensions to obtain each feature sequence. Then, the saliency of each feature sequence is screened to extract the most discriminative feature subset. Finally, a probabilistic prediction model is obtained, which is used to generate the disease probability and classify "whether or not one has the disease" based on the disease probability.
[0095] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the method for constructing the depression EEG prediction model of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0096] This application also provides a device for constructing a depression EEG prediction model; please refer to [reference needed]. Figure 11 The device for constructing a depression EEG prediction model includes: Signal processing module 10 is used to extract stable signal segments from the raw EEG signal, filter the stable signal segments, and generate effective signal segments; The feature extraction module 20 is used to extract each feature sequence from the effective signal segment, perform saliency screening on each feature sequence, and generate a target EEG signal feature set. The model building module 30 is used to generate a training sample set based on the target EEG signal feature set, and to build a probabilistic prediction model using the training sample set.
[0097] The depression EEG prediction model construction device provided in this application, employing the depression EEG prediction model construction method in the above embodiments, can solve the technical problem of poor model detection effect in current auxiliary diagnostic technologies for depression. Compared with the prior art, the beneficial effects of the depression EEG prediction model construction device provided in this application are the same as those of the depression EEG prediction model construction method provided in the above embodiments, and other technical features in the depression EEG prediction model construction device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0098] This application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the depression EEG prediction model construction method in Embodiment 1 above.
[0099] The following is for reference. Figure 12 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, and PADs (Portable Application Description: Tablet computers), as well as fixed terminals such as digital TVs and desktop computers. Figure 12 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0100] like Figure 12As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. The communication device 1009 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although the diagrams show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.
[0101] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0102] The electronic device provided in this application, employing the depression EEG prediction model construction method described in the above embodiments, can solve the technical problem of poor model detection performance in current auxiliary diagnostic technologies for depression. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the depression EEG prediction model construction method provided in the above embodiments, and other technical features of this electronic device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0103] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0104] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0105] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the depression EEG prediction model construction method in the above embodiments.
[0106] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0107] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.
[0108] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by an electronic device, the device for constructing a depression EEG prediction model causes the device to: extract stable signal segments from the original EEG signal, filter the stable signal segments to generate effective signal segments; extract each feature sequence from the effective signal segments, perform saliency screening on each feature sequence to generate a target EEG signal feature set; generate a training sample set based on the target EEG signal feature set, and construct a probabilistic prediction model using the training sample set.
[0109] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0111] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0112] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described method for constructing a depression EEG prediction model. This solves the technical problem of poor model detection performance in current auxiliary diagnostic techniques for depression. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the depression EEG prediction model construction method provided in the above embodiments, and will not be elaborated upon here.
[0113] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method for constructing a depression EEG prediction model.
[0114] The computer program product provided in this application can solve the technical problem of poor model detection performance in current auxiliary diagnostic technologies for depression. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the depression EEG prediction model construction method provided in the above embodiments, and will not be repeated here.
[0115] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for constructing a depression EEG prediction model, characterized in that, The method for constructing the depression EEG prediction model includes: Stable signal segments are extracted from the raw EEG signal, and the stable signal segments are filtered to generate effective signal segments; Each feature sequence is extracted from the effective signal segment, and the feature sequences are saliency-filtered to generate a target EEG signal feature set; A training sample set is generated based on the target EEG signal feature set, and a probabilistic prediction model is constructed using the training sample set.
2. The method for constructing a depression EEG prediction model as described in claim 1, characterized in that, The steps for extracting stable signal segments from raw EEG signals include: Based on each preset sliding window, the original EEG signal is traversed, the signal peak value of the original EEG signal in each preset sliding window is determined, the signal peak value is standardized, and a standardized score corresponding to each preset sliding window is generated. Each candidate stable window is determined based on the standardized score, wherein each candidate stable window is a preset sliding window whose absolute value of the standardized score is lower than a preset stability threshold. Each target window is determined within the boundary region of each candidate stable window, wherein each target window is a candidate stable window whose signal amplitude of the original EEG signal is lower than a preset amplitude threshold. The target windows are merged into continuous signal segments, and continuous signal segments with a duration greater than a preset duration threshold are designated as stable signal segments.
3. The method for constructing a depression EEG prediction model as described in claim 1, characterized in that, The step of filtering the stable signal segment to generate an effective signal segment includes: The signal amplitude of the stable signal segment is adjusted to a preset amplitude range, and the signal sampling rate of the stable signal segment is adjusted to a target frequency to obtain a first signal; The second signal is obtained by filtering out power frequency interference noise, ultra-low frequency drift noise, and high frequency electromyography interference noise from the first signal. The second signal is decomposed into multiple scales to obtain wavelet coefficients. A noise threshold is determined based on the wavelet coefficients. The high-frequency coefficients in the wavelet coefficients are then subjected to soft threshold quantization using the noise threshold to obtain the third signal. The third signal is divided into frequency bands based on a preset neural oscillation rhythm, and each frequency band is used as a valid signal segment.
4. The method for constructing a depression EEG prediction model as described in claim 1, characterized in that, The step of extracting each feature sequence from the effective signal segment includes: For any frequency band signal in the effective signal segment, feature sequences under each preset feature dimension are extracted from the frequency band signal, wherein each preset feature dimension includes time domain feature dimension, frequency domain feature dimension, time-frequency domain feature dimension and nonlinear feature dimension.
5. The method for constructing a depression EEG prediction model as described in claim 1, characterized in that, The step of performing saliency screening on each feature sequence to generate the target EEG signal feature set includes: For any one of the feature sequences, determine whether the feature sequence conforms to a normal distribution to obtain a determination result; Based on the determination result, each significant feature is determined from the feature sequence; Calculate the linear correlation coefficient between each pair of the salient features, determine the target feature pairs whose absolute values of the linear correlation coefficients exceed a preset correlation threshold, and take any one of the salient features in the target feature pairs as the target EEG signal feature; A target EEG signal feature set is generated based on the target EEG signal features of each feature sequence.
6. The method for constructing a depression EEG prediction model as described in claim 5, characterized in that, The step of determining each significant feature from the feature sequence based on the determination result includes: If the determination result is that the feature sequence conforms to a normal distribution, the statistical significance of the difference in the feature sequence is determined based on the parametric statistical test method. If the determination result is that the feature sequence does not conform to a normal distribution, the statistical significance of the difference in the feature sequence is determined based on a nonparametric statistical test method. The features in the feature sequence whose statistical differences reach a preset significance threshold are taken as each significant feature.
7. The method for constructing a depression EEG prediction model as described in claim 1, characterized in that, The step of constructing a probabilistic prediction model using the training sample set includes: Extract each sample subset from the training sample set, and construct a decision tree for any sample subset in each sample subset; In the process of constructing each node of the decision tree, target sample features are selected from the sample subset, and node splitting is performed at the corresponding split point based on the target sample features. Among them, the target sample features result in the largest decrease in the impurity of the sample set when splitting the node. The decision tree that meets the preset growth conditions is used as the target decision tree of the sample subset, and the target decision trees corresponding to each sample subset are integrated into a random forest model. The network parameters of the random forest model are adjusted based on the training sample set, and the adjusted random forest model is used as a probabilistic prediction model.
8. A device for constructing a depression EEG prediction model, characterized in that, The device for constructing the depression EEG prediction model includes: The signal processing module is used to extract stable signal segments from the raw EEG signal, filter the stable signal segments, and generate effective signal segments. The feature extraction module is used to extract each feature sequence from the effective signal segment, perform saliency screening on each feature sequence, and generate a target EEG signal feature set. The model building module is used to generate a training sample set based on the target EEG signal feature set, and to build a probabilistic prediction model using the training sample set.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the method for constructing a depression EEG prediction model as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the method for constructing a depression EEG prediction model as described in any one of claims 1 to 7.
