Construction method and device of electroshock treatment parameter selection model and electroshock treatment parameter selection method

CN115831381BActive Publication Date: 2026-09-15WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211650261.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2026-09-15
Estimated Expiration
2042-12-21

AI Technical Summary

Benefits of technology

[0038] 1. The method for constructing a parameter selection model for electroconvulsive therapy provided by this invention utilizes low-density electroencephalography (EEG) as a data source, establishing an EEG analysis method and process for electroconvulsive therapy based on low-density EEG. The characteristics of low-density EEG also significantly reduce the time and economic costs of clinical applications, making it more conducive to clinical promotion and practical application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115831381B_ABST
    Figure CN115831381B_ABST
Patent Text Reader

Abstract

The application provides a construction method and device of an electroshock treatment parameter selection model and an electroshock treatment parameter selection method. The model construction method arranges original data into a data set with unified length and format through filtering, slicing and down-sampling, and encodes stimulation parameters. Deep features of electroencephalogram time series are extracted through a designed convolutional neural network, the expression ability of the stimulation parameters is enhanced through feature expansion, the stimulation parameters are embedded into a feature vector through feature fusion, a multilayer perceptron is used as a classifier, and a final classification result is obtained. The application uses low-density electroencephalogram as a data source, mines and extracts deep features of electroencephalogram data, and can realize prediction of individual electroshock stimulation parameters without prior knowledge and expert participation. The application provides a solution for electroshock treatment stimulation parameter prediction, and can be practically applied to electroshock therapy research and clinical practice promotion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning and medical interdisciplinary technology, and in particular to a method and apparatus for constructing a model for selecting electroconvulsive therapy parameters, and a method for selecting electroconvulsive therapy parameters. Background Technology

[0002] Electroconvulsive therapy (ECT) is a treatment method that uses a certain amount of electrical current to pass through the brain, causing loss of consciousness and seizures, triggering epileptiform discharges in the central nervous system, and producing generalized convulsions. ECT has been used to treat depression for over 80 years and is recognized as the most effective and fastest-acting treatment. However, the cognitive impairment it causes, especially memory impairment, limits its application.

[0003] Electroconvulsive therapy (ECT) involves placing two stimulating electrodes on two points on the scalp and releasing pulsed square waves to induce seizures in the brain, producing an antidepressant effect. However, if the electrical stimulation is too weak, it may fail to induce seizures or result in poor-quality seizures, failing to achieve the therapeutic goal. Conversely, if the stimulation is too strong, it may not increase the ability to induce seizures but could instead cause more memory impairment. Therefore, finding the most appropriate electrical stimulation to induce seizures, achieving the optimal balance between efficacy and safety, is the most fundamental and crucial clinical issue in ECT.

[0004] In countries where electroconvulsive therapy (ECT) guidelines or standards exist, these guidelines (standards) typically include a separate chapter discussing the topic. Almost all guidelines (standards) recommend two characteristics for selecting stimulation parameters: 1. using "stimulation voltage" as an indicator; 2. suggesting empirical exploration. Clinically, the selection of electrical stimulation parameters for ECT still largely relies on the physician's clinical experience, considering factors such as the patient's physiological indicators, past medical history, and treatment stage, adjusting parameters such as stimulation frequency and pulse width to regulate stimulation intensity. If parameters are selected according to this approach, it's possible that the stimulation voltage is at the device's maximum output voltage but still fails to induce a seizure, or that a voltage far exceeding the patient's seizure induction threshold is used, thus artificially influencing the effectiveness and safety of ECT. This approach suffers from high subjectivity, poor stability, and can easily cause unnecessary suffering for the patient. In summary, because the specific mechanisms by which electrical stimulation induces epilepsy are still unclear, and numerous patient-specific variables may affect efficacy, there is currently no suitable predictive scheme for electrical stimulation parameters. Summary of the Invention

[0005] This invention provides a method and apparatus for constructing an electroconvulsive therapy (ECT) parameter selection model, as well as an ECT parameter selection method, to solve or at least partially solve the technical problem of poor model performance in the prior art.

[0006] To address the aforementioned technical problems, the first aspect of this invention provides a method for constructing a parameter selection model for electroconvulsive therapy, comprising:

[0007] S1: Acquire and label EEG data. The EEG data is divided into multiple segments, each corresponding to the stimulation parameters selected for treatment. Data segments extracted from the original data that experts have labeled as successfully inducing epilepsy are labeled as 1, and those that are not labeled as 0.

[0008] S2: Preprocess the EEG data fragments obtained in step S1;

[0009] S3: Construct an electroconvulsive therapy (ECT) parameter selection model. The ECT parameter selection model includes a convolutional neural network, a feature expansion layer, a feature fusion layer, and a classifier. The convolutional neural network is used to extract deep features from the preprocessed anesthetized EEG data. The feature expansion layer is used to enhance the importance of the stimulation parameters in the model discrimination and extract stimulation parameter features. The feature fusion layer is used to fuse the deep features with the stimulation parameter features. The classifier is used to obtain the prediction result based on the fused features.

[0010] S4: Input the preprocessed EEG data fragments into the constructed electroconvulsive therapy parameter selection model for training to obtain the trained electroconvulsive therapy parameter selection model.

