Long-tail data distribution-oriented recommendation method and system in federated environment

By using a federal recommendation method that decouples the learning and attention mechanism in a federal environment, explicitly decouples the attractiveness of items and performs model aggregation, the problem of poor recommendation performance of long-tail items by the federal recommendation system is solved, achieving higher recommendation diversity and novelty, while ensuring user privacy and security.

CN119557520AInactive Publication Date: 2025-03-04YIZHENG POWER SUPPLY OF JIANGSU ELECTRIC POWER +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411617586.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing federal recommendation system is prone to overfitting popular items when training on datasets of long-tail item distribution, resulting in poor recommendation performance for long-tail items. In the federal environment, there is a lack of prior global user item interaction data distribution information, making it difficult to directly apply the traditional long-tail recommendation model.

Method used

A recommended method for distribution of long-tail data in a federated environment is proposed. By using the FedLTR-AD model learned by decoupling representation on the user side, the attraction of items is explicitly decoupled into two factors: fame and niche, and the attention mechanism is used to aggregate the model on the server side to ensure the accuracy and effectiveness of the optimization model on the real power usage data.

Benefits of technology

It improves the probability of recommendation for long-tail items, improves the diversity and novelty of recommendations, ensures recommendation performance in a federal environment, and ensures the security of user privacy data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557520A_ABST
    Figure CN119557520A_ABST
Patent Text Reader

Abstract

The invention provides a long-tail data distribution-oriented recommendation method and system in a federated environment, and the method comprises the steps: firstly, enabling a current popular neural collaborative filtering recommendation model to be federated according to the comprehensive demands of a recommendation system in the federated environment for user privacy security and recommendation accuracy, so as to obtain a federated recommendation model FedNCF; and the privacy and the high efficiency of the federal recommendation result are ensured. Then, in consideration of personalized requirements of the user on recommended items, a long-tail recommendation model of a user side explicitly decouples the attraction of the items into fame attraction and niche attraction by utilizing decoupling representation learning to effectively mine user preferences; according to the model aggregation method of the server side, global attention aggregation is carried out on fame part model parameters through an attention mechanism, self-attention aggregation is carried out on niche part parameters to complete long-tail perception of a global model under federation, and the diversity and novelty of recommendation results are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a federated recommendation method and system for long-tail data distribution. Background Art

[0002] In recent years, the federated recommendation system has become popular and has attracted widespread attention. In a federated environment, for each user, their feature vector and interaction data with items are stored on the local client, so they are private to other users and federated recommendation application providers. The emergence of the federated recommendation system solves the problems of privacy leakage and centralization bottleneck in traditional centralized recommendation systems, allowing user data on "data islands" to be shared and integrated. It has the advantages of data dispersion, high security, and privacy protection, and is expected to become an important development direction for recommendation systems in the future.

[0003] In the federated recommendation system, the user-item interaction data on the client device is generated by the user during use. Each user is an independent individual with various preferences, so the interaction data with the items reflects the different preferences of each user. This leads to the heterogeneity of the user-item interaction data, that is, the inherent data non-independent and identically distributed phenomenon in the federated environment; it also leads to a small number of popular items gaining the attention of most users, while the significantly larger number of less popular items only have a small number of user feedback, and the overall user-item interaction data will obey the "80 / 20 rule" and show a long tail phenomenon.

[0004] Existing federated recommendation systems are trained directly on datasets with long-tail item distributions. However, ignoring the long-tail characteristics makes it easy to overfit a small number of popular items, resulting in poor recommendation performance for a large number of long-tail items, which further reduces the diversity and novelty of recommendations and causes popularity bias - the recommendation frequency of popular items even exceeds the recommendation frequency that their popularity should have. If the federated recommendation system can recommend some less popular but more subdivided niche items to users, it can allow users to find items that are more in line with their interests and hobbies, improve user satisfaction and user experience, and also help users discover new items and expand their range of choices.

