Microstate template generation method and terminal device

By optimizing the training sample set of EEG signals, high-quality micro-state templates are generated, which solves the problems of noise and non-representative data interference, and improves the accuracy and applicability of the template.

CN119961735BActive Publication Date: 2025-08-12INST OF APPLIED MATHEMATICS HEBEI ACADEMY OF SCI
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510435780.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-08-12
Estimated Expiration
2045-04-09

AI Technical Summary

Technical Problem

In the prior art, the EEG micro-state template generation process is disturbed by high noise and non-representative data, resulting in low template quality.

Method used

By obtaining the EEG signal, training the sample set, training the classifier and determining the accuracy, repeatedly updating the sample set until the accuracy reaches maximum, deleting or adding samples to optimize the sample set, forming the target sample set, and using intermediate micro-state templates and feature extraction to generate the target micro-state template.

Benefits of technology

The quality and classification performance of micro-state templates are improved, and the diagnostic ability of neuropsychiatric diseases is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961735B_ABST
    Figure CN119961735B_ABST
Patent Text Reader

Abstract

The present invention provides a microstate template generation method and terminal device, relating to the field of brain science and technology. The method comprises: training a classifier based on an EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier; updating the EEG signal training sample set, and jumping to the step of training the classifier based on the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier, and continuing until the accuracy reaches a maximum, which is recorded as the target accuracy; using the EEG signal training sample set corresponding to the target accuracy as the target sample set, and determining a target microstate template based on the target sample set. The present invention uses the EEG signal training sample set to train the classifier, and optimizes the data of the EEG signal training sample set based on the accuracy of the classifier, which can effectively reduce the impact of high noise and non-representative data, thereby improving the quality of the EEG microstate template.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of brain science technology, and in particular to a microstate template generation method and terminal equipment. Background Art

[0002] EEG microstates are a method for recording resting-state brain activity based on multi-channel electroencephalograms (EEGs). They reflect spontaneous, temporally synchronized, and spatially large-scale patterns of cortical neuronal activity. Alterations in microstate characteristics may be closely associated with disease-induced changes in neural activity and therefore serve as potential biomarkers for screening neuropsychiatric disorders. In recent years, EEG microstate analysis, as a tool for describing the spatiotemporal dynamics of large-scale electrophysiological data, has been widely used in the field of neuroscience. Generating high-quality microstate templates is the foundation of EEG microstate analysis, and the quality of these templates has a significant impact on subsequent analysis.

[0003] In the existing technology, clustering methods are usually used to generate microstate templates. However, in the process of extracting EEG microstate templates, factors such as high noise and non-representative data often interfere with the accuracy and classification performance of the templates, resulting in low quality of the generated microstate templates. Summary of the Invention

[0004] The embodiments of the present invention provide a micro-state template generation method and a terminal device to solve the problem in the prior art that the quality of the generated micro-state template is low due to the influence of data quality.

[0005] In a first aspect, an embodiment of the present invention provides a method for generating a microstate template, comprising:

[0006] Obtaining an EEG signal training sample set, training a classifier based on the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier;

[0007] Updating the EEG signal training sample set and jumping to the step of obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier, and continuing to execute the steps until the accuracy reaches a maximum, and recording the accuracy as the target accuracy;

[0008] The EEG signal training sample set corresponding to the target accuracy is used as the target sample set, and the target microstate template is determined based on the target sample set.

[0009] Optionally, the steps of updating the EEG signal training sample set, jumping to obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier are continued until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy, including:

[0010] Deleting samples from the EEG signal training sample set to obtain an updated EEG signal training sample set, and jumping to the step of obtaining the EEG signal training sample set, training a classifier based on the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier, and continuing to execute the steps until the accuracy reaches a maximum;

[0011] The samples in the test sample set are added to the EEG signal training sample set to form an updated EEG signal training sample set, and the process jumps to obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and continuing to determine the accuracy of the trained classifier until the accuracy reaches the maximum, and this accuracy is recorded as the target accuracy.

[0012] Optionally, the steps of deleting samples in the EEG signal training sample set to obtain an updated EEG signal training sample set, jumping to the step of obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier are continued until the accuracy reaches a maximum, including:

[0013] The current EEG signal training sample set is used as the first initial sample set;

[0014] =1;

[0015] For the Any sample in the first initial sample set, remove the sample from the The first initial sample set is deleted to form an updated EEG signal training sample set; the classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy corresponding to the sample;

[0016] Select The maximum accuracy among the accuracies corresponding to the samples in the first initial sample set is used as the updated EEG signal training sample set corresponding to the maximum accuracy. The first initial sample set;

[0017] Determine the Is the accuracy corresponding to the first initial sample set greater than that of the The accuracy corresponding to the first initial sample set;

[0018] If so, then , and jump to the Any sample in the first initial sample set, remove the sample from the The first initial sample set is deleted to form an updated EEG signal training sample set; the classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy corresponding to the sample step to continue execution;

[0019] If not, then The first initial sample set is used as the current EEG signal training sample set.

[0020] Optionally, the samples in the test sample set are added to the EEG signal training sample set to form an updated EEG signal training sample set, and the process jumps to obtaining the EEG signal training sample set, training the classifier based on the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier. The steps are continued until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy, including:

