Federated Transfer Learning System

By dividing the edge servers in the Internet of Things into edge collaboration domains and performing hierarchical aggregation training, the problems of global model convergence and personalization requirements caused by the non-independent and identically distributed user image data are solved, the model convergence and system efficiency are improved, and the risk of privacy leakage is reduced.

CN116384504BActive Publication Date: 2025-09-12BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310163408.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2025-09-12
Estimated Expiration
2043-02-24

AI Technical Summary

Technical Problem

In the Internet of Things, the non-independent and identically distributed nature of user image data leads to reduced convergence of the global model and difficulty in meeting users' personalized needs. Traditional centralized and edge computing models suffer from user privacy leaks and communication traffic pressure.

Method used

The cloud server divides the edge server into edge collaboration domains based on its public image data features, and uses the domain head server and domain member servers for hierarchical aggregation. The domain model of each edge collaboration domain is trained separately to meet the personalized needs of users, and the domain model is obtained through edge model aggregation.

Benefits of technology

It improves the convergence of the global model and the communication and computing efficiency of the learning system, reduces the risk of user privacy leakage, and reduces communication traffic pressure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116384504B_ABST
    Figure CN116384504B_ABST
Patent Text Reader

Abstract

The present invention provides a federated transfer learning system. The system comprises a cloud server, an edge component, and a user component. The edge component comprises multiple edge servers, and the user component comprises multiple user terminals. The cloud server is used to divide the multiple edge servers into multiple edge collaboration domains based on feature information emitted by each edge server, and to determine a domain head server and domain member servers. The edge server is used to select a target user terminal and send global model parameters and training information. It is also used to obtain training parameters and perform edge aggregation to obtain an edge model. The domain head server is used to globally aggregate all edge models in the same edge collaboration domain to obtain a domain model. The domain head server is also used to send the domain model to the cloud server when the accuracy of the domain model reaches a preset threshold. The target user terminal is used to train a local model to obtain training parameters. This system can meet user personalized needs and improve model convergence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a federated transfer learning system. Background Art

[0002] With the rapid development of the Internet of Things (IoT), massive amounts of image data are generated by various intelligent devices with sensory capabilities, such as smartphones, smart cars, and security equipment. Leveraging artificial intelligence (AI) technology, we can use this image data to train machine learning models and apply them to scenarios such as smart cities and smart healthcare. Traditional centralized machine learning models adopt a "train first, then deploy" approach, centralizing image data collected by user terminals to a cloud center, where servers in the cloud center then train a general machine learning model. However, this centralized model training model is limited by communication, computing, and storage resources, and cannot meet the latency requirements of real-time inference. The emergence of edge computing technology allows user terminals to offload complex computing tasks to nearby edge servers, which then complete model training, effectively reducing data processing and transmission latency. However, users still need to upload their personal data to nearby edge servers over public wireless networks, a process that poses the risk of privacy leakage. Furthermore, transmitting large amounts of data, such as images and videos, places significant traffic pressure on both user terminals and edge servers. These two drawbacks significantly reduce the feasibility of implementing large-scale distributed machine learning services in the IoT.

[0003] Federated learning is a distributed machine learning model that allows multiple user terminals to collaboratively train a machine learning model without requiring users' personal data to leave the local machine. This effectively reduces the risk of privacy leaks. In a horizontal federated learning architecture, an aggregator (such as a parameter server) distributes the initial global model to all participating user terminals. The user terminals use their own computing resources and local data to train the model and upload the updated model parameters to the aggregator. The aggregator then averages the model parameters submitted by all terminals to obtain the next global model. After multiple rounds of iteration, the trained global model is finally achieved. However, when horizontal federated learning is applied to IoT scenarios, due to the differences in the geographical location of user terminals and their corresponding user behavior preferences, the corresponding image data is non-independent and identically distributed (IID). This non-IID data significantly reduces the convergence of the global model. Furthermore, due to the inconsistency between the global data distribution and the user terminal data distribution, a universal global model is difficult to meet the personalized needs of different users, resulting in poor performance of the global model trained by federated learning on users' local data. Summary of the Invention

[0004] The present invention provides a federated transfer learning system to solve the problems in the prior art of reduced global model convergence caused by non-independent and identically distributed user image data and the difficulty of a global model in meeting the personalized needs of users. The system implements a method of constructing regions with similar data into an edge collaboration domain based on the similarity of public image data in edge servers, and meets the personalized needs of users by separately training domain models of each edge collaboration domain. In addition, the convergence of the domain model is improved to a certain extent by first aggregating the edge models and then obtaining the domain model from the edge models.

[0005] The present invention provides a federated transfer learning system, comprising: a cloud server, an edge component and a user component, wherein the edge component comprises a plurality of edge servers, and the user component comprises a plurality of user terminals;

[0006] The cloud server is used to divide the plurality of edge servers into a plurality of edge cooperation domains based on the characteristic information sent by each edge server, and determine a domain head server and a domain member server among the plurality of edge servers in each edge cooperation domain;

[0007] The edge server is used to select a target user terminal based on the joining request of the user terminal and send the parameters and training information of the global model to the selected target user terminal, and is also used to obtain the training parameters sent by the corresponding target user terminal and perform edge aggregation to obtain an edge model;

[0008] The domain head server is used to globally aggregate all the edge models in the same edge cooperation domain to obtain a domain model, and the domain head server is further used to send the domain model to the cloud server when the accuracy of the domain model reaches a preset threshold;

[0009] The target user terminal is used to train a local model based on the parameters of the global model and the training information sent by the corresponding edge server and based on the local data sample to obtain the training parameters.

[0010] According to a federated transfer learning system provided by the present invention, the cloud server is further used to perform pre-training based on the public image data on each of the edge servers to obtain the initial global model, and send the initial global model to each of the edge servers.

[0011] According to a federated transfer learning system provided by the present invention, each edge server is further configured to generate initial feature information based on the initial global model and send the initial feature information to the cloud server.

[0012] According to a federated transfer learning system provided by the present invention, the edge server is specifically configured to:

[0013] Sending the parameters of the global model and the training information to the corresponding target user terminal;