[0005] Currently, a lot of work has been done to implement long-tail recommendation models in a data-centralized environment. However, whether it is a clustering-based, graph-based, or neural network-based long-tail recommendation model, it is designed and implemented under the condition that the global user-item interaction data distribution is known. However, in a federated environment, user-item interaction data is stored on the user's local device. Each user does not know whether he is watching or buying a popular item or a long-tail item, and the server does not know the global user-item interaction data distribution. The data-centralized long-tail recommendation model cannot be directly applied to the federated environment without prior global user-item interaction data distribution information.

[0006] Therefore, in the power application scenario, the long-tail recommendation model in the data set faces such specific challenges in optimizing the power consumption of user devices. The power usage data of each user is stored locally, and each user does not know whether he belongs to a high-energy consumption device (popular device) or a low-energy consumption device (long-tail device). The server side cannot obtain the global distribution of power usage data. In this case, the traditional long-tail recommendation model is difficult to directly apply to the power optimization federation environment without prior global power data distribution information. Therefore, it is necessary to design a federated recommendation model to process local data of power consumption and perform overall optimization. Summary of the invention

[0007] The present invention aims to solve at least one of the technical problems existing in the prior art.

[0008] The present invention provides the following technical solution: a recommendation method for long-tail data distribution in a federated environment, comprising the following steps:

[0009] Step 1: Establish the federated recommendation model FedNCF, initialize the server, set relevant parameters, and organize local training of each client;

[0010] Step 2: The client performs training and updating of the user-side FedLTR-AD model, and uses the leave-one-out method to select test items and their feature side information from the real data set and input them into the local model. The overall training loss is calculated according to the long-tail coefficient formula through explicit attraction decoupling and the neural collaborative filtering layer;

[0011] Step 3: The server uses the attention mechanism to measure the contribution of each client to aggregate the model, and sends the perceived aggregated model to each client for the next round of training. After the model converges, the server sends the final model to each client for model inference.

[0012] In step 1, relevant parameters are set including feature embedding dimension, learning rate, training batch size, loss function, and optimizer.

[0013] Step 2 includes the following steps:

[0014] (1): The FedLTR-AD model on the user side inputs the unique-hot code of the local user and the selected item ID, and encodes different features of the item as the input side information;

[0015] (2): After the embedding layer, the latent feature vectors corresponding to the user and the item are obtained; the explicit attraction decoupling layer measures the influence of different feature vectors on the two attraction factors of fame and niche, and obtains the user and item latent vectors corresponding to the two factors after attraction decoupling, which are forward propagated as input to the neural collaborative filtering layer;

[0016] (3): Calculate the loss function and output the loss function values ​​corresponding to the two attractive factors of fame and niche;

[0017] (4): Calculate the loss function value of the overall training target based on the long-tail coefficient;

[0018] (5): Minimize the overall loss and update the local model parameters.

[0019] The influence on the two attractiveness factors of fame and niche is calculated as follows:

[0020] Impact on fame:

[0021]

[0022] Impact on niche:

[0023]

[0024] in, is the influence of fame attractiveness factor on user u, is the influence of the niche attractiveness factor on user u; j = 0, 1, 2, …, l; r (fa) and r (ni) are the K-dimensional vectors of the two attractive factors, fame and niche, which are trainable parameters in the neural network. is the jth latent vector of the item.

[0025] The long tail coefficient is calculated as follows:

[0026] First, use the total number of interactions of all items Inter all Inter the number of times item i is interacted with i The proportion c′ i To measure the long tail degree of item i, the specific formula is as follows:

[0027]

[0028] Use min-max standardization to linearly transform the long tail degree and change the long tail coefficient c i Mapped to [0,1], the specific formula is as follows:

[0029]

[0030] Among them, min(c′ I ) represents the minimum value of the long tail degree of all items before standardization; max(c′ I ) represents the maximum value of the long tail degree of all items before standardization.