[0011] In one implementation, step S1 includes:

[0012] The anesthesia-state EEG data of patients was extracted from the source data, and filtered, sliced ​​and downsampled to form several 2-second data segments.

[0013] Each data segment is encoded and associated with the stimulus parameters selected for treatment. Each data segment can be represented as D = [x1, x2, ... x...]. k [,s], where k is the number of EEG channels; s is the combination of stimulation parameters. This represents the time series data of the i-th channel of the patient, where n represents the number of data points contained in the time series;

[0014] The encoded data segments are labeled. Data segments extracted from the original data that experts marked as successfully inducing epilepsy are labeled as 1, and those that do not are labeled as 0.

[0015] In one implementation, step S2 includes:

[0016] The anesthetized EEG data in the EEG data segments were sliced, and then data cleaning, data augmentation and data balancing were performed;

[0017] The stimulation parameters corresponding to the EEG data segments are encoded.

[0018] In one implementation, the processing procedure of the convolutional neural network includes:

[0019] Continuous convolutional modules were used to perform convolution calculations on the preprocessed anesthetized EEG data to extract data features. The formula is as follows:

[0020]

[0021] in, and These represent the i-th output channel of the l-th layer and the i-th output channel of the (l-1)-th layer, respectively. This represents the convolution kernel between the i-th and j-th feature maps in the l-th layer; This represents the bias term of the i-th feature map in the l-th layer;

[0022] The extracted data features are downsampled using a pooling layer;

[0023] The Flatten layer is used to unfold and concatenate several downsampled feature maps into a one-dimensional vector.

[0024] By using a fully connected layer, the feature vectors obtained from the flattened layer are used to learn deep features, resulting in deep feature vectors.

[0025] In one implementation, the feature extension layer is a fully connected layer, and the number of fully connected layers is set to half or a quarter of the length of the deep feature vector.

[0026] In one implementation, the classifier uses a fully connected neural network. The fully connected neural network includes two fully connected layers. The first fully connected layer serves as the classification layer, using the ReLU activation function to improve the model's non-linear fitting ability and employing a dropout layer to randomly deactivate some neurons during training. The second fully connected layer serves as the output layer, with only one neuron and constrained by the Sigmoid activation function, the calculation method of which is as follows:

[0027]

[0028] and These represent the outputs of the j-th neuron in layer l and the k-th neuron in layer (l-1), respectively. This represents the weight connecting the k-th neuron in layer (l-1) to the j-th neuron in layer l. The bias of the j-th neuron in the l-th layer is represented. The output of the sigmoid function is restricted to the range [0,1]. The output of the model represents the probability that the input data can be induced by ECT treatment under the stimulation parameters.

[0029] Based on the same inventive concept, a second aspect of the present invention provides an apparatus for constructing a model for selecting parameters in electroconvulsive therapy, comprising:

[0030] The data acquisition and annotation module is used to acquire and annotate EEG data. The EEG data is divided into multiple segments, each segment corresponding to the stimulation parameters selected for treatment. Data segments extracted from the original data that experts have marked as successfully inducing epilepsy are labeled as 1, and those that are not labeled as 0.

[0031] The preprocessing module is used to preprocess the EEG data fragments obtained from the data acquisition and annotation module;

[0032] The model building module is used to construct a model for selecting electroconvulsive therapy (ECT) parameters. The ECT parameter selection model includes a convolutional neural network, a feature expansion layer, a feature fusion layer, and a classifier. The convolutional neural network is used to extract deep features from the preprocessed anesthetized EEG data. The feature expansion layer is used to enhance the importance of the stimulation parameters in the model discrimination and extract stimulation parameter features. The feature fusion layer is used to fuse the deep features with the stimulation parameter features. The classifier is used to obtain the prediction result based on the fused features.

[0033] The model training module is used to input preprocessed EEG data fragments into the constructed electroconvulsive therapy parameter selection model for training, thereby obtaining a trained electroconvulsive therapy parameter selection model.

[0034] Based on the same inventive concept, a third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described in the first aspect.

[0035] Based on the same inventive concept, a fourth aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.

[0036] Based on the same inventive concept, the fifth aspect of the present invention provides a method for selecting electroconvulsive therapy parameters, comprising: inputting the patient's anesthetized EEG data and a combination of selectable stimulation parameters into a trained electroconvulsive therapy parameter selection model obtained in the first aspect, to obtain stimulation parameters that meet the conditions, and using them as electroconvulsive therapy parameters.

[0037] Compared with the prior art, the advantages and beneficial technical effects of the present invention are as follows:

[0038] 1. The method for constructing a parameter selection model for electroconvulsive therapy provided by this invention utilizes low-density electroencephalography (EEG) as a data source, establishing an EEG analysis method and process for electroconvulsive therapy based on low-density EEG. The characteristics of low-density EEG also significantly reduce the time and economic costs of clinical applications, making it more conducive to clinical promotion and practical application.

[0039] 2. A parameter selection model for electroconvulsive therapy was constructed. A convolutional neural network structure was designed for the characteristics of low-density EEG data to mine and extract deep features of EEG data and fuse them with stimulation parameters as influencing factors for determining whether epilepsy can be induced. This improved the model's performance and enabled the selection of personalized electroconvulsive stimulation parameters without prior knowledge or expert intervention.