[0014] Obtaining the training parameters sent by the corresponding target user terminal;

[0015] Edge aggregating the training parameters of each target user terminal to obtain an initial edge model;

[0016] Using the initial edge model as the global model of a new round, and sending its parameters to the reselected target user terminal;

[0017] After repeating the above steps for a preset number of rounds, the edge model is obtained.

[0018] According to a federated transfer learning system provided by the present invention, when the edge server is used to edge aggregate the training parameters of each target user terminal to obtain an initial edge model, the system specifically includes:

[0019] Aligning all the training parameters according to the layer number;

[0020] Based on the newness or oldness of each of the training parameters, edge aggregation is performed on each of the training parameters to obtain the initial edge model.

[0021] According to a federated transfer learning system provided by the present invention, the domain head server is further used for:

[0022] When the accuracy of the domain model does not reach a preset threshold, the domain model is sent as the global model of a new round to the domain member servers in the same edge cooperation domain.

[0023] According to a federated transfer learning system provided by the present invention, after obtaining the domain model of a preset round, the domain head server and the domain member server are further configured to:

[0024] Based on the domain model of a preset round, a new round of feature information is generated and sent to the cloud server.

[0025] According to a federated transfer learning system provided by the present invention, after obtaining the domain model of a preset round, the domain head server and the domain member server are specifically configured to:

[0026] Randomly sampling from the public image data to obtain a preset number of data samples;

[0027] Compressing the feature space of the data sample using the domain model of a preset round as a feature extractor;

[0028] Calculating a fingerprint vector of the compressed data sample using a perceptual hash algorithm;

[0029] The fingerprint vectors of the data samples are stacked to obtain the feature information.

[0030] According to a federated transfer learning system provided by the present invention, the cloud server is specifically used for:

[0031] Calculating the similarity between any two edge servers based on the feature information sent by each edge server;

[0032] Constructing a similarity graph based on the similarity between any two edge servers;

[0033] According to the similarity graph, dividing the plurality of edge servers into a plurality of edge collaboration domains based on a spectral clustering algorithm;

[0034] The domain head server and the domain member servers are determined according to resource conditions of each edge server in each edge cooperation domain.

[0035] According to a federated transfer learning system provided by the present invention, the target user terminal is specifically configured to:

[0036] Determine a migration layer and a training layer in a local model according to the parameters of the global model and the training information sent by the corresponding edge server;

[0037] Migrating the parameters of the model layer corresponding to the migration layer in the global model to the migration layer of the local model;

[0038] Train parameters of the training layer in the local model to obtain training parameters.

[0039] The federated transfer learning system provided by the present invention divides edge servers with similar public image data features into the same edge collaboration domain through a cloud server. Since the public image data in the edge servers can reflect the image data features of the target user terminals in the area where the edge servers are located to a certain extent, the domain model is further obtained through the local model of the target user terminals in the edge collaboration domain. The multiple domain models of multiple edge collaboration domains can meet the personalized needs of multiple users. Furthermore, when further obtaining the domain model through the local model of the target user terminals in the edge collaboration domain, edge aggregation is first performed to obtain the edge model, and then the domain model is obtained by aggregating the edge models in the same edge collaboration domain. Based on the above-mentioned hierarchical aggregation mechanism, the convergence of the obtained domain model is improved to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 Schematic diagram of the structure of the federated transfer learning system provided by the present invention;

[0042] Figure 2 This is a schematic diagram of the communication process between the edge server and the user terminal provided by the present invention;

[0043] Figure 3 Schematic diagram of the workflow of the federated transfer learning system provided by the present invention;

[0044] Figure 4 This is a schematic diagram of edge aggregation performed by the edge server provided by the present invention;

[0045] Figure 5 It is a flow chart of the edge collaboration domain construction method provided by the present invention;

[0046] Figure 6 This is one of the schematic diagrams of the experimental results provided by the present invention;

[0047] Figure 7 This is the second schematic diagram of the experimental results provided by the present invention;

[0048] Figure 8 This is the third schematic diagram of the experimental results provided by the present invention;

[0049] Figure 9 This is the fourth schematic diagram of the experimental results provided by the present invention;

[0050] Figure 10 This is the fifth schematic diagram of the experimental results provided by the present invention;

[0051] Figure 11 This is the sixth schematic diagram of the experimental results provided by the present invention. DETAILED DESCRIPTION

[0052] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0053] The following combination Figures 1-11 Description The present invention provides a federated transfer learning system, which includes: a cloud server, an edge component and a user component, wherein the edge component includes multiple edge servers, and the user component includes multiple user terminals; the cloud server is used to divide the multiple edge servers into multiple edge collaboration domains based on the feature information sent by each edge server, and determine the domain head server and domain member servers among the multiple edge servers in each edge collaboration domain; the edge server is used to select the target user terminal based on the joining request of the user terminal and send the parameters and training information of the global model to the selected target user terminal, and is also used to obtain the training parameters sent by the corresponding target user terminal and perform edge aggregation to obtain the edge model; the domain head server is used to globally aggregate all the edge models in the same edge collaboration domain to obtain a domain model, and the domain head server is also used to send the domain model to the cloud server when the accuracy of the domain model reaches a preset threshold; the target user terminal is used to train the local model based on the parameters and training information of the global model sent by the corresponding edge server and based on local data samples to obtain the training parameters.

[0054] Specifically, refer to Figure 1 As shown in , the federated learning system consists of cloud servers, edge components and user components. The edge components include M edge servers, and the user components include N user terminals. M} represents the edge component composed of M edge servers, and v={V1,…v N} represents a user component consisting of N user terminals. The cloud server obtains feature information from the edge servers. This feature information is obtained by each edge server based on its own public image data. Based on this feature information, the cloud server can divide multiple edge servers into multiple edge collaboration domains. The public image data of the edge servers in each edge collaboration domain has a certain degree of similarity. The public image data is image data collected by public facilities in the area where the edge server is located, such as image data collected by public cameras.

