A fairness recommendation method for limited sensitive attribute information based on a knowledge graph
By constructing a user item knowledge graph and a graph neural network, and designing a sensitive attribute estimation and filtering network, fair user representations are generated, solving the problem of limited sensitive attribute labels in the recommender system and improving the fairness of the recommender system.
Patent Information
- Application Number
- CN202311242404.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-09-25
AI Technical Summary
Existing recommendation systems struggle to provide fair recommendations when user-sensitive attribute labels are limited, and traditional methods rely on a large number of labels, leading to performance limitations.
By constructing a user project knowledge graph, using graph neural networks to model user representations, and designing sensitive attribute estimation and filtering networks, fair user representations are generated, thus solving the problem of scarce sensitive attribute information.
This approach improves the fairness of the recommendation system and provides equitable recommendation results even with limited sensitive attribute labels, thus alleviating the problem of insufficient sensitive attribute information.
Smart Images

Figure CN117194797B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of recommendation algorithm application, and more particularly, to a fairness recommendation method based on knowledge graph and limited sensitive attribute information. BACKGROUND
[0002] With the advent of the big data era, people have entered the era of information explosion, and it is particularly important to provide products meeting the needs of people in the massive data. To solve this problem, a recommendation system emerges as the times require. The recommendation system can generate items of interest according to the historical interaction records of people, and the recommendation system involves many fields, such as network shopping, movie recommendation, news, etc., which greatly facilitates people's life. However, the recommendation data is very sparse, and the items that the user really interacts with account for a very small proportion in the total items, which seriously restricts the performance of the recommendation system. In order to alleviate this problem, the knowledge graph is introduced into the recommendation system, and the knowledge graph stores a large amount of real world knowledge, and its representation form is a heterogeneous graph. The nodes in the graph represent entities, and the edges in the graph represent the relationship between entities. By merging the knowledge graph and the user-item interaction graph, more rich semantics between users and items can be extracted, so as to supplement the user and item information of the recommendation system, and obtain more effective user and item representation.
[0003] Recently, the fairness problem of the recommendation system has also attracted people's attention. With the further development of the recommendation system, people not only need the recommendation system to provide accurate recommendation results, but also hope that the recommendation system can provide fair recommendation results, that is, users do not want the recommendation system to be affected by their sensitive attributes, such as age, gender, occupation factors, which is very important to improve the user experience. The traditional recommendation system often ignores the fairness factor, and the sensitive attributes of the user can be easily inferred from the recommendation result, so how to effectively remove the sensitive attributes of the user is a problem to be solved at present. At the same time, the removal of the sensitive attributes of the user depends on the training data, which needs a large number of sensitive attribute labels. However, in the real scene, the user group that can provide sensitive attributes is often very small, and a small number of sensitive attribute labels also seriously restrict the performance of the fairness algorithm, so how to provide fair recommendation results under the condition of limited sensitive attribute labels is also very important.
[0004] In order to solve the above problems, a technical scheme is provided. SUMMARY
[0005] In order to overcome the above-mentioned defects of the prior art, the application provides a fairness recommendation method based on limited sensitive attribute information of a knowledge graph, which enriches recommendation data by constructing a user-item knowledge graph, solves the technical problem of recommendation data sparsity, then introduces a graph neural network to model a more effective user representation, then generates a user sensitive attribute label through a user sensitive attribute estimation network, solves the technical problem of limited sensitive attributes, and finally generates a fair user representation through a user sensitive attribute filtering network, solves the technical problem of removing user sensitive attributes, thereby realizing fair recommendation and effectively improving the fairness of the recommendation system. The user sensitive attribute estimation network can generate a sensitive attribute label for each user, thereby alleviating the problem of limited sensitive attribute information. Finally, the user sensitive attribute filtering network ensures the removal of user sensitive attributes and provides a fair recommendation result, thereby solving the problems raised in the above background art.
[0006] To achieve the above object, the application provides the following technical scheme:
[0007] A fairness recommendation method based on limited sensitive attribute information of a knowledge graph, comprising the following steps:
[0008] Step one, constructing a user-item bipartite graph: generating a user-item bipartite graph according to a user's historical interaction item sequence, the nodes in the user-item bipartite graph being users or items, and the edges in the user-item bipartite graph being interaction behaviors;
[0009] Step two, constructing a knowledge graph: constructing a knowledge graph according to attribute information of items, the nodes in the knowledge graph representing items and attribute values, and the edges in the knowledge graph representing the relationship between items and attributes;
[0010] Step three, constructing a user-item knowledge graph: merging the user-item bipartite graph and the knowledge graph according to the common item nodes in the two graphs to generate a user-item knowledge graph;
[0011] Step four, modeling user representation: inputting the user-item knowledge graph into a graph neural network, propagating through a message passing function layer by layer to generate a user representation;
[0012] Step five, estimating user sensitive attributes: designing a sensitive attribute estimation network to estimate the corresponding sensitive attributes of all users;
[0013] Step six, filtering user sensitive attributes: designing a filtering network to filter user sensitive attributes through adversarial training to obtain a fair user representation;
[0014] Step seven, calculating the final loss function: the final loss function is obtained by adding the recommendation loss function corresponding to the traditional recommendation task, the loss function corresponding to the sensitive attribute estimation network, and the loss function corresponding to the filtering network.
[0015] Step eight, check if the number of cycles reaches the preset number: when the set number of training is reached, end the training and provide the user with a fair recommendation result; when the set number of training is not reached, return to step four.
[0016] As a further scheme of the present application, step three models the user representation, inputs the user-item knowledge graph into the graph neural network, propagates layer by layer through the message propagation function, generates the user representation, and uses the attention mechanism to strengthen the information transmission process of the graph neural network by taking the user-item knowledge graph G as the input of the graph neural network. The representation of the user node is: the target node in the user-item knowledge graph is h, and the neighbor representation of the h node is calculated according to the following formula:
[0017]
[0018] N h ={(h,r,t)|(h,r,t)∈G};
[0019]
[0020]
[0021] In the formula, e u is the representation of the user node, σ is an activation function, W1 is a learnable weight matrix, h is a target node in the user-item knowledge graph, is the neighbor representation of the node h, α(h,r,t) is an attention value, (h,r,t) is an edge in the knowledge graph, N h is a triple with h as the head node, r is a neighbor of the node h, and t is another neighbor of the node h, is the updated representation of the lth layer node h, is the updated representation of the (l-1)th layer node h, is the updated representation of the (l-1)th layer triple with h as the head node.
[0022] As a further scheme of the present application, the calculation formula of the attention value is:
[0023] α(h,r,t)=σ(W1e t ·(W1e h +e r ));
[0024]
[0025] In the formula, σ is an activation function, W1 is a learnable weight matrix, e t is the representation of the node t, e h is the representation of the node h, and e ris the representation of node r.
[0026] As a further scheme of the present application, step five estimates the sensitive attribute of the user, estimates the sensitive attribute of all users by designing a sensitive attribute estimation network, estimates the sensitive attribute label of each user by using the obtained user representation, and the calculation formula of the sensitive attribute label is:
[0027]
[0028] In the formula: is the sensitive attribute label of the user, and W1 is a learnable weight matrix.
[0029] The node is embedded into the sensitive attribute label of the user, and the final sensitive attribute estimation representation is obtained through a softmax function:
[0030]
[0031] In the formula: is the final sensitive attribute estimation representation.
[0032] As a further scheme of the present application, step six filters the sensitive attribute of the user, designs a filtering network, filters the sensitive attribute of the user through adversarial training, and obtains a fair user representation, and the filtering network representation of the filtering sensitive attribute is:
[0033]
[0034] In the formula: m u is the filtering network representation of the filtering sensitive attribute, Q is the total number of sensitive attributes, W1 is a learnable weight matrix and corresponds to the sensitive attribute one by one.
[0035] As a further scheme of the present application, step seven calculates the final loss function, and the final loss function is obtained by adding the recommendation loss function corresponding to the traditional recommendation task, the loss function corresponding to the sensitive attribute estimation network and the loss function corresponding to the filtering network, and the specific steps are:
[0036] Step W1, the preference degree of the user for different items is calculated according to the user embedding without the sensitive attribute, and the calculation formula of the preference degree of the user for different items is:
[0037] y ui = m u T e i ;
[0038] In the formula: y ui is the preference degree of the user i for different items, m u T is the transpose of the filtering network representation of the filtering sensitive attribute.
[0039] Step W2, calculate the recommendation loss function corresponding to the traditional recommendation task The physical meaning is that the user interacts with the item, which should be higher than the item that has not interacted with it, and the recommendation loss function The calculation formula is:
[0040]
[0041] In the formula: is the recommendation loss function, g + is the observed user-item interaction, g- is the unobserved user-item interaction, y uj is the preference degree of user j to different items;
[0042] Step W3, calculate the user sensitive attribute estimation network loss function The physical meaning is semi-supervised classification, that is, using part of the user sensitive attribute label to predict the whole user sensitive attribute label, and the calculation formula of the user sensitive attribute estimation network loss function is:
[0043]
[0044] In the formula: is the user sensitive attribute estimation network loss function, S is the whole sensitive attribute, U + is the user set with sensitive attribute, s u is the label corresponding to the sensitive attribute;
[0045] Step W4, calculate the user sensitive attribute filtering network loss function Use the method of adversarial training to train a set of discriminant networks, minimize the probability of user predicted sensitive attribute, so that the user is irrelevant to the sensitive attribute, and achieve the goal of removing the user sensitive attribute, the calculation formula of the user sensitive attribute filtering network loss function is as follows:
[0046]
[0047] In the formula: is the user sensitive attribute filtering network loss function, f is the cross-entropy loss function;
[0048] Step W5, the final overall loss function calculation formula is:
[0049]
[0050] In the formula: is the final loss function, λ2 and λ3 are attenuation coefficients.
[0051] The technical effect and advantages of the fairness recommendation method for limited sensitive attribute information based on a knowledge graph are as follows:
[0052] 1. The fairness recommendation method for limited sensitive attribute information based on a knowledge graph can effectively improve the fairness of a recommendation system.
[0053] 2. The graph neural network based on an attention mechanism can model more effective user representations from a user item knowledge graph, and the user sensitive attribute estimation network can generate sensitive attribute labels for each user, thereby alleviating the problem of limited sensitive attribute information, and finally, the user sensitive attribute filtering network can ensure that the sensitive attributes of users are removed, and a fair recommendation result is provided.
[0054] 3. The method can be extended to various recommendation tasks through appropriate improvement, and has certain application prospects in the recommendation field. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 The flowchart of the fairness recommendation method for limited sensitive attribute information based on a knowledge graph. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.
[0057] The fairness recommendation method for limited sensitive attribute information based on a knowledge graph comprises the following steps:
[0058] Step 1: Constructing a user item bipartite graph: generating a user item bipartite graph according to the historical interactive item sequence of a user, the nodes in the user item bipartite graph being users or items, and the edges in the user item bipartite graph being interactive behaviors;
[0059] Step 2: Constructing a knowledge graph: constructing a knowledge graph according to the attribute information of an item, the nodes in the knowledge graph representing items and attribute values, and the edges in the knowledge graph representing the relationship between items and attributes;
[0060] Step 3: Constructing a user item knowledge graph: merging the user item bipartite graph and the knowledge graph to generate a user item knowledge graph according to the common item nodes in the user item bipartite graph and the knowledge graph;
[0061] Step four, modeling user representation: input the user item knowledge graph into the graph neural network, propagate layer by layer through the message propagation function, and generate user representation;
[0062] Step five, estimating user sensitive attribute: design a sensitive attribute estimation network to estimate the sensitive attribute of all users;
[0063] Step six, filtering user sensitive attribute: design a filtering network to filter the user sensitive attribute through adversarial training, and obtain a fair user representation;
[0064] Step seven, calculating the final loss function: the final loss function is obtained by adding the recommendation loss function corresponding to the traditional recommendation task, the loss function corresponding to the sensitive attribute estimation network and the loss function corresponding to the filtering network;
[0065] Step eight, check whether the number of cycles reaches the preset number: when the set training number is reached, end the training and provide a fair recommendation result for the user; when the set training number is not reached, return to step four.
[0066] By constructing the user item knowledge graph, the technical problem of sparse recommendation data is solved, then the graph neural network is introduced to model more effective user representation, then the user sensitive attribute estimation network is used to generate user sensitive attribute label, the technical problem of limited sensitive attribute is solved, finally the user sensitive attribute filtering network is used to generate a fair user representation, the technical problem of removing user sensitive attribute is solved, so as to realize fair recommendation, effectively improve the fairness of the recommendation system, through the user sensitive attribute estimation network, the sensitive attribute label of each user can be generated, so as to alleviate the problem of limited sensitive attribute information, finally through the user sensitive attribute filtering network, the user sensitive attribute is removed to provide a fair recommendation result.
[0067] In the step of modeling user representation in the embodiment of the application, the user item knowledge graph is input into the graph neural network, the user representation is generated by layer-by-layer propagation through the message propagation function, the user item knowledge graph G is taken as the input of the graph neural network, and the information transmission process of the graph neural network is strengthened by using the attention mechanism, and the representation of the user node is: the target node in the user item knowledge graph is h, and the neighbor representation calculation formula of the h node is:
[0068]
[0069] N h ={(h,r,t)|(h,r,t)∈G};
[0070]
[0071]
[0072] where e u is the representation of user node, σ is an activation function, W1 is a learnable weight matrix, h is the target node in the user-item knowledge graph, is the neighbor representation of node h, α(h,r,t) is the attention value, (h,r,t) is the edge in the knowledge graph, N h is the triple with h as the head node, r is a neighbor of node h, t is another neighbor of node h, is the updated representation of node h in the l-th layer, is the updated representation of node h in the (l-1)-th layer, is the updated representation of the triple with h as the head node in the (l-1)-th layer.
[0073] The calculation formula of the attention value in the embodiment of the application is:
[0074] α(h,r,t)=σ(W1e t ·(W1e h +e r ));
[0075]
[0076] where σ is an activation function, W1 is a learnable weight matrix, e t is the representation of node t, e h is the representation of node h, e r is the representation of node r.
[0077] The fifth step in the embodiment of the application estimates the sensitive attribute of the user, estimates the sensitive attribute of each user by designing a sensitive attribute estimation network, and estimates the sensitive attribute label of each user by using the obtained user representation, and the calculation formula of the sensitive attribute label is:
[0078]
[0079] where: is the sensitive attribute label of the user, W1 is a learnable weight matrix;
[0080] The node is embedded into the sensitive attribute label of the user, and then the final sensitive attribute estimation representation is obtained through a softmax function:
[0081]
[0082] where: is the final sensitive attribute estimation representation.
[0083] The step six in the embodiment of the application filters user sensitive attributes, a filtering network is designed, the user sensitive attributes are filtered through the adversarial training of the filtering network, and a fair user representation is obtained, and the filtering network for filtering sensitive attributes is represented as:
[0084]
[0085] In the formula: m u is the filtering network for filtering sensitive attributes, Q is the total number of sensitive attributes, W1 is a learnable weight matrix and corresponds to the sensitive attributes one by one.
[0086] The step seven in the embodiment of the application calculates a final loss function, and the final loss function is obtained by adding a recommendation loss function corresponding to a traditional recommendation task, a loss function corresponding to a sensitive attribute estimation network and a loss function corresponding to a filtering network, and the specific steps are as follows:
[0087] Step W1, the preference degree of a user for different items is calculated according to the user embedding without sensitive attributes, and the calculation formula of the preference degree of the user for different items is as follows:
[0088] y ui = m u T e i ;
[0089] In the formula: y ui is the preference degree of the user i for different items, m u T is the transpose of the filtering network for filtering sensitive attributes;
[0090] Step W2, a recommendation loss function corresponding to a traditional recommendation task is calculated The physical meaning is that the items interacted by the user should obtain higher scores than the items not interacted by the user, and the calculation formula of the recommendation loss function is as follows:
[0091]
[0092] In the formula: is the recommendation loss function, g + is the observed user-item interaction, g - is the unobserved user-item interaction, y uj is the preference degree of the user j for different items.
[0093] Step W3, a user sensitive attribute estimation network loss function is calculated The physical meaning is semi-supervised classification, that is, the sensitive attribute labels of all users are predicted by using part of the sensitive attribute labels of the users, and the calculation formula of the user sensitive attribute estimation network loss function is as follows:
[0094]
[0095] In the formula: The user sensitive attribute estimation network loss function is S, and S is the whole sensitive attribute, U + The user set with sensitive attributes is s u The sensitive attribute corresponding label is s
[0096] Step W4, the user sensitive attribute filtering network loss function is calculated A set of discriminant networks is trained by using the method of adversarial training, the probability of user predicted sensitive attribute is minimized, so that the user is irrelevant to the sensitive attribute, and the goal of removing the user sensitive attribute is achieved, and the calculation formula of the user sensitive attribute filtering network loss function is as follows:
[0097]
[0098] In the formula: The user sensitive attribute filtering network loss function is f, and f is the cross-entropy loss function
[0099] Step W5, the final overall loss function calculation formula is as follows:
[0100]
[0101] In the formula: The final loss function is λ2 and λ3 are attenuation coefficients.
[0102] The embodiment solves the technical problem of recommendation data sparsity by constructing a user item knowledge graph to enrich recommendation data, then introduces a graph neural network to model a more effective user representation, then generates user sensitive attribute labels through a user sensitive attribute estimation network to solve the technical problem of limited sensitive attributes, and finally generates a fair user representation through a user sensitive attribute filtering network to solve the technical problem of removing user sensitive attributes, thereby realizing fair recommendation and effectively improving the fairness of the recommendation system. The user sensitive attribute estimation network can generate sensitive attribute labels for each user, thereby alleviating the problem of limited sensitive attribute information. Finally, the user sensitive attribute filtering network ensures the removal of user sensitive attributes to provide fair recommendation results. Through appropriate improvement, it can be extended to multiple recommendation tasks and has certain application prospect in the recommendation field.
[0103] The above is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0104] Finally: the above only for the preferred embodiments of the present application, and not for limiting the present application, any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application, should be included in the scope of protection of the present application.
Claims
1. A fairness recommendation method for limited sensitive attribute information based on a knowledge graph, characterized in that, Comprising the following steps: Step one, constructing a user-item bipartite graph: generating a user-item bipartite graph according to the user's historical interaction project sequence, the nodes in the user-item bipartite graph are users or projects, and the edges in the user-item bipartite graph are interaction behaviors; Step two, constructing a knowledge graph: constructing a knowledge graph according to the attribute information of the project, the nodes in the knowledge graph represent projects and attribute values, and the edges in the knowledge graph represent the relationship between projects and attributes; Step three, constructing a user-item knowledge graph: merging the user-item bipartite graph and the knowledge graph according to the common project nodes in the user-item bipartite graph and the knowledge graph to generate a user-item knowledge graph; Step four, modeling user representation: inputting the user-item knowledge graph into the graph neural network, propagating through the message passing function layer by layer to generate the user representation; Step five, estimating user sensitive attributes: designing a sensitive attribute estimation network to estimate the sensitive attributes of all users; Step six, filtering user sensitive attributes: designing a filtering network to filter user sensitive attributes through adversarial training to obtain fair user representation; Step seven, calculating the final loss function: the final loss function is obtained by adding the recommendation loss function corresponding to the traditional recommendation task, the loss function corresponding to the sensitive attribute estimation network, and the loss function corresponding to the filtering network; Step eight, check if the number of cycles reaches the preset number: when the set number of training times is reached, end the training and provide a fair recommendation result for the user; when the set number of training times is not reached, return to step four; Step 2 models the user representation, inputs the user-item knowledge graph into the graph neural network, propagates layer by layer through the message passing function, generates the user representation, and inputs the user-item knowledge graph as the input of the graph neural network, and uses the attention mechanism to strengthen the information transmission process of the graph neural network. The representation of the user node is: , The calculation formula of the neighbor representation of the node is: ; ; ; ; wherein: is a representation of a user node, is an activation function, is a learnable weight matrix, is a target node in a user-item knowledge graph, is a node a neighbor representation of, is an attention value, is an edge in a knowledge graph, is a triple with as head node, is a neighbor of node , is another neighbor of node , is the updated representation of the layer node , is the updated representation of the layer node , is the updated representation of the layer triple with as head node; Step five estimates the user's sensitive attributes by designing a sensitive attribute estimation network to estimate the user's corresponding sensitive attributes, and estimates the sensitive attribute label of each user using the obtained user representation, the calculation formula of the sensitive attribute label is: ; wherein: is a sensitive attribute label for the user, is a learnable weight matrix; Embedding the node into the user's sensitive attribute label, and then obtaining the final sensitive attribute estimation representation through the softmax function: ; In the formulae: The final estimate of the sensitive attribute representation.
2. The fairness recommendation method for limited sensitive attribute information based on a knowledge graph according to claim 1, characterized in that, The calculation formula of the attention value is: ; ; where: is an activation function, is a learnable weight matrix, is a representation of a node , is a representation of a node , is a representation of a node .
3. The method of claim 1, wherein, Step six filters the user's sensitive attributes by designing a filtering network to filter the user's sensitive attributes through adversarial training to obtain fair user representation, and the filtering sensitive attribute filtering network is represented as: ; wherein: is a filter network for filtering sensitive attributes, is the total number of sensitive attributes, is a learnable weight matrix and corresponds to a sensitive attribute one-to-one.
4. The method of claim 1, wherein, Step seven calculates the final loss function, and the final loss function is obtained by adding the recommendation loss function corresponding to the traditional recommendation task, the loss function corresponding to the sensitive attribute estimation network, and the loss function corresponding to the filtering network, the specific steps are: Step W1, calculate the user's preference for different projects according to the user's embedding without sensitive attributes, the calculation formula of the user's preference for different projects is: ; wherein: is the degree of preference of user i for different items, is the transpose of the filtered network representation filtered on sensitive attributes; Step W2, calculate the recommendation loss function corresponding to the traditional recommendation task The physical meaning is that the items interacted by the user should get higher scores than the items not interacted by the user, and the calculation formula of the recommendation loss function is: ; where: is a recommendation loss function, is an observed user-item interaction, is an unobserved user-item interaction, is the degree of preference of user j for different items; Step W3, calculating the user sensitive attribute estimation network loss function The physical meaning is semi-supervised classification, i.e., predicting the user sensitive attribute label of the whole user by using part of the user sensitive attribute label. The calculation formula of the user sensitive attribute estimation network loss function is: ; In the formula: is a user-sensitive attribute estimation network loss function, is a global sensitive attribute, is a user set with a sensitive attribute, is a label corresponding to the sensitive attribute; Step W4, calculating the user sensitive attribute filtering network loss function , a set of discriminative networks is trained by using the method of adversarial training, the probability of predicting the sensitive attribute of the user is minimized, so that the user is irrelevant to the sensitive attribute, the goal of removing the sensitive attribute of the user is achieved, and the calculation formula of the user sensitive attribute filtering network loss function is as follows: ; In the formula: is a user-sensitive attribute filtering network loss function, is a cross-entropy loss function; Step W5, the final overall loss function calculation formula is: ; In the formula: is the final loss function, and is the decay coefficient.
Citation Information
Patent Citations
Knowledge graph-based fairness recommendation algorithm
CN116340595A
Utilizing a graph neural network to generate visualization and attribute recommendations
US20230297625A1