[0040] 3. It provides a solution for predicting stimulation parameters in electroconvulsive therapy, which can be practically applied to the research and clinical practice of electroconvulsive therapy. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is an overall framework diagram of the method for constructing an electroconvulsive therapy parameter selection model provided in an embodiment of the present invention;

[0043] Figure 2 This is a structural diagram of the electroconvulsive therapy parameter selection model provided in this embodiment of the invention;

[0044] Figure 3 This is a block diagram of the construction device for the electroconvulsive therapy parameter selection model provided in this embodiment of the invention.

[0045] Figure 4 This is a structural diagram of the computer-readable storage medium provided in the embodiments of the present invention;

[0046] Figure 5 This is a structural diagram of the computer device provided in the embodiments of the present invention. Detailed Implementation

[0047] Through extensive research and practice, the inventors of this application have discovered that the essence of electrical stimulation-induced epilepsy is the interaction between electrical stimulation and the patient's brain. It is known that patient-related variables affecting the effectiveness of epilepsy induction include age, gender, medication use, serum potassium level, mental state, number of electroconvulsive therapy (ECT) sessions, type and dosage of anesthetic drugs, oxygen saturation during anesthesia, and the interval between anesthesia and electrical stimulation. However, electrical stimulation does not directly interact with the patient's age or gender, but rather with the patient's brain functional state. The aforementioned related factors may all be influencing factors of the patient's brain functional state. For a specific patient requiring ECT treatment, the brain functional state at a given moment corresponds to an optimal set of electrical stimulation parameters. Therefore, logically, the electrical stimulation parameters and the patient's brain functional state determine whether epilepsy is induced. The aforementioned problem then becomes determining "which combination of electrical stimulation parameters is most likely to induce epilepsy under a certain brain functional state."

[0048] The primary concern of this invention is determining the appropriate indicators to represent "brain functional state." Currently, commonly used tools for neuroscience research on brain functional state include Magnetic Resonance Imaging (MRI), Positron Emission Computed Tomography (PET), and Magnetoencephalography (MEG). However, the selection of stimulation parameters is a matter of clinical practice. Using these tools is costly and difficult, making it challenging to apply research findings to routine clinical treatment. Low-density (16 leads or less) electroencephalography (EEG), on the other hand, is simple, economical, and easy to perform, allowing for widespread clinical application. The characteristics of low-lead EEG balance scientific rigor and operability, enabling the deployment and application of this invention in ordinary hospitals. This is crucial for large-sample clinical research and subsequent clinical promotion.

[0049] Methods for analyzing electroencephalogram (EEG) data have evolved from early waveform recognition and spectral analysis to machine learning and deep learning. In the era of artificial intelligence, with deep learning as a typical application, convolutional neural networks (CNNs) exhibit strong adaptability in learning features and can effectively extract deep features from neural signals. This invention uses anesthetized EEG data as the analysis object, employs CNNs to extract deep features of the patient's EEG, and then fuses these features with stimulus parameter features to assess the likelihood of inducing epileptic seizures under different parameter combinations. This provides a new solution to the problem of predicting stimulus parameters for electroconvulsive therapy (ECT).

[0050] In summary, this invention mainly focuses on the analysis and processing of electroencephalogram (EEG) data and the feature embedding method of stimulation parameters, aiming to achieve a highly accurate and stable stimulation parameter selection scheme for electroconvulsive therapy.

[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] Example 1

[0053] This invention provides a method for constructing a parameter selection model for electroconvulsive therapy, including:

[0054] S1: Acquire and label EEG data. The EEG data is divided into multiple segments, each corresponding to the stimulation parameters selected for treatment. Data segments extracted from the original data that experts have labeled as successfully inducing epilepsy are labeled as 1, and those that are not labeled as 0.

[0055] S2: Preprocess the EEG data fragments obtained in step S1;

[0056] S3: Construct an electroconvulsive therapy (ECT) parameter selection model. The ECT parameter selection model includes a convolutional neural network, a feature expansion layer, a feature fusion layer, and a classifier. The convolutional neural network is used to extract deep features from the preprocessed anesthetized EEG data. The feature expansion layer is used to enhance the importance of the stimulation parameters in the model discrimination and extract stimulation parameter features. The feature fusion layer is used to fuse the deep features with the stimulation parameter features. The classifier is used to obtain the prediction result based on the fused features.

[0057] S4: Input the preprocessed EEG data fragments into the constructed electroconvulsive therapy parameter selection model for training to obtain the trained electroconvulsive therapy parameter selection model.

[0058] Please see Figure 1 This is an overall framework diagram of the method for constructing an electroconvulsive therapy parameter selection model provided in an embodiment of the present invention.

[0059] Specifically, step S1 is data acquisition and annotation. Low-density electroencephalography (EEG) can be used as the data source to extract the patient's anesthesia-state EEG data. After relevant operations, data segments are obtained, and each data segment corresponds to the stimulation parameters selected for its treatment.

[0060] Step S2 is data preprocessing, which may include data cleaning, data balancing, etc.