[0021] The current EEG signal training sample set is used as the first second initial sample set, and the current test sample set is used as the first initial test sample set;

[0022] =1;

[0023] For the Any sample in the initial test sample set is added to the a second initial sample set, forming an updated EEG signal training sample set; training a classifier according to the updated EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier as the accuracy corresponding to the sample;

[0024] Select The maximum accuracy among the accuracies corresponding to each sample in the initial test sample set is used as the updated EEG signal training sample set corresponding to the maximum accuracy. The second initial sample set; the sample corresponding to the maximum accuracy is selected from the The initial test samples are deleted and the An initial test sample set;

[0025] Determine the Is the accuracy corresponding to the second initial sample set greater than that of the The accuracy corresponding to the second initial sample set;

[0026] If so, then , and jump to the Any sample in the initial test sample set is added to the A second initial sample set is used to form an updated EEG signal training sample set; a classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy step corresponding to the sample is continued;

[0027] If not, then The accuracy corresponding to the second initial sample set is taken as the target accuracy.

[0028] Optionally, training the classifier based on the EEG signal training sample set to obtain a trained classifier includes:

[0029] Determine the intermediate microstate template based on the EEG signal training sample set;

[0030] The classifier is trained according to the intermediate microstate template and the EEG signal training sample set to obtain a trained classifier.

[0031] Optionally, determining an intermediate microstate template based on an EEG signal training sample set includes:

[0032] For any sample in the EEG signal training sample set, calculate the topographic map of the sample at the global field power peak;

[0033] The topographic maps of each sample at the global field power peak are clustered to obtain a preset number of cluster centers, and the preset number of cluster centers form an intermediate microstate template; wherein the intermediate microstate template includes a preset number of microstates.

[0034] Optional, the preset number is 4.

[0035] Optionally, a classifier is trained based on the intermediate microstate template and the EEG signal training sample set to obtain a trained classifier, including:

[0036] For any sample in the EEG signal training sample set, calculate the microstates corresponding to each signal point in the sample and sort them in chronological order to form a microstate sequence corresponding to the sample; perform feature extraction on the microstate sequence corresponding to the sample to obtain the features of the sample;

[0037] The features of each sample are input into the classifier for training to obtain a trained classifier.

[0038] Optionally, feature extraction is performed on the microstate sequence corresponding to the sample to obtain features of the sample, including:

[0039] According to the first formula, the time factor conversion probability of the microstate sequence corresponding to the sample is calculated, and the time factor conversion probability is used as the feature of the sample;

[0040] The first formula is:

[0041]

[0042] in, Microstate The time factor transition probability of the microstate, Microstate within the segment The next microstate after the occurrence is The probability of Microstate within the segment Probability of occurrence; For each microstate.

[0043] In a second aspect, an embodiment of the present invention provides a terminal device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the microstate template generation method in the first aspect or any possible implementation of the first aspect is implemented.

[0044] Embodiments of the present invention provide a microstate template generation method and terminal device, relating to the field of brain science and technology. The microstate template generation method includes: obtaining an EEG signal training sample set, training a classifier based on the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier; updating the EEG signal training sample set, and continuing to obtain an EEG signal training sample set, training a classifier based on the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier until the accuracy reaches a maximum, which is recorded as the target accuracy; using the EEG signal training sample set corresponding to the target accuracy as the target sample set, and determining a target microstate template based on the target sample set. In this embodiment of the present invention, the EEG signal training sample set is repeatedly updated, and the accuracy of the data in the EEG signal training sample set is verified using the accuracy of the classifier, thereby obtaining a high-quality EEG signal training sample set, removing some low-quality data from the sample set, and then using this data to determine the microstate template, effectively improving the quality of the microstate template. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a flowchart of a method for generating a microstate template according to an embodiment of the present invention;

[0046] Figure 2 Schematic diagram of generating an intermediate microstate template provided by an embodiment of the present invention;

[0047] Figure 3 Schematic diagram of the changes in the microstate template graphs of the AD group and the NC group during the iterative update of the sample set according to an embodiment of the present invention;

[0048] Figure 4 Schematic diagram of the change of classification accuracy during the iterative update of the sample set according to the embodiment of the present invention;

[0049] Figure 5 Schematic diagram of the structure of the micro-state template generation device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0051] EEG microstates are a method for recording resting-state brain activity using multi-channel electroencephalograms (EEGs). They reflect spontaneous, temporally synchronized, and spatially large-scale patterns of cortical neuronal activity. Alterations in microstate characteristics may be closely correlated with disease-induced changes in neural activity and therefore serve as potential biomarkers for screening neuropsychiatric disorders. In recent years, EEG microstate analysis, as a tool for describing the spatiotemporal dynamics of large-scale electrophysiological data, has been widely used in the field of neuroscience.

