A personalized music recommendation method and device for user mood improvement

By extracting features from music audio and text data, and using LSTM models and care factors to adjust recommendation results, this approach addresses the problem of traditional music recommendation systems neglecting the influence of emotions. It achieves personalized, emotion-oriented music recommendations, alleviates negative psychological effects and 'information cocoons,' and meets users' emotional needs.

CN122489795APending Publication Date: 2026-07-31RENMIN UNIVERSITY OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
RENMIN UNIVERSITY OF CHINA
Filing Date
2026-05-08
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Traditional music recommendation systems ignore the potential impact of music on users' emotions, which may lead to negative psychological effects and easily create 'information cocoons,' making it difficult to recommend new music.

Method used

By extracting the audio and text data features of music, the recommendation results are adjusted using an LSTM model and a care factor to recommend music with positive emotional orientation. Multimodal deep learning technology is also employed, taking into account the user's current psychological state and preferences.

Benefits of technology

It enables the recommendation of music that helps improve a user's mental state based on their emotional state, reducing negative impacts, avoiding the 'information cocoon' effect, and providing personalized emotional support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122489795A_ABST
    Figure CN122489795A_ABST
Patent Text Reader

Abstract

This invention proposes a personalized music recommendation method and apparatus for improving user emotions. The method includes: extracting initial emotional features and initial genre features for each piece of music based on audio and text data related to the target user; inputting the initial emotional features and initial genre features of each piece of music into a trained LSTM model to obtain the target emotional features and target genre features for the target user; adjusting the target emotional features and target recommended genres using a preset care factor to obtain adjusted emotional features and adjusted genre features; and selecting target music from a candidate music library based on the adjusted emotional features and adjusted genre features, and recommending the target music to the target user. This invention proactively guides user emotions towards a positive direction, helping users break free from a cycle of singular emotions and music genres, alleviating "information cocoons," and reducing potential negative psychological impacts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a personalized music recommendation method and apparatus for improving user mood. Background Technology

[0002] Traditional music recommendation algorithms often focus on data such as a user's historical playlists and playback behavior to predict their personalized preferences and make targeted music recommendations. While this approach can satisfy users' listening habits to some extent, it can also easily lead to the "information cocoon" effect, where users repeatedly receive the same type of music recommendations, making it difficult for them to discover new music content and limiting their horizons.

[0003] More importantly, music is inextricably linked to people's emotional states. Most existing recommendation systems ignore the potential impact of music on users' emotions, and may even have negative effects. For example, continuously recommending sad songs to users who are feeling down could exacerbate their depression and, in extreme cases, even trigger undesirable behaviors. Currently, some mainstream online music platforms are facing criticism from users who believe their recommended content may cause emotional distress.

[0004] Therefore, developing a music recommendation system that can not only understand users' listening preferences but also gain insights into their emotional needs and proactively recommend music that helps improve their psychological state has significant practical implications and application value. Summary of the Invention

[0005] This invention provides a personalized music recommendation method and device for improving user emotions. Its main purpose is to proactively guide users' emotions in a positive direction, helping users break out of a cycle of single emotions and music types, alleviate "information cocoons," and reduce potential negative psychological impacts.

[0006] In a first aspect, embodiments of the present invention provide a personalized music recommendation method for improving user mood, comprising:

[0007] S1, based on the audio and text data of each piece of music related to the target user, extract the initial emotional features and initial genre features of each piece of music.

[0008] S2, input the initial emotional features and initial genre features of each piece of music into the trained LSTM model to obtain the target emotional features and target genre features of the target user;

[0009] S3, adjust the target emotional features and the target recommended genre using preset care factors to obtain the adjusted emotional features and the adjusted genre features;

[0010] S4. Based on the adjusted emotional features and adjusted genre features, select target music from the candidate music library and recommend the target music to the target user;

[0011] The care factor is used to control the degree of positive deviation between the emotional attributes of the target music and the current psychological state of the target user.

[0012] Further, step S1 includes:

[0013] S111, obtain every piece of music played during the first preset historical time period of the target user and every piece of music liked by the target user during the second preset historical time period;

[0014] S112, Based on the audio data of each piece of music, extract the underlying acoustic features of each piece of music, and perform emotional mapping on the underlying acoustic features of each piece of music to obtain the acoustic emotional features of each piece of music.

