Eye closing-eye opening event identification method based on EEG data and equipment control method

By performing sliding average filtering and bandpass filtering on EEG data, the α wave energy ratio is extracted to judge the closed-eye-opening event, which solves the problem of inaccurate event recognition in the prior art, realizes efficient device control, and improves user experience and smart home applications.

CN120428849APending Publication Date: 2025-08-05SHANGHAI NAOYUN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510357487.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The existing EEG signal-based device control technology lacks the accuracy and stability of event recognition, and it is particularly difficult to accurately identify eye-opening events of a specific time, affecting the reliability of device control.

Method used

By performing sliding average filtering and bandpass filtering on the EEG data, the α wave energy is extracted, and the α wave energy ratio is used to judge the eye-closing and eye-opening events, combining time interval and frequency limitation to screen effective event pairs, so as to achieve accurate identification of eye-closing-opening events.

Benefits of technology

It improves the accuracy and stability of eye-opening events identification, reduces noise interference from device control, and is suitable for special scenarios such as mobility difficulties, improving user experience and device intelligence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120428849A_ABST
    Figure CN120428849A_ABST
Patent Text Reader

Abstract

The invention relates to the field of smart home and smart equipment, and discloses an eye closing-eye opening event identification method and equipment control method based on EEG data, and the method specifically comprises the steps: obtaining original EEG data, and carrying out the preprocessing of the original EEG data, and obtaining the preprocessed EEG data; dividing the preprocessed EEG data into a plurality of windows of which the lengths are windows; calculating alpha wave energy of each window; and judging whether an eye closing event and an eye opening event occur or not by calculating the alpha wave energy ratio of adjacent windows. On the basis of alpha wave energy change and reasonable threshold setting, the eye closing-eye opening event can be accurately detected, effective event pairs are screened out through time interval and frequency limitation, and the event recognition accuracy and stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of smart homes and smart devices, and in particular to an eyes-closed-eyes-open event recognition method and a device control method based on EEG data. Background Art

[0002] In the field of smart home and smart device control, traditional control methods mainly include manual control, voice control, and gesture control. Manual control requires users to directly operate the device's physical buttons or interface, which is not convenient in certain scenarios (such as when both hands are occupied or mobility is limited). Voice control relies on speech recognition technology, which can affect recognition accuracy in noisy environments and may pose a risk of privacy leakage. Gesture control has high requirements for operating space and gesture recognition accuracy, and may not be accurate in some complex environments.

[0003] With the development of brain-computer interface technology, using EEG signals to control devices has become a research direction. However, existing EEG-based device control technologies lack the accuracy and stability of event recognition. For example, when identifying simple events such as eyes closing and opening, EEG signals are susceptible to noise interference, and EEG signal characteristics vary from individual to individual, making it difficult to accurately detect specific events, which in turn affects the reliability of device control. Furthermore, the ability to recognize time constraints of events (such as eyes closing and opening events of a specific duration) is also weak, making it difficult to meet the demand for precise control in practical applications.

[0004] Currently, there is no mature technical solution that can efficiently and accurately identify a specific duration, such as an "eyes closed-eye open" event within 5 seconds, and stably use it for device control. Summary of the Invention

[0005] The main purpose of this invention is to solve the technical problems of insufficient event recognition accuracy and stability in the existing EEG signal-based device control technology, as well as the difficulty in accurately identifying events of specific duration. The method for identifying eyes closed-eyes-open events based on EEG data includes the following steps: Obtaining raw EEG data and preprocessing it to obtain preprocessed EEG data; Divide the preprocessed EEG data into multiple windows of length window_size; Calculate the alpha wave energy in each window; By calculating the α wave energy ratio of adjacent windows, it is determined whether an eye closing event or an eye opening event has occurred.

[0006] As a preferred technical solution, the pretreatment includes the following steps: Use the function moving_average(data,window_size) to smooth the EEG data. The principle is to convolve the data data with a uniform weight window of length window_size through the convolution operation. The formula is: Among them, y[n] is the filtered data, data[n] is the original data, and n is the index of the data point.

[0007] As a preferred technical solution, the pretreatment further comprises the following steps: Use the butter_bandpass_filter(data,lowcut,highcut,fs,order) function to design and apply a bandpass filter, where lowcut = 8 Hz, highcut = 13 Hz, fs is the sampling frequency, and order is the filter order. The bandpass filter is used to extract the 8-13 Hz alpha wave signal. The design of the bandpass filter is based on the Butterworth filter principle, and its transfer function is: Where N is the filter order, sk is the filter pole, and k is the different physical oscillation modes or states in the system. The analog filter is converted into a digital filter through bilinear transformation.

