Brain wave sleep state adjustable sleep aid music generation method, device, equipment and medium

By combining deep learning and the CycleGAN model generator, the problem of insufficient artistry and sleep-aiding effect of existing brainwave sleep-aid music is solved, generating personalized and highly professional brainwave sleep-aid music to improve sleep quality.

CN119770062BActive Publication Date: 2025-11-11SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411821224.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-11-11
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

Existing brainwave-based sleep-aid music generation methods are lacking in both musical artistry and sleep-aiding effects. In particular, the volume and pitch of the music fluctuate unreasonably due to the instability of brainwave signals and the simple mapping algorithms, lacking medical professionalism and effectiveness.

Method used

By acquiring EEG signals, performing preprocessing and sleep state analysis, and combining deep convolutional neural networks and graph neural networks to assess sleep stages, personalized brainwave sleep-aid music is generated by using the CycleGAN music style transfer model and combined with professional sleep-aid music. An additional discriminator is added to constrain the generator to learn advanced features.

Benefits of technology

The generated brainwave-based sleep-aid music is more artistic and medically professional, and can provide personalized sleep aid effects for different sleep states, thereby improving sleep quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119770062B_ABST
    Figure CN119770062B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and medium for generating brainwave-based sleep-aid music that can regulate sleep states. The method includes: acquiring electroencephalogram (EEG) signals; preprocessing the EEG signals to obtain sleep period samples; performing sleep stage analysis on the sleep period samples to obtain sleep states; acquiring corresponding professional sleep-aid music from a music library of obtained sleep states; extracting features from the EEG signals; generating real-time brainwave music based on the extracted features; inputting the professional sleep-aid music and the real-time brainwave music into a music style transfer model to learn the mutual transfer relationship between the real-time brainwave music and the professional sleep-aid music, and generating brainwave-based sleep-aid music tailored to the current sleep state. This invention, based on real-time brainwave music and professional sleep-aid music, generates sleep-aid brainwave music that regulates the real-time sleep state of the subject, providing targeted regulation for different sleep states and having significant application value in the field of sleep health.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electroencephalogram (EEG) signal processing technology, and in particular to a method, apparatus, device, and medium for generating brainwave-assisted sleep music that can regulate sleep state. Background Technology

[0002] Brainwave music is a therapeutic approach that aims to improve sleep quality and promote relaxation by synchronizing specific frequencies of sound with brainwaves. During sleep, brainwave frequencies change, with different sleep stages exhibiting different patterns. The main brainwave frequencies include delta, theta, alpha, and beta, which provide important information about sleep stages and quality. When people close their eyes, relax, or engage in light attentional activity, the brain produces alpha waves, indicating wakefulness and relaxation; during light sleep, the brain produces theta waves, indicating interrupted consciousness and deep relaxation; and during deep sleep, the brain produces delta waves. Conversely, in states of tension, stress, or fatigue, the brain produces higher-frequency beta waves, often making it difficult to fall asleep. Some neurological research suggests that brainwave music helps regulate brain activity patterns, thereby improving sleep and relaxation. The theoretical basis is that listening to specific frequencies of sound can alter brain frequencies, making it easier to enter a deep sleep state. However, it should be noted that because brainwave patterns vary significantly between individuals, different brainwave music may have varying degrees of applicability to different individuals.

[0003] Brainwave music generation is an innovative technology that combines brainwave science with the principles of music composition. Using specially designed equipment, it captures the electroencephalogram (EEG) signals emitted by the human brain and transforms them into musical sounds and melodies according to specific mapping rules. The human brain generates brainwaves of different frequencies in different states. When we feel relaxed and calm, the brain produces lower frequency fluctuations; while when focused and attentive, the brainwave frequency increases. The brainwave music generation system utilizes these frequency changes, mapping them to specific notes and tones to create music that matches the individual's current brainwave state. In addition to frequency, EEG signals also contain other parameters, such as amplitude and phase, which are closely related to an individual's brain activity, emotions, and sleep states. By comprehensively utilizing these different EEG parameters, the brainwave music generation system can improve the effectiveness of brainwave music generation, more accurately serving changes in an individual's brainwave state and sleep, mood, and other states. In this way, the brainwave music generation system can create more personalized and targeted musical experiences, meeting more of an individual's musical needs.