[0055] The edge cooperation domain set can be expressed as ED = {ED1, ...ED k}, element ED k Represents the edge collaboration domain, set Indicates that it belongs to the edge server s j ∈S target user terminal set, that is Indicates user terminal v i For edge servers jThe target user terminals participating in the federated learning task are selected. In each edge collaboration domain, the cloud server selects the edge server with the largest resource capacity as the domain leader server based on the resource capacity of each edge server. The remaining edge servers serve as domain member servers. The resources of the edge servers can include computing resources and memory resources.

[0056] To improve the efficiency of the entire federated transfer learning system, the edge server selects each user terminal that applies to participate in the learning process. Only the selected target user terminals will establish a connection with the edge server and be eligible to participate in the federated learning task. This avoids resource waste caused by timeouts. However, overly stringent selection criteria can result in a small number of user terminals eligible to participate, which can affect the convergence speed of the edge model. Therefore, the minimum number of local iterations and the maximum batch size can be used to estimate the user terminal's latency. If the latency is less than the remaining time of the edge server's communication window, the user terminal is selected as the target user terminal.

[0057] In a communication round, the latency of the user terminal mainly includes communication latency and computational latency. In deep learning tasks with large computational load, computational latency is the main part.

[0058] (1) Communication delay: This mainly includes the delay of the user terminal downloading the parameters of the global model and uploading the training parameters. In order to ensure the uniformity of the delay calculation, only the model parameters are considered as the content of the transmission, without considering the communication overhead caused by the model structure. At the same time, we assume that the bandwidth of the terminal is the same when downloading and uploading. User terminal v i The data transmission rate δ i It can be calculated according to Shannon's formula as follows:

[0059]

[0060] Among them, B i is the user terminal v i Available bandwidth, ρ i is the transmission power, ψ i is the user terminal v i The gain of the transmission channel established between and the edge server, and N0 is the Gaussian noise power.

[0061] Therefore, the user terminal v i The communication delay is:

[0062]

[0063] Among them, λ i is the migration vector, indicating which layers of the model are migrated, w G is the global model, w iFor the local model, the parameters of the global model and the local model are consistent in data size, so |w G |=|w i |.

[0064] (2) Computational delay: The computational load of the user terminal mainly comes from the training of the local model. In deep learning tasks, the training of the local model consists of two parts: forward propagation and back propagation. The back propagation process calculates the gradients of all model parameters and updates the model parameters through the stochastic gradient descent algorithm (SGD). Therefore, the user terminal v i The calculation delay is:

[0065]

[0066] Among them, C i is the user terminal v i The number of floating-point operations that can be executed per unit time is used to indicate the computing power of the user terminal. i is the user terminal v i The number of iterations for training the local model, and b i is the batch size for this iteration, |D i | indicates user terminal v i The number of samples in the training data set is Φ, Φ is the floating-point computation required for forward propagation when training a single local data sample, and Φ′ is the floating-point computation required for back propagation to execute the stochastic gradient descent algorithm (SGD) when training a single local data sample.

[0067] It is understandable that the selected target user terminal can submit local model gradient updates at any time within the communication window period, and after submission is completed, there is no need to wait for other target user terminals corresponding to the corresponding edge server to complete submission, so there is no waiting delay. i The total delay is expressed as:

[0068]

[0069] Figure 2 The process of establishing a connection between the user terminal and the edge server is as follows: First, the user terminal sends a request message Q to the edge server to participate in the training task. i = i ,C i ,|D i |>. Then, the edge server estimates the delay of the user terminal according to formula (4) where the migration vector λ i ​Set to unit α=<1,...1> (i.e. no parameter migration), and the number of iterations is set to the minimum value e min , the batch size is set to the maximum value b max If the delay Not exceeding the remaining time T of the edge server communication window in this round free , then the user terminal v i Join the selected target user terminal set And T free As the timeout period for the connection established between the edge server and the user terminal After being selected, the edge server sends a response message to the target user terminal, allowing it to participate in the task. The response message contains the parameters of the global model, the connection timeout time, and the The floating-point computational effort Φ required for forward propagation when training a single local data sample, and the floating-point computational effort Φ′ required for backpropagation using the stochastic gradient descent (SGD) algorithm when training a single local data sample, are calculated. The selected user terminal performs local training based on the local user image data based on the response message to obtain a local model. If the selected user terminal is not selected, the edge server sends a response message to the unselected user terminal, denying its participation request. The global model parameters and timeout in this response message are set to null and 0, respectively, to reject the user terminal's participation request.

[0070] like Figure 3 As shown in Figure 2, the specific work of the federated transfer learning system is as follows:

[0071] All edge servers in the edge component send feature information obtained based on their own public image data to the cloud server. The cloud server divides multiple edge servers into multiple edge collaboration domains based on similarity based on each feature information, and determines the domain head server and domain member server in each edge collaboration domain and broadcasts the network address in the domain head server to each domain member server, so that each domain member server establishes a connection with the corresponding domain head server, wherein the domain head server establishes a connection with the cloud server. After each domain member server establishes a connection with the corresponding domain head server, it does not need to communicate with the cloud server.

[0072] Each edge server selects a target user terminal according to the joining request of the user terminal.

[0073] The domain head server and domain member server send the parameters and training information of the global model (i.e., the above-mentioned response message allowing participation in the task) to the corresponding target user terminal. The target user terminal uses the local user image data for local training to obtain a local model, and sends the training parameters of the local model to the corresponding domain head server or domain member server via Wi-Fi or 5G cellular network. During training, the target user terminal only trains the parameters of some layers of the local model according to its own resource conditions, and the parameters of the remaining layers can be migrated from the global model.

[0074] The domain head server and the domain member server respectively perform edge aggregation on the training parameters of the corresponding target user terminal to obtain an edge model. The domain head server aggregates all edge models in the collaborative domain to obtain a domain model. The system continues to learn and train until the accuracy of the obtained domain model reaches a preset threshold, and then sends the domain model to the cloud server for subsequent model deployment, or it can be used as the initial global model for other federated learning tasks. Among them, when the above learning and training is continued, the edge-aggregated edge model or the globally aggregated domain model can be sent to the target user terminal as a new round of global model, so that the target user terminal can be trained for multiple communication rounds. Furthermore, in the federated transfer learning system, the communication and computing resources of the user terminals in the edge server area are limited and time-varying. Therefore, in each edge aggregation round, that is, before each global model is sent down, the domain head server and the domain member server need to reselect the target user terminal in the user terminal.

