Fair recommendation method and system based on timeliness perception and adversarial learning
By generating a static diagram of user items and performing graph representation learning, removing sensitive attribute information, introducing a time decay function, and building a discriminator for adversarial training, the problem of ignoring the fairness and time factors of item side in the existing recommendation model is solved, and fair and accurate user recommendations are achieved.
Patent Information
- Application Number
- CN202510439069.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-08-05
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing recommendation model ignores the fairness and time factors on the item side when considering fairness, resulting in users not getting a fair recommendation opportunity.
By generating a static diagram of user items, performing graph representation learning, using filters to remove sensitive attribute information, introducing a time decay function, building a discriminator for adversarial training, and generating an accurate and fair recommendation model.
A fair recommendation that takes into account user interest changes and item timeliness in the group recommendation scenario is achieved, providing fair and accurate user recommendation results.
Smart Images

Figure CN120430835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a recommendation system in deep learning, and in particular to a fairness recommendation method and system based on timeliness perception and adversarial learning. Background Art
[0002] In the digital age, the way we access information has undergone tremendous changes. With the surge in the number of users, the amount of data has also exploded, undoubtedly posing challenges for users in sifting through information. In this context, while users enjoy the convenience of data, they also face the problem of information overload. Information overload not only makes it more difficult for users to obtain valuable information, but can also lead to ineffective advertising for service providers, increasing promotional costs. Therefore, accurately identifying and meeting user needs has become increasingly important, leading to the emergence of recommendation systems.
[0003] Since most current recommendation models only consider accuracy and ignore fairness, there is an urgent need for a recommendation system that provides users with both accuracy and fairness, known as fair recommendation. Fair recommendation is a technology designed to reduce bias and discrimination in algorithmic decision-making and ensure equal opportunities for all user groups. Current fair recommendation models typically focus solely on the user side, rarely considering item-side fairness. Furthermore, these models fail to fully account for the impact of time on fair recommendations, resulting in users not receiving fair recommendations. Summary of the Invention
[0004] Purpose of the invention: To address the above shortcomings, the present invention provides an accurate and fair fairness recommendation method and system based on timeliness perception and adversarial learning.
[0005] Technical solution: To solve the above problems, the present invention adopts a fairness recommendation method based on timeliness perception and adversarial learning, which includes the following steps:
[0006] Step 1: Generate static images of user items based on public datasets;
[0007] Step 2: Learn a graph representation for the static graph of user items. Filters are used to remove sensitive attribute information to obtain a node-debiased representation. A time decay function is introduced into the node-debiased representation to obtain a temporal feature representation. A discriminator is constructed to predict sensitive attribute information from the temporal feature representation. Based on the loss function, adversarial training is performed between the generator and the discriminator to obtain a trained recommendation model.
[0008] Step 3: Recommend items of interest to users through the trained recommendation model.
[0009] Furthermore, step 1 specifically includes: screening category information, user-item interaction times, and data magnitude in a public dataset to obtain an experimental dataset, and constructing a user-item static graph based on the experimental dataset.
[0010] Furthermore, in step 2, the node debiasing expression obtained by removing sensitive attribute information through a filter is:
[0011]
[0012] Among them, e i is the initial embedding of the user or item, f i For the filtered user or item embedding representation, for K sensitive attributes, the filter network Includes K sub-filters: Each sensitive attribute k is associated with a sub-filter associated.
[0013] Furthermore, the node debiasing is represented by introducing a time decay function:
[0014]
[0015] Among them, e n represents the raw embedding representation of the nth item that user u interacts with, is the user feature representation after considering timeliness, t n is the timestamp when the user interacts with the nth item, λ t is the decay rate, t max Indicates the time closest to the current time, that is, the current moment, t sub The time for analyzing user timeliness is T, which is the time window.
[0016] Furthermore, based on the user feature representation after considering timeliness, the timeliness feature representation of user u based on the self-centered graph structure is obtained for:
[0017]
[0018] in, is the sum of the time-sensitive features of users and items, where S and S v Represent the timeliness representation matrix of all users and all items respectively, is the representation function of the summary local graph structure of user u, G u is the local network of user u;
[0019] Given a sensitive attribute vector x i , the traditional approach is to design the value function based on the embedding of the current node:
[0020]
[0021] in, The above value function only considers the fairness in the filtered embedding space and ignores the time-sensitive fairness exposed by the local graph structure. Adversarial training is used to ensure that the sensitive attributes of each user are not exposed by the local graph structure:
[0022]
[0023] Fairness-based value function V G It is a combination of two parts: V G =V N +V S , where the first part captures node-level fairness, and the second part models self-centered time-effect fairness; weighted average pooling is used to achieve the time-effect feature representation of user u based on the self-centered graph structure.
[0024]
[0025] Among them, A u is the adjacency matrix of user u, r uv is the original interaction value between user u and item v, represents the timeliness of item v;
[0026] The L-th order user-centered time-effectiveness graph structure aggregation is:
[0027]
[0028] Among them, a ij is the edge weight in the edge weight matrix A, A i is the subset of directly connected nodes i in the edge weight matrix A, is the temporal representation of node j connected to node i, L is the number of average pooling layers, are the representations of node i on the 1st and lth layers respectively.
[0029] Furthermore, the discriminator includes a local discriminator and a global discriminator. The local discriminator predicts the value of the sensitive attribute, and its value function is:
[0030]
[0031] Among them, V G is the log-likelihood of the predicted attribute distribution;
[0032] The global discriminator is used to correctly distinguish between the user rating scale and the reference rating scale. Specifically, the reference rating scale is estimated from the training data, where the reference rating r0[i] of item i is defined as the average rating of users who rated item i in the training data; on the other hand, the rating scale of user u is The item rating predicted by the model is obtained, that is, The predicted rating of user u for item i, the predicted probability of sampling rating sample φ from the reference rating scale r0 is:
[0033]
[0034] Where Δ is the global discriminator implemented as a Δ Parameterized MLP;
[0035] The training of the global discriminator is achieved by maximizing the log-likelihood formula, which is:
[0036]
[0037] Among them, when the rating sample φ is sampled from the reference rating scale r0, then δ φ =1, otherwise δ φ =0;
[0038] For the rating distribution that follows Gaussian distribution, the mean of Gaussian distribution is the predicted rating, and the value function V R The solution is:
[0039]
[0040] in, r uv is the original interaction value between user u and item v, is the number of users, is the number of items, V R is the log-likelihood of the rating distribution, is the predicted preference of user u for item v.
[0041] Furthermore, the recommendation model is obtained through adversarial training between the discriminator and the generator, and the loss function of the discriminator is:
[0042]
[0043] The loss function of the generator is:
[0044]
[0045] Among them, λ1, λ2, λ3 are hyperparameters.
[0046] The present invention also adopts a fairness recommendation system based on timeliness perception and adversarial learning, comprising:
[0047] The dataset processing module is used to generate static images of user items based on the public dataset;
[0048] The model building module is used to learn a graph representation of a static graph of user items. It removes sensitive attribute information through a filter to obtain a node-debiased representation. A time decay function is introduced into the node-debiased representation to obtain a temporal feature representation. A discriminator is constructed to predict sensitive attribute information from the temporal feature representation. Based on a loss function, the generator and discriminator are adversarially trained to obtain a trained recommendation model.
[0049] The recommendation module is used to recommend items of interest to users through the trained recommendation model.
[0050] The present invention also adopts a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0051] The present invention also adopts a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above method when executed by a processor.
[0052] Beneficial effect: Compared with the existing technology, the significant advantage of the present invention is that it proposes a group recommendation fairness algorithm based on timeliness perception and adversarial learning for the task scenario of group recommendation fairness. This method fully considers the changes in user interests over time and the timeliness of items, uses local discriminators to obtain debiased representations of users and items, and then obtains a user recommendation list, and then uses a global discriminator to optimize to obtain a fair recommendation result for the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a flowchart of the fairness recommendation method of the present invention.
[0054] Figure 2 It is a framework diagram of the algorithm model in the present invention.
[0055] Figure 3 This is a framework diagram of the temporal encoder in the present invention. DETAILED DESCRIPTION
[0056] Example 1
[0057] like Figure 1 As shown, in this embodiment, a fairness recommendation method based on timeliness perception and adversarial learning includes the following steps:
[0058] Step 1: Analyze and process the public dataset to generate a user-item static graph. Based on the actual experimental situation, filter the public dataset by category information, number of user-item interactions, and data volume to generate the experimental dataset. Construct the user-item static graph based on the experimental dataset.
[0059] Step 2: The static graph of user items obtained by processing the data set in step 1 is converted into a user-item bipartite graph G. The user-item bipartite graph is used to obtain a time-sensitive and bias-free representation of users and items, and unify the evaluation scale of each user. In the time-sensitive adversarial learning module, a fairness filter is first used to remove bias information in the user and item nodes, and then a time-sensitive encoder is used to obtain the time-sensitive features of the nodes (users and items); in the local discriminator part, the fairness features of users and items are improved through adversarial training, with the goal of eliminating sensitive attribute information in the nodes as much as possible; and in the global discriminator link, the goal is to maximize the unification of the scoring standards of different users to achieve overall fairness.
[0060] Step 2-1, based on the user-item bipartite graph G, the original embedding representation E of users and items is learned by encoding. In the time-sensitive adversarial learning module, given the original embedding matrix E and sensitive attributes X, a combination of K sub-filters is designed as the filter Remove the information of the user protection attribute X so that each node (user and item) is filtered from the original embedding space E to the embedding space Among them Since there are K sensitive attributes, the filter network It consists of K sub-filters: Each sensitive attribute k is associated with a sub-filter Then, each entity (user or item) is filtered and represented in the filtered embedding space as:
[0061]
[0062] Among them, e i Initial embed for a user or item.
[0063] Given the filtered embedding space, which eliminates user sensitive feature information, user u’s predicted preference for item v is Calculated as:
[0064]
[0065] Given a sensitive attribute vector x i , the traditional approach is to design the value function based on the embedding of the current node:
[0066]
[0067] The above value function only considers fairness in the filtered embedding space and assumes the independence of users, without considering that the sensitive attributes of user u are not affected by their local network G. u Therefore, a temporal encoder is designed. By introducing a time decay function, the user is obtained in a short window (t sub -T,t sub ) inside the feature representation:
[0068]
[0069] Among them, e n Represents the original embedding representation of the nth item interacted by user u, t n is the timestamp when the user interacts with the nth item, λ t is the decay rate, which controls how quickly time decays. is the user feature representation after considering timeliness, t max Indicates the time closest to the current time, and T is the time window.
[0070] For user u, the filtered user embedding representation cannot fully characterize the local graph structure of the user. Therefore, given the filtered node embedding space, the self-centered graph structure representation of each user u based on the timeliness feature is obtained as follows:
[0071]
[0072] in, is the sum of the time-sensitive features of users and items, where and Represent the timeliness representation matrix of all users and all items respectively, is the representation function of the summary local graph structure of user u, It is a self-centered graph structure representation of user u based on temporal features, which can be an aggregation of the user’s highest L-th order neighborhood representations, or can be implemented using the most advanced complex graph representation learning model.
[0073] Given each user u has a time-sensitive local graph structure representation Adversarial training is used to ensure that each user's sensitive attributes are not exposed by the local graph structure:
[0074]
[0075] Achieved through weighted average pooling :
[0076]
[0077] The above pooling technique is used to aggregate the first-order user-centric temporal network, i.e., the direct neighbors of user u. In order to model the L-th higher-order user-centric network, the above formula is extended to aggregate the L-th order user-centric temporal graph structure and learn the L-th order neighborhood representation of each user u centered on itself. for:
[0078]
[0079] where a ij is the edge weight in the edge weight matrix A. In this matrix, A i is the subset of directly connected node i in the edge weight matrix A.
[0080] In step 2-2, the purpose of the filter is to learn the embedding representation in the recommendation task and filter sensitive features. The purpose of the discriminator is to predict user sensitive features and weaken the ability of the filter to learn sensitive features. The two play a minimax game. The local discriminator ▽ uses adversarial training technology to achieve fairness. Specifically, given a filter network There are K discriminator sub-networks. By embedding the filtered u As input, the kth sub-discriminator tries to predict the value of the kth sensitive attribute. That is, each sub-discriminator As a classifier to guess the kth attribute, its value function is:
[0081]
[0082] Among them, V G is the log-likelihood of the predicted attribute distribution.
[0083] In step 2-3, in order to unify the evaluation scales among different users, a global discriminator Δ is introduced. It is essentially a binary classifier that attempts to determine whether the rating sample comes from the reference rating scale or the user rating scale. Let Φ be a rating sample consisting of K ratings, all of which come from the reference rating scale r0 or the user rating scale r of a certain user u. u :
[0084]
[0085] where Δ is realized as a function of Θ Δ parameterized MLP, while is the predicted probability of Φ sampled from the reference scale r0. Since MLP can only accept fixed-length input, the sample size K is fixed to 128 in our experiments.
[0086] The goal of the global discriminator is to correctly distinguish the user scale from the reference scale, which can be achieved by maximizing the following log-likelihood:
[0087]
[0088] If φ is sampled from r0, then δ φ =1, otherwise δ φ =0.
[0089] Step 3: Create a recommendation model loss function and an adversarial loss function, train the network model, and use the trained model to recommend fair and interesting items to users. Specifically, the following steps are performed:
[0090] Step 3-1: For the rating distribution, assume that it follows a Gaussian distribution, and the mean of the Gaussian distribution is the predicted rating. Therefore, the value function V R The solution is:
[0091]
[0092] Among them, V R is the log-likelihood of the score distribution, the precision parameter in the Gaussian distribution is omitted, is the number of users, is the number of items, r uv is the original interaction value between user u and item v.
[0093] Step 3-2, jointly train the fairness filter, discriminator, and base model. As in typical adversarial training, we alternate between optimizing the discriminator and the generator.
[0094] For the discriminator, we defeat the generator by using a local discriminator to identify the sensitive attributes of users and items, and use a global discriminator to distinguish between the user evaluation scale and the reference evaluation scale. The adversarial training formula is as follows.
[0095]
[0096] The goals of the generator, filter, and base model are threefold: (1) to deceive the local discriminator so that the debiased user / item embeddings do not carry biased information; (2) to deceive the global discriminator so that the predicted user rating scale is indistinguishable from the reference rating scale; and (3) the debiased embedding representation still enables the base model to accurately learn user-item preferences. The adversarial training formula is as follows:
[0097]
[0098] Among them, λ1, λ2, λ3 and are hyperparameters that control the trade-offs between different objectives.
[0099] During training, the discriminator is first updated While keeping the base model and filters included The generator inside is unchanged. Next, the generator is updated while keeping the discriminator fixed. We repeatedly alternate between these two steps until all parameters converge.
[0100] Step 3-3: Use the trained model to predict the items that the target group is most interested in and output the prediction results.
[0101] Example 2
[0102] Based on the same inventive concept, the present invention provides a fairness recommendation system based on timeliness perception and adversarial learning, including: a data set processing module, which screens and processes the data set to generate data for experiments; a discriminator module, which optimizes the fairness of user and item nodes. In the timeliness perception adversarial learning module, a fairness filter is used to filter the attribute information of user and item nodes, and a timeliness encoder is used to obtain the timeliness representation of the node (user and item); in the local discriminator module, adversarial training technology is used to optimize the fairness representation of users and items, and the sensitive attribute information of the node is eliminated as much as possible; in the global discriminator, the rating scale of each user is unified to the greatest extent to achieve global fairness; and a model training module and a prediction module, which are used to train the network model and use the trained model to predict the items that the target group is more interested in and more fair. The detailed implementation steps of each module refer to the above embodiment 1 and will not be repeated here.
[0103] Example 3
[0104] Based on the same inventive concept, the present invention provides a recommendation system based on timeliness perception and adversarial learning, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the computer program is loaded into the processor, it implements the recommendation method based on timeliness perception and adversarial learning.
[0105] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
Claims
1. A fair recommendation method based on timeliness perception and adversarial learning, characterized by: The following steps are involved: Step 1: Generate static images of user items based on public datasets; Step 2: Learn a graph representation for the static graph of user items. Filters are used to remove sensitive attribute information to obtain a node-debiased representation. A time decay function is introduced into the node-debiased representation to obtain a temporal feature representation. A discriminator is constructed to predict sensitive attribute information from the temporal feature representation. Based on the loss function, adversarial training is performed between the generator and the discriminator to obtain a trained recommendation model. Step 3: Recommend items of interest to users through the trained recommendation model.
2. The fairness recommendation method according to claim 1, characterized in that: The step 1 specifically includes: screening the category information, the number of user-item interactions, and the data magnitude in the public dataset to obtain an experimental dataset, and constructing a user-item static graph based on the experimental dataset.
3. The fairness recommendation method according to claim 2, characterized in that: In step 2, the node debiasing expression obtained by removing sensitive attribute information through a filter is: Among them, e i is the initial embedding of the user or item, f i For the filtered user or item embedding representation, for K sensitive attributes, the filter network Includes K sub-filters: Each sensitive attribute k is associated with a sub-filter associated.
4. The fairness recommendation method according to claim 3, characterized in that: The node debiasing is represented by introducing a time decay function: Among them, e n represents the raw embedding representation of the nth item that user u interacts with, is the user feature representation after considering timeliness, t n is the timestamp when the user interacts with the nth item, λ t is the decay rate, t max Indicates the time closest to the current time, that is, the current moment, t sub The time for analyzing user timeliness is T, which is the time window.
5. The fairness recommendation method according to claim 4, characterized in that: Based on the user feature representation after considering timeliness, the timeliness feature representation of user u based on the self-centered graph structure is obtained. for: in, is the sum of the time-sensitive features of users and items, where and Represent the timeliness representation matrix of all users and all items respectively, is the representation function of the summary local graph structure of user u, G u is the local network of user u; Given a sensitive attribute vector x i , the traditional approach is to design the value function based on the embedding of the current node: in, The above value function only considers the fairness in the filtered embedding space and ignores the time-sensitive fairness exposed by the local graph structure. Adversarial training is used to ensure that the sensitive attributes of each user are not exposed by the local graph structure: Fairness-based value function V G It is a combination of two parts: V G =V N +V S , where the first part captures node-level fairness, and the second part models self-centered time-effect fairness; weighted average pooling is used to achieve the time-effect feature representation of user u based on the self-centered graph structure. Among them, A u is the adjacency matrix of user u, r uv is the original interaction value between user u and item v, represents the timeliness of item v; The L-th order user-centered time-effectiveness graph structure aggregation is: Among them, a ij is the edge weight in the edge weight matrix A, A i is the subset of directly connected nodes i in the edge weight matrix A, is the temporal representation of node j connected to node i, L is the number of average pooling layers, are the representations of node i on the 1st and lth layers respectively.
6. The fairness recommendation method according to claim 5, characterized in that: The discriminator includes a local discriminator and a global discriminator. The local discriminator predicts the value of the sensitive attribute, and its value function is: Among them, V G is the log-likelihood of the predicted attribute distribution; The global discriminator is used to correctly distinguish between the user rating scale and the reference rating scale. Specifically, the reference rating scale is estimated from the training data, where the reference rating r0[i] of item i is defined as the average rating of users who rated item i in the training data; on the other hand, the rating scale of user u is The item rating predicted by the model is obtained, that is, The predicted rating of user u for item i, the predicted probability of sampling rating sample φ from the reference rating scale r0 is: Where Δ is the global discriminator implemented as a Δ Parameterized MLP; The training of the global discriminator is achieved by maximizing the log-likelihood formula, which is: Among them, when the rating sample φ is sampled from the reference rating scale r0, then δ φ =1, otherwise δ φ =0; For the rating distribution that follows Gaussian distribution, the mean of Gaussian distribution is the predicted rating, and the value function V R The solution is: in, r uv is the original interaction value between user u and item v, is the number of users, is the number of items, V R is the log-likelihood of the rating distribution, is the predicted preference of user u for item v.
7. The fairness recommendation method according to claim 6, characterized in that: The recommendation model is obtained through adversarial training between the discriminator and the generator. The loss function of the discriminator is: The loss function of the generator is: Among them, λ1, λ2, λ3 are hyperparameters.
8. A fair recommendation system based on timeliness perception and adversarial learning, characterized by: include: The dataset processing module is used to generate static images of user items based on the public dataset; The model building module is used to learn a graph representation of a static graph of user items. It removes sensitive attribute information through a filter to obtain a node-debiased representation. A time decay function is introduced into the node-debiased representation to obtain a temporal feature representation. A discriminator is constructed to predict sensitive attribute information from the temporal feature representation. Based on a loss function, the generator and discriminator are adversarially trained to obtain a trained recommendation model. The recommendation module is used to recommend items of interest to users through the trained recommendation model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.