[0004] Currently, methods for generating brainwave-based sleep-aid music primarily involve analyzing parameters such as frequency, amplitude, and phase of a subject's real-time electroencephalogram (EEG) signals and mapping these parameters to musical indices such as pitch and intensity. Then, filtering and multi-channel integration are used to generate the sleep-aid music. However, this method has some shortcomings in terms of both the artistry of the music and its effectiveness in improving sleep quality. First, regarding the artistry, existing brainwave-generated music is usually based on statistical models or data-driven methods. This method can only perform pattern recognition and generation using large amounts of data; the aesthetics and artistry of the music often exceed the scope of what statistical models can describe, failing to truly understand and express the music's connotation, emotion, and depth. Second, regarding the sleep-aiding effect, due to the instability of EEG signals, directly generating music from a subject's real-time EEG signals through simple mapping and algorithmic calculations may lead to unreasonable fluctuations in the music's volume and pitch, negatively impacting the subject's sleep quality. Meanwhile, compared to professional sleep-aid music that has been clinically validated in medicine (such as alpha brainwave music and dual-frequency music on the market), the medical professionalism and effectiveness of music generated by real-time brainwave direct mapping in improving sleep quality still need to be further improved. Summary of the Invention

[0005] In order to at least partially solve one of the technical problems existing in the prior art, the purpose of this invention is to provide a method, device, equipment and medium for generating brainwave sleep-aiding music that can adjust sleep state.

[0006] The first technical solution adopted in this invention is:

[0007] A method for generating brainwave-based sleep-inducing music that can regulate sleep states includes the following steps:

[0008] Acquire EEG signals, preprocess the EEG signals, and obtain sleep period samples;

[0009] Sleep stage analysis was performed on sleep samples to obtain sleep status;

[0010] Based on the obtained sleep state, retrieve corresponding professional sleep-aid music from the personal brainwave sleep-aid music library;

[0011] Features are extracted from electroencephalogram (EEG) signals, and real-time brainwave music is generated based on the extracted features.

[0012] By inputting professional sleep-aid music and real-time brainwave music into a music style transfer model, the model learns the mutual transfer relationship between real-time brainwave music and professional sleep-aid music, and generates brainwave sleep-aid music tailored to the current sleep state.

[0013] Further, the acquisition of EEG signals, and the preprocessing of the EEG signals to obtain sleep period samples, include:

[0014] Acquire EEG signals, and perform filtering operations on the EEG signals to remove noise interference and eliminate motion artifacts;

[0015] The filtered EEG signals are sliced ​​according to a preset method to generate multiple sleep period samples to be tested.

[0016] Furthermore, the step of performing sleep stage analysis on sleep period samples to obtain sleep states includes:

[0017] A pre-trained state assessment model was used to analyze sleep stages in multiple sleep period samples to determine the current sleep state.

[0018] The state assessment model works as follows:

[0019] A deep convolutional neural network (CNN) is used to perform temporal dimensionality reduction on samples from each sleep period to learn channel-independent temporal features;

[0020] By treating each brainwave channel as a graph node, graph neural networks (GNNs) are used to model the spatial topology of the brain, enabling information transmission and convergence between multiple brain channels.

[0021] By learning the highly discriminative spatiotemporal features of real-time sleep EEG data, the accuracy of sleep staging can be improved, thereby more accurately determining the real-time sleep state of the subjects.

[0022] Furthermore, the step of extracting features from electroencephalogram (EEG) signals and generating real-time brainwave music based on the extracted features includes:

[0023] The characteristics of the electroencephalogram (EEG) signal are acquired, including the frequency, amplitude, and phase of the brainwave signal.

[0024] The acquired features are mapped to corresponding note attributes; note attributes include pitch, duration, and intensity.

[0025] Adjust the out-of-key tone to the nearest in-key tone to ensure a more harmonious music;

[0026] If there are multiple channels of music, they can be integrated using music synthesis software to form multi-channel stereo brainwave music. These music files can then be used as preliminary real-time brainwave music to participate in the subsequent brainwave sleep-aid music generation process.

[0027] Furthermore, the music style transfer model is a CycleGAN-based music style transfer model;