[0015] S113. Based on the text data of each piece of music, word segmentation, word embedding, and semantic vector calculation are performed, followed by sentiment mapping to obtain the text sentiment features of each piece of music.

[0016] S114. Based on the acoustic emotional characteristics and textual emotional characteristics of each piece of music, the initial emotional characteristics of each piece of music are obtained.

[0017] Furthermore, step S1 also includes:

[0018] S121, Extract the Mel spectrogram of each piece of music based on the audio data of each piece of music;

[0019] S122, input the Mel spectrogram of each piece of music into the trained CNN model to extract the initial genre features of each piece of music.

[0020] Furthermore, in step S112:

[0021] By inputting the underlying acoustic features of each piece of music into the trained KNN model, the acoustic emotional features of each piece of music can be obtained.

[0022] Furthermore, in step S122, emotion mapping is performed using a predefined emotion model, wherein the predefined emotion model is the Feng's emotion model, which includes four basic emotion dimensions: happiness, anger, sadness, and fear.

[0023] Furthermore, the preset care factor mentioned in step S3 is obtained through any one or more of the following methods:

[0024] The target user can manually set this according to their personal preferences.

[0025] Generated by analyzing the target user's historical music listening history;

[0026] Generated based on user survey questionnaire feedback;

[0027] Generated from social media data;

[0028] It learns and generates data automatically by monitoring data through wearable devices.

[0029] Further, step S4 includes:

[0030] S41, traverse each candidate music in the candidate music library, and calculate the first distance between each candidate music and the adjusted emotional feature and the second distance between each candidate music and the adjusted genre feature.

[0031] S42, select the target music based on the first distance and the second distance of each candidate music.

[0032] Secondly, embodiments of the present invention provide a personalized music recommendation system for improving user mood, comprising:

[0033] The feature module is used to extract the initial emotional features and initial genre features of each piece of music based on the audio and text data of each piece of music related to the target user.

[0034] The prediction module is used to input the initial emotional features and initial genre features of each piece of music into the trained LSTM model to obtain the target emotional features and target genre features of the target user.

[0035] The adjustment module is used to adjust the target emotional characteristics and the target recommended genre using preset care factors to obtain the adjusted emotional characteristics and the adjusted genre characteristics.

[0036] The recommendation module is used to select target music from the candidate music library based on adjusted emotional features and adjusted genre features, and recommend the target music to the target user;

[0037] The care factor is used to control the degree of positive deviation between the emotional attributes of the target music and the current psychological state of the target user.

[0038] Thirdly, embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described personalized music recommendation method for improving user mood.

[0039] Fourthly, embodiments of the present invention provide a computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described personalized music recommendation method for improving user mood.

[0040] This invention proposes a personalized music recommendation method and device for improving user emotions. It aims to accurately identify the current emotional state of the target user, quantify the emotional attributes and genre characteristics of music, and construct a recommendation method accordingly. This method not only considers the emotional matching degree of the target user, but also focuses on recommending music with a positive guiding effect.

[0041] In addition, this invention provides a personalized mood improvement regulation mechanism (care factor) that makes the recommended target music "helpful" to the target user emotionally, rather than just "matching" or "catering", thereby alleviating the "information cocoon" problem of traditional recommendation methods and reducing the negative emotional impact that may be caused by inappropriate music recommendations. Attached Figure Description

[0042] Figure 1 A flowchart illustrating a personalized music recommendation method for improving user mood, provided as an embodiment of the present invention;

[0043] Figure 2 This is a schematic diagram of the structure of a personalized music recommendation system for improving user mood, provided in an embodiment of the present invention.

[0044] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0045] The embodiments of this application are described in detail below. Examples of the 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 this application, and should not be construed as limiting this application.

[0046] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0047] In the embodiments of this application, "at least one" refers to one or more; "multiple" refers to two or more. In the description of this application, terms such as "first," "second," and "third" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0048] References such as “one embodiment” or “some embodiments” as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the terms “comprising,” “including,” “having,” and variations thereof, as used in this specification, mean “including, but not limited to,” unless otherwise specifically emphasized.

[0049] This invention proposes a novel emotion-based multimodal personalized music recommendation framework, aiming to meet users' emotional needs and help improve their mental state by recommending "helpful" music. The core of this method is to identify the target user's emotional state and recommend "helpful" music, guiding their emotions in a positive direction. Simultaneously, a "care factor" is introduced to adjust the recommendation results, controlling the degree of emotional improvement from the recommended music and avoiding discomfort caused by a significant difference between the recommended music and the target user's current mood. This care factor can be preset or personalized based on feedback from the target user.