[0061] S3 involves model construction. Specifically, the number and size of convolutional and fully connected layers in the convolutional neural network can be designed based on the sample size. Feature expansion layers and feature fusion layers are also designed for the stimulus parameters. The feature expansion layer enhances the expressive power of the stimulus parameters or increases their weight, thus strengthening their importance in the model's judgment and facilitating the model's learning of the impact of stimulus parameters on ECT treatment. The feature fusion layer integrates the stimulus parameter features with deeper EEG features to jointly participate in the judgment of whether generalized epilepsy can be induced.

[0062] S4 involves training the model by inputting the preprocessed data from step S2 into the model designed in step S3. The goal is to achieve high classification accuracy using the simplest possible network structure and the shortest possible training time. The training set is {(D}. (1) ,y (1) ),…,(D (m) ,y (m) )}。 D (m) For the combination of EEG data and stimulation parameters of the m-th sample, y (m) The classification label representing the m-th sample, in this invention, y (m) ∈{0,1}.

[0063] In clinical practice, the combinations of commonly used stimulation parameters are limited. Therefore, the problem of predicting stimulation parameters can be transformed into a classification problem of determining whether a specific combination of stimulation parameters can induce epileptic seizures in a specific brain functional state. By searching within a limited parameter space, the optimal combination of stimulation parameters can be determined. Based on this, this invention proposes a method for constructing a stimulation parameter model for electroconvulsive therapy based on convolutional neural networks and feature fusion.

[0064] Several sets of stimulation parameters were set up, forming pairwise controls. EEG data of the patient were collected under different stimulation parameters (during normal treatment). EEG data fragments from all channels were extracted after the patient entered anesthesia, preprocessed, and used along with the corresponding stimulation parameters as input data for the model. Each data point can be represented as D = [x1, x2, ... x...]. k [,s], where k is the number of EEG channels and s is the combination of stimulation parameters. Let represent the time-series data of the i-th channel of the patient, where n represents the number of data points in the time series. Define labels y=1 to indicate that the treatment successfully induced epilepsy, and y=0 to indicate that the treatment did not induce epilepsy. Design a feature fusion model based on a convolutional neural network. Input the dataset into the model for training to obtain predictions of the probability of inducing epilepsy under specific brain functional states and stimulation parameters. In practice, doctors can set a classification threshold; when the model determines that the probability of successfully inducing epilepsy is greater than the threshold, it is considered that epilepsy can be induced.

[0065] In one implementation, step S1 includes:

[0066] The anesthesia-state EEG data of patients was extracted from the source data, and filtered, sliced ​​and downsampled to form several 2-second data segments.

[0067] Each data segment is encoded and associated with the stimulus parameters selected for treatment. Each data segment can be represented as D = [x1, x2, ... x...]. k [,s], where k is the number of EEG channels; s is the combination of stimulation parameters. This represents the time series data of the i-th channel of the patient, where n represents the number of data points contained in the time series;

[0068] The encoded data segments are labeled. Data segments extracted from the original data that experts marked as successfully inducing epilepsy are labeled as 1, and those that do not are labeled as 0.

[0069] In practice, the process of extracting and annotating the patient's anesthetized EEG data from the source data can be achieved through the following methods:

[0070] Step S1.1: The equipment used to collect EEG data typically employs the international 10-20 system for electrode placement. The international 10-20 system is the standard electrode placement method specified by the International Society for Electroencephalography (ESE).

[0071] The EEG reference method is average reference, meaning the average of all brain electrode data is used as the reference electrode. Data from the ear electrodes (A1 and A2 channels) is discarded during data export. In clinical practice, patients are given electrical stimulation for a period of time after entering anesthesia; during stimulation, the EEG recording equipment is disabled. Therefore, it is necessary to export the EEG data after the patient enters anesthesia but before the application of electrical stimulation, while ensuring the absence of significant noise.

[0072] Step S1.2: Bandpass filtering of the patient's EEG data from 0.5 to 60 Hz is applied, followed by noise reduction using Kalman filtering (KLM). Since the input format accepted by the pre-trained model used for data cleaning in this invention is 2s*256Hz, the truncated data needs to be sliced ​​and downsampled to form several 2s*256Hz time series segments. These time series segments and stimulus parameters are encoded and mapped to each other, serving as input to the preprocessing model.

[0073] Step S1.3: This invention innovatively transforms the problem of stimulus parameter prediction into a classification problem of whether epilepsy induction is successful. Therefore, the preprocessed EEG segments from Step 1.2 are labeled. Experts mark successful epilepsy induction as 1, otherwise as 0.

[0074] In one implementation, step S2 includes:

[0075] The anesthetized EEG data in the EEG data segments were sliced, and then data cleaning, data augmentation and data balancing were performed;

[0076] The stimulation parameters corresponding to the EEG data segments are encoded.

[0077] In practice, the preprocessing of anesthetized EEG data can be achieved in the following ways:

[0078] Step S2.1: Standardize the data. Perform a standardization operation on the data of each channel. The standardization formula is as follows:

[0079]

[0080] In Equation 2.1, σ represents the variance of the channel data, and μ represents the mean of the channel data. Data standardization can accelerate the convergence of the weight parameters.

[0081] Step S2.2: Data cleaning, the purpose of which is to remove bad segments, artifacts, and interpolation. The time series segments obtained in step S2.1 are input into an end-to-end preprocessing model to obtain several n*2s*256Hz EEG segments, where n is the number of channels.