[0028] CycleGAN consists of two GANs arranged in a cyclical manner and trained consistently. Each GAN consists of a generator G and a discriminator D. The generator is used to produce data that looks real from noise, and the discriminator is used to distinguish the generator's output from real data.

[0029] In the brainwave-based sleep music generation process, real-time brainwave music is domain A, and professional sleep music based on the subject's real-time sleep state from a personal sleep music library is domain B; the CycleGAN generator G... A->B The generator G transfers music samples from domain A to domain B. B->A The music is migrated from domain B to domain A; the output of each generator is connected to a discriminator, namely discriminator D. A With discriminator D B By using a generator to generate music that can confuse the discriminator through discriminative features that need to be learned between domains, the transfer from the source music style to the target music style can be achieved.

[0030] Furthermore, two additional discriminators D are added to the CycleGAN model. A,m With discriminator D B,m This is used to further constrain the generator to learn better high-level features;

[0031] Generator G A->B and generator G B->A It is a generator that bridges two directions: real-time brainwave music and professional sleep-aid music. A and D B These are the discriminators corresponding to these two generators, used to distinguish between genuine and fake generator music and single-source domain music styles;

[0032] M A and M B It is a collection of real-time brainwave music from a personal sleep aid music library, including music for different sleep states and professional sleep aid music, combined with M A and M B Training D A,m Discriminator D B,m These two additional discriminators distinguish between generated music and real-time brainwave music or professional sleep aid music in different sleep states.

[0033] Furthermore, the method for generating brainwave-based sleep-aid music also includes the step of saving the brainwave-based sleep-aid music:

[0034] Based on the sleep state category, the generated brainwave sleep-aid music is stored in the subject's personal brainwave sleep-aid music library;

[0035] The newly generated brainwave sleep-aid music is used to continuously enrich and update the brainwave sleep-aid music library, and participates in subsequent algorithm research and model training, which is conducive to generating higher quality and more effective sleep-aid music in the future.

[0036] The second technical solution adopted in this invention is:

[0037] A brainwave-based sleep-aid music generation device that can regulate sleep states includes:

[0038] The EEG sample acquisition module is used to acquire EEG signals, preprocess the EEG signals, and obtain sleep period samples.

[0039] The sleep state assessment module is used to perform sleep stage analysis on sleep period samples to obtain sleep state;

[0040] The professional music acquisition module is used to retrieve corresponding professional sleep-aid music from the personal brainwave sleep-aid music library based on the obtained sleep state;

[0041] The brainwave music generation module is used to extract features from electroencephalogram (EEG) signals and generate real-time brainwave music based on the extracted features.

[0042] The sleep-aid music generation module is used to input professional sleep-aid music and real-time brainwave music into the music style transfer model, learn the mutual transfer relationship between real-time brainwave music and professional sleep-aid music, and generate brainwave sleep-aid music tailored to the current sleep state.

[0043] The third technical solution adopted in this invention is:

[0044] An electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to realize a brainwave-based sleep-aid music generation method for adjusting sleep state as described above.

[0045] The fourth technical solution adopted in this invention is:

[0046] A computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement a brainwave-based sleep-aid music generation method for adjusting sleep state as described above.

[0047] The fifth technical solution adopted in this invention is:

[0048] A computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions to cause the computer device to perform the method described above.

[0049] The beneficial effects of this invention are as follows: Based on real-time brainwave music and professional sleep-aiding music, this invention generates sleep-aiding brainwave music that regulates the real-time sleep state of the subject. The generated brainwave sleep-aiding music closely matches the real-time brainwave activity during the subject's sleep process, and has a targeted regulatory effect on different sleep states of the subject. At the same time, it has higher artistic and medical professionalism, and has important application value in the field of sleep health. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of the present invention or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a flowchart of the brainwave-assisted sleep music generation method in an embodiment of the present invention;

[0052] Figure 2 This is a schematic diagram of the real-time brainwave music generation method in an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of the brainwave-assisted sleep music generation model in an embodiment of the present invention;

[0054] Figure 4 This is a flowchart illustrating the steps of a method for generating brainwave-assisted sleep music that can adjust sleep state, as described in an embodiment of the present invention. Detailed Implementation