[0052] Traditional EEG microstate research is primarily divided into basic characteristics research and applied research. Basic characteristics research focuses on two main areas: first, microstate pattern extraction, which involves clustering EEG signals according to spatial characteristics through clustering algorithms (such as K-means clustering and hierarchical clustering), identifying different microstate patterns, and generating microstate templates; second, the exploration of spatiotemporal characteristics, including spatial source localization analysis (such as dipole localization) and temporal dynamic characteristics analysis (such as microstate duration, transition frequency, and sequence patterns) to reveal dynamic changes in brain function. Applied research involves changes in microstate parameters associated with brain diseases, changes in microstate parameters associated with cognitive tasks, and the relationship between microstates and functional networks.

[0053] Generating high-quality microstate templates is fundamental to EEG microstate analysis, and their quality significantly impacts subsequent analysis. To improve template quality, clustering methods and the optimal number of clusters are often selected. However, during the template extraction process, factors such as high noise and non-representative data often interfere with template accuracy and classification performance. Therefore, it is desirable to improve template quality through data optimization.

[0054] In the existing technology, during the template extraction process, data preprocessing is usually carried out by filtering, removing baseline drift and noise, etc. to eliminate some noise, but it is unable to effectively remove data irrelevant to the analysis target, resulting in low quality of the generated microstate template.

[0055] Based on the above, see Figure 1 , which shows a flow chart of the implementation of the microstate template generation method provided by an embodiment of the present invention, and is described in detail as follows:

[0056] The above-mentioned microstate template generation method includes:

[0057] S101: Obtain an EEG signal training sample set, train a classifier based on the EEG signal training sample set to obtain a trained classifier, and determine the accuracy of the trained classifier;

[0058] In the embodiment of the present invention, an EEG signal training sample set is obtained to train the classifier and determine the accuracy of the classifier. At this time, the EEG signal training sample set is an initially formed EEG signal training sample set and has not been updated.

[0059] For example, 95 patients with Alzheimer's disease (AD) and 83 cognitively normal (NC) subjects, totaling 178 subjects, were selected. The age distribution was as follows (mean ± SD): 68.76 ± 8.65 years for the AD patients and 68.39 ± 6.31 years for the NC subjects. A 16-channel electrode cap (including Fp1, Fp2, F3, F4, C3, C4, P3, P4, O1, O2, F7, F8, T3, T4, T5, and T6) was placed according to the EEG recording system. The impedance of all electrode leads was less than 5 kΩ, the sampling rate was 1000 Hz, and the acquisition time for each subject exceeded 5 minutes. During data acquisition, the subjects sat in a relaxed position with their eyes closed and remained awake.

[0060] 30 samples of data were randomly selected from each of the AD and NC groups to form the EEG signal training sample set, and the remaining samples formed the test sample set. The classifier was trained using these 60 samples and its accuracy was determined.

[0061] It should be noted that the original EEG data can also be filtered, baseline drift and noise removed, and other operations can be performed to form EEG signal training sample sets and test sample sets to improve data quality.

[0062] For example, the above EEG data is band-pass filtered from 1 to 45 Hz, and then down-sampled to 250 Hz to reduce the amount of data. Next, the processed data is divided into several segments of 2 seconds in length. In order to remove artifacts, in the preprocessing process, in order to ensure that the sample size of each subject is relatively balanced, 10 to 30 data segments of each subject are randomly selected for analysis (subjects with less than 10 data segments are excluded, and for subjects with more than 30 data segments, 30 data segments are randomly selected for subsequent analysis). Finally, all data are band-pass filtered twice from 2 Hz to 20 Hz, and the data are re-referenced again using the whole-brain average value.

[0063] Specifically, in a possible implementation, S101 may include:

[0064] S1011: Determine an intermediate microstate template based on the EEG signal training sample set;

[0065] In the embodiment of the present invention, the classifier needs to be trained in combination with the intermediate microstate template.

[0066] Specifically, in a possible implementation, S1011 may include:

[0067] 1. For any sample in the EEG signal training sample set, calculate the topographic map of the sample at the global field power peak;

[0068] Global Field Power (GFP) is a commonly used metric in EEG research. GFP measures the voltage variation of EEG signals across the entire scalp. It is calculated by calculating the root mean square value of the EEG signals recorded by all electrodes at each time point. It reflects the intensity of overall electrical activity in the cerebral cortex and can be understood as a measure of the overall "activity" of neural activity in the brain at a given moment.

[0069] The specific steps of calculating the topographic map of the sample at the peak of the global field power may include:

[0070] 1. Calculate global field power

[0071] According to the definition of GFP, at each time point, the EEG signal values recorded by all electrodes are squared, these square values are accumulated and divided by the total number of electrodes, and finally the square root of the result is taken. In this way, the GFP value corresponding to each time point can be obtained. The formula is as follows:

[0072]

[0073] in, is the number of electrodes, For the Electrode No. The potential at the moment, For all electrodes The average potential value at that moment.

[0074] 2. Determine the GFP peak. After obtaining the time series of GFP changes for the entire sample, use a data analysis algorithm to find the maximum value. The time point corresponding to this maximum value is the moment of the GFP peak.

[0075] 3. Calculate the topography of the sample at the GFP peak.

[0076] Software can be used to convert discrete electrode data into continuous scalp potential distribution based on these values and the spatial position information of the electrodes on the scalp through a specific interpolation algorithm, thereby generating an intuitive topographic map that clearly shows the spatial distribution characteristics of cerebral cortical electrical activity on the scalp at the time of GFP peak. For details, see Figure 2 .

