Mindfulness Meditation Attention Transfer Method and Device for Chronic Disease Users Based on Brain-Computer Interface

The brain-computer interface collects and analyzes the EEG signals of chronic disease patients, generates and adjusts suitable meditation courses, solves the problem of mismatch between tasks and user status in the existing technology, and improves attention transfer efficiency and mindfulness meditation effect.

CN119495405BActive Publication Date: 2025-06-20SOUTH CHINA BRAIN COMPUTER INTERFACE TECHNOLOGY CO
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510081917.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-06-20
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

When the prior art provides attention transfer methods for chronic disease patients, the offline construction of tasks does not match the real-time status of users, resulting in a deviation between tasks and user needs, and the task threshold is high and the user's execution effect is poor.

Method used

The brain-computer interface is used to collect the user's EEG signals, detect load information through the preset EEG detection model, and generate meditation courses suitable for chronic diseases. When the user practices mindfulness meditation, the meditation courses are adjusted according to the load information to guide the user's attention from chronic diseases to mindfulness meditation.

Benefits of technology

It realizes dynamic adjustment of meditation courses based on the user's real-time load information, improves the efficiency of user's attention transfer, enhances the effect of mindfulness meditation, and alleviates the negative impact of chronic diseases on users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119495405B_ABST
    Figure CN119495405B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for attention transfer of mindfulness meditation for chronic disease users through a brain-computer interface. The method includes: invoking the brain-computer interface to collect single-channel or multi-channel electroencephalogram (EEG) signals of the user; determining the chronic disease on which the user's attention is focused; inputting the EEG signals into a preset EEG detection model to detect one or more types of load information generated by the user; generating a meditation course adapted to the chronic disease based on the load information; and when the user practices mindfulness meditation according to the meditation course, controlling the change of the meditation course based on the load information to guide the user's attention to shift from the chronic disease to mindfulness meditation. In this embodiment, the meditation course is constructed and adjusted in real time according to the user's load information, and the meditation course is adapted to the user's state, striving to ensure that the state of each user reaches the threshold of the meditation course, improving the adaptability between the user and the meditation course, realizing personalized practice of mindfulness meditation, and improving the efficiency of the user's attention transfer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of brain-computer interfaces, and particularly to a method and device for attention transfer of mindfulness meditation for brain-computer interfaces for chronic disease users. Background Art

[0002] For chronic disease patients, various methods are often used to divert attention from chronic diseases to other objects to reduce the negative impacts of chronic diseases.

[0003] Currently, the conventional method for diverting attention is to perform a task with certain cognitive requirements (such as watching TV) or a task with a certain exercise intensity (such as running). Since the difficulty of these tasks is relatively high, users usually input their chronic disease information into some APPs (applications) and let them recommend suitable tasks.

[0004] However, these APPs often construct tasks offline based on chronic disease information and push tasks to users when the chronic disease information matches successfully. The tasks constructed offline have a certain deviation from the user's real-time state, resulting in a certain deviation between the tasks and the user's needs. Moreover, these tasks have a certain threshold, and the user's state may be lower than the threshold of the tasks, resulting in poor task execution effects for users and low efficiency of attention transfer for users. Summary of the Invention

[0005] In view of this, the present invention provides a method and device for attention transfer of mindfulness meditation for brain-computer interfaces for chronic disease users to improve the efficiency of attention transfer for chronic disease users.

[0006] The first aspect of the present invention provides a method for attention transfer of mindfulness meditation for brain-computer interfaces for chronic disease users, including:

[0007] Invoking a brain-computer interface to collect single-channel or multi-channel electroencephalogram signals of a user;

[0008] Determining the chronic disease where the user's attention lies;

[0009] Inputting the electroencephalogram signals into a preset electroencephalogram detection model to detect one or more types of 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, controlling the change of the meditation course according to the load information to guide the user's attention to transfer from the chronic disease to the mindfulness meditation.

[0012] The second aspect of the present invention provides a device for attention transfer of mindfulness meditation for brain-computer interfaces for chronic disease users, including:

[0013] An electroencephalogram (EEG) signal acquisition module, configured to call a brain-computer interface to acquire single-channel or multi-channel EEG signals of a user;

[0014] A chronic disease determination module, configured to determine the chronic disease on which the user's attention focuses;

[0015] A load information detection module, configured to input the EEG signals into a preset EEG detection model to detect one or more types of load information generated by the user;

[0016] A meditation course generation module, configured to generate a meditation course adapted to the chronic disease according to the load information;

[0017] A meditation course variation module, configured to, when the user practices mindfulness meditation according to the meditation course, control the variation 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.

[0018] A third aspect of the present invention provides an electronic device, where the electronic device includes:

[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 executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the method for transferring the attention of a brain-computer interface mindfulness meditation for chronic disease users as described in the first aspect above.

[0022] A fourth aspect of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for transferring the attention of a brain-computer interface mindfulness meditation for chronic disease users as described in the first aspect above is implemented.

[0023] A fifth aspect of the present invention provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the method for transferring the attention of a brain-computer interface mindfulness meditation for chronic disease users as described in the first aspect above is implemented.

[0024] In this embodiment, a brain-computer interface is called to collect single-channel or multi-channel electroencephalogram (EEG) signals of a user; the chronic disease where the user's attention lies is determined; the EEG signals are 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 is controlled to change based on the load information to guide the user's attention to shift from the chronic disease to mindfulness meditation. In this embodiment, the meditation course is constructed and adjusted in real time according to the user's load information, and the meditation course is adapted to the user's state to ensure that the state of each user reaches the threshold of the meditation course, improve the adaptability 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 transfer, and relieve the negative impact brought by the chronic disease to the user.

[0025] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used 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 will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0027] Figure 1 It is a flowchart of a method for attention transfer of brain-computer interface mindfulness meditation for chronic disease users provided in Embodiment 1 of the present invention.

[0028] Figure 2 It is a schematic structural diagram of an EEG detection model provided in Embodiment 1 of the present invention.

[0029] Figure 3 It is a schematic structural diagram of a device for attention transfer of brain-computer interface mindfulness meditation for chronic disease users provided in Embodiment 2 of the present invention.

[0030] Figure 4 It is a schematic structural diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0031] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope 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 do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can cover the sequential embodiments other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0033] Embodiment 1

[0034] See Figure 1 , which shows a flowchart of a method for attention transfer in brain-computer interface mindfulness meditation for chronic disease users provided in Embodiment 1 of the present invention. This method can be executed by a device for attention transfer in brain-computer interface mindfulness meditation for chronic disease users. The device for attention transfer in brain-computer interface mindfulness meditation for chronic disease users can be implemented in the form of hardware and / or software, and 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, a smart glasses, etc. The virtual reality device is provided with a brain-computer interface and components such as a speaker and a screen. The speaker and components such as the screen can be solidified in the electronic device, or can be a mobile terminal such as a user's mobile phone for reuse.

[0036] In another case, the electronic device can also be a physically separable or detachable device. At this time, the virtual reality device includes a mutually independent head-mounted device and a display device. The headband and the screen can be connected by a wired or wireless method, such as Wi-Fi (Wireless Fidelity), Bluetooth, ZigBee (ZigBee), etc. The head-mounted device is provided with a brain-computer interface, and the display device is configured with components such as a screen and a speaker. The screen can be an independent display device matching the headband, or can be a device with a screen such as a reused TV.

[0037] As shown Figure 1 below, the method includes:

[0038] Step 101: Invoke a brain-computer interface to collect single-channel or multi-channel electroencephalogram (EEG) signals from the user.

[0039] In this embodiment, the user can wear an electronic device, which can invoke the brain-computer interface to collect single-channel or multi-channel EEG signals from the user at a preset frequency. Herein, the EEG signal, also known as electroencephalography (EEG), is an electrical signal generated by the activities of brain neurons. Neurons are connected to each other through synapses to form a complex neural network. When neurons are activated, bioelectrical phenomena occur, and these EEG signals can be captured by placing electrodes on the scalp or other means.

[0040] Among them, the frequency can be a fixed value or a value dynamically adjusted according to factors such as the battery power of the electronic device and tasks that distract attention. This embodiment does not limit this.

[0041] Taking the single-channel EEG signal as an example, the brain-computer interface includes an electrode, a signal processor, and an A / D (Analogue to Digital conversion) converter.

[0042] Among them, the electrode includes a reference electrode, a ground electrode, and an EEG electrode for one signal channel; the ground electrode is used to determine the zero potential of the EEG signal, and the placement positions of the reference electrode and the ground electrode are the temples on both sides of the user's head; the placement position of the EEG electrode is 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 filter out the 50 Hz power frequency noise in the EEG signal through a notch filter, and then filter out the DC component and high-frequency noise with a 0.1 - 50 Hz band-pass filter.

[0044] The A / D converter converts the amplified and filtered EEG signal from an analog signal into a digital signal through a 24-bit resolution analog-to-digital conversion chip.

[0045] Step 102: Determine the chronic disease on which the user's attention is focused.

[0046] Generally, the user can manually input information about the chronic disease, such as the type of the chronic disease, the onset time of the chronic disease, the severity of the chronic disease, the attack frequency of the chronic disease, etc., to provide more information references for mindfulness meditation, so as to better provide mindfulness meditation services for the user.

[0047] Among them, the types of chronic diseases can be divided into tinnitus and non-tinnitus. Non-tinnitus includes chronic pain (including but not limited to cancer pain, headache, low back pain, etc.), drug addiction, and so on.

[0048] In one case, when the 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, the electroencephalogram (EEG) signal can be reused to detect the severity of the symptoms of the user's chronic disease, so as to determine whether the user's attention is focused on the chronic disease, and then start the recommendation process of mindfulness meditation.

[0050] In a specific implementation, the EEG signal can be input into a pre-set symptom detection model to detect the degree of symptoms generated by the user on the chronic disease (that is, the severity of the symptoms of the chronic disease), and the degree of symptoms is compared with a pre-set degree threshold. When the degree of symptoms is greater than or equal to the pre-set degree threshold, it indicates that the risk of the chronic disease attack is relatively high or the symptoms are relatively 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 the user to practice mindfulness meditation, transfer the user's attention from the chronic disease to mindfulness meditation, and relieve the negative impact of the chronic disease symptoms on the user.

[0052] Exemplarily, the value range of the degree of symptoms is [1, 100], and a threshold a and b are set within this value range, such as a = 20 and b = 80.

