CN112287231A - Method and device for acquiring Federation recommendation gradient, intelligent terminal and storage medium - Google Patents

Method and device for acquiring Federation recommendation gradient, intelligent terminal and storage medium Download PDF

Info

Publication number
CN112287231A
CN112287231A CN202011222354.2A CN202011222354A CN112287231A CN 112287231 A CN112287231 A CN 112287231A CN 202011222354 A CN202011222354 A CN 202011222354A CN 112287231 A CN112287231 A CN 112287231A
Authority
CN
China
Prior art keywords
gradient
noise
noisy
common
denoising
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011222354.2A
Other languages
Chinese (zh)
Other versions
CN112287231B (en
Inventor
梁锋
潘微科
明仲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen University
Original Assignee
Shenzhen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen University filed Critical Shenzhen University
Priority to CN202011222354.2A priority Critical patent/CN112287231B/en
Publication of CN112287231A publication Critical patent/CN112287231A/en
Application granted granted Critical
Publication of CN112287231B publication Critical patent/CN112287231B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method and a device for acquiring a Federal recommendation gradient, an intelligent terminal and a storage medium, wherein the method for acquiring the Federal recommendation gradient comprises the following steps: acquiring a common object and a denoised object; acquiring a first noise-containing gradient through each common object based on the model parameters; based on the model parameters, acquiring a second noise-containing gradient through each denoising object; and eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient. Therefore, the first noisy gradient and the second noisy gradient both contain corresponding gradient noise, and the scoring behavior of the user can be protected; meanwhile, after the first noisy gradient and the second noisy gradient are obtained, corresponding gradient noise can be eliminated, and a target gradient without the gradient noise is obtained. Therefore, the scheme can eliminate gradient noise while protecting the scoring behavior of the user, and improve the accuracy of the model in the federal recommendation process.

Description

Method and device for acquiring Federation recommendation gradient, intelligent terminal and storage medium
Technical Field
The invention relates to the technical field of federal recommendation, in particular to a method and a device for acquiring a federal recommendation gradient, an intelligent terminal and a storage medium.
Background
With the improvement of the privacy protection consciousness of people, the traditional method of collecting user data to a server side by a system filtering algorithm and the like and then modeling is not feasible any more because the privacy of the user can be leaked. Google firstly proposes federal learning to solve the privacy problem of users, some researches further combine the federal learning with a collaborative filtering algorithm in a recommendation system, user data are guaranteed to be kept in the local of users in the modeling process, and only model parameters are uploaded to a server to update the models, namely, the federal recommendation.
In the prior art, in federal recommendation, the gradient of virtual user unscored items and the gradient of user real scored items are uploaded to a server together, so that the scoring behavior of a user is protected. For example, a mixed filling method is proposed in a display Feedback federal Recommendation (fed Recommendation with Explicit Feedback, hereinafter referred to as FedRec) proposed by Guanyu Lin, and the like, unscored articles of a part of users are randomly sampled, then a virtual score is assigned to the unscored articles by using average score filling and predictive score filling, so that gradients of the unscored articles are obtained, and the gradients of the scored articles and the unscored articles of the users are uploaded to a server together, so that the server cannot determine which articles are truly scored by the users according to the gradients, and scoring behaviors of the users are protected.
The problem in the prior art is that the gradient of the virtual user unscored items and the gradient of the user real scored items are uploaded to a server side together, and gradient noise (namely the gradient of the virtual user unscored items) is introduced while the scoring behavior of the user is protected, so that the accuracy of a model in the federal recommendation process is reduced, and the recommendation effect is reduced.
Thus, there is still a need for improvement and development of the prior art.
Disclosure of Invention
Aiming at the technical problems that in the prior art, the gradient of a virtual user unscored article and the gradient of a user real scored article are uploaded to a server side together, gradient noise is introduced while the scoring behavior of the user is protected, and model accuracy and a recommendation effect are reduced, the invention provides a method, a device, an intelligent terminal and a storage medium for obtaining a federated recommendation gradient, and model parameters can be obtained; acquiring a common object and a denoised object; acquiring a first noise-containing gradient through each common object based on the model parameters; based on the model parameters, acquiring a second noise-containing gradient through each denoising object; and eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient. The method comprises the steps that a common object and a denoising object are respectively arranged, gradient noise is eliminated through a first noise-containing gradient obtained by the common object and a second noise-containing gradient obtained by the denoising object, the grading behavior of a user is protected, meanwhile, the gradient noise is eliminated, and a target gradient without the gradient noise is obtained, so that the accuracy and the recommendation effect of a model in the federal recommendation process are improved.
In order to achieve the above technical effect, a first aspect of the present invention provides a method for acquiring a federal recommended gradient, where the method includes:
obtaining model parameters;
acquiring a common object and a denoised object;
acquiring a first noise-containing gradient through each common object based on the model parameters, wherein the first noise-containing gradient comprises a common object gradient and common object gradient noise which are acquired by calculating each common object;
acquiring a second noise gradient through each denoising object based on the model parameters, wherein the second noise gradient comprises a denoising object gradient and denoising gradient noise which are calculated and acquired by each denoising object;
and eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient.
Optionally, the obtaining the common object and the denoised object includes:
acquiring all object sets for evaluation;
acquiring a denoising object based on a preset denoising object threshold and the object set;
and taking all the objects in the object set except the denoising object as common objects.
Optionally, the obtaining a first noise-containing gradient through each of the common objects based on the model parameters includes:
sending the model parameters to each common object;
respectively controlling each common object to calculate and obtain the common object gradient and the common object gradient noise based on the model parameters, and generating the first noise-containing gradient based on the common object gradient and the common object gradient noise;
obtaining said first noisy gradient for each of said generic objects.
Optionally, the obtaining a second noisy gradient through each of the denoised objects based on the model parameters includes:
respectively controlling each common object to send the gradient noise of the common object to any one denoising object;
sending the model parameters to each denoising object;
respectively controlling each denoising object to calculate and obtain the gradient of the denoising object based on the model parameters, obtaining the denoising gradient noise based on all received common object gradient noises, and generating the second noise-containing gradient based on the gradient of the denoising object and the denoising gradient noise, wherein the denoising gradient noise is the sum of the common object gradient noises received by the denoising object;
and acquiring the second noise-containing gradient of each denoising object.
Optionally, the subtracting the denoising gradient noise from the denoising object gradient by the second denoising gradient, and eliminating the common object gradient noise and the denoising gradient noise based on the first denoising gradient and the second denoising gradient to obtain the target gradient includes:
calculating and acquiring a first target noisy gradient based on each first noisy gradient, wherein the first target noisy gradient is the sum of each first noisy gradient;
calculating and acquiring a second target noisy gradient based on each second noisy gradient, wherein the second target noisy gradient is the sum of each second noisy gradient;
and calculating and acquiring the difference between the first target noise-containing gradient and the second target noise-containing gradient as the target gradient.
The second aspect of the present invention provides a federated recommendation gradient acquisition apparatus, wherein the apparatus includes:
the parameter acquisition module is used for acquiring model parameters;
the object acquisition module is used for acquiring a common object and a denoising object;
a first noisy gradient obtaining module, configured to obtain a first noisy gradient through each of the common objects based on the model parameter, where the first noisy gradient includes a common object gradient and a common object gradient noise that are obtained by calculation of each of the common objects;
a second noisy gradient obtaining module, configured to obtain a second noisy gradient through each of the denoised objects based on the model parameter, where the second noisy gradient includes a denoised object gradient and a denoised gradient noise that are obtained by calculating each of the denoised objects;
and the target gradient obtaining module is used for eliminating the common object gradient noise and the denoising gradient noise based on the first denoising gradient and the second denoising gradient to obtain a target gradient.
Optionally, the first noisy gradient obtaining module includes:
a common object parameter sending unit, configured to send the model parameter to each common object;
a first noisy gradient generating unit configured to control each of the normal objects to calculate and obtain the normal object gradient and the normal object gradient noise based on the model parameter, and generate the first noisy gradient based on the normal object gradient and the normal object gradient noise;
a first noisy gradient obtaining unit configured to obtain the first noisy gradient of each of the common objects.
Optionally, the second noisy gradient obtaining module includes:
a common object control unit, configured to control each common object to send the gradient noise of the common object to any one of the denoising objects;
a denoising object parameter sending unit, configured to send the model parameter to each denoising object;
a second noise gradient generating unit, configured to respectively control each of the denoising objects to calculate and obtain a gradient of the denoising object based on the model parameter, obtain the denoising gradient noise based on all received gradient noises of the common object, and generate the second noise gradient based on the gradient of the denoising object and the denoising gradient noise, where the denoising gradient noise is a sum of the gradient noises of the common object received by the denoising object;
and a second noisy gradient obtaining unit, configured to obtain the second noisy gradient of each of the denoising objects.
A third aspect of the present invention provides an intelligent terminal, including a memory, a processor, and a program stored in the memory and executable on the processor, where the program, when executed by the processor, implements the steps of any of the methods for acquiring a federal recommendation gradient.
A fourth aspect of the present invention provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods for acquiring a federal recommendation gradient.
From the above, the scheme of the invention obtains the model parameters; acquiring a common object and a denoised object; acquiring a first noise-containing gradient through each common object based on the model parameters; based on the model parameters, acquiring a second noise-containing gradient through each denoising object; and eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient. According to the scheme, the common object and the denoising object are respectively arranged, gradient noise is eliminated through the first noise-containing gradient obtained by the common object and the second noise-containing gradient obtained by the denoising object, the grading behavior of a user is protected, meanwhile, the gradient noise is eliminated, and the target gradient without the gradient noise is obtained. Therefore, compared with the scheme that the gradient of the virtual user unscored object and the gradient of the user real scored object are uploaded to the server side together in the prior art, the scheme can eliminate gradient noise, and therefore accuracy and a recommendation effect of a model in the federal recommendation process are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a method for acquiring a bang recommended gradient according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a detailed process of step S200 in FIG. 1 according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a detailed process of step S300 in FIG. 1 according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a detailed process of step S400 in FIG. 1 according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a detailed process of step S500 in FIG. 1 according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a server-side and client-side interaction provided by an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a bang recommended gradient acquisition apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of the first noisy gradient obtaining module 730 shown in fig. 7 according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of the second noisy gradient acquisition module 740 in fig. 7 according to an embodiment of the present invention;
fig. 10 is a schematic block diagram of an internal structure of an intelligent terminal according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings of the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced otherwise than as specifically described and similarly intended by those of ordinary skill in the art without departing from the spirit of the present invention, which is not limited to the specific embodiments disclosed below.
With the increasing emphasis on privacy and the release of some related privacy protection laws, the issue of how to protect user privacy is becoming more and more important. In the field of federal recommendation technology, there has also been a considerable portion of research on privacy protection of users 'scoring behavior, which generally protects users' scoring behavior by uploading a gradient of virtual, unscored items. For example, in the FedRec, unscored items of a part of users are randomly sampled, then a virtual score is assigned to the unscored items by using average score filling and prediction score filling, so that gradients of the unscored items are obtained, and the gradients of the scored items of the users and the gradients of the unscored items are uploaded to the server, so that the server cannot determine which items are truly scored by the users according to the gradients, and scoring behaviors of the users are protected. The problem in the prior art is that the gradient of the virtual user unscored items and the gradient of the user real scored items are uploaded to a server side together, and gradient noise (namely the gradient of the virtual user unscored items) is introduced while the scoring behavior of the user is protected, so that the accuracy of a model in the federal recommendation process is reduced, and the recommendation effect is reduced. Therefore, the FedRec-based scheme capable of protecting the scoring behavior of the user and eliminating the gradient noise is provided, so that the accuracy and the recommendation effect of the model in the federal recommendation process are improved.
In order to solve the problems in the prior art, the invention provides a method for obtaining a Federation recommendation gradient, wherein in the embodiment of the invention, when a user is required to evaluate an article, a model parameter is obtained; acquiring a common object and a denoised object; acquiring a first noise-containing gradient through each common object based on the model parameters; based on the model parameters, acquiring a second noise-containing gradient through each denoising object; and eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient. Therefore, the gradient noise is eliminated through the first noise-containing gradient obtained by the common object and the second noise-containing gradient obtained by the de-noising object, the grading behavior of the user is protected, the gradient noise is eliminated, and the target gradient without the gradient noise is obtained. Therefore, compared with the scheme that the gradient of the virtual user unscored object and the gradient of the user real scored object are uploaded to the server side together in the prior art, the scheme can eliminate gradient noise while protecting the scoring behavior of the user, and therefore accuracy and a recommendation effect of a model in the federal recommendation process are improved.
Exemplary method
As shown in fig. 1, an embodiment of the present invention provides a method for acquiring a federal recommended gradient, where the method includes the following steps:
and step S100, obtaining model parameters.
Wherein the model parameters are latent feature vectors of the object, and in this embodiment, V is usedA potential feature vector representing an item I, wherein I belongs to I, I is a set of all items in the training set and has
Figure BDA0002762504970000081
Where d is the dimension of the potential feature vector,
Figure BDA0002762504970000082
and step S200, acquiring a common object and a denoising object.
Step S300, obtaining a first noisy gradient through each of the common objects based on the model parameters, where the first noisy gradient includes a common object gradient and a common object gradient noise obtained by calculation of each of the common objects.
Step S400, obtaining a second noise gradient through each of the denoising objects based on the model parameters, where the second noise gradient includes a denoising object gradient and a denoising gradient noise obtained by calculating each of the denoising objects.
In this embodiment, the server executes the federal recommended gradient acquisition method, the common object and the denoising object are clients associated with the server, users correspond to the clients one to one, and the object gradient is generated by performing scoring calculation on an object by the clients, and the server acquires the object gradient uploaded by each client and finally calculates the object gradient, that is, the real gradient of the object by the client.
In this embodiment, the common object is a common client, and is configured to perform real scoring and virtual scoring on an article to obtain the first noise-containing gradient. The denoising object is a denoising client, and as shown in step S400, the denoising client is configured to truly score the article and collect gradient noise of the common client in the scoring process, that is, gradient noise of the common object. Wherein the common object gradient noise is associated with a virtual rating of the item by the common client.
In the embodiment of the invention, the gradients obtained by the server from the common client and the denoising client both contain gradient noise, and the server cannot know the specific scoring conditions of the common client and the denoising client on the articles by the user (for example, the user corresponding to a certain common client scores the articles really and does not score the articles really), so that the scoring behavior of the user corresponding to the client is protected.
Step S500, eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient, and obtaining a target gradient.
Specifically, each of the first noisy gradients includes a common object gradient noise corresponding to a common object, each of the second noisy gradients includes a sum of common object gradients (i.e., a denoised gradient noise) of one or more common objects received by a corresponding denoised object, and a common object only sends its common object gradient noise to a denoising client, that is, the sum of the common object gradient noise included in all the first noisy gradients is equal to the sum of the denoised gradient noise included in all the second noisy gradients.
As can be seen from the above, the federal recommended gradient acquisition method provided by the embodiment of the present invention acquires model parameters; acquiring a common object and a denoised object; acquiring a first noise-containing gradient through each common object based on the model parameters; based on the model parameters, acquiring a second noise-containing gradient through each denoising object; and eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient. Therefore, the first noisy gradient obtained through the common object and the second noisy gradient obtained through the de-noising object both contain corresponding gradient noise, and the scoring behavior of the user can be protected; meanwhile, after the first noisy gradient and the second noisy gradient are obtained, corresponding gradient noise can be eliminated, and a target gradient without the gradient noise is obtained. Therefore, compared with the scheme that the gradient of the virtual user unscored object and the gradient of the user real scored object are uploaded to the server side together in the prior art, the scheme can eliminate gradient noise while protecting the scoring behavior of the user, and therefore accuracy and a recommendation effect of a model in the federal recommendation process are improved.
Specifically, as shown in fig. 2, in this embodiment, the step S200 includes:
in step S210, all object sets for evaluation are acquired.
Step S220, obtaining a denoised object based on a preset denoised object threshold and the object set.
Step S230, using all objects in the object set except the denoised object as common objects.
In this embodiment, the object set for evaluation includes all clients corresponding to the users for scoring, the denoising object is a denoising client, and the common object is a common client. The preset denoising object threshold may be a preset numerical value, or may be adjusted according to actual requirements, which is not limited herein. In actual use, the server side acquires all the clients, randomly screens the clients based on a preset denoising object threshold value to obtain denoising clients, and takes other clients as common clients. Optionally, other screening manners may also be provided, for example, sorting and screening may be performed according to the device condition corresponding to each client, which is not specifically limited herein.
Specifically, as shown in fig. 3, in this embodiment, the step S300 includes:
step S310, sending the model parameters to each of the common objects.
Step S320, respectively controlling each of the normal objects to calculate and obtain the normal object gradient and the normal object gradient noise based on the model parameters, and generating the first noise-containing gradient based on the normal object gradient and the normal object gradient noise.
In step S330, the first noisy gradient of each of the common objects is obtained.
In this embodiment, the server executes the federal recommendation method, and the server obtains and initializes the model parameter VI belongs to I, I is a set of all articles in a training set, and the model parameters are sent to users corresponding to the common objects
Figure BDA0002762504970000101
Wherein the content of the first and second substances,
Figure BDA0002762504970000102
for the above-mentioned set of all objects for evaluation (i.e. the set of all clients),
Figure BDA0002762504970000103
for a de-noised set of objects (i.e. a de-noised set of clients),
Figure BDA0002762504970000104
to belong to a set
Figure BDA0002762504970000105
But not in the aggregate
Figure BDA0002762504970000106
I.e. a set of common objects (i.e. a set of common clients).
Optionally, after the model parameters are sent to each of the common objects, when a user corresponding to the common object truly scores an item, the gradient of the item may be obtained based on the corresponding realistic score. However, for some articles, the user corresponding to the common object does not perform real scoring, and at this time, the virtual score of the corresponding article is obtained through the average score and the prediction score, wherein the calculation formulas of the average score and the prediction score are respectively shown in the following formulas (1) and (2):
Figure BDA0002762504970000111
Figure BDA0002762504970000112
wherein r'uiScoring the virtual grade of the item i for the user u, m being the number of items actually scored by the user, yukIs an indicator variable, rukThe user is given a rating score for item k,
Figure BDA0002762504970000113
Figure BDA0002762504970000114
a range of ratings for the item for the user, an
Figure BDA0002762504970000115
T is the number of iterations of the current algorithm, TpredictTo begin the number of iterations of using the virtual grade score as a virtual score for the corresponding item,
Figure BDA0002762504970000116
is the transpose of the feature vector of item i, T is the number of iterations of the algorithm,
Figure BDA0002762504970000117
a user potential feature vector for user u, d a dimension of the potential feature vector,
Figure BDA0002762504970000118
for item i, in FedRec, the gradient is shown in equation (3) below:
Figure BDA0002762504970000119
wherein the content of the first and second substances,
Figure BDA00027625049700001110
for all users
Figure BDA00027625049700001111
The sum of the gradients of item i is divided by
Figure BDA00027625049700001112
Figure BDA00027625049700001113
Representing a set of users who truly score or virtually score an item i,
Figure BDA00027625049700001114
a gradient for user u to item i, and
Figure BDA00027625049700001115
the calculation of (a) is as shown in the following equations (4) and (5):
Figure BDA00027625049700001116
Figure BDA00027625049700001117
wherein, UThe potential feature vector of the user u is represented by lambda which is a weight parameter and can be preset in the algorithm, and y isuiIs an indicator variable.
In step S320, the server controls each of the common clients to calculate according to the formula (1), the formula (2), the formula (4), and the formula (5) based on the model parameters and the real rating data of the userObtaining a first noise gradient of the user u corresponding to each common client to the article i
Figure BDA00027625049700001118
Wherein, IuA collection of items rated by user u, I 'above'uIs a set of items sampled for virtual scoring from items not scored by user u and has | I'u|=ρ|IuAnd | where ρ is a preset sampling parameter. Optionally, ρ may be 1, 2, or 3, or may take other values according to the actual situation, which is not specifically limited herein. In this embodiment, for the items that are not actually scored by the user, only a part of the items (ρ times the number of actually scored items) is sampled for virtual scoring, so that the scoring behavior of the user is protected, and the calculation amount is reduced. Optionally, virtual scoring may be performed on all user unscored items, which is not limited herein.
In this embodiment, after obtaining the first noise-containing gradient of each of the above-mentioned common objects, the server may calculate the sum of the first noise-containing gradients of the article based on the following formula (6):
Figure BDA0002762504970000121
wherein the content of the first and second substances,
Figure BDA0002762504970000122
users corresponding to all common objects
Figure BDA0002762504970000123
For the sum of the gradients of the item i,
Figure BDA0002762504970000124
a first noisy gradient for user u versus item i corresponding to the common object.
Specifically, as shown in fig. 4, in this embodiment, the step S400 includes:
step S410, respectively controlling each of the ordinary objects to transmit the gradient noise of the ordinary object to any one of the de-noised objects.
In this embodiment, the above-mentioned common object gradient noise is a gradient corresponding to a virtual score of the user corresponding to each common client for the item. The virtual score of the user corresponding to each common client for the item may be calculated based on the formula (1) and the formula (2), and the gradient corresponding to the virtual score may be calculated based on the formula (5). Specifically, for item i, the common object gradient noise corresponding to user u associated with the common client is
Figure BDA0002762504970000125
Can be calculated from the following equation (7):
Figure BDA0002762504970000126
wherein, I'uA collection of items sampled for virtual scoring from among items not scored by user u,
Figure BDA0002762504970000127
to belong to a set
Figure BDA0002762504970000128
But not in the aggregate
Figure BDA0002762504970000129
I.e. a set of common objects (i.e. a set of common clients).
Step S420, sending the model parameters to each denoising object.
Step S430, respectively controlling each of the denoised objects to calculate and obtain the gradient of the denoised object based on the model parameters, obtaining the gradient noise of the denoised object based on all the received gradient noise of the common object, and generating the second noise-containing gradient based on the gradient noise of the denoised object and the gradient noise of the denoised object, where the gradient noise of the denoised object is the sum of the gradient noise of the common object received by the denoised object.
Step S440, obtaining the second noisy gradient of each denoising object.
In this embodiment, the server also sends the model parameters to each denoising object (i.e., the denoising client in this embodiment), and when a user corresponding to the denoising object actually scores a certain article, the gradient corresponding to the article may be obtained based on the corresponding actual score, and the specific process is similar to that of the common object. However, for the article which is not truly scored by the user, the denoising object does not score virtually, so the gradient of the denoising object obtained by the denoising object calculation does not include the gradient noise generated by the virtual scoring. Wherein, for item i, denoising the user associated with the client
Figure BDA0002762504970000131
Corresponding de-noised object gradient is
Figure BDA0002762504970000132
Wherein, IuA collection of items scored for the user,
Figure BDA0002762504970000133
is a set of denoised objects (i.e. a set of denoised clients).
Meanwhile, in this embodiment, the denoising object also needs to receive the common object gradient noise sent by the common object, and since each common object sends the corresponding common object gradient noise to any one denoising object in this embodiment, one denoising object may receive a plurality of common object gradients, and each denoising object sums the received common object gradients to obtain the denoising gradient noise corresponding to the denoising object. And generating a second noisy gradient based on the de-noised gradient noise and the de-noised object gradient, and recording the second noisy gradient as
Figure BDA0002762504970000134
In this embodiment, the second noisy gradient may be obtained by calculation based on the following formula (8):
Figure BDA0002762504970000135
wherein, a is a denoising gradient noise corresponding to the denoising object, that is, all common object gradient noises received by the denoising object, and may be calculated based on the following formula (9):
Figure BDA0002762504970000136
wherein the content of the first and second substances,
Figure BDA0002762504970000137
for all the ordinary object gradient noises received by the denoised object, the ordinary object gradient noise corresponding to each ordinary object can be obtained by calculation based on the above formula (7).
Specifically, although the denoising object does not virtually score an unscored article and does not generate corresponding gradient noise, the second noise-containing gradient generated by the denoising object includes common object gradient noise, so that the gradient containing noise is still obtained by the server, and the privacy of the denoising object corresponding to the user is also protected.
Optionally, the denoising object threshold may be set to be smaller than half of the number of elements of the object set for evaluation, so that the number of the denoising objects is smaller than the number of the common objects, and further, when the common objects are controlled to send corresponding common object gradient noise to the denoising objects, it is ensured that at least one common object of each denoising object sends the common object gradient noise, so as to further ensure the privacy of the denoising object corresponding to the user.
Specifically, as shown in fig. 5, in this embodiment, the step S500 includes:
step S510, a first target noisy gradient is calculated and obtained based on each of the first noisy gradients, where the first target noisy gradient is a sum of each of the first noisy gradients.
Step S520, calculating a second target noisy gradient based on each of the second noisy gradients, where the second target noisy gradient is a sum of each of the second noisy gradients.
In step S530, a difference between the first target noisy gradient and the second target noisy gradient is calculated and obtained as the target gradient.
Specifically, the server obtains the second noise-containing gradient generated by each denoised object in step S440
Figure BDA0002762504970000141
And the sum of the second noisy gradient (second target noisy gradient) and the sum of the first noisy gradient (first target noisy gradient) contain a same portion of gradient noise, i.e. the sum of all common object gradient noise, so that the difference between the first target noisy gradient and the second target noisy gradient is calculated and obtained, and the target gradient for eliminating all common object gradient noise can be obtained.
The above target gradient may be calculated based on the following formula (10):
Figure BDA0002762504970000142
wherein B is the target gradient,
Figure BDA0002762504970000143
the first target noisy gradient can be obtained by calculation based on equation (6),
Figure BDA0002762504970000144
is a second target noisy gradient, wherein,
Figure BDA0002762504970000145
for de-noising objects
Figure BDA0002762504970000146
The corresponding second noisy gradient may be calculated based on equation (8) above.
Specifically, as can be seen from the above equations (8) and (10), when the target gradient B is calculated, the sum of gradient noise corresponding to all the de-noised objects is subtracted by subtracting the second target noise gradient from the first target noise gradient, and then the sum of gradient noise corresponding to all the de-noised objects is added. I.e. the sum of all common object gradient noise is subtracted, and the finally obtained target gradient only comprises the sum of all common object gradients and all de-noised object gradients. Therefore, the obtained target gradient reflects the real score of each common object and the denoising object to the article, and the gradient noise is not contained.
Optionally, the article feature vector V is received by the common object and the denoising object,i∈IuWhen the user gradient is calculated, each of the above ordinary object and the denoised object can be controlled to obtain the user gradient based on the following formula (11)
Figure BDA0002762504970000147
Figure BDA0002762504970000151
Wherein e isuiIs the difference between the actual score of user U on item i and the predicted score of user U on item i, UFor the user's latent feature vector, λ is the weight parameter, IuUser u is scored for a collection of items.
Further, it can be based on the above
Figure BDA0002762504970000152
For the above user potential feature vector UAnd updating to improve the accuracy of the model.
Optionally, when the denoising object receives the common object gradient noise sent by the common object, each denoising object may be further controlled to further count the number of common objects for virtually scoring the article i in the common object to which the common object gradient noise is sent, and the number is recorded as the number of common objects for virtually scoring the article i
Figure BDA0002762504970000153
The server can execute the step S440 and simultaneously performTo obtain statistics for each de-noised object
Figure BDA0002762504970000154
In order to further calculate the number of objects that truly score the item.
Optionally, after the target gradient is obtained, the federal recommended gradient obtaining method further includes: and calculating and obtaining the number of scoring objects for truly scoring the article, and updating the potential feature vector of the article based on the target gradient and the number of scoring objects so as to improve the calculation accuracy in the subsequent gradient calculation. The number of the scoring objects is the sum of the number of all common objects and denoising objects for truly scoring the article.
Specifically, after the server side obtains the target gradient B of the item i, the number of the client sides which are rated for the item i is calculated
Figure BDA0002762504970000155
Namely, it is
Figure BDA0002762504970000156
Wherein the content of the first and second substances,
Figure BDA0002762504970000157
a set of objects representing a real or virtual scoring of an item i,
Figure BDA0002762504970000158
and counting the number of the common objects for virtually scoring the article i in the common objects which are obtained by each denoising object and send the gradient noise of the common objects to the denoising objects.
Specifically, the server may update the potential feature vector of the item i according to the following formula (12):
Figure BDA0002762504970000159
wherein V on the left side of the equationV on the right of the equation for the updated latent feature vector of item iTo update the latent feature vector of the item i, γ represents the learning rate of the model, and B is the target gradient calculated based on the above equation (10).
Specifically, fig. 6 shows an interaction diagram of a server and a client provided by the present embodiment, and fig. 6 only shows a common client and a denoising client. As shown in FIG. 6, the server side sends the common client side u and the denoising client side u to the common client side u
Figure BDA0002762504970000161
Sending item latent feature vector VAnd receiving a first noisy gradient fed back by the common client u
Figure BDA0002762504970000162
Denoising client
Figure BDA0002762504970000163
Second noisy gradient of feedback
Figure BDA0002762504970000164
And the number of common objects for virtually scoring the item i in the common objects fed back by the denoising client and to which the common object gradient noise is sent
Figure BDA0002762504970000165
Thus, the server calculates and obtains a target gradient based on each first denoising gradient and each second denoising gradient, and calculates and obtains a target gradient based on each first denoising gradient and each second denoising gradient
Figure BDA0002762504970000166
And calculating the number of objects for truly scoring the article and further updating the potential feature vector of the article. For a specific calculation process, the flow of the federal recommended gradient acquisition method in this embodiment may be referred to, and details are not described herein.
Exemplary device
As shown in fig. 7, an embodiment of the present invention further provides a federal recommended gradient acquisition device corresponding to the federal recommended gradient acquisition method, where the federal recommended gradient acquisition device includes:
and a parameter obtaining module 710 for obtaining the model parameters.
Wherein the model parameters are latent feature vectors of the object, and in this embodiment, V is usedA potential feature vector representing an item I, wherein I belongs to I, I is a set of all items in the training set and has
Figure BDA0002762504970000167
Where d is the dimension of the potential feature vector,
Figure BDA0002762504970000168
and an object obtaining module 720, configured to obtain a normal object and a denoised object.
A first noisy gradient obtaining module 730, configured to obtain a first noisy gradient through each of the common objects based on the model parameters, where the first noisy gradient includes a common object gradient obtained by calculation of each of the common objects and a common object gradient noise.
A second noisy gradient obtaining module 740, configured to obtain a second noisy gradient through each of the denoised objects based on the model parameters, where the second noisy gradient includes a denoised object gradient and a denoised gradient noise that are obtained by calculating each of the denoised objects.
In this embodiment, the federal recommended gradient acquisition device is a server, the common object and the denoising object are clients associated with the server, users correspond to the clients one to one, and the object gradient is generated by performing scoring calculation on an object by the clients, and the server acquires the object gradient uploaded by each client and finally calculates the object gradient, that is, the real gradient of the object by the clients.
In this embodiment, the common object is a common client, and is configured to perform real scoring and virtual scoring on an article to obtain the first noise-containing gradient. The denoising object is a denoising client, and the denoising client is used for carrying out real scoring on the article and collecting the gradient noise of the common client in the scoring process, namely the gradient noise of the common object. Wherein the common object gradient noise is associated with a virtual rating of the item by the common client.
In the embodiment of the invention, the gradients obtained by the server from the common client and the denoising client both contain gradient noise, and the server cannot know the specific scoring conditions of the common client and the denoising client on the articles by the user (for example, the user corresponding to a certain common client scores the articles really and does not score the articles really), so that the scoring behavior of the user corresponding to the client is protected.
A target gradient obtaining module 750, configured to eliminate the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient, and obtain a target gradient.
Specifically, each of the first noisy gradients includes a common object gradient noise corresponding to a common object, each of the second noisy gradients includes a sum of common object gradients (i.e., a denoised gradient noise) of one or more common objects received by a corresponding denoised object, and a common object only sends its common object gradient noise to a denoising client, that is, the sum of the common object gradient noise included in all the first noisy gradients is equal to the sum of the denoised gradient noise included in all the second noisy gradients.
As can be seen from the above, the federal recommended gradient acquisition apparatus provided in the embodiment of the present invention acquires model parameters through the parameter acquisition module 710; acquiring a common object and a denoised object through the object acquisition module 720; acquiring a first noisy gradient through each of the common objects based on the model parameters by a first noisy gradient acquisition module 730; acquiring a second noise gradient through each denoising object based on the model parameter by using a second noise gradient acquisition module 740; the target gradient obtaining module 750 eliminates the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient, and obtains a target gradient. Therefore, the first noisy gradient and the second noisy gradient both contain corresponding gradient noise, and the scoring behavior of the user can be protected; meanwhile, after the first noisy gradient and the second noisy gradient are obtained, corresponding gradient noise can be eliminated, and a target gradient without the gradient noise is obtained. Therefore, compared with the scheme that the gradient of the virtual user unscored object and the gradient of the user real scored object are uploaded to the server side together in the prior art, the scheme can eliminate gradient noise while protecting the scoring behavior of the user, and therefore accuracy and a recommendation effect of a model in the federal recommendation process are improved.
Optionally, the object obtaining module 720 is specifically configured to: acquiring all object sets for evaluation; acquiring a denoising object based on a preset denoising object threshold and the object set; and taking all the objects in the object set except the denoising object as common objects.
In this embodiment, the object set for evaluation includes all clients corresponding to the users for scoring, the denoising object is a denoising client, and the common object is a common client. The preset denoising object threshold may be a preset numerical value, or may be adjusted according to actual requirements, which is not limited herein. In actual use, the server side acquires all the clients, randomly screens the clients based on a preset denoising object threshold value to obtain denoising clients, and takes other clients as common clients. Optionally, other screening manners may also be provided, for example, sorting and screening may be performed according to the device condition corresponding to each client, which is not specifically limited herein.
Specifically, as shown in fig. 8, in this embodiment, the first noisy gradient obtaining module 730 includes:
a normal object parameter transmitting unit 731 configured to transmit the model parameter to each of the normal objects.
A first noisy gradient generating unit 732 configured to control each of the normal objects to obtain the normal object gradient and the normal object gradient noise based on the model parameter calculation, and generate the first noisy gradient based on the normal object gradient and the normal object gradient noise.
A first noisy gradient obtaining unit 733, configured to obtain the first noisy gradient of each of the common objects.
In this embodiment, the federal recommended gradient acquisition device is a server, and the server acquires and initializes the model parameter VI belongs to I, I is a set of all articles in a training set, and the model parameters are sent to users corresponding to the common objects
Figure BDA0002762504970000181
Wherein the content of the first and second substances,
Figure BDA0002762504970000182
for the above-mentioned set of all objects for evaluation (i.e. the set of all clients),
Figure BDA0002762504970000183
for a de-noised set of objects (i.e. a de-noised set of clients),
Figure BDA0002762504970000184
to belong to a set
Figure BDA0002762504970000185
But not in the aggregate
Figure BDA0002762504970000186
I.e. a set of common objects (i.e. a set of common clients).
Optionally, after the model parameters are sent to each of the common objects, when a user corresponding to the common object truly scores an item, the gradient of the item may be obtained based on the corresponding realistic score. However, for some articles, the user corresponding to the common object does not perform real scoring, and at this time, the virtual score of the corresponding article is obtained through the average score and the prediction score, wherein the calculation formulas of the average score and the prediction score are respectively shown in the following formula (13) and formula (14):
Figure BDA0002762504970000191
Figure BDA0002762504970000192
wherein r'uiScoring the virtual grade of the item i for the user u, m being the number of items actually scored by the user, yukIs an indicator variable, rukThe user is given a rating score for item k,
Figure BDA0002762504970000193
Figure BDA0002762504970000194
a range of ratings for the item for the user, an
Figure BDA0002762504970000195
T is the number of iterations of the current algorithm, TpredictTo begin the number of iterations of using the virtual grade score as a virtual score for the corresponding item,
Figure BDA0002762504970000196
is the transpose of the feature vector of item i, T is the number of iterations of the algorithm,
Figure BDA0002762504970000197
a user potential feature vector for user u, d a dimension of the potential feature vector,
Figure BDA0002762504970000198
for item i, in FedRec, the gradient is shown in equation (15) below:
Figure BDA0002762504970000199
wherein the content of the first and second substances,
Figure BDA00027625049700001910
for all users
Figure BDA00027625049700001911
The sum of the gradients of item i is divided by
Figure BDA00027625049700001912
Figure BDA00027625049700001913
Representing a set of users who truly score or virtually score an item i,
Figure BDA00027625049700001914
a gradient for user u to item i, and
Figure BDA00027625049700001915
the calculation of (a) is as shown in the following equations (16) and (17):
Figure BDA00027625049700001916
Figure BDA00027625049700001917
wherein, UThe potential feature vector of the user u is represented by lambda which is a weight parameter and can be preset in the algorithm, and y isuiIs an indicator variable.
In this embodiment, the server controls each common client to calculate, based on the model parameters and the real score data of the user, a first noise-containing gradient of the user u corresponding to each common client with respect to the article i according to the formula (13), the formula (14), the formula (16), and the formula (17)
Figure BDA00027625049700001918
Wherein, IuRated for user uThe collection of products of (1), the above I'uIs a set of items sampled for virtual scoring from items not scored by user u and has | I'u|=ρ|IuAnd | where ρ is a preset sampling parameter. Optionally, ρ may be 1, 2, or 3, or may take other values according to the actual situation, which is not specifically limited herein. In this embodiment, for the items that are not actually scored by the user, only a part of the items (ρ times the number of actually scored items) is sampled for virtual scoring, so that the scoring behavior of the user is protected, and the calculation amount is reduced. Optionally, virtual scoring may be performed on all user unscored items, which is not limited herein.
In this embodiment, after obtaining the first noise-containing gradient of each of the above-mentioned common objects, the server may calculate the sum of the first noise-containing gradients of the article based on the following formula (18):
Figure BDA0002762504970000201
wherein the content of the first and second substances,
Figure BDA0002762504970000202
users corresponding to all common objects
Figure BDA0002762504970000203
For the sum of the gradients of the item i,
Figure BDA0002762504970000204
a first noisy gradient for user u versus item i corresponding to the common object.
Specifically, as shown in fig. 9, in this embodiment, the second noisy gradient obtaining module 740 includes:
a common object control unit 741, configured to control each of the common objects to send the common object gradient noise to any one of the denoising objects.
In this embodiment, the above-mentioned common object gradient noise is a gradient corresponding to a virtual score of the user corresponding to each common client for the item. In particular, for item iThe gradient noise of the common object corresponding to the user u associated with the common client is
Figure BDA0002762504970000205
Can be calculated from the following equation (19):
Figure BDA0002762504970000206
wherein, I'uA collection of items sampled for virtual scoring from among items not scored by user u,
Figure BDA0002762504970000207
to belong to a set
Figure BDA0002762504970000208
But not in the aggregate
Figure BDA0002762504970000209
I.e. a set of common objects (i.e. a set of common clients).
A denoising object parameter transmitting unit 742 for transmitting the model parameter to each denoising object.
A second noise gradient generating unit 743, configured to respectively control each of the denoising objects to obtain the gradient of the denoising object based on the model parameter calculation, obtain the denoising gradient noise based on all received common object gradient noises, and generate the second noise gradient based on the denoising gradient noise and the denoising gradient noise, where the denoising gradient noise is a sum of the common object gradient noises received by the denoising object.
A second noisy gradient obtaining unit 744, configured to obtain the second noisy gradient of each of the de-noised objects.
In this embodiment, the server also sends the model parameters to each denoising object (i.e., the denoising client in this embodiment), and when a user corresponding to the denoising object actually scores a certain object, the user may score the certain object based on the corresponding actual scoreAnd acquiring the corresponding gradient of the article, wherein the specific process is similar to that of the common object. However, for the article which is not truly scored by the user, the denoising object does not score virtually, so the gradient of the denoising object obtained by the denoising object calculation does not include the gradient noise generated by the virtual scoring. Wherein, for item i, denoising the user associated with the client
Figure BDA0002762504970000211
Corresponding de-noised object gradient is
Figure BDA0002762504970000212
Wherein, IuA collection of items scored for the user,
Figure BDA0002762504970000213
is a set of denoised objects (i.e. a set of denoised clients).
Meanwhile, in this embodiment, the denoising object also needs to receive the common object gradient noise sent by the common object, and since each common object sends the corresponding common object gradient noise to any one denoising object in this embodiment, one denoising object may receive a plurality of common object gradients, and each denoising object sums the received common object gradients to obtain the denoising gradient noise corresponding to the denoising object. And generating a second noisy gradient based on the de-noised gradient noise and the de-noised object gradient, and recording the second noisy gradient as
Figure BDA0002762504970000214
In this embodiment, the second noisy gradient may be obtained by calculation based on the following formula (20):
Figure BDA0002762504970000215
wherein, a is a denoising gradient noise corresponding to the denoising object, that is, all the common object gradient noises received by the denoising object, and may be calculated based on the following formula (21):
Figure BDA0002762504970000216
wherein the content of the first and second substances,
Figure BDA0002762504970000217
for all the ordinary object gradient noises received by the denoised object, the ordinary object gradient noise corresponding to each ordinary object can be obtained by calculation based on the above formula (19).
Specifically, although the denoising object does not virtually score an unscored article and does not generate corresponding gradient noise, the second noise-containing gradient generated by the denoising object includes common object gradient noise, so that the gradient containing noise is still obtained by the server, and the privacy of the denoising object corresponding to the user is also protected.
Optionally, the denoising object threshold may be set to be smaller than half of the number of elements of the object set for evaluation, so that the number of the denoising objects is smaller than the number of the common objects, and further, when the common objects are controlled to send corresponding common object gradient noise to the denoising objects, it is ensured that at least one common object of each denoising object sends the common object gradient noise, so as to further ensure the privacy of the denoising object corresponding to the user.
Optionally, the target gradient obtaining module is specifically configured to: calculating and acquiring a first target noisy gradient based on each first noisy gradient, wherein the first target noisy gradient is the sum of each first noisy gradient; calculating and acquiring a second target noisy gradient based on each second noisy gradient, wherein the second target noisy gradient is the sum of each second noisy gradient; and calculating and acquiring the difference between the first target noise-containing gradient and the second target noise-containing gradient as the target gradient.
Specifically, the server obtains the second noisy gradient generated by each denoised object through the second noisy gradient obtaining unit 744
Figure BDA0002762504970000221
And the sum of the second noisy gradient (second target noisy gradient) and the sum of the first noisy gradient (first target noisy gradient) contain a same portion of gradient noise, i.e. the sum of all common object gradient noise, so that the difference between the first target noisy gradient and the second target noisy gradient is calculated and obtained, and the target gradient for eliminating all common object gradient noise can be obtained.
The above target gradient may be calculated based on the following equation (22):
Figure BDA0002762504970000222
wherein B is the target gradient,
Figure BDA0002762504970000223
the first target noisy gradient can be obtained by calculation based on equation (18),
Figure BDA0002762504970000224
is a second target noisy gradient, wherein,
Figure BDA0002762504970000225
for de-noising objects
Figure BDA0002762504970000226
The corresponding second noisy gradient may be calculated based on equation (20) above.
Specifically, as can be seen from the above equations (20) and (22), when the target gradient B is calculated, the sum of gradient noise corresponding to all the de-noised objects is subtracted from the first target noise gradient by subtracting the second target noise gradient, and then the sum of gradient noise corresponding to all the de-noised objects is added. I.e. the sum of all common object gradient noise is subtracted, and the finally obtained target gradient only comprises the sum of all common object gradients and all de-noised object gradients. Therefore, the obtained target gradient reflects the real score of each common object and the denoising object to the article, and the gradient noise is not contained.
Optionally, the article feature vector V is received by the common object and the denoising object,i∈IuWhen the user gradient is obtained, each of the above ordinary object and the denoised object can be controlled to be calculated based on the following formula (23)
Figure BDA0002762504970000231
Figure BDA0002762504970000232
Wherein e isuiIs the difference between the actual score of user U on item i and the predicted score of user U on item i, UFor the user's latent feature vector, λ is the weight parameter, IuUser u is scored for a collection of items.
Further, it can be based on the above
Figure BDA0002762504970000233
For the above user potential feature vector UAnd updating to improve the accuracy of the model.
Optionally, when the denoising object receives the common object gradient noise sent by the common object, each denoising object may be further controlled to further count the number of common objects for virtually scoring the article i in the common object to which the common object gradient noise is sent, and the number is recorded as the number of common objects for virtually scoring the article i
Figure BDA0002762504970000234
The server can also obtain the statistics of each de-noised object
Figure BDA0002762504970000235
In order to further calculate the number of objects that truly score the item.
Optionally, after obtaining the target gradient, the federal recommended gradient obtaining apparatus may be further configured to: and calculating and obtaining the number of scoring objects for truly scoring the article, and updating the potential feature vector of the article based on the target gradient and the number of scoring objects so as to improve the calculation accuracy in the subsequent gradient calculation. The number of the scoring objects is the sum of the number of all common objects and denoising objects for truly scoring the article.
Specifically, after the server side obtains the target gradient B of the item i, the number of the client sides which are rated for the item i is calculated
Figure BDA0002762504970000236
Namely, it is
Figure BDA0002762504970000237
Wherein the content of the first and second substances,
Figure BDA0002762504970000238
a set of objects representing a real or virtual scoring of an item i,
Figure BDA0002762504970000239
and counting the number of the common objects for virtually scoring the article i in the common objects which are obtained by each denoising object and send the gradient noise of the common objects to the denoising objects.
Specifically, the server may update the potential feature vector of the item i according to the following formula (24):
Figure BDA00027625049700002310
wherein V on the left side of the equationV on the right of the equation for the updated latent feature vector of item iTo update the latent feature vector of the item i, γ represents the learning rate of the model, and B is the target gradient calculated based on the above equation (22).
Based on the above embodiments, the present invention further provides an intelligent terminal, and a schematic block diagram thereof may be as shown in fig. 10. The intelligent terminal comprises a processor, a memory, a network interface and a display screen which are connected through a system bus. Wherein, the processor of the intelligent terminal is used for providing calculation and control capability. The memory of the intelligent terminal comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the intelligent terminal is used for being connected and communicated with an external terminal through a network. The computer program, when executed by a processor, implements the steps of any of the above methods for Federation recommendation gradient acquisition. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
It will be understood by those skilled in the art that the block diagram of fig. 10 is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation to the intelligent terminal to which the solution of the present invention is applied, and a specific intelligent terminal may include more or less components than those shown in the figure, or combine some components, or have different arrangements of components.
In one embodiment, an intelligent terminal is provided, which includes a memory, a processor, and a program stored in the memory and executable on the processor, and when executed by the processor, the program performs the following operations:
obtaining model parameters;
acquiring a common object and a denoised object;
acquiring a first noise-containing gradient through each common object based on the model parameters, wherein the first noise-containing gradient comprises a common object gradient and common object gradient noise which are acquired by calculating each common object;
acquiring a second noise gradient through each denoising object based on the model parameters, wherein the second noise gradient comprises a denoising object gradient and denoising gradient noise which are calculated and acquired by each denoising object;
and eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient.
The embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the federal recommended gradient acquisition methods provided in the embodiment of the present invention.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment. The same amount of expression is expressed in each formula, and the same amount is expressed in each formula unless otherwise specified, and the formulas may be referred to each other.
Those of ordinary skill in the art would appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the above modules or units is only one logical division, and the actual implementation may be implemented by another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
The integrated modules/units described above, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method according to the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium and used by a processor to implement the steps of the above embodiments of the method. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the contents contained in the computer-readable storage medium can be increased or decreased as required by legislation and patent practice in the jurisdiction.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art; the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein.

Claims (10)

1. A method for acquiring a Federation recommendation gradient is characterized by comprising the following steps:
obtaining model parameters;
acquiring a common object and a denoised object;
acquiring a first noisy gradient through each common object based on the model parameters, wherein the first noisy gradient comprises the common object gradient and common object gradient noise which are calculated and acquired by each common object;
acquiring a second noise gradient through each denoising object based on the model parameters, wherein the second noise gradient comprises a denoising object gradient and denoising gradient noise which are calculated and acquired by each denoising object;
and eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient.
2. The federal recommended gradient retrieval method of claim 1, wherein said retrieving a normal object and a denoised object comprises:
acquiring all object sets for evaluation;
acquiring a denoising object based on a preset denoising object threshold and the object set;
and taking all objects in the object set except the de-noised object as common objects.
3. The federal recommended gradient retrieval method as claimed in claim 1 or 2, wherein the retrieving a first noisy gradient through each of the common objects based on the model parameters includes:
sending the model parameters to each common object;
respectively controlling each common object to calculate and obtain the gradient of the common object and the gradient noise of the common object based on the model parameters, and generating the first noise-containing gradient based on the gradient of the common object and the gradient noise of the common object;
obtaining the first noisy gradient for each of the generic objects.
4. The federal recommended gradient retrieval method as claimed in claim 3, wherein said retrieving a second noisy gradient through each of said denoised objects based on said model parameters comprises:
respectively controlling each common object to send the gradient noise of the common object to any one de-noising object;
sending the model parameters to each denoising object;
respectively controlling each denoising object to calculate and obtain a gradient of the denoising object based on the model parameters, obtaining the denoising gradient noise based on all received common object gradient noises, and generating the second denoising gradient based on the gradient of the denoising object and the denoising gradient noise, wherein the denoising gradient noise is the sum of the common object gradient noises received by the denoising object;
and acquiring the second noise-containing gradient of each de-noised object.
5. The federal recommended gradient retrieval method as claimed in claim 4, wherein the second noisy gradient is the denoised object gradient minus the denoised gradient noise, and the removing the normal object gradient noise and the denoised gradient noise based on the first noisy gradient and the second noisy gradient to obtain the target gradient comprises:
calculating and acquiring a first target noisy gradient based on each first noisy gradient, wherein the first target noisy gradient is the sum of each first noisy gradient;
calculating and acquiring a second target noisy gradient based on each second noisy gradient, wherein the second target noisy gradient is the sum of each second noisy gradient;
and calculating and obtaining the difference between the first target noise-containing gradient and the second target noise-containing gradient as the target gradient.
6. The bang recommended gradient acquisition device is characterized by comprising the following components:
the parameter acquisition module is used for acquiring model parameters;
the object acquisition module is used for acquiring a common object and a denoising object;
a first noisy gradient obtaining module, configured to obtain a first noisy gradient through each of the common objects based on the model parameter, where the first noisy gradient includes a common object gradient obtained by calculation of each of the common objects and a common object gradient noise;
a second noisy gradient obtaining module, configured to obtain a second noisy gradient through each of the denoised objects based on the model parameter, where the second noisy gradient includes a denoised object gradient and a denoised gradient noise obtained by calculating each of the denoised objects;
and the target gradient obtaining module is used for eliminating the common object gradient noise and the denoising gradient noise based on the first noisy gradient and the second noisy gradient to obtain a target gradient.
7. The federal recommended gradient acquisition apparatus of claim 6, wherein the first noisy gradient acquisition module comprises:
a common object parameter sending unit, configured to send the model parameter to each common object;
a first noisy gradient generating unit, configured to respectively control each of the common objects to calculate and obtain a gradient of the common object and a gradient noise of the common object based on the model parameter, and generate the first noisy gradient based on the gradient of the common object and the gradient noise of the common object;
a first noisy gradient obtaining unit configured to obtain the first noisy gradient of each of the common objects.
8. The federal recommended gradient acquisition device of claim 7, wherein the second noisy gradient acquisition module comprises:
the common object control unit is used for respectively controlling each common object to send the gradient noise of the common object to any one de-noising object;
a denoising object parameter sending unit, configured to send the model parameter to each denoising object;
a second noisy gradient generating unit, configured to respectively control each of the denoised objects to calculate and obtain a gradient of the denoised object based on the model parameter, obtain a gradient noise of the denoised object based on all received gradient noises of common objects, and generate a second noisy gradient based on the gradient noise of the denoised object and the gradient noise of the denoised object, where the gradient noise of the denoised object is a sum of the gradient noises of the common objects received by the denoised object;
and the second noisy gradient obtaining unit is used for obtaining the second noisy gradient of each de-noised object.
9. An intelligent terminal, comprising a memory, a processor, and a program stored on the memory and executable on the processor, the program, when executed by the processor, implementing the steps of the method according to any one of claims 1 to 5.
10. A non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1-5.
CN202011222354.2A 2020-11-05 2020-11-05 Federal recommendation gradient acquisition method and device, intelligent terminal and storage medium Active CN112287231B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011222354.2A CN112287231B (en) 2020-11-05 2020-11-05 Federal recommendation gradient acquisition method and device, intelligent terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011222354.2A CN112287231B (en) 2020-11-05 2020-11-05 Federal recommendation gradient acquisition method and device, intelligent terminal and storage medium

Publications (2)

Publication Number Publication Date
CN112287231A true CN112287231A (en) 2021-01-29
CN112287231B CN112287231B (en) 2024-04-05

Family

ID=74352309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011222354.2A Active CN112287231B (en) 2020-11-05 2020-11-05 Federal recommendation gradient acquisition method and device, intelligent terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112287231B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090299704A1 (en) * 2008-05-30 2009-12-03 Robert Kozma Methods of detection of propogating phase gradients using model field theory of non-gaussian mixtures
US20150324655A1 (en) * 2013-12-01 2015-11-12 University Of Florida Research Foundation, Inc. Distributive Hierarchical Model for Object Recognition in Video
CN110189192A (en) * 2019-05-10 2019-08-30 深圳前海微众银行股份有限公司 A kind of generation method and device of information recommendation model
CN110297848A (en) * 2019-07-09 2019-10-01 深圳前海微众银行股份有限公司 Recommended models training method, terminal and storage medium based on federation's study
CN111079022A (en) * 2019-12-20 2020-04-28 深圳前海微众银行股份有限公司 Personalized recommendation method, device, equipment and medium based on federal learning
CN111260061A (en) * 2020-03-09 2020-06-09 厦门大学 Differential noise adding method and system in federated learning gradient exchange

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090299704A1 (en) * 2008-05-30 2009-12-03 Robert Kozma Methods of detection of propogating phase gradients using model field theory of non-gaussian mixtures
US20150324655A1 (en) * 2013-12-01 2015-11-12 University Of Florida Research Foundation, Inc. Distributive Hierarchical Model for Object Recognition in Video
CN110189192A (en) * 2019-05-10 2019-08-30 深圳前海微众银行股份有限公司 A kind of generation method and device of information recommendation model
CN110297848A (en) * 2019-07-09 2019-10-01 深圳前海微众银行股份有限公司 Recommended models training method, terminal and storage medium based on federation's study
CN111079022A (en) * 2019-12-20 2020-04-28 深圳前海微众银行股份有限公司 Personalized recommendation method, device, equipment and medium based on federal learning
CN111260061A (en) * 2020-03-09 2020-06-09 厦门大学 Differential noise adding method and system in federated learning gradient exchange

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
GUANYU LIN等: ""FedRec: Federated Recommendation With Explicit Feedback"", 《IEEE INTELLIGENT SYSTEMS》, pages 22 - 28 *

Also Published As

Publication number Publication date
CN112287231B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN113127931B (en) Federal learning differential privacy protection method for adding noise based on Rayleigh divergence
CN108833458B (en) Application recommendation method, device, medium and equipment
CN111400754B (en) Construction method and device of user classification system for protecting user privacy
CN109857935B (en) Information recommendation method and device
CN108108821A (en) Model training method and device
CN107305611B (en) Method and device for establishing model corresponding to malicious account and method and device for identifying malicious account
WO2018130201A1 (en) Method for determining associated account, server and storage medium
CN106492459B (en) Data processing system, data processing method and data processing device
CN106611291A (en) Information push method and device
CN111695965A (en) Product screening method, system and equipment based on graph neural network
CN113254804A (en) Social relationship recommendation method and system based on user attributes and behavior characteristics
CN110929799A (en) Method, electronic device, and computer-readable medium for detecting abnormal user
CN113726545B (en) Network traffic generation method and device for generating countermeasure network based on knowledge enhancement
CN105894028A (en) User identification method and device
CN112163637A (en) Image classification model training method and device based on unbalanced data
CN107885754B (en) Method and device for extracting credit variable from transaction data based on LDA model
CN110874638B (en) Behavior analysis-oriented meta-knowledge federation method, device, electronic equipment and system
CN109388693A (en) A kind of method and relevant device of determining subregion intention
CN114519435A (en) Model parameter updating method, model parameter updating device and electronic equipment
CN110196805B (en) Data processing method, data processing apparatus, storage medium, and electronic apparatus
CN108108299B (en) User interface testing method and device
CN109308660B (en) Credit assessment scoring model evaluation method, apparatus, device and storage medium
CN107832925A (en) Internet content risk evaluating method, device and server
CN112287231A (en) Method and device for acquiring Federation recommendation gradient, intelligent terminal and storage medium
CN115618121B (en) Personalized information recommendation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant