Micro-state template generation method and terminal equipment
By constantly updating the EEG signal training sample set and training the classifier until the accuracy reaches maximum, the problem of low quality of micro-state templates in the existing technology is solved, and higher quality template generation is achieved.
Patent Information
- Application Number
- CN202510435780.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-04-09
AI Technical Summary
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.
By obtaining the EEG signal training sample set, the classifier is trained and the sample set is constantly updated until the classifier accuracy reaches maximum, thereby determining the target micro-state template.
Improve the quality of micro-state templates, reduce the impact of noise and non-representative data, and enhance the accuracy and classification performance of the template.
Smart Images

Figure CN119961735A_ABST
Abstract
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 of recording resting-state activity of the human brain based on multi-channel electroencephalogram (EEG). They reflect spontaneous, time-synchronized, and spatially large-scale patterns of cortical neuronal activity. Changes in microstate characteristics may be closely related to changes in neural activity caused by diseases, and therefore can be used as potential biomarkers for screening neuropsychiatric diseases. In recent years, EEG microstate analysis has been widely used in the field of neuroscience as a tool to describe the spatiotemporal dynamic characteristics of large-scale electrophysiological data. Generating high-quality microstate templates is the basis of EEG microstate analysis, and the quality of the templates has an important impact on subsequent analysis.
[0003] In the prior art, 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 embodiment of the present invention provides 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: Obtaining an 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; The step of 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 is continued until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy; 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 according to the target sample set.
[0006] Optionally, 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 continuing to determine the accuracy of the trained classifier until the accuracy reaches a maximum, and recording the accuracy as the target accuracy, including: 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 the classifier according to the EEG signal training sample set to obtain a trained classifier, and continue to perform the step of determining the accuracy of the trained classifier until the accuracy reaches a maximum; 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 perform the steps of determining the accuracy of the trained classifier until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy.
[0007] 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: The current EEG signal training sample set is used as the first initial sample set; =1; For the Any sample in the first initial sample set is selected 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; 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. A first initial sample set; Determine 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 sample in the first initial sample set is selected 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 to execute; If not, then The first initial sample set is used as the current EEG signal training sample set.
[0008] 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 step of 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 is 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 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; 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. a 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; Determine 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 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 step corresponding to the sample; and continuing to execute; If not, then The accuracy corresponding to the second initial sample set is taken as the target accuracy.
[0009] Optionally, training the classifier according to the EEG signal training sample set to obtain a trained classifier includes: Determine the 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.
[0010] Optionally, determining an intermediate microstate template based on an EEG signal training sample set includes: For any sample in the EEG signal training sample set, calculate the topographic map of the sample at the peak of the global field power; 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.
[0011] Optional, the preset number is 4.
[0012] Optionally, the classifier is trained according to the intermediate microstate template and the EEG signal training sample set to obtain a trained classifier, including: For any sample in the EEG signal training sample set, the microstates corresponding to each signal point in the sample are calculated, and the microstate sequence corresponding to the sample is formed by sorting them in chronological order; the feature extraction of the microstate sequence corresponding to the sample is performed to obtain the feature of the sample; The features of each sample are input into the classifier for training to obtain a trained classifier.
[0013] Optionally, feature extraction is performed on the microstate sequence corresponding to the sample to obtain features of the sample, including: 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; The first formula is:
[0014] in, Microstate The transition probability with the time factor of the microstate, Microstate within a segment After the occurrence of the next microstate is The probability of Microstate within a segment Probability of occurrence; For each microstate.
[0015] In a second aspect, an embodiment of the present invention provides a terminal device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the micro-state template generation method in the first aspect or any possible implementation method of the first aspect.
[0016] The embodiment of the present invention provides a microstate template generation method and terminal device, which relates to the field of brain science and technology. The above-mentioned microstate template generation method includes: obtaining an 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; updating the EEG signal training sample set, and jumping to the step of obtaining an 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, until the accuracy reaches the maximum, and the accuracy is recorded as the target accuracy; 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 according to the target sample set. In the 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 by using the accuracy of the classifier, so as to obtain an EEG signal training sample set with better quality, remove some poor quality data in the sample set, and then use the data to determine the microstate template, and the quality of the microstate template is effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of an implementation of a microstate template generation method provided by an embodiment of the present invention; Figure 2 is a schematic diagram of generating an intermediate microstate template provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of the change of the microstate template graphs of the AD group and the NC group during the update iteration of the sample set according to the embodiment of the present invention; Figure 4 is a schematic diagram of changes in classification accuracy during the iterative update of a sample set according to an embodiment of the present invention; Figure 5 It is a schematic diagram of the structure of a micro-state template generating device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0019] EEG microstates are a method based on multi-channel electroencephalogram (EEG) to record resting-state activity of the human brain. They reflect spontaneous, time-synchronized, and spatially large-scale patterns of cortical neuronal activity. Changes in microstate characteristics may be closely related to changes in neural activity caused by diseases, and therefore can be used as potential biomarkers for screening neuropsychiatric diseases. In recent years, EEG microstate analysis has been widely used in the field of neuroscience as a tool to describe the spatiotemporal dynamic characteristics of large-scale electrophysiological data.
[0020] Traditional EEG microstate research is mainly divided into basic characteristics research and applied research. Basic characteristics research is mainly concentrated in two directions: one is microstate pattern extraction, including clustering EEG signals according to spatial characteristics through clustering algorithms (such as K-means clustering, hierarchical clustering, etc.), identifying different microstate patterns, and generating microstate templates; the second is spatiotemporal characteristics exploration, including source localization analysis at the spatial level (such as dipole localization) and dynamic characteristics analysis in the time dimension (such as the duration, conversion frequency and sequence pattern of microstates) to reveal the dynamic changes of brain function. Applied research involves changes in microstate parameters related to brain diseases, changes in microstate parameters related to cognitive tasks, and the relationship between microstates and functional networks.
[0021] Generating high-quality microstate templates is the basis for EEG microstate analysis, and the quality of the template has an important impact on subsequent analysis. To improve the quality of the template, it is usually improved by selecting the clustering method and the optimal number of clusters. However, in the process of template extraction, factors such as high noise and non-representative data often interfere with the accuracy and classification performance of the template. Therefore, it is hoped that the quality of the template can be improved from the perspective of data optimization.
[0022] In the prior art, during the template extraction process, data preprocessing is usually performed by filtering, removing baseline drift and noise, etc. to eliminate some noise, but it is impossible to effectively remove data irrelevant to the analysis target, resulting in low quality of the generated microstate template.
[0023] 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, which is described in detail as follows: The above-mentioned microstate template generation method includes: S101: obtaining an 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; 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.
[0024] For example, 95 Alzheimer's disease (AD) patients and 83 cognitively normal (NC) subjects were selected, a total of 178 subjects. The age distribution was as follows (mean ± standard deviation): the age of AD patients was (68.76 ± 8.65) years old, and the age of NC subjects was (68.39 ± 6.31) years old. According to the EEG recording system, 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. The impedance values of all electrode wires were less than 5KΩ, the sampling rate was 1000Hz, and the acquisition time for each subject was more than 5 minutes. When collecting data, the subjects were in a sitting position, relaxed, and closed their eyes to stay awake.
[0025] 30 samples were randomly selected from each of the AD group and the NC group to form the EEG signal training sample set, and the remaining samples formed the test sample set. The classifier was trained using the above 60 samples and the accuracy was determined.
[0026] It should be noted that the original EEG data can also be filtered, baseline drift and noise can be removed, and then EEG signal training sample sets and test sample sets can be formed to improve data quality.
[0027] For example, the above EEG data is bandpass filtered from 1 to 45 Hz, and then downsampled 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 bandpass filtered twice from 2Hz to 20Hz, and the data are re-referenced again using the whole-brain average value.
[0028] Specifically, in a possible implementation, S101 may include: S1011: determining an intermediate microstate template according to an EEG signal training sample set; In the embodiment of the present invention, the classifier needs to be trained in combination with the intermediate microstate template.
[0029] Specifically, in a possible implementation manner, S1011 may include: 1. For any sample in the EEG signal training sample set, calculate the topographic map of the sample at the peak of the global field power; Global Field Power (GFP) is a commonly used indicator in EEG research. GFP is a measure of the voltage change of EEG signals across the scalp. It is obtained by calculating the root mean square value of the EEG signals recorded by all electrodes at each time point, reflecting the intensity of the overall electrical activity of the cerebral cortex. It can be understood as an indicator to measure the "activity" of the overall neural activity of the brain at a certain moment.
[0030] The specific steps of calculating the topographic map of the sample at the peak of the global field power may include: 1. Calculate global field power According to the definition of GFP, at each time point, the EEG signal values recorded by all electrodes are squared, and then these square values are accumulated and divided by the total number of electrodes. Finally, the square root of the result is taken, so that the GFP value corresponding to each time point can be obtained. The formula is as follows:
[0031] in, is the number of electrodes, For the Electrode No. The potential at the moment, For all electrodes The average potential value at that time.
[0032] 2. Determine the GFP peak value. After obtaining the time-varying sequence of GFP of the entire sample, find the maximum value through the data analysis algorithm. The time point corresponding to the maximum value is the time when the GFP peak value is located.
[0033] 3. Calculate the topography of the sample at the GFP peak.
[0034] 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 the cerebral cortical electrical activity on the scalp at the peak of GFP. For details, see Figure 2 .
[0035] Based on the above, the 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.
[0036] 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.
[0037] Since the topographic map at the global field power peak can be used as a feature description to help identify and distinguish these different modes, in the embodiment of the present invention, the topographic maps of each sample at the global field power peak are clustered, and each cluster center is used as an intermediate microstate template.
[0038] For example, the center 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, four cluster centers are obtained by clustering. The cluster centers are used as microstates, and the four microstates form an intermediate microstate template. Figure 2 .
[0039] S1012: Train the classifier according to the intermediate microstate template and the EEG signal training sample set to obtain a trained classifier.
[0040] Training a classifier requires extracting features. The embodiment of the present invention can extract features based on the intermediate microstate template obtained by the above calculation to train the classifier.
[0041] In a possible implementation, S1012 may include: 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; 2. Input the features of each sample into the classifier for training to obtain a trained classifier.
[0042] Microstate sequences are often abnormal in patients with neurological diseases such as epilepsy, Alzheimer's disease, and schizophrenia. For example, during an epileptic seizure, the duration, frequency, and sequence pattern of microstates may be significantly different from those of healthy people, which provides potential biomarkers for early diagnosis, disease monitoring, and treatment effect evaluation of the disease.
[0043] 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 microstate of each signal point is calculated to form a microstate sequence.
[0044] 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... Based on the above, the abnormality of the microstate sequence can be used to identify patients with neurological diseases. Based on this, in the embodiment of the present invention, the features of the microstate sequence are extracted for the training of the classifier.
[0045] In a possible implementation, extracting features from the microstate sequence corresponding to the sample to obtain features of the sample may include: 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; The first formula can be:
[0046] in, Microstate The transition probability with the time factor of the microstate, Microstate within a segment After the occurrence of the next microstate is The probability of Microstate within a segment Probability of occurrence; For each microstate.
[0047] In the embodiment of the present invention, the time factor conversion probability is used as the sample feature. For example, the microstates include: A, B, C, and D. Then, , , , , , , , , , , , A total of 12 parameters form the characteristics of the sample in a preset order.
[0048] 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.
[0049] Furthermore, the test sample set can be used to verify the classifier to obtain the accuracy of the classifier.
[0050] 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.
[0051] 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 step of determining 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 is continuously updated, and the updated EEG signal training sample set is used to train the classifier and calculate the accuracy; if the accuracy is improved, it means that the updated EEG signal training sample set is better. After continuous updating, the accuracy reaches the maximum, and the EEG signal training sample set with the maximum accuracy is the optimal sample set, which can be used to determine the target microstate template.
[0052] Specifically, in a possible implementation, S102 may include: 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 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 a maximum; 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 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 perform the step of determining the accuracy of the trained classifier until the accuracy reaches the maximum, and record the accuracy as the target accuracy.
[0053] Deleting samples from the EEG signal training sample set can remove possible outliers, noise samples, or samples that have a negative impact on the classifier performance. These bad samples may interfere with the classifier's learning process, causing the model to overfit or reduce generalization ability. By deleting samples, the training sample set is made purer. After each sample is deleted and the classifier is retrained, the accuracy of the classifier is re-evaluated. Continuing this process until the accuracy is maximized means constantly trying different sample combinations to find the optimal sample set. It should be noted that the number of sample deletions can be 0, 1, or more to find the sample combination with the highest accuracy.
[0054] Adding samples from the test sample set to the EEG signal training sample set can increase the diversity and richness of the training samples. Each time a sample is added and the classifier is retrained, the accuracy is evaluated until the accuracy is maximized. This process can explore the best solution to optimize the classifier performance by reasonably expanding the sample set and find the optimal sample combination. Similarly, the number of added samples can also be 0, 1, or more to find the sample combination with the highest accuracy.
[0055] 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 continuously tries different sample combinations to find the optimal sample combination at a relatively low computing cost.
[0056] In a possible implementation, S1021 may include: 1. Use the current EEG signal training sample set as the first initial sample set; 2. =1; 3. For the Any sample in the first initial sample set is selected 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; 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. A first initial sample set; 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; 6. If yes, then , and jump to the Any sample in the first initial sample set is selected 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 to execute; 7. If not, then The first initial sample set is used as the current EEG signal training sample set.
[0057] For example, the current EEG signal training sample set contains 60 samples; 1. =1, the first initial sample set contains 60 samples, and only one sample in the sample set is deleted each time. For example, sample No. 1 is deleted for the first time, and samples No. 2 to 60 remain; sample No. 2 is deleted for the second time, and samples No. 1 and No. 3 to 60 remain; 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; 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, 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; 3. Similarly, for the third first initial sample set, delete one sample each time, calculate 58 times to get 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.
[0058] Based on the above, in the embodiment of the present invention, one sample is deleted in each cycle, which can effectively identify those samples that have a negative impact on the accuracy of the classifier. Some samples may contain noise, wrong labels, or belong to outliers in the data distribution, which will interfere with the classifier learning the correct pattern. By deleting these samples one by one, the training sample set is made purer.
[0059] It should be noted that the deleted samples are not added to the test sample set.
[0060] In a possible implementation, S1022 may include: 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; 2. =1; 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; 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. a 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; 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; 6. If yes, 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 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 step corresponding to the sample; and continuing to execute; 7. If not, then The accuracy corresponding to the second initial sample set is taken as the target accuracy.
[0061] 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; 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 to form a sample set including 57 samples; the second time sample No. 2 is added to the first second initial sample set to form a sample set including 57 samples; and so on; the accuracy of the 30 new sample sets formed is calculated respectively, and 30 accuracy values are obtained. The sizes are compared, and 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; 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, then stop the loop and do not update 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, then it means that the accuracy has improved after adding samples, then continue adding; 3. At this time, there are 29 samples left in the second initial test sample set. These 29 samples are added to the second second initial sample set in turn to form 29 new sample sets containing 58 samples. The accuracy is calculated respectively, and the maximum accuracy is selected to compare with the accuracy of the previous second initial sample set. If the accuracy is improved, continue to increase; otherwise, stop the cycle. And so on, get the optimal sample set.
[0062] 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.
[0063] S103: Taking the EEG signal training sample set corresponding to the target accuracy as the target sample set, and determining the target microstate template according to the target sample set.
[0064] 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.
[0065] 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 relevance, the data with the highest model accuracy, that is, data with better quality, 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.
[0066] In a possible implementation, the classifier may be a SVM (Support Vector Machine Classifier, support vector machine) classifier.
[0067] In a possible implementation, the clustering algorithm may be a K-means algorithm (K-Means Clustering Algorithm, K-means clustering algorithm).
[0068] 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) were 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 reached the maximum value of 86.4% and remained stable, and the cyclic update process ended. During this process, the microstate template graphs of the AD group and the NC group changed 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.
[0069] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0070] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.
[0071] Figure 5 A schematic diagram of the structure of a micro-state template generating device provided by an embodiment of the present invention is shown. For ease of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows: like Figure 5 As shown, the microstate template generating device includes: The model training module 21 is used to obtain an EEG signal training sample set, train a classifier according to the EEG signal training sample set to obtain a trained classifier, and determine the accuracy of the trained classifier; 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 the trained classifier, and continuing to perform the step of determining the accuracy of the trained classifier until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy; The template output module 23 is used to use the EEG signal training sample set corresponding to the target accuracy as the target sample set, and determine the target microstate template according to the target sample set.
[0072] In a possible implementation, the sample updating module 22 may include: A sample deletion unit is used to delete samples in 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 the classifier according to 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; The sample adding unit is used to 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, 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.
[0073] In a possible implementation, the sample deletion unit may be specifically configured to: 1. Use the current EEG signal training sample set as the first initial sample set; 2. =1; 3. For the Any sample in the first initial sample set is selected 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; 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. A first initial sample set; 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; 6. If yes, then , and jump to the Any sample in the first initial sample set is selected 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 to execute; 7. If not, then The first initial sample set is used as the current EEG signal training sample set.
[0074] In a possible implementation, the sample adding unit may be specifically used for: 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; 2. =1; 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; 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. a 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; 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; 6. If yes, 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 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 step corresponding to the sample; and continuing to execute; 7. If not, then The accuracy corresponding to the second initial sample set is taken as the target accuracy.
[0075] In a possible implementation, the model training module 21 may include: An intermediate template output unit, used to determine an intermediate microstate template according to an EEG signal training sample set; 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.
[0076] In a possible implementation, the intermediate template output unit may include: A topographic map output subunit is used to calculate a topographic map of any sample in the EEG signal training sample set at the peak of the global field power; 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.
[0077] In a possible implementation manner, the preset number may be 4.
[0078] In a possible implementation, the classifier training unit may include: 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; The training subunit is used to input the features of each sample into the classifier for training to obtain a trained classifier.
[0079] In a possible implementation, the feature extraction subunit may be specifically used to: 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 can be:
[0080] in, Microstate The transition probability with the time factor of the microstate, Microstate within a segment After the occurrence of the next microstate is The probability of Microstate within a segment Probability of occurrence; For each microstate.
[0081] The embodiment of the present invention further provides a terminal device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the method in the above method embodiment when executing the computer program. Exemplarily, the terminal device can be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server, which is not limited here.
[0082] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. If there is no special explanation and logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other. The technical features in different embodiments can be combined to form a new embodiment according to their internal logical relationship.
[0083] 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 the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A method for generating a microstate template, characterized in that: include: Acquire an EEG signal training sample set, train a classifier according to the EEG signal training sample set to obtain a trained classifier, and determine the accuracy of the trained classifier; The steps of 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 determining the accuracy of the trained classifier are continued until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy; The EEG signal training sample set corresponding to the target accuracy is used as a target sample set, and a target microstate template is determined according to the target sample set.
2. The microstate template generation method according to claim 1, characterized in that: The step of 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 determining the accuracy of the trained classifier is continued until the accuracy reaches a maximum, and the accuracy is recorded as the target accuracy, including: 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 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; 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 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 the accuracy is recorded as the target accuracy.
3. The microstate template generation method according to claim 2, characterized in that: 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 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 sample in the first initial sample set, the sample is selected 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. A 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 sample in the first initial sample set, the sample is selected 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 step to continue to execute; If not, then the The first initial sample set is used as the current EEG signal training sample set.
4. The microstate template generation method according to claim 2, 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 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: 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 to form 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 first 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 is used 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 is continued; If not, then the The accuracy corresponding to the second initial sample set is used as the target accuracy.
5. The microstate template generation method according to any one of claims 1 to 4, 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 according to 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.
6. The microstate template generation method according to claim 5, characterized in that: The step of determining the intermediate microstate template according to the EEG signal training sample set comprises: For any sample in the EEG signal training sample set, calculating the topographic map of the sample at the global field power peak; 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 the intermediate microstate template; wherein the intermediate microstate template includes the preset number of microstates.
7. The microstate template generation method according to claim 6, characterized in that: The preset number is 4.
8. The method for generating a microstate template according to claim 5, 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, the microstates corresponding to the signal points in the sample are calculated, and the microstate sequences corresponding to the sample are formed by chronologically sorting the microstate sequences; and the features of the microstate sequences corresponding to the sample are extracted to obtain the features of the sample; The features of each sample are input into the classifier for training to obtain the trained classifier.
9. The method for generating a microstate template according to claim 8, characterized in that: The extracting features of the microstate sequence corresponding to the sample to obtain features of the sample includes: 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; The first formula is: in, Microstate The transition probability with the time factor of the microstate, Microstate within a segment After the occurrence of the next microstate is The probability of Microstate within a segment Probability of occurrence; For each microstate.
10. 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 micro-state template generation method as claimed in any one of claims 1 to 9 when executing the computer program.
Citation Information
Patent Citations
Classifier training method and device
CN105320957A
Sample screening method and device
CN110032624A
Method and device for generating sample data
CN111539479A
Image recognition method and system, computer equipment and readable storage medium
CN115909221A
Data selection method and device, electronic equipment and storage medium
CN116741154A