[0077] Based on the above, a topographic map of each sample at the GFP peak can be obtained. It should be noted that a sample may correspond to multiple GFP peaks, that is, a sample may correspond to multiple topographic maps.

[0078] 2. Cluster the topographic maps of each sample at the global field power peak to obtain a preset number of cluster centers, and the preset number of cluster centers form an intermediate microstate template; wherein the intermediate microstate template includes a preset number of microstates.

[0079] Since the topography at the global field power peak can be used as a feature description to help identify and distinguish these different modes, in this embodiment of the present invention, the topography at the global field power peak of each sample is clustered, and each cluster center is used as an intermediate microstate template.

[0080] For example, the centers of gravity of the four typical microstate EEG topologies with high recognition in this research field are: right frontal-left temporal (microstate A), left frontal-right temporal (microstate B), middle frontal-occipital (microstate C), and middle frontal (microstate D). Therefore, the preset number can be 4, and thus, 4 cluster centers are obtained by clustering. The cluster centers are used as microstates, and the four microstates form the intermediate microstate template. Figure 2 .

[0081] S1012: Train the classifier based on the intermediate microstate template and the EEG signal training sample set to obtain a trained classifier.

[0082] Training a classifier requires extracting features. In an embodiment of the present invention, features can be extracted based on the intermediate microstate template obtained by the above calculation to train the classifier.

[0083] In a possible implementation, S1012 may include:

[0084] 1. For any sample in the EEG signal training sample set, calculate the microstates corresponding to each signal point in the sample and sort them in chronological order to form a microstate sequence corresponding to the sample; perform feature extraction on the microstate sequence corresponding to the sample to obtain the features of the sample;

[0085] 2. Input the features of each sample into the classifier for training to obtain a trained classifier.

[0086] Abnormal microstate sequences are common in patients with neurological diseases such as epilepsy, Alzheimer's disease, and schizophrenia. For example, during an epileptic seizure, the duration, frequency, and sequential patterns of microstates can differ significantly from those in healthy individuals, providing potential biomarkers for early diagnosis, disease monitoring, and treatment efficacy assessment.

[0087] Based on this, in the embodiment of the present invention, sample features are extracted based on the microstate sequence to train the classifier. For any sample, since each signal point corresponds to a brain topology, the microstates of each signal point are calculated to form a microstate sequence.

[0088] Specifically, the correlation between each signal point and the four microstates can be calculated, and the microstate with the largest correlation is used as the microstate of the signal point, thereby obtaining a microstate sequence as shown below: ABBCDABDAAABCD...

[0089] Based on the above, abnormalities in microstate sequences can be used to identify patients with neurological diseases. Based on this, in an embodiment of the present invention, features of microstate sequences are extracted for classifier training.

[0090] In one possible implementation, extracting features from the microstate sequence corresponding to the sample to obtain features of the sample may include:

[0091] According to the first formula, the time factor conversion probability of the microstate sequence corresponding to the sample is calculated, and the time factor conversion probability is used as the feature of the sample;

[0092] The first formula can be:

[0093]

[0094] in, Microstate The time factor transition probability of the microstate, Microstate within the segment The next microstate after the occurrence is The probability of Microstate within the segment Probability of occurrence; For each microstate.

[0095] In the embodiment of the present invention, the time factor conversion probability is used as the sample feature. For example, if the microstates include: A, B, C, and D, then the extracted 、 、 、 、 、 、 、 、 、 、 、 , a total of 12 parameters form the characteristics of the sample in a preset order.

[0096] At the same time, the label of the AD group is set to 0, and the label of the NC group is set to 1, and the classifier is trained to obtain a trained classifier.

[0097] Furthermore, the classifier can be verified using a test sample set to obtain the accuracy of the classifier.

[0098] Specifically, the same method as above can be used to extract the features of each sample in the test sample set to determine the accuracy of the classifier, and the details will not be repeated here.

[0099] S102: updating the EEG signal training sample set, and jumping to the step of obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and continuing to perform the steps of determining the accuracy of the trained classifier until the accuracy reaches a maximum, and recording the accuracy as the target accuracy;

[0100] The EEG training sample set is continuously updated, and the classifier is trained and its accuracy calculated using the updated EEG training sample set. If the accuracy improves, it indicates that the updated EEG training sample set is better. After continuous updates, the accuracy is maximized. The EEG training sample set with the highest accuracy is the optimal sample set and can be used to determine the target microstate template.

[0101] Specifically, in a possible implementation, S102 may include:

[0102] S1021: Delete samples in the EEG signal training sample set to obtain an updated EEG signal training sample set, jump to the step of obtaining the EEG signal training sample set, train a classifier based on the EEG signal training sample set to obtain a trained classifier, and continue to determine the accuracy of the trained classifier until the accuracy reaches a maximum;

[0103] S1022: Add the samples in the test sample set to the EEG signal training sample set to form an updated EEG signal training sample set, and jump to obtaining the EEG signal training sample set, train the classifier according to the EEG signal training sample set to obtain a trained classifier, and continue to perform the steps of determining the accuracy of the trained classifier until the accuracy reaches the maximum, and record the accuracy as the target accuracy.