[0053] If the degree of chronic symptoms is in [1, a], it indicates that the risk of the user's chronic disease attack is relatively low.

[0054] If the degree of chronic symptoms is in (a, b], it indicates that the risk of the user's chronic disease attack is relatively high.

[0055] If the degree of chronic symptoms is in (b, 100], it indicates that the user has relatively obvious symptoms of the chronic disease.

[0056] In this example, both a and b can be set as the degree threshold.

[0057] It should be noted that the symptom detection model can be a machine learning model, for example, Support Vector Machine (SVM), decision tree, random forest, etc. The symptom detection model can also be a deep learning model, for example, Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM), Transformer (a neural network architecture based on 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 electroencephalogram (EEG) signal is input into a pre-set EEG detection model to detect the attention value, emotion value, sleep value, and tinnitus frequency generated by the user.

[0072] In one embodiment of the present invention, as Figure 2 shown, the EEG detection model includes a first branch structure Branch_1 and a second branch structure Branch_2. Among them, the first branch structure Branch_1 is mainly a basic decoding network for EEG signals, and the second branch structure Branch_2 is mainly a prediction network for 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 map.

[0075] In this embodiment, methods such as Continuous Wavelet Transform (CWT) can be used to perform time-frequency conversion on the EEG signal, convert the EEG signal from the time domain to the frequency domain, and obtain an EEG time-frequency map. The size of the EEG time-frequency map 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 tinnitus assessment scale component of the user.

[0077] In practical applications, the user can fill in or import the tinnitus assessment scale in real time. For example, the 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, etc.

[0078] The tinnitus assessment scale records the information of the user on each tinnitus assessment item, which can be converted into a vector to obtain the tinnitus assessment scale component.

[0079] The tinnitus assessment scale component is a one-dimensional vector. Suppose there are L (L is a positive integer) tinnitus assessment items in the tinnitus assessment scale, then the scale of the tinnitus assessment scale component is 1×L.

[0080] Step 1033: Input the EEG time-frequency map 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 based on the target EEG signal.

[0081] In this embodiment, as Figure 2 shown, input the EEG time-frequency map into the first branch structure Branch_1. The first branch structure Branch_1 performs multi-task processing based on the EEG time-frequency map. 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, as Figure 2 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, input the EEG time-frequency map 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 map is N×M×1 and the size of the convolutional kernel of the first convolutional layer Conv_1 is 1×K, the size of the first candidate EEG feature is N×M×1.

[0085] On the other hand, input the EEG time-frequency map 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 map is N×M×1 and the size of the convolutional kernel of the second convolutional layer Conv_2 is K×K, the size of the second candidate EEG feature is N×M×1.

[0087] On the other hand, input the EEG time-frequency map into the third convolutional layer Conv_3 to perform a frequency convolution operation to obtain the third candidate EEG feature.

[0088] When the size of the EEG time-frequency map is N×M×1 and the size of the convolutional kernel of the second convolutional 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 splice the first candidate EEG feature, the second candidate EEG feature, and the third candidate EEG feature along the 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] Input the fourth candidate EEG feature into the fourth convolutional layer Conv_4 (with a kernel size of 1×1) to perform channel convolution operation to obtain the target EEG feature;

[0092] Input the target EEG feature into the first fully connected layer FC_1 to map it into the first reference EEG feature, and use activation functions such as Sigmoid to activate the first reference EEG feature into an attention value.

[0093] Input the target EEG feature into the second fully connected layer FC_2 to map it into the second reference EEG feature, and use activation functions such as Sigmoid to activate the second reference EEG feature into an emotion value;

[0094] Input the target EEG feature into the third fully connected layer FC_3 to map it into the third reference EEG feature, and use activation functions such as Sigmoid to activate the third reference EEG feature into a sleep value.

[0095] Step 1034: Input the tinnitus assessment scale component into the second branch structure to extract the target tinnitus disability amount feature, fuse the target EEG feature with the target tinnitus disability amount 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, as Figure 2 shown, input the tinnitus assessment scale component into the second branch structure Branch_2. The second branch structure Branch_2 is responsible for extracting the target tinnitus disability amount feature from the tinnitus assessment scale component, fusing the target EEG feature with the target tinnitus disability amount 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, as Figure 2 shown, 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.

[0098] Then, input the tinnitus assessment scale component into the fourth fully connected layer FC_4 to map it into a candidate tinnitus disability amount feature.

[0099] Transform the candidate tinnitus disability amount feature Reshape into a two-dimensional target tinnitus disability amount feature with a size of g×g.

[0100] In the fifth convolutional layer Conv_5, the target electroencephalogram (EEG) tinnitus feature is used as the convolutional kernel to perform a convolutional operation on the target EEG feature, obtaining the EEG tinnitus feature.

[0101] The EEG tinnitus feature is input into the fifth fully connected layer FC_5 to be mapped to the tinnitus frequency, and the tinnitus frequency is mostly in the range of 2 - 8 kHz.

[0102] Step 1035: During a preset time period, if the tinnitus frequencies are all within the preset frequency range, maintain the operation of the first branch structure and turn off the operation of the second branch structure.

