Network parameter transmission method and device
By dynamically adjusting the bit transmission power and optimal transmission code rate, the problem of traditional parameter transmission priority in federated learning being unable to adapt to changes is solved, and the convergence performance and training efficiency of the model are improved.
Patent Information
- Application Number
- CN202410799208.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-10
AI Technical Summary
In federated learning, the traditional parameter transmission priority is determined based on bit position and dynamic range, which cannot adapt to changes in the training phase, resulting in improper resource allocation and thus limiting convergence performance.
By obtaining the network parameters to be transmitted, converting and splitting them into multiple groups of bits, allocating power according to the bit error probability and importance, inputting it into the updated deep network model to obtain the optimal transmission bit rate, and performing channel coding , dynamically adjust the transmission power and code rate.
Reasonable allocation of resources improves the convergence performance of federated learning, and improves model training efficiency and accuracy by allocating more transmission power and optimal transmission bit rates to high-priority key bits.
Smart Images

Figure CN118631394A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method and device for transmitting network parameters. Background Art
[0002] In federated learning (FL), parameter transfer refers to the process of exchanging model parameters between clients (e.g., edge devices) and central servers.
[0003] At present, the transmission priority of parameters is generally divided according to the bit position and the dynamic range of parameters, and then the parameters are transmitted according to the transmission priority. However, the importance of some parameters may change with different training stages. If the transmission priority is determined based on the initial bit position and the dynamic range of parameters, it may not be able to adapt to subsequent changes, resulting in improper resource allocation, which in turn leads to limited convergence performance.
[0004] Therefore, how to improve the convergence performance in federated learning has become an urgent problem to be solved in this field. Summary of the invention
[0005] The present application provides a method and device for transmitting network parameters, aiming to improve convergence performance in federated learning.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] A method for transmitting network parameters, comprising:
[0008] Obtain the network parameters to be transmitted;
[0009] Converting and splitting the network parameters to be transmitted to obtain multiple groups of bits;
[0010] For each group of the bits, power allocation is performed on the bits to obtain transmission power of the bits;
[0011] Inputting the bits into an updated deep network model to obtain an optimal transmission bit rate; the updated deep network model is obtained by updating the deep network model according to the Markov decision model;
[0012] Channel coding the bits according to the transmission power of the bits and the optimal transmission code rate to obtain coded bits;
[0013] The encoded bits are transmitted to a server, so that the server converts the encoded bits into the network parameters to be transmitted.
[0014] Optionally, converting and splitting the network parameter to be transmitted to obtain multiple groups of bits includes:
[0015] Using a quantization function to perform random quantization processing on the network parameters to be transmitted to obtain random variables;
[0016] Changing the quantization interval of the random variable to a preset quantization interval;
[0017] When the quantization interval of the random variable is changed, the random variable is converted to obtain a bit vector;
[0018] generating a bit matrix based on the bit vector;
[0019] The bit matrix is split to obtain multiple groups of bits.
[0020] Optionally, performing power allocation on the bits for each group of the bits to obtain the transmission power of the bits includes:
[0021] For each group of bits, the preset transmission power is transferred to the current bit to obtain the transmission power and bit error probability of the current bit; wherein each group of bits includes the current bit;
[0022] When the bit error probability is less than a preset bit error probability, the transmission power of the current bit is transferred to the next bit to obtain the transmission power and bit error probability of the next bit; wherein the next bit indicates a next group of bits of the current bit;
[0023] Determining whether the bit error probability is less than a preset bit error probability;
[0024] If the bit error probability is less than the preset bit error probability, the transmission power of the next bit is used as the transmission power of the current bit, and the step of transferring the transmission power of the current bit to the next bit to obtain the transmission power and bit error probability of the next bit is returned to be executed until the bit error probability is not less than the preset bit error probability;
[0025] If the bit error probability is not less than the preset bit error probability, the transmission power of the next bit is transferred to the current bit, and the bit corresponding to the bit error probability is identified as a target bit; the target bit indicates a bit to which power is not allocated;
[0026] Performing power allocation on the target bit by minimizing the difference value to obtain the transmission power of the target bit;
[0027] The transmission power of the bit is determined according to the transmission power of the current bit, the transmission power of the next bit and the transmission power of the target bit.
[0028] Optionally, performing power allocation on the target bit by minimizing the difference value to obtain the transmission power of the target bit includes:
[0029] Acquire the transmission power of the previous bit of the target bit; the previous bit indicates the bit to which power has been allocated;
[0030] The transmission power of the previous bit is gradually transferred to the target bit to obtain multiple power combinations; the power combination includes the transmission power of the previous bit after the transfer and the transmission power of the target bit;
[0031] For each power combination, determining a plurality of minimized difference values according to the transmission power of the last bit after the transfer and the transmission power of the target bit;
[0032] Screening out a minimum minimized difference value from the multiple minimized difference values, and determining the transmission power of the target bit from the power combination corresponding to the minimum minimized difference value;
[0033] The next target bit of the target bit is used as the target bit, and the step of obtaining the transmission power of the previous bit of the target bit is returned to be executed until the power allocation of all the target bits is completed.
[0034] Optionally, the process of updating the deep network model according to the Markov decision model includes:
[0035] Define state space, action space, state transition probability and reward function;
[0036] Normalizing the reward function to obtain a normalized reward function;
[0037] Constructing a Markov decision model according to the state space, the action space, the state transition probability and the normalized reward function;
[0038] Collecting trajectory samples of the Markov decision model;
[0039] The model parameters of the deep network model are updated using the trajectory samples and a preset stochastic gradient descent algorithm to obtain an updated deep network model.
[0040] A network parameter transmission device, comprising:
[0041] An acquisition unit, used for acquiring network parameters to be transmitted;
[0042] A splitting unit, used for converting and splitting the network parameters to be transmitted to obtain multiple groups of bits;
[0043] an allocating unit, configured to perform power allocation on the bits for each group of the bits to obtain a transmission power of the bits;
[0044] An input unit, used for inputting the bits into an updated deep network model to obtain an optimal transmission bit rate; the updated deep network model is obtained by updating the deep network model according to the Markov decision model;
[0045] A coding unit, configured to perform channel coding on bits according to the transmission power of the bits and the optimal transmission code rate to obtain coded bits;
[0046] The transmission unit is used to transmit the encoded bits to the server, so that the server converts the encoded bits into the network parameters to be transmitted.
[0047] Optionally, the splitting unit is specifically used for:
[0048] Using a quantization function to perform random quantization processing on the network parameters to be transmitted to obtain random variables;
[0049] Changing the quantization interval of the random variable to a preset quantization interval;
[0050] When the quantization interval of the random variable is changed, the random variable is converted to obtain a bit vector;
[0051] generating a bit matrix based on the bit vector;
[0052] The bit matrix is split to obtain multiple groups of bits.
[0053] Optionally, the allocation unit is specifically used for:
[0054] For each group of bits, the preset transmission power is transferred to the current bit to obtain the transmission power and bit error probability of the current bit; wherein each group of bits includes the current bit;
[0055] When the bit error probability is less than a preset bit error probability, the transmission power of the current bit is transferred to the next bit to obtain the transmission power and bit error probability of the next bit; wherein the next bit indicates a next group of bits of the current bit;
[0056] Determining whether the bit error probability is less than a preset bit error probability;
[0057] If the bit error probability is less than the preset bit error probability, the transmission power of the next bit is used as the transmission power of the current bit, and the step of transferring the transmission power of the current bit to the next bit to obtain the transmission power and bit error probability of the next bit is returned to be executed until the bit error probability is not less than the preset bit error probability;
[0058] If the bit error probability is not less than the preset bit error probability, the transmission power of the next bit is transferred to the current bit, and the bit corresponding to the bit error probability is identified as a target bit; the target bit indicates a bit to which power is not allocated;
[0059] Performing power allocation on the target bit by minimizing the difference value to obtain the transmission power of the target bit;
[0060] The transmission power of the bit is determined according to the transmission power of the current bit, the transmission power of the next bit and the transmission power of the target bit.
[0061] Optionally, the allocation unit is specifically used for:
[0062] Acquire the transmission power of the previous bit of the target bit; the previous bit indicates the bit to which power has been allocated;
[0063] The transmission power of the previous bit is gradually transferred to the target bit to obtain multiple power combinations; the power combination includes the transmission power of the previous bit after the transfer and the transmission power of the target bit;
[0064] For each power combination, determining a plurality of minimized difference values according to the transmission power of the last bit after the transfer and the transmission power of the target bit;
[0065] Screening out a minimum minimized difference value from the multiple minimized difference values, and determining the transmission power of the target bit from the power combination corresponding to the minimum minimized difference value;
[0066] The next target bit of the target bit is used as the target bit, and the step of obtaining the transmission power of the previous bit of the target bit is returned to be executed until the power allocation of all the target bits is completed.
[0067] Optionally, the input unit is specifically used for:
[0068] Define state space, action space, state transition probability and reward function;
[0069] Normalizing the reward function to obtain a normalized reward function;
[0070] Constructing a Markov decision model according to the state space, the action space, the state transition probability and the normalized reward function;
[0071] Collecting trajectory samples of the Markov decision model;
[0072] The model parameters of the deep network model are updated using the trajectory samples and a preset stochastic gradient descent algorithm to obtain an updated deep network model.
[0073] The technical solution provided by the present application obtains the network parameters to be transmitted; converts and splits the network parameters to be transmitted to obtain multiple groups of bits; for each group of bits, the bits are power-allocated to obtain the transmission power of the bits; the bits are input into the updated deep network model to obtain the optimal transmission code rate; the bits are channel-encoded according to the transmission power and the optimal transmission code rate of the bits to obtain the encoded bits; the encoded bits are transmitted to the server so that the server converts the encoded bits into the network parameters to be transmitted. By allocating different transmission powers and optimal transmission code rates to different bits, more transmission power and optimal transmission code rates are allocated to high-priority key bits, resources are reasonably allocated, and convergence performance is improved in federated learning. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0075] Figure 1 A flowchart of a method for transmitting network parameters provided in an embodiment of the present application;
[0076] Figure 2 A flowchart of a method for converting network parameters to be transmitted provided in an embodiment of the present application;
[0077] Figure 3 A flow chart of a power allocation method provided in an embodiment of the present application;
[0078] Figure 4 A flowchart of another power allocation method provided in an embodiment of the present application;
[0079] Figure 5 A schematic diagram of bit power allocation provided in an embodiment of the present application;
[0080] Figure 6 A flowchart of a method for updating a deep network model provided in an embodiment of the present application;
[0081] Figure 7 A schematic diagram of a BER curve provided in an embodiment of the present application;
[0082] Figure 8 A schematic diagram of a training effect provided in an embodiment of the present application;
[0083] Fig. 9 A schematic diagram of a fluctuation trend provided in an embodiment of the present application;
[0084] Fig.10 A schematic diagram of another training effect provided in an embodiment of the present application;
[0085] Fig.11 A schematic diagram of a code rate scheduling provided in an embodiment of the present application;
[0086] Fig.12 A schematic diagram of the architecture of a network parameter transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0087] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0088] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0089] like Figure 1 As shown, it is a flowchart of a method for transmitting network parameters provided in an embodiment of the present application, which is applied to a client and includes the following steps:
[0090] S101: Obtain network parameters to be transmitted.
[0091] The parameters to be transmitted indicate trainable parameters in the model, including but not limited to: weights and biases.
[0092] S102: Convert and split the network parameters to be transmitted to obtain multiple groups of bits.
[0093] It can be understood that the network parameters to be transmitted are converted and split. Specifically, the network parameters to be transmitted are first converted to obtain a bit matrix; and then the bit matrix is split to obtain multiple groups of bits.
[0094] Optionally, in another embodiment of the present application, the specific implementation of step S102 is as follows: Figure 2 As shown, the following steps are included:
[0095] S201: Perform random quantization processing on the parameters of the transmission network using a quantization function to obtain a random variable.
[0096] The specific expression of the quantization function is shown in formula (1).
[0097]
[0098] In formula (1), δ m is the network parameter to be transmitted, δ m ∈R d , R d is a d-dimensional Euclidean space, q i (δ m ,s) is a random variable, is a quantization function, through which [1, -1] can be evenly divided into 2s quantization intervals, and the value range of s is a positive integer.
[0099] It should be noted that any trainable parameter of a model can be converted into a tuple ||δ m ||2·q i (δ m ,s), due to ||δ m The communication overhead of ||2 (i.e., the resources consumed when transmitting the trainable parameters of the model) is independent of the dimension of the model, so the trainable parameters of the model can be transmitted losslessly.
[0100] S202: Changing the quantization interval of the random variable to a preset quantization interval.
[0101] The preset quantization interval includes but is not limited to: [1 / s, (1+1) / s]. Here, 1 is used to represent the boundary of the quantization interval, and the value range is an integer.
[0102] It can be understood that l∈Z represents the corresponding quantization interval [l / s, (l+1) / s], so that Then the quantization interval of the random variable is changed to a specific expression of the preset quantization interval, as shown in formula (2).
[0103]
[0104] In formula (2), p(a,s)=as-l, a is
[0105] S203: After the quantization interval of the random variable is changed, the random variable is converted to obtain a bit vector.
[0106] Among them, q i (δ m ,s) is set to s=2 s(b) , then we can use the bit vector To express q i (δ m ,s). Specifically, the specific form of transforming the random variable is shown in formula (3).
[0107]
[0108] In formula (3), bj is the bit vector The jth bit of .
[0109] S204: Generate a bit matrix based on the bit vector.
[0110] It can be understood that the bit matrix is generated based on the bit vector. Specifically, each bit vector is connected in the column direction to obtain the bit matrix Bm. The bit matrix represents q i (δ m ,s).
[0111] S205: Split the bit matrix to obtain multiple groups of bits.
[0112] It should be noted that the bit matrix is split, specifically, the bit matrix is split along the row direction to obtain multiple groups of bits, wherein a row of bit vectors represents a group of bits.
[0113] It can be understood that since the bits are split into multiple groups, the importance of each group of bits is different, and the bit power and transmission code rate are adjusted according to the importance. When each group of bits is subsequently transmitted, the bits are transmitted according to the adjusted bit power and transmission code rate.
[0114] S103: For each group of bits, power is allocated to the bits to obtain transmission power of the bits.
[0115] For each group of bits, power allocation is performed on the bits. Specifically, power allocation is performed on the bits according to the transmission error probability. If there are unallocated bits, power allocation is continued to be performed on the bits by minimizing the difference value until power allocation of all bits is completed.
[0116] It is understandable that different bits may be allocated different powers. When the total power budget is constant, more transmission power is allocated to high-priority key bits to reduce the bit error rate of these key bits.
[0117] Optionally, in another embodiment of the present application, the specific implementation of step S103 is as follows: Figure 3 As shown, the following steps are included:
[0118] S301: For each group of bits, transfer the preset transmission power to the current bit to obtain the transmission power and bit error probability of the current bit.
[0119] Each group of bits includes the current bit.
[0120] Optionally, the preset transmission power includes but is not limited to: the power of the sign bit.
[0121] The so-called bit transmission power is actually the energy used to represent each bit transmission in the digital communication system.
[0122] The so-called bit error probability is actually the probability that the receiving end incorrectly judges the bit during the transmission process.
[0123] It can be understood that before power allocation, since all power is concentrated on the preset sign bit, it is necessary to allocate power to the bits through the preset transmission power. Therefore, for each group of bits, the preset transmission power is transferred to the current bit to obtain the transmission power and bit error probability of the current bit.
[0124] S302: When the bit error probability is less than a preset bit error probability, the transmission power of the current bit is transferred to the next bit to obtain the transmission power and bit error probability of the next bit.
[0125] The next bit indicates the next group of bits of the current bit.
[0126] Optionally, the preset bit error probability includes but is not limited to: 10 -5 .
[0127] It can be understood that the preset transmission power is transferred to the current bit, and when the bit error probability is less than the preset bit error probability, the transmission power of the current bit is transferred to the next bit.
[0128] S303: Determine whether the bit error probability is less than a preset bit error probability.
[0129] If the bit error probability is less than the preset bit error probability, step S304 is executed; if the bit error probability is not less than the preset bit error probability, step S305 is executed.
[0130] It can be understood that if the bit error probability is less than the preset bit error probability, it means that the transmission power allocation for the next bit is completed. If the bit error probability is not less than the preset bit error probability, it means that the transmission power allocated to the next bit does not meet the requirements at this time. Therefore, the transmission power allocated to the next bit is transferred to the current bit.
[0131] S304: Using the transmission power of the next bit as the transmission power of the current bit.
[0132] The transmission power of the next bit is used as the transmission power of the current bit, and the process returns to step S302 until the bit error probability is not less than the preset bit error probability.
[0133] Specifically, assuming that there are three bits, namely the first bit, the second bit and the third bit, the preset transmission power is transferred to the first bit to obtain the transmission power and the bit error probability of the first bit. When the bit error probability of the first bit is less than the preset error probability, the transmission power of the first bit is transferred to the second bit to obtain the transmission power and the bit error probability of the second bit. When the bit error probability of the second bit is less than the preset error rate, the transmission power of the second bit is transferred to the third bit to obtain the transmission power and the bit error probability of the third bit. If the bit error probability of the third bit is not less than the preset error probability, the transmission power of the third bit is transferred to the second bit.
[0134] S305: Transfer the transmission power of the next bit to the current bit, and mark the bit corresponding to the bit error probability as the target bit.
[0135] The target bit is a bit to which power is not allocated.
[0136] It can be understood that transferring the transmission power of the next bit to the current bit means reversing the power allocation process so that the transmission power of the current bit is the power before allocating power to the next bit.
[0137] S306: Perform power allocation on the target bit by minimizing the difference value to obtain the transmission power of the target bit.
[0138] The target bit is power-allocated by minimizing the difference value, that is, the target bit is power-allocated in accordance with the standard of minimizing the difference data in the power allocation process to obtain the transmission power of the target bit.
[0139] Optionally, the specific form of minimizing the difference value is as shown in formula (4).
[0140]
[0141] In formula (4), α tTo minimize the difference data (i.e., the upper limit of the difference between the model before and after lossy transmission), To obtain and The minimum value in , d is the length of the network parameter vector, The bit error probability of the j-th bit under given coding parameters during the t-th round of upload.
[0142] Optionally, in another embodiment of the present application, the specific implementation of step S306 is as follows: Figure 4 As shown, the following steps are included:
[0143] S401: Obtain the transmission power of the previous bit of the target bit.
[0144] The previous bit indicates the bit to which power has been allocated.
[0145] It can be understood that obtaining the transmission power of the previous bit of the target bit means obtaining the power of the previous bit that is not transferred to the target power, so that power can be subsequently allocated to the target bit according to the transmission power of the previous bit.
[0146] S402: gradually transferring the transmission power of the previous bit to the target bit to obtain multiple power combinations.
[0147] The power combination includes the transmission power of the previous bit after the transfer and the transmission power of the target bit.
[0148] Specifically, assuming that the transmission power of the previous bit is 3, the transmission power of the previous bit is gradually transferred to the target bit, that is, the first power combination is that the transmission power of the previous bit after the transfer is 2, and the transmission power of the target bit is 1, the second power combination is that the transmission power of the previous bit after the transfer is 1, and the transmission power of the target bit is 2, and the third power combination is that the transmission power of the previous bit after the transfer is 3, and the transmission power of the target bit is 0.
[0149] S403: For each power combination, determine a plurality of minimized difference values according to the transmission power of the last bit after the transfer and the transmission power of the target bit.
[0150] It is understandable that different power combinations correspond to different minimized difference values, and therefore, it is necessary to calculate the minimized difference value of each power combination in order to subsequently determine the transmission power of the target bit.
[0151] S404: Filter out a minimum minimum difference value from the multiple minimum difference values, and determine the transmission power of the target bit from the power combination corresponding to the minimum minimum difference value.
[0152] It should be noted that different power combinations correspond to different minimized difference values. The minimum minimized difference value is screened out from multiple minimized difference values, and then the transmission power of the target bit is determined from the power combination corresponding to the minimum minimized difference value. In other words, the transmission power of the target bit in the power combination corresponding to the minimum minimized difference value is determined as the transmission power of the target bit.
[0153] S405: Taking the next target bit of the target bit as the target bit.
[0154] The next target bit of the target bit is used as the target bit, and the process returns to step S405 until the power allocation of all target bits is completed.
[0155] Optionally, the next target bit of the target bit is used as the target bit, and the process returns to step S405 until the remaining power overhead (which refers to the additional power consumed during system operation in addition to the power required to implement the main functions) is 0, thereby obtaining the transmission power of all target bits.
[0156] Specifically, assuming that there are two target bits, namely the first target bit and the second target bit, the transmission power of the previous bit is gradually transferred to the first target bit to obtain multiple power combinations, and the transmission power of the first target bit is determined based on the multiple power combinations (i.e., the process from step S403 to step S404); the transmission power of the first target bit is obtained, and the transmission power of the first target bit is gradually transferred to the second target bit to obtain multiple power combinations, and the transmission power of the first target bit is determined based on the multiple power combinations.
[0157] S307: Determine the bit power of each group of bits according to the bit power of the current bit, the bit power of the next bit and the bit power of the target bit.
[0158] It can be understood that the bit power of each group of bits is determined based on the bit power of the current bit, the bit power of the next bit and the bit power of the target bit, that is, the transmission power of all bits can be obtained by combining the bit power of the current bit, the bit power of the next bit and the bit power of the target bit.
[0159] Combination Figure 3 and Figure 4 For the content shown, see Figure 5 FIG. 1 is a schematic diagram of a bit power allocation. In the first stage, the current bit is allocated by the preset transmission power to obtain the transmission power and bit error probability of the current bit. When the bit error probability is less than the preset error probability 10 -5When the transmission power of the current bit is transferred to the next bit, the transmission power and bit error probability of the next bit are obtained. When the bit error probability of the next bit is not less than the preset bit error rate, the transmission power of the next bit is transferred to the current bit. In the second stage, the transmission power of the previous bit is gradually transferred to the target bit to obtain multiple power combinations; the minimum difference value α is determined by multiple power combinations t is 1.46.
[0160] S104: Input the bits into the updated deep network model to obtain the optimal transmission bit rate.
[0161] Among them, the updated deep network model is obtained by updating the deep network model according to the Markov decision model.
[0162] It can be understood that for each group of bits, the bits are input into the updated deep network model to obtain the optimal transmission bit rate for each group of bits. The optimal transmission bit rate for each group of bits is different, and decisions need to be made based on the importance of the bits.
[0163] Optionally, a specific implementation method for updating the deep network model according to the Markov decision model is as follows: Figure 6 As shown, the following steps are included:
[0164] S601: Define state space, action space, state transition probability and reward function.
[0165] The state space includes: the current gradient divergence (i.e., the degree of change of the model update on different devices), the gradient divergence change compared with the previous time, and the use of the transmission delay overhead. Specifically, the specific form of the state space is as shown in formula (5).
[0166]
[0167] In formula (5), S t is the state space, G t is the gradient divergence, and the approximate expression of the gradient divergence is: Represents G t , ρ is a hyperparameter describing the preference for low bitrate, ε R The delay constraint that needs to be met during transmission
[0168] It should be noted that the current gradient divergence is the normalized gradient divergence, which is used to improve the versatility of the trained deep network model.
[0169] Among them, the action space is: The action of the deep network model is to select the coding rate from a finite set, that is, A t= {R1, R2, ..., R nR}, R nR is the number of optional coding rates for the selected channel code, and At is the action space.
[0170] Optionally, the derived upper bound of the convergence rate of federated learning is used as the objective function to be minimized, and the reward function is the negative value of the objective function plus the penalty term when the transmission delay constraint is violated. The specific expression of the reward function is shown in formula (6).
[0171]
[0172] In formula (6), is the indicator function, which takes 1 when the inequality holds and takes 0 when the inequality does not hold. β is the penalty term value used to balance delay overhead and performance to prevent the agent from aggressively using low-rate transmission in order to obtain greater rewards. σ is the upper limit of the stochastic gradient variance, and L is a constant.
[0173] Among them, the specific form of state transition probability is P(S t+1 |S t ,A t ), P(S t+1 |S t ,A t ) is S t and select A t Time t+1 The probability distribution of is determined only by the federated learning process.
[0174] S602: Normalize the reward function to obtain a normalized reward function.
[0175] In order to enhance the stability of the deep network model training process, the reward function needs to be normalized. Specifically, the specific form of normalizing the reward function is shown in formula (7).
[0176]
[0177]
[0178] In formula (7) and formula (8), a sca l er corresponds to an average bit rate of T / ε R Time α t The value of U scaler is the normalized reward coefficient.
[0179] S603: Construct a Markov decision model according to the state space, action space, state transition probability and normalized reward function.
[0180] It can be understood that a Markov decision model is constructed according to the state space, action space, state transition probability and normalized reward function, so that the deep network model can be subsequently updated according to the Markov decision model.
[0181] S604: Collect trajectory samples of the Markov decision model.
[0182] Among them, trajectory samples are data generated during the interaction between the Markov decision model and the environment.
[0183] S605: Update the model parameters of the deep network model using the trajectory sample and a preset stochastic gradient descent algorithm to obtain an updated deep network model.
[0184] The specific expression of the preset stochastic gradient descent algorithm is shown in formula (9).
[0185]
[0186] In formula (9), θ is the parameter of the deep network model, γ is the reward discount factor, η is the learning rate when training the deep network model, Q(S t ,A t θ t ) is the deep network model parameter θ t When the estimated S t ,A t The corresponding Q value.
[0187] It should be noted that after collecting the sample trajectory of the Markov decision process, the model parameters of the deep network model are updated through the stochastic gradient descent algorithm to maximize the cumulative future reward. The cumulative future reward is:
[0188] S105: Channel-encode the bits according to the bit power and the optimal transmission code rate to obtain encoded bits.
[0189] Among them, channel coding is performed on bits according to bit power and optimal transmission bit rate. Specifically, the coding rate is selected according to the usage of gradient divergence and delay overhead in the updated deep network model; the bits are channel coded according to the coding rate, bit power and optimal transmission bit rate to obtain coded bits.
[0190] S106: Transmit the encoded bits to the server, so that the server converts the encoded bits into network parameters to be transmitted.
[0191] It is understandable that when the server receives the encoded bits, it decodes the encoded bits to obtain the decoded bits Substituting the decoded bits into Get the random variable; substitute the random variable into Get the network parameters to be transmitted.
[0192] It should be noted that the server converts the encoded bits into network parameters to be transmitted until the federated learning is completed or the delay constraint is violated.
[0193] In summary, by allocating different transmission powers and optimal transmission code rates to different bits, more transmission power and optimal transmission code rates are allocated to high-priority key bits, which reasonably allocates resources and thus improves the convergence performance in federated learning.
[0194] To verify Figure 1 To show the performance of the content, in some specific embodiments, an experimental scenario is provided, and a simulation experiment is performed using python. The simulation experiment evaluates the performance of the proposed allocation scheme by performing image classification tasks on the heterogeneous FMNIST dataset and the CIFAR-10 dataset, and compares it with the simulation experiment of the existing benchmark. The comparison process is shown in A1 to A7.
[0195] A1: For the heterogeneous FMNIST dataset, the data samples are sorted according to the labels and evenly divided into groups.
[0196] Each client randomly selects two groups as its local dataset to ensure that the client has samples from at most two categories.
[0197] A2: When constructing the heterogeneous CIFAR-10 dataset, the data is first classified into ten different categories based on the labels.
[0198] A3: Each client randomly selects eight categories and randomly samples 100 images from each selected category as training data.
[0199] Among them, other simulation parameters are summarized as follows. In terms of federated learning related parameters, the Lipschitz constant is set to 10, the upper limit of the random gradient variance is set to 1.5, the number of clients is set to 100, the number of clients activated per round is set to 12, the number of local training rounds is set to 5, the local batch size is set to 5, and the learning rate is set to 0.01. In terms of bitstream transmission related parameters, the delay overhead is, the data block size when transmitting CNN / MobileNet is 128 / 8192 respectively, the number of quantization bits is set to 4 bits / 16 bits respectively, and the power overhead is set to 6dB / 15dB respectively.
[0200] It should be noted that the noise power of all clients is kept equal during the simulation process, and the normalized power value is directly used to represent the signal-to-noise ratio. In terms of channel coding parameters, the channel coding is set to polar code, the decoder is continuous elimination decoding, the code length is 2048 bits, the modulation mode is binary phase shift keying, and the channel is additive white Gaussian noise. The BER curves of different code rates under this setting are as follows: Figure 7 shown.
[0201] Optionally, in the reinforcement learning related parameters, set the reward decay factor to 0.9, the learning rate to 0.01, the rate preference to 1, the penalty coefficient to 40, the memory capacity of the experience replay to 200, the greedy strategy probability to 0.9, and the number of training rounds to 200.
[0202] A4: Use the training data to train the deep network model to obtain a trained deep network model.
[0203] A5: Obtain fixed transmission parameters of the verification set, and transmit the verification set according to the fixed transmission parameters to obtain a first transmission result.
[0204] It should be noted that the fixed transmission parameters are: lossless bit transmission (denoted as Baseline): federated learning implemented using error-free bit transmission, sign bit transmission (denoted as SBT): transmission power is only allocated to the sign bit, and the channel coding rate is constant at 3 / 5, all bits are equally powered (denoted as EPT): transmission power is evenly distributed among all quantized bits, and the channel coding rate is constant at 3 / 5, and there is coding rate scheduling based on unequal error protection strategy (denoted as URS): we use the algorithm proposed in this application to allocate bit power. In terms of rate scheduling, the training rounds are divided into three equally spaced stages, and the rate is gradually reduced to 4 / 5, 3 / 5, and 2 / 5 in this experiment.
[0205] A6: Input the verification set into the trained deep network model to obtain the optimal transmission bit rate of the verification set, and transmit the verification set according to the optimal transmission bit rate and transmission power of the verification set to obtain a first transmission result.
[0206] A7: Compare the first transmission result and the second transmission result.
[0207] Among them, see Figure 8 A schematic diagram of a training effect is shown, which shows the effect of training a convolutional neural network (CNN) with 4-bit quantization on the FMNIST dataset. In shallow neural networks, the importance of the sign bit is more prominent than other bits. It can be seen that the method that imposes key protection on the sign bit shows better performance than the EPT method.
[0208] Optionally, due to the obvious heterogeneity of the data set, the gradient divergence cannot be stabilized during the training process and shows a trend of continuous fluctuation. The fluctuation trend is as follows Fig. 9 As shown in the figure, it can be seen that the DRS method with dynamic adjustment of coding rate is better than the URS and SBT methods with predefined coding rate scheduling intervals, and improves the recognition accuracy by 5.72% and 3.14% respectively.
[0209] It should be emphasized that in order to further verify the performance advantage of the embodiment of the present application when using a large number of bits and high power transmission quantized neural network, the effect of training a convolutional neural network (e.g., MobileNet) using 16-bit quantization on the CIFAR-10 dataset is also simulated. Fig.10 shown.
[0210] For deep neural networks, the impact of key bits on federated learning is more obvious. If the key bits are not specified correctly, for example, only the sign bit is protected, the federated learning training will fail. Therefore, the SBT method cannot stably train MobileNet, and the performance of the EPT method is significantly inferior to other methods, with the final recognition accuracy rate of only 49.05%.
[0211] For bitrate scheduling, see Fig.11 ,The figure shows that the DRS method proposed in this application initially uses a higher code rate to reduce communication delay, and as the gradient divergence increases, it will dynamically switch to a lower code rate to improve the model transmission accuracy, and strike a balance between transmission delay and federated learning performance. Since the scheduling results of the URS method are very similar to those of the DRS method, it also achieves performance close to lossless bit transmission, and the final recognition accuracy rate reaches about 61%.
[0212] In summary, through simulation comparison experiments, dynamic adjustment of bit transmission power and optimal transmission code rate are better than pre-defined code rate scheduling interval and equal power transmission. Dynamic adjustment of transmission parameters can better cope with channel changes, reduce packet loss, delay and error rate, and thus improve communication reliability.
[0213] like Fig.12 As shown, it is a schematic diagram of the architecture of a network parameter transmission device provided in an embodiment of the present application, and the transmission device includes: an acquisition unit 100, a splitting unit 200, an allocation unit 300, an input unit 400, an encoding unit 500 and a transmission unit 600.
[0214] The acquisition unit 100 is used to acquire network parameters to be transmitted.
[0215] The splitting unit 200 is used to convert and split the network parameters to be transmitted to obtain multiple groups of bits.
[0216] The splitting unit 200 is specifically used to: use a quantization function to randomly quantize the transmission network parameters to obtain a random variable; change the quantization interval of the random variable to a preset quantization interval; when the quantization interval of the random variable is changed, convert the random variable to obtain a bit vector; generate a bit matrix based on the bit vector; split the bit matrix to obtain multiple groups of bits.
[0217] The allocation unit 300 is used to allocate power to bits for each group of bits to obtain transmission power of the bits.
[0218] The allocation unit 300 is specifically used for: for each group of bits, transferring the preset transmission power to the current bit, and obtaining the transmission power and bit error probability of the current bit; wherein each group of bits includes the current bit; when the bit error probability is less than the preset error probability, transferring the transmission power of the current bit to the next bit, and obtaining the transmission power and bit error probability of the next bit; wherein the next bit indicates the next group of bits of the current bit; judging whether the bit error probability is less than the preset error probability; if the bit error probability is less than the preset error probability, using the transmission power of the next bit as the transmission power of the current bit, and returning to execute The transmission power of the current bit is transferred to the next bit to obtain the transmission power and bit error probability of the next bit until the bit error probability is not less than the preset bit error probability; if the bit error probability is not less than the preset bit error probability, the transmission power of the next bit is transferred to the current bit, and the bit corresponding to the bit error probability is identified as the target bit; the target bit indicates the bit to which power is not allocated; the power of the target bit is allocated by minimizing the difference value to obtain the transmission power of the target bit; the transmission power of the bit is determined according to the transmission power of the current bit, the transmission power of the next bit and the transmission power of the target bit.
[0219] The allocation unit 300 is specifically used to: obtain the transmission power of the previous bit of the target bit; the previous bit indicates the bit to which power has been allocated; the transmission power of the previous bit is gradually transferred to the target bit to obtain multiple groups of power combinations; the power combination includes the transmission power of the previous bit after the transfer and the transmission power of the target bit; for each group of power combinations, determine multiple minimized difference values based on the transmission power of the previous bit after the transfer and the transmission power of the target bit; filter out the minimum minimized difference value from the multiple minimized difference values, and determine the transmission power of the target bit from the power combination corresponding to the minimum minimized difference value; use the next target bit of the target bit as the target bit, and return to execute the step of obtaining the transmission power of the previous bit of the target bit until the power allocation of all target bits is completed.
[0220] The input unit 400 is used to input bits into the updated deep network model to obtain the optimal transmission bit rate; the updated deep network model is obtained by updating the deep network model according to the Markov decision model.
[0221] The input unit 400 is specifically used to: define the state space, action space, state transition probability and reward function; normalize the reward function to obtain a normalized reward function; construct a Markov decision model based on the state space, action space, state transition probability and normalized reward function; collect trajectory samples of the Markov decision model; use the trajectory samples and a preset stochastic gradient descent algorithm to update the model parameters of the deep network model to obtain an updated deep network model.
[0222] The encoding unit 500 is used to perform channel encoding on the bits according to the transmission power of the bits and the optimal transmission code rate to obtain encoded bits.
[0223] The transmission unit 600 is used to transmit the encoded bits to the server, so that the server converts the encoded bits into network parameters to be transmitted.
[0224] In summary, by allocating different transmission powers and optimal transmission code rates to different bits, more transmission power and optimal transmission code rates are allocated to high-priority key bits, which reasonably allocates resources and thus improves the convergence performance in federated learning.
[0225] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0226] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0227] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for transmitting network parameters, characterized in that: include: Obtain the network parameters to be transmitted; Converting and splitting the network parameters to be transmitted to obtain multiple groups of bits; For each group of the bits, power allocation is performed on the bits to obtain transmission power of the bits; Inputting the bits into an updated deep network model to obtain an optimal transmission bit rate; the updated deep network model is obtained by updating the deep network model according to the Markov decision model; Channel coding the bits according to the transmission power of the bits and the optimal transmission code rate to obtain coded bits; The encoded bits are transmitted to a server, so that the server converts the encoded bits into the network parameters to be transmitted.
2. The method according to claim 1, characterized in that The converting and splitting the network parameters to be transmitted to obtain multiple groups of bits includes: Using a quantization function to perform random quantization processing on the network parameters to be transmitted to obtain random variables; Changing the quantization interval of the random variable to a preset quantization interval; When the quantization interval of the random variable is changed, the random variable is converted to obtain a bit vector; generating a bit matrix based on the bit vector; The bit matrix is split to obtain multiple groups of bits.
3. The method according to claim 1, characterized in that The performing power allocation on the bits for each group of the bits to obtain the transmission power of the bits includes: For each group of bits, the preset transmission power is transferred to the current bit to obtain the transmission power and bit error probability of the current bit; wherein each group of bits includes the current bit; When the bit error probability is less than a preset bit error probability, the transmission power of the current bit is transferred to the next bit to obtain the transmission power and bit error probability of the next bit; wherein the next bit indicates a next group of bits of the current bit; Determining whether the bit error probability is less than a preset bit error probability; If the bit error probability is less than the preset bit error probability, the transmission power of the next bit is used as the transmission power of the current bit, and the step of transferring the transmission power of the current bit to the next bit to obtain the transmission power and bit error probability of the next bit is returned to be executed until the bit error probability is not less than the preset bit error probability; If the bit error probability is not less than the preset bit error probability, the transmission power of the next bit is transferred to the current bit, and the bit corresponding to the bit error probability is identified as a target bit; the target bit indicates a bit to which power is not allocated; Performing power allocation on the target bit by minimizing the difference value to obtain the transmission power of the target bit; The transmission power of the bit is determined according to the transmission power of the current bit, the transmission power of the next bit and the transmission power of the target bit.
4. The method according to claim 3, characterized in that The method of allocating power to the target bit by minimizing the difference value to obtain the transmission power of the target bit includes: Acquire the transmission power of the previous bit of the target bit; the previous bit indicates the bit to which power has been allocated; The transmission power of the previous bit is gradually transferred to the target bit to obtain multiple power combinations; the power combination includes the transmission power of the previous bit after the transfer and the transmission power of the target bit; For each power combination, determining a plurality of minimized difference values according to the transmission power of the last bit after the transfer and the transmission power of the target bit; Screening out a minimum minimized difference value from the multiple minimized difference values, and determining the transmission power of the target bit from the power combination corresponding to the minimum minimized difference value; The next target bit of the target bit is used as the target bit, and the step of obtaining the transmission power of the previous bit of the target bit is returned to be executed until the power allocation of all the target bits is completed.
5. The method according to claim 1, characterized in that The process of updating the deep network model according to the Markov decision model includes: Define state space, action space, state transition probability and reward function; Normalizing the reward function to obtain a normalized reward function; Constructing a Markov decision model according to the state space, the action space, the state transition probability and the normalized reward function; Collecting trajectory samples of the Markov decision model; The model parameters of the deep network model are updated using the trajectory samples and a preset stochastic gradient descent algorithm to obtain an updated deep network model.
6. A network parameter transmission device, characterized in that: include: An acquisition unit, used for acquiring network parameters to be transmitted; A splitting unit, used for converting and splitting the network parameters to be transmitted to obtain multiple groups of bits; an allocating unit, configured to perform power allocation on the bits for each group of the bits to obtain a transmission power of the bits; An input unit, used for inputting the bits into an updated deep network model to obtain an optimal transmission bit rate; the updated deep network model is obtained by updating the deep network model according to the Markov decision model; A coding unit, configured to perform channel coding on bits according to the transmission power of the bits and the optimal transmission code rate to obtain coded bits; The transmission unit is used to transmit the encoded bits to the server, so that the server converts the encoded bits into the network parameters to be transmitted.
7. The device according to claim 6, characterized in that The splitting unit is specifically used for: Using a quantization function to perform random quantization processing on the network parameters to be transmitted to obtain random variables; Changing the quantization interval of the random variable to a preset quantization interval; When the quantization interval of the random variable is changed, the random variable is converted to obtain a bit vector; generating a bit matrix based on the bit vector; The bit matrix is split to obtain multiple groups of bits.
8. The device according to claim 6, characterized in that The allocation unit is specifically used for: For each group of bits, the preset transmission power is transferred to the current bit to obtain the transmission power and bit error probability of the current bit; wherein each group of bits includes the current bit; For each group of bits, the preset transmission power is transferred to the current bit to obtain the transmission power and bit error probability of the current bit; wherein each group of bits includes the current bit; When the bit error probability is less than a preset bit error probability, the transmission power of the current bit is transferred to the next bit to obtain the transmission power and bit error probability of the next bit; wherein the next bit indicates a next group of bits of the current bit; Determining whether the bit error probability is less than a preset bit error probability; If the bit error probability is less than the preset bit error probability, the transmission power of the next bit is used as the transmission power of the current bit, and the step of transferring the transmission power of the current bit to the next bit to obtain the transmission power and bit error probability of the next bit is returned to be executed until the bit error probability is not less than the preset bit error probability; If the bit error probability is not less than the preset bit error probability, the transmission power of the next bit is transferred to the current bit, and the bit corresponding to the bit error probability is identified as a target bit; the target bit indicates a bit to which power is not allocated; Performing power allocation on the target bit by minimizing the difference value to obtain the transmission power of the target bit; The transmission power of the bit is determined according to the transmission power of the current bit, the transmission power of the next bit and the transmission power of the target bit.
9. The device according to claim 8, characterized in that The allocation unit is specifically used for: Acquire the transmission power of the previous bit of the target bit; the previous bit indicates the bit to which power has been allocated; The transmission power of the previous bit is gradually transferred to the target bit to obtain multiple power combinations; the power combination includes the transmission power of the previous bit after the transfer and the transmission power of the target bit; For each power combination, determining a plurality of minimized difference values according to the transmission power of the last bit after the transfer and the transmission power of the target bit; Screening out a minimum minimized difference value from the multiple minimized difference values, and determining the transmission power of the target bit from the power combination corresponding to the minimum minimized difference value; The next target bit of the target bit is used as the target bit, and the step of obtaining the transmission power of the previous bit of the target bit is returned to be executed until the power allocation of all the target bits is completed.
10. The device according to claim 6, characterized in that The input unit is specifically used for: Define state space, action space, state transition probability and reward function; Normalizing the reward function to obtain a normalized reward function; Constructing a Markov decision model according to the state space, the action space, the state transition probability and the normalized reward function; Collecting trajectory samples of the Markov decision model; The model parameters of the deep network model are updated using the trajectory samples and a preset stochastic gradient descent algorithm to obtain an updated deep network model.