[0075] The federated transfer learning system provided by the present invention divides edge servers with similar public image data features into the same edge collaboration domain through a cloud server. Since the public image data in the edge servers can reflect the image data features of the target user terminals in the area where the edge servers are located to a certain extent, the domain model is further obtained through the local model of the target user terminal in the edge collaboration domain. The multiple domain models of multiple edge collaboration domains can meet the personalized needs of multiple users. Furthermore, when further obtaining the domain model through the local model of the target user terminal in the edge collaboration domain, edge aggregation is first performed to obtain the edge model, and then the domain model is obtained by aggregating the edge models in the same edge collaboration domain. Based on the above-mentioned hierarchical aggregation mechanism, the convergence of the obtained domain model is improved to a certain extent, thereby improving the communication and computing efficiency of the learning system.

[0076] In one embodiment, the cloud server is further configured to perform pre-training based on public image data on each of the edge servers to obtain the initial global model, and send the initial global model to each of the edge servers.

[0077] Specifically, the initial global model at the beginning of the federated transfer learning task can be obtained and sent by the cloud server. The cloud server obtains the public image data of all edge servers for pre-training to obtain the initial global model and send the initial global model to each edge server.

[0078] In a real-time example, each edge server is further configured to generate initial feature information based on the initial global model and send the initial feature information to the cloud server.

[0079] Specifically, edge servers j From its public image dataset Random sampling N s data samples and uses the initial global model as a feature extractor to compress the feature space of these sampled data samples. j Calculate N for each compressed sample using the perceptual hashing algorithm d dimensional fingerprint vector And all fingerprint vectors Stack to get the feature matrix H j :

[0080] All edge servers will set their feature matrix H j As the initial feature information is sent to the cloud server. For any two edge servers s i and S j , the cloud server calculates the data similarity SL between them based on the Gaussian similarity function ij :

[0081]

[0082] Among them, σ 2 Indicates edge servers i All fingerprint vectors and edge servers j The variance of all fingerprint vectors.

[0083] Based on the similarity, the cloud server divides multiple edge servers into multiple edge collaboration domains.

[0084] In one embodiment, the edge server is specifically used to: send the parameters of the global model and the training information to the corresponding target user terminal; obtain the training parameters sent by the corresponding target user terminal; edge aggregate the training parameters of each target user terminal to obtain an initial edge model; use the initial edge model as the global model of a new round, and send its parameters to the reselected target user terminal; repeat the above steps for a preset number of rounds to obtain the edge model.

[0085] Specifically, such as Figure 2 As shown, before the domain head server performs global aggregation on the edge model, multiple rounds of local model training and multiple edge aggregations will be performed. Specifically, the edge server sends the parameters of the global model and the training information to the corresponding target user terminal. After the target user terminal performs local training, the training parameters are sent to the edge server. The edge server aggregates the training parameters of all corresponding target user terminals to obtain the initial edge model. The edge server reselects the corresponding target user terminal, uses the initial edge model as the global model for the new round, and sends the parameters of the new round of global model to the reselected target user terminal. After repeating the above steps for a preset number of rounds, the initial edge model obtained by the preset number of rounds of edge aggregation is used as the edge model for the corresponding domain head server to perform global aggregation to obtain the domain model.

[0086] After completing the division of the edge collaboration domain, the cloud server sends the domain model accuracy requirements to the domain head server of each edge collaboration domain. The domain head server then determines the domain aggregation period and notifies all domain member servers within the edge collaboration domain as task information. After receiving the task information, each domain member server determines the communication window size and the number of edge aggregation rounds in each global aggregation round based on the resource status of the terminals in the service area.

[0087] For each user terminal Use F(w i ) represents its local model w i In the training dataset The loss function is:

[0088]

[0089] Among them, |D i | is the number of samples in the training dataset, and f(·) is a user-specified loss function related to the data type of the training dataset, such as mean squared error (MSE) and cross entropy loss (CE).

[0090] Edge Server S j Set the target user terminal Aggregate the training parameters submitted by all target user terminals to obtain the initial edge model Then the loss function of the initial edge model is It can be:

[0091]

[0092] in, For edge server S j Selected target user terminal set The total number of samples in the training dataset of all target user terminals in .

[0093] Furthermore, the average data similarity of each edge server can be used As the approximate coefficient regularizes its marginal model At this point, the loss function of the edge model Can be transformed into:

[0094]

[0095] Among them, |ED k | represents the edge collaboration domain ED k The total number of user terminals in the .

[0096] In one embodiment, when the edge server is used to edge aggregate the training parameters of each target user terminal to obtain an initial edge model, it specifically includes: aligning all the training parameters according to the layer number; and based on the newness of each training parameter, edge aggregating each training parameter to obtain the initial edge model.

[0097] Specifically, the hierarchical aggregation mechanism consists of two aggregations at different time scales: edge aggregation and global aggregation. The former trains the edge model between the target user terminal and the edge server, while the latter trains the domain model of the edge collaboration domain between the domain head server and domain member servers.

[0098] like Figure 4 As shown in Figure 1, an example of edge aggregation is shown. After completing local training, the target user terminal uploads the training parameters of the updated local model training layer to the edge server to which it belongs. Then, the edge server aligns the training parameters uploaded by all selected target user terminals according to the layer number. Due to the different resource conditions of different target user terminals, the update frequency of the training parameters they submit is also different. Directly aggregating the training parameters of different periods at the edge will affect the convergence of the domain model. Therefore, the target user terminal v is defined as i The staleness θ of the local model update i , used to indicate the staleness of the training parameters submitted by the target user terminal:

[0099]

[0100] Where t is the current edge aggregation round, T i is the target user terminal v i is the number of rounds of communication with the edge server, and β is the staleness impact coefficient.

[0101] The edge server weights the training parameters submitted by different target user terminals based on staleness and performs edge aggregation to obtain the initial edge model of the next round of edge aggregation as the global model of the new round.

[0102]

[0103] For the parameters of the local model migration layer that are not uploaded by the target user terminal, the edge server uses the parameters of the corresponding layer of the current edge model when performing aggregation replace.