[0103] In this embodiment, if the tinnitus frequencies are all within the preset frequency range and the duration exceeds the preset time period, it can be considered that the tinnitus frequency is the tinnitus frequency subjectively felt by the user. Then, the operation of the first branch structure can be maintained and the operation of the second branch structure can be turned off, thereby reducing resource consumption.

[0104] Of course, in addition to maintaining the operation of the first branch structure and turning off 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 an embodiment of the present invention, the method for training an EEG detection model includes the following steps:

[0106] S201: During the stage of training the EEG detection model, collect the EEG signals and tinnitus assessment scale components of the user as samples.

[0107] During the stage of training the EEG detection model, the EEG signals and tinnitus assessment scale components of the tested user can be collected as samples.

[0108] Among them, at least one of the attention value, emotion value, and sleep value is marked as the label Label for the EEG signal as a sample. At least one of the attention value, emotion value, and sleep value can be marked by the user according to their own physical feelings, or by external personnel according to the user's external performance, or can also be marked by analyzing the user's external performance such as expressions and body movements. This embodiment does not limit this.

[0109] In addition, the tinnitus assessment scale component as a sample is marked with the tinnitus frequency as the label Label.

[0110] S202: Perform time-frequency conversion on the EEG signal as a sample to obtain the EEG time-frequency map.

[0111] In this embodiment, methods such as continuous wavelet transform can be used to perform time-frequency conversion on the EEG signals used as samples, converting the EEG signals from the time domain to the frequency domain to obtain an EEG time-frequency map. The size of the EEG time-frequency map is N×M×1, where N represents the length, M represents the width, and 1 represents the number of channels.

[0112] S203. Input the EEG time-frequency map into the first branch structure to extract target EEG features, and generate the attention value, emotion value, and sleep value generated by the user based on the target EEG signals.

[0113] In this embodiment, the EEG time-frequency map is input into the first branch structure Branch_1. The first branch structure Branch_1 performs multitask processing based on the EEG time-frequency map. During the processing, 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 temporal convolution operation (i.e., a one-dimensional convolution operation in the time dimension) to obtain a first candidate EEG feature.

[0116] When the size of the EEG time-frequency map is N×M×1 and the size of the convolutional kernel of the first convolutional 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 domains) to obtain a second candidate EEG feature.

[0118] When the size of the EEG time-frequency map is N×M×1 and the size of the convolutional kernel of the second convolutional layer Conv_2 is K×K, the size of the second candidate EEG feature is N×M×1.

[0119] On yet another 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) to obtain a third candidate EEG feature.

[0120] When the size of the EEG time-frequency map is N×M×1 and the size of the convolutional kernel of the second convolutional 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. Functions such as Concat can be used to splice the first candidate EEG feature, the second candidate EEG feature, and the third candidate EEG feature by channels into the fourth candidate EEG feature.

[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] Input the fourth candidate EEG feature into the fourth convolutional layer Conv_4 (the size of the convolutional kernel is 1×1) to perform channel convolution operation to obtain the target EEG feature;

[0124] Input the target EEG feature into the first fully connected layer FC_1 to map it into the first reference EEG feature, and use activation functions such as Sigmoid to activate the first reference EEG feature into an attention value.

[0125] Input the target EEG feature into the second fully connected layer FC_2 to map it into the second reference EEG feature, and use activation functions such as Sigmoid to activate the second reference EEG feature into an emotion value.

[0126] Input the target EEG feature into the third fully connected layer FC_3 to map it into the third reference EEG feature, and use activation functions such as Sigmoid to activate the third reference EEG feature into a sleep value.

[0127] S204. Generate a first sub-loss value based on the attention value, generate a second sub-loss value based on the emotion value, and generate a third sub-loss value based on 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 the cross-entropy loss function) for operation 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 the cross-entropy loss function) for operation to generate a second sub-loss value.

[0130] On the other hand again, the sleep value output by the EEG detection model and the corresponding label Label are substituted into a preset loss function (such as the cross-entropy loss function) for operation to generate a third sub-loss value.

[0131] S205. Input the tinnitus assessment scale component into the second branch structure to extract the target tinnitus disability quantity feature, fuse the target EEG feature and the target tinnitus disability quantity 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 component of the tinnitus assessment scale 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 component of the tinnitus assessment scale, fusing the target EEG feature and 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 component of the tinnitus assessment scale is input into the fourth fully connected layer FC_4 and mapped into a candidate tinnitus disability feature.

[0135] The candidate tinnitus disability feature is transformed (Reshape) 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 known as dynamic convolution) is performed on the target EEG feature using the target tinnitus disability feature as the convolution kernel to obtain an EEG-tinnitus feature.

[0137] The EEG-tinnitus feature is input into the fifth fully connected layer FC_5 and mapped into a tinnitus frequency.

[0138] S206. Generate a fourth sub-loss value based on 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) for operation to generate a fourth sub-loss value.

[0140] S207. 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.

[0141] In this embodiment, a linear or non-linear method can be used 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.

[0142] In a specific implementation, the first sub-loss value, the second sub-loss value, and the third sub-loss value are added together to obtain a 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, plus the product of the fifth sub-loss value and the second weight, is used 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] Wherein, 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, α = 0.5 can be set, and the four loss functions have the same weight to optimize the parameters of the electroencephalogram detection model.