[0050] Figure 1 A flowchart illustrating a personalized music recommendation method for improving user mood, as provided in an embodiment of the present invention, is shown below. Figure 1 As shown, the method includes:

[0051] S1, based on the audio and text data of each piece of music related to the target user, extract the initial emotional features and initial genre features of each piece of music.

[0052] In this embodiment of the invention, the current psychological state of the target user and the corresponding emotional needs of the target user are first identified. Specifically, based on the audio data and text data of each piece of music related to the target user, the initial emotional features and initial genre features of each piece of music are extracted.

[0053] Among them, music related to the target user can be music recently played by the target user on the music platform and / or music that the target user likes or collects; audio data refers to the audio file of the music; and text data refers to the lyrics and / or comments of the music.

[0054] Accurately monitoring the psychological state of target users is challenging in daily life. This invention is based on the close relationship between music, psychology, and emotion, assuming that target users tend to choose music whose emotions match their psychological state. Therefore, the psychological state of target users can be inferred by analyzing the emotions contained in the music they have listened to over a period of time.

[0055] According to psychological theory, an individual's current emotional state is jointly determined by the previous "mood" (a persistent emotional state) and the incoming "stimulus" (an emotional trigger). First, this invention uses the average emotion of all music in the target user's recent playlist as a representation of the persistent emotional state "mood." Since mood is relatively stable over a period of time, emotions with large fluctuations are considered noise and excluded.

[0056] Subsequently, this invention uses the emotions contained in the music recently enjoyed by the target user as an "emotional stimulus." For example, if the target user suddenly hears a sad song, this "stimulus" will cause the target user's psychological state to slightly decline, and they will be infected by the sad emotion. Therefore, in order to more accurately capture the psychological state of the target user, this invention comprehensively considers the emotional characteristics of both "mood" and "stimulus."

[0057] Specifically, step S1 includes:

[0058] S111, obtain every piece of music played during the first preset historical time period of the target user and every piece of music liked by the target user during the second preset historical time period;

[0059] Among them, each piece of music played in the first preset historical time period represents the music recently played by the target user, and the specific time period can be determined according to the actual situation; each piece of music liked in the second preset historical time period represents the music liked by the target user, and the specific time period can be determined according to the actual situation.

[0060] S112, Based on the audio data of each piece of music, extract the underlying acoustic features of each piece of music, and perform emotional mapping on the underlying acoustic features of each piece of music to obtain the acoustic emotional features of each piece of music.

[0061] The audio data for each piece of music can be an audio file, such as a .wav format audio file. This embodiment of the invention specifically uses the Librosa toolkit in Python to extract various low-level acoustic features from the audio data of each piece of music. These low-level acoustic features may include one or more of the following: rhythm, tempo, pitch, chroma, zero-crossing rate, spectral centroid, spectral contrast, spectral roll-off, spectral flatness, and Mel-frequency cepstral coefficients. The specific features can be determined according to actual circumstances, and this embodiment of the invention does not impose any specific limitations on them.

[0062] Emotional mapping is performed on the underlying acoustic features of each piece of music. Specifically, an emotion mapping model can be selected, and the underlying acoustic features of each piece of music are input into the emotion mapping model to obtain the acoustic emotional features of each piece of music.

[0063] Among them, the predefined emotion model is the Feng emotion model, which includes four basic emotion dimensions: happiness, anger, sadness, and fear.

[0064] The choice of an emotion model is crucial for accurate emotion extraction. This embodiment of the invention employs the Feng emotion model. This Feng emotion model has a solid foundation in computational media aesthetics and includes four low-level emotion categories (happiness, anger, sadness, and fear). These dimensions are closely related to the two dimensions of "arousal" and "valence" (i.e., pleasure) in music, facilitating mapping and computation. This structure makes it highly flexible in application, and the low-dimensional emotion model is sufficient to explain the primary emotional experiences evoked by music. Furthermore, the Feng emotion model helps to focus on the main positive and negative emotions, aligning with the emotion improvement goals of this invention.