[0104] After the preset number of rounds of edge aggregation, all domain member servers in the edge collaboration domain will Sent to the domain head server in the edge cooperation domain. Since the training strategy of the target user terminal under each edge server is different, the training degree of each edge model is also different. The more training layers participate in the training of the edge model, the better the edge server s j The greater the contribution to the domain model, the greater the contribution to the domain model. Therefore, the edge server is defined here j Average training volume:

[0105]

[0106] in, Indicates edge servers j The number of edge aggregation rounds in the current global aggregation round, Indicates the target user terminal set The total number of terminals in , ‖λ i (t)‖ represents the migration vector λ i (t) modulus.

[0107] The domain head server performs domain aggregation based on the average training amount of each edge server to obtain the domain model w G (t+1):

[0108]

[0109] in, Edge Collaboration Domain (ED) k The total number of samples in the training data set of all target user terminals in the target user terminal.

[0110] The domain head server will edge collaboration domain ED k The edge model parameters submitted by all domain member servers are globally aggregated to obtain the domain model, which is the new global model w G , w G The loss function is:

[0111]

[0112] The optimization goal of the federated learning task of this system is to determine the appropriate migration layer, i.e., the migration vector λ, without timeout or memory overflow. i And the corresponding training layer, so as to minimize the loss function value of the domain model, the loss function is as follows:

[0113]

[0114]

[0115] Constraint (a) gives the value range of each element in the migration vector, and constraint (b) requires that each target user terminal v i The delay τ(λ in each communication round i ,e i ,b i ) must be smaller than the communication window t of the edge cooperation domain E , and constraint (c) requires that the target user terminal b i The memory resource r(λ i ,b i ) must be less than or equal to its available memory resources

[0116] In one embodiment, the domain head server is further configured to: when the accuracy of the domain model does not reach a preset threshold, send the domain model as the global model of a new round to the domain member servers in the same edge cooperation domain.

[0117] Specifically, if the domain model's accuracy reaches a preset threshold, the learning task is complete. If the domain model's accuracy falls below the preset threshold, the learning task is incomplete and further learning is required. The domain head server then sends the domain model as the global model for the next global aggregation round to the domain member servers in the same edge collaboration domain. The edge servers in the edge collaboration domain then continue to select target user terminals for training.

[0118] In one embodiment, after obtaining the domain model of a preset round, the domain head server and the domain member server are further configured to: generate a new round of feature information based on the domain model of the preset round and send the new round of feature information to the cloud server.

[0119] Specifically, because the initial global model's feature extraction capabilities are limited in the early stages of training, this can lead to deviations between the initial calculated and true similarities between edge servers. Therefore, a domain model, updated after multiple rounds of training, can be used as a feature extractor for edge server data samples to extract feature information for cloud servers to re-partition edge collaboration domains. Furthermore, given the fluctuating resource availability of edge servers, it's necessary to reselect the domain leader for each edge collaboration domain after re-partitioning it.

[0120] In one embodiment, after obtaining the domain model of a preset round, the domain head server and the domain member server are specifically used to: randomly sample from the public image data to which they belong to obtain a preset number of data samples; use the domain model of the preset round as a feature extractor to compress the feature space of the data samples; use the perceptual hash algorithm to calculate the fingerprint vector of the compressed data sample; and stack the fingerprint vectors of the data sample to obtain the feature information.

[0121] Specifically, such as Figure 5 As shown in , when the edge server re-determines the feature information, the edge server s j From its public image dataset Random sampling N s data samples, and uses the domain model of the preset round as the feature extractor to compress the feature space of these sampled data samples. j Calculate N for each compressed sample using the perceptual hashing algorithm d dimensional fingerprint vector And stack all fingerprint vectors to get the feature matrix H j :

[0122]

[0123] All edge servers send their own feature matrices to the cloud server as feature information for re-dividing the edge collaboration domain. i and s j , the cloud server calculates the data similarity SL between them based on the Gaussian similarity function ij :

[0124]

[0125] Based on the similarity, the cloud server re-divides multiple edge servers into multiple edge collaboration domains and re-determines the domain head server.

[0126] Furthermore, after the edge collaboration domain is re-divided, the domain model obtained by the domain head server in the previous global aggregation round in the new edge collaboration domain becomes the global model for the new global aggregation round of the edge collaboration domain. This global model is distributed by the domain head server to the domain member servers in the same edge collaboration domain. The domain head server and domain member servers then distribute it to the corresponding target user terminals for local training by the target user terminals.

[0127] In one embodiment, the cloud server is specifically configured to: calculate the similarity between any two edge servers based on feature information sent by each edge server; construct a similarity graph based on the similarity between any two edge servers; divide the plurality of edge servers into a plurality of edge collaboration domains based on a spectral clustering algorithm according to the similarity graph; and determine the domain head server and the domain member servers based on the resource status of each edge server in each edge collaboration domain.

[0128] Specifically, such as Figure 5 As shown in , after the cloud server completes the similarity calculation between any two edge servers, it can build a similarity graph G = (ES, SL) based on the similarity. In the similarity graph, the vertex set ES = {ES1,…,ES M} represent all edge servers, and the edge set SL = {SL ij ,i,j∈S} represents any two edge servers

[0129] The data similarity between them is calculated. Then, based on the similarity graph G, the cloud server executes a spectral clustering algorithm based on the regularized Laplacian matrix to divide all edge servers into K edge collaborative training domains. The clustering result is obtained by inputting the first K eigenvectors of the Laplacian matrix L into the K-Means clustering algorithm, where the value of K can be determined by a heuristic eigenvalue difference search algorithm. The regularized Laplacian matrix L is calculated as follows:

[0130]

[0131] Where I is the identity matrix, and are the adjacency matrix and degree matrix of the similarity graph G respectively.

[0132] In each edge collaboration training domain, the cloud server divides all edge servers into a domain head server and several domain member servers based on the resource status of the edge servers. The domain head server serves as the controller of the entire edge collaboration domain and is responsible for performing domain aggregation to obtain the domain model and communicating with the cloud server. Since the domain head server needs to bear additional workload, we must select an edge server with abundant resources to play this role. Here, we define any edge server sj The resource capacity is:

[0133]

[0134] in, Indicates the number of target user terminals selected by the edge server, is the total number of target user terminals selected in the edge cooperation domain, and and are the available bandwidth and computing power of the edge server respectively, and ω1, ω2 and ω3 are weight parameters.

[0135] The cloud server selects the edge server with the largest resource capacity as the domain leader of the edge collaboration domain and broadcasts its network address to the remaining domain member servers. After establishing a connection with the domain leader, all domain member servers no longer need to communicate with the cloud server during the learning process.

[0136] This system uses a cloud server similarity-based clustering method to construct an edge collaboration domain to alleviate the impact of data heterogeneity on model convergence; it uses a spectral clustering algorithm to construct an edge collaboration domain, while taking into account the data distribution and resource conditions of user terminals, thereby enhancing collaboration between edge servers while accelerating the convergence of the domain model.

[0137] In one embodiment, the target user terminal is specifically used to: determine the migration layer and the training layer in the local model based on the parameters of the global model and the training information sent by the corresponding edge server; migrate the parameters of the model layer corresponding to the migration layer in the global model to the migration layer of the local model; and train the parameters of the training layer in the local model to obtain training parameters.

[0138] Specifically, the target terminal device's resources primarily consist of computing power and memory. Computing power refers to the processing power of the terminal device's computing unit (CPU or GPU), which affects the time it takes for the target user terminal to complete local model training. Memory resources directly determine whether the target user terminal can participate in federated learning tasks. Memory usage is primarily composed of data usage and model usage.

[0139] (1) Model occupancy: When training a deep learning model, the computing unit loads three parts into memory: model parameters, model parameter gradients, and gradient information saved by the optimizer. In this embodiment, the target user terminal divides the parameters of each layer of the global model into a migration layer and a training layer according to whether they participate in training. The parameters of the migration layer do not have gradients, and accordingly, the optimizer does not save the gradient information of these parameters. Therefore, the model occupancy is:

[0140]

[0141] Among them, λ i = <a i1 , a i2 , …, a iK , a k ∈ {0, 1} is the migration vector of the user terminal, which is used to indicate whether the k-th layer of the local model participates in local training. If a k = 1, the k-th layer is the training layer; if a k = 0, the k-th layer is the migration layer. w i = {w i1 , …, w iK} are the parameters of each layer of the local model of the target user terminal, g i = {g i1 , …, g iK} is the gradient of the parameters of each layer of the local model. |w i | and |g i | respectively represent the data sizes of the local model parameters and gradients. is the memory occupancy coefficient of the local model, which is related to the specific machine learning framework.

[0142] (2) Data occupancy: When using the stochastic gradient descent algorithm SGD to update the model parameters, it is necessary to load a batch of data samples of the batch size into the memory as the input of the model, and a large number of intermediate variables related to the model parameters will also be generated during the forward propagation process. Increasing the batch size can reduce the time of one iteration of the model, but will correspondingly increase the memory resource occupancy. The training data of the target user terminal v i occupies the memory resources as follows:

[0143]

[0144] Among them, b i is the batch size of the training data of the terminal v i , d is the size of a single data sample, is the memory occupancy coefficient of the intermediate variables, which is related to the specific machine learning framework.

[0145] Therefore, in one communication round, the memory resource occupancy of the target user terminal v i is as follows:

[0146]

[0147] Before starting local training, the selected target user terminal needs to, according to its own resource status, as well as the global model given by the edge server, the floating-point computation amount Φ required for forward propagation when training a single local data sample, the floating-point computation amount Φ′ required for performing the stochastic gradient descent algorithm (SGD) during backpropagation when training a single local data sample, and the connection timeout Determine which layers of the edge model parameters are directly transferred to the local model, and adjust the number of iterations e accordingly i and batch size b i These two training parameters.

[0148] According to formula (20), the user terminal v i The migration vector λ i It will affect the memory resource usage of the model gradient. i The closer it is to the unit vector, the fewer migration layers there are, and the greater the memory resource consumption of the target user terminal. When the total memory resource consumption of the target user terminal is greater than its available memory resources, a memory overflow event will occur in the target user terminal. According to formula (4), different migration vectors λ i It also affects the target user terminal's computational and communication latency. A timeout occurs when the target user terminal's total latency exceeds the timeout period set by the edge server. Both timeouts and memory overflows can cause the target user terminal to fail in the federated learning task, severely impacting the stability of the federated learning system. However, the greater the number of migration layers, the slower the edge model converges. Therefore, during local training, optimizing the number of migration layers is a trade-off between model quality and resource consumption. The goal of training strategy development is to maximize the number of migration layers by adjusting migration vectors and training parameters without causing memory overflows or timeouts, thereby ensuring the quality of the edge model and the stability of the entire federated transfer learning system.

[0149] Since memory overflow determines whether the target user terminal can perform the federated learning task, we first determine the migration vector λ based on the available memory resources of the target user terminal. i , maximize the number of migration layers to prioritize the quality of the edge model, and i Determine the maximum batch size b j In order to shorten the computational delay. i , assuming that the batch size in a communication round of the target user terminal is b′ i , then the maximum value of the batch can be calculated as:

[0150]

[0151] Among them, r(λ i ,b′ i ) represents the memory resource usage of the target user terminal in a communication round.

[0152] Then, the target user terminal will Adjust the migration vector λ i , and in the corresponding λ iMaximize the number of local iterations e i , in order to make full use of computing resources and communication windows. For each λ i , assuming that the number of local iterations in a communication round at the target user terminal is e′ i , then the maximum number of local iteration rounds can be calculated as:

[0153]

[0154] Among them, τ(λ i ,e′ i ,b i ) represents the delay of the target user terminal in the previous communication round.

[0155] Because some layers of a deep neural network (DNN) may have dependencies and cannot be migrated individually, the edge server contains an optional set of migration vectors x (each migration vector corresponds to a decreasing number of migration layers and computational complexity). When a target user terminal first establishes a connection with the edge server, the edge server sends the migration vector set x to the target user terminal. Conversely, the target user terminal linearly explores feasible migration vectors in both directions, starting from the migration vector position set in the previous communication round.