[0149] If the fluctuation range of the total loss value during update is less than the preset fluctuation threshold, then under the condition of maintaining the sum of the first weight and the second weight as 1, increase the first weight and decrease the second weight, that is, increase the weight of the loss function for predicting the tinnitus frequency, which can help search for the global optimal solution and improve the convergence speed.

[0150] S208. Update the electroencephalogram detection model according to the total loss value.

[0151] In this embodiment, the total loss value can be substituted into optimization algorithms such as SGD (stochastic gradient descent) and Adam (Adaptive momentum) to calculate the update amplitude of the parameters in the electroencephalogram detection model, and update the parameters in the electroencephalogram detection model according to this update amplitude.

[0152] Furthermore, training conditions can be preset as the conditions for stopping the training of the electroencephalogram detection model. For example, the number of iterations reaches a certain threshold, the total loss value is less than a certain threshold, the change amplitude of the total loss value in multiple iterative trainings is less than a certain threshold, etc. In each round of iterative training, it is judged whether the training conditions are met.

[0153] If the training conditions are met, it can be considered that the electroencephalogram detection model is completed. At this time, output the parameters in the electroencephalogram detection model and write them 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 are re - executed, and so on for iterative training until the electroencephalogram detection model is completed.

[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 the scenario text information for describing each meditation scenario and the scenario text vectors converted from the scenario text information. For example, some information in the knowledge base includes introducing digital robots, introducing the definition of mindfulness, introducing the content of mindfulness meditation, the norms for guiding users in mindfulness meditation in various meditation scenarios, and so on.

[0166] At this time, the meditation scenario, the user's chronic disease and load information can be used to construct the guidance text information Prompt, and the guidance text information Prompt is input into the LLM to generate meditation guidance.

[0167] For example, the guidance text information Prompt is "I suffer from chronic low back pain. My attention value during campfire meditation is between 0 and 30 points, my emotional value is between 20 and 50 points, and it has lasted for more than 10 minutes, indicating that I am in a relatively poor meditation state. You need to tell me my current state, directly give some suggestions to help me concentrate, improve my emotional state, and keep my body and mind happy."

[0168] In one design, the meditation scenario can be directly constructed based on the user's load information, and the meditation guidance can be generated synchronously based on the user's load information.

[0169] When the chronic disease is not tinnitus, select a meditation scenario for the user according to at least one of the emotional value and the sleep value, and generate meditation guidance for the user according to at least one of the attention value, the emotional value and the sleep value.

[0170] Exemplarily, for a user with chronic pain, soothing symphonies and aerial natural landscape (meditation scenario) can be provided according to their emotional value, and their attention value and emotional value are input into the LLM to generate meditation guidance in real time.

[0171] For a user with drug addiction, an audio-visual feedback scenario with low richness of audio and low color saturation (meditation scenario) can be provided according to their emotional value, or a meditation scenario can be constructed by combining publicity materials on the hazards of drugs. Their attention value and emotional value are input into the LLM to generate meditation guidance in real time.

[0172] For users with chronic pain and / or drug addiction, a meditation scenario with a low level of richness and a single subject, such as a campfire or a candle flame, can be provided based on their emotional value and sleep value. The feedback of this meditation scenario mainly focuses on the realistic dynamic changes of objects. For example, the height of the candle flame, the dynamic growth of the tree, the rotation of the earth, etc. Input their attention value, emotional value, and sleep value into the LLM to generate meditation guidance in real time. For example, when the user's sleep value is low (i.e., awake) and the attention value is low, guide the user to focus on a certain object through the meditation guidance (the object of focus is different depending on the meditation scenario, such as a candle, breathing, etc.). When the user's sleep value is low (i.e., awake) and the attention value is high, guide the user to gradually relax each part of the body through the meditation guidance. When the user's sleep value is medium (i.e., the light sleep stage), pause the feedback based on the attention value and give the user meditation guidance for approaching sleep, such as "Your consciousness is becoming increasingly blurred and you are about to enter deep sleep". When the user's sleep value is high (i.e., the deep sleep stage), stop the feedback of the meditation guidance.

[0173] When the chronic disease is tinnitus, select a meditation scenario for mindfulness meditation for the user based on at least one of the emotional value and the sleep value, and generate meditation guidance for the user based on at least one of the attention value, emotional value, sleep value, and tinnitus frequency.

[0174] That is, constructing a meditation field depends on two elements. One element is the tinnitus frequency, and the other element is at least one of the emotional value and the sleep value.

[0175] Furthermore, the audio signal in the meditation scenario can be selected as narrowband noise, white noise, music, etc. The meditation scenario will filter out some audio signals, making some audio signals missing. The difference between the central frequency of the missing audio signal in the meditation scenario and the tinnitus frequency is less than the frequency threshold, that is, the central frequency of the missing audio signal is the same as or close to the tinnitus frequency.

[0176] Generally, filtering out the sounds (i.e., audio signals) near the tinnitus frequency can reduce the overactivity of tinnitus frequency-related neurons, thereby further diverting the user's attention from tinnitus.

[0177] Of course, the above meditation scenarios and meditation guidance are only examples. When implementing this embodiment, other meditation scenarios and meditation guidance can be set according to the actual situation, and this embodiment does not limit this. In addition, in addition to the above meditation scenarios and meditation guidance, those skilled in the art can also adopt other meditation scenarios and meditation guidance according to actual needs, and this embodiment does not limit this either.

[0178] In another design, a meditation course for the next practice of mindfulness meditation can be constructed based on the user's previous practice effect of mindfulness meditation.

[0179] In a specific implementation, the attention value to a certain extent represents the effect of the user practicing mindfulness meditation. Therefore, the average value of the attention values when the user last practiced mindfulness meditation can be calculated to obtain the average attention.

[0180] Query the attention range where the average attention is located among 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 meditation courses adapted to each chronic disease based on prior knowledge such as experiments.

[0181] Set the meditation course corresponding to the target range as the meditation course for the user to practice mindfulness meditation this time.

[0182] Exemplarily, the value range of the attention value is [1, 100], and a threshold c is set within this value range, such as c = 60.

[0183] If the average attention is within [1, c], it indicates that the attention transfer effect of the user practicing mindfulness meditation this time is poor. When practicing mindfulness meditation next time, an introductory meditation course is recommended.

[0184] If the average attention is within (c, 100], it indicates that the attention transfer effect of the user practicing mindfulness meditation this time is good. When practicing mindfulness meditation next time, a professional-level meditation course is recommended.

[0185] Step 105, when the user practices mindfulness meditation according to the meditation course, control the change of the meditation course according to the load information to guide the user's attention to shift from the chronic disease to mindfulness meditation.

[0186] During the process of the user practicing mindfulness meditation according to the meditation course, the electroencephalogram (EEG) signals can be continuously collected, and the load information can be continuously generated based on the EEG signals, so as to evaluate the effect of the user's attention transfer when practicing mindfulness meditation.

[0187] Thereafter, the expressiveness of various feedbacks (including visual feedback, auditory feedback, etc.) in the meditation course (including meditation scenes, meditation guiding words) can be adjusted according to the change trend of the load information, so that the user can intuitively know their own state, guide the user's attention to shift from the chronic disease to mindfulness meditation, and relieve the negative impact brought by the chronic disease to the user.

[0188] Among them, for the visual feedback, its expressiveness includes the clarity of the 3D (three-dimensional) or 2D (two-dimensional) meditation images, visual changes, etc. For the auditory feedback, its expressiveness includes changes in the volume, pitch, sound type, etc. of the mindfulness meditation audio data.

[0189] In a specific implementation, when the chronic disease is not tinnitus, the change of the meditation scene is controlled visually and auditorily 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 mindful meditation.

[0190] Exemplarily, the attention value is detected at regular intervals (such as every 1 second), and preprocessing such as moving average is performed on the attention value. If the attention value at the current moment is higher than that at the previous moment, that is, the change trend of the attention value of mindful meditation is increasing, indicating that the user's degree of mindful meditation becomes deeper and the effect of diverting attention becomes better, then the clarity of the meditation screen can be increased, and the volume of the mindful meditation audio data can be increased; if the attention value at the current moment is lower than that at the previous moment, that is, the change trend of the attention value of mindful meditation is decreasing, indicating that the user's degree of mindful meditation becomes shallower and the effect of diverting attention becomes worse, then the clarity of the meditation screen can be decreased, and the volume of the mindful meditation audio data can be decreased.

[0191] In addition to the above changes, when it is detected that the user's sleep value is high (i.e., the deep sleep period), the volume of the audio signal and the brightness of the screen can be gradually decreased until the meditation course is exited.

[0192] When the chronic disease is tinnitus, the change of the meditation scene is controlled visually and auditorily according to at least one of the attention value and the sleep value, and the audio signal with the difference between the central frequency and the tinnitus frequency less than the frequency threshold is filtered out auditorily, so as to guide the user's attention to shift from tinnitus to mindful meditation.

[0193] Furthermore, the audio signal in a partial frequency band centered on the tinnitus frequency in the meditation scene is used to filter out the audio signal with the difference between the central frequency and the tinnitus frequency 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, and a personalized meditation scene is constructed for the current user.

[0194] In this embodiment, a brain-computer interface is called to collect single-channel or multi-channel electroencephalogram (EEG) signals of the user; the chronic disease where the user's attention is located is determined; the EEG signals are input into a preset EEG detection model to detect one or more types of load information generated by the user; a meditation course adapted to the chronic disease is generated according to the load information; when the user practices mindful meditation according to the meditation course, the meditation course is controlled to change according to the load information, so as to guide the user's attention to shift from the chronic disease to mindful meditation. In this embodiment, the meditation course is constructed and adjusted in real time according to the user's load information, the meditation course is adapted to the user's state, and every effort is made to ensure that the state of each user reaches the threshold of the meditation course, improve the adaptation degree between the user and the meditation course, realize personalized practice of mindful meditation, improve the effect of the user's practice of mindful meditation, improve the efficiency of the user's attention diversion, and relieve the negative impact brought by the chronic disease to the user.

[0195] Embodiment Two

[0196] See Figure 3 , which shows a schematic structural diagram of a brain-computer interface mindfulness meditation attention transfer device provided in the second embodiment of the present invention. As Figure 3 shown, the device includes:

[0197] An electroencephalogram (EEG) signal acquisition module 301, configured to call a brain-computer interface to acquire single-channel or multi-channel EEG signals of a user;

[0198] A chronic disease determination module 302, configured to determine the chronic disease on which the attention of the user is focused;

[0199] A load information detection module 303, configured to input the EEG signals into a preset EEG detection model to detect one or more types of load information generated by the user;

[0200] A meditation course generation module 304, configured to generate a meditation course adapted to the chronic disease according to the load information;

[0201] A meditation course change module 305, configured to, when the user practices mindfulness meditation according to the meditation course, control the change of the meditation course according to the load information to guide the attention of the user to transfer from the chronic disease to the mindfulness meditation.

[0202] In an embodiment of the present invention, the chronic disease determination module 302 includes:

[0203] A symptom degree detection module, configured to input the EEG signals into a preset symptom detection model to detect the symptom degree generated by the user for the chronic disease;

[0204] An attention concentration module, configured to determine that the attention of the user is concentrated on the chronic disease when the symptom degree is greater than or equal to a preset degree threshold.

[0205] In an 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, configured to input the EEG signals into a preset EEG detection model to detect the attention value, the emotion value, and the sleep value generated by the user when the chronic disease is not tinnitus;

[0208] A second load detection module, configured to input the EEG signals into a preset EEG detection model to detect the attention value, the emotion value, the sleep value, and the 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 construction module, configured to select a meditation scene for the user according to at least one of the emotion value and the sleep value when the chronic disease is not tinnitus, and generate meditation instructions for the user according to at least one of the attention value, the emotion value, and the sleep value;

[0212] A second course construction module, configured to select 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 generate 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 central frequency of the missing audio signal in the meditation scene and the tinnitus frequency is less than a frequency threshold;

[0213] The meditation course change module 305 includes:

[0214] A first change control module, configured 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 not tinnitus, so as to guide the user's attention to transfer from the chronic disease other than tinnitus to the mindfulness meditation;

[0215] A second change control module, configured 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 filter out the audio signal whose difference between the central frequency and the tinnitus frequency is less than the frequency threshold auditorily, so as to guide the user's attention to transfer 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, configured to calculate the average value of the attention value when the user last practiced mindfulness meditation to obtain an average attention;

[0218] A target range query module, configured 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] A meditation course setting module, configured to set the meditation course corresponding to the target range as the meditation course for the user to practice mindfulness meditation this time.