[0055] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0056] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0057] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0058] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.

[0059] To address existing problems, this invention proposes a method for generating brainwave-based sleep-aid music that allows for adjustable sleep states, based on domain transfer. This method selects targeted, professional sleep-aid music according to the subject's real-time sleep state, combines this with real-time brainwave music mapped from electroencephalogram (EEG) signals, and uses a music style transfer model to generate the sleep-aid music. This method overcomes, to some extent, the shortcomings of traditional brainwave music, such as a lack of artistic authenticity and a lack of theoretical support for its sleep-aiding effects. It provides more personalized and professional music-based sleep aids tailored to different stages of the subject's sleep, offering more scientific and high-quality support for their sleep health.

[0060] Example 1

[0061] like Figure 1 and Figure 4 As shown in the figure, this embodiment provides a method for generating brainwave-based sleep-aid music that can adjust sleep state. The method specifically includes the following steps:

[0062] S1. Acquire EEG signals, preprocess the EEG signals, and obtain sleep period samples.

[0063] As one implementation method, the acquired EEG signals are first filtered to remove noise interference and motion artifacts. Next, filtering and amplification methods are used to improve the quality of the EEG signals. Finally, according to the American Association of Sleep Staging Systems (AASM), the processed EEG data is sliced ​​in 30-second intervals to generate multiple sleep period samples for testing. These preprocessing steps effectively improve the quality of the EEG signal data, providing a reliable foundation for subsequent signal analysis and brainwave music generation.

[0064] S2. Perform sleep stage analysis on sleep period samples to obtain sleep status.

[0065] For example, in sleep state determination, an algorithm model is used to analyze the sleep stages of multiple real-time sleep period samples generated after preprocessing in order to determine the user's current sleep state.

[0066] S3. Based on the obtained sleep state, retrieve the corresponding professional sleep-aid music from the personal brainwave sleep-aid music library.

[0067] Professional sleep aid music corresponding to the sleep state is selected from the personal brainwave sleep aid music library. Specifically, based on the subject's real-time sleep state assessment result (obtained from step S2), professional sleep aid music matching the sleep state category is searched in the personal sleep aid music library and participated in the brainwave sleep aid music generation in step S5.

[0068] S4. Extract features from EEG signals and generate real-time brainwave music based on the extracted features.

[0069] In some embodiments, different features extracted from EEG signals are mapped to corresponding music parameters using mapping rules or algorithms. Using these mapped music parameters, we can synthesize music using computer software to create musical works related to the real-time brainwave activity of the subject during sleep, thus participating in the brainwave-assisted sleep music generation in step S5.

[0070] S5. Input professional sleep-aid music and real-time brainwave music into the music style transfer model, learn the mutual transfer relationship between real-time brainwave music and professional sleep-aid music, and generate brainwave sleep-aid music tailored to the current sleep state.

[0071] The professional sleep aid music selected in step S3 and the real-time brainwave music obtained in step S4 are input into the CycleGAN-based music style transfer model to learn the mutual transfer relationship between the real-time brainwave music and the professional sleep aid music, and generate effective sleep aid music for the subject's current sleep state.

[0072] S6. Based on the sleep state category, the generated brainwave sleep-aid music is stored in the subject's personal brainwave sleep-aid music library.

[0073] Save the brainwave-based sleep aid music. Based on sleep state categories, the brainwave-based sleep aid music generated through the above steps is stored in the subject's personal brainwave-based sleep aid music library. Newly generated brainwave-based sleep aid music can continuously enrich and update the library, and participate in subsequent algorithm research and model training, which is beneficial for generating higher-quality and more effective sleep aid music in the future.

[0074] In summary, this embodiment mainly involves three modules: selecting professional sleep-aid music based on real-time sleep status, generating real-time brainwave music, and generating brainwave sleep-aid music. This embodiment uses an algorithmic model to segment EEG data from multiple sleep periods, assesses the subject's sleep state based on the distribution of real-time sleep stages, and selects professional sleep-aid music from the corresponding sleep state category in the individual's sleep-aid music library. Simultaneously, the method maps the subject's real-time brainwave signals into music according to certain mapping rules and algorithms. The professional sleep-aid music tailored to the subject's real-time sleep status and the real-time brainwave music are jointly input into a CycleGAN-based music style transfer model. The generator in the model is further constrained by two additional discriminators, ultimately generating brainwave sleep-aid music that is superior in terms of professionalism in sleep-aiding effects, medical interpretability, and artistic authenticity.