[0104] Deleting samples from the EEG training set removes possible outliers, noise, or samples that negatively impact classifier performance. These undesirable samples can interfere with the classifier's learning process, leading to model overfitting or decreased generalization. By deleting samples, the training set becomes purer. Each time a sample is deleted and the classifier is retrained, the classifier's accuracy is reevaluated. This process continues until maximum accuracy is achieved, meaning different sample combinations are constantly being tried to find the optimal sample set. Note that the number of samples deleted can be 0, 1, or more to find the sample combination with the highest accuracy.

[0105] Adding samples from the test set to the EEG training set increases the diversity and richness of the training samples. Each time a sample is added, the classifier is retrained and the accuracy is evaluated until maximum accuracy is achieved. This process allows us to explore the best approach to optimize classifier performance by rationally expanding the sample set and finding the optimal sample combination. Similarly, the number of added samples can be 0, 1, or more to find the sample combination that maximizes accuracy.

[0106] The embodiment of the present invention adopts this simple sample deletion and screening method, which is more direct and effective. It does not require additional complex algorithms and a large amount of computing resources to process sample data. Instead, it finds the optimal sample combination at a lower computing cost by continuously trying different sample combinations.

[0107] In a possible implementation, S1021 may include:

[0108] 1. Use the current EEG signal training sample set as the first initial sample set;

[0109] 2. =1;

[0110] 3. For the Any sample in the first initial sample set, remove the sample from the The first initial sample set is deleted to form an updated EEG signal training sample set; the classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy corresponding to the sample;

[0111] 4. Select The maximum accuracy among the accuracies corresponding to the samples in the first initial sample set is used as the updated EEG signal training sample set corresponding to the maximum accuracy. The first initial sample set;

[0112] 5. Determine the Is the accuracy corresponding to the first initial sample set greater than that of the The accuracy corresponding to the first initial sample set;

[0113] 6. If so, then , and jump to the Any sample in the first initial sample set, remove the sample from the The first initial sample set is deleted to form an updated EEG signal training sample set; the classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy corresponding to the sample step to continue execution;

[0114] 7. If not, then The first initial sample set is used as the current EEG signal training sample set.

[0115] For example, the current EEG signal training sample set contains 60 samples;

[0116] 1. =1, then the first initial sample set contains 60 samples, and only one sample in the sample set is deleted each time. For example, the first time sample No. 1 is deleted, leaving samples No. 2 to 60; the second time sample No. 2 is deleted, leaving samples No. 1 and No. 3 to 60; and so on, the accuracy of 60 new sample sets is obtained, and 60 accuracy values are obtained. After comparing the sizes, the sample corresponding to the maximum accuracy value is actually deleted from the first initial sample set to form the second first initial sample set; wherein, the second first initial sample set contains 59 samples;

[0117] 2. Compare the accuracy corresponding to the second first initial sample set with the accuracy corresponding to the first first initial sample set; if the accuracy corresponding to the second first initial sample set is not greater than the accuracy corresponding to the first first initial sample set, it means that the accuracy has decreased after deletion, then stop the loop and no longer update the sample set; if the accuracy corresponding to the second first initial sample set is greater than the accuracy corresponding to the first first initial sample set, then it means that the accuracy has improved after deletion, then continue the deletion work, and for the second first initial sample set, only delete one sample set at a time, calculate the accuracy corresponding to the remaining 58 samples respectively, select the sample corresponding to the maximum accuracy value and delete it from the second first initial sample set to form a third first initial sample set; wherein, the third first initial sample set contains 58 samples;

[0118] 3. Similarly, for the third first initial sample set, delete one sample each time, calculate 58 times to obtain 58 accuracies, select the maximum accuracy and compare it with the accuracy of the previous first initial sample set. If the accuracy is improved, continue to delete; if the accuracy is not improved, stop the loop; and so on, get the optimal sample set.

[0119] Based on the above, the present invention deletes one sample per loop, effectively identifying samples that negatively impact classifier accuracy. Some samples may contain noise, mislabeling, or be outliers in the data distribution, which can interfere with the classifier learning the correct patterns. By deleting these samples one by one, the training sample set becomes purer.

[0120] It should be noted that the deleted samples are not added to the test sample set.

[0121] In a possible implementation, S1022 may include:

[0122] 1. Use the current EEG signal training sample set as the first second initial sample set, and use the current test sample set as the first initial test sample set;

[0123] 2. =1;

[0124] 3. For the Any sample in the initial test sample set is added to the a second initial sample set, forming an updated EEG signal training sample set; training a classifier according to the updated EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier as the accuracy corresponding to the sample;

[0125] 4. Select The maximum accuracy among the accuracies corresponding to each sample in the initial test sample set is used as the updated EEG signal training sample set corresponding to the maximum accuracy. The second initial sample set; the sample corresponding to the maximum accuracy is selected from the The initial test samples are deleted and the An initial test sample set;

[0126] 5. Determine the Is the accuracy corresponding to the second initial sample set greater than that of the The accuracy corresponding to the second initial sample set;