[0031] Use the long tail coefficient as loss fa and loss ni The weights of , weighted summation to get the final loss function, the calculation formula is as follows:

[0032] loss all =(1-c i )loss fa +c i loss ni

[0033] Among them, loss fa and loss ni They are the loss function values ​​corresponding to fame and niche attractiveness factors respectively.

[0034] Step three includes the following steps:

[0035] (1): After receiving the parameters of the federated recommendation model FedNCF returned by each client, the server aggregates the model parameters related to fame and niche in different ways;

[0036] The update rule of the fame-related model parameter Θ_f using global attention aggregation is as follows:

[0037]

[0038] Where t represents the training round, U represents the set of all clients, is the function for calculating similarity, represents the aggregate weight of user u in round t, Indicates the difference in fame-related parameters between user u in the new round and the previous round. Indicates the difference between the parameters of user u in the new round and the previous round;

[0039] The update rule of the niche-related model parameters Θ_n using self-attention aggregation is as follows:

[0040]

[0041] Where t represents the training round, U represents the set of all clients, and k represents the selected user. is the function for calculating similarity, represents the aggregate weight of user u in round t, Indicates the difference in niche-related parameters between user u in the new round and the previous round. Indicates the difference in niche-related parameters between user k in the new round and the previous round; It represents the exponential of the similarity function.

[0042] (2): Calculate whether the global communication round has been reached or the predetermined model accuracy has been achieved; if so, the training is completed and go to step (3); otherwise, the server sends the relevant model parameters to each client and goes to step 2 to continue the next round of training;

[0043] (3): The server broadcasts the converged model to each client for actual application reasoning.

[0044] A recommendation system for long-tail data distribution in a federated environment includes a server and several clients. The clients and the server work together to achieve the recommendation task for long-tail data distribution. The client includes a training control module and a collaborative interaction module, and the server includes a central control module, a client management module, a client selection module, and a collaborative interaction module.

[0045] The central control module is used to manage the entire federated training process; the client management module is used to manage the users participating in the training and save the client information on the server side; the client selection module is used to dynamically select a subset of clients during the global training process; and the collaborative interaction module is used to manage the information transmitted between the server and the client.

[0046] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0047] (1) The present invention adopts the currently popular NCF model based on the neural collaborative filtering method as the basic recommendation model, which has good recommendation accuracy and can accurately analyze the usage pattern of power equipment. In a federated environment, in view of the non-independent and identically distributed characteristics of data, the present invention uses decoupled representation learning on the user side to achieve long-tail perception, and performs aggregation optimization through the attention mechanism on the server side to ensure the accuracy and effectiveness of the optimization model on real power usage data.

[0048] (2) The present invention innovatively proposes a federated recommendation method for the long-tail data distribution of power equipment. In view of the problem that most current federated recommendation frameworks ignore the long-tail data distribution characteristics of real data sets of power equipment and fail to fully tap the potential of a large number of low-frequency used equipment, the present invention enhances the diversity of power usage patterns and the novelty of equipment use by increasing the optimization weight of long-tail equipment.

[0049] (3) The federated recommendation in the present invention is based on a distributed architecture. During the model training process, the user power usage data of each client is retained locally, and the client has a specially designed long-tail perception mechanism. This process does not expose the privacy data on each terminal, thereby ensuring security.

[0050] (4) With the popularization of deep neural networks, complex models can provide more accurate predictions of electricity usage, but at the same time they need to learn more parameters, require the devices involved in the training to have certain computing capabilities, and incur certain communication costs. However, in cross-user power optimization systems, user devices are usually very lightweight (such as smart meters, home terminal devices), which poses a challenge to balancing recommendation accuracy and limited communication resources and computing resources. The deep learning model used in the centralized recommendation system is not suitable for lightweight user devices. The present invention implements a resource-friendly neural network model to meet the constraints of lightweight user devices, while taking into account the system's requirements for low latency and low cost, which is conducive to application and promotion and has strong feasibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 This is a model diagram of the basic recommended model NCF adopted by the present invention;