[0082] Step S2.3: Data Augmentation and Data Balancing. Generally, the number of original clinical samples is far from sufficient for training neural networks, making data augmentation almost inevitable. Simultaneously, most clinical samples have a label of 1 (i.e., successful evoked symptoms), indicating a severe imbalance. To ensure the model does not bias towards learning certain features, data balancing is necessary. This invention utilizes random channel amplitude inversion, time-series inversion, and left / right brain region channel swapping to augment and balance samples without destroying time-series characteristics. Specifically:

[0083] Left and right brain region channel swapping: Following the international 10-20 system naming standard, the data for corresponding brain regions (odd-numbered channels) are swapped between the left brain and the right brain (even-numbered channels). In this system, odd-numbered channels are located on the left side, and even-numbered channels on the right side; Z represents the midline region, F represents the frontal region, C represents the central region, T represents the temporal region, P represents the parietal region, O represents the occipital region, and A1 / A2 represent the left and right ear electrodes, respectively. The complete channel swapping table is shown in Table 1.

[0084] Table 1 Channel Interchange Table

[0085] Fp1 (left frontal pole) Fp2 (Right Frontal Pole) F3 (Left Forehead) F4 (Right Forehead) F7(left anterior temporal) F8 (Right Anterior Temporal) T3 (left middle temporal) T4 (right temporal midline) C3 (center left) C4(center right) P3 (Top Left) P4 (Right Top) T5 (left posterior temporal) T6 (right posterior temporal lobe) O1 (Left occipital region) O2(right pillow)

[0086] For each piece of data, you can choose to swap all channels or select some channels, thus achieving data augmentation at almost any rate.

[0087] Random channel amplitude inversion: Select a channel in the sample and invert the amplitude of that channel. Specifically, reverse the amplitude of the time series x of a certain channel in the sample. i ={p0,p1,...,p 256 The amplitude of} is reversed as follows:

[0088] x i ={-p0,-p 1, ...,-p 256} (2.2)

[0089] Where i represents the i-th channel of the sample. The channel with inverted amplitude, along with the data from the other channels of the sample, is used as a new sample for training.

[0090] Random Channel Time Series Reversal: Select a channel in the sample and reverse the time series of that channel. Specifically, reverse the time series x of a channel in the sample. i ={p0,p1,...,p 256 The order of} is reversed as follows:

[0091] x′ i ={p 256 ,p 255 ,...,p0} (2.3)

[0092] Where i represents the i-th channel of the sample. The channel after time series reversal, along with the data from the other channels of the sample, are used as new samples for training.

[0093] In practice, the training set is first expanded by swapping channels between the left and right hemispheres, and then the ratio of positive to negative samples is calculated to balance the data. Different inversion ratios can be achieved by selecting different numbers of channels for inversion.

[0094] Preprocessing of stimulus parameters mainly involves encoding them. Different combinations of numbers of parameters can be encoded using binary encoding. For example, four parameter combinations would be encoded as 00, 01, 10, and 11, respectively. During encoding, it is important to ensure that parameter combinations that are close in the parameter space are also as close as possible in the logical space of the encoding. This helps the model correctly learn the relationship between different parameters and EEG features.

[0095] In one implementation, the processing procedure of the convolutional neural network includes:

[0096] Continuous convolutional modules were used to perform convolution calculations on the preprocessed anesthetized EEG data to extract data features. The formula is as follows:

[0097]

[0098] in, and These represent the i-th output channel of the l-th layer and the i-th output channel of the (l-1)-th layer, respectively. This represents the convolution kernel between the i-th and j-th feature maps in the l-th layer; This represents the bias term of the i-th feature map in the l-th layer;

[0099] The extracted data features are downsampled using a pooling layer;

[0100] The Flatten layer is used to unfold and concatenate several downsampled feature maps into a one-dimensional vector.

[0101] By using a fully connected layer, the feature vectors obtained from the flattened layer are used to learn deep features, resulting in deep feature vectors.

[0102] Specifically, in the implementation process, the preprocessed anesthetized EEG data is organized in the format of n*sample_length*1, where n represents the number of channels, sample_length is the length of a single channel time series with a value of 2*Freq, and Freq represents the sampling frequency. This data is then input into a continuous convolutional module (including multiple convolutional layers) for computation. The convolutional layers use the ReLU activation function to enhance the model's non-linear fitting capability. In practice, the bias term can be set to zero.

[0103] Since the trainable parameters change continuously during training, the data distribution in the non-input layers of the network also changes. To maintain a good data distribution, a batch normalization layer is inserted between the computations of two convolutional layers. This normalizes the data to a mean of 0 and a variance of 1, which can maintain training stability and improve training speed.

[0104] Next, a pooling layer (MaxPooling) is used to downsample the data features, extracting the main spatiotemporal features while reducing model parameters, thereby reducing computational overhead, preventing overfitting, and improving the model's generalization ability.

[0105] Then, a flatten layer is used to expand and concatenate the feature maps obtained from the pooling layer into a one-dimensional vector. Finally, a fully connected layer is connected to learn the set of deep features and obtain the deep feature vector of EEG.

