Music recommendation method and system based on hypergraph neural network

By using a hypergraph neural network framework and graph attention mechanism, the problem of insufficient utilization of user and music information in existing technologies is solved, achieving more accurate music recommendation and cold start solutions, and improving the efficiency and effectiveness of recommendation systems.

CN117891969BActive Publication Date: 2026-07-21SHAANXI NORMAL UNIV +1
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHAANXI NORMAL UNIV
Filing Date
2024-02-02
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies fail to effectively utilize the rich information of users and music in music recommendation, and do not employ hypergraph neural networks for feature representation, resulting in poor recommendation performance, particularly in the cold start problem.

Method used

The system employs a hypergraph neural network framework to generate a hypergraph structure representing the relationship between users and music. It utilizes a graph attention mechanism for feature extraction and aggregation, combines a two-layer multi-head graph attention network to compute feature representations of users and music, and finally generates a preference probability value for recommendation through product pooling.

Benefits of technology

It improves the accuracy of music recommendations, solves the cold start problem, reduces computational load, helps to uncover users' potential listening interests, and results in better recommendation performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117891969B_ABST
    Figure CN117891969B_ABST
Patent Text Reader

Abstract

The application discloses a music recommendation method and system based on a hypergraph neural network, and the method comprises the following steps: acquiring a music data set, pre-processing the data set, dividing a training set and a test set, generating a hypergraph representation based on the music data set, performing maximum pooling, calculating a graph attention correlation coefficient, obtaining a user representation, processing user features and music features, obtaining a final representation through product pooling, i.e., a love probability value of each certain music; sorting the music according to the probability value from large to small, and finally recommending top-N music that a user likes to the user. Through modeling of the user and the music, we can utilize the graph structure to better represent all possible and complex interactions between the user and the music, meanwhile, the structure information of the graph is ensured to be rich, and the rich information of the user and the music itself is also considered, which is beneficial to mining the potential music listening interest of the user and helping the user to determine the most suitable song.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of hypergraph neural network recommendation, specifically relating to a music recommendation method and system based on hypergraph neural networks. Background Technology

[0002] Existing technologies mainly rely on users' listening records and consider listening sequences to make recommendations. For example, existing technologies 1 (a music recommendation method and system based on music tags and time information, publication number CN112800270A, publication date 2021.05.14, Nanjing University of Posts and Telecommunications) and 4 (a hybrid music recommendation method, system and device based on KNN and word embeddings, publication number CN112860937A, publication date 2021.05.28, Shaanxi Normal University) both consider users' listening records to identify users' interests and preferences, and then analyze the similarity between songs to make Top-N recommendations for users.