[0065] Based on the selected Feng's emotion model, this invention performs data analysis and extracts specific emotion and music genre features in this step. Audio processing libraries such as Librosa are used to extract the underlying acoustic features of each piece of music. Then, using machine learning models such as K-Nearest Neighbor (KNN), these underlying acoustic features are mapped onto the four emotion dimensions of the selected Feng's emotion model to obtain the acoustic emotion features of the music.

[0066] The KNN model was trained using music data with official sentiment labels (labeled playlists from music platforms). This trained KNN model was then used to predict the sentiment category of other unlabeled music (such as music in user playlists and popular music libraries), achieving a test accuracy of approximately 73.91% in this study.

[0067] S113. Based on the text data of each piece of music, word segmentation, word embedding, and semantic vector calculation are performed, followed by sentiment mapping to obtain the text sentiment features of each piece of music.

[0068] Using the BERT (Bidirectional Encoder Representations from Transformers) natural language processing model, word segmentation, word embedding, and semantic vector calculation are performed on text data such as music lyrics and comments. These are then directly mapped to the sentiment model to obtain relevant text sentiment features.

[0069] S114. Based on the acoustic emotional characteristics and textual emotional characteristics of each piece of music, the initial emotional characteristics of each piece of music are obtained.

[0070] By using a deep learning model (Convolutional Neural Network, or CNN) to comprehensively utilize the aforementioned acoustic sentiment features and textual sentiment features, a more accurate, multi-dimensional, and comprehensive initial sentiment feature can be obtained.

[0071] Since the acoustic emotional features of each piece of music cannot fully and accurately represent the emotional data of the music, in order to improve the accuracy of recommendations, this invention combines multimodal data and uses the BERT language model to extract the emotionally relevant textual emotional features from the lyrics and comments of the music. By combining the above acoustic emotional features and textual emotional features with a convolutional neural network (CNN), a more accurate and multidimensional comprehensive emotional feature vector is obtained.

[0072] Step S1 further includes:

[0073] S121, Extract the Mel spectrogram of each piece of music based on the audio data of each piece of music;

[0074] In this embodiment of the invention, the Librosa toolkit in Python is used to extract Mel spectrograms from the audio data of each song. These spectrograms are considered a visual representation of the audio data and can be used as input for subsequent CNN models.

[0075] S122, input the Mel spectrogram of each piece of music into the trained CNN model to extract the initial genre features of each piece of music.

[0076] In this embodiment of the invention, the publicly available GTZAN dataset is used to train a CNN model. Then, this trained CNN model is used to extract initial genre features for each piece of music from inputs such as Mel spectrograms.

[0077] The GTZAN dataset contains 1000 30-second audio clips in .wav format across 10 genres, including blues, classical, country, disco, hip hop, jazz, metal, pop, reggae, and rock.

[0078] The extracted initial emotional features and initial genre features represent the target user's (or the music's) emotional inclination and music genre preference, respectively.

[0079] To ensure that the recommendation system provides music that the target user likes, this invention also extracts other features from the music besides emotion, which are simplified here as initial genre features. Specifically, this invention uses a CNN model to extract genre features from the music. This CNN model is trained on publicly available music genre datasets (such as the GTZAN dataset, which includes 10 genres such as blues, classical, and country).

[0080] Therefore, in this embodiment of the invention, the psychological state of the target user is first identified, and the target user's psychological state is characterized by the initial emotional characteristics and initial genre characteristics of each piece of music related to the target user. In this embodiment of the invention, the Feng's Emotion Model is used to represent musical emotions, and the user's current psychological state and potential emotional needs are comprehensively evaluated based on the target user's recent playlists and music recently collected or marked as "liked".

[0081] Based on the selected Feng's sentiment model, this invention performs data analysis and extracts specific sentiment and music genre features in this step. For sentiment features, this invention comprehensively extracts acoustic sentiment features from musical acoustic data and textual sentiment features from lyric commentary data, resulting in a more accurate and comprehensive sentiment dimension vector.

[0082] In addition, to ensure that the recommendation system can provide music that the target user likes, this invention also extracts other features from the music besides emotions, which are simplified here as initial genre features.

[0083] S2, input the initial emotional features and initial genre features of each piece of music into the trained LSTM model to obtain the target emotional features and target genre features of the target user;

[0084] After obtaining the target user's psychological state and music preferences by comprehensively analyzing relevant acoustic and textual data, this invention designs a Long Short-Term Memory (LSTM) network model for preliminary music recommendation.

[0085] Design an LSTM model for recommendation. The input to the LSTM model includes the target user's mood (composed of all initial sentiment features of the music in the playlist), the current emotional stimulus (composed of all initial sentiment features of the recently liked music), and music preferences (composed of all initial genre features of the playlist and all initial genre features of the recently liked music). The LSTM model learns this sequence information and predicts the sentiment and genre orientation of music that the target user may like and that will help improve their mood.

[0086] Specifically, for target users This invention first identifies a user's mood through their recent playlist. Assume the target user's recent playlist contains... The first piece of music, for each piece of music By combining its acoustic emotional features and textual emotional features, initial emotional features are extracted. (Four emotional dimensions), and characteristics of the initial school of thought. .

[0087] Similarly, embodiments of the present invention extract emotional stimuli from the music recently liked by the target user. and initial school characteristics The above features are then coupled to form a multimodal feature representation of the target user. . Its dimensions are Each time step has 14 features, for a total of Each time step. This serialized multimodal feature. It is fed into the LSTM neural network for learning and prediction.

[0088] After synthesizing relevant acoustic and textual data to obtain the user's psychological state and music preferences, this invention designs an LSTM model for preliminary music recommendation. The inputs to the LSTM model include the user's mood (composed of the average emotional characteristics of the playlist music), the current emotional stimulus (composed of the emotional characteristics of recently liked music), and music preferences (composed of the average genre characteristics of the playlist). The LSTM model learns this sequence information to predict the emotional and genre orientation of music that the user might like and that could help improve their mood.

[0089] S3, adjust the target emotional features and the target recommended genre using preset care factors to obtain the adjusted emotional features and the adjusted genre features;

[0090] The output of the LSTM model provides an initial recommendation direction (e.g., target sentiment vector and target genre vector). However, directly using this prediction result cannot optimally improve mood, and may even lead to users being repeatedly recommended music with similar moods, creating a "filter bubble" effect that causes annoyance or frustration.

[0091] Therefore, this invention introduces a "care factor" to finalize the recommendation results. This care factor is designed to address the phenomenon that different target users may have varying degrees of emotional needs even in similar emotional states. For example, when experiencing sadness, some people may only need soothing music that is also sad but has a slightly positive undertone, while others may require music with a stronger emotional guidance. This individual difference is consistent with previous research findings on the influence of different personality types on music preferences and emotional responses.

[0092] In practical applications, the "care factor" can be manually set by the target user according to their own needs, or it can be automatically learned and inferred by analyzing the user's historical listening data, social media content, or emotional data monitored by wearable devices. For example, a simple method is to infer this factor by analyzing the emotional tendencies of the music the user has recently played. In the experiment of this study, a questionnaire was designed to investigate users' preferences for music recommendations under different emotions, and a personalized and controllable "care factor" was derived for each target user based on the questionnaire results.

[0093] The target sentiment vector and genre vector, adjusted by the "care factor," will be used to select the most suitable Top-N songs from a "popular music library" as the final recommendation result. Choosing "popular" music as the candidate set ensures that the recommended music meets the user's perceptual input requirements (i.e., the music itself has a certain degree of popularity and acceptance). This is closer to real-world applications than many studies that only recommend from users' existing playlists, but it is also more challenging because popular music is usually new, and its characteristics are not reflected in the target user's historical data.

[0094] It should be noted that the preset care factor mentioned in step S3 is obtained through any one or more of the following methods:

[0095] The target user can manually set this according to their personal preferences.

[0096] Generated by analyzing the target user's historical music listening history;

[0097] Generated based on user survey questionnaire feedback;

[0098] Generated from social media data;

[0099] It learns and generates data automatically by monitoring data through wearable devices.