[0008] As a preferred technical solution, the calculation method of the alpha wave energy is: Use the calculate_alpha_energy(data,fs) function to calculate the alpha wave energy. This function uses the Welch method to estimate the power spectral density. The formula is: Among them, P xx (f) is the power spectral density, x(n) is the EEG data in the window, w(n) is the window function, N is the number of data points, and f is the frequency; Then, the power spectrum in the range of 8-13 Hz is integrated to obtain the alpha wave energy, and the formula is as follows: .

[0009] As a preferred technical solution, the method for determining whether an eye closing event or an eye opening event has occurred is: Set a threshold threshold; let the α wave energy of the current window be α_energ(yi), and the α wave energy of the previous window be α_energ(yi−1). If α_energ(yi) / α_energ(yi−1)>threshold, it is considered that an eye closing event has occurred; if α_energ(yi) / α_energ(yi−1)<1 / threshold, it is considered that an eye opening event has occurred.

[0010] As a preferred technical solution, the identification method also includes a valid event pair screening step, and the valid event pair screening step includes the following steps: obtaining the eye closure duration; when the eye closure duration is between 2.0-3.0 seconds and no valid event pair occurs within 5 seconds, it is considered that paired eye closing and eye opening events have been screened.

[0011] A second aspect of the present invention provides a device control method, comprising: Acquire EEG data in real time; use the aforementioned recognition method to identify the EEG data; when a matching eye-closed-eye-open event pair is identified, use the EEG data to control related devices, including lighting control and curtain control.

[0012] The present invention has the following beneficial effects: By preprocessing the EEG data through sliding average filtering and bandpass filtering, noise interference is effectively reduced and the extraction accuracy of α wave signals is improved; based on the energy changes of α waves and reasonable threshold settings, the "eyes closed-eyes open" events can be accurately detected, and effective event pairs can be screened out through time interval and frequency restrictions, thereby improving the accuracy and stability of event recognition.

[0013] The technology of the present invention can be applied to the fields of smart homes and smart devices, reducing dependence on traditional control methods (such as complex manual control devices, high-precision voice recognition devices, etc.), reducing equipment costs and maintenance costs; at the same time, it improves the intelligence level of device control, increases the market competitiveness of products, and has good economic benefits.

[0014] The solution of the present invention provides users with a more convenient and natural way to control devices, which is especially suitable for users in special scenarios such as those with limited mobility or whose hands are occupied, thereby improving the user experience; promoting the application of brain-computer interface technology in daily life, promoting the development of smart life, and having positive social significance. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A flowchart of a method for identifying eyes closed-eyes open events based on EEG data provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0016] The terms "first," "second," "third," "fourth," and so on (if any) in the description and claims of the present invention and in the accompanying drawings are used to distinguish similar items and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that shown or described herein. In addition, the terms "including," "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, product, or apparatus.

[0017] The specific implementation method of the function of the present invention is as follows: Sliding average filter function Function: Perform sliding average processing on the input one-dimensional time series data to suppress high-frequency noise.

[0018] parameter: data: One-dimensional array of input, raw EEG signal.

[0019] window_size: Window size (integer, unit: number of data points).

[0020] Implementation steps: Cumulative sum calculation: After inserting a 0 at the beginning of the data, calculate the cumulative sum array.

[0021] Window sliding: Calculate the sum of the data in each window by difference, and then divide it by the window size to get the mean.

[0022] Boundary processing: directly truncate edge data (output length is less than input by window_size - 1).

[0023] Bandpass filter function Function: Use Butterworth filter to extract the specified frequency band (such as 8-13Hz of alpha wave).

[0024] parameter: data: Input one-dimensional EEG data.

[0025] lowcut: passband low frequency cutoff frequency (Hz).

[0026] highcut: passband high frequency cutoff frequency (Hz).

[0027] fs: sampling frequency (Hz).

[0028] order: filter order (default is 5).

[0029] Implementation steps: Frequency normalization: Convert the cutoff frequency to a multiple of the Nyquist frequency (range 0 to 1).

[0030] Filter design: Call the butter function to design a Butterworth bandpass filter.

