A brain wave signal recognition training method and system based on big data
By dividing and uniformly analyzing the EEG signal data, combined with deep learning technology and F1 score calculation, the problem of reduced accuracy of the recognition model in the existing technology is solved, and higher recognition accuracy and data processing intelligence are achieved.
Patent Information
- Application Number
- CN202311784848.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-24
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2043-12-24
AI Technical Summary
When the test set information is unknown, the existing EEG signal recognition training method cannot accurately judge the accuracy of the recognition model by analyzing only a single result, resulting in a decrease in the accuracy of the recognition model.
By dividing the EEG signal data, the training set and the test set are obtained, and the unity of the EEG signal data in the same corresponding state is analyzed to determine the accuracy of the recognition model. Deep learning technology is used for model training, and the accuracy of the recognition model is judged by calculating the F1 score.
It improves the accuracy of the recognition model and the intelligence of data processing, avoids data redundancy and data fluctuations caused by abnormally high voltage, and enhances the accurate recognition of EEG signals.
Smart Images

Figure CN117743854B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electroencephalogram (EEG) signal training and recognition, and in particular to an EEG signal recognition and training method and system based on big data. Background Art
[0002] EEG signal recognition training technology refers to the process of using machine learning and pattern recognition methods to parse and classify EEG signals; EEG signals are obtained by placing electrodes on the scalp to measure the brain's electrical activity; these electrical activities are caused by the electrochemical activity of brain neurons and captured by electrodes; the goal of EEG signal recognition training technology is to extract useful information from EEG signals, thereby achieving the classification and recognition of different brain states, cognitive tasks or brain functions.
[0003] Existing training methods for EEG signal recognition usually improve the recognition accuracy and reduce the redundancy of signal data to make EEG signal recognition more accurate. For example, in a Chinese patent with application publication number CN115099274A, a method for EEG signal recognition is disclosed. The scheme is to divide the data into a training set and a test set, train the preprocessed training set using multivariate spatiotemporal deep learning technology, and use the test set for detection. The scheme is to analyze when the test set information is clear and there are obvious differences in different test set data. This will result in only analyzing a single test set information when the test set information is unknown. Since the uniformity of other test set data is not analyzed, the accuracy of the training model will be affected during recognition training. In view of this, it is necessary to improve the existing automated testing. Summary of the invention
[0004] The present invention aims to solve one of the technical problems in the prior art to at least a certain extent. By analyzing the EEG signal, the corresponding state of the EEG signal is obtained, and the accuracy of the recognition model is judged by analyzing the uniformity of all EEG signals with the same corresponding state. This is used to solve the problem in the prior art that when there is a lack of unknown test set information, only a single result is analyzed and it is impossible to accurately judge whether the recognition result of the recognition model is correct, thereby reducing the accuracy of the recognition model.
[0005] To achieve the above objectives, in a first aspect, the present invention provides an EEG signal recognition training method based on big data, comprising:
[0006] Step S1, obtaining a first amount of EEG signal data, dividing the first amount, and outputting training set data and test set data;
[0007] Step S2, performing calculation and analysis on each EEG signal data, outputting a label voltage and determining the voltage frequency based on the calculation result;
[0008] Step S3, analyzing the EEG signal data based on the voltage frequency, and outputting the corresponding state; calculating the state voltage interval based on the corresponding state, and outputting the state voltage interval; using deep learning technology to train the model, and outputting the recognition model;
[0009] Step S4, using the recognition model to analyze the test set data and output the recognition state; analyzing the recognition state based on the state voltage range and calculating the F1 score of the analysis; analyzing the F1 score and outputting retraining information or training completion information based on the analysis result.
[0010] Furthermore, the step S1 includes the following sub-steps:
[0011] Step S1011, obtaining a first amount of EEG signal data, wherein the EEG signal data includes voltage;
[0012] Step S1012, multiplying the first number by the first division coefficient to obtain an expected training number; marking the difference between the first number and the expected training number as the expected test number;
[0013] Step S1013, calculate the ratio of the number of training data to the number of test data, round it down, and mark it as the number of partition intervals.
[0014] Furthermore, the step S1 further includes the following sub-steps:
[0015] Step S1021, sorting the first number of EEG data to obtain an EEG data sequence, and calculating a division number using a division calculation formula;
[0016] The partition calculation formula is configured as BHi=i×n+1; wherein BHi is the i-th partition number, n is the partition interval number, and i is a positive integer;
[0017] Step S1022, marking the EEG data with the same number as the partition number in the EEG data series as test set data, and marking the other EEG signal data except the test set data as training set data.
[0018] Furthermore, the step S2 includes the following sub-steps:
[0019] Step S2011, obtaining the maximum value of the voltage in each EEG signal data, and marking it as a label voltage;
[0020] Step S2012, marking the difference of the calculated unit voltage obtained by subtracting the determination multiple from the tag voltage as a first determination endpoint, and marking the voltage between the first determination endpoint and the tag voltage as a first determination interval;
[0021] Step S2013, calculating the frequency of the voltage in the EEG signal data being in the first judgment interval, and marking it as the first calibration judgment frequency;
[0022] Step S2014, when the first calibration judgment frequency is greater than the calibration judgment threshold, outputting the tag voltage;
[0023] Step S2015: When the first calibration judgment frequency is less than or equal to the calibration judgment threshold, a maximum value re-judgment process is performed.
[0024] Furthermore, the maximum value re-determination process includes:
[0025] Updating the first determination endpoint to the tag voltage;
[0026] Repeat step S2012 to step S2013 to obtain a first calibration judgment frequency, and when the first calibration judgment frequency is greater than a calibration judgment threshold, output the tag voltage;
[0027] When the first calibration determination frequency is less than or equal to the calibration determination threshold, the maximum value re-determination process is repeated.
[0028] Furthermore, the voltage frequency determination includes a first determination frequency and a second determination frequency, and step S2 further includes the following sub-steps:
[0029] Step S2021, analyzing the tag voltage, when the tag voltage is less than or equal to the first voltage threshold, calculating the occurrence frequency of the voltage in the first voltage interval, and marking it as the first judgment frequency;
[0030] Step S2022: when the tag voltage is greater than the first voltage threshold, the occurrence frequency of the voltage in the second voltage interval is calculated and marked as the second judgment frequency.
[0031] Further, the corresponding state includes a focused state and a distracted state, the state voltage interval includes a focused voltage interval and a distracted voltage interval, and the step S3 includes the following sub-steps:
[0032] Step S301, receiving a judgment voltage frequency, when receiving a first judgment frequency, analyzing the first judgment frequency, when the first judgment frequency is less than or equal to a first frequency threshold, outputting a distraction state; when the first judgment frequency is greater than or equal to a second frequency threshold, outputting a concentration state; when the first judgment frequency is between the first judgment frequency and the second judgment frequency, deleting the corresponding EEG signal data;
[0033] Step S302, when a second judgment frequency is received, outputting a distraction state;
[0034] Step S303: Set the appearance rate threshold yz, obtain the minimum voltage and the labeled voltage of the test set data with a single corresponding state of the focused state, and mark the range from the minimum voltage to the labeled voltage as the first analysis interval [a, b], where a represents the minimum voltage and b represents the labeled voltage;
[0035] Calculate the probability that the voltage in the single test set data is within the first analysis interval, and mark it as c1;
[0036] Set the calculation times jz with an initial value of 1;
[0037] Start loop analysis, and the loop analysis includes:
[0038] Analyze the relationship between c1 and yz;
[0039] When c1 < yz, output the first analysis interval and end the loop analysis;
[0040] When c1 > yz, judge the parity of jz; when jz is odd, subtract d from b, where d is the calculated unit voltage; recalculate c1 and increment jz by 1;
[0041] When jz is even, add d to a, recalculate c1, and increment jz by 1;
[0042] Repeat the loop analysis;
[0043] Step S304: Repeat Step S303 to calculate the first analysis intervals for all corresponding states of the focused state; calculate the average value of all the first analysis intervals and mark it as the focused voltage interval;
[0044] Step S305: Obtain the minimum voltage and the labeled voltage of the test set data with a single corresponding state of the distracted state, and mark the range from the minimum voltage to the labeled voltage as the second analysis interval [a, b], where a represents the minimum voltage and b represents the labeled voltage;
[0045] Calculate the probability that the voltage in the single test set data is within the second analysis interval, and mark it as c2;
[0046] Set the calculation times jz with an initial value of 1;
[0047] Start loop analysis, and the loop analysis includes:
[0048] Analyze c2 and yz;
[0049] When c2 is less than or equal to yz, output the second analysis interval and end the loop analysis;
[0050] When c2 is greater than yz, determine the parity of jz; when jz is an odd number, subtract d from b, where d is the calculated unit voltage; recalculate c2 and add one to jz;
[0051] When jz is an even number, add d to a, recalculate c2, and add 1 to jz;
[0052] Repeated cycle analysis;
[0053] Step S306, repeating step S305, calculating all second analysis intervals corresponding to the distraction state; calculating the average value of all second analysis intervals, and marking them as distraction voltage intervals;
[0054] Step S307, using deep learning technology to perform model training on the training set data, the label voltage corresponding to the training set data, and the corresponding state of the training set data, and output the recognition model when the training is completed.
[0055] Furthermore, the step S4 includes the following sub-steps:
[0056] Step S4011, using the recognition model to recognize the test set data, and outputting the recognition status, wherein the recognition status includes a focused state and a distracted state;
[0057] Calculate the probability e that the voltage of the test set data whose recognition state is the focus state is in the focus voltage interval;
[0058] When e is greater than or equal to yz, the test set data is marked as actual focused data;
[0059] When e is less than yz, no processing is done;
[0060] Calculate the probability f that the voltage of the test set data whose recognition state is the distraction state is located in the distraction voltage interval;
[0061] When f is greater than or equal to yz, the test set data is marked as actual distracting data;
[0062] When f is less than yz, no processing is done;
[0063] Step S4012, calculating the accuracy of the recognition model;
[0064] The calculation method of the accuracy is:
[0065] Get the number of test set data with the recognition state of focus, marked as the expected focus number; get the total number of actual focus data, marked as the actual focus number;
[0066] Get the number of test set data in the recognition state of distraction, marked as the expected number of distractions; get the total number of actual distraction data, marked as the actual number of distractions;
[0067] The accuracy is calculated using the accuracy calculation formula.
[0068] The accuracy calculation formula is configured as: Among them, JQ is the accuracy rate, SZ is the actual number of concentration, SF is the actual number of distraction, YZ is the expected number of concentration, and YF is the expected number of distraction;
[0069] Step S4013, calculating the recall rate of the recognition model;
[0070] The method for calculating the recall rate is as follows: setting a recall calculation value with an initial value of 0, obtaining the corresponding state and the recognition state of the test set data, and when the corresponding state is the same as the recognition state, adding one to the recall calculation value;
[0071] Get the number of test set data and use the recall rate calculation formula to calculate the recall rate.
[0072] The recall rate calculation formula is configured as: Where ZH is the recall rate, CS is the calculated recall value, and CES is the number of test set data;
[0073] Step S4014, calculating the F1 score of the recognition model using the F1 score calculation formula;
[0074] The F1 score calculation formula is configured as:
[0075] Furthermore, the step S4 further includes the following sub-steps:
[0076] Step S4021, obtaining an F1 score, and when the F1 score is greater than or equal to a first score threshold, outputting training completion information;
[0077] Step S4022, when the F1 score is less than the first score threshold, determine the precision; when the precision is greater than or equal to the first score threshold, output training completion information;
[0078] Step S4023: when the recall rate is less than the first score threshold, output retraining information.
[0079] In a second aspect, the present invention also provides an EEG signal recognition training system based on big data, including an EEG data processing module, a model training module and a training analysis module;
[0080] The EEG data processing module is used to obtain EEG signal data and divide the EEG signal data into training set data and test set data;
[0081] The model training module includes a label analysis unit, a voltage calculation unit and a model training unit; the label analysis unit is used to calculate and analyze the EEG signal data, output the label voltage and judge the voltage frequency; the label analysis unit is also used to analyze the judgement voltage frequency and output the corresponding state; the voltage calculation unit is used to calculate and analyze the state voltage interval of the same corresponding state; the model training unit is used to perform model training according to the training set data and output the recognition model;
[0082] The training analysis module includes an accurate judgment unit and an accurate calculation unit. The accurate judgment unit is used to analyze the recognition state of the test set data based on the state voltage interval; the accurate calculation unit is used to calculate the F1 score of the recognition model and output retraining information or training completion information based on the F1 score.
[0083] Beneficial effects of the present invention: The present invention obtains test set data and training set data by discontinuously dividing the EEG signal data; then analyzes whether the maximum voltage in the EEG signal data is referenceable, and calculates the referenceable label voltage; then calculates and judges the voltage frequency according to the label voltage, and obtains the corresponding state according to the judged voltage frequency; the advantage is that, through discontinuous division processing, the data can be disrupted to avoid the occurrence of continuous similar data to increase data redundancy; by calculating the referenceable label voltage, the abnormal high voltage caused by the error can be judged, and the data fluctuation caused by the abnormality can be reduced; the intelligence and accuracy of data processing can be improved;
[0084] The present invention also calculates the state voltage interval of the same corresponding state in the training set data, and then uses the deep learning technology to perform model training on the training set data to obtain a recognition model; then uses the recognition model to recognize the test set data and outputs the recognition state; calculates the probability that the voltage of the data with the same recognition state and the corresponding state is located in the state voltage interval, and judges whether the recognition is correct; then calculates the F1 score of the recognition model, and judges the accuracy of the recognition model according to the F1 score; the advantage of this is that by calculating the state voltage interval, a common voltage interval that conforms to a single state can be obtained, and then the probability that the voltage is located in the common voltage interval when the recognition state is the same as the corresponding state can be judged, so that it can accurately judge whether the recognition is accurate, thereby improving the accuracy of the recognition judgment;
[0085] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] Figure 1 is a flow chart of the steps of the method of the present invention;
[0087] Figure 2 is a schematic diagram of the tag voltage of the present invention;
[0088] Figure 3 A schematic diagram of the tag voltage maximum value re-determination process of the present invention;
[0089] Figure 4 It is a data flow chart of step S303 of the present invention;
[0090] Figure 5 is a schematic diagram of the state voltage range of the present invention;
[0091] Figure 6 It is a functional block diagram of the system of the present invention. DETAILED DESCRIPTION
[0092] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0093] Example 1
[0094] See also Figure 1 As shown, the present invention provides an EEG signal recognition training method based on big data, which obtains EEG signal data and divides it; calculates and analyzes the EEG signal data, outputs label voltage and judgment voltage frequency; analyzes the judgment voltage frequency, and outputs the corresponding state; calculates the state voltage interval and performs model training; calculates the F1 score of the model, and outputs retraining information or training completion information.
[0095] Specifically, the steps include:
[0096] Step S1, obtaining a first amount of EEG signal data, dividing the first amount, and outputting training set data and test set data; Step S1 also includes the following sub-steps:
[0097] Step S1011, obtaining a first amount of EEG signal data, wherein the EEG signal data includes voltage;
[0098] Step S1012, multiplying the first number by the first division coefficient to obtain an expected training number; marking the difference between the first number and the expected training number as the expected test number;
[0099] In the specific implementation, the first number is set to 100, and the first division coefficient is set to 0.7; since EEG signals have obvious differences in details, and show similarities overall when the state is the same, setting too much data for model training will not significantly improve the accuracy of the model, and when the data is too little, it is impossible to accurately judge the impact of the difference in details on the state; therefore, the first division coefficient is set to 0.7, indicating that it is expected that 70 EEG signal data will be divided into the training set, and 30 EEG signal data will be divided into the test set; the number of 70 training set data in the field of EEG signal recognition training technology meets the definition of big data;
[0100] Step S1013, calculate the ratio of the number of training data to the number of test data, round it up, and mark it as the number of division intervals;
[0101] In specific implementation, the purpose of rounding down is to eliminate the influence of the result being a decimal and increase the number of EEG signal data divided into the training set data; for example, when the number of training data is 70 and the number of test data is 30, the number of division intervals is calculated to be 4; it means that in step S1022, one test set data is divided every 4 data intervals, and finally 80 EEG signal data are divided into the training set data and 20 EEG signal data are divided into the test set data;
[0102] It should be noted that in order to meet the definition of big data, the number of training data should not be less than 50, and the number of training data should not be less than the number of test data. When the number of test data is greater than the number of training data, the number of training data used for subsequent training will be too small, reducing the accuracy of the recognition model. At the same time, too much test data will not affect the calculation of the F1 score. The F1 score is determined by the recognition model obtained through training and has nothing to do with the number of test set data. Excessive testing will only increase data redundancy.
[0103] Step S1021, sorting the first number of EEG data to obtain an EEG data sequence, and calculating a division number using a division calculation formula;
[0104] The partition calculation formula is configured as BHi=i×n+1; wherein BHi is the i-th partition number, n is the partition interval number, and i is a positive integer;
[0105] Step S1022, marking the EEG data with the same number as the partition number in the EEG data series as test set data, and marking the other EEG signal data except the test set data as training set data;
[0106] See also Figure 2 As shown, step S2 is to calculate and analyze each EEG signal data, output the label voltage and determine the voltage frequency based on the calculation result; step S2 also includes the following sub-steps:
[0107] Step S2011, obtaining the maximum value of the voltage in each EEG signal data, and marking it as a label voltage;
[0108] Step S2012, marking the difference of the calculated unit voltage obtained by subtracting the determination multiple from the tag voltage as a first determination endpoint, and marking the voltage between the first determination endpoint and the tag voltage as a first determination interval;
[0109] Step S2013, calculating the frequency of the voltage in the EEG signal data being in the first judgment interval, and marking it as the first calibration judgment frequency;
[0110] Step S2014, when the first calibration judgment frequency is greater than the calibration judgment threshold, outputting the tag voltage;
[0111] Step S2015, when the first calibration judgment frequency is less than or equal to the calibration judgment threshold, a maximum value re-judgment process is performed;
[0112] In the specific implementation, the judgment multiple is set to 5 times, the calculation unit voltage is set to 1μv, and the calibration judgment threshold is set to 10; the calculation unit voltage is set to 1μv in order to gradually and slowly clamp the calculation state voltage interval in the subsequent steps; the calibration judgment threshold is set to 10 in order to exclude abnormal peaks caused by errors; Figure 2 For example, if Figure 2 The maximum voltage in the figure is 27μv, so the first judgment interval is 22~27μv; the frequency of the voltage in the first judgment interval in the figure is 12; T1 and T2 are shown as a single time in the figure due to the instantaneous large change in voltage, but they are actually counted twice; at this time, it can be judged that 27μv is not abnormal data caused by error, so 27μv can be used as the label voltage of the EEG signal data;
[0113] The maximum value re-determination process includes:
[0114] Updating the first determination endpoint to the tag voltage;
[0115] Repeat step S2012 to step S2013 to obtain a first calibration judgment frequency, and when the first calibration judgment frequency is greater than a calibration judgment threshold, output the tag voltage;
[0116] When the first calibration judgment frequency is less than or equal to the calibration judgment threshold, repeating the maximum value re-judgment process;
[0117] Step S2021, analyzing the tag voltage, when the tag voltage is less than or equal to the first voltage threshold, calculating the occurrence frequency of the voltage in the first voltage interval, and marking it as the first judgment frequency;
[0118] Step S2022, when the tag voltage is greater than the first voltage threshold, calculating the occurrence frequency of the voltage in the second voltage interval and marking it as a second judgment frequency;
[0119] In a specific implementation, the first voltage threshold is set to 50 μv, the first voltage interval is set to 15-25 μv; the second voltage interval is set to 35-45 μv;
[0120] It should be noted that brain waves have five waveforms: δ, θ, α, β and γ. The voltage and frequency of each waveform are shown in Table 1-1.
[0121] Table 1-1
[0122] Waveform Common voltage μv Maximum voltage μv Frequency Hz δ 10~30 50 0.5~4 θ 10~30 50 4~8 α 30~50 100 8~12 β 5~30 (20 is the most common) 30 12~32 γ 15~25 30 Greater than or equal to 32
[0123] The first voltage interval can determine theta, beta and gamma waveforms in the subsequent steps, and the second voltage interval can determine the alpha waveform in the subsequent steps; delta only appears in deep sleep or extreme fatigue, and the frequency of the delta wave is less than 8Hz, so it is not analyzed;
[0124] Step S3, analyzing the EEG signal data based on the voltage frequency, and outputting the corresponding state; calculating the state voltage interval based on the corresponding state, and outputting the state voltage interval; using deep learning technology to train the model, and outputting the recognition model; Step S3 also includes the following sub-steps:
[0125] Step S301, receiving a judgment voltage frequency, when receiving a first judgment frequency, analyzing the first judgment frequency, when the first judgment frequency is less than or equal to a first frequency threshold, outputting a distraction state; when the first judgment frequency is greater than or equal to a second frequency threshold, outputting a concentration state; when the first judgment frequency is between the first judgment frequency and the second judgment frequency, deleting the corresponding EEG signal data;
[0126] In a specific implementation, the first frequency threshold is set to 8, and the second frequency threshold is set to 12;
[0127] It should be noted that α, δ and θ waveforms appear in distracted or sleeping states, β waveform appears when awake, accompanied by a state of concentration that can be achieved with effort, and γ wave can appear when concentrating on learning; when the first judgment frequency is less than 8, it indicates that it is in δ or θ wave, and the sleeping state is classified as a distracted state, and it is judged as a distracted state at this time; when the first judgment frequency is greater than 12, it is represented by β or γ waveform, and it is judged as a concentrated state; when the first judgment frequency is between 8 and 12, it may be an α wave at this time, and the common voltage of the α waveform should be 30-50μv, which causes a conflict, so the corresponding EEG signal data is deleted;
[0128] Step S302, when a second judgment frequency is received, outputting a distraction state;
[0129] It should be noted that when the second judgment frequency appears, it means that the voltage is between 30 and 50 μv. At this time, it can be directly judged as an α waveform. Therefore, no additional analysis steps are required, and the distracted state is directly output;
[0130] Please refer to Figure 4 as shown Figure 4 In the figure, a represents the minimum voltage, b represents the label voltage, yz represents the occurrence rate threshold, c1 represents the probability that the voltage in a single test set data is in the first analysis interval, and d represents the calculation unit voltage; b = b - d means assigning the value of b - d to b; a = a + d means assigning the value of a + d to a; jz = jz + 1 means assigning the value of jz + 1 to jz;
[0131] Step S303, set the occurrence rate threshold yz, obtain the minimum voltage and the label voltage of a single test set data with the corresponding state of the focused state, and mark the interval from the minimum voltage to the label voltage as the first analysis interval [a, b], where a represents the minimum voltage and b represents the label voltage;
[0132] Calculate the probability that the voltage in a single test set data is in the first analysis interval, and mark it as c1;
[0133] Set the calculation times jz with an initial value of 1;
[0134] Start the loop analysis, and the loop analysis includes:
[0135] Analyze the relationship between c1 and yz;
[0136] When c1 < yz, output the first analysis interval and end the loop analysis;
[0137] When c1 > yz, judge the parity of jz; when jz is odd, subtract d from b, where d is the calculation unit voltage; recalculate c1 and increment jz by 1;
[0138] When jz is even, add d to a, recalculate c1, and increment jz by 1;
[0139] Repeat the loop analysis;
[0140] Please refer to Figure 5 as shown Figure 5 In the figure, the part between the two dashed lines T3 and T4 is the state voltage interval;
[0141] Step S304, repeat Step S303 to calculate the first analysis intervals of all corresponding states of the focused state; calculate the average value of all the first analysis intervals and mark it as the focused voltage interval;
[0142] Step S305, obtaining the minimum voltage and label voltage of a single test set data corresponding to the distracted state, marking the minimum voltage to the label voltage as a second analysis interval [a, b], where a represents the minimum voltage and b represents the label voltage;
[0143] Calculate the probability that the voltage in a single test set data is in the second analysis interval, marked as c2;
[0144] Set the initial value of the calculation times jz to 1;
[0145] Start a cyclic analysis, which includes:
[0146] Analyze c2 and yz;
[0147] When c2 is less than or equal to yz, the second analysis interval is output and the loop analysis ends;
[0148] When c2 is greater than yz, determine the parity of jz; when jz is an odd number, subtract d from b, where d is the calculated unit voltage; recalculate c2 and add one to jz;
[0149] When jz is an even number, add d to a, recalculate c2, and add 1 to jz;
[0150] Repeated cycle analysis;
[0151] Step S306, repeating step S305, calculating all second analysis intervals corresponding to the distraction state; calculating the average value of all second analysis intervals, and marking them as distraction voltage intervals;
[0152] In the specific implementation, the occurrence rate threshold is set to 70%; since EEG signals inevitably have high and low peaks, 30% of the voltage data is allowed to exceed the state voltage range when floating;
[0153] It should be noted that the method of slowly squeezing up and down is used in steps S303 to S306 to make the judgment, so as to avoid the simultaneous changes that cause c1 and c2 to become too small instantly;
[0154] Step S307, using deep learning technology to perform model training on the training set data, the label voltage corresponding to the training set data, and the corresponding state of the training set data, and outputting the recognition model when the training is completed;
[0155] Step S4, using the recognition model to analyze the test set data and output the recognition state; analyzing the recognition state based on the state voltage interval and calculating the analyzed F1 score; analyzing the F1 score and outputting retraining information or training completion information based on the analysis result; Step S4 also includes the following sub-steps:
[0156] Step S4011, using the recognition model to recognize the test set data, and outputting the recognition status, wherein the recognition status includes a focused state and a distracted state;
[0157] Calculate the probability e that the voltage of the test set data whose recognition state is the focus state is in the focus voltage interval;
[0158] When e is greater than or equal to yz, the test set data is marked as actual focused data;
[0159] When e is less than yz, no processing is done;
[0160] Calculate the probability f that the voltage of the test set data whose recognition state is the distraction state is located in the distraction voltage interval;
[0161] When f is greater than or equal to yz, the test set data is marked as actual distracting data;
[0162] When f is less than yz, no processing is done;
[0163] Step S4012, calculating the accuracy of the recognition model;
[0164] The calculation method of the accuracy is:
[0165] Get the number of test set data with the recognition state of focus, marked as the expected focus number; get the total number of actual focus data, marked as the actual focus number;
[0166] Get the number of test set data in the recognition state of distraction, marked as the expected number of distractions; get the total number of actual distraction data, marked as the actual number of distractions;
[0167] The accuracy is calculated using the accuracy calculation formula.
[0168] The accuracy calculation formula is configured as: Among them, JQ is the accuracy rate, SZ is the actual number of concentration, SF is the actual number of distraction, YZ is the expected number of concentration, and YF is the expected number of distraction;
[0169] It should be noted that, in this embodiment, the corresponding state is divided into two categories, namely, the focused state and the distracted state; the accuracy calculation formula is Simplified, it means the proportion of the expected focused state that is actually in the focused state plus the proportion of the expected distracted state that is actually in the distracted state; as shown in Table 2-1
[0170] Table 2-1
[0171] Estimated number of focuses 80 Actual focus number 70 Estimated number of distractions 20 Actual number of distractions 30
[0172] Then the calculated JQ is 0.77;
[0173] Step S4013, calculating the recall rate of the recognition model;
[0174] The method for calculating the recall rate is as follows: setting a recall calculation value with an initial value of 0, obtaining the corresponding state and the recognition state of the test set data, and when the corresponding state is the same as the recognition state, adding one to the recall calculation value;
[0175] Get the number of test set data and use the recall rate calculation formula to calculate the recall rate.
[0176] The recall rate calculation formula is configured as: Where ZH is the recall rate, CS is the calculated recall value, and CES is the number of test set data;
[0177] It should be noted that recall refers to the proportion of samples that are actually positive that are correctly predicted as positive by the model; the recall calculation formula means the probability of being correctly identified in the test set data. Under the same prediction results as Table 2-1, the recall calculation is shown in Table 2-2:
[0178] Table 2-2
[0179]
[0180]
[0181] The calculated recall rate is 0.9;
[0182] Step S4014, calculating the F1 score of the recognition model using the F1 score calculation formula;
[0183] The F1 score calculation formula is configured as:
[0184] Step S4021, obtaining an F1 score, and when the F1 score is greater than or equal to a first score threshold, outputting training completion information;
[0185] Step S4022, when the F1 score is less than the first score threshold, determine the precision; when the precision is greater than or equal to the first score threshold, output training completion information;
[0186] In a specific implementation, the first score threshold is set to 0.8;
[0187] Step S4023, when the recall rate is less than the first score threshold, outputting retraining information;
[0188] It should be noted that the F1 score ranges from 0 to 1, where 1 represents the best performance and 0 represents the worst performance. When JQ is 0.77 and ZH is 0.9, the calculated F1 is 0.83. At this time, the recognition model is judged to be reliable and the training completion information is output.
[0189] On the other hand, when the precision is 0.74 and the recall is 0.86, the F1 score is 0.79. At this time, the F1 score and the precision are less than 0.8, but the recall is greater than 0.8, which means that when 100 EEG signal data are used for the recognition model to judge, each EEG signal data has a 79% probability of being correctly recognized, and the final number of correct recognitions is 86; in the case of big data recognition, the recognition model can still be used. When the recognition accuracy of a single data is less than 80%, the retraining information is output to improve the precision of the recognition model through re-training.
[0190] Example 2
[0191] Second, see Figure 2 As shown, the difference between this embodiment and embodiment 1 is that, in the case of abnormal maximum voltage, maximum value re-judgment processing is required; therefore, this embodiment is further described when the first calibration judgment frequency is less than or equal to the calibration judgment threshold:
[0192] Step S2011, obtaining the maximum value of the voltage in each EEG signal data, and marking it as a label voltage;
[0193] Step S2012, marking the difference of the calculated unit voltage obtained by subtracting the determination multiple from the tag voltage as a first determination endpoint, and marking the voltage between the first determination endpoint and the tag voltage as a first determination interval;
[0194] Step S2013, calculating the frequency of the voltage in the EEG signal data being in the first judgment interval, and marking it as the first calibration judgment frequency;
[0195] Step S2014, when the first calibration judgment frequency is greater than the calibration judgment threshold, outputting the tag voltage;
[0196] Step S2015, when the first calibration judgment frequency is less than or equal to the calibration judgment threshold, a maximum value re-judgment process is performed;
[0197] by Figure 3 For example, if Figure 3 The maximum voltage is 37μv, so the first judgment interval is 32~37μv; the frequency of the voltage in the first judgment interval in the figure is 6; at this time, it can be judged that 32μv may be abnormal data caused by error, and the maximum value re-judgment processing is required;
[0198] The maximum value re-determination process includes:
[0199] Updating the first determination endpoint to the tag voltage;
[0200] Repeat step S2012 to step S2013 to obtain a first calibration judgment frequency, and when the first calibration judgment frequency is greater than a calibration judgment threshold, output the tag voltage;
[0201] When the first calibration judgment frequency is less than or equal to the calibration judgment threshold, repeating the maximum value re-judgment process;
[0202] In a specific implementation, the tag voltage is updated to 32 μv. At this time, the first judgment interval is 32-27 μv, and the first calibration frequency is 12. At this time, 32 is output as the tag voltage, and there is no need to continue the maximum value re-judgment process.
[0203] Example 3
[0204] Third, see Figure 6 As shown, the present invention also provides an EEG signal recognition training system based on big data, including an EEG data processing module, a model training module and a training analysis module;
[0205] The EEG data processing module is used to obtain EEG signal data and divide the EEG signal data into training set data and test set data;
[0206] The model training module includes a label analysis unit, a voltage calculation unit and a model training unit; the label analysis unit is used to calculate and analyze the EEG signal data, output the label voltage and judge the voltage frequency; the label analysis unit is also used to analyze the judgement voltage frequency and output the corresponding state; the voltage calculation unit is used to calculate and analyze the state voltage interval of the same corresponding state; the model training unit is used to train the model according to the training set data and output the recognition model;
[0207] The training analysis module includes an accurate judgment unit and an accurate calculation unit. The accurate judgment unit is used to analyze the recognition state of the test set data based on the state voltage interval; the accurate calculation unit is used to calculate the F1 score of the recognition model and output retraining information or training completion information based on the F1 score.
[0208] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0209] It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0210] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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 communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
Claims
1. A brain wave signal recognition training method based on big data, characterized in that: include: Step S1, obtaining a first amount of EEG signal data, dividing the first amount, and outputting training set data and test set data; Step S2, performing calculation and analysis on each EEG signal data, outputting a label voltage and determining the voltage frequency based on the calculation result; Step S3, analyzing the EEG signal data based on the determined voltage frequency and outputting the corresponding state; Calculate a state voltage interval based on the corresponding state, and output the state voltage interval; Use deep learning technology to train the model and output the recognition model; Step S4, using the recognition model to analyze the test set data and output the recognition status; Analyze the recognition state based on the state voltage interval and calculate the F1 score of the analysis; analyze the F1 score and output retraining information or training completion information based on the analysis result; The step S1 includes the following sub-steps: Step S1011, obtaining a first amount of EEG signal data, wherein the EEG signal data includes voltage; Step S1012, multiplying the first number by the first division coefficient to obtain an expected training number; marking the difference between the first number and the expected training number as the expected test number; Step S1013, calculate the ratio of the number of training data to the number of test data, round it down, and mark it as the number of division intervals; The step S1 further comprises the following sub-steps: Step S1021, sorting the first number of EEG data to obtain an EEG data sequence, and calculating a division number using a division calculation formula; The partition calculation formula is configured as BHi=i×n+1; wherein BHi is the i-th partition number, n is the partition interval number, and i is a positive integer; Step S1022, marking the EEG data with the same number as the partition number in the EEG data series as test set data, and marking the other EEG signal data except the test set data as training set data; The step S2 includes the following sub-steps: Step S2011, obtaining the maximum value of the voltage in each EEG signal data, and marking it as a label voltage; Step S2012, marking the difference of the calculated unit voltage obtained by subtracting the determination multiple from the tag voltage as a first determination endpoint, and marking the voltage between the first determination endpoint and the tag voltage as a first determination interval; Step S2013, calculating the frequency of the voltage in the EEG signal data being in the first judgment interval, and marking it as the first calibration judgment frequency; Step S2014, when the first calibration judgment frequency is greater than the calibration judgment threshold, outputting the tag voltage; Step S2015, when the first calibration judgment frequency is less than or equal to the calibration judgment threshold, a maximum value re-judgment process is performed; The maximum value re-determination process includes: Updating the first determination endpoint to the tag voltage; Repeat step S2012 to step S2013 to obtain a first calibration judgment frequency, and when the first calibration judgment frequency is greater than a calibration judgment threshold, output the tag voltage; When the first calibration determination frequency is less than or equal to the calibration determination threshold, the maximum value re-determination process is repeated.
2. The method for EEG signal recognition training based on big data according to claim 1, characterized in that: The voltage frequency determination includes a first determination frequency and a second determination frequency, and step S2 further includes the following sub-steps: Step S2021: Analyze the tag voltage. When the tag voltage is less than or equal to the first voltage threshold, calculate the occurrence frequency of the voltage within the first voltage range and mark it as the first judgment frequency. Step S2022: When the tag voltage is greater than the first voltage threshold, calculate the occurrence frequency of the voltage within the second voltage range and mark it as the second judgment frequency.
3. The method for EEG signal recognition training based on big data according to claim 2, characterized in that: The corresponding states include the focused state and the distracted state. The state voltage ranges include the focused voltage range and the distracted voltage range. Step S3 includes the following sub-steps: Step S301: Receive the judgment voltage frequency. When the first judgment frequency is received, analyze the first judgment frequency. When the first judgment frequency is less than or equal to the first frequency threshold, output the distracted state. When the first judgment frequency is greater than or equal to the second frequency threshold, output the focused state. When the first judgment frequency is between the first judgment frequency and the second judgment frequency, delete the corresponding electroencephalogram signal data. Step S302: When the second judgment frequency is received, output the distracted state. Step S303: Set the occurrence rate threshold yz. Obtain the minimum voltage and the tag voltage of the test set data with a single corresponding state of the focused state. Mark the range from the minimum voltage to the tag voltage as the first analysis range [a, b], where a represents the minimum voltage and b represents the tag voltage. Calculate the probability that the voltage in the single test set data is within the first analysis range and mark it as c1. Set the calculation count jz with an initial value of 1. Start the loop analysis. The loop analysis includes: Analyze the relationship between c1 and yz. When c1 < yz, output the first analysis range and end the loop analysis. When c1 > yz, judge the parity of jz. When jz is odd, subtract d (where d is the calculated unit voltage) from b. Recalculate c1 and increment jz by 1. When jz is even, add d to a, recalculate c1, and increment jz by 1. Repeat the loop analysis. Step S304: Repeat Step S303 to calculate the first analysis ranges for all test set data with a corresponding state of the focused state. Calculate the average value of all the first analysis ranges and mark it as the focused voltage range. Step S305: Obtain the minimum voltage and the tag voltage of the test set data with a single corresponding state of the distracted state. Mark the range from the minimum voltage to the tag voltage as the second analysis range [a, b], where a represents the minimum voltage and b represents the tag voltage. Calculate the probability that the voltage in the single test set data is within the second analysis range and mark it as c2. Set the calculation count jz with an initial value of 1. Start the loop analysis. The loop analysis includes: Analyze c2 and yz. When c2 is less than or equal to yz, output the second analysis range and end the loop analysis. When c2 > yz, judge the parity of jz. When jz is odd, subtract d (where d is the calculated unit voltage) from b. Recalculate c2 and increment jz by 1. When jz is even, add d to a, recalculate c2, and increment jz by 1. Repeat the loop analysis. Step S306, repeating step S305, calculating all second analysis intervals corresponding to the distraction state; calculating the average value of all second analysis intervals, and marking them as distraction voltage intervals; Step S307, using deep learning technology to perform model training on the training set data, the label voltage corresponding to the training set data, and the corresponding state of the training set data, and output the recognition model when the training is completed.
4. The method for EEG signal recognition training based on big data according to claim 3, characterized in that: The step S4 includes the following sub-steps: Step S4011, using the recognition model to recognize the test set data, and outputting the recognition status, wherein the recognition status includes a focused state and a distracted state; Calculate the probability e that the voltage of the test set data whose recognition state is the focus state is in the focus voltage interval; When e is greater than or equal to yz, the test set data is marked as actual focused data; When e is less than yz, no processing is done; Calculate the probability f that the voltage of the test set data whose recognition state is the distraction state is located in the distraction voltage interval; When f is greater than or equal to yz, the test set data is marked as actual distracting data; When f is less than yz, no processing is done; Step S4012, calculating the accuracy of the recognition model; The calculation method of the accuracy is: Get the number of test set data with the recognition state of focus, marked as the expected focus number; get the total number of actual focus data, marked as the actual focus number; Get the number of test set data in the recognition state of distraction, marked as the expected number of distractions; get the total number of actual distraction data, marked as the actual number of distractions; The accuracy is calculated using the accuracy calculation formula. The accuracy calculation formula is configured as: JQ= , where JQ is the accuracy, SZ is the actual number of concentration, SF is the actual number of distraction, YZ is the expected number of concentration, and YF is the expected number of distraction; Step S4013, calculating the recall rate of the recognition model; The method for calculating the recall rate is as follows: setting a recall calculation value with an initial value of 0, obtaining the corresponding state and the recognition state of the test set data, and when the corresponding state is the same as the recognition state, adding one to the recall calculation value; Get the number of test set data and use the recall rate calculation formula to calculate the recall rate. The recall rate calculation formula is configured as: ZH= , where ZH is the recall rate, CS is the calculated recall value, and CES is the number of test set data; Step S4014, calculating the F1 score of the recognition model using the F1 score calculation formula; The F1 score calculation formula is configured as: F1 = .
5. The method for EEG signal recognition training based on big data according to claim 4, characterized in that: The step S4 also includes the following sub-steps: Step S4021, obtaining an F1 score, and when the F1 score is greater than or equal to a first score threshold, outputting training completion information; Step S4022, when the F1 score is less than the first score threshold, determine the precision; when the precision is greater than or equal to the first score threshold, output training completion information; Step S4023: when the recall rate is less than the first score threshold, output retraining information.
6. A system for the big data-based EEG signal recognition training method according to any one of claims 1 to 5, characterized in that: It includes EEG data processing module, model training module and training analysis module; The EEG data processing module is used to obtain EEG signal data and divide the EEG signal data into training set data and test set data; The model training module includes a label analysis unit, a voltage calculation unit and a model training unit; the label analysis unit is used to calculate and analyze the EEG signal data, output the label voltage and judge the voltage frequency; the label analysis unit is also used to analyze the judgement voltage frequency and output the corresponding state; the voltage calculation unit is used to calculate and analyze the state voltage interval of the same corresponding state; the model training unit is used to perform model training according to the training set data and output the recognition model; The training analysis module includes an accurate judgment unit and an accurate calculation unit. The accurate judgment unit is used to analyze the recognition state of the test set data based on the state voltage interval; the accurate calculation unit is used to calculate the F1 score of the recognition model and output retraining information or training completion information based on the F1 score.
Citation Information
Patent Citations
Electroencephalogram signal identification method
CN115099274A
Electric wheelchair control system based on electroencephalogram signal
CN109481164A
Distraction driving state identification method and system based on electroencephalogram complex network
CN116712091A