[0100] Recommendation Adjustment Based on the "Care Factor". A key innovation is the introduction of a bias parameter, the "Care Factor," to determine the degree of emotional therapy (i.e., the bias between the user's current mental state and the recommended slightly positive emotional music). This care factor is predefined and personalized, designed to adjust the recommendations of the LSTM model to guide the listener's mental state in a positive direction. It can be set manually or learned automatically from accessible data such as user listening history, social media data, or wearable device data. For example, the appropriate value of this factor can be inferred by analyzing the emotional tendency of the user's recently played music and the emotional fluctuations in the user's playlist.

[0101] Among them, LSTM stands for Long Short-Term Memory, a special type of Recurrent Neural Network (RNN) designed to solve the gradient vanishing and long-term dependency problems of traditional RNNs when processing long-sequence data. Through its unique gating mechanism, it can effectively memorize and update information over long time spans, and is widely used in time series forecasting, natural language processing, and other fields.

[0102] S4. Based on the adjusted emotional features and adjusted genre features, select target music from the candidate music library and recommend the target music to the target user;

[0103] The care factor is used to control the degree of positive deviation between the emotional attributes of the target music and the current psychological state of the target user.

[0104] Step S4 includes:

[0105] S41, traverse each candidate music in the candidate music library, and calculate the first distance between each candidate music and the adjusted emotional feature and the second distance between each candidate music and the adjusted genre feature.

[0106] S42, select the target music based on the first distance and the second distance of each candidate music.

[0107] Finally, the candidate music library is traversed, which is a popular music library. The distance between each candidate music and the adjusted recommendation direction is calculated (combining emotional distance and genre distance, and weights can be used to balance the two). The N target music with the smallest distance are selected as the final recommendation result.

[0108] This invention proposes a personalized music recommendation method for improving user emotions. It aims to accurately identify the current emotional state of the target user, quantify the emotional attributes and genre characteristics of music, and construct a recommendation method accordingly. This method not only considers the emotional matching degree of the target user, but also focuses on recommending music with a positive guiding effect.

[0109] In addition, this invention provides a personalized mood improvement regulation mechanism (care factor) that makes the recommended target music "helpful" to the user emotionally, rather than just "matching" or "catering", thereby alleviating the "information cocoon" problem in traditional recommendation systems and reducing the negative emotional impact that may be caused by inappropriate music recommendations.

[0110] This invention proposes a music recommendation method based on multimodal deep learning and personalized emotion improvement, aiming to recommend music to users that not only matches their preferences but also improves their psychological state. Its theoretical foundation partially draws on Juslin's unified music emotion theory, particularly its aesthetic judgment process. This process posits that a user's acceptance of music (like / dislike) is influenced by perceptual input, cognitive input, emotional input, and individualized criteria.

[0111] In summary, unlike traditional recommendation systems that primarily aim to match user preferences, this invention innovatively prioritizes improving users' psychological state and fulfilling their deep emotional needs as its core principle. Specifically, firstly, this invention combines long-term mood with short-term emotional stimuli to assess users' emotional states, making emotion recognition more comprehensive and dynamic. Secondly, it effectively utilizes LSTM networks to process multimodal data, including acoustic and textual information from music, for sequential modeling, improving the accuracy and rationality of recommendations. Finally, this invention innovatively proposes and applies a "care factor" to dynamically adjust the emotional intensity of recommended music, thereby providing emotional support while avoiding user discomfort, achieving more humanistic and personalized recommendations. Overall, this invention proactively guides users' emotions towards a positive direction, helping them break free from cycles of singular emotions and music genres, alleviating "information cocoons," and reducing potential negative psychological impacts.

[0112] Figure 2 This is a schematic diagram of the structure of a personalized music recommendation system for improving user mood, provided in an embodiment of the present invention. Figure 2 As shown, the system includes:

[0113] Feature module 210 is used to extract the initial emotional features and initial genre features of each piece of music based on the audio data and text data of each piece of music related to the target user.

[0114] The prediction module 220 is used to input the initial emotional features and initial genre features of each piece of music into the trained LSTM model to obtain the target emotional features and target genre features of the target user.

[0115] The adjustment module 230 is used to adjust the target emotional characteristics and the target recommended genre using a preset care factor to obtain the adjusted emotional characteristics and the adjusted genre characteristics.

[0116] Recommendation module 240 is used to select target music from the candidate music library based on adjusted emotional features and adjusted genre features, and recommend the target music to the target user;

[0117] The care factor is used to control the degree of positive deviation between the emotional attributes of the target music and the current psychological state of the target user.

[0118] This embodiment is a system embodiment corresponding to the above method embodiment. Its specific implementation process is the same as that of the above method embodiment. For details, please refer to the above method embodiment. This system embodiment does not make any specific limitations.

[0119] The modules in the aforementioned personalized music recommendation system aimed at improving user mood can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can invoke and execute the corresponding operations of each module.

[0120] This invention provides a computer device, which may be a server, comprising a processor, a memory, a network interface, and a database connected via a system bus. The processor provides computational and control capabilities. The memory includes a computer storage medium and internal memory. The computer storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the computer storage medium. The database stores data generated or acquired during the execution of a personalized music recommendation method aimed at improving user mood, such as audio and text data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a personalized music recommendation method aimed at improving user mood.

[0121] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of a personalized music recommendation method for improving user mood as described in the above embodiment. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the embodiment of a personalized music recommendation system for improving user mood.

[0122] In one embodiment, a computer storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the steps of a personalized music recommendation method for improving user mood as described in the above embodiment. Alternatively, when executed by a processor, the computer program implements the functions of each module / unit in the above embodiment of a personalized music recommendation system for improving user mood.

[0123] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0124] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0125] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A personalized music recommendation method for user mood improvement, characterized in that, include: S1, based on the audio and text data of each piece of music related to the target user, extract the initial emotional features and initial genre features of each piece of music. S2, input the initial emotional features and initial genre features of each piece of music into the trained LSTM model to obtain the target emotional features and target genre features of the target user; S3, adjust the target emotional features and the target recommended genre using preset care factors to obtain the adjusted emotional features and the adjusted genre features; S4. Based on the adjusted emotional features and adjusted genre features, select target music from the candidate music library and recommend the target music to the target user; The care factor is used to control the degree of positive deviation between the emotional attributes of the target music and the current psychological state of the target user. 2.The method of claim 1, wherein, Step S1 includes: S111, obtain every piece of music played during the first preset historical time period of the target user and every piece of music liked by the target user during the second preset historical time period; S112, Based on the audio data of each piece of music, extract the underlying acoustic features of each piece of music, and perform emotional mapping on the underlying acoustic features of each piece of music to obtain the acoustic emotional features of each piece of music. S113. Based on the text data of each piece of music, word segmentation, word embedding, and semantic vector calculation are performed, followed by sentiment mapping to obtain the text sentiment features of each piece of music. S114. Based on the acoustic emotional characteristics and textual emotional characteristics of each piece of music, the initial emotional characteristics of each piece of music are obtained. 3.The method of claim 2, wherein, Step S1 also includes: S121, Extract the Mel spectrogram of each piece of music based on the audio data of each piece of music; S122, input the Mel spectrogram of each piece of music into the trained CNN model to extract the initial genre features of each piece of music. 4.The method of claim 2, wherein, In step S122, emotion mapping is performed using a predefined emotion model, wherein the predefined emotion model is the Feng's emotion model, which includes four basic emotion dimensions: happiness, anger, sadness, and fear. 5.The method of claim 4, wherein, In step S112: The underlying acoustic features of each piece of music are input into a trained KNN model, and the underlying acoustic features are mapped to four basic emotional dimensions: happiness, anger, sadness, and fear, to obtain the acoustic emotional features of each piece of music.