[0156] The target user terminal determines the migration vector based on its own resource conditions, which to a certain extent solves the problem of poor federated learning efficiency caused by the heterogeneous resources of each user terminal.

[0157] The federated transfer learning system provided by the present invention divides edge servers with similar public image data features into the same edge collaboration domain through a cloud server. Since the public image data in the edge servers can reflect the image data features of the target user terminals in the area where the edge servers are located to a certain extent, the domain model is further obtained through the local model of the target user terminals in the edge collaboration domain. The multiple domain models of multiple edge collaboration domains can meet the personalized needs of multiple users. Furthermore, when further obtaining the domain model through the local model of the target user terminals in the edge collaboration domain, edge aggregation is first performed to obtain the edge model, and then the domain model is obtained by aggregating the edge models in the same edge collaboration domain. Based on the above-mentioned hierarchical aggregation mechanism, the convergence of the obtained domain model is improved to a certain extent.

[0158] The following examples illustrate the advantages of this federated transfer learning system:

[0159] In our experiments, we used a system consisting of five computing nodes as the experimental platform. These five computing nodes included a server and four laptops equipped with graphics cards (Table 1 shows the laptop hardware configuration). The laptops were connected to the server via Wi-Fi. We launched a separate process on the server to simulate the cloud server and multiple processes to simulate edge servers. Each process listened for access requests from user terminals on a designated port. Furthermore, we launched multiple processes on four laptops with varying computing power to simulate vehicle user terminals. Each process was allocated a different amount of available bandwidth and graphics card memory, simulating a heterogeneous network environment.

[0160] Table 1

[0161] equipment Bandwidth / Mbps Computing power / TFLOPS Video memory / GB 1 100 15.3 8 2 100 2.7 2 3 100 5.2 4 4 10 5.2 4

[0162] (1) Model and data

[0163] In this experiment, YOLOv5 was used as the training model, and the object detection datasets COCO and KITTI were used as datasets. The COCO dataset is a large-scale image dataset released by Microsoft, containing 330,000 images with 80 object categories. It serves as a public image dataset for cloud-based pre-training of the YOLOv5 model. KITTI is an image dataset used in the field of autonomous driving, consisting of five data collection scenarios and eight label categories. We assigned partial image data of one scenario to each edge server and the terminals within its service area to simulate a real-world environment. To evaluate the impact of data heterogeneity on model performance, we used two data partitioning methods when assigning samples from the KITTI dataset to terminals: 1) IID: Data samples are randomly distributed evenly to all terminals and edge servers, ensuring that the data distribution is similar across all nodes. 2) Non-IID: All data is divided into three categories according to label, with each edge server and terminal assigned to two of the categories and completely missing data from the remaining category.

[0164] (2) Benchmarks and evaluation criteria

[0165] In this experiment, in order to evaluate the performance of the technical solution of this application, we set up three reference benchmark solutions as follows. In each solution, we set the same resource allocation and used the same initial global model. Among them, solution (a) is the most typical federated learning method, while solution (b) is a federated learning method that removes resource awareness and edge collaboration domains, but adds an approximation term to the loss function, and solution (c) is a federated learning method that constructs an edge collaboration domain but only migrates fixed layers. The loss function value and average accuracy (mAP@0.5 and mAP@0.5:0.95) are used as evaluation criteria for the model, and the average latency and average memory resource occupancy are used as evaluation criteria for the federated learning system.

[0166] (a) FedAvg: No collaborative domain is built (single edge server) and the user terminal trains the parameters of the entire local model (i.e., for each user terminal, the migration vector λ j =<1,…,1> is a fixed value).

[0167] (b) FedProx: Based on FedAvg, it adds an approximation term to the loss function of the local model to alleviate the data heterogeneity problem, and does not adopt collaborative domain and transfer learning methods.

[0168] (c) FTL: constructs the edge collaboration domain but performs a fixed transfer learning method, migrating all layers of the edge model except the output layer.

[0169] (3) Training parameters

[0170] In this experiment, the global aggregation round number T is set to 20. When training the local model, the learning rate η of the stochastic gradient descent algorithm SGD is set to 0.01, the default number of iteration rounds and batch size are 4 and 16, and the batch size range is The resolution and number of channels of all images in all training data are unified as 640×640 and 3 respectively. When constructing the collaborative domain, the number of data samples sampled by the edge server is 10.

[0171] Experimental results:

[0172] (1) First, we compare the difference in loss function value and recognition accuracy between the learning method RFTL-EC provided by the federated transfer learning system in this technical solution and other benchmark solutions. Here, we set the communication window size to 180s. The batch size and number of iterations of RFTL-EC will be adaptively adjusted, while these parameters of other solutions are set to default values. Figure 6 It can be seen that RFTL-EC is significantly better than the FTL solution with a fixed number of migration layers and the typical federated learning algorithm FedAvg in terms of model convergence speed. Moreover, compared with the FedProx algorithm for heterogeneous environments, it can further accelerate the convergence of the model. Figure 7 It can be seen that after 20 rounds of global aggregation, the average precision (mAP_0.5:0.95) of RFTL-EC can reach 0.43, which is 38% and 16% higher than FedAvg and FedProx respectively. At the fifth round of global aggregation, the progress of RFTL-EC is close to that of the FedAvg algorithm trained for 20 rounds. In addition, we Figure 7 It can also be seen that the average precision of the models using the FedAvg and FedProx algorithms decreases after several rounds of global aggregation. This is primarily because, in these algorithms, terminals may be unable to participate in training due to timeouts or memory overflows, resulting in significant fluctuations in model training performance. It is important to note that because the FTL algorithm only trains the model's output layer, the model converges very slowly, with the average precision remaining at only 0.16 after many rounds of training. This demonstrates that federated migration algorithms must be optimized for real-world scenarios before they can be used.