[0075] The following description, in conjunction with the accompanying drawings and specific embodiments, provides supplementary explanations of each module in the above method.

[0076] (1) Sleep status assessment

[0077] The study learns the independent temporal characteristics of each brain channel. Subsequently, each EEG channel is treated as a graph node, and graph neural networks (GNNs) are used to model the spatial topology of the brain, enabling information transmission and convergence between multiple brain channels. By learning the highly discriminative spatiotemporal features of real-time sleep EEG data, the accuracy of sleep staging is improved, thus more accurately determining the subject's real-time sleep state. By observing the distribution of the subject's sleep stages, such as whether the subject experiences multiple awakenings during sleep or difficulty entering N3 or N4 stages to achieve deep sleep, the subject's real-time sleep quality can be assessed, thereby determining their current sleep state.

[0078] It is important to note that the sleep state assessment described above employs a combination of deep CNN networks and graph neural networks (GNNs) to learn spatiotemporal features and obtain sleep staging results. Sleep staging can also be performed using Transformer-based temporal models or other spatiotemporal graph convolutional networks. Furthermore, sleep state assessment can consider other physiological behaviors of the subject during sleep, such as the frequency of snoring. These physiological behaviors can serve as auxiliary indicators to help more accurately assess sleep state. By comprehensively considering these factors, we can gain a more holistic understanding of the subject's sleep, thereby improving the accuracy and reliability of sleep state assessment and generating brainwave-based sleep-aiding music that has a greater promoting effect on sleep health.

[0079] (2) Real-time brainwave music generation

[0080] See Figure 2 During the real-time brainwave music generation process, the statistical characteristics of the subject's real-time brainwave signals are extracted using mathematical algorithms. These characteristics can include parameters such as the frequency, amplitude, and phase of the brainwave signals. Based on these characteristics, the system will automatically map corresponding note attributes, such as pitch, duration, and intensity. Simultaneously, modulation filtering is used to adjust out-of-key tones to the nearest in-key to ensure more harmonious music. If there are multiple channels of music, the system will use music synthesis software to integrate them, creating multi-channel stereo brainwave music. These music files will serve as preliminary brainwave music for subsequent brainwave sleep-aid music generation. By generating music based on the user's real-time brainwave signals, the system more closely matches the subject's brainwave activity, thereby achieving better relaxation and sleep-aiding effects.

[0081] (3) Generation of brainwave-assisted sleep music

[0082] See Figure 3 The music style transfer model used in the brainwave-based sleep-aid music generation process is based on CycleGAN. CycleGAN consists of two GANs arranged cyclically and trained consistently. Each GAN comprises a generator G and a discriminator D. The generator attempts to produce seemingly realistic data from noise, while the discriminator attempts to distinguish the generator's output from real data. The generator G and discriminator D are trained iteratively using a two-person minimax game. The input to the generator is real samples from the source domain.

[0083] In the brainwave-based sleep music generation process, real-time brainwave music is domain A, and professional sleep music based on the subject's real-time sleep state from their personal sleep music library is domain B. The generator G of CycleGAN... A->B The generator G transfers music samples from domain A to domain B. B->A The music is migrated from domain B to domain A. Each generator's output is connected to a discriminator, with discriminator D... AFor example, D A Used to distinguish generator G B->A The generated music is synchronized with real-time brainwave music.

[0084] CycleGAN utilizes a generator to produce music that can confuse the discriminator by learning discriminative features that facilitate transfer between domains, thereby achieving transfer from the source music style to the target music style. However, both real-time brainwave music and professional sleep-aid music contain some unique but low-discriminative features, which the generator can easily construct to try to deceive the discriminator, ultimately producing music with low realism and poor sleep-aiding effects. To address this limitation of CycleGAN, this embodiment adds two additional discriminators D to the CycleGAN model. A,m With D B,m This is used to further constrain the generator to learn better high-level features. Finally, the music generated by the model maintains the basic structure of brainwave music while having a more professional sleep-aiding effect, and the music possesses higher artistry and realism.