[0052] Figure 2 Schematic diagram of the overall structure of the Federated Long Tail Recommendation Model (FedLTR-AD) with explicit attractiveness decoupling;

[0053] Figure 3 This is a schematic diagram of the architecture of the federated recommendation method for long-tail distribution;

[0054] Figure 4 Schematic diagram of the prototype system of the federated recommendation method based on long-tail perception. DETAILED DESCRIPTION

[0055] The technical solution provided by the present invention will be described in detail below in conjunction with specific embodiments. It should be understood that the following specific implementation methods are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0056] The basic components of the federated recommendation system are: a server and several clients. User privacy data is stored locally on the client, and the user's Top-K recommended item list is also stored locally on the client without having to be uploaded to the server.

[0057] The present invention provides a federated recommendation system based on long-tail perception, wherein the core interaction mainly includes two parts, a client and a server, which work together to realize the recommendation task oriented to the long-tail data distribution.

[0058] The overall prototype structure of the system is as follows Figure 4 The client execution module mainly includes a training control module and a collaborative interaction module. The training control module controls the local training process and implements a federated long-tail recommendation model with explicit attraction decoupling. The collaborative interaction module manages communication data and uses message queues to upload data.

[0059] The server-side execution module mainly includes four functional modules: the central control module is used to manage the entire federated training process; the client management module is used to manage users participating in the training and save the client information on the server; the client selection module is used to dynamically select a subset of clients during the global training process; and the collaborative interaction module is used to manage the information transmitted between the server and the client. In the above two modules, model update calculation tasks need to be performed based on the deep model training support platform. At the same time, during the federated training process, both the server execution module and the client execution module require the assistance of the communication module. Therefore, this system designs the communication function as a separate functional module, and both the server-side execution module and the client execution module have specific methods for implementing the communication module.

[0060] The entire system is divided into four layers from the perspective of logical architecture, including: physical resource layer, basic service layer, system service layer, and application layer. Among them, the physical resource layer uses multiple servers as infrastructure to provide physical resource support such as computing and storage. Then, the basic service layer provides basic services such as message queues, databases, and monitoring systems to provide support for upper-level system services and application services. Secondly, the system service layer is the core of the entire system, providing key functions such as training and model reasoning of the federated long-tail recommendation model, and implementing a multi-process multi-client parallel training method. Thirdly, the application layer is the top-level business layer, which provides application services such as model verification and personalized recommendations, and interacts with the system service layer.

[0061] The core mechanism of the present invention mainly includes three parts: a federated collaborative filtering recommendation framework, a long-tail recommendation model with explicit attractiveness decoupling on the user side, and a long-tail perception aggregation module based on the attention mechanism on the server side.

[0062] The server and each client collaborate to complete the long-tail-aware federated recommendation framework method. This method implements a long-tail-aware privacy recommendation model on the user side. It uses the idea of ​​decoupled representation learning to explicitly decouple the attractiveness of items into two factors: fame and niche. It also guides the training direction of the federated long-tail recommendation model through the item's secondary information. It implements a long-tail-aware model aggregation method on the server side. Based on the attention mechanism, it performs global attention aggregation on the decoupled fame model parameters and self-attention aggregation on the niche model parameters. First, the server needs to perform preprocessing preparations, which include the following steps:

[0063] Step 1: Establish the federal recommendation model FedNCF

[0064] Step 1-1: Implement the basic recommendation model NCF based on neural collaborative filtering, whose architecture is as follows Figure 1 shown.

[0065] The present invention proposes to use a user-item interaction matrix to represent the interaction relationship between users and items in a data set. Each value in the user-item interaction matrix represents the probability of each item interacting with the user.

