Myoelectricity artifact detection method and device, readable storage medium and terminal equipment
By detecting electromyography in EEG data online, the problem of lack of online detection methods in the prior art is solved, and the quality of EEG data acquisition and analysis efficiency are improved.
Patent Information
- Application Number
- CN202410856944.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-12-06
AI Technical Summary
The lack of online electromyography artifact detection methods in the prior art leads to poor quality of electroencephalogram data acquisition, affecting subsequent research and analysis.
By obtaining the target EEG data, extracting the lead characteristic value and detecting it based on the characteristic value and predetermined threshold, online electromyography artifact detection is realized, and lead data that is more affected by electromyography is preferred.
Real-time online detection of electromyography artifacts has been achieved, which improves detection efficiency and accuracy, and improves the availability and scenario adaptability of electromyography artifact detection methods.
Smart Images

Figure CN119074018A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to a method and apparatus for detecting electromyographic artifacts, a computer-readable storage medium, and a terminal device. Background Art
[0002] In recent years, brain science research has become one of the frontiers and hot topics in the field of life sciences. It aims to explore the internal physiological activities of the brain through EEG data. Electroencephalogram (EEG) is a non-invasive, low-cost and cost-effective EEG data recording technology that is widely used in many aspects. However, the energy of EEG data is very weak, and the amplitude reflected on the EEG is only at the microvolt level. Therefore, it is very susceptible to external interference during the acquisition process. For example, it is easily interfered by electromyographic artifacts (EMG), resulting in poor quality of the collected EEG data, which affects subsequent research and analysis.
[0003] In order to solve this problem, the prior art usually performs electromyographic artifact detection on the collected EEG data, and then removes the electromyographic artifacts from the EEG data detected to contain electromyographic artifacts. However, the current electromyographic artifact detection method (for example, Automatic EEG Artifact Detection (ADJUST)) is an offline algorithm and cannot perform online electromyographic artifact detection. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a method, an apparatus, a computer-readable storage medium and a terminal device for detecting electromyographic artifacts to solve the technical problem of the lack of an online electromyographic artifact detection method in the prior art.
[0005] A first aspect of an embodiment of the present application provides a method for detecting electromyographic artifacts, which may include:
[0006] Acquire target EEG data; wherein the target EEG data includes lead data collected by each target lead, and each target lead is located in the frontal lobe, central area, parietal lobe and occipital lobe respectively;
[0007] Extracting target lead feature values corresponding to each of the lead data respectively; wherein the target lead feature value is a lead feature value with the highest extraction priority and has not been extracted, and the extraction priority of the lead feature value is positively correlated with the extraction speed of the lead feature value;
[0008] The electromyographic artifact detection result of the target EEG data is determined according to each of the target lead characteristic values and a predetermined target characteristic value threshold; wherein the target characteristic value threshold is a characteristic value threshold corresponding to the target lead characteristic value.
[0009] A second aspect of the embodiments of the present application provides a myoelectric artifact detection device, which may include:
[0010] A target EEG data acquisition module is used to acquire target EEG data; wherein the target EEG data includes lead data collected by each target lead, and each of the target leads is located in the frontal lobe, central area, parietal lobe and occipital lobe respectively;
[0011] A target lead feature value extraction module is used to extract target lead feature values corresponding to each of the lead data respectively; wherein the target lead feature value is a lead feature value with the highest extraction priority and has not been extracted, and the extraction priority of the lead feature value is positively correlated with the extraction speed of the lead feature value;
[0012] The module for determining the result of electromyographic artifact detection is used to determine the result of electromyographic artifact detection of the target EEG data according to each of the target lead characteristic values and a predetermined target characteristic value threshold; wherein the target characteristic value threshold is the characteristic value threshold corresponding to the target lead characteristic value.
[0013] A third aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned electromyographic artifact detection methods are implemented.
[0014] The fourth aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned electromyography artifact detection methods when executing the computer program.
[0015] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the steps of any one of the above-mentioned electromyographic artifact detection methods.
[0016] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application acquire target EEG data; wherein, the target EEG data includes lead data collected by each target lead, and each of the target leads is respectively located in the frontal lobe, central area, parietal lobe and occipital lobe; the target lead characteristic values corresponding to each of the lead data are respectively extracted; wherein, the target lead characteristic value is the lead characteristic value with the highest extraction priority and has not been extracted, and the extraction priority of the lead characteristic value is positively correlated with the extraction speed of the lead characteristic value; according to each of the target lead characteristic values and a predetermined target characteristic value threshold, the electromyographic artifact detection result of the target EEG data is determined; wherein, the target characteristic value threshold is the characteristic value threshold corresponding to the target lead characteristic value. In an embodiment of the present application, electromyographic artifact detection can be performed based on lead data collected from leads located in the frontal lobe, central area, parietal lobe and occipital lobe that are more affected by electromyography; and feature extraction can be performed preferentially on lead feature values with a higher extraction speed, so that electromyographic artifacts can be detected more accurately and efficiently, and online and real-time electromyographic artifact detection can be achieved, which helps to improve the availability and scenario adaptability of the electromyographic artifact detection method. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is a flow chart of an embodiment of a method for detecting electromyographic artifacts in an embodiment of the present application;
[0019] Figure 2 It is a structural schematic diagram of a depth separator;
[0020] Figure 3 A schematic flow chart of the target feature value threshold determination process;
[0021] Figure 4 Schematic diagram of some fragments of clean EEG data;
[0022] Figure 5 A schematic diagram of a portion of simulated electromyographic data;
[0023] Figure 6 Schematic diagram of some fragments of semi-simulated EEG data;
[0024] Figure 7 This is a schematic diagram of the semi-simulated EEG data testing process;
[0025] Figure 8 A schematic diagram of the modules required for the semi-simulated EEG data testing process;
[0026] Fig. 9 The receiver operating characteristic curve for detecting the semi-simulated EEG data with EMG artifacts and the semi-simulated EEG data with real EMG artifacts;
[0027] Fig.10 The time domain comparison diagram of the two processing processes for the semi-simulated EEG data with electromyographic artifacts;
[0028] Fig.11 The frequency domain comparison diagram of the two processing processes for the semi-simulated EEG data with electromyographic artifacts;
[0029] Fig.12 The time domain comparison diagram of the two processing processes for the semi-simulated EEG data without EMG artifacts;
[0030] Fig.13 The frequency domain comparison diagram of the two processing processes for the semi-simulated EEG data without EMG artifacts;
[0031] Fig.14 This is a structural diagram of an embodiment of an electromyographic artifact detection device in an embodiment of the present application;
[0032] Fig.15 This is a schematic block diagram of a terminal device in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0034] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0035] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0036] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0037] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0038] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0039] In recent years, brain science research has become one of the frontiers and hot topics in the field of life sciences. It aims to explore the internal physiological activities of the brain through EEG data. Electroencephalogram (EEG) is a non-invasive, low-cost and cost-effective EEG data recording technology that is widely used in many aspects. However, the energy of EEG data is very weak, and the amplitude reflected on the EEG is only at the microvolt level. Therefore, it is very susceptible to external interference during the acquisition process. For example, it is easily interfered by electromyographic artifacts (EMG), resulting in poor quality of the collected EEG data, which affects subsequent research and analysis.
[0040] In order to solve this problem, the prior art usually performs electromyographic artifact detection on the collected EEG data, and then removes the electromyographic artifacts from the EEG data detected to contain electromyographic artifacts. However, the current electromyographic artifact detection method (for example, Automatic EEG Artifact Detection (ADJUST)) is an offline algorithm and cannot perform online electromyographic artifact detection.
[0041] In view of this, the embodiments of the present application provide a method, an apparatus, a computer-readable storage medium and a terminal device for detecting electromyographic artifacts to solve the technical problem of the lack of an online electromyographic artifact detection method in the prior art.
[0042] It should be noted that the execution subject of the method of the present application is a terminal device, specifically, it can be a common computing device such as a desktop computer, a notebook, a PDA, a workstation, etc., or it can be other computing devices.
[0043] In an embodiment of the present application, feature extraction can be performed on the acquired EEG data according to the priority of the feature value to obtain the feature value corresponding to the EEG data, and the feature value can be compared with a predetermined feature value threshold to determine the electromyographic artifact detection result of the EEG data.
[0044] See also Figure 1 In the embodiment of the present application, an embodiment of a method for detecting electromyographic artifacts may include:
[0045] Step S101, obtaining target EEG data.
[0046] In the embodiment of the present application, EEG data can be acquired in real time, and electromyography artifact detection can be performed on the acquired EEG data.
[0047] Since the leads that are most seriously affected by electromyographic artifacts are mainly distributed in the frontal lobe, central area, parietal lobe and occipital lobe areas, the embodiment of the present application can perform electromyographic artifact detection based on the EEG data collected by the leads in these areas.
[0048] To facilitate analysis, the acquired EEG data can be windowed to obtain individual EEG data segments, wherein the window length of the windowing processing can be specific and situational according to actual needs, and this application does not limit this. For example, it can be set to 1 second, 2 seconds, 3 seconds, etc.
[0049] The following will take any one of the EEG data segments (referred to as target EEG data) as an example to illustrate the electromyographic artifact detection method in the embodiment of the present application.
[0050] Among them, the target EEG data may include lead data collected by each target lead, each target lead is a lead that is more seriously affected by electromyographic artifacts, and each target lead is located in the frontal lobe, central area, parietal lobe and occipital lobe respectively; specifically, each target lead can be a left frontal lobe lead (F3 lead), a right frontal lobe lead (F4 lead), a left central area lead (C3), a right central area lead (C4), a left parietal lobe lead (P3), a right parietal lobe lead (P4), a left occipital lobe lead (O1) and a right occipital lobe lead (O2).
[0051] Step S102: extract target lead feature values corresponding to each lead data respectively.
[0052] In an embodiment of the present application, the lead feature values corresponding to the lead data may include the variance, C0 complexity and Hurst exponent of the lead data.
[0053] Since the extraction speeds of different lead feature values may be different, in order to improve the speed of electromyographic artifact detection, in an embodiment of the present application, feature extraction can be performed preferentially on lead feature values with a higher extraction speed to improve the efficiency of feature extraction.
[0054] Specifically, the extraction priority corresponding to each lead feature value can be set according to the extraction speed of the lead feature value; wherein the extraction priority of the lead feature value can be positively correlated with the extraction speed of the lead feature value. Here, since the extraction speed of the variance is the highest, the extraction priority of the variance can be set to the highest value among the three lead feature values; the extraction speed of the C0 complexity is the second highest, so the extraction priority of the C0 complexity can be set to the second highest value among the three lead feature values; the extraction speed of the Hurst index is the lowest, so the extraction priority of the Hurst index can be set to the lowest value among the three lead feature values.
[0055] In the embodiment of the present application, the target lead feature value corresponding to each lead data may be extracted respectively, wherein the target lead feature value is the lead feature value with the highest extraction priority and has not been extracted yet.
[0056] Step S103: Determine the electromyographic artifact detection result of the target EEG data according to the characteristic values of each target lead and a predetermined target characteristic value threshold.
[0057] In the embodiment of the present application, after extracting each target lead characteristic value, each target lead characteristic value can be compared with a predetermined target characteristic value threshold to determine the electromyographic artifact detection result of the target EEG data. The target characteristic value threshold is the characteristic value threshold corresponding to the target lead characteristic value. For example, if the target lead characteristic value is the variance of the lead data, the target characteristic value threshold is the characteristic value threshold corresponding to the variance.
[0058] Specifically, if there is at least one target lead feature value greater than the target feature value threshold, it can be determined that the electromyographic artifact detection result of the target EEG data is the presence of electromyographic artifacts, and there is no need to perform feature extraction on lead feature values with lower extraction priority.
[0059] If each target lead feature value is less than or equal to the target feature value threshold, and the target lead feature value is the lead feature value with the lowest extraction priority, it can be determined that the electromyographic artifact detection result of the target EEG data is that there is no electromyographic artifact.
[0060] If each target lead feature value is less than or equal to the target feature value threshold, and the target lead feature value is not the lead feature value with the lowest extraction priority, the process may return to step S102 and subsequent steps.
[0061] In an embodiment of the present application, after the lead data collected by each target lead is obtained, feature extraction can be performed on each lead data; at this time, since the lead feature value with the highest extraction priority and not yet extracted is the variance, the variance of each lead data can be extracted first.
[0062] Taking any target lead as an example, the variance of the lead data of the target lead can be calculated by referring to the following formula:
[0063]
[0064] Wherein, var is the variance of the lead data of the target lead, f(k) is the value of the kth sampling point in the lead data, μ is the mean of each sampling point in the lead data, and N is the number of sampling points in the lead data; for example, the sampling rate of the lead data is 256 Hz and the window length is 2 seconds, that is, the lead data contains 512 sampling points, and N is 512.
[0065] The lead data of each target lead can be subjected to variance extraction according to the above method to obtain each variance. If at least one variance among the variances is greater than the eigenvalue threshold corresponding to the variance, the electromyographic artifact detection result of the target EEG data can be directly determined to be the presence of electromyographic artifacts, and the feature extraction process can be terminated without the need to extract features from the C0 complexity and Hurst index with lower extraction priority.
[0066] Since the variance is not the lead eigenvalue with the lowest extraction priority, if each variance is less than or equal to the eigenvalue threshold corresponding to the variance, feature extraction can continue for the lead eigenvalues with a lower extraction priority; here, since the lead eigenvalue with the highest extraction priority (i.e., the variance) has been extracted, it can be determined that the lead eigenvalue with the highest extraction priority and not yet extracted at this time is the C0 complexity, and the C0 complexity of each lead data can be extracted.
[0067] C0 complexity can indicate the degree of irregularity of the lead data. If the irregularity of a certain lead data is high, the C0 complexity of the lead data will also be high. Taking any target lead as an example, the C0 complexity of the lead data of the target lead can be calculated by referring to the following formula:
[0068]
[0069] Among them, C0 is the C0 complexity of the lead data of the target lead, It can be calculated based on f(k); specifically, f(k) can be transformed by Fourier transform first:
[0070]
[0071] Among them, FN (j) is the value after Fourier transform of f(k), and the value of j is 0, 1, ..., N-1; then, F N (j) Find the mean square value:
[0072]
[0073] Among them, G N F N (j) the mean square value; according to G N and F N (j), we can get
[0074]
[0075] Afterwards, you can Perform inverse Fourier transform to get
[0076] The lead data of each target lead can be subjected to C0 complexity extraction according to the above method to obtain each C0 complexity. If there is at least one C0 complexity in each C0 complexity that is greater than the characteristic value threshold corresponding to the C0 complexity, it can be directly determined that the electromyographic artifact detection result of the target EEG data is the presence of electromyographic artifacts, and the feature extraction process can be terminated without extracting features for the Hurst index with a lower extraction priority.
[0077] Since C0 complexity is not the lead feature value with the lowest extraction priority, if each C0 complexity is less than or equal to the feature value threshold corresponding to C0 complexity, feature extraction can be performed on the lead feature value with a lower extraction priority; here, since the lead feature value with the highest extraction priority (i.e., variance) and the lead feature value with the second highest extraction priority (i.e., C0 complexity) have been extracted, it can be determined that the lead feature value with the highest extraction priority and has not yet been extracted is the Hurst index, and the Hurst index of each lead data can be extracted.
[0078] The Hurst index can evaluate whether there is long-term correlation and its degree in the signal sequence. The Hurst index can be considered as the trend of the signal sequence. It is often used to describe the dynamic transformation of power-law characteristics, and its value range is between 0 and 1. When the Hurst index is 0.5, it can be said that the signal sequences are independent random sequences with limited variance; when the Hurst index is between 0.5 and 1, it can be said that there is long-range dependence between the signal sequences, and the closer the Hurst index is to 1, the stronger the dependence; when the Hurst index is between 0 and 0.5, it can be said that the signal sequence conforms to the anti-persistence of the recovery process. Taking any target lead as an example, the Hurst index of the lead data of the target lead can be obtained by referring to the rescaled range analysis method as follows:
[0079]
[0080] Where H is the Hurst index of the lead data of the target lead, R is the deviation between the maximum and minimum values of f(k), S represents the standard deviation of f(k), and T is the duration of f(k). It can be seen that as H increases, the complexity of f(k) decreases.
[0081] The lead data of each target lead can be subjected to Hurst index extraction according to the above method to obtain each Hurst index. If at least one Hurst index among the various Hurst indexes is greater than the eigenvalue threshold corresponding to the Hurst index, it can be determined that the electromyographic artifact detection result of the target EEG data is that electromyographic artifacts exist.
[0082] If each Hurst exponent is less than or equal to the eigenvalue threshold corresponding to the Hurst exponent, it can be determined that the electromyographic artifact detection result of the target EEG data is that there is no electromyographic artifact.
[0083] Accordingly, the EMG artifact detection result of the overall target EMG data can be determined based on the data collected from each lead that is more seriously affected by the EMG artifacts, without the need to perform feature extraction on the data collected from each lead in the target EMG data one by one; and, the embodiment of the present application can perform step-by-step feature extraction and EMG artifact result determination on each lead feature value according to the priority of the lead feature value. If the EMG artifact detection result can be determined based on a lead feature value with a high priority, there is no need to perform a subsequent feature extraction process, which greatly saves the amount of calculation, effectively improves the efficiency of EMG artifact detection, and can meet the real-time requirements of online EMG artifact detection.
[0084] In an embodiment of the present application, a preset EMG artifact removal model can also be used to remove EMG artifacts from the target EMG data to obtain the target EMG data after EMG artifacts are removed; wherein, the EMG artifact removal model is an artificial intelligence model for removing EMG artifacts, and the embodiment of the present application does not specifically limit the EMG artifact removal model.
[0085] In a specific implementation of the embodiment of the present application, the electromyographic artifact removal model can be a deep separator (DeepSeparator) based on deep learning. The structure of DeepSeparator can refer to Figure 2 , specifically, it may include an encoder, a decomposer and a decoder. Using DeepSeparator, the electromyographic artifacts and clean electroencephalogram data can be separated from the target electroencephalogram data, thereby removing the electromyographic artifacts in the target electroencephalogram data.
[0086] In combination with the EMG artifact detection method and the EMG artifact removal model of the embodiments of the present application, the EMG data with EMG artifacts can be determined in real time and efficiently, and only the EMG artifacts can be removed from the EMG data with EMG artifacts. Since a part of the EMG data will inevitably be removed in the process of removing EMG artifacts, compared to indiscriminately removing EMG artifacts from each collected EMG data, by pre-detecting the part of the EMG data with EMG artifacts, unnecessary clearing of the EMG data can be reduced, more EMG data can be retained, and EMG data resources can be greatly saved.
[0087] In a specific implementation of the embodiment of the present application, the electromyographic artifact detection method of the embodiment of the present application can also be applied to perform electromyographic artifact detection at different time spans to better evaluate the quality of the EEG data and perform corresponding processing. For example, the collected EEG data can be subjected to electromyographic artifact detection at different time spans such as 2 seconds, 1 minute, or the entire process of collecting EEG data to determine whether the EEG data needs to be denoised or whether the EEG data acquisition equipment needs to be adjusted in a timely manner.
[0088] The following is an introduction to the process of determining the target feature value threshold in the embodiment of the present application. Figure 3 The process of determining the target feature value threshold in the embodiment of the present application may specifically include:
[0089] Step S301, obtaining each original EEG data and a preset EMG data set.
[0090] In the embodiment of the present application, the EEG data can be collected by using a preset EEG data acquisition module to obtain various raw EEG data. The EEG data acquisition module is a multi-lead EEG device, and the raw EEG data is the EEG data obtained by multi-lead acquisition; the multi-lead EEG device can be any common multi-lead EEG device in the prior art, and the present application does not specifically limit this. For example, the multi-lead EEG device can be a 32-lead EEG device, a 64-lead EEG device, a 128-lead EEG device, etc.
[0091] Specifically, the EEG data of each subject can be collected using a multi-lead EEG device to obtain each raw EEG data. Here, the specific values of the number of subjects and the number of raw EEG data can be specific and situational according to actual needs, and this application does not limit this. For example, the number of subjects and the number of raw EEG data can both be set to 30, that is, the EEG data of 30 subjects can be collected, and each subject collects one raw EEG data, and a total of 30 raw EEG data are obtained.
[0092] In a specific implementation of the embodiment of the present application, when collecting raw EEG data, two electrodes in a multi-lead EEG device can be used as reference electrodes. The reference electrodes can provide a comparison benchmark to facilitate observation of raw EEG data. The location selection of the reference electrodes can affect the interpretation of EEG signals and the results of data analysis. In practical applications, the reference electrodes can be selected according to actual needs. For example, in a 64-lead EEG device, the FT9 electrode located between the left anterior temporal lobe and the frontal lobe and the FT10 electrode located between the right anterior temporal lobe and the frontal lobe can be used as reference electrodes, and 62 leads can be used to obtain raw EEG data.
[0093] In another specific implementation of the embodiment of the present application, in order to obtain real and clean EEG data, the original EEG data can be collected after the subject closes his eyes and rests for a period of time. During the collection process, the subject can be required to keep the body as stable as possible to avoid the generation of electromyographic interference.
[0094] In another specific implementation of the embodiment of the present application, in order to facilitate analysis and screening, after collecting and obtaining each original EEG data, each original EEG data can also be preprocessed to obtain each original EEG data that is easy to observe and calculate. Here, each original EEG data can be downsampled to obtain each original EEG data after downsampling to reduce the subsequent calculation amount; then, each original EEG data after downsampling can be filtered using a preset bandpass filter to remove baseline and power frequency noise and improve the quality of the original EEG data. The sampling rate after the above-mentioned downsampling and the passband of the bandpass filter can be set according to actual needs, and this application is not limited to this. For example, the EEGLAB plug-in of the MATLAB platform can be used to downsample each original EEG data with a sampling rate of 1 kilohertz (kHz) to obtain each original EEG data with a sampling rate of 256 Hz (Hz); then, a 1-40Hz bandpass filter can be used to filter each original EEG data after downsampling. Accordingly, the quality and accuracy of the original EEG data can be effectively improved, so that the subsequent process can be better performed.
[0095] In the embodiment of the present application, a preset electromyographic data set can also be obtained; specifically, any data set containing electromyographic data disclosed in the prior art can be obtained, and the present application does not limit this. Here, the public EEGdenoiseNet can be preferably obtained as the electromyographic data set in the embodiment of the present application; wherein, EEGdenoiseNet contains 5598 electromyographic signal artifacts, based on which, the semi-simulated EEG data set of the embodiment of the present application can be easily constructed.
[0096] Step S302: construct a semi-simulated EEG data set based on the original EEG data and EMG data set.
[0097] In the embodiment of the present application, the corresponding clean EEG data can be determined respectively based on each raw EEG data; wherein the clean EEG data is the raw EEG data without electromyographic artifacts. Specifically, for each subject, a relatively clean data segment can be selected from the raw EEG data corresponding to the subject, and the data can be determined as the clean EEG data; accordingly, the corresponding clean EEG data can be determined respectively from the raw EEG data of each subject. As just an example, a portion of the clean EEG data can be as follows Figure 4 shown.
[0098] In a specific implementation of the embodiment of the present application, in order to ensure the quality of the clean EEG data, the determined clean EEG data may be manually inspected to ensure that there is no noise pollution such as electromyographic artifacts in the clean EEG data.
[0099] In addition, a preset number of simulated electromyographic data may be determined based on the electromyographic data set; wherein the simulated electromyographic data is electroencephalographic data with electromyographic artifacts, and the number of simulated electromyographic data may be the same as the number of clean electroencephalographic data.
[0100] Before constructing the simulated electromyographic data, the electromyographic data set can be preprocessed to obtain electromyographic signal artifacts that meet the requirements. Specifically, the electromyographic signal artifacts can be filtered using a bandpass filter to remove irrelevant frequency components, wherein the passband of the bandpass filter can be set according to actual needs, and the present application does not limit this. For example, a 1-120Hz bandpass filter can be used to filter each electromyographic signal artifact in the electromyographic data set to obtain each electromyographic signal artifact after bandpass filtering. Afterwards, a notch filter can also be used to filter each electromyographic signal artifact to remove the interference of the power frequency; wherein the passband of the notch filter can be set according to actual needs, and the present application does not limit this. For example, a 50Hz notch filter can be used to filter each electromyographic signal artifact after bandpass filtering to obtain each electromyographic signal artifact after notch filtering. Afterwards, each electromyographic signal artifact after notch filtering can be resampled to 512Hz, and the electromyographic signal artifact can be windowed to obtain each electromyographic signal artifact after windowing. Among them, the window length of the windowing processing can be specific and situational according to actual needs, and this application does not limit this. For example, it can be set to 1 second, 2 seconds, 3 seconds, etc.
[0101] Specifically, quantitative electromyographic signal artifacts can be randomly selected from the electromyographic signal artifacts contained in the electromyographic data set, and the corresponding myoelectric source matrix can be constructed based on the selected quantitative electromyographic signal artifacts. By repeating the above process, each independent multi-channel myoelectric source matrix can be constructed.
[0102] In order to ensure that the simulated electromyographic data has a richer spatial structure, the embodiment of the present application can also set a preset number of electromyographic hybrid matrices, the number of electromyographic hybrid matrices is the same as the number of myoelectric source matrices, and each electromyographic hybrid matrix can correspond to a myoelectric source matrix; wherein each column in the electromyographic hybrid matrix can contain 20 to 30 non-zero elements, and the position and corresponding value of the non-zero elements of each column in the electromyographic hybrid matrix can be randomly determined according to a uniform distribution. Accordingly, it can be ensured that each myoelectric source in the myoelectric source matrix can independently affect 20 to 30 channels.
[0103] Afterwards, each electromyographic activity signal matrix can be determined according to each electromyographic source matrix and the corresponding electromyographic mixed matrix; the specific calculation formula of the electromyographic activity signal matrix is:
[0104] X EMGi =A EMGi SEMGi ,
[0105] Among them, X EMGi is the determined i-th myoelectric activity signal matrix, S EMGi is the determined i-th muscle power matrix, A EMGi is the corresponding electromyographic mixing matrix.
[0106] In the embodiment of the present application, a preset number of myoelectric activity signal matrices can be spliced to obtain a simulated myoelectric data, and the number of myoelectric activity signal matrices required to construct each simulated myoelectric data can be set according to actual needs, and the present application does not limit this. For example, 12 myoelectric activity signal matrices can be used to construct a simulated myoelectric data.
[0107] In an embodiment of the present application, data splicing can be performed on a preset number of electromyographic activity signal matrices at preset time intervals, and the space between each electromyographic activity signal matrix is filled with zero values to obtain corresponding simulated electromyographic data; this process is repeated to obtain each simulated electromyographic data. Among them, the time interval can be set according to actual needs, and the present application does not make specific restrictions on this; and the duration of the simulated electromyographic data must be the same as the duration of the clean EEG data. For example, if the duration of the clean EEG data is 60 seconds, the duration of the simulated electromyographic data can also be set to 60 seconds. As an example only, a partial fragment of the simulated electromyographic data can be as follows Figure 5 shown.
[0108] In a specific implementation of the embodiment of the present application, during the data splicing process, the time interval can be flexibly set to a value between 2 seconds and 6 seconds without maintaining a fixed value. For example, the time interval between the previous spliced data and the current spliced data can be 2 seconds, and the time interval between the current spliced data and the next spliced data can be set to 3 seconds.
[0109] Afterwards, each clean EEG data and the simulated EMG data corresponding to each clean EEG data can be superimposed to obtain each semi-simulated EEG data. Specifically, for the same subject, a clean EEG data and a simulated EMG data can be obtained, and the duration of the clean EEG data and the simulated EMG data are the same. Afterwards, the clean EEG data and the simulated EMG data can be superimposed to obtain the semi-simulated EEG data corresponding to the subject. Accordingly, the semi-simulated EEG data can be obtained by superimposing the clean EEG data and the simulated EMG data corresponding to each subject. Just as an example, some fragments of the semi-simulated EEG data can be as follows Figure 6 shown.
[0110] A semi-simulated EEG data set can be constructed based on the obtained semi-simulated EEG data.
[0111] Step S303: extract features from each semi-simulated EEG data to obtain target feature values corresponding to each semi-simulated EEG data.
[0112] Among them, the target eigenvalue corresponds to the target lead eigenvalue. Here, the lead eigenvalue includes the variance, C0 complexity and Hurst exponent of the lead data. Similarly, the eigenvalue of the semi-simulated EEG data can also include the variance, C0 complexity and Hurst exponent of the semi-simulated EEG data.
[0113] In an embodiment of the present application, the target characteristic value threshold can be calculated according to the target characteristic value of each semi-simulated EEG data. For example, the characteristic value threshold corresponding to the variance can be calculated according to the variance of each semi-simulated EEG data. The following will take the variance of the semi-simulated EEG data as an example of the target characteristic value of the semi-simulated EEG data to introduce the process of determining the target characteristic value threshold in the embodiment of the present application.
[0114] In order to facilitate analysis, the embodiment of the present application can perform windowing processing on each semi-simulated EEG data, and divide each semi-simulated EEG data into non-overlapping semi-simulated EEG data segments; the window length of the windowing processing can be specifically set according to actual needs, and the present application does not limit this. For example, the window length can be set to 1 second, 2 seconds, 3 seconds, etc.
[0115] Afterwards, the variance of each semi-simulated EEG data segment can be calculated. The specific calculation method of the variance of the semi-simulated EEG data segment can refer to the description in the previous article and will not be repeated here.
[0116] Step S304: hierarchically clustering the semi-simulated EEG data according to the target feature values corresponding to the semi-simulated EEG data to obtain target cluster grouping data.
[0117] In the embodiment of the present application, hierarchical clustering can be performed on each semi-simulated EEG data segment according to the variance of the semi-simulated EEG data segment to obtain cluster grouping data corresponding to the variance (ie, target cluster grouping data).
[0118] Here, after hierarchical clustering of each semi-simulated EEG data segment, two groups of data can be obtained, which are data without EMG artifacts and data with EMG artifacts. Afterwards, data without EMG artifacts (called first cluster grouped data) and data with EMG artifacts (called second cluster grouped data) can be specifically determined from the target cluster grouped data. Here, the target eigenvalue mean of the target cluster grouped data (including two groups of data) can be calculated, and the target eigenvalue mean is the mean of the target eigenvalues, that is, the mean of the variance. According to the mean of the variance of the two groups of data, the first cluster grouped data and the second cluster grouped data can be determined from the two groups of data; specifically, a group of data with a smaller mean of the variance in the two groups of data can be determined as the first cluster grouped data, and a group of data with a larger mean of the variance in the two groups of data can be determined as the second cluster grouped data.
[0119] Step S305: Determine a target feature value threshold value according to the target feature value of the target cluster grouping data.
[0120] In an embodiment of the present application, the eigenvalue threshold corresponding to the variance can be determined based on the grouped data (i.e., the second clustered grouped data) in which the electromyographic artifact exists. Specifically, the preset quantile of each variance of the second clustered grouped data can be determined as the eigenvalue threshold corresponding to the variance. Among them, the preset quantile can be set according to actual needs, and the present application does not limit this. In an embodiment of the present application, the preset quantile can preferably be set to the 75th quantile, that is, the 75th quantile of each variance in the second clustered grouped data can be determined as the eigenvalue threshold corresponding to the variance.
[0121] Similarly, according to the above method, the C0 complexity and Hurst index corresponding to each semi-simulated EEG data segment can be calculated, and each semi-simulated EEG data segment can be hierarchically clustered according to the C0 complexity and the Hurst index, respectively, to obtain the first cluster data and the second cluster data corresponding to the C0 complexity, and the first cluster data and the second cluster data corresponding to the Hurst index; then, the preset quantiles of each C0 complexity of the first cluster data corresponding to the C0 complexity can be determined as the eigenvalue threshold corresponding to the C0 complexity; for example, the 75th quantile of each C0 complexity of the first cluster data corresponding to the C0 complexity can be determined as the eigenvalue threshold corresponding to the C0 complexity. In addition, the minimum value of each Hurst index of the first cluster data corresponding to the Hurst index can be determined as the eigenvalue threshold corresponding to the Hurst index.
[0122] After determining each characteristic value threshold, each characteristic value threshold can be applied to actual electromyographic artifact detection.
[0123] In a specific implementation method of an embodiment of the present application, in order to test the performance of the electromyographic artifact detection method in the embodiment of the present application, the constructed semi-simulated EEG dataset can also be used to test the electromyographic artifact detection method in the embodiment of the present application; here, the constructed semi-simulated EEG dataset can be divided according to a preset division ratio to obtain a semi-simulated EEG training dataset for determining the eigenvalue threshold and a semi-simulated EEG data test set for testing; for example, 70% of the semi-simulated EEG dataset can be used as a semi-simulated EEG training dataset, and 30% of the semi-simulated EEG dataset can be used as a semi-simulated EEG test dataset.
[0124] Figure 7 shows a test process of semi-simulated EEG data. Figure 8 The required modules corresponding to the test process are shown. Specifically, the EEG data acquisition module can obtain the original EEG data, and the semi-simulated EEG test data set construction module can determine each clean EEG data based on the acquired part of the original EEG data (for example, 30% of the original EEG data); each simulated EMG data can also be determined according to the preset EMG data set. After that, each clean EEG data and each simulated EMG data can be superimposed to obtain each semi-simulated EEG data, and a semi-simulated EEG test data set can be constructed; after that, the EMG artifact detection module can perform EMG artifact detection on each semi-simulated EEG data in the semi-simulated EEG test data set. For the semi-simulated EEG data with EMG artifacts, the EMG artifact removal module can remove the EMG artifacts to obtain clean EEG data. For the semi-simulated EEG data without EMG artifacts, there is no need to remove the EMG artifacts, and the semi-simulated EEG data can be directly determined as clean EEG data.
[0125] Optionally, in the above implementation, the semi-simulated EEG data with EMG artifacts detected in the embodiment of the present application and the EEG data with real EMG artifacts in the semi-simulated EEG test data set can be used to perform confusion matrix statistics, and the receiver operating characteristic curve (Receiver Operating Characteristic Curve, ROC curve) can be as follows: Fig. 9 As shown, based on this, the accuracy of the electromyographic artifact detection method of the embodiment of the present application can be obtained, so as to subsequently improve the electromyographic artifact detection method of the embodiment of the present application.
[0126] Optionally, in the above implementation, the semi-simulated EEG data after the EMG artifacts are removed after the detection by the EMG artifact detection method in the embodiment of the present application and the semi-simulated EEG data without the detection by the EMG artifact detection method in the embodiment of the present application but directly subjected to the EMG artifacts removal can be compared. Here, the root mean square error (RMSE) and the correlation coefficient (Coefficient of Correlation) can be used as evaluation indicators; wherein the root mean square error can measure the degree of deviation between the semi-simulated EEG data after the EMG artifacts are removed and the original semi-simulated EEG data. If the root mean square error is smaller, it indicates that the deviation between the semi-simulated EEG data after the EMG artifacts are removed and the original semi-simulated EEG data is smaller, that is, the original semi-simulated EEG data is retained to a greater extent; if the root mean square error is larger, it indicates that the deviation between the semi-simulated EEG data after the EMG artifacts are removed and the original semi-simulated EEG data is greater, that is, the original semi-simulated EEG data is retained to a smaller extent; the specific calculation formula of the root mean square error is:
[0127]
[0128] Among them, M is the number of sampling points of the semi-simulated EEG data, that is, the data length of each lead, y a is the semi-simulated EEG data of the ath sampling point after EMG artifact removal, x a is the original semi-simulated EEG data of the ath sampling point. The correlation coefficient can measure the correlation between the semi-simulated EEG data after EMG artifact removal and the original semi-simulated EEG data. The value range of the correlation coefficient is [-1,1]. When the correlation coefficient is 1, it indicates that the semi-simulated EEG data after EMG artifact removal has a positive linear relationship with the original semi-simulated EEG data. When the correlation coefficient is -1, it indicates that the semi-simulated EEG data after EMG artifact removal has a negative linear relationship with the original semi-simulated EEG data. If the correlation coefficient is closer to 0, it indicates that the correlation between the semi-simulated EEG data after EMG artifact removal and the original semi-simulated EEG data is lower. The correlation coefficient R(x) of the ath sampling point semi-simulated EEG data after EMG artifact removal and the original ath sampling point semi-simulated EEG data is a ,y a ) is calculated as:
[0129]
[0130] Among them, Cov(x a ,y a ) is x a With y a The covariance of For x aThe standard deviation of for y a As just an example, in a practical application, the two root mean square errors and correlation coefficients of the semi-simulated EEG data that is detected by the EMG artifact detection method in the embodiment of the present application and then removed by DeepSeparator for EMG artifacts and the semi-simulated EEG data that is not detected by the EMG artifact detection method in the embodiment of the present application and directly removed by DeepSeparator for EMG artifacts are as follows:
[0131]
[0132] It can be seen that, combined with the electromyographic artifact detection method of the embodiment of the present application, the loss of EEG data after the removal of electromyographic artifacts can be reduced, and more and better original semi-simulated EEG data can be retained.
[0133] Optionally, just as an example, in the above implementation, for the semi-simulated EEG data with electromyographic artifacts in each semi-simulated EEG data, the time domain comparison of the EEG data directly performing electromyographic artifact removal and the EEG data performing electromyographic artifact removal after electromyographic artifact detection according to the embodiment of the present application can be as follows: Fig.10 As shown, the corresponding frequency domain comparison can be referred to Fig.11 It can be seen that for the semi-simulated EEG data with electromyographic artifacts, the difference between the EEG data obtained by the two processing processes is small, that is, the EEG artifact removal after the electromyographic artifact detection in the embodiment of the present application can maintain a good effect; similarly, for the semi-simulated EEG data without electromyographic artifacts in each semi-simulated EEG data, it can also be processed according to the above two processing processes, and the time domain comparison of the obtained EEG data can be shown as follows Fig.12 As shown in the figure, the semi-simulated EEG data is subjected to electromyography artifact detection, and then the EEG data after the electromyography artifact removal model is used to remove the electromyography artifacts coincides with the corresponding clean EEG data. It can be seen that for the semi-simulated EEG data without electromyography artifacts, the semi-simulated EEG data after electromyography artifact detection and electromyography artifact removal in the embodiment of the present application has a higher degree of overlap with the clean EEG data, that is, the semi-simulated EEG data after electromyography artifact detection and electromyography artifact removal in the embodiment of the present application is more complete and can retain more clean semi-simulated EEG data; the corresponding frequency domain comparison can be shown as Fig.13 shown.
[0134] In summary, the embodiment of the present application acquires target EEG data; wherein, the target EEG data includes lead data collected by each target lead, and each of the target leads is respectively located in the frontal lobe, central area, parietal lobe and occipital lobe; the target lead feature values corresponding to each of the lead data are respectively extracted; wherein, the target lead feature value is the lead feature value with the highest extraction priority and has not been extracted, and the extraction priority of the lead feature value is positively correlated with the extraction speed of the lead feature value; according to each of the target lead feature values and a predetermined target feature value threshold, the electromyographic artifact detection result of the target EEG data is determined; wherein, the target feature value threshold is the feature value threshold corresponding to the target lead feature value. In an embodiment of the present application, electromyographic artifact detection can be performed based on lead data collected from leads located in the frontal lobe, central area, parietal lobe and occipital lobe that are more affected by electromyography; and feature extraction can be performed preferentially on lead feature values with a higher extraction speed, so that electromyographic artifacts can be detected more accurately and efficiently, and online and real-time electromyographic artifact detection can be achieved, which helps to improve the availability and scenario adaptability of the electromyographic artifact detection method.
[0135] It should be understood that the size of the serial numbers of the steps in the above embodiments does not 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 embodiments of the present application.
[0136] Corresponding to the electromyographic artifact detection method described in the above embodiment, Fig.14 A structural diagram of an embodiment of an electromyographic artifact detection device provided in an embodiment of the present application is shown.
[0137] In an embodiment of the present application, a myoelectric artifact detection device may include:
[0138] The target EEG data acquisition module 1401 is used to acquire target EEG data; wherein the target EEG data includes lead data collected by each target lead, and each of the target leads is located in the frontal lobe, the central area, the parietal lobe and the occipital lobe respectively;
[0139] The target lead feature value extraction module 1402 is used to extract the target lead feature values corresponding to each of the lead data respectively; wherein the target lead feature value is the lead feature value with the highest extraction priority and has not been extracted, and the extraction priority of the lead feature value is positively correlated with the extraction speed of the lead feature value;
[0140] The EMG artifact detection result determination module 1403 is used to determine the EMG artifact detection result of the target EEG data according to each of the target lead feature values and a predetermined target feature value threshold; wherein the target feature value threshold is the feature value threshold corresponding to the target lead feature value.
[0141] In a specific implementation of the embodiment of the present application, the electromyographic artifact detection result determination module includes:
[0142] A first result determination submodule is used to determine that the electromyographic artifact detection result of the target EEG data is the presence of electromyographic artifacts if at least one of the target lead characteristic values is greater than the target characteristic value threshold;
[0143] A second result determination submodule is used to determine that the electromyographic artifact detection result of the target EEG data is that there is no electromyographic artifact if each of the target lead feature values is less than or equal to the target feature value threshold and the target lead feature value is the lead feature value with the lowest extraction priority;
[0144] The step execution submodule is used to return to the step of respectively extracting the target lead feature values corresponding to each of the lead data and its subsequent steps if each of the target lead feature values is less than or equal to the target feature value threshold and the target lead feature value is not the lead feature value with the lowest extraction priority.
[0145] In a specific implementation of the embodiment of the present application, the electromyographic artifact detection device further includes:
[0146] A raw data acquisition module is used to acquire each raw EEG data and a preset EMG data set;
[0147] A semi-simulated EEG data set construction module, used to construct a semi-simulated EEG data set according to each of the original EEG data and the electromyography data set; wherein the semi-simulated EEG data set includes each of the semi-simulated EEG data;
[0148] A target feature value extraction module is used to extract features from each of the semi-simulated EEG data to obtain target feature values corresponding to each of the semi-simulated EEG data; wherein the target feature values correspond to the target lead feature values;
[0149] A hierarchical clustering module, used for performing hierarchical clustering on each of the semi-simulated EEG data according to the target feature values respectively corresponding to each of the semi-simulated EEG data, to obtain target clustering grouping data;
[0150] The target feature value threshold determination module is used to determine the target feature value threshold according to the target feature value of the target cluster grouping data.
[0151] In a specific implementation of the embodiment of the present application, the semi-simulated EEG data set construction module includes:
[0152] A clean EEG data determination submodule is used to determine each clean EEG data according to each raw EEG data; wherein the clean EEG data is the raw EEG data without electromyographic artifacts;
[0153] A simulated electromyographic data determination submodule is used to determine each simulated electromyographic data according to the electromyographic data set; wherein the simulated electromyographic data is electroencephalographic data with electromyographic artifacts;
[0154] A data superposition submodule, used for superimposing each of the clean EEG data and the corresponding simulated EMG data to obtain each of the semi-simulated EEG data;
[0155] The semi-simulated EEG data set construction submodule is used to construct the semi-simulated EEG data set according to each of the semi-simulated EEG data.
[0156] In a specific implementation of the embodiment of the present application, the simulated electromyographic data determination submodule includes:
[0157] A myoelectric power matrix determination unit, used for determining each myoelectric power matrix from the myoelectric data set;
[0158] The myoelectric activity signal matrix determination unit is used to determine each myoelectric activity signal matrix according to each of the myoelectric source matrices and a preset corresponding myoelectric mixed matrix;
[0159] The data splicing unit is used to perform data splicing on each of the electromyographic activity signal matrices at a preset time interval to obtain each of the simulated electromyographic data.
[0160] In a specific implementation of the embodiment of the present application, the target feature value threshold determination module includes:
[0161] A target feature mean calculation submodule, used to calculate the target feature mean of the target cluster grouping data; wherein the target feature mean is the mean of the target feature values of the target cluster grouping data;
[0162] A cluster grouping data determination submodule, used to determine first cluster grouping data and second cluster grouping data from the target cluster grouping data according to the target feature mean; wherein the first cluster grouping data is data without electromyographic artifacts, and the second cluster grouping data is data with electromyographic artifacts;
[0163] The target feature value threshold determination submodule is used to determine the target feature value threshold according to the target feature value of the first cluster grouping data; or to determine the target feature value threshold according to the target feature value of the second cluster grouping data.
[0164] In a specific implementation of the embodiment of the present application, the electromyographic artifact detection device further includes:
[0165] The electromyography artifact removal module is used to remove electromyography artifacts from the target EEG data using a preset electromyography artifact removal model to obtain the target EEG data after the electromyography artifacts are removed; wherein the electromyography artifact removal model is an artificial intelligence model for removing electromyography artifacts.
[0166] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0167] 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.
[0168] Fig.15 A schematic block diagram of a terminal device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0169] like Fig.15 As shown, the terminal device 15 of this embodiment includes: a processor 150, a memory 151, and a computer program 152 stored in the memory 151 and executable on the processor 150. When the processor 150 executes the computer program 152, the steps in the above-mentioned embodiments of the electromyographic artifact detection method are implemented, for example Figure 1 Alternatively, when the processor 150 executes the computer program 152, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Fig.14 The functions of modules 1401 to 1403 are shown.
[0170] Exemplarily, the computer program 152 may be divided into one or more modules / units, which are stored in the memory 151 and executed by the processor 150 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 152 in the terminal device 15.
[0171] Those skilled in the art will understand that Fig.15 It is only an example of the terminal device 15 and does not constitute a limitation of the terminal device 15. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device 15 may also include input and output devices, network access devices, buses, etc.
[0172] The processor 150 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0173] The memory 151 may be an internal storage unit of the terminal device 15, such as a hard disk or memory of the terminal device 15. The memory 151 may also be an external storage device of the terminal device 15, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 15. Further, the memory 151 may also include both an internal storage unit of the terminal device 15 and an external storage device. The memory 151 is used to store the computer program and other programs and data required by the terminal device 15. The memory 151 may also be used to temporarily store data that has been output or is to be output.
[0174] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0175] 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.
[0176] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0177] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0179] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0180] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0181] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person 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 application, and should all be included in the protection scope of the present application.
Claims
1. A method for detecting electromyographic artifacts, characterized in that: include: Acquire target EEG data; wherein the target EEG data includes lead data collected by each target lead, and each target lead is located in the frontal lobe, central area, parietal lobe and occipital lobe respectively; Extracting target lead feature values corresponding to each of the lead data respectively; wherein the target lead feature value is a lead feature value with the highest extraction priority and has not been extracted, and the extraction priority of the lead feature value is positively correlated with the extraction speed of the lead feature value; The electromyographic artifact detection result of the target EEG data is determined according to each of the target lead characteristic values and a predetermined target characteristic value threshold; wherein the target characteristic value threshold is a characteristic value threshold corresponding to the target lead characteristic value.
2. The method for detecting electromyographic artifacts according to claim 1, characterized in that: The step of determining the electromyographic artifact detection result of the target EEG data according to each of the target lead characteristic values and a predetermined target characteristic value threshold value includes: If there is at least one of the target lead characteristic values greater than the target characteristic value threshold, determining that the electromyographic artifact detection result of the target EEG data is that there is an electromyographic artifact; If each of the target lead feature values is less than or equal to the target feature value threshold, and the target lead feature value is the lead feature value with the lowest extraction priority, then it is determined that the electromyographic artifact detection result of the target EEG data is that there is no electromyographic artifact; If each of the target lead feature values is less than or equal to the target feature value threshold, and the target lead feature value is not the lead feature value with the lowest extraction priority, then return to execute the step of respectively extracting the target lead feature values corresponding to each of the lead data and its subsequent steps.
3. The method for detecting electromyographic artifacts according to claim 1, characterized in that: The process of determining the target characteristic value threshold includes: Obtain each original EEG data and preset EMG data set; According to each of the original EEG data and the electromyography data set, a semi-simulated EEG data set is constructed; wherein the semi-simulated EEG data set includes each of the semi-simulated EEG data; Performing feature extraction on each of the semi-simulated EEG data to obtain target feature values corresponding to each of the semi-simulated EEG data; wherein the target feature values correspond to the target lead feature values; According to the target feature values respectively corresponding to the respective semi-simulated EEG data, hierarchical clustering is performed on the respective semi-simulated EEG data to obtain target clustering grouping data; The target feature value threshold is determined according to the target feature value of the target cluster grouping data.
4. The method for detecting electromyographic artifacts according to claim 3, characterized in that: The semi-simulated EEG data set is constructed based on each of the original EEG data and the electromyography data set, including: Determine each clean EEG data according to each raw EEG data; wherein the clean EEG data is the raw EEG data without electromyographic artifacts; Determine each simulated electromyographic data according to the electromyographic data set; wherein the simulated electromyographic data is electroencephalographic data with electromyographic artifacts; Superimposing each of the clean EEG data and the corresponding simulated EMG data to obtain each of the semi-simulated EEG data; The semi-simulated EEG data set is constructed based on each of the semi-simulated EEG data.
5. The method for detecting electromyographic artifacts according to claim 4, characterized in that: Determining each simulated electromyographic data according to the electromyographic data set includes: determining each myoelectric source matrix from the myoelectric data set; Determine each electromyographic activity signal matrix according to each of the myoelectric source matrices and a preset corresponding electromyographic hybrid matrix; According to the preset time intervals, data splicing is performed on each of the electromyographic activity signal matrices to obtain each of the simulated electromyographic data.
6. The method for detecting electromyographic artifacts according to claim 3, characterized in that: The step of determining the target feature value threshold according to the target feature value of the target cluster grouping data includes: Calculate the target feature mean of the target cluster grouping data; wherein the target feature mean is the mean of the target feature values of the target cluster grouping data; According to the target feature mean, determining first cluster grouping data and second cluster grouping data from the target cluster grouping data; wherein the first cluster grouping data is data without myoelectric artifacts, and the second cluster grouping data is data with myoelectric artifacts; The target feature value threshold is determined according to the target feature value of the first cluster grouping data; or the target feature value threshold is determined according to the target feature value of the second cluster grouping data.
7. The method for detecting electromyographic artifacts according to claim 2, characterized in that: After determining that the electromyographic artifact detection result of the target electroencephalogram data is that the electromyographic artifact exists, the method further includes: The target EEG data is subjected to EMG artifact removal using a preset EMG artifact removal model to obtain the target EEG data after EMG artifact removal; wherein the EMG artifact removal model is an artificial intelligence model for EMG artifact removal.
8. A myoelectric artifact detection device, characterized in that: include: A target EEG data acquisition module is used to acquire target EEG data; wherein the target EEG data includes lead data collected by each target lead, and each of the target leads is located in the frontal lobe, central area, parietal lobe and occipital lobe respectively; A target lead feature value extraction module is used to extract target lead feature values corresponding to each of the lead data respectively; wherein the target lead feature value is a lead feature value with the highest extraction priority and has not been extracted, and the extraction priority of the lead feature value is positively correlated with the extraction speed of the lead feature value; The module for determining the result of electromyographic artifact detection is used to determine the result of electromyographic artifact detection of the target EEG data according to each of the target lead characteristic values and a predetermined target characteristic value threshold; wherein the target characteristic value threshold is the characteristic value threshold corresponding to the target lead characteristic value.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the myoelectric artifact detection method according to any one of claims 1 to 7 are implemented.
10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the myoelectric artifact detection method according to any one of claims 1 to 7 are implemented.