[0127] 6. If so, then , and jump to the Any sample in the initial test sample set is added to the A second initial sample set is used to form an updated EEG signal training sample set; a classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy step corresponding to the sample is continued;

[0128] 7. If not, then The accuracy corresponding to the second initial sample set is taken as the target accuracy.

[0129] For example, after sample deletion, the EEG signal training sample set containing 56 samples is finally obtained as the first second initial sample set; the test sample set contains 30 samples;

[0130] 1. =1, the first initial test sample set contains 30 samples, and only one sample is added to the first second initial sample set each time. For example, the first time, sample No. 1 is added to the first second initial sample set, forming a sample set containing 57 samples; the second time, sample No. 2 is added to the first second initial sample set, forming a sample set containing 57 samples; and so on. The accuracy of the 30 new sample sets formed is calculated respectively, and 30 accuracy values are obtained. After comparing the sizes, the sample corresponding to the maximum accuracy value is actually added to the first second initial sample set to form the second second initial sample set. At this time, the second second initial sample set contains 57 samples.

[0131] 2. Compare the accuracy corresponding to the second second initial sample set with the accuracy corresponding to the first second initial sample set; if the accuracy corresponding to the second second initial sample set is not greater than the accuracy corresponding to the first second initial sample set, it means that the accuracy has decreased after adding samples, and the loop is stopped without updating the sample set; if the accuracy corresponding to the second second initial sample set is greater than the accuracy corresponding to the first second initial sample set, it means that the accuracy has improved after adding samples, and the addition work is continued;

[0132] 3. At this point, there are 29 samples remaining in the second initial test sample set. These 29 samples are added to the second second initial sample set, forming 29 new sample sets containing 58 samples each. The accuracy is calculated for each set, and the maximum accuracy is compared with the accuracy of the previous second initial sample set. If the accuracy improves, continue to increase it; otherwise, stop the loop. Repeat this process until the optimal sample set is obtained.

[0133] Similarly, adding only one sample in each cycle can verify the contribution of each sample to the classifier performance, which helps to screen out samples that have an important impact on the classification results. It can also find some samples that may have a negative impact on the classifier performance, thereby providing a basis for sample selection and processing.

[0134] S103: Using the EEG signal training sample set corresponding to the target accuracy as the target sample set, and determining the target microstate template based on the target sample set.

[0135] The EEG signal training sample set corresponding to the target accuracy is the optimal sample set. The same method as above can be used to determine the topographic map at the global field power peak of each sample, and then cluster to obtain the target microstate template. The specific steps will not be repeated here.

[0136] In an embodiment of the present invention, the accuracy of the model is used to judge the quality of the data, and the EEG signal training sample set is continuously updated. By updating and eliminating data with poor collection quality and low correlation, the data with the highest model accuracy, that is, better quality data, is screened out, thereby effectively improving the quality and applicability of the template, and providing a more solid and reliable basis for the diagnosis and treatment of related diseases.

[0137] In a possible implementation, the classifier may be a SVM (Support Vector Machine Classifier) classifier.

[0138] In a possible implementation, the clustering algorithm may be a K-means algorithm (K-Means Clustering Algorithm).

[0139] Based on the 60 samples obtained in the above embodiment, the initial classification accuracy is 74.2%. After removing six subjects in turn (AD group: No. 1, 14, 22; NC group: No. 2, 6, 8), the classification accuracy no longer improves, and the data deletion process is terminated. Subsequently, four subjects (AD group: No. 16; NC group: No. 2, 26, 9) are added from the test sample set in turn to the updated EEG signal training sample set formed after the above deletion. The classification accuracy finally reaches the highest value of 86.4% and remains stable, and the cyclic update process ends. During this process, the microstate template graphs of the AD group and the NC group change as shown below. Figure 3 As shown in the figure (the upper part of the group template is the AD group and the lower part is the NC group), the classification accuracy changes as follows Figure 4 shown.

[0140] It should be understood that the order of execution of the steps in the above embodiments does not necessarily mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0141] The following are device embodiments of the present invention. For details not fully described therein, reference may be made to the corresponding method embodiments described above.

[0142] Figure 5 A schematic diagram of the structure of a microstate template generating device provided by an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:

[0143] like Figure 5 As shown, the microstate template generating device includes:

[0144] The model training module 21 is used to obtain an EEG signal training sample set, train a classifier based on the EEG signal training sample set to obtain a trained classifier, and determine the accuracy of the trained classifier;

[0145] The sample updating module 22 is used to update the EEG signal training sample set and jump to the step of obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and continuing to perform the steps of determining the accuracy of the trained classifier until the accuracy reaches a maximum, and recording the accuracy as the target accuracy;

[0146] The template output module 23 is configured to use the EEG signal training sample set corresponding to the target accuracy as the target sample set, and determine the target microstate template based on the target sample set.

[0147] In a possible implementation, the sample updating module 22 may include:

[0148] a sample deletion unit, configured to delete samples from the EEG signal training sample set to obtain an updated EEG signal training sample set, and jump to the step of obtaining the EEG signal training sample set, training a classifier based on the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier until the accuracy reaches a maximum;