[0085] Figure 3 This illustrates the architecture of the music style transfer model used in the brainwave-based sleep-aid music segment. Blue arrows represent music style transfer from real-time brainwave music to professional sleep-aid music, while red arrows represent music style transfer from professional sleep-aid music to real-time brainwave music. A->B and G B->A It is a generator that bridges two directions: real-time brainwave music and professional sleep-aid music. A and D B The discriminators corresponding to these two generators are used to distinguish between genuine and fake generator music and single-source domain music styles. A and M B It contains real-time brainwave music for different sleep states and professional sleep-aid music from a personal sleep music library. Training D A,m and D B,m These two additional discriminators distinguish between generated music and real-time brainwave music or professional sleep aid music for different sleep states, respectively. (And D) A and D B In contrast, they distinguish between generated music and music from multiple domains, not just music from a single target domain. The added discriminator forces the generator to learn higher-level discriminative features related to the domain, constraining the generated music to be closer to real music. In this patent, the generator G... A->B and G B->A With discriminator D A and D B The loss function used is consistent with the loss function of CycleGAN, with an additional discriminator D. A,m and D B,mThe loss function used is consistent with the discriminator in GAN.

[0086] It's important to note that the above-mentioned brainwave-based sleep-aid music generation employs a CycleGAN-based music style transfer model. This model learns the mapping relationship between real-time brainwave music and professional sleep-aid music, ultimately generating more sophisticated brainwave-based sleep-aid music. Alternatively, music generation models such as MusicVAE can be used to achieve the transfer task between real-time brainwave music and professional sleep-aid music.

[0087] In summary, the method of the present invention has at least the following advantages and beneficial effects compared with the prior art:

[0088] (1) The brainwave sleep-aid music generation method of the present invention combines real-time brainwave music during sleep and professional sleep-aid music for specific sleep states, and uses a CycleGAN-based music style transfer model to generate brainwave sleep-aid music with more professional sleep-aid effects and stronger artistry.

[0089] Advantages: Music generated directly from real-time brainwave mapping can reflect brainwave activity during sleep. However, due to the instability and noise of EEG signals, real-time brainwave music lacks the professionalism and medical interpretability of clinically validated sleep-aiding music. Furthermore, music mapped from EEG signals under simple rules often lacks artistic beauty and musicality. This invention combines real-time brainwave music with professional sleep-aiding music tailored to specific sleep states to generate brainwave music that is more professional, has better sleep-aiding effects, and superior artistic appeal. By intervening in brain activity during sleep with high-quality brainwave sleep-aiding music, it improves sleep quality.

[0090] (2) This invention proposes a brainwave sleep-aid music generation model. Based on the CycleGAN music style transfer model, two additional multi-source domain music discriminators are added to further constrain the generator to learn and implement the domain discriminative features of brainwave music and professional-grade sleep-aid music, while promoting the authenticity of the music and improving the quality of brainwave sleep-aid music.

[0091] Advantages: Both real-time brainwave music and professional sleep aid music contain unique but low-discrimination patterns. By focusing on constructing these patterns, the generator can confuse the discriminator during training, but ultimately produces unrealistic, low-quality sleep aid music. This patent adds two additional discriminators to CycleGAN, used to distinguish the generated music from brainwave music and professional sleep aid music in different sleep states. By introducing data from more domains, the direction of music generation is further standardized, producing more realistic-sounding brainwave sleep aid music and providing subjects with higher-quality sleep quality regulation services.

[0092] Example 2

[0093] This embodiment provides a brainwave-based sleep-aid music generation device that can adjust sleep state, including:

[0094] The EEG sample acquisition module is used to acquire EEG signals, preprocess the EEG signals, and obtain sleep period samples.

[0095] The sleep state assessment module is used to perform sleep stage analysis on sleep period samples to obtain sleep state;

[0096] The professional music acquisition module is used to retrieve corresponding professional sleep-aid music from the personal brainwave sleep-aid music library based on the obtained sleep state;

[0097] The brainwave music generation module is used to extract features from electroencephalogram (EEG) signals and generate real-time brainwave music based on the extracted features.