[0173] (2) Secondly, we evaluate the impact of constructing edge collaboration domains on the quality of the final trained model under non-IID data distribution. Here, we add edge collaboration domain structures to the FedAvg and FedProx algorithms, respectively, and obtain two artificially modified algorithms FedAvg-EC and FedProx-EC. Figure 8 It can be seen that in the case of the same edge cooperation domain, the average precision of RFTL-EC is still 25% and 14% higher than that of FedAvg-EC and FedProx-EC algorithms respectively. Figure 8 It can also be seen that the addition of the edge collaboration domain structure improves the average accuracy of the FedAvg algorithm by 9%. This is because the edge collaboration domain strengthens the collaboration between edge servers, thereby accelerating the convergence of the model. In addition, the proposed method of constructing collaboration domains based on data similarity can further alleviate the degree of inconsistent data distribution.

[0174] (3) Finally, we compared the impact of resource awareness on the overall efficiency of the federated learning system under different communication windows, including the average number of terminal failures, average latency, and average memory consumption. To more clearly illustrate the role of dynamic transfer learning, we added an algorithm, FTL-Backbone, as a control. In this algorithm, the terminal only trains the backbone layer of the local model, which consumes more resources than the general FTL. Figure 9We compared the average number of terminal failures across several schemes under different communication window sizes. We see that as the communication window increases, the number of failures decreases for all schemes. However, when the communication window is small, RFTL-EC experiences significantly fewer terminal failures than all other schemes. This is because when the communication window is small, RFTL-EC avoids timeouts and memory overflows by increasing the number of migration layers and reducing the number of local iterations. Because the FedAvg algorithm doesn't use transfer learning and has fixed training parameters, the average number of terminal failures is close to 19 when the communication window is 120 seconds. This means that almost all terminals are unable to successfully complete local model training and upload within the timeout period. Figure 10 and Figure 11 The average latency and average memory resource consumption of several schemes were compared. It can be seen that RFTL-EC's latency and memory resource consumption increase with the increase of the communication window. When the communication window is 120 seconds, RFTL-EC's latency and memory resource consumption are lower than all other schemes, and when the communication window is 270 seconds, both metrics exceed those of the FedAvg algorithm. This is because when the communication window is ample, RFTL-EC improves the quality of the global model by increasing the amount of local training on the terminal within resource constraints. Although the FTL algorithm also effectively reduces average latency and average memory consumption, a comparison with RFTL-EC and FTL-Backbone shows that it fails to fully utilize the terminal's communication and computing resources. This is primarily because FTL only trains the output layer of the global model under all resource conditions and latency requirements, resulting in a waste of resources and communication windows.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A federated transfer learning system, characterized in that: include: A cloud server, an edge component, and a user component, wherein the edge component includes multiple edge servers, and the user component includes multiple user terminals; The cloud server is used to divide the plurality of edge servers into a plurality of edge cooperation domains based on the characteristic information sent by each edge server, and determine a domain head server and a domain member server among the plurality of edge servers in each edge cooperation domain; The edge server is used to select a target user terminal based on the joining request of the user terminal and send the parameters and training information of the global model to the selected target user terminal, and is also used to obtain the training parameters sent by the corresponding target user terminal and perform edge aggregation to obtain an edge model; The domain head server is used to globally aggregate all the edge models in the same edge cooperation domain to obtain a domain model, and the domain head server is further used to send the domain model to the cloud server when the accuracy of the domain model reaches a preset threshold; The target user terminal is used to train a local model based on the parameters of the global model and the training information sent by the corresponding edge server and based on the local data sample to obtain the training parameters.

2. The federated transfer learning system according to claim 1, characterized in that The cloud server is further configured to perform pre-training based on the public image data on each of the edge servers to obtain the initial global model, and send the initial global model to each of the edge servers.

3. The federated transfer learning system according to claim 2, wherein: Each edge server is further configured to generate initial feature information based on the initial global model and send the initial feature information to the cloud server.

4. The federated transfer learning system according to claim 1, wherein: The edge server is specifically used for: Sending the parameters of the global model and the training information to the corresponding target user terminal; Obtaining the training parameters sent by the corresponding target user terminal; Edge aggregating the training parameters of each target user terminal to obtain an initial edge model; Using the initial edge model as the global model of a new round, and sending its parameters to the reselected target user terminal; After repeating the above steps for a preset number of rounds, the edge model is obtained.

5. The federated transfer learning system according to claim 4, characterized in that: When the edge server is used to edge aggregate the training parameters of each target user terminal to obtain an initial edge model, the method specifically includes: Aligning all the training parameters according to the layer number; Based on the newness or oldness of each of the training parameters, edge aggregation is performed on each of the training parameters to obtain the initial edge model.

6. The federated transfer learning system according to any one of claims 1 to 5, characterized in that: The domain head server is also used for: When the accuracy of the domain model does not reach a preset threshold, the domain model is sent as the global model of a new round to the domain member servers in the same edge cooperation domain.

7. The federated transfer learning system according to claim 6, characterized in that After obtaining the domain model of a preset round, the domain head server and the domain member server are further configured to: Based on the domain model of a preset round, a new round of feature information is generated and sent to the cloud server.

8. The federated transfer learning system according to claim 7, characterized in that: After obtaining the domain model of a preset round, the domain head server and the domain member server are respectively specifically configured to: Randomly sampling from the public image data to obtain a preset number of data samples; Compressing the feature space of the data sample using the domain model of a preset round as a feature extractor; Calculating a fingerprint vector of the compressed data sample using a perceptual hash algorithm; The fingerprint vectors of the data samples are stacked to obtain the feature information.

9. The federated transfer learning system according to claim 1, wherein: The cloud server is specifically used for: Calculating the similarity between any two edge servers based on the feature information sent by each edge server; Constructing a similarity graph based on the similarity between any two edge servers; According to the similarity graph, dividing the plurality of edge servers into a plurality of edge collaboration domains based on a spectral clustering algorithm; The domain head server and the domain member servers are determined according to resource conditions of each edge server in each edge cooperation domain.

10. The federated transfer learning system according to claim 1, wherein: The target user terminal is specifically used for: Determine a migration layer and a training layer in a local model according to the parameters of the global model and the training information sent by the corresponding edge server; Migrating the parameters of the model layer corresponding to the migration layer in the global model to the migration layer of the local model; Train parameters of the training layer in the local model to obtain training parameters.