[0220] In one embodiment of the present invention, the electroencephalogram (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 map conversion module, configured to perform time-frequency conversion on the EEG signal to obtain an EEG time-frequency map;

[0222] A tinnitus assessment scale component query module, configured to query the tinnitus assessment scale component of the user;

[0223] A first branch processing module, configured to input the EEG time-frequency map into the first branch structure to extract target EEG features, and generate the attention value, emotion value, and sleep value generated by the user based on the target EEG signal;

[0224] A second branch processing module, configured to input the tinnitus assessment scale component into the second branch structure to extract target tinnitus disability quantity features, fuse the target EEG features and the target tinnitus disability quantity features into EEG-tinnitus features, and generate the tinnitus frequency generated by the user based on the EEG-tinnitus features.

[0225] In another embodiment of the present invention, the load information detection module 303 further includes:

[0226] A branch adjustment module, configured to maintain the operation of the first branch structure and close the operation of the second branch structure within a preset time period if the tinnitus frequencies are all within a preset frequency range.

[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 generation module, configured to input the EEG time-frequency map into the first convolutional layer to perform a temporal convolution operation to obtain a first candidate EEG feature;

[0230] A second candidate EEG feature generation module, configured to input the EEG time-frequency map into the second convolutional layer to perform a time-frequency convolution operation to obtain a second candidate EEG feature;

[0231] A third candidate EEG feature generation module, configured to input the EEG time-frequency map into the third convolutional layer to perform a frequency convolution operation to obtain a third candidate EEG feature;

[0232] The fourth candidate EEG feature generation module is used to splice the first candidate EEG feature, the second candidate EEG feature, and the third candidate EEG feature by channel to form a fourth candidate EEG feature;

[0233] The target EEG feature generation module is used to input the fourth candidate EEG feature into the fourth convolutional layer to perform channel convolution operation to obtain a target EEG feature;

[0234] The attention value generation module is used to input the target EEG feature into the first fully connected layer to map it into a first reference EEG feature and activate the first reference EEG feature into an attention value;

[0235] The emotion value generation module is used to input the target EEG feature into the second fully connected layer to map it into a second reference EEG feature and activate 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 into a sleep value.

[0237] In an 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] The candidate tinnitus disability quantity feature mapping module is used to input the tinnitus assessment scale component into the fourth fully connected layer to map it into a candidate tinnitus disability quantity feature;

[0240] The target tinnitus disability quantity feature conversion module is used to transform the candidate tinnitus disability quantity feature into a two-dimensional target tinnitus disability quantity feature;

[0241] The EEG tinnitus feature generation module is used to perform a convolution operation on the target EEG feature with the target tinnitus disability quantity feature as the convolution kernel in the fifth convolutional 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 to map it into a tinnitus frequency.

[0243] In an embodiment of the present invention, it further includes:

[0244] The sample acquisition module is used to collect EEG signals and tinnitus assessment scale components as samples from users during the training stage of the EEG detection model;

[0245] The sample time-frequency diagram conversion module is used to perform time-frequency conversion on the EEG signal as a sample to obtain an EEG time-frequency diagram;

[0246] The first sample processing module is used to input the electroencephalogram time-frequency map into the first branch structure to extract target electroencephalogram features, and generate the attention value, emotion value, and sleep value generated by the user according to the target electroencephalogram signal;

[0247] The first loss value generation module is used 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] The second sample processing module is used to input the tinnitus evaluation scale component into the second branch structure to extract target tinnitus disability characteristics, fuse the target electroencephalogram characteristics and the target tinnitus disability characteristics into electroencephalogram-tinnitus characteristics, and generate the tinnitus frequency generated by the user according to the electroencephalogram-tinnitus characteristics;