[0149] The sample adding unit is used to add samples in the test sample set to the EEG signal training sample set to form an updated EEG signal training sample set, and jump to obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and continuing to perform the steps of determining the accuracy of the trained classifier until the accuracy reaches the maximum, and the accuracy is recorded as the target accuracy.

[0150] In a possible implementation, the sample deletion unit may be specifically configured to:

[0151] 1. Use the current EEG signal training sample set as the first initial sample set;

[0152] 2. =1;

[0153] 3. For the Any sample in the first initial sample set, remove the sample from the The first initial sample set is deleted to form an updated EEG signal training sample set; the classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy corresponding to the sample;

[0154] 4. Select The maximum accuracy among the accuracies corresponding to the samples in the first initial sample set is used as the updated EEG signal training sample set corresponding to the maximum accuracy. The first initial sample set;

[0155] 5. Determine the Is the accuracy corresponding to the first initial sample set greater than that of the The accuracy corresponding to the first initial sample set;

[0156] 6. If so, then , and jump to the Any sample in the first initial sample set, remove the sample from the The first initial sample set is deleted to form an updated EEG signal training sample set; the classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy corresponding to the sample step to continue execution;

[0157] 7. If not, then The first initial sample set is used as the current EEG signal training sample set.

[0158] In a possible implementation, the sample adding unit may be specifically configured to:

[0159] 1. Use the current EEG signal training sample set as the first second initial sample set, and use the current test sample set as the first initial test sample set;

[0160] 2. =1;

[0161] 3. For the Any sample in the initial test sample set is added to the a second initial sample set, forming an updated EEG signal training sample set; training a classifier according to the updated EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier as the accuracy corresponding to the sample;

[0162] 4. Select The maximum accuracy among the accuracies corresponding to each sample in the initial test sample set is used as the updated EEG signal training sample set corresponding to the maximum accuracy. The second initial sample set; the sample corresponding to the maximum accuracy is selected from the The initial test samples are deleted and the An initial test sample set;

[0163] 5. Determine the Is the accuracy corresponding to the second initial sample set greater than that of the The accuracy corresponding to the second initial sample set;

[0164] 6. If so, then , and jump to the Any sample in the initial test sample set is added to the A second initial sample set is used to form an updated EEG signal training sample set; a classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy step corresponding to the sample is continued;

[0165] 7. If not, then The accuracy corresponding to the second initial sample set is taken as the target accuracy.

[0166] In one possible implementation, the model training module 21 may include:

[0167] An intermediate template output unit, used to determine an intermediate microstate template based on an EEG signal training sample set;

[0168] The classifier training unit is used to train the classifier according to the intermediate microstate template and the EEG signal training sample set to obtain a trained classifier.

[0169] In a possible implementation, the intermediate template output unit may include:

[0170] A topographic map output subunit is used to calculate the topographic map of any sample in the EEG signal training sample set at the peak of the global field power;

[0171] The clustering subunit is used to cluster the topographic maps of each sample at the global field power peak to obtain a preset number of cluster centers, and the preset number of cluster centers form an intermediate microstate template; wherein the intermediate microstate template includes a preset number of microstates.

[0172] In a possible implementation, the preset number may be 4.

[0173] In a possible implementation, the classifier training unit may include:

[0174] The feature extraction subunit is used to calculate the microstates corresponding to each signal point in any sample in the EEG signal training sample set, and sort them in chronological order to form a microstate sequence corresponding to the sample; perform feature extraction on the microstate sequence corresponding to the sample to obtain the features of the sample;

[0175] The training subunit is used to input the features of each sample into the classifier for training to obtain a trained classifier.

[0176] In one possible implementation, the feature extraction subunit may be specifically configured to: calculate, according to the first formula, a time factor conversion probability of the microstate sequence corresponding to the sample, and use the time factor conversion probability as a feature of the sample;

[0177] The first formula can be:

[0178]

[0179] in, Microstate The time factor transition probability of the microstate, Microstate within the segment The next microstate after the occurrence is The probability of Microstate within the segment Probability of occurrence; For each microstate.

[0180] An embodiment of the present invention further provides a terminal device comprising a memory and a processor. The memory stores a computer program, and the processor, when executing the computer program, implements the method described in the above method embodiment. By way of example, the terminal device may be a computing device such as a desktop computer, a laptop, a PDA, or a cloud server, but is not limited here.

[0181] In the above embodiments, the descriptions of each embodiment have their own focus. For parts not described or recorded in detail in one embodiment, please refer to the relevant descriptions of other embodiments. Unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other. The technical features of different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0182] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A method for generating a microstate template, characterized in that: include: Obtaining an EEG signal training sample set, training a classifier based on the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier; Updating the EEG signal training sample set, jumping to the step of obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and continuing to determine the accuracy of the trained classifier until the accuracy reaches a maximum, and recording the accuracy as the target accuracy; The EEG signal training sample set corresponding to the target accuracy is used as the target sample set, the topographic map of each sample in the target sample set at the global field power peak is extracted, and a clustering algorithm is used to determine the target microstate template; The steps of updating the EEG signal training sample set, jumping to obtaining the EEG signal training sample set, training the classifier according to the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier are continued until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy, including: Deleting samples from the EEG signal training sample set to obtain an updated EEG signal training sample set, and jumping to the step of obtaining the EEG signal training sample set, training a classifier according to the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier, and continuing to execute the steps until the accuracy reaches a maximum; Add the samples in the test sample set to the EEG signal training sample set to form an updated EEG signal training sample set, and jump to the step of obtaining the EEG signal training sample set, train the classifier according to the EEG signal training sample set to obtain a trained classifier, and continue to determine the accuracy of the trained classifier until the accuracy reaches the maximum, and record the accuracy as the target accuracy.