[0106] In one implementation, the feature extension layer is a fully connected layer, and the number of fully connected layers is set to half or a quarter of the length of the deep feature vector.

[0107] Specifically, the encoded stimulus parameters are input into a fully connected layer, and the number of fully connected layers is set to half or a quarter of the length of the deep feature vector of the EEG.

[0108] Then, the output of the fully connected layer (feature extension layer) is concatenated with the obtained deep EEG feature vector using the Concrete layer (feature splicing layer) to complete the feature embedding.

[0109] In one implementation, the classifier uses a fully connected neural network. The fully connected neural network includes two fully connected layers. The first fully connected layer serves as the classification layer, using the ReLU activation function to improve the model's non-linear fitting ability and employing a dropout layer to randomly deactivate some neurons during training. The second fully connected layer serves as the output layer, with only one neuron and constrained by the Sigmoid activation function, the calculation method of which is as follows:

[0110]

[0111] and These represent the outputs of the j-th neuron in layer l and the k-th neuron in layer (l-1), respectively. This represents the weight connecting the k-th neuron in layer (l-1) to the j-th neuron in layer l. The bias of the j-th neuron in the l-th layer is represented. The output of the sigmoid function is restricted to the range [0,1]. The output of the model represents the probability that the input data can be induced by ECT treatment under the stimulation parameters.

[0112] Using dropout layers during training randomly deactivates some neurons in the network (preventing parameter updates), thus mitigating overfitting. The classification threshold can be set according to actual needs.

[0113] Please see Figure 2 This is a structural diagram of the electroconvulsive therapy parameter selection model provided in this embodiment of the invention.

[0114] The model construction method provided by this invention will be illustrated below with specific examples.

[0115] Part 1: Data Preparation and Preprocessing

[0116] 1. The equipment used to acquire EEG data in this example was manufactured by Guangzhou Andy Company, and the electrodes were placed using the international 10-20 system. The data export reference method was set to average reference, and the default leads included 17 channels (16 channels included in Table 2 and the central channel Cz). A data segment marked by experts as the time after the onset of anesthesia was extracted from the source data, and bandpass filtering (0.5-60Hz) and Kalman filtering were performed. Then, it was downsampled to 256Hz and divided into 8 segments of 2s*256Hz EEG data. Each segment was then standardized according to Equation 2.1 to meet the Gaussian distribution with a mean of 0 and a variance of 1. The data was then input into an end-to-end data processing network to complete data preprocessing steps such as artifact removal, bad segment removal, and interpolation.

[0117] 2. Based on the expert's annotations of the EEG during treatment, each segment was labeled. Specifically, data segments extracted from the original data that the experts marked as successfully inducing epilepsy were labeled as 1, and those that did not were labeled as 0.

[0118] 3. The samples were divided into training and test sets in an 8:2 ratio. The training set was expanded by swapping channels between the left and right hemispheres. Next, the ratio of positive samples (labeled 1) to negative samples (labeled 0) in the training set was calculated. In clinical practice, epilepsy can be successfully induced in most patients, resulting in a relatively small number of negative samples. Therefore, random channel reversal was primarily used to expand the negative samples, bringing the ratio of positive to negative samples closer to 1:1.