[0098] The sleep-aid music generation module is used to input professional sleep-aid music and real-time brainwave music into the music style transfer model, learn the mutual transfer relationship between real-time brainwave music and professional sleep-aid music, and generate brainwave sleep-aid music tailored to the current sleep state.

[0099] Since this device is an adjustable sleep state brainwave sleep-aid music generation device according to an embodiment of the present invention, and the principle of the device in solving the problem is similar to that of the method, the implementation of this device can refer to the implementation process of the above method embodiment, and the repeated parts will not be described again.

[0100] Example 3

[0101] This invention also provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, a code set, or an instruction set. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to achieve the following: Figure 1 and Figure 4 This illustrates a method for generating brainwave-based sleep-aid music that can regulate sleep patterns.

[0102] It is understood that the memory may include random access memory (RAM) or read-only memory. Optionally, the memory may include non-transitory computer-readable storage medium. The memory can be used to store instructions, programs, code, code sets, or instruction sets. The memory may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the various method embodiments described above, etc.; the stored data area may store data created according to the use of the server, etc.

[0103] A processor may include one or more processing cores. The processor connects to various parts of the server via various interfaces and lines, executing instructions, programs, code sets, or instruction sets stored in memory, and accessing data stored in memory to perform various server functions and process data. Optionally, the processor may be implemented using at least one of the following hardware forms: Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor may integrate one or more of the following: Central Processing Unit (CPU) and Modem. The CPU primarily handles the operating system and applications; the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor.

[0104] Since this electronic device corresponds to the brainwave sleep-aid music generation method for adjustable sleep state in this embodiment of the invention, and the principle of this electronic device in solving the problem is similar to that of this method, the implementation of this electronic device can refer to the implementation process of the above method embodiment, and the repeated parts will not be described again.

[0105] Example 4

[0106] This invention also provides a computer-readable storage medium storing at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to achieve the following: Figure 1 and Figure 4 This illustrates a method for generating brainwave-based sleep-aid music that can regulate sleep patterns.

[0107] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0108] Since this storage medium is the storage medium corresponding to the brainwave sleep-aid music generation method for adjustable sleep state in an embodiment of the present invention, and the principle of the storage medium in solving the problem is similar to that of the method, the implementation of this storage medium can refer to the implementation process of the above method embodiment, and the repeated parts will not be described again.

[0109] Example 5

[0110] In some possible implementations, various aspects of the methods of the embodiments of the present invention can also be implemented as a program product comprising program code that, when run on a computer device, causes the computer device to perform the steps of a method for generating brainwave-based sleep-inducing music that can regulate sleep states, as described above according to various exemplary embodiments of this application. The executable computer program code or "code" used to perform the various embodiments can be written in high-level programming languages ​​such as C, C++, C#, Smalltalk, Java, JavaScript, Visual Basic, Structured Query Language (e.g., Transact-SQL), Perl, or in various other programming languages.

[0111] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0112] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0113] The above embodiments are merely illustrative of the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made based on the essence of the content of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for generating brainwave-based sleep-aid music that can regulate sleep state, characterized in that, Includes the following steps: Acquire EEG signals, preprocess the EEG signals, and obtain sleep period samples; Sleep stage analysis was performed on sleep samples to obtain sleep status; Based on the obtained sleep state, retrieve corresponding professional sleep-aid music from the personal brainwave sleep-aid music library; Features are extracted from electroencephalogram (EEG) signals, and real-time brainwave music is generated based on the extracted features. By inputting professional sleep-aid music and real-time brainwave music into the music style transfer model, the model learns the mutual transfer relationship between real-time brainwave music and professional sleep-aid music, and generates brainwave sleep-aid music tailored to the current sleep state. The process of extracting features from electroencephalogram (EEG) signals and generating real-time brainwave music based on the extracted features includes: The characteristics of the electroencephalogram (EEG) signal are acquired, including the frequency, amplitude, and phase of the brainwave signal. The acquired features are mapped to corresponding note attributes; note attributes include pitch, duration, and intensity. If there are multiple channels of music, use music synthesis software to integrate them to form multi-channel stereo brainwave music. Use these music files as preliminary real-time brainwave music to participate in the subsequent brainwave sleep-aid music generation process. The music style transfer model is a CycleGAN-based music style transfer model. CycleGAN consists of two GANs arranged in a cyclical manner and trained consistently. Each GAN consists of a generator G and a discriminator D. In the brainwave-based sleep music generation process, real-time brainwave music is domain A, and professional sleep music based on the subject's real-time sleep state from a personal sleep music library is domain B; the CycleGAN generator G... A->B The generator G transfers music samples from domain A to domain B. B->A The music is migrated from domain B to domain A; the output of each generator is connected to a discriminator, namely discriminator D. A With discriminator D B By using a generator to generate music that can confuse the discriminator through discriminative features that need to be learned between domains, the transfer from the source music style to the target music style can be achieved.