[0249] The second loss value generation module is used to generate a fourth sub-loss value according to the tinnitus frequency;

[0250] The loss value fusion module is used 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 electroencephalogram detection model update module is used to update the electroencephalogram detection model according to the total loss value.

[0252] In an embodiment of the present invention, the loss value fusion module includes:

[0253] The loss value addition module is used 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] The weight configuration module is used 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] The weighted summation module is used to add the product of the fourth sub-loss value and the first weight, plus the product of the fifth sub-loss value and the second weight, as the total loss value;

[0256] The weight adjustment module is used to increase the first weight and decrease the second weight under the condition that the sum of the first weight and the second weight remains 1 if the fluctuation amplitude 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 further configured to:

[0259] Input the EEG time-frequency map into the first convolutional layer to perform a temporal convolution operation to obtain a first candidate EEG feature;

[0260] Input 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] Input the EEG time-frequency map into the third convolutional layer to perform a frequency convolution operation to obtain a third candidate EEG feature;

[0262] Concatenate the first candidate EEG feature, the second candidate EEG feature, and the third candidate EEG feature along the channels to obtain a fourth candidate EEG feature;

[0263] Input the fourth candidate EEG feature into the fourth convolutional layer to perform a channel convolution operation to obtain a target EEG feature;

[0264] Input the target EEG feature into the first fully connected layer to map it to a first reference EEG feature, and activate the first reference EEG feature to obtain an attention value;

