Personalized music recommendation method and system based on deep learning and brainwave signals
Through the method of combining deep learning with brain wave signals, multi-scale convolution feature extraction and reinforcement learning are used to dynamically adjust the music recommendation strategy, solving the problem of insufficient dynamic adaptability and individual differences in the existing technology, and achieving personalized and real-time music recommendation effects.
Patent Information
- Application Number
- CN202510028508.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-01-08
AI Technical Summary
The existing brain wave music recommendation system has shortcomings in terms of dynamic adaptability, physiological signal processing ability and individual differences, resulting in the mismatch of recommendation effects with user status needs, making it difficult to achieve personalized and real-time dynamic music recommendations.
Using a deep learning-based method, combining EEG and heart rate variability signals, we dynamically adjust the recommendation strategy through multi-scale convolutional feature extraction, autoencoder dimensionality reduction, spherical clustering and reinforcement learning, and optimize personalized music recommendations using deep Q networks.
It improves the personalization and real-time adaptability of music recommendations, enhances the effectiveness and user experience of recommendation strategies, reduces the impact of individual differences on model training, and improves the accuracy and stability of recommendations.
Smart Images

Figure CN119848288B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning, and in particular to a personalized music recommendation method and system based on deep learning and brainwave signals. Background Art
[0002] As a novel neuromodulation technology, brainwave music influences the activity of the human central nervous system through auditory evoked potentials (AEPs) generated by sound waves of specific frequencies. It demonstrates significant application value and development potential in a variety of scenarios, including clinical medicine, mental health, education and training, and personal health management. This technology, based on electroencephalogram (EEG) neurofeedback, utilizes the binaural beat effect to generate EEG activity at specific frequencies, thereby regulating brain function. Existing brainwave music recommendation systems primarily employ analysis methods based on static user characteristics, recommending music content to users using a pre-set rule base or traditional machine learning algorithms. These systems typically construct user profiles based on static features such as basic user information, historical usage data, and subjective reviews, and generate recommendations based on classic recommendation algorithms such as collaborative filtering or content matching. However, in actual applications, due to the dynamic nature of human physiological states and psychological needs, as well as significant individual variability, existing solutions exhibit significant technical limitations in terms of both recommendation effectiveness and user experience. Existing systems are particularly incapable of real-time dynamic adaptation in areas such as immediate stress monitoring and tracking emotional changes, resulting in significant discrepancies between recommended content and the user's current state and needs. Furthermore, in the feature extraction phase, existing technologies are insufficiently capable of processing multimodal physiological signals such as electroencephalograms (EEGs) and heart rate variability, making it difficult to effectively capture and utilize the complex dynamic feature information contained in these signals. This directly limits the effectiveness of personalized recommendation strategies.
[0003] To address the above technical issues, industry researchers have disclosed various improvement proposals. Regarding dynamic adaptability, some studies have employed real-time physiological signal acquisition and rapid response mechanisms, dynamically adjusting recommendation strategies by continuously monitoring changes in user status. Regarding feature extraction, deep learning techniques, such as advanced algorithms like convolutional neural networks (CNNs) and recurrent neural networks (RNNs), have been introduced to improve the processing of multimodal physiological signals. Simultaneously, some studies have begun to apply reinforcement learning to policy optimization in recommendation systems, optimizing recommendation decisions through the continuous interaction of intelligent agents with their environments. Regarding addressing individual differences, cold-start optimization schemes based on transfer learning have been disclosed, attempting to accelerate model convergence through knowledge transfer. However, these improvement proposals still face technical bottlenecks and limitations. First, the acquisition and processing of real-time physiological signals is subject to significant noise interference and data quality issues, which affect system stability and reliability. Second, deep learning models face challenges such as high computational complexity and large training sample requirements when processing high-dimensional and nonlinear physiological signals. Furthermore, reinforcement learning algorithms suffer from slow convergence and high exploration costs in practical applications. This makes it difficult to find the optimal recommendation strategy within a limited timeframe, especially when the user state space is large. Finally, cold-start optimization schemes based on transfer learning often fail to achieve ideal knowledge transfer when there are significant differences between the source and target domains, resulting in limited improvements in model performance. These technical issues severely restrict the practical application and promotional value of brainwave music recommendation systems.
[0004] Therefore, there is an urgent need for a technical solution that can improve the matching degree between music recommendations and the user's current physiological state and enhance the personalization and effectiveness of recommendations. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention discloses a personalized music recommendation method and system based on deep learning and brainwave signals. This application solves the technical problems of existing technologies such as poor dynamic adaptability and a single recommendation strategy.
[0006] An embodiment of the present application discloses a personalized music recommendation method based on deep learning and brain wave signals, including: collecting physiological signals of users when wearing electroencephalogram (EEG) equipment and heart rate monitoring equipment, filtering and segmenting the collected signals for preprocessing, and generating a time-frequency matrix; performing multi-scale convolution feature extraction on the preprocessed matrix, combining the time domain and frequency domain features of heart rate variability data, and reducing the dimension through an autoencoder to form a feature vector; calculating the sample similarity matrix based on the reduced feature vector, performing spherical clustering grouping, constructing and initializing the state-action value table for each category; inputting the feature vector into the constructed deep network, using priority experience replay to store interaction data, and performing parameter updates and gradient clipping; collecting users' ratings of recommended music and changes in physiological signals, re-clustering based on the newly added data, and dynamically adjusting the clustering structure.
[0007] In one possible implementation, physiological signals of a user wearing an electroencephalogram (EEG) device and a heart rate monitoring device are collected, and the collected signals are filtered and segmented for preprocessing to generate a time-frequency matrix, including: fixing the EEG acquisition device on the user's forehead and wearing the heart rate monitoring device on the user's wrist; collecting EEG signals and heart rate data of the user in a natural and relaxed state, and continuously collecting for a preset time; performing wavelet transform denoising on the collected EEG signals, and using a bandpass filter to remove power frequency interference; segmenting the filtered EEG signals according to a preset length and setting the overlap rate; identifying the peak position of the heart rate variability data, calculating the continuous interval sequence, and eliminating outliers; and reconstructing the processed EEG signals into a time-frequency matrix form.
[0008] In one possible implementation, multi-scale convolution feature extraction is performed on the preprocessed matrix, and the time domain and frequency domain features of the heart rate variability data are combined to form a feature vector through dimensionality reduction by an autoencoder, including: using multi-scale convolution kernels to extract local features of different frequency bands to generate feature maps; inputting the feature maps into a long short-term memory network to capture the dynamic changes of features over time; extracting time domain features and frequency domain features of the heart rate variability data; combining EEG features and heart rate variability features to form a mixed feature vector; and using a divergence-based autoencoder to reduce the dimensionality of the mixed feature vector.
[0009] In one possible implementation, a sample similarity matrix is calculated based on the eigenvector after dimensionality reduction, spherical clustering grouping is performed, and a state-action value table for each category is constructed and initialized, including: using an improved spherical clustering algorithm to group users based on the eigenvector after dimensionality reduction; calculating the cosine similarity matrix between samples, and determining the number of clusters by maximizing the silhouette coefficient; randomly selecting the initial class center, calculating the similarity between the sample and the class center for distribution; constructing an independent state-action value table for each user category; setting the exploration rate using a cosine annealing strategy, and calculating the initial value based on the mean value of the sample features within the class.
[0010] In one possible implementation, the feature vector is input into the constructed deep network, priority experience replay is used to store interaction data, and parameter updates and gradient clipping are performed, including: inputting the real-time feature vector into the deep state action value network for policy optimization; constructing a main network and a target network with a multi-layer fully connected structure; using a priority experience replay mechanism to store interaction data; using a loss function to update parameters and perform norm clipping on the gradient value; adding parameterized Gaussian noise to the network weights, and gradually reducing the noise standard deviation during training.
[0011] In one possible implementation, users' ratings of recommended music and changes in physiological signals are collected, and clustering is performed based on the newly added data, and the clustering structure is dynamically adjusted, including: satisfaction rating of recommended music and recording real-time changes in users' physiological signals during music playback; re-clustering users based on feedback data and adjusting groupings; using the nearest neighbor matching method for new users to select reference users; and performing splitting or merging operations when the cluster group reaches a preset threshold.
[0012] In one possible implementation, a multi-scale convolution kernel is used to extract local features of different frequency bands to generate a feature map, including: setting the convolution kernels of the first branch and the second branch, the convolution kernel size of the first branch is a first preset value, and the convolution kernel size of the second branch is a second preset value; setting a preset number of convolution kernels for multiple frequency bands in the brain waves, respectively, the multiple frequency bands including the δ band, the θ band, the α band, the β band and the γ band; connecting a rectified linear unit activation function after each of the convolution layers, the activation function selects the maximum value output; cascading the feature maps extracted by the first branch and the second branch in the channel dimension to obtain a feature map sequence.
[0013] In one possible implementation, an improved spherical clustering algorithm is used to group users based on the feature vectors after dimensionality reduction, including: calculating the cosine similarity between multiple groups of two target feature vectors to construct a cosine similarity matrix between samples; calculating the average distance between each sample and other samples in the same cluster and the average distance to the nearest other cluster to obtain a silhouette coefficient; traversing the cluster values within a preset range and selecting the cluster value corresponding to the largest silhouette coefficient.
[0014] An embodiment of the present application also discloses a system for applying the personalized music recommendation method as described in any of the above embodiments, including: a signal input and preprocessing module, a feature extraction module, a user clustering and grouping module, a recommendation strategy initialization module, a recommendation and reinforcement learning optimization module, and a user feedback and system optimization module; wherein, the signal input and preprocessing module is used to collect target signals for denoising, filtering and standardization processing; the feature extraction module is used to extract features of the processed signals through a deep neural network; the user clustering and grouping module is used to group users according to feature vectors using a clustering algorithm; the recommendation strategy initialization module is used to initialize the recommendation strategy based on user grouping information and historical playback records; the recommendation and reinforcement learning optimization module is used to combine the extracted features and user feedback to optimize the recommendation strategy using a deep Q network; the user feedback and system optimization module is used to collect feedback data to optimize system parameters.
[0015] An embodiment of the present application also discloses a personalized music recommendation device based on deep learning and brainwave signals, comprising: a processor, a memory, and a system bus; wherein the processor and the memory are connected via the system bus; the memory is used to store one or more programs, and the one or more programs include instructions, which, when executed by the processor, enable the processor to execute the method described in any one of the above embodiments.
[0016] In the disclosed method, system, and device for personalized music recommendation based on deep learning and brainwave signals, embodiments of the present application utilize a deep neural network model combining CNN and LSTM to efficiently extract the complex dynamic features of multimodal physiological signals (EEG, HRV), enabling comprehensive characterization of a user's real-time physiological state. Furthermore, in some embodiments, a clustering algorithm is used to group users based on their physiological signal characteristics and initial preferences, reducing the impact of individual differences on model training and improving the effectiveness of the recommendation strategy and the speed of model convergence. Furthermore, in some embodiments, Q-learning is used for policy initialization during the cold start phase, and as the amount of data increases, a deep Q-network (DQN) is gradually transitioned to policy optimization. This hybrid reinforcement learning strategy can improve the accuracy and personalization of recommendations. Furthermore, in some embodiments, a multi-dimensional reward function is designed by comprehensively considering the user's subjective satisfaction score and objective physiological signal changes, ensuring that the recommendation strategy meets the personalized needs of the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 This is a flowchart of a personalized music recommendation method based on deep learning and brainwave signals disclosed in an embodiment of the present application;
[0019] Figure 2 This is a schematic block diagram of a personalized music recommendation system disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0020] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0021] Those skilled in the art will understand that the terms "first", "second" and the like in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and do not represent any specific technical meaning, nor do they represent the necessary logical order between them. It should also be understood that in the embodiments of the present disclosure, "multiple" may refer to two or more, and "at least one" may refer to one, two or more. It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly defined or given a contrary revelation in the context. In addition, the term "and / or" in the present disclosure is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship. It should also be understood that the description of each embodiment in the present disclosure emphasizes the differences between the embodiments, and the same or similar aspects thereof can be referenced to each other. For the sake of brevity, they will not be described one by one.
[0022] At the same time, it should be understood that for ease of description, the dimensions of the various parts shown in the drawings are not drawn according to the actual proportional relationship. The following description of at least one exemplary embodiment is actually only illustrative and is in no way intended to limit the present disclosure and its application or use. Technologies, methods and equipment known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods and equipment should be considered part of the specification. It should be noted that similar numbers and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further discussed in subsequent figures.
[0023] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0024] Figure 1 This is a flowchart of a personalized music recommendation method based on deep learning and brainwave signals disclosed in an embodiment of the present application.
[0025] like Figure 1 As shown, in step S101, physiological signals of the user wearing an EEG device and a heart rate monitor are collected, and the collected signals are filtered and segmented to generate a time-frequency matrix. This includes: fixing the EEG acquisition device to the user's forehead and wearing the heart rate monitor on the user's wrist; collecting EEG signals and heart rate data from the user in a natural and relaxed state for a preset time period; performing wavelet transform denoising on the collected EEG signals and using a bandpass filter to remove power frequency interference; segmenting the filtered EEG signals according to a preset length and setting the overlap rate; identifying the peak position of the heart rate variability data, calculating the continuous interval sequence, and eliminating outliers; and reconstructing the processed EEG signals into a time-frequency matrix.
[0026] In one embodiment, a portable EEG forehead patch can be attached to the user's forehead, while a portable heart rate monitoring bracelet or ring is worn on the user's wrist or finger. The EEG signal acquisition device is lightweight and easy to wear, with a sampling frequency of 512Hz and high precision and low noise. The heart rate monitoring device features high-precision heart rate monitoring, a sampling frequency of 250Hz, and real-time monitoring and recording of HRV data. During data acquisition, the user maintains a relaxed state, and each acquisition lasts for 180 seconds. The collected EEG signal is first denoised using a wavelet transform, with a bandpass filter set to a frequency range of 0.5-45Hz to remove power frequency interference. The filtered signal is segmented, each segment being 2 seconds long with an overlap rate of 50%. For the heart rate variability data, the R wave peak location is accurately identified, and the continuous RR interval sequence is calculated, with outliers outside the mean ±3 standard deviations being removed. The processed EEG signal is reconstructed into a time-frequency matrix, where n is the number of time segments and m is the number of frequency components.
[0027] In step S102, multi-scale convolution feature extraction is performed on the preprocessed matrix. Combined with the time-domain and frequency-domain features of the heart rate variability data, the matrix is then reduced in dimension using an autoencoder to form a feature vector. This includes: using multi-scale convolution kernels to extract local features from different frequency bands to generate feature maps; inputting the feature maps into a long-short-term memory network to capture the dynamic changes of features over time; extracting time-domain and frequency-domain features from the heart rate variability data; combining EEG features and heart rate variability features to form a mixed feature vector; and using a divergence-based autoencoder to reduce the dimensionality of the mixed feature vector.
[0028] Specifically, a multi-scale convolution kernel is used to extract local features from different frequency bands on the preprocessed EEG matrix. The convolution kernel size is set to 3×3 and 5×5, with a stride of 1, and the ReLU activation function is used to capture the changing patterns in frequency and time. A feature map of shape (n, k) is generated, where k is the number of extracted features, representing the comprehensive information of different frequency bands. The feature map is input into the LSTM network to capture the dynamic changes of features over time and understand the temporal dependencies of the user's physiological signals. The LSTM network generates a time series feature vector (1, k) for subsequent recommendation strategy decisions. For HRV data, time domain features such as SDNN, RMSSD, and pNN50, as well as frequency domain features such as LF, HF, and LF / HF ratio are extracted. EEG features and HRV features are combined to form a mixed feature vector, which is then subjected to dimensionality reduction to remove redundant information and retain the most recognizable feature combinations.
[0029] Among them, a multi-scale convolution kernel is used to extract local features of different frequency bands to generate a feature map, including: setting the convolution kernels of the first branch and the second branch, the convolution kernel size of the first branch is a first preset value, and the convolution kernel size of the second branch is a second preset value; setting a preset number of convolution kernels for multiple frequency bands in the brain waves, respectively, the multiple frequency bands including the δ band, the θ band, the α band, the β band and the γ band; connecting a rectified linear unit activation function after each of the convolution layers, the activation function selects the maximum value output; cascading the feature maps extracted by the first branch and the second branch in the channel dimension to obtain a feature map sequence.
[0030] In one embodiment, a dual-branch multi-scale convolution structure is used to extract features from the EEG signal in the form of a preprocessed time-frequency matrix. The first branch uses a 3×3 convolution kernel, and the second branch uses a 5×5 convolution kernel. The step size of both branches is set to 1. 32 different convolution kernels are set for the δ band (0.5-4Hz), θ band (4-8Hz), α band (8-13Hz), β band (13-30Hz), and γ band (30-45Hz). A ReLU activation function f(x)=max(0,x) is connected after each convolution layer. The feature maps extracted by the two branches are cascaded in the channel dimension to obtain a feature map with a shape of (n, 320), where n is the number of time periods and 320 is the total number of features extracted by the two branches.
[0031] A bidirectional LSTM network is used to process the feature map sequence. The network structure consists of two stacked LSTM layers, each containing 128 hidden units. At time t, the hidden state update of the forward LSTM layer is calculated as follows: Where W is the weight matrix, b is the bias term, σ is the sigmoid activation function, and ⊙ represents element-wise multiplication. The backward LSTM layer uses the same computational approach, but processes the sequence in reverse order. The final hidden states in both directions are concatenated to produce a 256-dimensional feature vector.
[0032] For HRV data, time-domain features were first calculated: SDNN is the standard deviation of consecutive RR intervals; RMSSD is the root mean square of the difference between adjacent RR intervals; and pNN50 is the percentage of adjacent RR intervals with a difference greater than 50 ms. The power spectral density was calculated using the Welch method, defining the low-frequency component (LF) as the energy in the 0.04-0.15 Hz band and the high-frequency component (HF) as the energy in the 0.15-0.4 Hz band. The LF / HF ratio was then calculated. All HRV features were combined into a 64-dimensional vector. The 256-dimensional EEG feature vector output by the LSTM network was concatenated with the 64-dimensional HRV feature vector to obtain a 320-dimensional mixed feature vector. Dimensionality reduction was performed using an autoencoder based on KL divergence. Both the encoder and decoder were three-layer fully connected networks with 256, 128, and 64 hidden units, respectively. A LeakyReLU activation function with α = 0.2 was used to obtain the final 64-dimensional feature vector.
[0033] In step S103, a sample similarity matrix is calculated based on the reduced eigenvectors, spherical clustering is performed, and a state-action value table for each category is constructed and initialized. This includes: using an improved spherical clustering algorithm to group users based on the reduced eigenvectors; calculating the cosine similarity matrix between samples and determining the number of clusters by maximizing the silhouette coefficient; randomly selecting initial cluster centers and calculating the similarity between samples and the cluster centers for allocation; constructing a separate state-action value table for each user category; setting the exploration rate using a cosine annealing strategy and calculating the initial value based on the mean of the sample features within the class.
[0034] Specifically, based on the user physiological signals and historical preference data extracted through preliminary features, the K-means clustering algorithm is used to group users. First, the optimal K value is determined through indicators such as the silhouette coefficient, and different initial strategies are set for each group. In the early stages of system startup, due to the lack of sufficient user interaction data, the Q-learning algorithm is used to initialize the strategy. A higher exploration rate is set initially to promote diversified exploration of strategies. As user interaction data accumulates and the system gradually understands user preferences, the exploration rate is gradually reduced and the utilization rate of strategies is increased to improve the accuracy of recommendations and user satisfaction. Utilizing user grouping information, different initial strategies are set according to the characteristics of different groups during the Q-learning initialization phase to ensure that the recommendation strategy is more targeted and to avoid model convergence difficulties caused by excessive individual differences.
[0035] Furthermore, an improved spherical clustering algorithm is used to group users based on the feature vectors after dimensionality reduction, including: calculating the cosine similarity between multiple groups of two target feature vectors to construct a cosine similarity matrix between samples; calculating the average distance between each sample and other samples in the same cluster and the average distance to the nearest other cluster to obtain the silhouette coefficient; traversing the cluster values within a preset range, and selecting the cluster value corresponding to the largest silhouette coefficient.
[0036] In one embodiment, the improved spherical K-means clustering algorithm is used to group users on the 64-dimensional reduced dimension feature vector. First, the cosine similarity matrix S between samples is calculated. For any two feature vectors and ,calculate The number of clusters K is determined by maximizing the silhouette coefficient. The silhouette coefficient calculation formula is: ,in is the average distance between sample i and other samples in the same cluster, is the average distance between sample i and the nearest cluster. Based on the sample distribution characteristics, the K value is set in the range of 2-8 and the K value corresponding to the maximum silhouette coefficient is selected.
[0037] For the determined K clusters, spherical K-means clustering is performed. First, K samples are randomly selected as the initial class centers. For each sample x, its cosine similarity with each class center is calculated, and it is assigned to the class with the largest similarity. When updating the class center, all sample vectors in the kth class are summed and L2 normalized to obtain the new class center. Repeat the sample allocation and center update steps until the category division does not change or the maximum number of iterations is reached.
[0038] In the strategy initialization phase, a Q-learning algorithm with prioritized experience replay is used. An independent Q table is constructed for each user category k, and the action space A contains different combinations of music features. The Q value update formula is , where the learning rate α is set to 0.1 and the decay coefficient γ is set to 0.95. The exploration rate ε uses the cosine annealing strategy, with the initial value set to 0.9. Decrease, where t is the current number of interactions and T is the preset annealing period. Set different initial values for the Q table for each category. The initial Q value is calculated based on the feature mean of the samples within the category. ,in is the class-specific weight matrix.
[0039] At step S104, the feature vector is input into the constructed deep network, and priority experience replay is used to store interaction data, and parameter updates and gradient clipping are performed. This includes: inputting the real-time feature vector into the deep state-action-value network for policy optimization; constructing a master network and a target network with a multi-layer fully connected structure; using a priority experience replay mechanism to store interaction data; using a loss function for parameter updates and norm clipping of gradient values; and adding parameterized Gaussian noise to the network weights, gradually reducing the noise standard deviation during training.
[0040] In one embodiment, extracted real-time EEG and HRV feature vectors are fed into a deep Q-network (DQN). As the system accumulates sufficient user interaction data and feedback, it switches from Q-learning to DQN for policy optimization. The system dynamically determines whether to use Q-learning or DQN based on the amount of real-time data and user feedback, ensuring that the most appropriate reinforcement learning algorithm is used for recommendation policy optimization at each data stage. During the cold start phase, the Q-learning algorithm is used for policy initialization, combining a high exploration rate and user clustering information to rapidly accumulate user preference data. As user interaction data increases, the exploration rate is gradually reduced to improve policy utilization. When the system detects that the data volume reaches a preset threshold, it automatically transitions from Q-learning to DQN, leveraging DQN's advantages in large-scale data environments to improve the overall performance of the recommendation system. Whether using Q-learning or DQN, the system continuously collects user feedback and dynamically adjusts model parameters and reward functions to ensure that the recommendation strategy always matches the user's needs and physiological state.
[0041] Furthermore, in another embodiment, a 64-dimensional feature vector can be used as the state input to construct a two-stream deep Q network. The main network adopts a four-layer fully connected structure, with the number of neurons in each layer being 256, 128, 64, and |A|, where |A| is the size of the action space. A dropout layer is inserted between the second and third layers with a dropout rate of 0.3. The target network has the same structure and is used to calculate the target Q value. The target network parameters are updated every 1000 interactions. When the amount of user interaction data exceeds the preset threshold of 8192, the switch from Q-learning to DQN is triggered.
[0042] The priority experience replay mechanism is used to store interaction data. For each interaction sample (s, a, r, s'), its priority is calculated. ,in is the TD error, and ε=0.01 is a small constant to prevent the priority from being zero. Sampling is performed, where α=0.6 controls the influence of priority. Each sampling consists of 512 samples to form a mini-batch.
[0043] The loss function adopts the form of double Q learning: ,in The importance sampling weights are calculated, with β increasing linearly from 0.4 to 1. The Adam optimizer is used for parameter updates, with an initial learning rate of 0.001 and a learning rate decay of 0.8 every 50,000 steps. To prevent gradient explosion, gradients are clipped, with a maximum norm of 10. During training, the Noisy Net mechanism is used to add parameterized Gaussian noise to each layer's weights. The standard deviation of the noise starts at 0.5 and is gradually reduced to 0.1 during training.
[0044] In step S105, the system collects user ratings of recommended music and physiological signal changes, re-clusters based on the newly added data, and dynamically adjusts the cluster structure. This includes: assigning satisfaction ratings to recommended music and recording real-time changes in users' physiological signals during music playback; re-clustering users and adjusting groupings based on feedback data; selecting reference users for new users using the nearest neighbor matching method; and splitting or merging clusters when they reach a preset threshold.
[0045] Preferably, a satisfaction score is given to the recommended music through a mobile device, ranging from 1 to 5 points, and the real-time data changes of the user's EEG and HRV during music playback are recorded. The subjective feedback is combined with the objective physiological signal changes to evaluate the effectiveness of the current recommendation strategy. Based on the feedback data, the users are re-clustered to ensure the effectiveness of the grouping and the pertinence of the recommendation strategy. When three consecutive recommendations are detected to be ineffective, the exploration rate is temporarily increased. When the success rate of a certain type of music recommendation is lower than the preset threshold, its Q value is appropriately lowered. The nearest neighbor matching method is used for new users, and reference users are selected based on the similarity of physiological characteristics, and the weighted average of their Q tables is used as the initial value. Users are re-clustered every 100 times of new interaction data. When the number of cluster group samples or the distance between groups reaches the preset threshold, a split or merge operation is performed to dynamically adjust the cluster structure. The system optimizes the deep Q network through continuous reinforcement learning training to achieve adaptive optimization of the recommendation strategy.
[0046] Figure 2 This is a schematic block diagram of a personalized music recommendation system disclosed in an embodiment of the present application. It should be understood that the system shown in the figure is exemplary and not restrictive. This means that the system architecture involved is not limited to a specific form or design, but is presented as an example. In other words, the architecture shown in the figure can be regarded as a way of expression to clearly describe related concepts and relationships, and does not exclude other forms of architecture. Therefore, when interpreting the architecture in the picture, it should be understood that the model is flexible and diverse, and its purpose is to disclose an exemplary description rather than a restrictive provision on a specific form.
[0047] Specifically, the present embodiment discloses a personalized brainwave music recommendation system, primarily consisting of the following modules: a signal input and preprocessing module 201, responsible for collecting the user's EEG and HRV signals, performing denoising, filtering, and normalization processing to generate signal data suitable for subsequent feature extraction. A feature extraction module 202, employing a CNN-LSTM deep neural network, extracts frequency and time domain features from the preprocessed multimodal physiological signals, generating high-dimensional feature vectors. A user clustering and grouping module 203, utilizing clustering algorithms (such as K-means or hierarchical clustering), groups users based on physiological signal characteristics and initial preferences, mitigating the impact of individual differences on model training. A recommendation strategy initialization module 204, utilizing a Q-learning algorithm based on user grouping information and historical playback records, initializes the recommendation strategy and provides an initial music recommendation scheme. A recommendation and reinforcement learning optimization module 205, combining real-time extracted features with user feedback, employs a deep Q-network (DQN) to continuously optimize the recommendation strategy, achieving dynamic and personalized music recommendations. The user feedback and system optimization module 206 collects users' subjective feedback (such as satisfaction scores) and objective feedback (such as changes in physiological signals), and dynamically adjusts system parameters and reinforcement learning models to improve recommendation accuracy and user experience.
[0048] Furthermore, an embodiment of the present application also discloses a personalized brainwave music recommendation device, comprising: a processor, a memory, and a system bus; the processor and the memory are connected via the system bus; the memory is used to store one or more programs, and the one or more programs include instructions, which, when executed by the processor, enable the processor to execute any of the above methods.
[0049] Furthermore, an embodiment of the present application also discloses a computer program product, which, when running on a terminal device, enables the terminal device to execute any one of the above-mentioned processing methods.
[0050] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in each embodiment of the present application or certain parts of the embodiments.
[0051] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the methods.
[0052] It should also be noted that, in the embodiments of the present application, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device comprising the elements.
[0053] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the embodiments of the present application may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown in the embodiments of the present application, but rather will conform to the widest scope consistent with the principles and novel features disclosed in the embodiments of the present application.
Claims
1. A personalized music recommendation method based on deep learning and brainwave signals, characterized in that: include: Collect physiological signals from users wearing EEG and heart rate monitoring devices, perform filtering and segmentation preprocessing on the collected signals, and generate a time-frequency matrix; Multi-scale convolution feature extraction is performed on the preprocessed matrix, and the time domain and frequency domain features of the heart rate variability data are combined to form a feature vector through dimensionality reduction using an autoencoder; Calculate the sample similarity matrix based on the eigenvector after dimensionality reduction, perform spherical clustering, and construct and initialize the state-action value table for each category, including: An improved spherical clustering algorithm is used to group users based on the feature vector after dimension reduction; Calculate the cosine similarity matrix between samples and determine the number of clusters by maximizing the silhouette coefficient; Randomly select the initial class center, calculate the similarity between the sample and the class center for distribution; Construct an independent state-action-value table for each user category; The exploration rate is set to use the cosine annealing strategy, and the initial value is calculated based on the mean of the sample features within the class; The feature vector is input into the constructed deep network, and the interaction data is stored using priority experience replay. Parameter updates and gradient clipping are performed, including: Input the real-time feature vector into the deep state-action-value network for policy optimization; Build a main network and target network with multi-layer fully connected structures; Use priority experience replay mechanism to store interaction data; Use the loss function to update the parameters and perform norm clipping on the gradient value; Add parameterized Gaussian noise to the network weights and gradually reduce the noise standard deviation during training; Collect users' ratings of recommended music and changes in physiological signals, re-cluster based on the newly added data, and dynamically adjust the clustering structure.
2. The personalized music recommendation method according to claim 1, characterized in that in, Collect physiological signals from users wearing EEG and heart rate monitoring devices, perform filtering and segmentation preprocessing on the collected signals, and generate a time-frequency matrix, including: Fix the EEG acquisition device on the user's forehead and wear the heart rate monitoring device on the user's wrist; Collect EEG signals and heart rate data from users in a naturally relaxed state for a preset period of time; The collected EEG signals were subjected to wavelet transform denoising and bandpass filter was used to remove power frequency interference; The filtered EEG signal is segmented according to the preset length and the overlap rate is set; Identify the peak position of heart rate variability data, calculate the continuous interval sequence, and eliminate outliers; The processed EEG signal is reconstructed into a time-frequency matrix form.
3. The personalized music recommendation method according to claim 1, characterized in that in, Perform multi-scale convolution feature extraction on the preprocessed matrix, combine the time domain and frequency domain features of the heart rate variability data, and use the autoencoder to reduce the dimension to form a feature vector, including: Use multi-scale convolution kernels to extract local features of different frequency bands and generate feature maps; The feature map is input into the long short-term memory network to capture the dynamic changes of features over time; Extract time domain features and frequency domain features from heart rate variability data; Combining EEG features and heart rate variability features to form a mixed feature vector; A divergence-based autoencoder is used to reduce the dimensionality of the mixed feature vector.
4. The personalized music recommendation method according to claim 1, wherein: in, Collect user ratings of recommended music and changes in physiological signals, re-cluster based on the newly added data, and dynamically adjust the clustering structure, including: Score the satisfaction of recommended music and record the real-time changes in the user's physiological signals during music playback; Re-cluster users based on feedback data and adjust grouping; For new users, the nearest neighbor matching method is used to select reference users; When the cluster group reaches the preset threshold, a split or merge operation is performed.
5. The personalized music recommendation method according to claim 3, characterized in that: in, Use multi-scale convolution kernels to extract local features in different frequency bands and generate feature maps, including: Setting the convolution kernels of the first branch and the second branch, wherein the convolution kernel size of the first branch is a first preset value, and the convolution kernel size of the second branch is a second preset value; Setting a preset number of convolution kernels for a plurality of frequency bands in the brain wave, respectively, the plurality of frequency bands including a delta band, a theta band, an alpha band, a beta band, and a gamma band; Connecting a rectified linear unit activation function after each convolution kernel, wherein the activation function selects the maximum value output; The feature maps extracted by the first branch and the second branch are cascaded in the channel dimension to obtain a feature map sequence.
6. The personalized music recommendation method according to claim 1, characterized in that: in, An improved spherical clustering algorithm is used to group users based on the feature vector after dimensionality reduction, including: Calculate the cosine similarity between multiple sets of two target feature vectors and construct the cosine similarity matrix between samples; Calculate the average distance between each sample and other samples in the same cluster and the average distance between each sample and the nearest cluster to obtain the silhouette coefficient; Traverse the cluster values within the preset range and select the cluster value corresponding to the largest silhouette coefficient.
7. A system using the personalized music recommendation method according to any one of claims 1 to 6, characterized in that: include: Signal input and preprocessing module, feature extraction module, user clustering and grouping module, recommendation strategy initialization module, recommendation and reinforcement learning optimization module and user feedback and system optimization module; among them, The signal input and preprocessing module is used to collect target signals for denoising, filtering and standardization; The feature extraction module is used to extract features from the processed signal through a deep neural network; The user clustering and grouping module is used to group users using a clustering algorithm based on feature vectors; The recommendation strategy initialization module is used to initialize the recommendation strategy based on user group information and historical playback records; The recommendation and reinforcement learning optimization module is used to combine the extracted features and user feedback and use a deep Q network to optimize the recommendation strategy; The user feedback and system optimization module is used to collect feedback data to optimize system parameters.
8. A personalized music recommendation device based on deep learning and brainwave signals, characterized in that: include: A processor, a memory, and a system bus; wherein the processor and the memory are connected via the system bus; The memory is configured to store one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by the processor, the processor is enabled to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Music recommendation method and device fusing physiological and psychological feedback
CN118708755A