6. The personalized music recommendation method for improving user mood according to claim 1, characterized in that, The preset care factor mentioned in step S3 is obtained through any one or more of the following methods: The target user can manually set this according to their personal preferences. Generated by analyzing the target user's historical music listening history; Generated based on user survey questionnaire feedback; Generated from social media data; It learns and generates data automatically by monitoring data through wearable devices.

7. The personalized music recommendation method for improving user mood according to claim 1, characterized in that, Step S4 includes: S41, traverse each candidate music in the candidate music library, and calculate the first distance between each candidate music and the adjusted emotional feature and the second distance between each candidate music and the adjusted genre feature. S42, select the target music based on the first distance and the second distance of each candidate music.

8. A personalized music recommendation system for improving user mood, characterized in that, include: The feature module is used to extract the initial emotional features and initial genre features of each piece of music based on the audio and text data of each piece of music related to the target user. The prediction module is used to input the initial emotional features and initial genre features of each piece of music into the trained LSTM model to obtain the target emotional features and target genre features of the target user. The adjustment module is used to adjust the target emotional characteristics and the target recommended genre using preset care factors to obtain the adjusted emotional characteristics and the adjusted genre characteristics. The recommendation module is used to select target music from the candidate music library based on adjusted emotional features and adjusted genre features, and recommend the target music to the target user; The care factor is used to control the degree of positive deviation between the emotional attributes of the target music and the current psychological state of the target user.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the personalized music recommendation method for improving user mood as described in any one of claims 1 to 7.

10. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the personalized music recommendation method for improving user mood as described in any one of claims 1 to 7.