[0119] 4. Assign each data segment to the stimulation parameters selected for treatment. Each segment can be represented as X = [[x1, x2, ... x...]. k [,s], where k is the number of EEG channels; s is the combination of stimulation parameters. In this example, the applied electrical stimulation is a square wave, and the stimulation parameters studied are pulse frequency and pulse width.

[0120] Part Two: Network Model Structure Design

[0121] 1. The input data is organized into a 17*512*1 format, i.e., 17 channels, each channel being a 2-second EEG segment with a sampling rate of 256Hz. This data is then processed using three consecutive convolutional layers with 3*3 kernels of 32, 64, and 128 kernels respectively. Each convolutional layer uses the ReLU activation function to enhance the model's non-linear fitting capability. The convolutional layer operations are expressed by the following formula:

[0122]

[0123] Here and These represent the i-th output channel of the l-th layer and the i-th output channel of the (l-1)-th layer, respectively. This represents the convolution kernel between the i-th and j-th feature maps in the l-th layer; This represents the bias term of the i-th feature map in the l-th layer, which is set to zero here.

[0124] Next, a Batch Normalization layer and a MaxPooling layer are connected after the convolutional layer. The former is used to ensure a good distribution of data and speed up training; the latter has a pooling size of 2*2. The pooling layer can further extract features, while reducing the number of parameters, reducing computational overhead, and reducing the risk of overfitting.

[0125] 2. After flattening the feature map using a Flatten layer, it is connected to a fully connected layer for feature aggregation. The task of this fully connected layer is to aggregate the deep features learned by the convolutional neural network; the number of neurons is set to 128.

[0126] 3. Encode the stimulus parameters. In this example, there are two different choices for pulse frequency and pulse width, so two bits are used for encoding. High frequency and large pulse width are encoded as 1, and low frequency and small pulse width are encoded as 0. The encoding table is shown in Table 2:

[0127] Table 2 Stimulus Parameter Coding Table

[0128]

[0129]

[0130] Next, this vector of length 2 is input into a fully connected layer with 32 neurons, and expanded into a 32-bit feature vector.

[0131] 4. Use a concatenate layer to concatenate the feature vectors obtained in steps 2 and 3, combining them into a single feature vector of length 160. Input this vector into a two-layer fully connected neural network. The first layer has 32 neurons, and the ReLU activation function is used to enhance the model's non-linear fitting ability. The second layer has 1 neuron, and the Sigmoid activation function is used for constraint. Its calculation method can be expressed as follows:

[0132]

[0133] and These represent the outputs of the j-th neuron in layer l and the k-th neuron in layer (l-1), respectively. This represents the weight of the connection between the k-th neuron in layer (l-1) and the j-th neuron in layer l. This represents the bias of the j-th neuron in the l-th layer. The output of the Sigmoid function is limited to [0,1], and can be viewed as the probability that the sample can be induced to have epilepsy by ECT treatment under this stimulus parameter. The default classification threshold is 0.5.

[0134] Part Three: Model Training and Testing

[0135] 1. The samples were divided into training and test sets in an 8:2 ratio, with 20% of the training set used as a validation set. The model was trained using stochastic gradient descent based on backpropagation, continuously updating the parameters. The learning optimizer was Adam, with an initial learning rate of 0.001, a mean squared error loss (MSE) loss function, a batch size of 256, and 15 epochs for training.

[0136] 2. Compare the model prediction results with the expert annotation results in the test set to evaluate the probability of the model inducing epilepsy under specific stimulus parameters. The indicators used are accuracy, precision, and recall.

[0137] Example 2

[0138] Based on the same inventive concept, this embodiment provides a device for constructing an electroconvulsive therapy parameter selection model. For details on the device for constructing an electroconvulsive therapy parameter selection model, please refer to [link to relevant documentation]. Figure 3 The device includes:

[0139] The data acquisition and annotation module 201 is used to acquire and annotate EEG data. The EEG data is divided into multiple segments, each segment corresponding to the stimulation parameters selected for treatment. Data segments extracted from the original data that experts have marked as successfully inducing epilepsy are labeled as 1, and those that are not labeled as 0.

[0140] Preprocessing module 202 is used to preprocess the EEG data fragments obtained by the data acquisition and annotation module;

[0141] The model building module 203 is used to build an electroconvulsive therapy parameter selection model. The electroconvulsive therapy parameter selection model includes a convolutional neural network, a feature expansion layer, a feature fusion layer, and a classifier. The convolutional neural network is used to extract deep features from the preprocessed anesthetized EEG data. The feature expansion layer is used to enhance the importance of the stimulation parameters in the model discrimination and extract the stimulation parameter features. The feature fusion layer is used to fuse the deep features with the stimulation parameter features. The classifier is used to obtain the prediction result based on the fused features.

[0142] The model training module 204 is used to input the preprocessed EEG data fragments into the constructed electroconvulsive therapy parameter selection model for training, so as to obtain the trained electroconvulsive therapy parameter selection model.

[0143] Since the device described in Embodiment 2 of this invention is the same device used in constructing the electroconvulsive therapy parameter selection model in Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this device based on the method described in Embodiment 1 of this invention, and therefore will not be repeated here. All devices used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0144] Example 3

[0145] Based on the same inventive concept, please refer to Figure 4 The present invention also provides a computer-readable storage medium 300 having a computer program 311 stored thereon, which, when executed, implements the method described in Embodiment 1.

[0146] Since the computer-readable storage medium described in Embodiment 3 of this invention is the same computer-readable storage medium used in the method for constructing the electroconvulsive therapy parameter selection model in Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this computer-readable storage medium based on the method described in Embodiment 1 of this invention, and therefore will not be repeated here. All computer-readable storage media used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0147] Example 4

[0148] Based on the same inventive concept, please refer to Figure 5 This application also provides a computer device, including a memory 401, a processor 402, and a computer program 403 stored in the memory and executable on the processor. When the processor executes the program, it implements the method in Embodiment 1.

[0149] Since the computer device described in Embodiment 4 of this invention is the same computer device used to implement the method for constructing the electroconvulsive therapy parameter selection model in Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this computer device based on the method described in Embodiment 1 of this invention, and therefore will not be repeated here. All computer devices used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0150] Example 5

[0151] Based on the same inventive concept, this application also provides a method for selecting electroconvulsive therapy (ECT) parameters, comprising: inputting the patient's anesthetized EEG data and a combination of selectable stimulation parameters into the trained ECT parameter selection model obtained in Example 1, and obtaining stimulation parameters that meet the conditions as ECT parameters.

[0152] In practice, when using this model to select stimulation parameters for electroconvulsive therapy, the patient's anesthetized EEG data can be input into the constructed model. Then, the available combinations of stimulation parameters from the instrument can be input into the model. The probability of inducing seizures under different stimulation parameters can be observed, and parameter selection can be made by comprehensively considering the induction probability and treatment risk. The model can also search within a certain parameter space, returning all parameter combinations that meet the induction threshold.

[0153] Meeting the criteria means meeting the doctor's treatment expectations (such as the probability of triggering the condition); under these conditions, the stimulation parameters obtained can be used as parameters for electroconvulsive therapy.