[0031] Zero-phase filtering: Use filtfilt bidirectional filtering to eliminate phase delay.

[0032] Alpha wave energy calculation function Function: Calculates the power spectral density (PSD) of the input data using the Welch method, integrating it in the 8-13 Hz frequency band to obtain the alpha wave energy.

[0033] parameter: data: preprocessed EEG data (1D array).

[0034] fs: sampling frequency (Hz).

[0035] Implementation steps: Welch power spectrum estimation: Call the welch function to calculate PSD.

[0036] Frequency point screening: Find the frequency point index corresponding to 8-13Hz.

[0037] Energy Integration: Integrate the power spectral density of the selected frequency band.

[0038] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 The first embodiment of the method for identifying eyes closed-eyes open events based on EEG data in the embodiment of the present invention includes: The method for identifying eyes closed-eye open events based on EEG data includes the following steps: Obtaining raw EEG data and preprocessing it to obtain preprocessed EEG data; The pretreatment comprises the following steps: Use the function moving_average(data,window_size) to smooth the EEG data. The principle is to convolve the data data with a uniform weight window of length window_size through the convolution operation. The formula is: Among them, y[n] is the filtered data, data[n] is the original data, and n is the index of the data point.

[0039] The pre-processing further comprises the following steps: Use the butter_bandpass_filter(data,lowcut,highcut,fs,order) function to design and apply a bandpass filter, where lowcut = 8 Hz, highcut = 13 Hz, fs is the sampling frequency, and order is the filter order. The bandpass filter is used to extract the 8-13 Hz alpha wave signal. The design of the bandpass filter is based on the Butterworth filter principle, and its transfer function is: Where N is the filter order, sk is the filter pole, and k is the different physical oscillation modes or states in the system. The analog filter is converted into a digital filter through bilinear transformation.

[0040] Divide the preprocessed EEG data into multiple windows of length window_size; calculate the alpha wave energy of each window; The calculation method of the α wave energy is: Use the calculate_alpha_energy(data,fs) function to calculate the alpha wave energy. This function uses the Welch method to estimate the power spectral density. The formula is: Among them, P xx (f) is the power spectral density, x(n) is the EEG data in the window, w(n) is the window function, N is the number of data points, and f is the frequency; Then, the power spectrum in the range of 8-13 Hz is integrated to obtain the alpha wave energy, and the formula is as follows: .

[0041] By calculating the α wave energy ratio of adjacent windows, it is determined whether an eye closing event or an eye opening event has occurred.

[0042] The method for determining whether an eye closing event or an eye opening event has occurred is: Set a threshold value; Assume that the α wave energy of the current window is α_energ(yi), and the α wave energy of the previous window is α_energ(yi−1). If α_energ(yi) / α_energ(yi−1)>threshold, it is considered that an eye closing event has occurred; if α_energ(yi) / α_energ(yi−1)<1 / threshold, it is considered that an eye opening event has occurred.

[0043] The identification method further includes a valid event pair screening step, wherein the valid event pair screening step includes the following steps: Get the duration of eye closure; When the eye closure duration is between 2.0 and 3.0 seconds and no valid event pair occurs within 5 seconds, it is considered that paired eye closure and eye opening events have been screened.

[0044] A second aspect of the present invention provides a device control method, comprising: Real-time acquisition of EEG data; The aforementioned recognition method is used to identify the EEG data; When a matching eye-closed-eye-open event pair is identified, the EEG data is used to control related devices, including lighting control and curtain control.

[0045] Specifically, the scheme of the present invention is as follows: First, pair your computer or mobile phone with the EEG acquisition device via Bluetooth to ensure that the device is working properly and can collect EEG data in real time.

[0046] After the collected raw EEG data is transferred to a computer or mobile phone, data preprocessing is performed: Apply the moving average filter function moving_average(data,window_size) and set an appropriate window_size (such as determined by the sampling frequency and data characteristics) to smooth the raw EEG data and reduce noise interference.

[0047] Use the bandpass filter function butter_bandpass_filter(data,8,13,fs,order) to perform bandpass filtering on the smoothed data according to the actual sampling frequency fs and the set filter order order (such as 5th order) to extract the 8-13Hz alpha wave signal.

[0048] Calculate the alpha wave energy of the preprocessed EEG data: Divide the data into multiple windows of length window_size (such as 0.5 seconds or other appropriate duration).

[0049] For each window, call the calculate_alpha_energy(data,fs) function, use the Welch method to estimate the power spectral density, and integrate the power spectrum in the range of 8-13 Hz to obtain the alpha wave energy of each window.

[0050] Detecting eye closing and eye opening events: Set an appropriate threshold (such as 1.3, which can be adjusted according to experimental data).

[0051] Compare the α wave energy ratios of adjacent windows. When α_energyi / α_energyi−1>threshold, it is marked as an eye-closing event; when α_energyi / α_energyi−1<1 / threshold, it is marked as an eye-opening event.

[0052] Filter valid event pairs: Detected eye closing and eye opening events were screened to ensure that the duration of eye closing was between 2.0 and 3.0 seconds.

[0053] At the same time, check whether multiple event pairs occur within 5 seconds. If they occur multiple times, only the pair of events that meets the conditions is retained and other event pairs are excluded.

[0054] When a matching "eyes closed-eyes open" event pair is identified, the system sends a signal to the corresponding device (such as lighting or curtains in a smart home system) based on pre-set control rules, enabling control of the device. For example, if the system is set to control lights, when an event pair is identified, a command is sent to the lighting control module to turn the lights on or off at the appropriate brightness.

[0055] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying eyes closed-eye open events based on EEG data, characterized in that: The following steps are involved: Obtaining raw EEG data and preprocessing it to obtain preprocessed EEG data; Divide the preprocessed EEG data into multiple windows of length window_size; Calculate the alpha wave energy in each window; By calculating the α wave energy ratio of adjacent windows, it is determined whether an eye closing event or an eye opening event has occurred.

2. The method for identifying eyes closed-eyes open events based on EEG data according to claim 1, characterized in that: The pretreatment comprises the following steps: Use the function moving_average(data,window_size) to smooth the EEG data. The principle is to convolve the data data with a uniform weight window of length window_size through the convolution operation. The formula is: Among them, y[n] is the filtered data, data[n] is the original data, and n is the index of the data point.

3. The method for identifying eyes closed-eyes open events based on EEG data according to claim 2, characterized in that: The pre-processing further comprises the following steps: Use the butter_bandpass_filter(data,lowcut,highcut,fs,order) function to design and apply a bandpass filter, where lowcut = 8 Hz, highcut = 13 Hz, fs is the sampling frequency, and order is the filter order. The bandpass filter is used to extract the 8-13 Hz alpha wave signal. The design of the bandpass filter is based on the Butterworth filter principle, and its transfer function is: Where N is the filter order, sk is the filter pole, and k is the different physical oscillation modes or states in the system. The analog filter is converted into a digital filter through bilinear transformation.

4. The method for identifying eyes closed-eyes open events based on EEG data according to claim 1, characterized in that: The calculation method of the α wave energy is: Use the calculate_alpha_energy(data,fs) function to calculate the alpha wave energy. This function uses the Welch method to estimate the power spectral density. The formula is: Among them, P xx (f) is the power spectral density, x(n) is the EEG data in the window, w(n) is the window function, N is the number of data points, and f is the frequency; Then, the power spectrum in the range of 8-13 Hz is integrated to obtain the alpha wave energy, and the formula is as follows: .

5. The method for identifying eyes closed-eyes open events based on EEG data according to claim 1, characterized in that: The method for determining whether an eye closing event or an eye opening event has occurred is: Set a threshold value; Assume that the α wave energy of the current window is α_energ(yi), and the α wave energy of the previous window is α_energ(yi−1). If α_energ(yi) / α_energ(yi−1)>threshold, it is considered that an eye closing event has occurred; if α_energ(yi) / α_energ(yi−1)<1 / threshold, it is considered that an eye opening event has occurred.

6. The method for identifying eyes closed-eyes open events based on EEG data according to claim 1, characterized in that: The identification method further includes a valid event pair screening step, wherein the valid event pair screening step includes the following steps: Get the duration of eye closure; When the eye closure duration is between 2.0 and 3.0 seconds and no valid event pair occurs within 5 seconds, it is considered that paired eye closure and eye opening events have been screened.

7. A device control method, comprising: Real-time acquisition of EEG data; Identify EEG data using the identification method described in any one of claims 1 to 6; When a matching eye-closed-eye-open event pair is identified, the EEG data is used to control related devices, including lighting control and curtain control.