Model reasoning method and device for federated decision tree
By only performing one communication between the active party and the participating parties in the federated decision tree model reasoning, the security risks in the decision tree model reasoning process under the federated learning scenario are solved, ensuring data security and privacy protection.
Patent Information
- Application Number
- CN202410703273.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-03
AI Technical Summary
There are security risks in the reasoning process of the decision tree model in the federated learning scenario. Participants can deduce the classification results of samples based on the number of communications between the active party and other participants, leading to the leakage of sensitive information.
By responding to the classification request, based on the tree structure of the federated decision tree, the feature set and node list of the active party and the participating parties are determined. The active party only communicates once with each participant, and each participant cannot determine the classification result based on the number of communications, thus Avoid safety hazards.
It effectively ensures data security, avoids the risk of participants inferring classification results through the number of communications, and ensures data privacy protection.
Smart Images

Figure CN118278525B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a model reasoning method and device for a federated decision tree. Background Art
[0002] Federated machine learning (Federated Learning), also known as federated learning, is a machine learning framework that can effectively help multiple institutions use data and conduct machine learning modeling while meeting user privacy protection, data security and other requirements. As a distributed machine learning paradigm, federated learning can effectively solve the problem of data silos, allowing participants to jointly model without sharing data, technically breaking data silos and achieving AI collaboration.
[0003] Decision Tree (DT) is a simple machine learning method. Its essence is a bunch of decision structures combined in a tree shape, and the leaf nodes represent the final predicted value or category. Decision tree is essentially making several decisions to determine the category or value corresponding to the input data.
[0004] In related technologies, the construction of a decision tree model in a federated learning scenario requires joint training by multiple data participants, and accordingly, the model parameters of the decision tree model are also held by multiple data participants. When applying the decision tree model for model reasoning, data interaction is required between the active party and each participant, and other passive parties that do not participate in the data division process can deduce the classification results of the data by obtaining the number of communications between the active party and the participants, which will lead to the leakage of sensitive information such as the classification results, making the model reasoning process of the decision tree model in the federated learning scenario a security risk. Summary of the invention
[0005] In view of this, the present invention provides a model reasoning method and device for a federated decision tree.
[0006] One aspect of the present invention provides a model reasoning method for a federated decision tree, comprising: in response to a classification request, based on the tree structure of the federated decision tree, determining a first feature set of an active party and a second feature set of at least one participating party from the object data of the object to be classified included in the classification request, wherein the first feature set includes feature values of multiple first nodes associated with the active party, and each second feature set includes feature values of multiple second nodes associated with the corresponding participating party; determining a first node list based on the first feature set and feature thresholds of the multiple first nodes; sending the second feature set of each participating party to each participating party, wherein each participating party is configured to determine a second node list based on the second feature set of each participating party and the feature thresholds of the multiple second nodes associated with each participating party, and sending the second node list to the active party; and determining the classification reasoning result of the object to be classified based on the first node list and the second node list of the at least one participating party.
[0007] Another aspect of the present invention provides a model reasoning device for a federated decision tree, comprising: a first determination module, for responding to a classification request, based on the tree structure of the federated decision tree, determining the first feature set of the active party and the second feature set of each of at least one participating party from the object data of the object to be classified included in the above classification request, wherein the above first feature set includes the feature values of each of the multiple first nodes associated with the above active party, and each second feature set includes the feature values of each of the multiple second nodes associated with the corresponding participating party; a second determination module, for determining a first node list based on the above first feature set and the feature thresholds of each of the multiple first nodes; a sending module, for sending the second feature set of each participating party to each participating party, wherein each participating party is configured to determine the second node list based on the second feature set of each participating party and the feature thresholds of each of the multiple second nodes associated with each participating party, and send the second node list to the above active party; and an inference module, for determining the classification inference result of the above object to be classified based on the above first node list and the second node list of each of the above at least one participating party.
[0008] Another aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.
[0009] Another aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0010] Another aspect of the present invention provides a computer program product, the computer program product comprising computer executable instructions, the instructions being used to implement the method as described above when being executed.
[0011] According to an embodiment of the present invention, in response to a classification request for an object to be classified, at least one participant participating in the sample division process can be determined, and in the sample division process, the object data of the object to be classified is divided into a first feature set of the active party and a second feature set of each participant. For the active party or each participant, each can determine its own node list based on the obtained first feature set or second feature set, and the model parameters of the federated decision tree, that is, obtain a first node list and at least one second node list, and the classification reasoning result of the object to be classified can be determined based on the first node list and at least one second node list. In the model reasoning process, the active party and each participant only need to communicate once, and each participant cannot determine the classification reasoning result of the object to be classified based on the acquired object data or the number of communications, thereby avoiding the security risks existing in the relevant technology and effectively ensuring data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0013] Figure 1 The figure schematically shows a reasoning diagram of a decision tree model in a federated learning environment in the related art.
[0014] Figure 2 A schematic diagram schematically shows the tree structure of a decision tree model.
[0015] Figure 3 An exemplary system architecture to which a model inference method for a federated decision tree can be applied according to an embodiment of the present invention is schematically shown.
[0016] Figure 4 The flowchart of the model inference method for federated decision trees according to an embodiment of the present invention is schematically shown.
[0017] Figure 5 The following is a schematic diagram of the object data splitting process according to an embodiment of the present invention.
[0018] Figure 6 The flowchart of a data provider determining a node list according to an embodiment of the present invention is schematically shown.
[0019] Figure 7 The flowchart of the active party determining the classification reasoning result according to an embodiment of the present invention is schematically shown.
[0020] Figure 8 The figure schematically shows a model reasoning process according to an embodiment of the present invention.
[0021] Fig. 9 A block diagram of a model inference device for a federated decision tree according to an embodiment of the present invention is schematically shown.
[0022] Fig.10 A block diagram of an electronic device suitable for implementing a model reasoning method or apparatus for a federated decision tree according to an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION
[0023] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.
[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0025] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0026] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0027] In the embodiments of the present invention, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage and other aspects of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0028] In the embodiment of the present invention, before obtaining or collecting the user's personal information, the user's authorization or consent is obtained.
[0029] Among related technologies, XGBoost (eXtreme Gradient Boosting) is one of the most widely used decision tree algorithms. In order to build a decision tree model in a federated learning scenario, to enable multiple data providers to jointly train a decision tree model, and to protect the data security of each participant, the SecureBoost algorithm was proposed.
[0030] The SecureBoost algorithm can introduce solutions to the privacy protection issues that need to be considered in federated learning based on XGBoost, such as using homomorphic encryption schemes to implement decision tree model training.
[0031] The SecureBoost algorithm can divide multiple data providers of federated learning into active parties and multiple participants. Active parties can refer to data providers that own data matrices and class labels, and can assume the responsibility of being the leading server in federated learning. Participants can be data providers that only own data matrices, and can play the role of clients in a federated learning environment.
[0032] After the decision tree model is trained using the SecureBoost algorithm, cooperation from each data provider is required during model inference. At this time, each data provider may know its own feature threshold and tree structure, but not the feature thresholds of other data providers.
[0033] Figure 1 The figure schematically shows a reasoning diagram of a decision tree model in a federated learning environment in the related art.
[0034] like Figure 1 As shown, taking a two-party system as an example, the first party can be the participant, with classification features f0, f1, ..., f9, and the second party can be the active party, with classification features f 10 , f 11 , …, f 19The tree structure of the decision tree model may include multiple nodes, which may include a root node Root, multiple common nodes Node1 and Node2 that are descendant nodes of the root node, and multiple leaf nodes w1, w2, w3, and w4. Each node may have a corresponding node record. For example, the node record of the root node may be represented as [party id:0, record id:1], where the party id may represent the holder of the node, and the record id may represent the feature threshold of the classification feature corresponding to the node. The corresponding classification feature and feature threshold may be retrieved from a lookup table, which may be, for example, as shown in Table 1.
[0035] Table 1
[0036]
[0037] For the sample x to be predicted, the active party and the participating parties can work together to predict the sample, and the entire process is coordinated by the active party.
[0038] Starting from the root node of the decision tree model, the active party can determine that the participating party holds the root node through party id:0 in the node record [party id:0, record id:1] of the root node. Therefore, the active party can communicate with the participating party and ask the participating party to retrieve from the participant's lookup table according to record id:1. The participating party can determine that the classification feature corresponding to the root node is f1, and its feature threshold is 14. The participating party can obtain the data corresponding to the feature it owns in sample x, that is, the participating party can determine that f1 of sample x is 29, which is greater than the feature threshold 14. Based on this, the decision result that the participating party can obtain is to move down to the right child node of the root node, that is, node 2. The active party can retrieve the active party's lookup table according to the node record [partyid:1, record id:1] of node 2, and then determine the next node of node 2. This process continues until a leaf node is reached. The category represented by the last leaf node reached is the model inference result of sample x.
[0039] During the federated reasoning process, the number of interactions between the active party and the participating parties increases with the depth of the tree, resulting in a corresponding increase in the amount of communication. This means that during the federated reasoning process, the number of interactions and the amount of communication between the active party and the participating parties will change. This change is because the path from the root node to the leaf node is different for each sample, resulting in a different number of nodes assigned to the participating party along this path. Therefore, in some cases, the participating party can use the number of interactions and the amount of communication with the active party to determine the partition path of the sample and its related leaf nodes. The leaf node to which the sample belongs is sensitive information, and if it is leaked, there will be security issues.
[0040] Figure 2 A schematic diagram schematically shows the tree structure of a decision tree model.
[0041] like Figure 2 As shown, the decision tree model involves three data providers, including an active party and two participants. In a sample partitioning process for a sample, for example, participant 1 participates in the sample partitioning process, while participant 2 does not participate in the sample partitioning process, then participant 1 can determine the sample partitioning path based on the number of communications with the active party during the sample partitioning process, and participant 2 can also determine the sample partitioning path by obtaining the number of communications between the active party and participant 1.
[0042] For example, if participant 2 monitors the communication between the active party and participant 1 without participating in the sample division process, if the active party and participant 1 communicate only once, then both participant 1 and participant 2 can determine the sample division path as: root node → node 1 → node 3. If the active party and participant 1 communicate twice, then both participant 1 and participant 2 can determine the sample division path as: root node → node 1 → node 4. If the active party and participant 1 communicate three times, then both participant 1 and participant 2 can determine the sample division path as: root node → node 2 → node 5.
[0043] It can be seen that, except for the active party, the participants have the ability to infer the final partitioning result by analyzing the partitioning path of the sample. Therefore, the SecureBoost algorithm in the related art has security risks, that is, any participant can obtain the number of communications between the active party and other participants through eavesdropping, and then deduce the leaf node to which the sample belongs, which is inconsistent with the security capabilities expected when the algorithm is designed.
[0044] In view of this, an embodiment of the present invention provides a model reasoning method and device for a federated decision tree, which can at least partially solve the problems existing in the related art. The model reasoning method for a federated decision tree includes: in response to a classification request, based on the tree structure of the federated decision tree, determining the first feature set of the active party and the second feature set of each of the at least one participating party from the object data of the object to be classified included in the classification request, wherein the first feature set includes the feature values of each of the multiple first nodes associated with the active party, and each second feature set includes the feature values of each of the multiple second nodes associated with the corresponding participating party; based on the first feature set and the feature thresholds of each of the multiple first nodes, determining the first node list; sending the second feature set of each participating party to each participating party, wherein each participating party is configured to determine the second node list based on the second feature set of each participating party and the feature thresholds of each of the multiple second nodes associated with each participating party, and sending the second node list to the active party; and determining the classification reasoning result of the object to be classified based on the first node list and the second node list of each of the at least one participating party.
[0045] Figure 3 The exemplary system architecture to which the model reasoning method for the federated decision tree can be applied according to an embodiment of the present invention is schematically shown. It should be noted that: Figure 3 The examples shown are merely examples of system architectures to which the embodiments of the present invention may be applied, to help those skilled in the art understand the technical content of the present invention, but do not mean that the embodiments of the present invention may not be used in other devices, systems, environments or scenarios.
[0046] like Figure 3 As shown, the system architecture 300 according to this embodiment may include terminal devices 301, 302, 303, a network 304 and a server 305. The network 304 is used to provide a medium for communication links between the terminal devices 301, 302, 303 and the server 305. The network 304 may include various connection types, such as wired and / or wireless communication links, etc.
[0047] Users can use terminal devices 301, 302, 303 to interact with server 305 through network 304 to receive or send messages, etc.
[0048] Terminal devices 301, 302, and 303 can serve as devices of various participants in federated learning. Various communication client applications can be installed on terminal devices 301, 302, and 303, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software.
[0049] The terminal devices 301 , 302 , and 303 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0050] Server 305 can be a device that acts as the active party of federated learning. Server 305 can be a server that provides various services. For example, during the process of federated learning, server 305 can lead terminal devices 301, 302, and 303 to train the federated learning model.
[0051] It should be noted that the model inference method for federated decision trees provided in the embodiment of the present invention can generally be executed by the server 305. Accordingly, the model inference device for federated decision trees provided in the embodiment of the present invention can generally be set in the server 305.
[0052] It should be understood that Figure 3 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0053] Figure 4 The flowchart of the model inference method for federated decision trees according to an embodiment of the present invention is schematically shown.
[0054] like Figure 4 As shown, the method includes operations S401 to S404, and the method can be executed by the electronic device of the active party.
[0055] In operation S401, in response to a classification request, based on the tree structure of a federated decision tree, a first feature set of an active party and a second feature set of at least one participating party are determined from object data of an object to be classified included in the classification request.
[0056] In operation S402 , a first node list is determined based on the first feature set and feature thresholds of each of the plurality of first nodes.
[0057] In operation S403, the second feature set of each participant is sent to each participant, wherein each participant is configured to determine a second node list based on the second feature set of each participant and the feature thresholds of each of the multiple second nodes associated with each participant, and send the second node list to the active party.
[0058] In operation S404, a classification reasoning result of the object to be classified is determined based on the first node list and the second node list of at least one participant.
[0059] The federated decision tree can be obtained by multiple data providers through federated learning, and its training process is not described in detail here. The multiple data providers can include active parties and multiple participants, and at least one participant participating in the sample division process of the object to be classified belongs to the multiple participants.
[0060] The respective feature sets can be determined from the object data of the object to be classified based on the features possessed by the active party and each participating party. For example, if the active party possesses feature f0, then the first feature set of the active party may include feature values corresponding to feature f0, and if participant 1 possesses feature f1, then the second feature set of participant 1 may include feature values corresponding to feature f1. The tree structure of the federated decision tree may include multiple nodes, and each feature may correspond to one or more nodes, that is, the first feature set may include feature values of multiple first nodes associated with the active party, and each second feature set may include feature values of multiple second nodes associated with the corresponding participating party.
[0061] The feature threshold of each node can be determined by the model parameters corresponding to the node in the federated decision tree, which will not be elaborated here.
[0062] By means of simulated decision making, it can be determined that in the active party, the first feature set includes the decision results of each of the multiple feature values, and each decision result can be used to represent the path that may be used in the sample division process. Based on the multiple decision results, a first node list covering all possible paths can be obtained. Similarly, each participant can also determine the second node list by means of simulated decision making, which will not be elaborated here.
[0063] Each node list may represent a path that the data provider may use during the sample division process, and the possible path may include the path of the real sample division of the object to be classified. Information for eliminating wrong paths or nodes may be provided by at least one participant and included in the second node list of at least one participant. Thus, the active party may eliminate the wrong paths or nodes in the first node list based on the at least one second node list, thereby obtaining the real sample division path and further determining the classification reasoning result of the object to be classified.
[0064] According to an embodiment of the present invention, in response to a classification request for an object to be classified, at least one participant participating in the sample division process can be determined, and in the sample division process, the object data of the object to be classified is divided into a first feature set of the active party and a second feature set of each participant. For the active party or each participant, each can determine its own node list based on the obtained first feature set or second feature set, and the model parameters of the federated decision tree, that is, obtain a first node list and at least one second node list, and the classification reasoning result of the object to be classified can be determined based on the first node list and at least one second node list. In the model reasoning process, the active party and each participant only need to communicate once, and each participant cannot determine the classification reasoning result of the object to be classified based on the acquired object data or the number of communications, thereby avoiding the security risks existing in the relevant technology and effectively ensuring data security.
[0065] Reference below Figure 5~Figure 8 , combined with specific embodiments Figure 4 The method shown is further explained.
[0066] Optionally, the communication data used by the active party to communicate with the participating parties, including the assigned object data, the returned node list, etc., can be plain text data, or ciphertext data generated by various pre-agreed encryption methods, including symmetric encryption, asymmetric encryption, quantum encryption, homomorphic encryption, etc., which are not limited here.
[0067] Figure 5 The following is a schematic diagram of the object data splitting process according to an embodiment of the present invention.
[0068] like Figure 5 As shown, the splitting process includes operations S501 to S503.
[0069] In operation S501 , feature values of respective ones of a plurality of classification features are determined from object data.
[0070] In operation S502, based on the tree structure of the federated decision tree, feature values corresponding to each of the plurality of first nodes are selected from the feature values of each of the plurality of classification features to obtain a first feature set.
[0071] In operation S503, based on the tree structure of the federated decision tree, feature values of respective multiple second nodes associated with each participant are selected from respective feature values of multiple classification features to obtain a second feature set for each participant.
[0072] After completing the training of the federated decision tree, the active party may determine the classification features owned by any data provider in the active party and each passive party. Optionally, the classification features owned by the data provider may refer to the classification features owned by the data provider and used in the federated decision tree.
[0073] The object data of the object to be classified can be processed to obtain the characteristic values of each of the multiple classification features. The method of processing the object data can refer to the algorithms in the relevant technology, such as the processing method of the SecureBoost algorithm during model inference, which will not be described here.
[0074] Based on the tree structure of the federated decision tree, the active party may determine nodes associated with each data provider, including but not limited to determining a plurality of first nodes associated with the active party, and a plurality of second nodes associated with each participating party.
[0075] Each node in the tree structure of the federated decision tree may be configured with a node record, and the node record may record an identifier representing the classification feature corresponding to the node, and the classification feature represented by the identifier may be determined by looking up the table. Based on this, the classification features corresponding to each of the multiple nodes of each data provider may be determined, and thus the feature values corresponding to each of the multiple nodes of each data provider may be determined to obtain the feature set of the data provider.
[0076] For example, the object to be classified may refer to a user portrait, and the object data of the object to be classified may include various user data of the user, such as the user's age, the user's gender, the user's income, etc. Specifically, the object data may be represented as a matrix or a vector, and each column of the matrix, or each element of the vector, may represent a type of user data. The above user data may be provided by the user to the data provider actively, or the above user data may be recorded by the data provider when the user conducts business with the data provider, and the data provider may use the above user data after obtaining the user's authorization. Various user data may correspond to multiple classification features, such as the user's age may correspond to the classification feature of age, and the user's gender may correspond to the classification feature of gender. After federated learning, each data provider may have one or more classification features, for example, data provider 1 may have the classification feature of age, and data provider 2 may have the classification feature of gender, so user data related to age may be added to the feature set of data provider 1, and user data related to gender may be added to the feature set of data provider 2.
[0077] Figure 6 The flowchart of a data provider determining a node list according to an embodiment of the present invention is schematically shown.
[0078] like Figure 6 As shown, taking the active party determining the first node list as an example, the active party can sequentially remove nodes from the current node list based on the feature value of each first node and the feature threshold of each first node for multiple first nodes, and obtain a new node list to finally obtain the first node list. Specifically, the process may include operations S601 to S604.
[0079] In operation S601 , based on the tree structure of the federated decision tree, descendant nodes of each first node are determined.
[0080] In operation S602, the feature value of each first node is compared with the feature threshold of each first node to obtain a comparison result.
[0081] In operation S603 , based on the comparison result, at least one node to be removed is determined from the descendant nodes of each first node.
[0082] In operation S604, identification information corresponding to the current node list and at least one node to be removed is removed to obtain a new node list.
[0083] The descendant nodes of each first node may include all the descendant nodes of the first node, and the descendant nodes of these descendant nodes, and so on, until the leaf node. Figure 2 In the decision tree model shown, the descendant nodes of the root node Node0 may include the node Node1, the node Node2, the node Node3, the node Node4, the node Node5 and the node Node6. The descendant nodes of the node Node2 may include the node Node5 and the node Node6.
[0084] In each first node, the feature value corresponding to the first node can be compared with the feature threshold of the first node, and the next node of the first node can be determined according to the comparison result and the decision rule of the first node. The specific setting of the decision rule is not limited here.
[0085] For example, the decision rule can be configured as follows: if the feature value is less than the feature threshold, the left child node is selected as the next node; if the feature value is greater than or equal to the feature threshold, the right child node is selected as the next node.
[0086] For another example, the decision rule can also be configured as follows: if the feature value is less than the feature threshold, the right child node is selected as the next node; if the feature value is greater than or equal to the feature threshold, the left child node is selected as the next node.
[0087] After determining the next node, another node that has not been selected and the descendant nodes of the node can be used as nodes to be removed, and then the identification information of the node to be removed is removed from the current node list to obtain a new node list.
[0088] For example, the current node list can be [0, 1, 2, 3, 4, 5, 6], where 0 can be the identification information of the root node Node0, 1 can be the identification information of the node Node1, and so on. The characteristic value of the root node Node0 can be 5, and the characteristic threshold of the root node Node0 can be 7. The decision rule can be configured as follows: if the characteristic value is less than the characteristic threshold, the left child node is selected as the next node; if the characteristic value is greater than or equal to the characteristic threshold, the right child node is selected as the next node. Since the characteristic value of the root node Node0 is less than the characteristic threshold of the root node Node0, it can be determined that the node Node1 is the next node. Accordingly, it can be determined that the node Node2 is another node that has not been selected. The node and its descendant nodes, including the node Node2, the node Node5 and the node Node6, can be used as nodes to be removed. The identification information of the node to be removed can be removed from the current node list, and the new node list obtained is [0, 1, 3, 4].
[0089] The process of operations S601 to S604 may be performed once for each of the plurality of first nodes in a traversal manner. For example, in the previous example, after completing the process of operations on the root node Node0, the process of operations S601 to S604 may be performed for the node Node1. After the traversal is completed, the first node list of the active party may be obtained.
[0090] Similarly, for each participant, the following operations can be performed traversally for each second node of the multiple second nodes included in the participant: based on the tree structure of the federal decision tree, the descendant nodes of each second node included in each participant are determined, the characteristic value of each second node and the characteristic threshold of each second node are compared to obtain a comparison result, based on the comparison result, at least one node to be removed from the descendant nodes of each second node, and the identification information corresponding to the current node list and the at least one node to be removed are removed to obtain a new node list, which will not be repeated here.
[0091] Figure 7 The flowchart of the active party determining the classification reasoning result according to an embodiment of the present invention is schematically shown.
[0092] like Figure 7 As shown, the process may include operations S701 to S703.
[0093] In operation S701, a target node list is determined based on the first node list and the second node list of at least one participant.
[0094] In operation S702, a target leaf node is determined based on the target node list.
[0095] In operation S703, based on the category identifier of the target leaf node, a classification reasoning result of the object to be classified is determined.
[0096] The active party may determine the target node list based on the first node list and the second node list of at least one participating party through a Private Set Intersection (PSI) method.
[0097] As an optional implementation, the active party may determine the target node list by performing n privacy set intersection operations, where the number of at least one participant is n-1. For example, the active party may perform a privacy set intersection operation with n-1 participants respectively, that is, perform privacy set intersection on the first node list and the second node list of at least one participant respectively, to obtain at least one intersection node list, and then perform a privacy set intersection operation on the obtained intersection node list, that is, determine the target node list based on the at least one intersection node list.
[0098] Alternatively, as another optional implementation, the active party may perform a privacy set intersection operation with n-1 participants respectively to determine the target node list, wherein the node list used by the active party when performing the privacy set intersection operation with the next participant is the result obtained by the active party performing the privacy set intersection operation with the previous participant. For example, the active party may use the i-th intermediate list to perform a privacy set intersection with the second node list of the i-th participant to obtain the i+1-th intermediate list; wherein i is a positive integer, and when i=1, the i-th intermediate list is represented as the first node list; when the i-th participant is represented as the last participant among at least one participant, the i+1-th intermediate list is represented as the target node list.
[0099] The identification information of the last node in the target node list may be the identification information of a leaf node, and the target leaf node may be determined based on the identification information of the last node.
[0100] Each leaf node in the federated decision tree can represent a category, and the category represented by each leaf node can be reflected by the category identifier of the leaf node. Based on the category identifier of the target leaf node, the category represented by the target leaf node can be determined, and the category represented by the target leaf node can be used as the classification reasoning result of the object to be classified.
[0101] Figure 8 The figure schematically shows a model reasoning process according to an embodiment of the present invention.
[0102] like Figure 8 As shown, for the convenience of the specification, for the convenience of explanation, the multiple nodes included in the tree structure of the federated decision tree have been numbered respectively, such as the nodes of the active party include Node1, Node3 and Node6, and the nodes of the participating party include Node0, Node2, Node4 and Node5. Leaf nodes Node7, Node8, Node9, Node10, Node11, Node12, Node13, Node14 can be used as common nodes of the active party and the passive party. Leaf nodes Node7, Node8, Node9, Node10, Node11, Node12, Node13, Node14 can have corresponding category identifiers w1, w2, w3, w4, w5, w6, w7, w8 respectively.
[0103] Participants can have classification features f0, f1, ..., f9, and active parties can have classification features f 10 ,f 11 ,…,f 19 , the features selected in the tree structure of the federated decision tree are f1,f 15 ,f8,f 12 ,f2,f5,f 13 .exist Figure 8 The decision rules and feature thresholds of each node are also directly displayed. For example, the decision rule and feature threshold of Node0 can be expressed as f1<15, and the decision rule and feature threshold of Node1 can be expressed as f 15 <6, the decision rule and feature threshold of Node2 can be expressed as f8<9, the decision rule and feature threshold of Node3 can be expressed as f 12 <4, the decision rule and feature threshold of Node4 can be expressed as f2<7, the decision rule and feature threshold of Node5 can be expressed as f5<20, and the decision rule and feature threshold of Node6 can be expressed as f 13 <40.
[0104] In actual applications, the decision rules and feature thresholds of the nodes of each data provider are only visible to the data provider. For example, the decision rules and feature thresholds of Node0 are only visible to the participating party, and the decision rules and feature thresholds of Node1 are only visible to the active party, etc.
[0105] When dividing the sample of the object data x to be classified, it can be determined that the feature set of the participant includes f1=13, f2=10, f5=30, f8=10, and the feature set of the active party includes f 12=5, f 13 =50, f 15 =10.
[0106] The active party and the participating party may remove the nodes that they can judge from the node list in turn to obtain the first node list of the active party or the second node list of the participating party.
[0107] For the active party, we start with a node list [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]. 15 = 10 is greater than the feature threshold of Node1, which is 6. Therefore, the active party can remove nodes 3, 7, and 8 from the list. The active party’s feature set f 13 =50 is greater than the feature threshold of Node6, 40, so the active party can remove 13 from the node list. Finally, the active party's node list remains as [0,1,2,4,5,6,9,10,11,12,14].
[0108] For the participant, the node list starts with [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]. In the participant's feature set, f1=13 is less than the feature threshold of Node0, 15, so the participant can remove nodes 2, 5, 6, 11, 12, 13, and 14 from the list; in the participant's feature set, f2=10 is greater than the feature threshold of Node4, 7, so the participant can remove node 9 from the list. Finally, the participant's node list remains as [0,1,3,4,7,8,10].
[0109] The participant can return the reserved node list to the active party, and the active party can perform PSI operation on the node list reserved by the active party and the node list reserved by the participant. Finally, the active party obtains the PSI result of [0, 1, 4, 10], which indicates that the object data x of the object to be classified is finally classified into the leaf node Node10. Based on the category identifier w4 of the leaf node Node10, the classification reasoning result of the object to be classified can be determined.
[0110] According to an embodiment of the present invention, by intersecting privacy sets, a sample only needs to execute PSI once to complete the federated reasoning process regardless of the characteristic value of the sample, thereby avoiding the problem of inferring sample division based on the number of communications.
[0111] Fig. 9 A block diagram of a model inference device for a federated decision tree according to an embodiment of the present invention is schematically shown.
[0112] like Fig. 9As shown, the model reasoning device 900 for the federated decision tree includes a first determination module 910 , a second determination module 920 , a sending module 930 and a reasoning module 940 .
[0113] The first determination module 910 is used to determine, in response to a classification request, a first feature set of an active party and a second feature set of each of at least one participating party from object data of the object to be classified included in the classification request based on the tree structure of a federated decision tree, wherein the first feature set includes feature values of each of a plurality of first nodes associated with the active party, and each second feature set includes feature values of each of a plurality of second nodes associated with a corresponding participating party.
[0114] The second determination module 920 is used to determine the first node list based on the first feature set and the feature thresholds of the plurality of first nodes.
[0115] The sending module 930 is used to send the second feature set of each participant to each participant, wherein each participant is configured to determine a second node list based on the second feature set of each participant and the feature threshold of each of the multiple second nodes associated with each participant, and send the second node list to the active party.
[0116] The reasoning module 940 is used to determine the classification reasoning result of the object to be classified based on the first node list and the second node list of at least one participant.
[0117] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a proper combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be executed.
[0118] For example, any multiple of the first determination module 910, the second determination module 920, the sending module 930 and the reasoning module 940 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present invention, at least one of the first determination module 910, the second determination module 920, the sending module 930 and the reasoning module 940 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the first determination module 910, the second determination module 920, the sending module 930 and the reasoning module 940 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0119] It should be noted that the model reasoning device part for federated decision trees in the embodiment of the present invention corresponds to the model reasoning method part for federated decision trees in the embodiment of the present invention. The description of the model reasoning device part for federated decision trees specifically refers to the model reasoning method part for federated decision trees, which will not be repeated here.
[0120] Fig.10 A block diagram of an electronic device suitable for implementing a model reasoning method or apparatus for a federated decision tree according to an embodiment of the present invention is schematically shown. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0121] like Fig.10As shown, the electronic device 1000 according to an embodiment of the present invention includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0122] In RAM 1003, various programs and data required for the operation of electronic device 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.
[0123] According to an embodiment of the present invention, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The system 1000 may further include one or more of the following components connected to the input / output (I / O) interface 1005: an input portion 1006 including a keyboard, a mouse, etc.; an output portion 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk, etc.; and a communication portion 1009 including a network interface card such as a LAN card, a modem, etc. The communication portion 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the input / output (I / O) interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that the computer program read therefrom is installed into the storage portion 1008 as needed.
[0124] According to an embodiment of the present invention, the method flow according to an embodiment of the present invention can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present invention are executed. According to an embodiment of the present invention, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0125] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0126] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device.
[0127] For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 1002 and / or the RAM 1003 described above and / or one or more memories other than the ROM 1002 and the RAM 1003 .
[0128] An embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present invention. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method provided by the embodiment of the present invention.
[0129] When the computer program is executed by the processor 1001, the above functions defined in the system / device of the embodiment of the present invention are executed. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0130] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0131] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0132] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present invention can be combined and / or combined in various ways, even if such a combination or combination is not explicitly recorded in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments and / or claims of the present invention may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present invention.
[0133] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination. The scope of the present invention is defined by the attached claims and their equivalents. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A model reasoning method for a federated decision tree, applied to an active party's electronic device, characterized in that: include: In response to a classification request, based on the tree structure of a federated decision tree, a first feature set of an active party and a second feature set of at least one participating party are determined from the object data of the object to be classified included in the classification request, wherein the first feature set includes feature values of multiple first nodes associated with the active party, and each second feature set includes feature values of multiple second nodes associated with the corresponding participating party, wherein the object to be classified refers to a user portrait, and the object data of the object to be classified includes multiple user data of the user, wherein the user data includes the user's age, the user's gender, and the user's income, and the multiple user data corresponds to multiple classification features, wherein the object data of the object to be classified belongs to ciphertext data generated by a pre-agreed encryption method; Determine a first node list based on the first feature set and feature thresholds of each of the plurality of first nodes; Sending each participant a second feature set, wherein each participant is configured to determine a second node list based on the second feature set of each participant and a feature threshold of each of a plurality of second nodes associated with each participant, and send the second node list to the active party, wherein the second node list is ciphertext data generated using a pre-agreed encryption method; and Determining the classification reasoning result of the object to be classified based on the first node list and the second node list of each of the at least one participant includes: Determining a target node list based on the first node list and the second node list of each of the at least one participant; Based on the target node list, determining a target leaf node; and Determining a classification reasoning result of the object to be classified based on the category identifier of the target leaf node; The step of determining a target node list based on the first node list and the second node list of each of the at least one participant includes: Performing privacy set intersection of the first node list and the second node list of the at least one participant, respectively, to obtain at least one intersection node list; and The target node list is determined based on the at least one intersection node list.
2. The method according to claim 1, characterized in that The determining of the first node list based on the first feature set and the feature thresholds of the plurality of first nodes includes: For the multiple first nodes in turn, when each first node is in the current node list, node elimination processing is performed on the current node list based on the feature value of each first node and the feature threshold of each first node to obtain a new node list, so as to finally obtain the first node list.
3. The method according to claim 2, characterized in that The performing node elimination processing on the current node list based on the feature value of each first node and the feature threshold of each first node to obtain a new node list includes: Determining descendant nodes of each first node based on the tree structure of the federated decision tree; Compare the characteristic value of each first node with the characteristic threshold of each first node to obtain a comparison result; Based on the comparison result, determining at least one node to be removed from descendant nodes of each first node; and The identification information corresponding to the current node list and the at least one node to be removed is removed to obtain the new node list.
4. The method according to claim 1, characterized in that: The determining of the target node list based on the first node list and the second node list of the at least one participant includes: Use the ith intermediate list and the second node list of the ith participant to intersect the privacy set and obtain the i+1th intermediate list; Among them, i is a positive integer. When i=1, the i-th intermediate list is represented as the first node list; when the i-th participant is represented as the last participant among the at least one participant, the i+1-th intermediate list is represented as the target node list.
5. The method according to claim 1, characterized in that The tree structure based on the federated decision tree determines the first feature set of the active party and the second feature set of each of at least one participating party from the object data of the object to be classified included in the classification request, including: determining feature values of respective ones of a plurality of classification features from the object data; Based on the tree structure of the federated decision tree, selecting feature values corresponding to each of the plurality of first nodes from the feature values of each of the plurality of classification features to obtain the first feature set; and Based on the tree structure of the federated decision tree, the feature values of the respective multiple second nodes associated with each participant are selected from the feature values of the respective multiple classification features to obtain a second feature set for each participant.
6. A model reasoning device for a federated decision tree, applied to an electronic device of an active party, characterized in that: include: A first determination module, configured to respond to a classification request and determine, based on a tree structure of a federated decision tree, a first feature set of an active party and a second feature set of at least one participating party from object data of an object to be classified included in the classification request, wherein the first feature set includes feature values of each of a plurality of first nodes associated with the active party, and each second feature set includes feature values of each of a plurality of second nodes associated with a corresponding participating party, wherein the object to be classified refers to a user portrait, and the object data of the object to be classified includes a plurality of user data of the user, wherein the user data includes the user's age, the user's gender, and the user's income, and the plurality of user data corresponds to a plurality of classification features, and wherein the object data of the object to be classified belongs to ciphertext data generated using a pre-agreed encryption method; A second determining module, configured to determine a first node list based on the first feature set and feature thresholds of each of the plurality of first nodes; a sending module, configured to send the second feature set of each participant to each participant, wherein each participant is configured to determine a second node list based on the second feature set of each participant and a feature threshold of each of the plurality of second nodes associated with each participant, and send the second node list to the active party, wherein the second node list belongs to ciphertext data generated by using a pre-agreed encryption method; and an inference module, configured to determine a classification inference result of the object to be classified based on the first node list and the second node list of each of the at least one participant, wherein the object data of the object to be classified and the second node list are ciphertext data generated by using a pre-agreed encryption method; Wherein, the reasoning module is specifically used for: Determining a target node list based on the first node list and the second node list of each of the at least one participant; Based on the target node list, determining a target leaf node; and Determining a classification reasoning result of the object to be classified based on the category identifier of the target leaf node; The step of determining a target node list based on the first node list and the second node list of each of the at least one participant includes: Performing privacy set intersection of the first node list and the second node list of the at least one participant, respectively, to obtain at least one intersection node list; and The target node list is determined based on the at least one intersection node list.
7. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: Executable instructions are stored thereon, and when the instructions are executed by a processor, the processor implements the method according to any one of claims 1 to 5.
