Brain-computer interface meditation attention transfer method and device for chronic disease user
Through the brain-computer interface, collect and analyze the EEG signals of chronic disease patients, generate and adjust meditation courses suitable for their chronic disease, solve the problem of inefficient attention transfer in the existing technology, and realize personalized mindfulness meditation practice and more Efficient attention transfer.
Patent Information
- Application Number
- CN202510081917.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2045-01-20
AI Technical Summary
The prior art has problems with inefficiency in helping chronic disease patients divert attention, especially because the offline built tasks do not match the real-time status of users, resulting in deviations between tasks and user needs.
The brain-computer interface is used to collect the user's EEG signal, detect load information through the preset EEG detection model, generate meditation courses suitable for chronic diseases, and adjust the meditation courses in real time according to the load information when the user practices mindfulness meditation to guide the user. The focus shifts from chronic illness to mindful meditation.
By adjusting the meditation courses in real time, the degree of adaptation between users and meditation courses is improved, personalized mindfulness meditation practice is achieved, the efficiency of diverting attention is improved, and the negative impact of chronic diseases on users is alleviated.
Smart Images

Figure CN119495405A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of brain-computer interfaces, and in particular to a brain-computer interface mindfulness meditation attention transfer method and device for chronic disease users. Background Art
[0002] For patients with chronic diseases, they often use various methods to divert their attention from the chronic disease to other objects and reduce the negative impact of the chronic disease.
[0003] At present, the conventional method of diverting attention is to perform a task with certain cognitive requirements (such as watching TV) or a task of a certain exercise intensity (such as running). These tasks are difficult, so users usually input their chronic disease information into some APPs (applications) and ask them to recommend suitable tasks.
[0004] However, these apps often construct tasks based on chronic disease information offline, and push tasks to users when the chronic disease information is matched successfully. The offline constructed tasks have a certain deviation from the user's real-time status, which causes a certain deviation between the tasks and user needs. Moreover, these tasks have certain thresholds, and the user's status may be lower than the threshold of the task, which makes the user's task execution effect poor and the user's efficiency in diverting attention low. Summary of the invention
[0005] In view of this, the present invention provides a brain-computer interface mindfulness meditation attention transfer method and device for chronic disease users, so as to improve the efficiency of attention transfer for chronic disease users.
[0006] The first aspect of the present invention provides a brain-computer interface mindfulness meditation attention transfer method for chronic disease users, comprising:
[0007] Calling the brain-computer interface to collect single-channel or multi-channel EEG signals from the user;
[0008] Determine the chronic disease to which the user's attention is directed;
[0009] Inputting the EEG signal into a preset EEG detection model to detect one or more load information generated by the user;
[0010] generating a meditation course adapted to the chronic disease according to the load information;
[0011] When the user practices mindfulness meditation according to the meditation course, the meditation course is controlled to change according to the load information to guide the user's attention to shift from the chronic disease to the mindfulness meditation.
[0012] The second aspect of the present invention provides a brain-computer interface mindfulness meditation attention transfer device for chronic disease users, comprising:
[0013] An EEG signal acquisition module is used to call the brain-computer interface to collect single-channel or multi-channel EEG signals from the user;
[0014] A chronic disease determination module, used to determine the chronic disease to which the user's attention is focused;
[0015] A load information detection module, used for inputting the EEG signal into a preset EEG detection model to detect one or more load information generated by the user;
[0016] A meditation course generation module, used to generate a meditation course adapted to the chronic disease according to the load information;
[0017] A meditation course change module is used to control the change of the meditation course according to the load information when the user practices mindfulness meditation according to the meditation course, so as to guide the user's attention to shift from the chronic disease to the mindfulness meditation.
[0018] A third aspect of the present invention provides an electronic device, the electronic device comprising:
[0019] at least one processor; and
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the brain-computer interface mindfulness meditation attention transfer method for chronic disease users as described in the first aspect above.
[0022] The fourth aspect of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the brain-computer interface mindfulness meditation attention transfer method for chronic disease users as described in the first aspect above.
[0023] The fifth aspect of the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the brain-computer interface mindfulness meditation attention transfer method for chronic disease users as described in the first aspect above.
[0024] In this embodiment, the brain-computer interface is called to collect single-channel or multi-channel EEG signals from the user; the chronic disease that the user's attention is focused on is determined; the EEG signal is input into a preset EEG detection model to detect one or more load information generated by the user; a meditation course adapted to the chronic disease is generated based on the load information; when the user practices mindfulness meditation according to the meditation course, the meditation course changes are controlled based on the load information to guide the user's attention from chronic disease to mindfulness meditation. This embodiment constructs and adjusts the meditation course in real time based on the user's load information, and adjusts the meditation course adaptively to the user's state, striving to ensure that the state of each user reaches the threshold of the meditation course, improve the degree of adaptation between the user and the meditation course, realize personalized practice of mindfulness meditation, improve the effect of the user's practice of mindfulness meditation, improve the efficiency of the user's attention diversion, and alleviate the negative impact of chronic diseases on users.
[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 This is a flowchart of a brain-computer interface mindfulness meditation attention transfer method for chronic disease users provided in Example 1 of the present invention.
[0028] Figure 2 It is a structural schematic diagram of an electroencephalogram detection model provided in Example 1 of the present invention.
[0029] Figure 3 It is a structural schematic diagram of a brain-computer interface mindfulness meditation attention transfer device for chronic disease users provided in Example 2 of the present invention.
[0030] Figure 4 It is a structural schematic diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can cover sequential implementations other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] Embodiment 1
[0034] See also Figure 1 , showing a flow chart of a brain-computer interface mindfulness meditation attention transfer method for chronic disease users provided in Example 1 of the present invention. The method can be executed by a brain-computer interface mindfulness meditation attention transfer device for chronic disease users. The brain-computer interface mindfulness meditation attention transfer device for chronic disease users can be implemented in the form of hardware and / or software. The brain-computer interface mindfulness meditation attention transfer device for chronic disease users can be configured in an electronic device.
[0035] In one case, the electronic device is an integrated device, especially a head-mounted device, such as a smart headband, a smart helmet, smart glasses, etc. The virtual reality device is provided with a brain-computer interface as well as components such as speakers and screens. Components such as speakers and screens can be solidified in the electronic device or can be reused by mobile terminals such as mobile phones of users.
[0036] In another case, the electronic device may also be a physically separable or detachable device. In this case, the virtual reality device includes a head-mounted device and a display device that are independent of each other. The headband and the screen may be connected by wire or wireless means, such as Wi-Fi (Wireless Fidelity), Bluetooth, ZigBee, etc. The head-mounted device is provided with a brain-computer interface, and the display device is equipped with components such as a screen and a speaker. The screen may be an independent display device matched with the headband, or it may be a device with a screen such as a multiplexed television.
[0037] like Figure 1 As shown, the method includes:
[0038] Step 101: Call the brain-computer interface to collect single-channel or multi-channel EEG signals from the user.
[0039] In this embodiment, the user can wear an electronic device, which can call a brain-computer interface to collect single-channel or multi-channel EEG signals from the user at a preset frequency. EEG signals are also called electroencephalograms (EEGs), which are electrical signals generated by the activity of brain neurons. Neurons are connected to each other through synapses to form a complex neural network. When neurons are activated, bioelectric phenomena are generated, and these EEG signals can be captured by placing electrodes on the scalp.
[0040] The frequency may be a fixed value or a value dynamically adjusted according to factors such as the power of the electronic device and the task of diverting attention, and this embodiment does not impose any limitation on this.
[0041] Taking a single-channel EEG signal as an example, the brain-computer interface includes electrodes, a signal processor, and an A / D (Analogue to Digital conversion) converter.
[0042] Among them, the electrodes include a reference electrode, a ground electrode, and an EEG electrode of a signal channel; the ground electrode is used to determine the zero potential of the EEG signal, and the reference electrode and the ground electrode are placed at the temples on both sides of the user's head; the EEG electrode is placed at the Fp2 position defined in the 10-20 system.
[0043] The signal processor is used to amplify the collected EEG signal through an amplifier with a sampling frequency of 250 Hz, and to filter out the 50 Hz power frequency noise in the EEG signal through a notch filter, and then use a 0.1-50 Hz bandpass filter to filter out the DC component and high-frequency noise.
[0044] The A / D converter converts the amplified and filtered EEG signals from analog signals to digital signals through a 24-bit resolution digital-to-analog conversion chip.
[0045] Step 102: Determine the chronic disease that the user is focusing on.
[0046] Generally, users can manually input information about chronic diseases, such as the type of chronic disease, duration of chronic disease, severity of chronic disease, frequency of chronic disease, etc., to provide more information reference for mindfulness meditation, so as to better provide mindfulness meditation services to users.
[0047] Among them, chronic diseases can be divided into tinnitus and non-tinnitus. Non-tinnitus includes chronic pain (including but not limited to cancer pain, headaches, and back pain), drug addiction, etc.
[0048] In one case, when a user uses the electronic device in this embodiment, it can be considered that the user's attention is focused on the chronic disease.
[0049] In another case, EEG signals can be reused to detect the severity of a user's chronic disease symptoms, thereby determining whether the user's attention is focused on the chronic disease, thereby initiating a mindfulness meditation recommendation process.
[0050] In a specific implementation, the EEG signal can be input into a preset symptom detection model to detect the degree of symptoms of the user's chronic disease (i.e., the severity of the chronic disease symptoms), and the symptom degree can be compared with a preset degree threshold. When the symptom degree is greater than or equal to the preset degree threshold, it indicates that the risk of chronic disease onset is high or the symptoms are more obvious, and it is determined that the user's attention is focused on the chronic disease, which may amplify the negative impact of the chronic disease symptoms on the user.
[0051] At this time, voice, vibration and other methods can be used to prompt users to practice mindfulness meditation, shifting the user's attention from chronic diseases to mindfulness meditation, and alleviating the negative impact of chronic disease symptoms on users.
[0052] Exemplarily, the value range of the symptom degree is [1, 100], and a threshold a, b is set in this value range, such as a=20, b=80.
[0053] If the chronic symptom level is [1, a], it means that the user has a low risk of chronic disease onset.
[0054] If the chronic symptom level is at (a, b], it means that the user has a higher risk of chronic disease onset.
[0055] If the chronic symptom level is in (b, 100], it means that the user's chronic disease has produced more obvious symptoms.
[0056] In this example, both a and b can be set as degree thresholds.
[0057] It should be pointed out that the symptom detection model can be a machine learning model, such as a support vector machine (SVM), a decision tree, a random forest, etc. The symptom detection model can also be a deep learning model, such as a convolutional neural network (CNN), a long short-term memory network (LSTM), a Transformer (a neural network architecture based on a self-attention mechanism), etc. This embodiment does not limit this.
[0058] In one embodiment of the present invention, the method for training a symptom detection model comprises the following steps:
[0059] Step 1021: signal acquisition.
[0060] In step 1021, single-channel or multi-channel EEG signals are collected from a number of users (eg, 100) with different types of chronic diseases when their chronic diseases are not acting up and when they are acting up.
[0061] Step 1022: signal slicing.
[0062] In step 1022, the EEG signal is divided into segment signals of equal length (eg, 10 seconds), each segment signal constituting a sample.
[0063] Step 1023: Data labeling.
[0064] In step 1023, according to the degree of chronic disease symptoms reported by the user, the segment signal is marked with no chronic disease symptoms and chronic disease onset as labels.
[0065] Step 1024: Model training.
[0066] The symptom detection model is supervisedly trained using the fragment signal and its label. When the training is completed, the symptom detection model with fixed parameters is output.
[0067] Step 103: Input the EEG signal into a preset EEG detection model to detect one or more load information generated by the user.
[0068] In actual applications, different types of chronic diseases bring different loads to users. In order to simplify the detection operation and improve the efficiency of detection, in this embodiment, the same EEG signal can be input into a preset EEG detection model for analysis, and various load information generated by the user can be detected, and the load information adapted to the chronic disease can be selected for subsequent processing.
[0069] Exemplarily, the load information includes at least one of an attention value, an emotion value, a sleep value and a tinnitus frequency, wherein the attention value is a numerical value quantifying the degree of concentration of the user, the emotion value is a numerical value quantifying the degree of the user's emotion, the sleep value is a numerical value quantifying the depth of the user's sleep, and the tinnitus frequency is the frequency of the tinnitus cause generated by the user.
[0070] When the chronic disease is not tinnitus, the EEG signal can be input into a preset EEG detection model to detect the user's attention value, emotion value and sleep value.
[0071] When the chronic disease is tinnitus, the EEG signal is input into a preset EEG detection model to detect the user's attention value, emotion value, sleep value and tinnitus frequency.
[0072] In one embodiment of the present invention, Figure 2 As shown, the EEG detection model includes a first branch structure Branch_1 and a second branch structure Branch_2, wherein the first branch structure Branch_1 is mainly a basic decoding network of EEG signals, and the second branch structure Branch_2 is mainly a prediction network of tinnitus frequency.
[0073] Then, step 103 may include the following steps:
[0074] Step 1031: Perform time-frequency conversion on the EEG signal to obtain an EEG time-frequency graph.
[0075] In this embodiment, the EEG signal can be converted from the time domain to the frequency domain using methods such as continuous wavelet transform (CWT) to obtain an EEG time-frequency graph. The size of the EEG time-frequency graph is N×M×1, where N represents the length, M represents the width, and 1 represents the number of channels.
[0076] Step 1032: query the user's tinnitus assessment scale components.
[0077] In actual applications, users can fill in or import tinnitus assessment scales in real time, such as Tinnitus Handicap Inventory (THI), Tinnitus Handicap Questionnaire (THQ), Tinnitus Activity Questionnaire (TAQ), Tinnitus Functional Index (TFI), Tinnitus Reaction Questionnaire (TRQ), Tinnitus Questionnaire (TQ), Tinnitus Evaluation Questionnaire, and so on.
[0078] The tinnitus assessment scale records the user's information on various tinnitus assessment items, which can be converted into vectors to obtain tinnitus assessment scale components.
[0079] The tinnitus assessment scale component is a one-dimensional vector. If there are L (L is a positive integer) tinnitus assessment items in the tinnitus assessment scale, the scale of the tinnitus assessment scale component is 1×L.
[0080] Step 1033: Input the EEG time-frequency graph into the first branch structure to extract the target EEG features, and generate the attention value, emotion value and sleep value generated by the user according to the target EEG signal.
[0081] In this embodiment, if Figure 2 As shown, the EEG time-frequency graph is input into the first branch structure Branch_1, and the first branch structure Branch_1 performs multi-task processing based on the EEG time-frequency graph. During the processing, the target EEG features are extracted, and the attention value, emotion value and sleep value generated by the user are generated based on the target EEG features.
[0082] In one design, Figure 2 As shown, the first branch structure Branch_1 includes a first convolutional layer Conv_1, a second convolutional layer Conv_2, a third convolutional layer Conv_3, a fourth convolutional layer Conv_4, a first fully connected layer FC_1, a second fully connected layer FC_2 and a third fully connected layer FC_3.
[0083] On the one hand, the EEG time-frequency map is input into the first convolutional layer Conv_1 to perform a temporal convolution operation to obtain the first candidate EEG feature.
[0084] When the size of the EEG time-frequency graph is N×M×1 and the size of the convolution kernel of the first convolution layer Conv_1 is 1×K, the size of the first candidate EEG feature is N×M×1.
[0085] On the other hand, the EEG time-frequency map is input into the second convolutional layer Conv_2 to perform a time-frequency convolution operation to obtain the second candidate EEG feature.
[0086] When the size of the EEG time-frequency graph is N×M×1 and the size of the convolution kernel of the second convolution layer Conv_2 is K×K, the size of the second candidate EEG feature is N×M×1.
[0087] On the other hand, the EEG time-frequency map is input into the third convolutional layer Conv_3 to perform a frequency convolution operation to obtain a third candidate EEG feature.
[0088] When the size of the EEG time-frequency graph is N×M×1 and the size of the convolution kernel of the second convolution layer Conv_2 is K×1, the size of the third candidate EEG feature is N×M×1.
[0089] Use functions such as Concat to concatenate the first candidate EEG feature, the second candidate EEG feature, and the third candidate EEG feature according to channels into the fourth candidate EEG feature.
[0090] When the size of the first candidate EEG feature is N×M×1, the size of the second candidate EEG feature is N×M×1, and the size of the third candidate EEG feature is N×M×1, the size of the fourth candidate EEG feature is N×M×3.
[0091] The fourth candidate EEG feature is input into the fourth convolution layer Conv_4 (the size of the convolution kernel is 1×1) to perform channel convolution operation to obtain the target EEG feature;
[0092] The target EEG feature is input into the first fully connected layer FC_1 and mapped to the first reference EEG feature, and the first reference EEG feature is activated as the attention value using activation functions such as Sigmoid.
[0093] The target EEG feature is input into the second fully connected layer FC_2 and mapped into the second reference EEG feature. The second reference EEG feature is activated into the emotion value using activation functions such as Sigmoid.
[0094] The target EEG feature is input into the third fully connected layer FC_3 and mapped into the third reference EEG feature, and the third reference EEG feature is activated as the sleep value using activation functions such as Sigmoid.
[0095] Step 1034: input the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, fuse the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and generate the tinnitus frequency generated by the user based on the EEG tinnitus feature.
[0096] In this embodiment, if Figure 2 As shown, the tinnitus assessment scale component is input into the second branch structure Branch_2, and the second branch structure Branch_2 is responsible for extracting the target tinnitus disability feature from the tinnitus assessment scale component, fusing the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and predicting the tinnitus frequency generated by the user based on the EEG tinnitus feature.
[0097] In one design, Figure 2 As shown, the second branch structure includes the fifth convolutional layer Conv_5, the fourth fully connected layer FC_4 and the fifth fully connected layer FC_5.
[0098] Then, the tinnitus assessment scale components are input into the fourth fully connected layer FC_4 and mapped into candidate tinnitus disability features.
[0099] The candidate tinnitus disability feature is reshaped into a two-dimensional target tinnitus disability feature, and the size of the target tinnitus disability feature is g×g.
[0100] In the fifth convolutional layer Conv_5, a convolution operation is performed on the target EEG feature with the target tinnitus disability feature as the convolution kernel to obtain the EEG tinnitus feature.
[0101] The EEG tinnitus features are input into the fifth fully connected layer FC_5 and mapped to tinnitus frequencies, which are mostly in the range of 2-8kHz.
[0102] Step 1035: within a preset time period, if the tinnitus frequencies are all within a preset frequency range, the first branch structure is maintained in operation, and the second branch structure is turned off.
[0103] In this embodiment, if the tinnitus frequency is within a preset frequency range and lasts for longer than a preset time period, it can be considered that the tinnitus frequency is the tinnitus frequency subjectively felt by the user, and the first branch structure can be maintained and the second branch structure can be shut down, thereby reducing resource consumption.
[0104] Of course, in addition to maintaining the operation of the first branch structure and shutting down the operation of the second branch structure, both the first branch structure and the second branch structure can continue to operate, and this embodiment does not limit this.
[0105] In one embodiment of the present invention, the method for training an EEG detection model comprises the following steps:
[0106] S201. In the stage of training the EEG detection model, EEG signals and tinnitus assessment scale components are collected from the user as samples.
[0107] In the stage of training the EEG detection model, EEG signals and tinnitus assessment scale components may be collected from the user as samples.
[0108] Among them, the EEG signal used as a sample has been labeled with at least one of the attention value, emotion value, and sleep value as a label Label. At least one of the attention value, emotion value, and sleep value can be labeled by the user based on his or her own physical feelings, or by an external person based on the user's external performance, or it can be labeled by analyzing the user's external performance such as facial expressions and body movements. This embodiment does not impose any restrictions on this.
[0109] In addition, the tinnitus assessment scale component as a sample has been annotated with the tinnitus frequency as the label.
[0110] S202: Perform time-frequency conversion on the EEG signal used as a sample to obtain an EEG time-frequency graph.
[0111] In this embodiment, the EEG signal used as a sample can be converted into a time-frequency signal using methods such as continuous wavelet transform, and the EEG signal can be converted from the time domain to the frequency domain to obtain an EEG time-frequency graph. The size of the EEG time-frequency graph is N×M×1, where N represents the length, M represents the width, and 1 represents the number of channels.
[0112] S203, inputting the EEG time-frequency graph into the first branch structure to extract target EEG features, and generating the user's attention value, emotion value and sleep value according to the target EEG signal.
[0113] In this embodiment, the EEG time-frequency graph is input into the first branch structure Branch_1, and the first branch structure Branch_1 performs multi-task processing based on the EEG time-frequency graph. During the processing, the target EEG features are extracted, and the attention value, emotion value and sleep value generated by the user are generated based on the target EEG features.
[0114] In one design, the first branch structure Branch_1 includes a first convolutional layer Conv_1, a second convolutional layer Conv_2, a third convolutional layer Conv_3, a fourth convolutional layer Conv_4, a first fully connected layer FC_1, a second fully connected layer FC_2 and a third fully connected layer FC_3.
[0115] On the one hand, the EEG time-frequency map is input into the first convolutional layer Conv_1 to perform a time convolution operation (i.e., a one-dimensional convolution operation in the time dimension) to obtain the first candidate EEG feature.
[0116] When the size of the EEG time-frequency graph is N×M×1 and the size of the convolution kernel of the first convolution layer Conv_1 is 1×K, the size of the first candidate EEG feature is N×M×1.
[0117] On the other hand, the EEG time-frequency map is input into the second convolutional layer Conv_2 to perform a time-frequency convolution operation (i.e., a two-dimensional convolution operation in the time and frequency domain dimensions) to obtain the second candidate EEG feature.
[0118] When the size of the EEG time-frequency graph is N×M×1 and the size of the convolution kernel of the second convolution layer Conv_2 is K×K, the size of the second candidate EEG feature is N×M×1.
[0119] On the other hand, the EEG time-frequency map is input into the third convolutional layer Conv_3 to perform a frequency convolution operation (i.e., a one-dimensional convolution operation in the frequency domain dimension) to obtain a third candidate EEG feature.
[0120] When the size of the EEG time-frequency graph is N×M×1 and the size of the convolution kernel of the second convolution layer Conv_2 is K×1, the size of the third candidate EEG feature is N×M×1.
[0121] The first candidate EEG feature, the second candidate EEG feature and the third candidate EEG feature have the same size, and the first candidate EEG feature, the second candidate EEG feature and the third candidate EEG feature can be concatenated into the fourth candidate EEG feature according to the channel using functions such as Concat.
[0122] When the size of the first candidate EEG feature is N×M×1, the size of the second candidate EEG feature is N×M×1, and the size of the third candidate EEG feature is N×M×1, the size of the fourth candidate EEG feature is N×M×3.
[0123] The fourth candidate EEG feature is input into the fourth convolution layer Conv_4 (the size of the convolution kernel is 1×1) to perform channel convolution operation to obtain the target EEG feature;
[0124] The target EEG feature is input into the first fully connected layer FC_1 and mapped to the first reference EEG feature, and the first reference EEG feature is activated as the attention value using activation functions such as Sigmoid.
[0125] The target EEG features are input into the second fully connected layer FC_2 and mapped into the second reference EEG features, and the second reference EEG features are activated into emotion values using activation functions such as Sigmoid.
[0126] The target EEG feature is input into the third fully connected layer FC_3 and mapped into the third reference EEG feature, and the third reference EEG feature is activated as the sleep value using activation functions such as Sigmoid.
[0127] S204, generating a first sub-loss value according to the attention value, generating a second sub-loss value according to the emotion value, and generating a third sub-loss value according to the sleep value.
[0128] On the one hand, the attention value output by the EEG detection model and the corresponding label Label can be substituted into a preset loss function (such as a cross entropy loss function) to generate a first sub-loss value.
[0129] On the other hand, the emotion value output by the EEG detection model and the corresponding label Label are substituted into a preset loss function (such as a cross entropy loss function) to generate a second sub-loss value.
[0130] On the other hand, the sleep value output by the EEG detection model and the corresponding label Label are substituted into a preset loss function (such as a cross entropy loss function) to generate a third sub-loss value.
[0131] S205, input the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, merge the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and generate the tinnitus frequency generated by the user based on the EEG tinnitus feature.
[0132] In this embodiment, the tinnitus assessment scale component is input into the second branch structure Branch_2, which is responsible for extracting the target tinnitus disability feature from the tinnitus assessment scale component, fusing the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and predicting the tinnitus frequency generated by the user based on the EEG tinnitus feature.
[0133] In one design, the second branch structure includes a fifth convolutional layer Conv_5, a fourth fully connected layer FC_4, and a fifth fully connected layer FC_5.
[0134] Then, the tinnitus assessment scale components are input into the fourth fully connected layer FC_4 and mapped into candidate tinnitus disability features.
[0135] The candidate tinnitus disability feature is reshaped into a two-dimensional target tinnitus disability feature, and the size of the target tinnitus disability feature is g×g.
[0136] In the fifth convolutional layer Conv_5, a convolution operation (also called dynamic convolution) is performed on the target EEG feature with the target tinnitus disability feature as the convolution kernel to obtain the EEG tinnitus feature.
[0137] The EEG tinnitus features are input into the fifth fully connected layer FC_5 and mapped into tinnitus frequency.
[0138] S206: Generate a fourth sub-loss value according to the tinnitus frequency.
[0139] The tinnitus frequency output by the EEG detection model and the corresponding label Label are substituted into a preset loss function (such as a cross entropy loss function or an L2 norm loss function) to generate a fourth sub-loss value.
[0140] S207: Merge the first sub-loss value, the second sub-loss value, the third sub-loss value and the fourth sub-loss value into a total loss value.
[0141] In this embodiment, a linear or nonlinear method may be used to merge the first sub-loss value, the second sub-loss value, the third sub-loss value, and the fourth sub-loss value into a total loss value.
[0142] In a specific implementation, the first sub-loss value, the second sub-loss value and the third sub-loss value are added to obtain the fifth sub-loss value.
[0143] A first weight is configured for the fourth sub-loss value, and a second weight is configured for the fifth sub-loss value; wherein the sum of the first weight and the second weight is 1.
[0144] At this time, the product of the fourth sub-loss value and the first weight is added to the product of the fifth sub-loss value and the second weight as the total loss value.
[0145] Then, the total loss value can be expressed as:
[0146] L total =αL freq + (1-α)(L attention +L emotion +L sleep );
[0147] Among them, L total is the total loss value, L freq is the fourth sub-loss value, L attention is the first sub-loss value, L emotion is the second sub-loss value, L sleep is the third sub-loss value, α is the first weight, and (1-α) is the second weight.
[0148] Initially, α can be set to 0.5, and the four loss functions are equally weighted to optimize the parameters of the EEG detection model.
[0149] If the fluctuation amplitude of the total loss value during updating is less than the preset fluctuation threshold, then while maintaining the sum of the first weight and the second weight at 1, increasing the first weight and decreasing the second weight, that is, increasing the weight of the loss function for predicting tinnitus frequency, can help search for the global optimal solution and increase the convergence speed.
[0150] S208. Update the EEG detection model according to the total loss value.
[0151] In this embodiment, the total loss value can be substituted into an optimization algorithm such as SGD (stochastic gradient descent) and Adam (Adaptive momentum) to calculate the update amplitude of the parameters in the EEG detection model, and the parameters in the EEG detection model are updated according to the update amplitude.
[0152] Furthermore, training conditions can be set in advance as conditions for stopping training the EEG detection model, for example, the number of iterations reaches a certain threshold, the total loss value is less than a certain threshold, the change in the total loss value in multiple iterative training is less than a certain threshold, and so on. In each round of iterative training, it is determined whether the training conditions are met.
[0153] If the training conditions are met, the EEG detection model can be considered to have completed training. At this time, the parameters in the EEG detection model are output and written into the corresponding configuration file.
[0154] If the training conditions are not met, the next round of iterative training can be entered, and S202-S208 can be executed again, and the iterative training can be repeated in this way until the EEG detection model is trained.
[0155] Step 104: Generate a meditation course suitable for chronic diseases based on the load information.
[0156] In this embodiment, a meditation course adapted to chronic diseases can be generated for the user based on part or all of the load information generated by the user.
[0157] Among them, meditation courses refer to courses suitable for mindfulness meditation. Mindfulness meditation is a meditation method that allows users to become more aware of their feelings, emotions, and thought processes by being aware of the present experience, receive multi-sensory feedback and adjust their attention targets in real time, relax the body and mind, and quickly concentrate, thereby reducing users' concern about chronic diseases. In addition, mindfulness meditation does not rely too much on other tools. The basic tools are speakers, screens, etc., and electronic devices can be directly reused and can be carried out anytime and anywhere.
[0158] In specific implementation, the meditation course includes meditation scenes and meditation instructions.
[0159] Among them, the meditation scene at least includes the picture of mindfulness meditation and / or the audio data of mindfulness meditation. At this time, the screen can be called to play the picture of mindfulness meditation and the speaker can be called to play the audio data of mindfulness meditation to provide the user with visual feedback and / or auditory feedback.
[0160] Of course, in addition to visual feedback and auditory feedback, other sensory feedback components can also be called to provide users with olfactory, tactile, electrical stimulation and other feedback, which is not limited in this embodiment.
[0161] For example, visual feedback may include animated meditation images of the sky, clouds, bonfires, waves, forests, etc.; auditory feedback may include pink noise, the sound of raindrops, the sound of flowing water, the sound of flames, music, etc.; olfactory feedback may include aromatherapy, etc.; tactile feedback may include vibration of portable devices, massage, etc.; electrical stimulation feedback may include direct current stimulation, etc.
[0162] In this embodiment, a functional relationship between chronic diseases, load information and meditation scenes can be constructed based on prior knowledge such as experiments (for example, load information is segmented under chronic diseases, and the segmented values are mapped to meditation scenes). When the user's chronic disease and load information are detected, the meditation scene can be determined based on the functional relationship.
[0163] In addition, meditation instructions are information that guides users to practice mindfulness meditation, and are usually paired with meditation scenes to improve the efficiency of users practicing mindfulness meditation, thereby improving the efficiency of users diverting their attention.
[0164] Generally, a corpus of mindfulness meditation can be pre-set and used to train or fine-tune a large language model (LLM).
[0165] Among them, the corpus stores scene text information used to describe various meditation scenes and scene text vectors converted from the scene text information. For example, some information in the knowledge base includes an introduction to digital robots, an introduction to the definition of mindfulness, an introduction to the content of mindfulness meditation, and norms for guiding users in mindfulness meditation in various meditation scenes, etc.
[0166] At this time, the meditation scene, the user's chronic disease and load information can be used to construct a guidance text information Prompt, and the guidance text information Prompt can be input into the LLM to generate meditation instructions.
[0167] For example, the guidance text message prompt is "I suffer from chronic low back pain. My concentration value in campfire meditation is between 0 and 30 points, and my emotion value is between 20 and 50 points. This has lasted for more than 10 minutes, which means that I am in a relatively poor meditation state. You need to tell me my current state and give me some direct suggestions to help me concentrate, improve my emotional state, and maintain physical and mental happiness."
[0168] In one design, a meditation scene can be constructed directly based on the user's load information, and meditation instructions can be generated simultaneously based on the user's load information.
[0169] When the chronic disease is not tinnitus, a meditation scene is selected for the user based on at least one of the emotion value and the sleep value, and meditation instructions are generated for the user based on at least one of the attention value, the emotion value and the sleep value.
[0170] For example, for users with chronic pain, soothing symphonies and aerial natural landscapes (meditation scenes) can be provided according to their emotional values, and their attention values and emotional values can be input into the LLM to generate meditation instructions in real time.
[0171] For drug addicts, we can provide audio-visual feedback scenes (meditation scenes) containing low-richness audio and low color saturation based on their emotional values. We can also build meditation scenes based on propaganda materials about the harm of drugs, and input their attention values and emotional values into the LLM to generate meditation instructions in real time.
[0172] For users with chronic pain and / or drug addiction, low-richness, single-subject meditation scenes including bonfires and candlelight can be provided based on their emotion values and sleep values. The feedback of this meditation scene mainly focuses on the simulated dynamic changes of objects, such as the height of candle flames, the dynamic growth changes of trees, the rotation of the earth, etc. Their attention values, emotion values and sleep values are input into the LLM to generate meditation instructions in real time. For example, when the user's sleep value is low (i.e. awake) and the attention value is low, the meditation instructions are used to guide the user to focus on a certain object (different meditation scenes have different objects of focus, such as candles, breathing, etc.); when the user's sleep value is low (i.e. awake) and the attention value is high, the meditation instructions are used to guide the user to gradually relax various parts of the body; when the user's sleep value is medium (i.e. light sleep), the feedback based on the attention value is suspended, and the user is given meditation instructions for about to fall asleep, such as "Your consciousness is becoming more and more blurred, you are about to enter deep sleep"; when the user's sleep value is high (i.e. deep sleep), the meditation instructions are stopped.
[0173] When the chronic disease is tinnitus, a meditation scene of mindfulness meditation is selected for the user based on at least one of the emotion value and the sleep value, and the tinnitus frequency, and meditation instructions are generated for the user based on at least one of the attention value, the emotion value, the sleep value and the tinnitus frequency.
[0174] That is, constructing a meditation field depends on two elements, one of which is the tinnitus frequency, and the other is at least one of the emotion value and the sleep value.
[0175] Furthermore, the audio signal in the meditation scene can be selected as narrowband noise, white noise, music, etc. The meditation scene will filter part of the audio signal so that it is missing part of the audio signal. The difference between the center frequency of the missing audio signal in the meditation scene and the tinnitus frequency is less than the frequency threshold, that is, the center frequency of the missing audio signal is the same as or close to the tinnitus frequency.
[0176] Generally speaking, filtering out sounds (i.e., audio signals) near the tinnitus frequency can reduce the overactivity of neurons related to the tinnitus frequency, thereby further distracting the user from the tinnitus.
[0177] Of course, the above meditation scenes and meditation instructions are only examples. When implementing this embodiment, other meditation scenes and meditation instructions can be set according to actual conditions, and this embodiment does not limit this. In addition, in addition to the above meditation scenes and meditation instructions, those skilled in the art can also use other meditation scenes and meditation instructions according to actual needs, and this embodiment does not limit this.
[0178] In another design, a meditation course for the next mindfulness meditation practice may be constructed based on the effect of the user's previous mindfulness meditation practice.
[0179] In a specific implementation, the attention value represents the effect of the user's mindfulness meditation practice to a certain extent. Therefore, the average attention value of the user's last mindfulness meditation practice can be calculated to obtain the average attention.
[0180] The attention range where the average attention is located is queried in multiple preset attention ranges to obtain the target range; the attention range represents the difficulty of practicing mindfulness meditation to a certain extent, and each attention range is configured with a meditation course adapted to each chronic disease based on prior knowledge such as experiments.
[0181] The meditation course corresponding to the target range is set as the meditation course for the user to practice mindfulness meditation this time.
[0182] Exemplarily, the attention value ranges from [1, 100], and a threshold c is set within this range, such as c=60.
[0183] If the average attention is in [1, c], it means that the user's attention transfer effect in this mindfulness meditation practice is poor. The next time the user practices mindfulness meditation, an entry-level meditation course is recommended.
[0184] If the average attention is in (c, 100], it means that the user's attention transfer effect in this mindfulness meditation practice is good, and a professional meditation course is recommended for the next mindfulness meditation practice.
[0185] Step 105: When the user practices mindfulness meditation according to the meditation course, the meditation course is changed according to the load information to guide the user's attention to shift from chronic diseases to mindfulness meditation.
[0186] When users practice mindfulness meditation according to the meditation course, EEG signals can be continuously collected, and load information can be continuously generated based on the EEG signals, so as to evaluate the effectiveness of the user's attention diversion when practicing mindfulness meditation.
[0187] Afterwards, the expressiveness of various feedbacks (including visual feedback, auditory feedback, etc.) in the meditation course (including meditation scenes, meditation instructions) can be adjusted according to the changing trend of the load information, so that users can intuitively know their own status, guide users to shift their attention from chronic diseases to mindfulness meditation, and alleviate the negative impact of chronic diseases on users.
[0188] Among them, for visual feedback, its expressiveness includes changes in the clarity and vision of 3D (three-dimensional) or 2D (two-dimensional) meditation images; for auditory feedback, its expressiveness includes changes in the volume, pitch, sound type, etc. of mindfulness meditation audio data.
[0189] In a specific implementation, when the chronic disease is not tinnitus, the meditation scene changes are controlled visually and auditorily based on at least one of the attention value and the sleep value to guide the user's attention to shift from the non-tinnitus chronic disease to mindfulness meditation.
[0190] Exemplarily, the attention value is detected at regular intervals (such as 1 second), and the attention value is preprocessed by sliding averaging. If the attention value at the current moment is higher than the attention value at the previous moment, that is, the changing trend of the attention value of mindfulness meditation is increasing, indicating that the user's mindfulness meditation level has become deeper and the effect of diverting attention has become better, then the clarity of the meditation picture can be improved, and the volume of the mindfulness meditation audio data can be increased; if the attention value at the current moment is lower than the attention value at the previous moment, that is, the changing trend of the attention value of mindfulness meditation is decreasing, indicating that the user's mindfulness meditation level has become shallower and the effect of diverting attention has become worse, then the clarity of the meditation picture can be reduced, and the volume of the mindfulness meditation audio data can be reduced.
[0191] In addition to the above changes, when it is detected that the user's sleep value is high (i.e. deep sleep), the volume of the audio signal and the brightness of the picture can be gradually reduced until the meditation course is exited.
[0192] When the chronic disease is tinnitus, the meditation scene changes are visually and auditorily controlled based on at least one of the attention value and the sleep value, and the audio signal whose difference between the center frequency and the tinnitus frequency is less than the frequency threshold is filtered out auditorily to guide the user's attention from tinnitus to mindfulness meditation.
[0193] Furthermore, the audio signal in the partial frequency band with the tinnitus frequency as the center frequency in the meditation scene is filtered out, thereby filtering out the audio signal whose difference between the center frequency and the tinnitus frequency is less than the frequency threshold. At this time, the tinnitus frequency subjectively felt by the user is used to supplement the missing frequency of the audio signal in the meditation scene, thereby constructing a personalized meditation scene for the current user.
[0194] In this embodiment, the brain-computer interface is called to collect single-channel or multi-channel EEG signals from the user; the chronic disease that the user's attention is focused on is determined; the EEG signal is input into a preset EEG detection model to detect one or more load information generated by the user; a meditation course adapted to the chronic disease is generated based on the load information; when the user practices mindfulness meditation according to the meditation course, the meditation course changes are controlled based on the load information to guide the user's attention from chronic disease to mindfulness meditation. This embodiment constructs and adjusts the meditation course in real time based on the user's load information, and adjusts the meditation course adaptively to the user's state, striving to ensure that the state of each user reaches the threshold of the meditation course, improve the degree of adaptation between the user and the meditation course, realize personalized practice of mindfulness meditation, improve the effect of the user's practice of mindfulness meditation, improve the efficiency of the user's attention diversion, and alleviate the negative impact of chronic diseases on users.
[0195] Embodiment 2
[0196] See also Figure 3 , showing a schematic diagram of the structure of a brain-computer interface mindfulness meditation attention transfer device for chronic disease users provided by the second embodiment of the present invention. Figure 3 As shown, the device comprises:
[0197] The EEG signal acquisition module 301 is used to call the brain-computer interface to collect single-channel or multi-channel EEG signals from the user;
[0198] A chronic disease determination module 302, for determining the chronic disease to which the user's attention is focused;
[0199] A load information detection module 303 is used to input the EEG signal into a preset EEG detection model to detect one or more load information generated by the user;
[0200] A meditation course generating module 304, configured to generate a meditation course adapted to the chronic disease according to the load information;
[0201] The meditation course change module 305 is used to control the change of the meditation course according to the load information when the user practices mindfulness meditation according to the meditation course, so as to guide the user's attention to shift from the chronic disease to the mindfulness meditation.
[0202] In one embodiment of the present invention, the chronic disease determination module 302 includes:
[0203] A symptom degree detection module, used for inputting the EEG signal into a preset symptom detection model to detect the degree of symptoms of the user's chronic disease;
[0204] The attention concentration module is used to determine that the user's attention is focused on the chronic disease when the symptom level is greater than or equal to a preset level threshold.
[0205] In one embodiment of the present invention, the load information includes at least one of an attention value, an emotion value, a sleep value, and a tinnitus frequency;
[0206] The load information detection module 303 includes:
[0207] A first load detection module, for inputting the EEG signal into a preset EEG detection model to detect the attention value, emotion value and sleep value generated by the user when the chronic disease is not tinnitus;
[0208] The second load detection module is used to input the EEG signal into a preset EEG detection model to detect the attention value, emotion value, sleep value and tinnitus frequency generated by the user when the chronic disease is tinnitus.
[0209] In one embodiment of the present invention, the meditation course includes a meditation scene and meditation instructions;
[0210] The meditation course generation module 304 includes:
[0211] a first course building module, for selecting a meditation scene for the user according to at least one of the emotion value and the sleep value, and generating a meditation instruction for the user according to at least one of the attention value, the emotion value and the sleep value, when the chronic disease is not tinnitus;
[0212] The second course construction module is used for selecting a meditation scene of the mindfulness meditation for the user according to at least one of the emotion value and the sleep value, and the tinnitus frequency when the chronic disease is tinnitus, and generating meditation instructions for the user according to at least one of the attention value, the emotion value, the sleep value, and the tinnitus frequency; wherein the difference between the center frequency of the audio signal missing in the meditation scene and the tinnitus frequency is less than a frequency threshold;
[0213] The meditation course variation module 305 includes:
[0214] A first change control module is used for controlling the change of the meditation scene visually and auditorily according to at least one of the attention value and the sleep value when the chronic disease is not tinnitus, so as to guide the user's attention to shift from the chronic disease other than tinnitus to the mindfulness meditation;
[0215] The second change control module is used to control the change of the meditation scene visually and auditorily according to at least one of the attention value and the sleep value when the chronic disease is tinnitus, and to filter out audio signals whose center frequency differs from the tinnitus frequency by less than a frequency threshold, so as to guide the user's attention to shift from the tinnitus to the mindfulness meditation.
[0216] In another embodiment of the present invention, the meditation course generation module 304 includes:
[0217] An average attention calculation module, used to calculate the average of the attention values of the user during the last mindfulness meditation practice to obtain average attention;
[0218] A target range query module is used to query the attention range where the average attention is located in a plurality of preset attention ranges to obtain a target range; each of the attention ranges is configured with a meditation course adapted to each of the chronic diseases;
[0219] The meditation course setting module is used to set the meditation course corresponding to the target range as the meditation course for the user practicing mindfulness meditation this time.
[0220] In one embodiment of the present invention, the EEG detection model includes a first branch structure and a second branch structure; the load information detection module 303 includes:
[0221] An EEG time-frequency graph conversion module, used for performing time-frequency conversion on the EEG signal to obtain an EEG time-frequency graph;
[0222] A tinnitus assessment scale component query module, used to query the tinnitus assessment scale components of the user;
[0223] A first branch processing module, configured to input the EEG time-frequency graph into the first branch structure to extract target EEG features, and to generate the attention value, emotion value and sleep value generated by the user according to the target EEG signal;
[0224] The second branch processing module is used to input the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, merge the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and generate the tinnitus frequency generated by the user based on the EEG tinnitus feature.
[0225] In another embodiment of the present invention, the load information detection module 303 further includes:
[0226] The branch adjustment module is used to maintain the operation of the first branch structure and shut down the operation of the second branch structure if the tinnitus frequencies are all within a preset frequency range within a preset time period.
[0227] In one embodiment of the present invention, the first branch structure includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a first fully connected layer, a second fully connected layer and a third fully connected layer;
[0228] The first branch processing module includes:
[0229] A first candidate EEG feature generating module, configured to input the EEG time-frequency graph into the first convolution layer to perform a time convolution operation to obtain a first candidate EEG feature;
[0230] A second candidate EEG feature generating module, used for inputting the EEG time-frequency map into the second convolution layer to perform a time-frequency convolution operation to obtain a second candidate EEG feature;
[0231] A third candidate EEG feature generating module, used for inputting the EEG time-frequency map into the third convolution layer to perform a frequency convolution operation to obtain a third candidate EEG feature;
[0232] a fourth candidate EEG feature generating module, configured to splice the first candidate EEG feature, the second candidate EEG feature and the third candidate EEG feature into a fourth candidate EEG feature according to channels;
[0233] A target EEG feature generation module, used for inputting the fourth candidate EEG feature into the fourth convolution layer to perform a channel convolution operation to obtain a target EEG feature;
[0234] an attention value generating module, configured to input the target EEG feature into the first fully connected layer and map it into a first reference EEG feature, and activate the first reference EEG feature as an attention value;
[0235] An emotion value generating module, used for inputting the target EEG feature into the second fully connected layer and mapping it into a second reference EEG feature, and activating the second reference EEG feature into an emotion value;
[0236] The sleep value generation module is used to input the target EEG feature into the third fully connected layer to map it into a third reference EEG feature, and activate the third reference EEG feature as a sleep value.
[0237] In one embodiment of the present invention, the second branch structure includes a fifth convolutional layer, a fourth fully connected layer and a fifth fully connected layer;
[0238] The second branch processing module includes:
[0239] A candidate tinnitus disability feature mapping module, used for inputting the tinnitus assessment scale components into the fourth fully connected layer and mapping them into candidate tinnitus disability features;
[0240] A target tinnitus disability feature conversion module, used to convert the candidate tinnitus disability feature into a two-dimensional target tinnitus disability feature;
[0241] an EEG tinnitus feature generation module, configured to perform a convolution operation on the target EEG feature using the target tinnitus disability feature as a convolution kernel in the fifth convolution layer to obtain an EEG tinnitus feature;
[0242] The tinnitus frequency generation module is used to input the EEG tinnitus feature into the fifth fully connected layer and map it into a tinnitus frequency.
[0243] In one embodiment of the present invention, it also includes:
[0244] A sample collection module, used to collect EEG signals and tinnitus assessment scale components from users as samples during the stage of training the EEG detection model;
[0245] A sample time-frequency graph conversion module, used for performing time-frequency conversion on the EEG signal as a sample to obtain an EEG time-frequency graph;
[0246] A first sample processing module, configured to input the EEG time-frequency graph into the first branch structure to extract target EEG features, and to generate the attention value, emotion value and sleep value generated by the user according to the target EEG signal;
[0247] A first loss value generating module, configured to generate a first sub-loss value according to the attention value, generate a second sub-loss value according to the emotion value, and generate a third sub-loss value according to the sleep value;
[0248] A second sample processing module is used to input the tinnitus assessment scale components into the second branch structure to extract the target tinnitus disability feature, merge the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and generate the tinnitus frequency generated by the user according to the EEG tinnitus feature;
[0249] A second loss value generating module, used for generating a fourth sub-loss value according to the tinnitus frequency;
[0250] a loss value fusion module, configured to fuse the first sub-loss value, the second sub-loss value, the third sub-loss value and the fourth sub-loss value into a total loss value;
[0251] The EEG detection model updating module is used to update the EEG detection model according to the total loss value.
[0252] In one embodiment of the present invention, the loss value fusion module includes:
[0253] a loss value adding module, configured to add the first sub-loss value, the second sub-loss value and the third sub-loss value to obtain a fifth sub-loss value;
[0254] A weight configuration module, configured to configure a first weight for the fourth sub-loss value and a second weight for the fifth sub-loss value; wherein the sum of the first weight and the second weight is 1;
[0255] a weighted summation module, configured to add a product of the fourth sub-loss value and the first weight to a product of the fifth sub-loss value and the second weight, as a total loss value;
[0256] A weight adjustment module is used to increase the first weight and reduce the second weight while maintaining the sum of the first weight and the second weight as 1 if the fluctuation range of the total loss value during update is less than a preset fluctuation threshold.
[0257] In one embodiment of the present invention, the first branch structure includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a first fully connected layer, a second fully connected layer and a third fully connected layer;
[0258] The first sample processing module is also used for:
[0259] Inputting the EEG time-frequency graph into the first convolutional layer to perform a time convolution operation to obtain a first candidate EEG feature;
[0260] Inputting the EEG time-frequency map into the second convolutional layer to perform a time-frequency convolution operation to obtain a second candidate EEG feature;
[0261] Inputting the EEG time-frequency graph into the third convolutional layer to perform a frequency convolution operation to obtain a third candidate EEG feature;
[0262] splicing the first candidate EEG feature, the second candidate EEG feature and the third candidate EEG feature according to channels into a fourth candidate EEG feature;
[0263] Inputting the fourth candidate EEG feature into the fourth convolutional layer to perform a channel convolution operation to obtain a target EEG feature;
[0264] Inputting the target EEG feature into the first fully connected layer and mapping it into a first reference EEG feature, and activating the first reference EEG feature as an attention value;
[0265] Inputting the target EEG feature into the second fully connected layer and mapping it into a second reference EEG feature, activating the second reference EEG feature;
[0266] The target EEG feature is input into the third fully connected layer and mapped into a third reference EEG feature, and the third reference EEG feature is activated as a sleep value.
[0267] In one embodiment of the present invention, the second branch structure includes a fifth convolutional layer, a fourth fully connected layer and a fifth fully connected layer;
[0268] The second sample processing module is also used for:
[0269] Inputting the tinnitus assessment scale components into the fourth fully connected layer and mapping them into candidate tinnitus disability features;
[0270] Transforming the candidate tinnitus disability feature into a two-dimensional target tinnitus disability feature;
[0271] In the fifth convolution layer, a convolution operation is performed on the target EEG feature using the target tinnitus disability feature as a convolution kernel to obtain an EEG tinnitus feature;
[0272] The EEG tinnitus feature is input into the fifth fully connected layer and mapped into a tinnitus frequency.
[0273] The brain-computer interface mindfulness meditation attention transfer device for chronic disease users provided in an embodiment of the present invention can execute the brain-computer interface mindfulness meditation attention transfer method for chronic disease users provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the brain-computer interface mindfulness meditation attention transfer method for chronic disease users.
[0274] Embodiment 3
[0275] See also Figure 4 , shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0276] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0277] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0278] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the brain-computer interface mindfulness meditation attention transfer method for chronic disease users.
[0279] In some embodiments, the brain-computer interface mindfulness meditation attention transfer method for chronic disease users can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the brain-computer interface mindfulness meditation attention transfer method for chronic disease users described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the brain-computer interface mindfulness meditation attention transfer method for chronic disease users in any other appropriate manner (for example, by means of firmware).
[0280] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0281] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0282] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0283] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0284] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0285] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0286] Embodiment 4
[0287] An embodiment of the present invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the brain-computer interface mindfulness meditation attention transfer method for chronic disease users as provided in any embodiment of the present invention.
[0288] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, through the Internet using an Internet service provider).
[0289] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0290] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A brain-computer interface mindfulness meditation attention transfer method for chronic disease users, characterized in that: include: Calling the brain-computer interface to collect single-channel or multi-channel EEG signals from the user; Determine the chronic disease to which the user's attention is directed; Inputting the EEG signal into a preset EEG detection model to detect one or more load information generated by the user; generating a meditation course adapted to the chronic disease according to the load information; When the user practices mindfulness meditation according to the meditation course, controlling the meditation course to change according to the load information to guide the user's attention to shift from the chronic disease to the mindfulness meditation; The determining of the chronic disease to which the user's attention is focused includes: Inputting the EEG signal into a preset symptom detection model to detect the degree of symptoms of the user's chronic disease; When the symptom level is greater than or equal to a preset level threshold, determining that the user's attention is focused on the chronic disease; The load information includes at least one of an attention value, an emotion value, a sleep value, and a tinnitus frequency; The step of inputting the EEG signal into a preset EEG detection model to detect one or more load information generated by the user includes: When the chronic disease is not tinnitus, the EEG signal is input into a preset EEG detection model to detect the attention value, emotion value and sleep value generated by the user; When the chronic disease is tinnitus, the electroencephalogram signal is input into a preset electroencephalogram detection model to detect the attention value, emotion value, sleep value and tinnitus frequency generated by the user.
2. The method according to claim 1, characterized in that The meditation course includes a meditation scene and meditation instructions; Generating a meditation course adapted to the chronic disease according to the load information includes: When the chronic disease is not tinnitus, selecting a meditation scene for the user according to at least one of the emotion value and the sleep value, and generating a meditation instruction for the user according to at least one of the attention value, the emotion value and the sleep value; When the chronic disease is tinnitus, a meditation scene of the mindfulness meditation is selected for the user according to at least one of the emotion value and the sleep value, and the tinnitus frequency, and a meditation instruction is generated for the user according to at least one of the attention value, the emotion value, the sleep value, and the tinnitus frequency; wherein the difference between the center frequency of the audio signal missing in the meditation scene and the tinnitus frequency is less than a frequency threshold; The controlling the change of the meditation course according to the load information to guide the user's attention to shift from the chronic disease to the mindfulness meditation includes: When the chronic disease is not tinnitus, visually and auditorily controlling the meditation scene change according to at least one of the attention value and the sleep value, so as to guide the user's attention to shift from the chronic disease other than tinnitus to the mindfulness meditation; When the chronic disease is tinnitus, visually and auditorily controlling the change of the meditation scene according to at least one of the attention value and the sleep value, and auditorily filtering out audio signals whose center frequency differs from the tinnitus frequency by less than a frequency threshold, so as to guide the user's attention to shift from the tinnitus to the mindfulness meditation; or, Generating a meditation course adapted to the chronic disease according to the load information includes: Calculate the average of the attention values of the user when they last practiced mindfulness meditation to obtain average attention; The attention range where the average attention is located is queried in a plurality of preset attention ranges to obtain a target range; each of the attention ranges is configured with a meditation course adapted to each of the chronic diseases; The meditation course corresponding to the target range is set as the meditation course for the user practicing mindfulness meditation this time.
3. The method according to any one of claims 1 to 2, characterized in that: The EEG detection model includes a first branch structure and a second branch structure; the step of inputting the EEG signal into a preset EEG detection model to detect one or more load information generated by the user includes: Performing time-frequency conversion on the EEG signal to obtain an EEG time-frequency graph; querying a tinnitus assessment scale component of the user; Inputting the EEG time-frequency graph into the first branch structure to extract target EEG features, and generating the attention value, emotion value and sleep value generated by the user according to the target EEG signal; Inputting the tinnitus assessment scale component into the second branch structure to extract the target tinnitus disability feature, fusing the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and generating the tinnitus frequency generated by the user according to the EEG tinnitus feature; In a preset time period, if the tinnitus frequencies are all within a preset frequency range, the operation of the first branch structure is maintained, and the operation of the second branch structure is shut down.
4. The method according to claim 3, characterized in that The first branch structure includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a first fully connected layer, a second fully connected layer and a third fully connected layer; The step of inputting the EEG time-frequency graph into the first branch structure to extract target EEG features, and generating the attention value, emotion value and sleep value generated by the user according to the target EEG signal, includes: Inputting the EEG time-frequency graph into the first convolutional layer to perform a time convolution operation to obtain a first candidate EEG feature; Inputting the EEG time-frequency map into the second convolutional layer to perform a time-frequency convolution operation to obtain a second candidate EEG feature; Inputting the EEG time-frequency graph into the third convolutional layer to perform a frequency convolution operation to obtain a third candidate EEG feature; splicing the first candidate EEG feature, the second candidate EEG feature and the third candidate EEG feature according to channels into a fourth candidate EEG feature; Inputting the fourth candidate EEG feature into the fourth convolutional layer to perform a channel convolution operation to obtain a target EEG feature; Inputting the target EEG feature into the first fully connected layer and mapping it into a first reference EEG feature, and activating the first reference EEG feature as an attention value; Inputting the target EEG feature into the second fully connected layer and mapping it into a second reference EEG feature, and activating the second reference EEG feature into an emotion value; The target EEG feature is input into the third fully connected layer and mapped into a third reference EEG feature, and the third reference EEG feature is activated as a sleep value.
5. The method according to claim 3, characterized in that: The second branch structure includes a fifth convolutional layer, a fourth fully connected layer and a fifth fully connected layer; The step of inputting the tinnitus assessment scale component into the second branch structure to extract the target tinnitus disability feature, fusing the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and generating the tinnitus frequency generated by the user according to the EEG tinnitus feature, comprises: Inputting the tinnitus assessment scale components into the fourth fully connected layer and mapping them into candidate tinnitus disability features; Transforming the candidate tinnitus disability feature into a two-dimensional target tinnitus disability feature; In the fifth convolution layer, a convolution operation is performed on the target EEG feature using the target tinnitus disability feature as a convolution kernel to obtain an EEG tinnitus feature; The EEG tinnitus feature is input into the fifth fully connected layer and mapped into a tinnitus frequency.
6. The method according to claim 3, characterized in that Also includes: In the stage of training the EEG detection model, EEG signals and tinnitus assessment scale components are collected from users as samples; Performing time-frequency conversion on the EEG signal as a sample to obtain an EEG time-frequency graph; Inputting the EEG time-frequency graph into the first branch structure to extract target EEG features, and generating the attention value, emotion value and sleep value generated by the user according to the target EEG signal; Generate a first sub-loss value according to the attention value, generate a second sub-loss value according to the emotion value, and generate a third sub-loss value according to the sleep value; Inputting the tinnitus assessment scale component into the second branch structure to extract the target tinnitus disability feature, fusing the target EEG feature with the target tinnitus disability feature into an EEG tinnitus feature, and generating the tinnitus frequency generated by the user according to the EEG tinnitus feature; generating a fourth sub-loss value according to the tinnitus frequency; Merging the first sub-loss value, the second sub-loss value, the third sub-loss value and the fourth sub-loss value into a total loss value; The EEG detection model is updated according to the total loss value.
7. The method according to claim 6, characterized in that The step of fusing the first sub-loss value, the second sub-loss value, the third sub-loss value, and the fourth sub-loss value into a total loss value includes: Adding the first sub-loss value, the second sub-loss value, and the third sub-loss value to obtain a fifth sub-loss value; Assign a first weight to the fourth sub-loss value and assign a second weight to the fifth sub-loss value; wherein the sum of the first weight and the second weight is 1; Adding the product of the fourth sub-loss value and the first weight to the product of the fifth sub-loss value and the second weight as the total loss value; If the fluctuation range of the total loss value during updating is less than a preset fluctuation threshold, the first weight is increased and the second weight is decreased while maintaining the sum of the first weight and the second weight at 1.
8. A brain-computer interface mindfulness meditation attention transfer device for chronic disease patients, characterized in that: include: An EEG signal acquisition module is used to call the brain-computer interface to collect single-channel or multi-channel EEG signals from the user; A chronic disease determination module, used to determine the chronic disease to which the user's attention is focused; A load information detection module, used for inputting the EEG signal into a preset EEG detection model to detect one or more load information generated by the user; A meditation course generation module, used to generate a meditation course adapted to the chronic disease according to the load information; a meditation course change module, configured to control the change of the meditation course according to the load information when the user practices mindfulness meditation according to the meditation course, so as to guide the user's attention to shift from the chronic disease to the mindfulness meditation; Wherein, the chronic disease determination module includes: A symptom degree detection module, used for inputting the EEG signal into a preset symptom detection model to detect the degree of symptoms of the user's chronic disease; An attention concentration module, configured to determine that the user's attention is focused on the chronic disease when the symptom level is greater than or equal to a preset level threshold; The load information includes at least one of an attention value, an emotion value, a sleep value, and a tinnitus frequency; The load information detection module includes: A first load detection module, for inputting the EEG signal into a preset EEG detection model to detect the attention value, emotion value and sleep value generated by the user when the chronic disease is not tinnitus; The second load detection module is used to input the EEG signal into a preset EEG detection model to detect the attention value, emotion value, sleep value and tinnitus frequency generated by the user when the chronic disease is tinnitus.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the brain-computer interface mindfulness meditation attention transfer method for chronic disease users as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the brain-computer interface mindfulness meditation attention transfer method for chronic disease users as described in any one of claims 1-7.
Citation Information
Patent Citations
Brain-computer interface meditation meditation method and device for virtual reality motion sickness
CN118319329A
Meditation adjustment method and device based on motion sickness and storage medium
CN118634402A
Personalized real-time audio generation based on user physiological response
US10790919B1
Device for personalized treatment of tinnitus and computer-readable recording medium for performing same
WO2021187877A1
Cited By
Brain-computer interface-based mindfulness meditation attention diversion method for user having chronic disease, and device
WO2026153571A1