A federated learning method and system
Patent Information
- Application Number
- CN202311489792.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-11-09
AI Technical Summary
而由于端设备的子图数据禁止与其他端设备共享,导致端设备在训练本地模型时无法从其他端设备获取到与自身相关的数据,导致数据缺失,本地模型的精度较低
[0026]由以上技术方案可知,本说明书提供的联邦学习方法,目标端设备由目标子图扩展出包含目标外部节点的目标扩展图,通过聚合来自目标外部节点的非原始特征从而得到其目标边缘节点的聚合外部嵌入特征,即在保护其他端设备数据隐私的前提下引入了其他端设备中与自身相关的信息,使得目标边缘节点的信息更全面,利用目标边缘节点训练得到的本地模型的精度更高。同时,目标端设备通过服务器下发的全局参数更新本地参数,即结合了其他端设备的本地参数共同更新本地模型的本地参数,提高了本地模型的泛化性。
Smart Images

Figure CN117313838B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of artificial intelligence, and in particular to a federated learning method and system. Background Technology
[0002] Graphs can represent data relationships in the real world. For example, a subgraph on a bank's terminal device can represent financial transaction relationships between different customers, and a subgraph on a telecommunications operator's terminal device can represent communication relationships between different customers, and so on. Typically, the subgraph data of each terminal device is highly confidential and is prohibited from being shared with other terminal devices.
[0003] Users on different devices may communicate with each other, or the same user may have data on different devices. Therefore, different devices are usually interconnected, and their subgraphs are coupled together to form a coupled graph. However, because subgraph data of a device is prohibited from being shared with other devices, a device cannot obtain relevant data from other devices when training its local model, resulting in data gaps and low accuracy of the local model. Therefore, a federated learning method is needed to improve model accuracy.
[0004] The information in the background section is merely information known only to the inventor and does not imply that such information had entered the public domain before the date of this application, nor does it imply that it can be considered prior art in this disclosure. Summary of the Invention
[0005] The federated learning methods and systems provided in this manual can improve the accuracy of local models.
[0006] Firstly, this specification provides a federated learning method applied to a target device, the method comprising:
[0007] A target subgraph is determined, comprising connected internal nodes of the target, including target edge nodes connected to other end devices. A target extension graph of the target subgraph is determined, comprising the target subgraph and a graph connecting the target edge nodes to target external nodes, wherein the target external nodes are edge nodes of the other end devices. Multiple iterations of training are performed based on the target extension graph to obtain a target local model. In each iteration: aggregated external embedding features of the target edge nodes are determined, which aggregate non-original features from the target external nodes. A global model is trained based on the aggregated external embedding features to obtain a local model, wherein the parameters of the global model are the global parameters obtained in the previous iteration. The local parameters of the local model are sent to a server, wherein the server determines the global parameters based on the local parameters of multiple local models corresponding to multiple end devices, wherein the multiple end devices include at least the target end device and the other end devices. The server also receives the global parameters sent by the server and updates the local parameters of the local model based on the global parameters.
[0008] In some embodiments, before determining the aggregated external embedding features of the target edge node, the method further includes: pre-training the global model based on the target extended graph to obtain a pre-trained local model.
[0009] In some embodiments, pre-training the global model based on the target extended graph to obtain a pre-trained local model includes: performing a preset number of comparative learning training rounds on the global model based on the target extended graph to obtain the pre-trained local model.
[0010] In some embodiments, in each training round of the preset number of rounds: a comparison model is determined, the comparison model being the global model obtained in the previous round of training; and the global model is trained by comparison learning based on the target extended graph and the comparison model to obtain the updated parameters of the global model in the current round.
[0011] In some embodiments, the step of performing comparative learning training on the global model based on the target expansion graph and the comparative model to obtain the update parameters of the global model in the current round includes: inputting the target expansion graph into the comparative model for encoding, and outputting a first embedding feature of each target internal node in the target expansion graph; inputting the target expansion graph into the global model in the current round for encoding, and outputting a second embedding feature of each target internal node in the target expansion graph; for each target internal node: determining a classification loss based on the second embedding feature and its corresponding true label; obtaining a comparative learning loss based on the second embedding feature of the current target internal node and the first embedding feature of each target internal node, wherein the comparative learning loss constrains the distance between the second embedding feature of the current target internal node and the first embedding feature of the target internal node of the same category to be close, and constrains the distance between the second embedding feature of the current target internal node and the first embedding feature of the target internal node of a different category to be far apart; and performing a weighted summation of the classification loss and the comparative learning loss to obtain a first loss; and determining the update parameters based on the first loss of each target internal node.
[0012] In some embodiments, the server includes an edge server and a cloud server, wherein the distance between the edge server and the target device is closer than the distance between the cloud server and the target device.
[0013] In some embodiments, determining the aggregated external embedding features of the target edge node includes: obtaining the embedding features of the target external node based on the pre-trained local model and sending them to the edge server; and receiving the aggregated external embedding features sent by the edge server, wherein the aggregated external embedding features are obtained by the edge server aggregating the embedding features of the target edge node sent by the other end device, and the embedding features of the target edge node sent by the other end device include the features of the target external node.
[0014] In some embodiments, training the global model based on the aggregated external embedding features to obtain a local model includes: training the pre-trained local model based on the aggregated external embedding features to obtain the local model.
[0015] In some embodiments, training the pre-trained model based on the aggregated external embedding features to obtain a local model includes: inputting the target extended graph into the pre-trained local model to obtain aggregated internal embedding features of the target edge nodes, wherein the aggregated internal embedding features aggregate features from target internal nodes connected to the target edge nodes; aggregating the aggregated internal embedding features with the aggregated external embedding features to obtain aggregated embedding features of the target edge nodes; and determining a second loss between the aggregated embedding features and the true labels of the target edge nodes, and updating the parameters of the pre-trained model based on the second loss to obtain the local model.
[0016] In some embodiments, the global parameters include parameters obtained by aggregating the local parameters of the plurality of local models.
[0017] Secondly, this specification provides a federated learning system, including a target end device, the target end device comprising: at least one storage medium storing at least one set of instructions for implementing the federated learning; and at least one processor communicatively connected to the at least one storage medium, wherein when the federated learning system is running, the at least one processor reads the at least one set of instructions and implements the federated learning method described in any one of the first aspects.
[0018] Thirdly, this specification provides a federated learning method applied to a server. The method includes multiple iterations of training. In each iteration: receiving embedding features of external nodes sent by multiple end devices; for a target end device among the multiple end devices: the target end device includes a target external node and a target edge node connected to other end devices, the target external node of the target end device is the edge node of the other end devices, and the target edge node of the target end device is the external node of the other end devices; aggregating the embedding features sent by the multiple end devices to obtain aggregated external embedding features of the edge nodes of each end device; sending the aggregated external embedding features to the corresponding end devices, wherein each end device trains a global model based on the aggregated external embedding features to obtain a local model, the parameters of the global model being the parameters obtained in the previous iteration; receiving local parameters of multiple local models sent by the multiple end devices, and aggregating the local parameters of the multiple local models to obtain global parameters; and sending the global parameters to the multiple end devices respectively, the global parameters being configured to update the local parameters in the multiple local models.
[0019] In some embodiments, the server includes an edge server and a cloud server, wherein the distance between the edge server and the target device is closer than the distance between the cloud server and the target device.
[0020] In some embodiments, receiving the embedding features of external nodes sent by the multiple end devices includes: the edge server receiving the embedding features of the multiple end devices.
[0021] In some embodiments, the aggregation of the embedding features sent by the plurality of end devices to obtain the aggregated external embedding features of the edge nodes of each end device includes, for the target end device: the edge server aggregates the embedding features of the target edge nodes of the target end device sent by the other end devices to obtain the aggregated external embedding features of the target edge nodes of the target end device, wherein the embedding features of the target edge nodes of the target end device sent by the other end devices include the features of the target external nodes of the target end device.
[0022] In some embodiments, the aggregation includes addition.
[0023] In some embodiments, receiving local parameters of multiple local models sent by the multiple end devices includes: the cloud server receiving local parameters of the multiple local models forwarded by the edge server.
[0024] In some embodiments, aggregating the local parameters of the plurality of local models to obtain global parameters includes: determining a plurality of model weights corresponding to the plurality of local models, wherein the model weights are inversely proportional to the number of edge nodes of the corresponding terminal device; and weighting and aggregating the plurality of model weights with the local parameters of the plurality of local models to obtain the global parameters.
[0025] Fourthly, this specification also provides a federated learning system, including a server, the server comprising: at least one storage medium storing at least one set of instructions for implementing the federated learning; and at least one processor communicatively connected to the at least one storage medium, wherein when the federated learning system is running, the at least one processor reads the at least one set of instructions and implements the federated learning method described in any one of the third aspects.
[0026] As can be seen from the above technical solutions, the federated learning method provided in this specification expands the target subgraph into a target extended graph containing external nodes. By aggregating non-original features from these external nodes, the aggregated external embedding features of the target edge nodes are obtained. This introduces information relevant to the target from other devices while protecting their data privacy, making the information of the target edge nodes more comprehensive and resulting in higher accuracy for the local model trained using these edge nodes. Simultaneously, the target device updates its local parameters using global parameters issued by the server, combining local parameters from other devices to update the local model's parameters, thus improving the generalization ability of the local model.
[0027] Other features of the federated learning methods and systems provided in this specification will be partially listed in the following description. The figures and examples presented below will be readily apparent to those skilled in the art. The inventive aspects of the federated learning methods and systems provided in this specification can be fully understood through practice or use of the methods, apparatus, and combinations described in the detailed examples below. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A schematic diagram of a federated learning system provided according to some embodiments of this specification is shown;
[0030] Figure 2 A schematic diagram of a coupling diagram provided according to some embodiments of this specification is shown;
[0031] Figure 3 A hardware structure diagram of a computing device provided according to some embodiments of this specification is shown;
[0032] Figure 4 A flowchart of a federated learning method provided according to some embodiments of this specification is shown;
[0033] Figure 5 A flowchart of a federated learning method provided according to some embodiments of this specification is shown;
[0034] Figure 6 A flowchart illustrating a comparative learning training method according to some embodiments of this specification is shown;
[0035] Figure 7A flowchart illustrating a method for determining aggregated external embedding features according to some embodiments of this specification is shown; and
[0036] Figure 8 A schematic diagram is shown illustrating an embodiment of determining aggregated external embedding features of a target edge node according to some embodiments of this specification. Detailed Implementation
[0037] The following description provides specific application scenarios and requirements for this specification, intended to enable those skilled in the art to make and use the contents of this specification. Various partial modifications to the disclosed embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments and applications without departing from the spirit and scope of this specification. Therefore, this specification is not limited to the embodiments shown, but rather to the widest scope consistent with the claims.
[0038] The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not restrictive. For example, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” used herein may also include the plural forms. When used in this specification, the terms “comprising,” “including,” and / or “containing” mean that the associated integers, steps, operations, elements, and / or components are present, but do not exclude the presence of one or more other features, integers, steps, operations, elements, components, and / or groups, or that other features, integers, steps, operations, elements, components, and / or groups may be added to the system / method.
[0039] Considering the following description, these and other features of this specification, as well as the operation and function of the related components of the structure, and the economy of assembly and manufacture of the parts, can be significantly improved. All of these form part of this specification with reference to the accompanying drawings. However, it should be clearly understood that the drawings are for illustrative and descriptive purposes only and are not intended to limit the scope of this specification. It should also be understood that the drawings are not drawn to scale.
[0040] The flowcharts used in this specification illustrate operations implemented according to some embodiments of this specification. It should be clearly understood that the operations in the flowcharts may not be implemented in a sequential order. Instead, the operations may be implemented in reverse order or simultaneously. Furthermore, one or more additional operations may be added to the flowcharts. One or more operations may be removed from the flowcharts.
[0041] Before describing the specific embodiments in this specification, the application scenarios of this specification will be introduced as follows:
[0042] The application scenarios described herein can include finance, insurance, government affairs, healthcare, video, e-commerce, and more, such as banks, telecommunications operators, application software, cities, campuses, hospitals, etc. For example, each bank can have a subgraph representing internal financial transactions (such as transfers) between multiple users of that bank. Different banks can have external financial transactions (such as transfers) between them. Thus, external financial transactions between different banks and internal financial transactions within each bank can form a coupled graph. Internal financial transaction data between different banks cannot be transferred to each other, nor can it be transferred through a server. Each bank's end device can use the federated learning method provided in this description to train its own local model. Similarly, each telecommunications operator can have a subgraph representing communication (such as phone calls) between multiple users of that operator. Different telecommunications operators can have external communication (such as phone calls) between them. Thus, external communication between different telecommunications operators and internal communication within each telecommunications operator can form a coupled graph. Internal communication data between different telecommunications operators cannot be transferred to each other, nor can it be transferred through a server. Each telecommunications operator's end device can use the federated learning method provided in this description to train its own local model. For example, each application can have a subgraph representing internal user relationships (such as following, liking, favorites, and friends) among multiple users of that application. Different applications can have external user relationships (such as sharing and forwarding). Thus, the external user relationships between different applications and the internal user relationships within each application can form a coupled graph. Internal user relationship data between different applications cannot be transferred to each other, nor can it be transferred through a server. Each application's endpoint can use the federated learning method provided in this specification to train its own local model.
[0043] For ease of description, this manual explains the terms that will appear in the following descriptions:
[0044] Federated learning: a distributed machine learning technique that allows multiple devices to collaboratively train a global model representing all the devices; and
[0045] Graph Neural Networks (GNNs) are a type of deep learning technique used to process graphical data. Federated Learning
[0046] Figure 1 A schematic diagram of a federated learning system 001 provided according to some embodiments of this specification is shown. Figure 1 As shown, the system 001 may include multiple end devices 100 and a server 200. Any one of the multiple end devices 100 may be a target end device.
[0047] Multiple terminal devices 100 can belong to the same entity type. For example, multiple terminal devices 100 may all belong to banks, but be terminal devices 100 of different banks; or multiple terminal devices 100 may all belong to telecommunications operators, but be terminal devices 100 of different telecommunications operators. Terminal devices 100 under the same entity can be divided according to geographical regions. For example, geographical region 1 may contain multiple banks, and geographical region 2 may contain multiple banks. The terminal devices 100 can store a large amount of user data, and based on this user data, a subgraph (or user graph) representing internal user relationships can be formed. This subgraph includes internal nodes and edges connecting the internal nodes. The internal nodes can represent users, and the edges between internal nodes represent the relationships between users. For example, this subgraph can represent the transfer relationships between various customers of a bank, or the communication relationships between various customers of a telecommunications operator. It should be noted that the user data obtained in this specification has been authorized by the users and does not involve user privacy.
[0048] Multiple end devices 100 can be associated with each other; that is, at least two end devices 100 have connecting edges between their subgraphs. Specifically, these connecting edges can be between nodes of the two end devices 100, and the node responsible for connecting the two end devices 100 can be called an edge node. Therefore, each end device 100 can aggregate information not only about its internal nodes but also about nodes that logically exist but actually originate from other end devices 100. In some embodiments, multiple subgraphs corresponding to multiple associated end devices 100 can constitute a coupled graph. Figure 2 A schematic diagram of a coupling diagram provided according to some embodiments of this specification is shown. For example... Figure 2 As shown, the coupling diagram includes three sub-diagrams for three end devices 100: sub-diagram G1 for end device 1, sub-diagram G2 for end device 2, and sub-diagram G3 for end device 3. Sub-diagram G1 includes interconnected internal nodes 1, 2, and 3. Sub-diagram G2 includes internal nodes 4, 5, 6, and 7, where internal nodes 5, 6, and 7 are interconnected, and internal node 4 is connected to internal node 5. Sub-diagram G3 includes interconnected internal nodes 8, 9, and 10. Edge node 3 of sub-diagram G1 is connected to edge node 8 of sub-diagram G3, and edge node 2 of sub-diagram G1 is connected to edge node 4 of sub-diagram G2. Edge node 4 of sub-diagram G2 is connected to edge node 2 of sub-diagram G1 and edge node 8 of sub-diagram G3. Edge node 8 of sub-diagram G3 is connected to edge node 3 of sub-diagram G1 and edge node 4 of sub-diagram G2.
[0049] like Figure 1As shown, the end device 100 can enhance the subgraph by adding external nodes connected to the edge nodes, thereby obtaining an enhanced graph. The enhanced graph can include the subgraph and the graph showing the connections between edge nodes and external nodes. Hollow dots in the graph represent external nodes. In a pair of edge nodes used to connect two end devices 100, one edge node can be an external node in the enhanced graph of the other edge node. The two interconnected end devices 100 know the identifiers of the external nodes connected to their own edge nodes, but do not know the data of those external nodes.
[0050] like Figure 1 As shown, multiple end devices 100 can each train their own local model (such as local-GCN, i.e., local Graph Convolutional Networks) using the extended graph. They then send the local parameters of their respective local models to the server 200 for aggregation. The server 200 can receive the local parameters of the multiple local models sent by the end devices 100, aggregate the local parameters of the multiple local models to obtain global parameters, and then send the global parameters to the multiple end devices 100 respectively. The multiple end devices 100 can each obtain the global parameters from the server 200 and update their own local models with the global parameters, thus obtaining their final local models.
[0051] In some embodiments, such as Figure 1 As shown, server 200 may include at least one edge server 201 and a cloud server 202. Multiple clients 100 may connect to at least one edge server 201, and at least one edge server 201 may connect to the cloud server 202. These connections may be communication connections. When server 200 includes one edge server 201, the edge server 201 connects to each end device. When server 200 includes multiple edge servers 201, the multiple clients 100 may be divided into multiple groups, with each edge server 201 connecting to a group of end devices 100. The subgraphs of end devices 100 connected to the same edge server 201 can form a coupling graph. As mentioned earlier, end devices 100 under the same entity can be divided according to geographical regions; similarly, multiple edge servers 201 can also be divided according to geographical regions, such that each geographical region contains edge servers and multiple end devices 100, and end devices located within the same geographical region communicate with the edge server 201. Figure 1 As shown, Figure 1The system includes at least two edge servers 201 and one cloud server, with each edge server 201 connected to at least two end devices 100. The edge server 201 can interact with the at least two end devices 100 to determine the aggregated external embedding features required by each of the at least two end devices 100, the specific methods of which are described later. The edge server 201 can act as a relay device between the at least two end devices 100 and the cloud server 202 to upload local parameters of the at least two end devices 100 to the cloud server 202 and distribute global parameters of the cloud server 202 to the at least two end devices 100, thereby updating the parameters of the local model.
[0052] In some embodiments, the federated learning method can be executed on the target device 100. In this case, the target device 100 may store data or instructions for executing the federated learning method described herein, and may execute or be used to execute the data or instructions. In some embodiments, the target device 100 may include hardware devices with data processing capabilities and necessary programs to drive the hardware devices. In some embodiments, the target device 100 may interact with the server 200 via a network to receive or send messages / information / data, such as receiving or sending model parameters. In some embodiments, the target device 100 may include a desktop computer, mobile device, tablet computer, laptop computer, or any combination thereof. In some embodiments, the mobile device may include a smart mobile device or similar device. In some embodiments, the smart mobile device may include a smartphone, personal digital assistant, gaming device, or any combination thereof. In some embodiments, the target device 100 may include an image acquisition device for acquiring biological images, such as facial images. In some embodiments, the image acquisition device may be a two-dimensional image acquisition device (e.g., an RGB camera), or a two-dimensional image acquisition device (e.g., an RGB camera) and a depth image acquisition device (e.g., a 3D structured light camera, a laser detector, etc.). In some embodiments, the target device 100 may be a device with positioning technology for locating the position of the target device 100. In some embodiments, the target device 100 may have one or more of the following functions: NFC (Near Field Communication), WIFI (Wireless Fidelity), 3G / 4G / 5G, POS (Point of Sale) card swiping function, QR code scanning function, barcode scanning function, Bluetooth, infrared, SMS (Short Message Service), and MMS (Multimedia Message Service).
[0053] In some embodiments, the target device 100 may have one or more applications (APPs) installed. The APPs provide the owner of the target device 100 with the ability and interface to interact with the outside world. The APPs include, but are not limited to: web browser APPs, search APPs, chat APPs, shopping APPs, video APPs, financial management APPs, instant messaging tools, email clients, social media platform software, etc. In some embodiments, the target device 100 may have a target APP installed. In some embodiments, the target APP can train a local model. The owner of the target device 100 can trigger a federated learning request through the target APP. The target APP can respond to the request and execute a federated learning method.
[0054] In some embodiments, the federated learning method can be executed on server 200. In this case, server 200 may store data or instructions for executing the federated learning method described herein, and may execute or be used to execute said data or instructions. In some embodiments, server 200 may include hardware devices with data processing capabilities and necessary programs to drive the hardware devices. Server 200 may be communicatively connected to multiple target devices 100 and receive data sent by the target devices 100.
[0055] The network (not shown in the figure) serves as a medium for providing a communication connection between the target device 100 and the server 200. The network facilitates the exchange of information or data. In some embodiments, the network can be any type of wired or wireless network, or a combination thereof. For example, the network may include a cable network, wired network, fiber optic network, telecommunications network, intranet, Internet, local area network (LAN), wide area network (WAN), wireless local area network (WLAN), metropolitan area network (MAN), public switched telephone network (PSTN), Bluetooth network, ZigBee network, near field communication (NFC) network, or similar networks. In some embodiments, the network may include one or more network access points. For example, the network may include wired or wireless network access points, such as base stations or Internet switching points, through which one or more components of the target device 100 and the server 200 can connect to the network to exchange data or information.
[0056] It should be understood that Figure 1 The number of target devices 100 and servers 200 shown is merely illustrative. Depending on implementation requirements, there can be any number of target devices 100 and servers.
[0057] It should be noted that the federated learning method can be executed entirely on the target device 100, entirely on the server 200, or partially on both the target device 100 and the server 200.
[0058] Figure 3 A hardware structure diagram of a computing device 600 according to some embodiments of this specification is shown. The computing device 600 can execute the federated learning method described in this specification. The federated learning method is described in other parts of this specification. The computing device 600 can be the target device 100 when the federated learning method is executed on the target device 100. The computing device 600 can be the server 200 when the federated learning method is executed on the server 200. The computing device 600 can be either the target device 100 or the server 200 when the federated learning method can be executed partly on the target device 100 and partly on the server 200.
[0059] like Figure 3 As shown, the computing device 600 may include at least one storage medium 630 and at least one processor 620. In some embodiments, the computing device 600 may also include a communication port 650 and an internal communication bus 610. Additionally, the computing device 600 may include I / O components 660.
[0060] The internal communication bus 610 can connect different system components, including storage medium 630, processor 620 and communication port 650.
[0061] I / O component 660 supports input / output between computing device 600 and other components.
[0062] Communication port 650 is used for data communication between computing device 600 and external sources. For example, communication port 650 can be used for data communication between computing device 600 and a network. Communication port 650 can be a wired communication port or a wireless communication port.
[0063] Storage medium 630 may include a data storage device. The data storage device may be a non-transitory storage medium or a temporary storage medium. For example, the data storage device may include one or more of a disk 632, a read-only storage medium (ROM) 634, or a random access storage medium (RAM) 636. Storage medium 630 may store at least one set of instructions for implementing federated learning. The instructions are computer program code, which may include programs, routines, objects, components, data structures, procedures, modules, etc., that execute the federated learning methods provided in this specification. Storage medium 630 may also store local and global models. The model may be one or more instruction sets stored in storage medium 630 that execute corresponding instructions and are executed by processor 620 in computing device 600. Alternatively, the model may be a portion of circuitry, hardware devices, or modules in computing device 600.
[0064] At least one processor 620 can be communicatively connected to at least one storage medium 630 and a communication port 650 via an internal communication bus 610. At least one processor 620 is used to execute the at least one instruction set described above. When the computing device 600 is running, at least one processor 620 can read the at least one instruction set and, according to the instructions of the at least one instruction set, execute the federated learning method provided in this specification. Processor 620 can execute all the steps included in the federated learning method. Processor 620 can be in the form of one or more processors. In some embodiments, processor 620 may include one or more hardware processors, such as a microcontroller, microprocessor, reduced instruction set computer (RISC), application-specific integrated circuit (ASIC), application-specific instruction set processor (ASIP), central processing unit (CPU), graphics processing unit (GPU), physical processing unit (PPU), microcontroller unit, digital signal processor (DSP), field-programmable gate array (FPGA), advanced RISC machine (ARM), programmable logic device (PLD), any circuit or processor capable of performing one or more functions, or any combination thereof. For illustrative purposes only, only one processor 620 is described in this specification for the computing device 600. However, it should be noted that the computing device 600 in this specification may also include multiple processors. Therefore, the operation and / or method steps disclosed in this specification may be executed by one processor as described in this specification, or they may be executed jointly by multiple processors. For example, if the processor 620 of the computing device 600 in this specification executes steps A and B, it should be understood that steps A and B may also be executed jointly or separately by two different processors 620 (e.g., the first processor executes step A, the second processor executes step B, or the first and second processors jointly execute steps A and B).
[0065] Figure 4 A flowchart of a federated learning method P100 provided according to some embodiments of this specification is shown.
[0066] like Figure 4 As shown, method P100 may include:
[0067] S120: Target device 100 determines the target sub-map.
[0068] The target device 100 can be any one of multiple end devices 100. The target end device 100 can store a large amount of user data. This user data can be user feature data. The user data can also be training sample data for the target end device 100 in the federated learning method. The training sample data in different end devices 100 can be user data stored locally by each end device 100. Depending on the application scenario, the user data may also differ. For example, user data may include, but is not limited to, locally collected user feature data, product feature data, event feature data, or relationship feature data, etc.
[0069] For example, application scenarios can include finance, insurance, government affairs, healthcare, video, e-commerce, etc. Correspondingly, if the application scenario is e-commerce, the user data can be user characteristic data and product transaction data; if the application scenario is finance, the user data can be user characteristic data and financial transaction data; if the application scenario is insurance or government affairs, the user data can be user characteristic data; if the application scenario is healthcare, the user data can be medical and health data; and if the application scenario is video, the user data can be user characteristic data and historical playback data.
[0070] User data can be of any type. For example, user data may include user data based on text data, image data, and / or voice data. Accordingly, the model trained using the method P100 described in this specification can be applied to risk identification, information recommendation, service recommendation, intent recognition, and so on, based on text data, image data, and / or voice data. For example, in a telecommunications operator service scenario, user data may be user content data, usage frequency data, etc., on the operator's platform. The model trained using the method P100 described in this specification can perform risk identification, information recommendation, service recommendation, intent recognition, and so on, based on user data.
[0071] Based on this large amount of user data, the target device 100 can construct a target subgraph. The target subgraph can include connected internal nodes, each representing a user, and edges connecting these nodes representing internal user relationships. Interconnected internal nodes influence each other. The target subgraph can reflect the internal user relationships among multiple users of the target device 100. For example, when the target device 100 is a bank's device, these internal user relationships could be financial transaction relationships (such as transfers and receipts) among multiple users of that bank. When the target device 100 is a telecommunications operator's device, these internal user relationships could be communication relationships (such as making phone calls) among multiple users of that telecommunications operator. When the target device 100 is an application software company's device, these internal user relationships could be user relationships (such as following, liking, friends, and relatives) among multiple users of that application software company.
[0072] When there is a cross-device external edge between the target device 100 and other devices 100, the target internal nodes include target edge nodes. These target edge nodes are used to connect with the edge nodes of other devices 100 through this external edge, which can represent external user relationships between users. The target subgraph of the target device 100 and the subgraphs of other devices 100 can form a coupling graph. This coupling graph reflects the external user relationships between users of the target device 100 and users of other devices 100. These external user relationships could be, for example, financial transaction relationships between users of different banks (e.g., transfers, receipts), communication relationships between users of different telecommunications operators (e.g., phone calls), or user relationships between users of different application software companies (e.g., sharing, forwarding).
[0073] S140: The target terminal device 100 determines the target extended map of the target sub-map.
[0074] Since the target edge node can connect not only to its internal nodes but also to the edge nodes of other end devices 100 connected to it, the information of the target edge node can include its own information, the information of its connected internal nodes, and the information of the edge nodes of other end devices 100 connected to it. If the external user relationships of the target edge node are directly discarded due to privacy concerns, i.e., the information of the edge nodes of other end devices 100 is discarded, the information of the target edge node will be inaccurate. Therefore, in order to improve the data accuracy of the target edge node, the target end device 100 can enhance the target subgraph to obtain a target extended graph. The target extended graph includes the target subgraph and the graph connecting the target edge node to the target external nodes, where the target external nodes are the edge nodes of other end devices 100, and the target edge node is an external node of other end devices 100. In this way, the target end device 100 introduces the target external nodes that affect itself into the target extended graph.
[0075] In the target extended graph, the initial features of the internal nodes of the target are the features of the corresponding nodes in the target subgraph. The target end device 100 can know the identifiers of the external nodes of the target, but does not know the original features of the external nodes of the target (stored in other end devices 100). Therefore, the features of the external nodes of the target can be initialized to 0, such as tensors initialized to 0.
[0076] S160: The target device 100 performs multiple loop training based on the target extended graph to obtain the target local model.
[0077] Since the target extension graph introduces external nodes, meaning that the target device 100 incorporates the influence of other devices 100 on itself, the target local model trained using the target extension graph improves the accuracy of the local model compared to the local model trained using a subgraph that does not introduce external nodes.
[0078] The target device 100 can set a preset termination condition for the multiple loops. The termination condition can be stopping the loop when a preset number of loops is reached. The preset number of loops can be any value, such as 10, 50, 100, 130, 150, 200, etc. This embodiment of the specification does not limit the preset number of loops. The termination condition can also be stopping the loop when the local model reaches a preset accuracy rate, or other termination conditions. This embodiment of the specification does not limit these conditions.
[0079] In the loop, the target expanded graph is the training sample. Before starting the loop, the server 200 can initialize a global model and distribute this initialized global model to multiple end devices 100. Therefore, in the first loop, the parameters of the global model are the parameters of the initialized global model. In subsequent loops, the parameters of the global model are the global parameters obtained in the previous loop.
[0080] Figure 5 A flowchart of a federated learning method S160 provided according to some embodiments of this specification is shown. Figure 5 As shown, each cycle in the multiple cycles may include S160-1 to S160-13.
[0081] S160-1: The target terminal device 100 pre-trains the global model based on the target extended graph to obtain a pre-trained local model.
[0082] In some embodiments, the target device 100 can perform conventional training on the global model based on the target extended map for a preset number of rounds to obtain the pre-trained local model. For example, the target device 100 can input the target extended map into the global model, output a prediction result, calculate a loss based on the prediction result and the true labels of the target extended map, and update the parameters of the global model based on the loss, thereby obtaining the pre-trained local model. The preset number of rounds can be any value, such as 20, 30, 50, etc., and this specification does not limit this.
[0083] In some embodiments, the target device 100 can perform a preset number of comparative learning training rounds on the global model based on the target extended graph to obtain the pre-trained local model. By employing comparative learning training on the global model, a high-precision pre-trained local model can be obtained. In each round of comparative learning training, the target device 100 can determine a comparison model. The comparison model is the global model obtained in the previous training round; in the first training round, the comparison model is the initialized global model. Figure 6 A flowchart illustrating a comparative learning training method according to some embodiments of this specification is shown. Figure 6 As shown, assuming the target extended graph is EG0, Gm is the contrast model, and Gg is the global model, the target device 100 can perform contrastive learning training on the global model Gg based on the target extended graph EG0 and the contrast model Gm to obtain the updated parameters of the global model Gg in the current round.
[0084] like Figure 6As shown, the target device 100 can input the target extended graph EG0 into the contrast model Gm for encoding, and output the first embedding feature of each target internal node in the target extended graph EG0. The target device 100 can also input the target extended graph EG0 into the global model Gg of the current round for encoding, and output the second embedding feature of each target internal node in the target extended graph EG0. For each target internal node, the target device 100 can determine its first loss based on the first and second embedding features. Furthermore, the target device 100 can determine the update parameters of the global model Gg in the current round based on the first loss of each target internal node. For example, the target device 100 can perform a weighted summation of multiple first losses corresponding to multiple target internal nodes in the target extended graph, and use the weighted summation loss to determine the update parameters of Gg in the current round.
[0085] Specifically, for the first loss of each target's internal node, the target device 100 can determine the classification loss based on the second embedded feature and its corresponding true label. For example, ... Figure 6 As shown, the target device 100 can input the second embedding feature of each target internal node into the global classifier Fg, output the classification result of the current target internal node, and then calculate the classification loss between the classification result and the true label of the current target internal node through a loss function. The target device 100 can also obtain a contrastive learning loss based on the second embedding feature of the current target internal node and the first embedding feature of each target internal node. The contrastive learning loss constrains the distance between the second embedding feature of the current target internal node and the first embedding feature of the target internal node of the same category to be close, and constrains the distance between the second embedding feature of the current target internal node and the first embedding feature of the target internal node of a different category to be far apart. For example, as... Figure 6 As shown, the current target's internal node is V0. Nodes within the two dashed boxes belong to the same category, and the nodes outside the dashed boxes (solid circles) also belong to the same category. The contrastive learning loss constrains the distance between V0's second embedded feature and each of the first embedded features within the dashed boxes (represented by a solid single-arrow), and constrains the distance between V0's second embedded feature and each of the other three different first embedded features (represented by a dashed single-arrow). Subsequently, the target device 100 can perform a weighted sum of the classification loss and the contrastive learning loss to obtain the first loss.
[0086] In some embodiments, the target device 100 may not pre-train the global model, but instead directly use the global model instead of pre-training the local model in subsequent processes. This specification does not limit this embodiment.
[0087] S160-3: The target end device 100 determines the aggregated external embedding features of the target edge node.
[0088] The aggregated embedding features of the target edge node may include aggregated internal embedding features and aggregated external embedding features. The aggregated internal embedding features may be features aggregated from internal nodes of the target, and the aggregated external embedding features may be non-original features aggregated from external nodes of the target. The aggregated internal embedding features may include features of the target edge node itself, and / or the aggregated external embedding features may include features of the target edge node itself.
[0089] When determining the aggregated internal embedding features, the target device 100 can input the target extended map into the aforementioned pre-trained local model to obtain the aggregated internal embedding features of the target edge nodes. When determining the aggregated external embedding features, Figure 7 A flowchart illustrating a method for determining aggregated external embedding features according to some embodiments of this specification is shown. Figure 7 As shown, the method may include S160-31 to S160-37.
[0090] S160-31: The target terminal device 100 sends the embedding features of the target external node to the server 200.
[0091] like Figure 1 As shown, server 200 may include edge server 201 and cloud server 202. The distance between edge server 201 and target device 100 is closer than the distance between cloud server 202 and target device 100. To improve aggregation efficiency, target device 100 can determine the aggregated external embedded features through interaction with edge server 201.
[0092] Since the target external node is an edge node of other terminal device 100, when other terminal device 100 aggregates the aggregated external embedding features of the edge node, it needs the embedding features of the target external node sent by the target terminal device 100. Therefore, the target terminal device 100 can send the embedding features of the target external node to the server 200.
[0093] In some embodiments, the target terminal device 100 may obtain the embedding features of the target external node based on the aforementioned pre-trained local model and send them to the edge server.
[0094] S160-33: Server 200 receives embedded features of external nodes sent by multiple end devices 100.
[0095] In some embodiments, the edge server 201 may receive embedded features of external nodes sent by multiple end devices 100.
[0096] S160-35: Server 200 aggregates the embedded features sent by the multiple end devices 100 to obtain the aggregated external embedded features of the edge nodes of each end device 100.
[0097] In some embodiments, the edge server 201 can aggregate the embedding features sent by the plurality of end devices 100 to obtain aggregated external embedding features of the edge nodes of each end device 100. Specifically, for a target end device: the edge server 201 can aggregate the embedding features of the target edge nodes of the target end device 100 sent by other end devices 100 to obtain aggregated external embedding features of the target edge nodes of the target end device 100, wherein the embedding features of the target edge nodes of the target end device 100 sent by other end devices 100 include the features of the target external nodes of the target end device 100.
[0098] Since the target edge node is an external node in other terminal devices 100, other terminal devices 100 can send the embedding features of the external node to the edge server 201 for aggregation. Specifically, other terminal devices 100 can obtain the embedding features of the external node based on their own pre-trained local model. For example, other terminal devices 100 can input the extended graph into their own pre-trained local model to output the embedding features of the external node. Since the external nodes of other terminal devices 100 are connected to edge nodes, the embedding features of the external nodes will include the features of the edge nodes connected to them. And since the edge nodes of other terminal devices 100 are target external nodes of the target terminal device 100, it is equivalent to the embedding features of the target edge node of the target terminal device 100 sent by other terminal devices 100 containing the features of the target external node of the target terminal device 100.
[0099] Figure 8 A schematic diagram illustrating the determination of aggregated external embedding features of a target edge node 8 according to some embodiments of this specification is shown. Figure 8As shown, assume the target end device is end device 3, which includes target internal nodes 8, 9, and 10, where node 8 is a target edge node. End devices 1 and 2 belong to other end devices. The extended graph of end device 1 includes internal nodes 1, 2, and 3 and external nodes 4 and 8, where internal nodes 2 and 3 are edge nodes, and external node 8 is the target edge node of end device 3. End device 1 can input the extended graph into its own pre-trained local model (such as a pre-trained GCN (Graph Convolutional Networks)) to output the embedding feature of external node 8, which includes the features of internal node 3. Then, end device 1 can send the embedding feature of external node 8 to edge server 201. The extended graph of end device 2 includes internal nodes 4, 5, 6, and 7 and external nodes 2 and 8, where internal node 4 is an edge node, and external node 8 is the target edge node of end device 3. End device 2 can input the extended graph into its own pre-trained local model (such as a pre-trained GCN) to output the embedding features of the external node 8, which include the features of the internal node 4. Then, end device 2 can send the embedding features of the external node 8 to edge server 201.
[0100] Furthermore, the edge server 201 can receive the embedding features of external nodes sent by other end devices 100, whereby the external nodes are the target edge nodes of the target end device 100. The edge server 201 can aggregate the received embedding features, for example, by adding, multiplying, or weighted summing the received embedding features, to obtain the aggregated external embedding features of the target edge node. Figure 8 As shown, edge server 201 receives the embeddings of node 8 sent by end device 1 and end device 2 respectively, and aggregates these two embeddings to obtain the aggregated external embedding of the target edge node 8. Following the same method, the aggregated external embedding features of the edge nodes of each end device 100 can be obtained.
[0101] This approach not only avoids the transmission of raw features of edge nodes between end devices 100, protecting data privacy, but also allows for the utilization of edge node information to improve model accuracy. Furthermore, the end device 100 confirms the aggregated external embedding features of edge nodes through transmission with the edge server 201. Compared to communicating with the cloud server 202 to determine the aggregated external embedding features, this reduces communication overhead, achieving a trade-off between accuracy and communication volume. The communication volume for determining the aggregated external embedding features in this specification can be: number of edge nodes * communication volume per edge node * embedding dimension * number of communication rounds (i.e., number of iterations).
[0102] S160-37: Server 200 sends the aggregated external embedded features to the corresponding end device 100.
[0103] In some embodiments, the edge server 201 can send the aggregated external embedding features to the corresponding end device 100. For example, for a target edge node of the target end device 100, the edge server 201 can send the aggregated external embedding features of the target edge node to the corresponding target end device 100. Figure 8 As shown, the edge server 201 can send the aggregated external embedded features of the target edge node 8 to the end device 3.
[0104] S160-5: The target device 100 trains the global model based on the aggregated external embedded features to obtain a local model.
[0105] When the target device 100 trains the global model to obtain a pre-trained local model, the target device 100 can train the pre-trained local model based on the aggregated external embedding features to obtain the local model.
[0106] Since the features of the target edge nodes have changed, in order to improve the accuracy of the local model, the target device 100 can retrain the pre-trained local model one or more times based on the changed target edge nodes.
[0107] As previously described, the target device 100 can input the target extended graph into a pre-trained local model to obtain aggregated internal embedding features of the target edge nodes. These aggregated internal embedding features aggregate features from target internal nodes connected to the target edge nodes. The aggregated external embedding features aggregate non-original features from target external nodes. Therefore, the target device 100 can aggregate the aggregated internal embedding features and the aggregated external embedding features (e.g., by addition, multiplication, or weighted summation) to obtain aggregated embedding features of the target edge nodes. Furthermore, the target device 100 can determine a second loss between the aggregated embedding features and the true labels of the target edge nodes, and update the parameters of the pre-trained model based on this second loss to obtain the local model.
[0108] S160-7: The target device 100 sends the local parameters of the local model to the server 200.
[0109] In some embodiments, the target device 100 can send the local parameters of the local model to the edge server 201, and then the edge server 201 can send the local parameters to the cloud server 202. For example, Figure 1As shown, each end device 100 sends its local parameters to the edge server 201, which then forwards them to the cloud server 202.
[0110] S160-9: Server 200 receives local parameters of multiple local models sent by the multiple end devices 100, and aggregates the local parameters of the multiple local models to obtain global parameters.
[0111] In some embodiments, the cloud server 202 may determine the average parameter among the local parameters of the plurality of local models and use the average parameter as the global parameter.
[0112] In some embodiments, the cloud server 202 can determine multiple model weights corresponding to the multiple local models, and perform weighted aggregation of the multiple model weights with the local parameters of the multiple local models to obtain the global parameters. The model weights are inversely proportional to the number of edge nodes of the corresponding end device 100. The fewer the number of edge nodes of the end device 100, the less it is affected by other end devices 100, and the higher the classification accuracy of the local model of the end device 100 for local data. Therefore, assigning larger weights to end devices 100 with fewer edge nodes and smaller weights to end devices with more edge nodes results in higher classification accuracy of the model assigned to the global parameters for local data.
[0113] S160-11: Server 200 sends the global parameters to the plurality of end devices 100 respectively.
[0114] In some embodiments, such as Figure 1 As shown, the cloud server 202 can send the global parameters to the edge server 201, which then forwards them to multiple end devices 100.
[0115] S160-13: The target device 100 receives the global parameters sent by the server 200 and updates the local parameters of the local model based on the global parameters.
[0116] In some embodiments, the target device 100 may receive the global parameters sent by the edge server 201 and use the global parameters as local parameters of its own local model.
[0117] After the multiple iterations are completed, the target device 100 obtains the final target local model. This target local model can be used in various scenarios such as classification, clustering, and recommendation. For example, a bank's target device 100 can input user data from multiple users into the target local model, which can then categorize these users into five types: conservative, stable, balanced, growth-oriented, and aggressive. As another example, a bank's target device 100 can input user data such as a user's asset amount, investment distribution, risk preference, and asset liquidity into the target local model, which can then output recommended financial products for that user, such as wealth management products, insurance, funds, securities, and stocks. Similarly, a telecommunications operator's target device 100 can input user data from multiple users into the target local model, which can then cluster these users into three different communication types.
[0118] This demonstrates that the target local model on target device 100 has undergone local contrastive learning training and training with aggregated external embedded features from local target edge nodes, significantly improving the accuracy of the target local model on local data, such as classification and recommendation accuracy. Simultaneously, the target local model has also undergone global training, further enhancing its generalization ability.
[0119] In summary, the federated learning method and system provided in this specification involve expanding the target device's subgraph to include external nodes. By aggregating non-original features from these external nodes, aggregated external embedding features of the target edge nodes are obtained. This approach, while protecting data privacy, introduces information relevant to the target from other devices, resulting in more comprehensive information about the target edge nodes and higher accuracy of the local model trained using them. Furthermore, the target device updates its local parameters using global parameters issued by the server, combining local parameters from other devices to update the local model's parameters, thus improving the generalization ability of the local model.
[0120] This specification, in another aspect, provides a non-transitory storage medium storing at least one set of executable instructions for performing federated learning. When the executable instructions are executed by a processor, they instruct the processor to implement the steps of the federated learning method P100 described herein. In some possible embodiments, various aspects of this specification can also be implemented as a program product comprising program code. When the program product is run on a federated learning system 001, the program code causes the federated learning system 001 to perform the steps of the federated learning method P100 described herein. The program product for implementing the above method may employ a portable compact disk read-only memory (CD-ROM) containing program code and may run on the federated learning system 001. However, the program product of this specification is not limited thereto. In this specification, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system. The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. The computer-readable storage medium may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof. Program code for performing the operations described herein can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on Federated Learning System 001, partially on Federated Learning System 001, as a standalone software package, partially on Federated Learning System 001 and partially on a remote computing device, or entirely on a remote computing device.
[0121] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0122] In summary, after reading this detailed disclosure, those skilled in the art will understand that the foregoing detailed disclosure is presented by way of example only and is not restrictive. Although not explicitly stated herein, those skilled in the art will understand that this specification requires various reasonable changes, improvements, and modifications to the embodiments. These changes, improvements, and modifications are intended to be made by this specification and are within the spirit and scope of the exemplary embodiments described herein.
[0123] Furthermore, certain terms in this specification have been used to describe embodiments of this specification. For example, "an embodiment," "an embodiment," and / or "some embodiments" mean that a particular feature, structure, or characteristic described in connection with that embodiment may be included in at least one embodiment of this specification. Therefore, it is to be emphasized and understood that two or more references to "an embodiment" or "an embodiment" or "alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. Moreover, specific features, structures, or characteristics may be suitably combined in one or more embodiments of this specification.
[0124] It should be understood that in the foregoing description of the embodiments in this specification, various features are combined in a single embodiment, drawing, or description for the purpose of simplifying the description and aiding in the understanding of a feature. However, this does not mean that the combination of these features is necessary, and those skilled in the art may readily identify some of the devices as separate embodiments when reading this specification. That is, the embodiments in this specification can also be understood as an integration of multiple secondary embodiments. It is also valid when each secondary embodiment contains fewer than all the features of a single foregoing disclosed embodiment.
[0125] Every patent, patent application, publication of a patent application, and other material such as articles, books, specifications, publications, documents, articles, etc., cited herein, except for any related historical prosecution documents, any identical ones that may be inconsistent with or conflict with this document, or any identical historical prosecution documents that may have a limiting effect on the widest scope of the claims, may be incorporated herein by reference and used for all purposes now or hereafter in connection with this document. Furthermore, in the event of any inconsistency or conflict between the description, definition, and / or use of terms related to any included material and those related to this document, the terminology used herein shall prevail.
[0126] Finally, it should be understood that the embodiments disclosed herein are illustrative of the principles of the embodiments described in this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are merely examples and not limitations. Those skilled in the art can implement the applications described in this specification using alternative configurations based on the embodiments in this specification. Therefore, the embodiments in this specification are not limited to the embodiments precisely described in the applications.
Claims
1. A federated learning method applied to a target device, the method comprising: Determine a target subgraph, which includes connected target internal nodes, and the target internal nodes include target edge nodes connected to other end devices; Determine the target extended graph of the target subgraph, the target extended graph including the target subgraph and the graph connecting the target edge nodes and the target external nodes, the target external nodes being the edge nodes of the other end devices; as well as Based on the target extended graph, perform multiple iterations of training to obtain the target local model. In each iteration: The aggregated external embedding features of the target edge node are determined, wherein the aggregated external embedding features aggregate non-original features from the target external node. The global model is trained based on the aggregated external embedding features to obtain a local model. The parameters of the global model are the global parameters obtained in the previous iteration. The local parameters of the local model are sent to the server, wherein the server determines global parameters based on the local parameters of multiple local models corresponding to multiple end devices, and the multiple end devices include at least the target end device and the other end devices. Receive the global parameters sent by the server, and update the local parameters of the local model based on the global parameters.
2. The method as described in claim 1, wherein, Before determining the aggregated external embedding features of the target edge node, the method further includes: The global model is pre-trained based on the target extended graph to obtain a pre-trained local model.
3. The method as described in claim 2, wherein, The step of pre-training the global model based on the target extended graph to obtain a pre-trained local model includes: The global model is trained by comparative learning for a preset number of rounds based on the target extended graph to obtain the pre-trained local model.
4. The method of claim 3, wherein, In each round of training of the preset number of rounds: Determine the comparison model, which is the global model obtained from the previous training round; and The global model is trained by comparative learning based on the target extended graph and the comparison model to obtain the updated parameters of the global model in the current round.
5. The method of claim 4, wherein, The step of performing comparative learning training on the global model based on the target extended graph and the comparative model to obtain the updated parameters of the global model in the current round includes: The target extended graph is input into the comparison model for encoding, and the first embedding feature of each target internal node in the target extended graph is output. The target expansion graph is input into the global model of the current round for encoding, and the second embedding feature of each target internal node in the target expansion graph is output. For each of the target's internal nodes: Based on the second embedded feature and its corresponding true label, the classification loss is determined. Based on the second embedding feature of the current target internal node and the first embedding feature of each target internal node, a contrastive learning loss is obtained. This contrastive learning loss constrains the distance between the second embedding feature of the current target internal node and the first embedding feature of target internal nodes of the same category to be close, and constrains the distance between the second embedding feature of the current target internal node and the first embedding feature of target internal nodes of different categories to be far apart. The classification loss and the contrastive learning loss are weighted and summed to obtain the first loss; and The update parameters are determined based on the first loss of each target's internal nodes.
6. The method of claim 2, wherein, The server includes an edge server and a cloud server, wherein the distance between the edge server and the target device is closer than the distance between the cloud server and the target device.
7. The method of claim 6, wherein, The determination of the aggregated external embedding features of the target edge node includes: Based on the pre-trained local model, the embedding features of the target external node are obtained and sent to the edge server; and The edge server receives the aggregated external embedding feature, wherein the aggregated external embedding feature is obtained by the edge server aggregating the embedding features of the target edge node sent by the other end device, and the embedding features of the target edge node sent by the other end device include the features of the target external node.
8. The method of claim 2, wherein, The step of training the global model based on the aggregated external embedding features to obtain the local model includes: The pre-trained local model is trained based on the aggregated external embedding features to obtain the local model.
9. The method of claim 8, wherein, The step of training the pre-trained model based on the aggregated external embedding features to obtain the local model includes: The target extended graph is input into the pre-trained local model to obtain the aggregated internal embedding features of the target edge nodes. The aggregated internal embedding features aggregate features from the target internal nodes connected to the target edge nodes. The aggregated internal embedding features and the aggregated external embedding features are aggregated to obtain the aggregated embedding features of the target edge node; and A second loss is determined between the aggregated embedded features and the true labels of the target edge nodes, and the parameters of the pre-trained model are updated based on the second loss to obtain the local model.
10. The method of claim 1, wherein, The global parameters include parameters obtained by aggregating the local parameters of the multiple local models.
11. A federated learning system, comprising a target end device, the target end device comprising: At least one storage medium stores at least one set of instructions for implementing the federated learning; as well as At least one processor is communicatively connected to the at least one storage medium. When the federated learning system is running, the at least one processor reads the at least one instruction set and implements the federated learning method according to any one of claims 1-10.
12. A federated learning method applied to a server, the method comprising multiple iterations of training, in each iteration: Receive the embedded features of external nodes sent by multiple end devices, where, The embedding features of the external nodes sent by the multiple end devices respectively include the features of the edge nodes in the end device that are directly connected to the external nodes; for the target end device among the multiple end devices: The target terminal device includes a target external node and a target edge node connected to other terminal devices. The target external node of the target terminal device is the edge node of the other terminal device, and the target edge node of the target terminal device is the external node of the other terminal device. The embedded features sent by the multiple end devices are aggregated to obtain the aggregated external embedded features of the edge node of each end device. The aggregated external embedded features aggregate non-original features from the target external node. The aggregated external embedding features are sent to the corresponding end devices, wherein each end device trains a local model based on the aggregated external embedding features to obtain a global model, and the parameters of the global model are the parameters obtained in the previous loop. Receive local parameters of multiple local models sent by the multiple end devices, and aggregate the local parameters of the multiple local models to obtain global parameters; and The global parameters are sent to the plurality of end devices respectively, and the global parameters are configured to update the local parameters in the plurality of local models.
13. The method of claim 12, wherein, The server includes an edge server and a cloud server, wherein the distance between the edge server and the target device is closer than the distance between the cloud server and the target device.
14. The method of claim 13, wherein, The method of receiving the embedded features of external nodes sent by multiple end devices includes: The edge server receives the embedded features from the multiple end devices.
15. The method of claim 12, wherein, The process of aggregating the embedded features sent by the multiple end devices to obtain the aggregated external embedded features of the edge nodes of each end device includes, for the target end device: The edge server aggregates the embedding features of the target edge node of the target end device sent by the other end devices to obtain the aggregated external embedding features of the target edge node of the target end device. The embedding features of the target edge node of the target end device sent by the other end devices include the features of the target external node of the target end device.
16. The method of claim 15, wherein, The polymerization includes addition.
17. The method of claim 13, wherein, The receipt of local parameters of multiple local models sent by the multiple end devices includes: The cloud server receives local parameters of the multiple local models forwarded by the edge server.
18. The method of claim 12, wherein, The aggregation of local parameters from the multiple local models to obtain global parameters includes: Determine multiple model weights corresponding to the multiple local models, wherein the model weights are inversely proportional to the number of edge nodes of the corresponding end devices; and The global parameters are obtained by weighting and aggregating the weights of the multiple models with the local parameters of the multiple local models.
19. A federated learning system, comprising a server, said server comprising: At least one storage medium stores at least one set of instructions for implementing the federated learning; as well as At least one processor is communicatively connected to the at least one storage medium. When the federated learning system is running, the at least one processor reads the at least one instruction set and implements the federated learning method according to any one of claims 12-18.
Citation Information
Patent Citations
Knowledge graph representation learning optimization method and device and readable storage medium
CN111767411A
Federal learning-based model parameter updating method, device and equipment
CN113297396A