2. The microstate template generation method according to claim 1, characterized in that: The steps of deleting samples from the EEG signal training sample set to obtain an updated EEG signal training sample set, jumping to the step of obtaining the EEG signal training sample set, training a classifier according to the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier are continued until the accuracy reaches a maximum, including: The current EEG signal training sample set is used as the first initial sample set; =1; For the Any one of the samples in the first initial sample set, the sample is removed from the first The first initial sample set is deleted to form an updated EEG signal training sample set; the classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy corresponding to the sample; Select the The maximum accuracy among the accuracies corresponding to the samples in the first initial sample set is used as the updated EEG signal training sample set corresponding to the maximum accuracy. The first initial sample set; Determine the Is the accuracy corresponding to the first initial sample set greater than that of the The accuracy corresponding to the first initial sample set; If so, then , and jump to the Any one of the samples in the first initial sample set, the sample is removed from the first The first initial sample set is deleted to form an updated EEG signal training sample set; the classifier is trained according to the updated EEG signal training sample set to obtain a trained classifier, and the accuracy of the trained classifier is determined as the accuracy corresponding to the sample to continue the step; If not, then the The first initial sample set is used as the current EEG signal training sample set.

3. The microstate template generation method according to claim 1, characterized in that: The steps of adding samples in the test sample set to the EEG signal training sample set to form an updated EEG signal training sample set, jumping to the step of obtaining the EEG signal training sample set, training a classifier according to the EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier are continued until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy, including: The current EEG signal training sample set is used as the first second initial sample set, and the current test sample set is used as the first initial test sample set; =1; For the Any sample in the initial test sample set is added to the a second initial sample set, forming an updated EEG signal training sample set; training the classifier according to the updated EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier as the accuracy corresponding to the sample; Select the The maximum accuracy among the accuracies corresponding to each sample in the initial test sample set is used as the updated EEG signal training sample set corresponding to the maximum accuracy. a second initial sample set; taking the sample corresponding to the maximum accuracy from the first The initial test samples are deleted and the An initial test sample set; Determine the Is the accuracy corresponding to the second initial sample set greater than that of the The accuracy corresponding to the second initial sample set; If so, then , and jump to the Any sample in the initial test sample set is added to the a second initial sample set, forming an updated EEG signal training sample set; training the classifier according to the updated EEG signal training sample set to obtain a trained classifier, and determining the accuracy of the trained classifier as the accuracy corresponding to the sample; and continuing to execute the step; If not, then the The accuracy corresponding to the second initial sample set is used as the target accuracy.

4. The microstate template generation method according to any one of claims 1 to 3, characterized in that: The step of training a classifier according to the EEG signal training sample set to obtain a trained classifier includes: determining an intermediate microstate template based on the EEG signal training sample set; The classifier is trained according to the intermediate microstate template and the EEG signal training sample set to obtain a trained classifier.

5. The microstate template generation method according to claim 4, characterized in that: The determining of the intermediate microstate template according to the EEG signal training sample set includes: For any sample in the EEG signal training sample set, calculating a topographic map of the sample at a global field power peak; Clustering is performed on the topographic maps of each sample at the global field power peak to obtain a preset number of cluster centers, and the preset number of cluster centers form the intermediate microstate template; wherein the intermediate microstate template includes the preset number of microstates.

6. The microstate template generation method according to claim 5, characterized in that: The preset number is 4.

7. The microstate template generation method according to claim 4, characterized in that: The step of training the classifier according to the intermediate microstate template and the EEG signal training sample set to obtain a trained classifier includes: For any sample in the EEG signal training sample set, calculate the microstate corresponding to each signal point in the sample, and sort them in chronological order to form a microstate sequence corresponding to the sample; perform feature extraction on the microstate sequence corresponding to the sample to obtain the features of the sample; The features of each sample are input into the classifier for training to obtain the trained classifier.

8. The microstate template generation method according to claim 7, characterized in that: The feature extraction of the microstate sequence corresponding to the sample to obtain the features of the sample includes: Calculate the time factor conversion probability of the microstate sequence corresponding to the sample according to the first formula, and use the time factor conversion probability as the feature of the sample; The first formula is: in, Microstate The time factor transition probability of the microstate, Microstate within the segment The next microstate after the occurrence is The probability of Microstate within the segment Probability of occurrence; For each microstate.

9. A terminal device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the microstate template generation method according to any one of claims 1 to 8 when executing the computer program.

Citation Information

Patent Citations

  • Method and device for generating sample data

    CN111539479A

  • Electroencephalogram micro-state template extraction method and device, terminal and storage medium

    CN118383777A

  • Mental fatigue degree testing method

    CN119770057A