[0154] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0155] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0156] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0157] Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, if these modifications and variations to the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention also intends to include these modifications and variations.

Claims

1. A method for constructing a parameter selection model for electroconvulsive therapy, characterized in that, include: S1: Acquire and label EEG data. The EEG data is divided into multiple segments, each corresponding to the stimulation parameters selected for treatment. Data segments extracted from the original data that experts have labeled as successfully inducing epilepsy are labeled as 1, and those that are not labeled as 0. S2: Preprocess the EEG data fragments obtained in step S1; S3: Construct an electroconvulsive therapy (ECT) parameter selection model. The ECT parameter selection model includes a convolutional neural network, a feature expansion layer, a feature fusion layer, and a classifier. The convolutional neural network is used to extract deep features from the preprocessed anesthetized EEG data. The feature expansion layer is used to enhance the importance of the stimulation parameters in the model discrimination and extract stimulation parameter features. The feature fusion layer is used to fuse the deep features with the stimulation parameter features. The classifier is used to obtain the prediction result based on the fused features. S4: Input the preprocessed EEG data fragments into the constructed electroconvulsive therapy parameter selection model for training to obtain the trained electroconvulsive therapy parameter selection model; The processing steps of a convolutional neural network include: Continuous convolutional modules were used to perform convolution calculations on the preprocessed anesthetized EEG data to extract data features. The formula is as follows: in, and They represent the first The first layer The output channel and the first The first layer One output channel; Indicates the first The first in the layer The and the first Convolution kernels between feature maps; Indicates the first The first in the layer Bias terms for each feature map; The extracted data features are downsampled using a pooling layer; The Flatten layer is used to unfold and concatenate several downsampled feature maps into a one-dimensional vector. The feature vectors obtained from the flattened layer are processed by a fully connected layer to learn deep features, thus obtaining deep feature vectors. The feature expansion layer uses fully connected layers, with the number of fully connected layers set to half or a quarter of the length of the deep feature vectors. The classifier is a fully connected neural network, consisting of two fully connected layers. The first fully connected layer serves as the classification layer, using the ReLU activation function to improve the model's non-linear fitting ability and employing a dropout layer to randomly deactivate some neurons during training. The second fully connected layer serves as the output layer, with only one neuron and constrained by the Sigmoid activation function, calculated as follows: and They represent the first The first layer The output of the first neuron and the first The first layer The output of each neuron; Indicates the first The first layer The first neuron is connected to the first... The first layer The weights of each neuron, Indicates the first The first layer The bias of each neuron, the output of the Sigmoid function is limited to [0,1], and the output of the model represents the probability that the input data can be induced by ECT treatment under the stimulation parameters.

2. The method for constructing the electroconvulsive therapy parameter selection model as described in claim 1, characterized in that, Step S1 includes: The anesthesia-state EEG data of patients was extracted from the source data, and filtered, sliced ​​and downsampled to form several 2-second data segments. Each data segment is encoded, and each data segment is mapped to the stimulation parameters selected for treatment. Each data segment is represented as D. Where k is the number of brainwave channels; s is the combination of stimulation parameters. This represents the time series data of the i-th channel of the patient, where n represents the number of data points contained in the time series; The encoded data segments are labeled. Data segments extracted from the original data that experts marked as successfully inducing epilepsy are labeled as 1, and those that do not are labeled as 0.

3. The method for constructing the electroconvulsive therapy parameter selection model as described in claim 1, characterized in that, Step S2 includes: The anesthetized EEG data in the EEG data segments were sliced, and then data cleaning, data augmentation and data balancing were performed; The stimulation parameters corresponding to the EEG data segments are encoded.

4. A device for constructing a parameter selection model for electroconvulsive therapy, characterized in that, Based on the method described in claim 1, it includes: The data acquisition and annotation module is used to acquire and annotate EEG data. The EEG data is divided into multiple segments, each segment corresponding to the stimulation parameters selected for treatment. Data segments extracted from the original data that experts have marked as successfully inducing epilepsy are labeled as 1, and those that are not labeled as 0. The preprocessing module is used to preprocess the EEG data fragments obtained from the data acquisition and annotation module; The model building module is used to construct a model for selecting electroconvulsive therapy (ECT) parameters. The ECT parameter selection model includes a convolutional neural network, a feature expansion layer, a feature fusion layer, and a classifier. The convolutional neural network is used to extract deep features from the preprocessed anesthetized EEG data. The feature expansion layer is used to enhance the importance of the stimulation parameters in the model discrimination and extract stimulation parameter features. The feature fusion layer is used to fuse the deep features with the stimulation parameter features. The classifier is used to obtain the prediction result based on the fused features. The model training module is used to input preprocessed EEG data fragments into the constructed electroconvulsive therapy parameter selection model for training, thereby obtaining a trained electroconvulsive therapy parameter selection model.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed, it implements the method as described in any one of claims 1 to 3.

6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 3.

7. A method for selecting parameters in electroconvulsive therapy, characterized in that, This includes: inputting the patient's anesthetized EEG data and a combination of selectable stimulation parameters into a trained electroconvulsive therapy parameter selection model obtained as described in any one of claims 1 to 3, to obtain stimulation parameters that meet the conditions, which are then used as electroconvulsive therapy parameters.