[0003] Techniques 2 (A method for recommending and predicting user long-term and short-term preferences based on multimodal music data (Publication No. CN114254205A, Publication Date 2022.03.29, Guangdong University of Technology) and 3 (A music recommendation method based on multi-view enhanced graph attention neural network (Publication No. CN114969547A, Publication Date 2022.08.30, Hangzhou Dianzi University) both consider users' long-term and short-term preferences, learn user and music representations from users' listening records, analyze users' listening interests, and make recommendations. Furthermore, existing techniques 1-4 do not employ hypergraph neural networks to learn user and music feature representations, and these works rarely consider the rich information of users and the music itself. Summary of the Invention

[0004] This invention is based on the overall framework of a hypergraph neural network, using hypergraphs and graph attention mechanisms as the basic unit structures for music data feature extraction and generation, and proposes a music recommendation method and system based on hypergraph neural networks.

[0005] To achieve the above objectives, the technical solution adopted by this invention is: a music recommendation method based on a hypergraph neural network, comprising the following steps: Generate a hypergraph structure representation consisting of an association matrix based on a dataset containing user information and music information. , It is a hyperedge set, representing all the music a user has listened to. Let be the set of vertices, where the vertices are represented by music. This is a diagonal matrix representing the hyperedge weights; Each user is considered as a set of music within a hyperedge. First, the features of the corresponding music within the hyperedge are converted into feature vectors of a fixed size. Then, the feature vectors are aggregated using a max pooling layer to obtain the initial embedding representation of all users. Based on the initial embedding representations of all users, the graph attention correlation coefficient is calculated through a two-layer multi-head graph attention network to finally obtain the user representations; Initial user features (age, gender, occupation) and music features (song title, release date, artist) are processed and input into the embedding layer to obtain... The feature vector is embedded. Then, a two-layer attention network is used to calculate the attention weights for each user feature and music feature, resulting in the final feature representations of the user and music. The final user and music feature representations, along with the user representation, are processed through a product pool to obtain the probability value of a user's liking for each piece of music. The music is sorted from highest to lowest probability value, and the top-N most popular songs are recommended to each user.

[0006] Furthermore, generating the hypergraph structure representation composed of the association matrix includes: the user set is represented as... There are a total of | | Users, music collections are represented as There are a total of | |The first piece of music, the hypergraph is defined as ,in Let vertices be a set of vertices used to represent music. It is a hyperedge set, representing all the music a user has listened to. For the diagonal matrix of hyperedge weights, the user The music I've listened to includes Then the user The corresponding hyperedge is represented as The structure of a hypergraph is determined by the incidence matrix. constitute: (1) Where, if vertex If the value is 1, then the current position value is 1; otherwise, it is 0.

[0007] Furthermore, each user is considered as a set of music within a hyperedge. First, the features of the corresponding music within the hyperedge are converted into fixed-size vectors to obtain feature vectors. Then, a max-pooling layer aggregates the information from these feature vectors to obtain the initial embeddings for all users. The initial embeddings are then learned through an embedding layer. If a user... The initial embedding is ,in It's music The initial embedding, then the user The initial embedding is represented as: (2) in This represents the max pooling layer operation, from which the user... The initial embeddings of the first user are obtained, and the initial embeddings of other users are obtained using the same method. The initial embeddings of all users are represented as follows: .

[0008] Furthermore, a two-layer, multi-head graph attention mechanism is used to highlight the user's attention. For other, more important users, the formula for calculating the graph attention correlation coefficient is: (3) (4) in, These are learnable parameters. and On behalf of users With users exist Layer embedding representation, where The representative is the user The neighbor, || To the user , The transformed features are then concatenated. To calculate the correlation between two nodes, the concatenated high-dimensional features are mapped to a real number, and the standardized version of the graph attention correlation coefficient is obtained through formula (4), where, Represents the activation function. On behalf of users For users The attention coefficient represents the strength of the connecting edges in the user hypergraph.

[0009] Furthermore, a multi-head attention network is employed to acquire user attention. The expression is represented by the following formula: (5) in, Represents the activation function. Representative process After the next iteration, the user The final expression is a 3D embedding feature vectors, The number of heads represents the number of heads in the multi-head attention network. It uses a two-layer graph attention network, with each layer connected in the same way.

[0010] Furthermore, the calculation of the attention mechanism is similar to the processing of hypergraphs, and the final output of the two-layer attention network is as follows:

[0011] in These are the attention weights for each input feature. For the final user and music feature representation, it is a Dimensional embedded feature vectors; The output of the two-layer attention network is then passed through a product pool to obtain the final representation. (7) in, These are learnable parameters. It is the result of element-wise multiplication. It represents the probability of selecting that music.

[0012] Furthermore, based on the same concept as the above method, the present invention provides a music recommendation system based on a hypergraph neural network, including a hypergraph structure generation module, an initial embedding representation acquisition module, a user representation acquisition module, a user and music feature representation acquisition module, a product pooling processing module, and a recommendation module; The graph structure generation module generates a hypergraph structure representation composed of an association matrix based on a dataset containing user information and music information. , It is a hyperedge set, representing all the music a user has listened to. Let be the set of vertices, where the vertices are represented by music. This is a diagonal matrix representing the hyperedge weights; The initial embedding representation acquisition module is used to treat each user as a set of music in the hyperedge. First, the features of the corresponding music in the hyperedge are converted into feature vectors of a fixed size. Then, the feature vectors are aggregated through a max pooling layer to obtain the initial embedding representation of all users. The user representation acquisition module calculates the graph attention correlation coefficient through a two-layer multi-head graph attention network based on the initial embedded representations of all users and finally obtains the user representation. The user and music feature representation acquisition module is used to input the initial user features and music features into the embedding layer, and obtain the following features respectively. 3D embedding feature vector; then the The dimensional embedding feature vector is used as the input of a two-layer attention network. The attention weights of each user feature and music feature are calculated through the two-layer attention network to obtain the final feature representations of the user and music. The product pool processing module is used to process the final user and music feature representations and the user representations through the product pool to obtain the probability value of the user's liking for each piece of music; The recommendation module sorts the music according to its probability value from highest to lowest, and finally recommends the top-N most popular songs to the user.

[0013] The present invention can also provide a computer device, including a processor and a memory, wherein the memory is used to store a computer executable program, the processor reads the computer executable program from the memory and executes it, and the processor can implement the music recommendation method based on hypergraph neural network described in the present invention when executing the computer executable program.

[0014] Additionally, a computer-readable storage medium is provided, in which a computer program is stored. When executed by a processor, the computer program can implement the music recommendation method based on a hypergraph neural network as described in this invention.

[0015] Compared with the prior art, the present invention has at least the following beneficial effects: This invention employs a hypergraph neural network to learn feature representations of users and music. By modeling users and music, we can utilize graph structures to better represent all possible and complex interactions between users and music, while ensuring the richness of the graph's structural information. Using a hypergraph can better aggregate neighbor information, resulting in better recommendation performance. Using a hypergraph can also effectively solve the cold start problem, relatively reduce the computational load, and benefit application deployment. This invention also considers the rich information of users and music themselves, which is conducive to mining users' potential listening interests and helping users determine the most suitable songs. Attached Figure Description

[0016] Figure 1 This is a flowchart of Embodiment 1 of the present invention.

[0017] Figure 2 This is a schematic diagram of the technical framework structure of the present invention.

[0018] Figure 3 This is a detailed structural diagram of the technical framework of the present invention. Detailed Implementation

[0019] This method employs a hypergraph neural network to learn feature representations of users and music. By modeling users and music, it enables us to better represent all possible and complex interactions between users and music using graph structures, while ensuring the richness of the graph's structural information. This method also considers the rich information of both the user and the music itself, which is beneficial for uncovering users' potential listening interests and helping them determine the most suitable songs.

[0020] refer to Figure 1 , Figure 2 and Figure 3 The detailed operation steps of one embodiment provided by the present invention are as follows: Step 1: Obtain the music dataset Obtain a dataset containing rich user and music information.

[0021] Step 2: Preprocess the dataset The dataset may contain users who registered an account but never listened to music on the platform, or whose music has been removed from the platform. Therefore, it is necessary to consider removing these users and their music as outliers from the dataset.

[0022] Step 3: Divide the dataset into training and test sets. During the model training phase, in order to learn the optimal parameters of the model and verify the effect of the trained model, the dataset is divided into a training set and a test set, with a ratio of 7:3.

[0023] Step 4: Generate Hypergraph Representation Define the user set as There are a total of | | Users, music collections are represented as There are a total of | |The first piece of music. A hypergraph is defined as... ,in Representing a set of vertices, in this invention, vertices are represented by music. It is a hyperedge set, representing all the music a user has ever listened to. This is a diagonal matrix representing the weights of the hyperedges. For users... The music he has listened to includes Then the corresponding hyperedge can be represented as The structure of a hypergraph is determined by the incidence matrix. constitute: (1) Where, if vertex If the value is 1, then the current position value is 1; otherwise, it is 0.

[0024] Step 5: Max Pooling Layer Processing This invention treats each user as a set of music within a hyperedge. First, the features of the corresponding music within the hyperedge are converted into vectors of a fixed size. Then, a max-pooling layer is used to aggregate the information. Specifically, the initial process embedding is learned through an embedding layer. If the user... The initial embedding is ,in It's music The initial embedding. User The initial embedding can be represented as: (2) in This represents the max pooling layer operation. This yields the user's... The initial embeddings of the first user are obtained, and the initial embeddings of other users are obtained in the same way. We represent the initial embeddings of all users as follows: .

[0025] Step 6: Calculate the graph attention correlation coefficient This invention highlights the user through a two-layer, multi-head graph attention mechanism. More importantly, for other users, the first step is to calculate the graph attention correlation coefficient, using the formula: (3) (4) in These are learnable parameters. and On behalf of users With users exist Layer embedding representation, where The representative is the user The neighbor, || For the user , The transformed features were then concatenated. This is to calculate the correlation between two nodes, that is, to map the concatenated high-dimensional features onto a real number. Then, the standardized version of the graph attention correlation coefficient is obtained through formula (4), where Represents the activation function. On behalf of users For users The attention coefficient represents the strength of the connecting edges in the user hypergraph.

[0026] Step 7: Obtain user feedback To enrich the model's capabilities and stabilize the training process, this invention designs a multi-head attention mechanism to obtain user attention. The expression is represented by the following formula: (5) in Represents the activation function. Representative process After the next iteration, the user The final statement is that this is Dimensional embedding feature vectors. The number of heads represents the multi-head attention mechanism. As an optional implementation, this invention employs a two-layer graph attention mechanism, with each layer connected in the same way.

[0027] Step 8: Process user characteristics and music characteristics The user characteristics (Age, gender, occupation) and musical characteristics (Song title, release date, artist) are input into the embedded layer to obtain the following information: 3D embedding feature vector and Then, the attention weights of each input feature are calculated using the dual-layer attention network to obtain the output of the dual-layer attention mechanism. In this invention, the calculation method for obtaining the attention mechanism is similar to the processing of hypergraphs, but a multi-head attention mechanism is not used. The final output formula of the dual-layer attention mechanism is as follows: (6) in These are the attention weights for each input feature. For the final user and music characteristics representation, it is also Dimensional embedding feature vector.

[0028] Step 9: Obtain the final representation, i.e., the probability value of the user liking each piece of music, through the product pool; (7) in, These are learnable parameters. It is the result of element-wise multiplication. It represents the probability of selecting that music.

[0029] Step 10: Calculate the loss function (8) in One-hot encoding representing the true value, Indicates music selection The probability, This represents the number of instances used for training. A two-layer multi-head graph attention network is trained using a loss function until convergence.

[0030] Step 11: Finally, recommend the top-N music tracks that the user likes.

[0031] Similar to the above method, this invention provides a music recommendation system based on a hypergraph neural network, including a hypergraph structure generation module, an initial embedding representation acquisition module, a user representation acquisition module, a user and music feature representation acquisition module, a product pooling processing module, and a recommendation module; The graph structure generation module generates a hypergraph structure representation composed of an association matrix based on a dataset containing user information and music information. , It is a hyperedge set, representing all the music a user has listened to. Let be the set of vertices, where the vertices are represented by music. This is a diagonal matrix representing the hyperedge weights; The initial embedding representation acquisition module is used to treat each user as a set of music in the hyperedge. First, the features of the corresponding music in the hyperedge are converted into feature vectors of a fixed size. Then, the feature vectors are aggregated through a max pooling layer to obtain the initial embedding representation of all users. The user representation acquisition module calculates the graph attention correlation coefficient through a two-layer multi-head graph attention network based on the initial embedded representations of all users and finally obtains the user representation. The user and music feature representation acquisition module is used to input the initial user features and music features into the embedding layer, and obtain the following features respectively. 3D embedding feature vector; then the The dimensional embedding feature vector is used as the input of a two-layer attention network. The attention weights of each user feature and music feature are calculated through the two-layer attention network to obtain the final feature representations of the user and music. The product pool processing module is used to process the final user and music feature representations and the user representations through the product pool to obtain the probability value of the user's liking for each piece of music; The recommendation module sorts the music according to its probability value from highest to lowest, and finally recommends the top-N most popular songs to the user.

[0032] In addition, the present invention can also provide a computer device, including a processor and a memory, wherein the memory is used to store a computer executable program, the processor reads part or all of the computer executable program from the memory and executes it, and the processor can implement the music recommendation method based on hypergraph neural network described in the present invention when executing part or all of the computer executable program.

[0033] On the other hand, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the music recommendation method based on a hypergraph neural network as described in the present invention.

[0034] The computer device may be a laptop, a desktop computer, or a workstation.

[0035] The processor can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or an off-the-shelf programmable gate array (FPGA).

[0036] The memory described in this invention can be an internal storage unit of a laptop, desktop computer, or workstation, such as memory or hard disk; or it can be an external storage unit, such as a portable hard disk or flash memory card.

[0037] Computer-readable storage media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer-readable storage media can include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. Random access memory can include resistive random access memory (ReRAM) and dynamic random access memory (DRAM).

Claims

1. A music recommendation method based on a hypergraph neural network, characterized in that, Includes the following steps: Generate a hypergraph structure representation consisting of an association matrix based on a dataset containing user information and music information. , E It is a hyperedge set, representing all the music a user has listened to. V Let be the set of vertices, where the vertices are represented by music. This is a diagonal matrix representing the hyperedge weights; Each user is considered as a set of music within a hyperedge. First, the features of the corresponding music within the hyperedge are converted into a fixed-size feature vector. Then, a max-pooling layer is used to aggregate the information from these feature vectors, yielding the initial embedding representation for all users. This includes: embedding the initial learning process through the embedding layer, if the user... The initial embedding is ,in It's music The initial embedding, then the user The initial embedding is represented as: (2) in This represents the max pooling layer operation, from which the user... The initial embeddings of the first user are obtained, and the initial embeddings of other users are obtained using the same method. The initial embeddings of all users are represented as follows: ; Based on the initial embedding representations of all users, a graph attention correlation coefficient is calculated using a two-layer multi-head graph attention network to ultimately obtain the user representation; specifically, a two-layer multi-head graph attention mechanism is used to highlight user-related information. For other, more important users, the formula for calculating the graph attention correlation coefficient is: (3) (4) in, These are learnable parameters. and On behalf of users With users exist Layer embedding representation, where The representative is the user The neighbor, || To the user , The transformed features are then concatenated. To calculate the correlation between two nodes, the concatenated high-dimensional features are mapped to a real number, and the standardized version of the graph attention correlation coefficient is obtained through formula (4). Represents the activation function. On behalf of users For users The attention coefficient represents the strength of the connecting edges in the user hypergraph; Using multi-head attention networks to acquire users The expression is represented by the following formula: (5) in, Represents the activation function. Representative process After the next iteration, the user The final expression is a 3D embedding feature vectors, The number of heads represents the number of heads in the multi-head attention network. A two-layer graph attention network is used, with each layer connected in the same way. The initial user features and music features are input into the embedding layer to obtain... 3D embedding feature vector; then the The dimensional embedding feature vector is used as the input of a two-layer attention network. The attention weights of each user feature and music feature are calculated through the two-layer attention network to obtain the final feature representations of the user and music. The final user and music feature representations, along with the user representation, are processed through a product pool to obtain the probability value of a user's liking for each piece of music. The music is sorted from highest to lowest probability value, and the top-N most popular songs are recommended to each user.

2. The music recommendation method based on a hypergraph neural network according to claim 1, characterized in that, Generating a hypergraph structure representation consisting of an incidence matrix includes: the user set is represented as... There are a total of | | Users, music collections are represented as There are a total of | |The first piece of music, the hypergraph is defined as ,in Let vertices be a set of vertices used to represent music. It is a hyperedge set, representing all the music a user has listened to. For the diagonal matrix of hyperedge weights, the user The music I've listened to includes Then the user The corresponding hyperedge is represented as The structure of a hypergraph is determined by the incidence matrix. constitute: (1) Where, if vertex If the value is 1, then the current position value is 1; otherwise, it is 0.

3. The music recommendation method based on a hypergraph neural network according to claim 1, characterized in that, The calculation method for the attention mechanism is the same as that for hypergraphs. The final output of the two-layer attention network is as follows: in These are the attention weights for each input feature. For the final user and music feature representation, it is a Dimensional embedded feature vectors; The output of the two-layer attention network is then passed through a product pool to obtain the final representation. (7) in, These are learnable parameters. It is the result of element-wise multiplication. It represents the probability of selecting that music.

4. A music recommendation system based on a hypergraph neural network, characterized in that, The method for implementing the music recommendation method based on a hypergraph neural network as described in claim 1 includes a hypergraph structure generation module, an initial embedding representation acquisition module, a user representation acquisition module, a user and music feature representation acquisition module, a product pooling processing module, and a recommendation module. The graph structure generation module generates a hypergraph structure representation composed of an association matrix based on a dataset containing user information and music information. , E It is a hyperedge set, representing all the music a user has listened to. Let be the set of vertices, where the vertices are represented by music. This is a diagonal matrix representing the hyperedge weights; The initial embedding representation acquisition module is used to treat each user as a set of music in the hyperedge. First, the features of the corresponding music in the hyperedge are converted into feature vectors of a fixed size. Then, the feature vectors are aggregated through a max pooling layer to obtain the initial embedding representation of all users. The user representation acquisition module calculates the graph attention correlation coefficient through a two-layer multi-head graph attention network based on the initial embedded representations of all users and finally obtains the user representation. The user and music feature representation acquisition module is used to input the initial user features and music features into the embedding layer, and obtain the following features respectively. 3D embedding feature vector; then the The dimensional embedding feature vector is used as the input of a two-layer attention network. The attention weights of each user feature and music feature are calculated through the two-layer attention network to obtain the final feature representations of the user and music. The product pool processing module is used to process the final user and music feature representations and the user representations through the product pool to obtain the probability value of the user's liking for each piece of music; The recommendation module sorts the music according to its probability value from highest to lowest, and finally recommends the top-N most popular songs to the user.

5. A computer device, characterized in that, It includes a processor and a memory, the memory being used to store a computer-executable program, the processor reading the computer-executable program from the memory and executing it, and the processor executing the computer-executable program being able to implement the music recommendation method based on a hypergraph neural network as described in any one of claims 1 to 4.

6. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores a computer program that, when executed by a processor, enables the music recommendation method based on a hypergraph neural network as described in any one of claims 1 to 4.