2. The method for generating brainwave-based sleep-aiding music that can regulate sleep state according to claim 1, characterized in that, The acquisition of electroencephalogram (EEG) signals, the preprocessing of the EEG signals, and the obtaining of sleep period samples include: Acquire EEG signals, and perform filtering operations on the EEG signals to remove noise interference and eliminate motion artifacts; The filtered EEG signals are sliced ​​according to a preset method to generate multiple sleep period samples to be tested.

3. The method for generating brainwave-based sleep-aiding music that can regulate sleep state according to claim 1, characterized in that, The process of analyzing sleep stages in sleep samples to obtain sleep states includes: A pre-trained state assessment model was used to analyze sleep stages in multiple sleep period samples to determine the current sleep state. The state assessment model works as follows: A deep convolutional neural network is used to perform temporal dimensionality reduction on samples from each sleep period to learn channel-independent temporal features. By treating each brainwave channel as a graph node, a graph neural network is used to model the spatial topology of the brain, enabling information transmission and convergence between multiple brain channels. By learning the highly discriminative spatiotemporal features of real-time sleep EEG data, the accuracy of sleep staging can be improved, thereby more accurately determining the real-time sleep state of the subjects.

4. The method for generating brainwave-based sleep-aiding music that can regulate sleep state according to claim 1, characterized in that, Based on the CycleGAN model, two additional discriminators D are added. A,m With discriminator D B,m This is used to further constrain the generator to learn better high-level features; generator G A->B and generator G B->A It is a generator that bridges two directions: real-time brainwave music and professional sleep-aid music. A and D B These are the discriminators corresponding to these two generators, used to distinguish between genuine and fake generator music and single-source domain music styles; M A and M B It is a collection of real-time brainwave music from a personal sleep aid music library, including music for different sleep states and professional sleep aid music, combined with M A and M B Training D A,m Discriminator D B,m These two additional discriminators distinguish between generated music and real-time brainwave music or professional sleep aid music in different sleep states.

5. The method for generating brainwave-based sleep-aiding music that can regulate sleep state according to claim 1, characterized in that, The method for generating brainwave-assisted sleep music also includes the step of saving the brainwave-assisted sleep music: Based on the sleep state category, the generated brainwave sleep-aid music is stored in the subject's personal brainwave sleep-aid music library; The newly generated brainwave-assisted sleep music is used to continuously enrich and update the brainwave-assisted sleep music library, and participates in subsequent algorithm research and model training.

6. A brainwave-based sleep-aid music generation device for adjusting sleep state, applied to the method described in any one of claims 1-5, characterized in that, include: The EEG sample acquisition module is used to acquire EEG signals, preprocess the EEG signals, and obtain sleep period samples. The sleep state assessment module is used to perform sleep stage analysis on sleep period samples to obtain sleep state; The professional music acquisition module is used to retrieve corresponding professional sleep-aid music from the personal brainwave sleep-aid music library based on the obtained sleep state; The brainwave music generation module is used to extract features from electroencephalogram (EEG) signals and generate real-time brainwave music based on the extracted features. The sleep-aid music generation module is used to input professional sleep-aid music and real-time brainwave music into the music style transfer model, learn the mutual transfer relationship between real-time brainwave music and professional sleep-aid music, and generate brainwave sleep-aid music tailored to the current sleep state.

7. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Sleep music playing method and device based on electroencephalogram signals and terminal

    CN113995939A

  • Method and electronic device for providing sleep-inducing music according to user state determined on basis of biosignal

    WO2024228511A1