[0066] The NCF model inputs the unique hot code ID of each user and each item, and then passes through the Embedding layer to obtain the latent feature vectors of the user and item. Then, the NCF model uses MLP to learn the user's rating function Υ for the item, and the model output is limited to the range of (0,1). When training the NCF model, the BCE loss function is used to quantify the difference between the model's predicted rating and the actual rating of the training data set. The process of using the basic recommendation model NCF of neural collaborative filtering to recommend items specifically includes the following steps:

[0067] (1) Each user u∈U’s unique code ID is processed by the embedding layer to obtain a latent feature vector p u Similarly, each item i∈I has a unique ID and a hidden feature vector q i . p u and q i They are all K-dimensional latent vectors, where K is a system hyperparameter;

[0068] (2) The NCF model uses MLP to learn the user's scoring function for items, which is specifically expressed as follows:

[0069] Υ(p u ,,q i )=a out (h T Φ(p u (☉q i ))

[0070] Among them, a out , h, Φ and ⊙ represent the activation function, weight vector, MLP function and the corresponding multiplication of the same element respectively. Sigmoid function is used as a out , so that the model output is limited to the range of (0,1).

[0071] use To represent the predicted score of user u for item i, that is, user u’s preference for item i. In NCF, The calculation method is as follows:

[0072]

[0073] (3) When training the NCF model, the BCE loss function is used to quantify the difference between the model prediction score and the actual score of the training dataset. u represents the loss function of user u, which is specifically expressed as follows:

[0074]

[0075] Among them, D u represents the training data set of user u, consisting of item-rating pairs (i,Y ui ). If user u interacts with item i, then Y ui =1 (positive sample); otherwise, Y ui =0 (negative sample).

[0076] Step 1-2: In the federated recommendation system, the server initializes the federated recommendation model FedNCF. The federated recommendation model FedNCF is based on the basic recommendation model NCF of centralized neural collaborative filtering recommendation, which can balance the user's limited device resources and the requirements for recommendation accuracy in a distributed training environment.

[0077] The federated recommendation model FedNCF includes a generalized matrix decomposition part and a multi-layer perceptron part. It uses a method of integrating linear and nonlinear relationships to fully explore users' interest preferences for items.

[0078] Set the feature embedding dimension, learning rate, training batch size, loss function, and optimizer; and set the hyperparameters of federated learning, including the total number of communication rounds between the server and the client, the number of client training times in each round, etc.

[0079] Step 1-3: The server selects and notifies a certain number of clients, sends the initial federated recommendation model parameters to the clients, and prepares to start model training.

[0080] Step 2: The client performs decoupled representation learning to perform long-tail perception, explicitly decoupling the attractiveness of items into two factors: fame and niche. The main steps are as follows:

[0081] Step 2-1: Input the unique hot code ID of the user and item, and encode the different features of the item differently as the input side information; just like the basic recommendation model NCF in step 1, the K-dimensional latent feature vector p is obtained through the Embedding layer u and q i ;

[0082] Step 2-2: Input item secondary information and use specific encoding methods for different features of the item: for continuous features, directly input the original value in binary format; for categorical features, use one-hot encoding; for textual description information, use the bag-of-words model for encoding. Encode each feature into K dimensions through padding operation, then concatenate to obtain multi-hot feature encoding, obtain the item feature vector through the Embedding layer, and concatenate it with the item invisible feature vector in step 2-1;

[0083] Step 2-3: For the input item feature vector, first measure the influence of each feature on fame and niche.

[0084] The calculation formula for the degree of influence on fame is as follows:

[0085]

[0086] The formula for calculating the impact on the niche is as follows:

[0087]

[0088] in, is the influence of fame attractiveness factor on user u, is the influence of the niche attractiveness factor on user u; j = 0, 1, 2, …, l; r (fa) and r (ni) are all K-dimensional vectors, which are trainable parameters in the neural network. is the jth latent vector of the item.

[0089] For user u, similarly, we can calculate Calculations for users and items can be performed in parallel.

[0090] Step 2-4: Aggregate all features to obtain a comprehensive representation of each attractiveness factor after decoupling, and make the latent vectors of users and items have the same dimension.

[0091] For each item i, the calculation formula is as follows:

[0092]

[0093] FFN(x)=W f x+b f is a single-layer feedforward neural network, W f , b f are neural network parameters.

[0094] For user u, we can also calculate Calculations for users and items can be performed in parallel.

[0095] The client has now completed the task of the explicit attraction decoupling layer. Next, the present invention further completes the training and reasoning of the FedLTR-AD model on the client. The overall structure of the FedLTR-AD model with explicit attraction decoupling is as follows: Figure 4 As shown, the main steps are as follows:

[0096] Step 3: The client performs training and updating of the FedLTR-AD model. If the global round is not reached or the global model has not converged, the local model is trained according to the overall training goal of considering the decoupled attractiveness factors. Otherwise, the predicted rating of the user for the item is calculated and a list of Top-K recommended items is generated.

[0097] Step 3-1: The neural collaborative filtering layer of the recommendation model on the client obtains the latent vectors of the fame factors corresponding to users and items And the latent vector corresponding to the niche factor After inputting, calculate the loss function according to the formula (3) in step 1-1, and output the loss function values ​​corresponding to fame and niche attractiveness factors respectively. fa and loss ni .

[0098] Step 3-2: Design and calculate the long tail coefficient of each item.

[0099] First, use the total number of interactions of all items Inter all Inter the number of times item i is interacted with i The proportion c′ i To measure the long tail degree of item i, the specific formula is as follows:

[0100]

[0101] Use min-max standardization to linearly transform the long tail degree and change the long tail coefficient c i Mapped to [0,1], the specific formula is as follows:

[0102]

[0103] Among them, min(c′ I ) represents the minimum value of the long tail degree of all items before standardization; max(c′ I ) represents the maximum value of the long tail degree of all items before standardization.

[0104] Step 3-3: Use the long tail coefficient as loss fa and loss ni The weights of , weighted summation to get the final loss function, the calculation formula is as follows:

[0105] loss all =(1-c i )loss fa +c i loss ni

[0106] Minimize the loss function value according to the overall training objective and update the model parameters.

[0107] Step 3-4: If the iteration round has not ended, send the model parameters that are not related to user privacy to the server for global aggregation; if the iteration round has ended, use the current model to calculate the user's predicted score for the item, and sort the items in descending order according to the predicted score to generate a Top-K item recommendation list.

[0108] The calculation formula for the final prediction score is as follows:

[0109]

[0110] here, and are the predicted scores of the corresponding attractiveness factors fame and niche; c i is the long tail coefficient of the item.

[0111] The client uploads the updated federated recommendation model to the server, and the local training process for this round ends. The architecture of the federated recommendation framework for long-tail distribution is as follows: Figure 4 shown.

[0112] Step 4: The server is responsible for aggregating the models of each client based on long-tail perception and sending the aggregated updated model parameters to each client for the next round of training. After the model converges, the server sends the final model to each client for model reasoning.

[0113] The server continues with the following process:

[0114] Step 4-1: After receiving the federated recommendation model parameters returned by each client, the server aggregates the fame and niche related model parameters in different ways.

[0115] The update rule of the fame-related model parameter Θ_f using global attention aggregation is as follows:

[0116]

[0117] Where t represents the current training round, U represents the set of all clients, is the function for calculating similarity (dot product is used here), represents the aggregate weight of user u in round t, The denominator of represents the sum of the numerators calculated for all users u. Indicates the difference in fame-related parameters between user u in the new round and the previous round. represents the difference between the parameters of user u in the new round and the previous round. This formula takes into account that most users have some herd mentality, so it pays more attention to the similarity between individual user behavior and group user behavior.

[0118] The update rule of the niche-related model parameters Θ_n using self-attention aggregation is as follows:

[0119]

[0120] Where t represents the training round, U represents the set of all clients, and u and k represent the selected users. is the function for calculating similarity (dot product is used here), represents the aggregate weight of user u in round t, The denominator of represents the sum of the numerators calculated for all users u. Indicates the difference in niche-related parameters between user u in the new round and the previous round. Indicates the difference in niche-related parameters between user k in the new round and the previous round, Indicates taking the exponential of the similarity function (i.e., the exponential function symbol). In this formula, the weight Measures the similarity between the behavior of individual user u and the behavior of individual user k, which means that the behavior of individual users that is more similar to the behavior of individual user u will have a greater weight when aggregated.

[0121] Step 4-2: The server calculates whether the global communication round has been reached or the predetermined model accuracy has been reached. If so, the training is completed and goes to step 4-3; otherwise, the server sends the model parameters to each client and goes to step 2-1 to continue the next round of training.

[0122] Step 4-3: The server broadcasts the converged model to each client, and the model can be used for actual application reasoning.

[0123] The present invention firstly aims at the comprehensive requirements of user privacy security and recommendation accuracy of the recommendation system in a federated environment, and rationally federates the currently popular neural collaborative filtering recommendation model to ensure the privacy and efficiency of the federated recommendation results. Then, considering the personalized needs of users for recommended items, the long-tail recommendation model on the user side uses decoupled representation learning to explicitly decouple the attractiveness of items into fame attractiveness and niche attractiveness to effectively mine user preferences. The model aggregation method on the server side uses the attention mechanism to perform global attention aggregation on the fame model parameters and self-attention aggregation on the niche parameters to complete the long-tail perception of the global model under the federation, thereby improving the diversity and novelty of the recommendation results.

[0124] The present invention realizes a model aggregation method of a user-side long-tail recommendation model and a server-side long-tail perception based on a federated recommendation model (Federated Neural Collaborative Filtering, FedNCF).

[0125] The user-side long-tail recommendation model uses the decoupled representation learning that has become popular in recent years. It explicitly decouples the attractiveness of items into two factors: fame and niche. It also uses the item's secondary information to guide the training direction of the federated long-tail recommendation model.

[0126] The server-side long-tail-aware model aggregation method is based on the attention mechanism, which performs global attention aggregation on the decoupled fame model parameters and self-attention aggregation on the niche model parameters.

[0127] The federated long-tail recommendation method of these two modules is implemented, which increases the probability of recommending long-tail items and improves diversity and novelty without significantly affecting the accuracy of the recommendations.

[0128] The technical means disclosed in the scheme of the present invention are not limited to the technical means disclosed in the above-mentioned implementation mode, but also include technical schemes composed of any combination of the above-mentioned technical features. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also regarded as the protection scope of the present invention.

Claims

1. A recommendation method for long-tail data distribution in a federated environment, characterized in that: The steps include: Step 1: Establish the federated recommendation model FedNCF, initialize the server, set relevant parameters, and organize local training of each client; Step 2: The client performs training and updating of the user-side FedLTR-AD model, and uses the leave-one-out method to select test items and their feature side information from the real data set and input them into the local model. The overall training loss is calculated according to the long-tail coefficient formula through explicit attraction decoupling and the neural collaborative filtering layer; Step 3: The server uses the attention mechanism to measure the contribution of each client to aggregate the model, and sends the perceived aggregated model to each client for the next round of training. After the model converges, the server sends the final model to each client for model inference.

2. According to claim 1, a recommendation method for long-tail data distribution in a federated environment is characterized in that: In step 1, relevant parameters are set including feature embedding dimension, learning rate, training batch size, loss function, and optimizer.

3. According to claim 1, a recommendation method for long-tail data distribution in a federated environment is characterized in that: Step 2 includes the following steps: (1): The FedLTR-AD model on the user side inputs the unique-hot code of the local user and the selected item ID, and encodes different features of the item as the input side information; (2): After the embedding layer, the latent feature vectors corresponding to the user and the item are obtained; the explicit attraction decoupling layer measures the influence of different feature vectors on the two attraction factors of fame and niche, and obtains the user and item latent vectors corresponding to the two factors after attraction decoupling, which are forward propagated as input to the neural collaborative filtering layer; (3): Calculate the loss function and output the loss function values ​​corresponding to the two attractive factors of fame and niche; (4): Calculate the loss function value of the overall training target based on the long-tail coefficient; (5): Minimize the overall loss and update the local model parameters.

4. The recommendation method for long-tail data distribution in a federated environment according to claim 3, characterized in that: The influence on the two attractiveness factors of fame and niche is calculated as follows: Impact on fame: Impact on niche: in, is the influence of fame attractiveness factor on user u, is the influence of the niche attractiveness factor on user u; j=0,1,2,…,l;r (fa) and r (ni) are the K-dimensional vectors of the two attractive factors, fame and niche, which are trainable parameters in the neural network. is the jth latent vector of the item.

5. The recommendation method for long-tail data distribution in a federated environment according to claim 3, characterized in that: The long tail coefficient is calculated as follows: First, use the total number of interactions of all items Inter all Inter the number of times item i is interacted with i The proportion c′ i To measure the long tail degree of item i, the specific formula is as follows: Use min-max standardization to linearly transform the long tail degree and change the long tail coefficient c i Mapped to [0,1], the specific formula is as follows: Among them, min(c′ I ) represents the minimum value of the long tail degree of all items before standardization; max(c′ I ) represents the maximum value of the long tail degree of all items before standardization.

6. The recommendation method for long-tail data distribution in a federated environment according to claim 1, characterized in that: Use the long tail coefficient as loss fa and loss ni The weights of , weighted summation to get the final loss function, the calculation formula is as follows: loss all =(1-c i )loss fa +c i loss ni Among them, loss fa and loss ni They are the loss function values ​​corresponding to fame and niche attractiveness factors respectively.

7. The recommendation method for long-tail data distribution in a federated environment according to claim 1, characterized in that: Step three includes the following steps: (1): After receiving the parameters of the federated recommendation model FedNCF returned by each client, the server aggregates the model parameters related to fame and niche in different ways; The update rule of the fame-related model parameter Θ_f using global attention aggregation is as follows: Where t represents the training round, U represents the set of all clients, is the function for calculating similarity, represents the aggregate weight of user u in round t, Indicates the difference in fame-related parameters between user u in the new round and the previous round. Indicates the difference between the parameters of user u in the new round and the previous round; The update rule of the niche-related model parameters Θ_n using self-attention aggregation is as follows: Where t represents the training round, U represents the set of all clients, and k represents the selected user. is the function for calculating similarity, represents the aggregate weight of user u in round t, Indicates the difference in niche-related parameters between user u in the new round and the previous round. Indicates the difference in niche-related parameters between user k in the new round and the previous round; It represents the exponential of the similarity function. (2): Calculate whether the global communication round has been reached or the predetermined model accuracy has been achieved; if so, the training is completed and go to step (3); otherwise, the server sends the relevant model parameters to each client and goes to step 2 to continue the next round of training; (3): The server broadcasts the converged model to each client for actual application reasoning.

8. A recommendation system for long-tail data distribution in a federated environment, characterized in that: A recommendation method for long-tail data distribution in a federated environment for implementing any one of claims 1-7, It includes a server and several clients. The client and server work together to achieve recommendation tasks for long-tail data distribution. The client includes a training control module and a collaborative interaction module. The server includes a central control module, a client management module, a client selection module, and a collaborative interaction module. The central control module is used to manage the entire federated training process; The client management module is used to manage users participating in training and save client information on the server side; The client selection module is used to dynamically select a client subset during the global training process; the collaborative interaction module is used to manage the information transmitted between the server and the client.