[0265] Input the target EEG feature into the second fully connected layer to map it to a second reference EEG feature, and activate the second reference EEG feature to;

[0266] Input the target EEG feature into the third fully connected layer to map it to a third reference EEG feature, and activate the third reference EEG feature to obtain 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 further configured to:

[0269] Input the tinnitus assessment scale component into the fourth fully connected layer to map it to a candidate tinnitus disability feature;

[0270] Transform the candidate tinnitus disability feature into a two-dimensional target tinnitus disability feature;

[0271] In the fifth convolutional layer, use the target tinnitus disability feature as a convolution kernel to perform a convolution operation on the target EEG feature to obtain an EEG-tinnitus feature;

[0272] Input the electroencephalogram tinnitus feature into the fifth fully connected layer to map it to the tinnitus frequency.

[0273] The brain-computer interface mindfulness meditation attention transfer device for chronic disease users provided by the embodiments of the present invention can execute the brain-computer interface mindfulness meditation attention transfer method provided by 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 III

[0275] See Figure 4 , which shows a schematic structural diagram 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 illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0276] As Figure 4 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 11 can execute 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 into 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] Multiple 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 disc, 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 various general-purpose and / or special-purpose 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 dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, 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 may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto 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 described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured to execute the brain-computer interface mindfulness meditation attention transfer method by any other suitable means (e.g., by means of firmware).

[0280] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0281] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on a remote machine or server.

[0282] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0283] In order to provide interaction with a user, the systems and techniques described herein can 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 a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0284] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

[0285] A computing system can include a client and a server. The client and the server are generally far from each other and usually interact through a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0286] Example Four

[0287] The 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 method for attention transfer of brain-computer interface mindfulness meditation for chronic disease users provided in any embodiment of the present invention.

[0288] In the process of implementing the computer program product, computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely 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 (e.g., connected through the Internet using an Internet service provider).

[0289] It should be understood that the various forms of processes shown above can be used, with steps reordered, added or deleted. 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 no limitation is made herein.

[0290] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within 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; 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; 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 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; 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 features; 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.

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, the meditation scene change is visually and auditorily controlled according to at least one of the attention value and the sleep value, and the audio signal whose center frequency differs from the tinnitus frequency by less than a frequency threshold is acoustically filtered out to guide the user's attention to shift from the tinnitus to the mindfulness meditation.

3. The method according to claim 1, characterized in that 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.

4. The method according to claim 1, 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 features, 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 1, 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 1, characterized in that Also includes: In the stage of training the EEG detection model, EEG signals and tinnitus assessment scale components are collected 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 features; 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 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; 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 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; 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; 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; A second load detection module is used for inputting 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; The EEG detection model includes a first branch structure and a second branch structure; the load information detection module includes: An EEG time-frequency graph conversion module, used for performing time-frequency conversion on the EEG signal to obtain an EEG time-frequency graph; A tinnitus assessment scale component query module, used to query the tinnitus assessment scale components of the user; A first branch processing module, configured to input the EEG time-frequency graph into the first branch structure to extract target EEG features, and generate the attention value, emotion value and sleep value generated by the user according to the target EEG features; A 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, 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 according to the EEG tinnitus feature; 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.

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

  • Meditation adjustment method and device based on motion sickness and storage medium

    CN118634402A