Federated learning convolutional neural network model aggregation method, device and storage medium

By constructing a system of overdetermined equations in federated learning and using random number matrices to calculate global model parameters, the problem of poor performance of existing federated learning methods in heterogeneous data sets is solved, and better model robustness is achieved. and privacy protection.

CN114707634BActive Publication Date: 2024-10-01DALIAN UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210225094.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-09
Publication Date
2024-10-01
Estimated Expiration
2042-03-09

AI Technical Summary

Technical Problem

Existing federated learning methods perform poorly when dealing with highly heterogeneous data sets. In particular, the FedAvg algorithm lacks robustness when aggregating model parameters and is difficult to effectively solve global model parameters.

Method used

A new federated learning convolutional neural network model aggregation method is adopted. By initializing the convolutional neural network model on the user side and constructing an overdetermined equation system on the central server, a random number matrix is ​​used for calculation and global model parameters are solved, avoiding the need for The transmission of original data enhances privacy protection and model stability.

Benefits of technology

When processing non-IID data, this method achieves better results than the FedAvg algorithm, improves the robustness and privacy protection of the model, simplifies algorithm implementation, and is suitable for data collaborative training in distributed networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114707634B_ABST
    Figure CN114707634B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and storage medium for aggregating a convolutional neural network model for federated learning. The method mainly includes: installing an initialized model on a user terminal; each user terminal uses a local database to perform distributed training on the model; encrypting each user model and uploading it to a central server for aggregation to construct an overdetermined set of equations; solving the overdetermined set of equations to obtain global model parameters; the central server transmits the global model parameters back to each user terminal, and each user terminal updates the parameters of its own model according to the global model parameters. In the process of convolutional neural network parameter aggregation by federated learning, the present invention calculates the convolution kernel parameters of the global model from each independent model by solving the overdetermined set of equations. Compared with traditional parameter calculation methods, the present invention can achieve better results when dealing with non-independent and identically distributed data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a method, device and storage medium for aggregating a federated learning convolutional neural network model. Background Art

[0002] As computing substrates such as phones, sensors, and wearables grow in power and popularity, learning statistical models locally in a network of distributed devices becomes increasingly attractive compared to moving data to data centers. This problem is called federated learning and requires addressing new challenges with privacy, heterogeneous data and devices, and large-scale distributed networks. Federated learning methods are designed to handle multiple devices collecting data and a central server coordinating a global learning goal for the entire network. To reduce communication, a common technique in federated optimization is to use a local objective function based on device data as a substitute for the global objective function on each device. In each external iteration, a subset of devices is selected and a local solver is used to optimize the local objective function on each selected device. The devices then communicate their local model updates to the central server, which aggregates them and updates the global model accordingly. The most widely used aggregation method is fedavg, which takes a weighted average of the parameters aggregated from each device, which can achieve good results when processing IID data, but performs poorly when the data set is highly heterogeneous. Fedprox is an improved algorithm based on FedAvg. It adds a correction term called proximal term, which is essentially a difference limit between the local model weight parameter and the global model weight parameter, so as to increase the stability of model training and the convergence of the model. However, since it is still based on the fedavg method and adds a stable variable adjustment, it can only play a limited role in mitigation. At present, it is urgent to provide a method for solving global model parameters with superior robust performance. Summary of the invention

[0003] The present invention provides a method, device and storage medium for aggregating convolutional neural network models in federated learning. The present invention uses an underlying averaging algorithm different from fedavg, and in the process of convolutional neural network parameter aggregation in federated learning, each convolution kernel parameter of the global model is calculated by each independent model by solving an overdetermined set of equations.

[0004] The technical means adopted by the present invention are as follows:

[0005] A federated learning convolutional neural network model aggregation method, comprising:

[0006] S1. Install the initialized model on a user terminals, where a is an integer not less than 2. The initialized model installed on each user terminal is the same convolutional neural network model, wherein the convolutional kernel size of the convolutional neural network model is k*k, the number of channels is 3, corresponding to R, G, and B respectively, and the convolutional neural network model has a total of e convolutional layers, and the i-th convolutional layer contains e i A three-channel convolution kernel;

[0007] S2, each user terminal uses the local database to perform distributed training on the model, thereby obtaining a user model;

[0008] S3, encrypt each user model and upload it to the central server for aggregation to construct an overdetermined set of equations;

[0009] S4, solving the overdetermined equations to obtain global model parameters;

[0010] S5. The central server transmits the global model parameters back to each user terminal, and each user terminal updates the parameters of its own model according to the global model parameters;

[0011] S6. Iterate steps S2-S5 until the loss function converges or reaches a predetermined number of iterations, completing the training process.

[0012] Further, S3 encrypts each user model and uploads it to the central server for aggregation, including:

[0013] S301, the central server uniformly obtains the jth convolution kernel in the i-th convolution layer from the h-th user model, denoted as c hij , where h is not greater than a, i is not greater than e, and j is not greater than e i , then c hij Contains three matrices corresponding to the three channels, respectively, denoted as (r pq ) k*k ,(g pq ) k*k ,(b pq ) k*k , split the three-channel convolution kernel into rows and concatenate them into a column vector w hij :

[0014] (r 11 、r 12 、r 13 ...r 1k 、r 21 、r 22 ....r k1 ...r kk , g 11 , g 12 ... kk ...b11 , b 12 ...b kk ) T

[0015] Then hij The number of rows is 3*k 2 ;

[0016] S302: Perform the convolution kernel operation described in S301 on a users to obtain w 1ij 、w 2ij ... aij , concatenate these column vectors into a column vector by row, denoted as w ij Then ij The number of rows is 3*k 2 *a;

[0017] S303, the central server generates a random number input matrix D of size m*n as the model input, and includes three matrices corresponding to the three channels in the partial data of the matrix D participating in the convolution kernel operation for the first time, which are recorded as (r pq ′) k*k ,(g pq ′) k*k ,(b pq ′) k*k , the three-channel convolution kernel is split into rows and concatenated to form a row vector d l :

[0018] r′ 11 , r′ 12 , r′ 13 ...r′ 1k , r′ 21 , r′ 22 ...r′ k1 ...r′ kk , g′ 11 , g′ 12 ...g′ kk , b′ 11 , b′ 12 ...b′ kk

[0019] Then the number of columns of d1 is 3*k 2 ;

[0020] S304, after (m-2)*(n-2) transformation operations as described in S303, the data multiplied by the random matrix D and the convolution kernel each time is transformed to obtain the following row vector:

[0021] d1, d2...d (m-2)(n-2)

[0022] Concatenate the above row vectors row by row to form matrix A:

[0023] A=[d1、d2...d (m-2)(n-2) ] T

[0024] The number of rows of matrix A is (m-2)*(n-2) and the number of columns is 3*k 2

[0025] S305, the central server concatenates a identical matrices A into a matrix with (m-2)*(n-2) rows and 3*k columns. 2 *a's matrix F, w obtained in S302 ij Concatenate by rows to get the matrix W, the size of W is 3*k 2 *a row 1 column;

[0026] S306 , solve B=F*W, and obtain the size of matrix B as (m-2)*(n-2) rows and 1 column.

[0027] Furthermore, in step S3, constructing an overdetermined system of equations includes: constructing an overdetermined system of equations AX=B according to the matrix B.

[0028] Further, S4 solves the overdetermined equations to obtain global model parameters, including:

[0029] Solving the overdetermined system of equations to obtain a one-dimensional global model parameter X;

[0030] Expand X according to the inverse operation of the one-dimensionalization operation in S3 to obtain the i-th convolution kernel of the e-th convolution layer;

[0031] Furthermore, S4 solves the overdetermined equations to obtain global model parameters, and also includes: solving other convolution kernels of the global model according to steps S2-S4.

[0032] The present invention also discloses a federated learning convolutional neural network model aggregation device, comprising:

[0033] An initialization unit is used to install the initialized model on a user terminals, where a is an integer not less than 2, and the initialized model installed on each user terminal is the same convolutional neural network model, wherein the convolution kernel size of the convolutional neural network model is k*k, the number of channels is 3, corresponding to R, G, and B respectively, and the convolutional neural network model has a total of e convolutional layers, and the i-th convolutional layer contains e i A three-channel convolution kernel;

[0034] A distributed training unit, which is used to perform distributed training on the model using a local database at each user end, thereby obtaining a user model;

[0035] An overdetermined equation group construction unit, which is used to encrypt each user model and upload it to a central server for aggregation to construct an overdetermined equation group;

[0036] A parameter solving unit, which is used to solve the overdetermined equations to obtain global model parameters;

[0037] A feedback unit, which is used to transmit the global model parameters back to each user terminal through the central server, and each user terminal updates the parameters of its own model according to the global model parameters;

[0038] The training unit is used to terminate the training process when it is judged that the loss function converges or reaches a predetermined number of iterations.

[0039] The present invention also discloses a storage medium, which includes a stored program, wherein when the program is run, any of the above-mentioned federated learning convolutional neural network model aggregation methods is executed.

[0040] Compared with the prior art, the present invention has the following advantages:

[0041] The advantages of the federated learning convolutional neural network model aggregation method provided by the present invention are privacy protection and ease of implementation. This method calculates the weights in each user according to the random number matrix generated by the local data distribution, and transmits the weights in each model instead of the original data, thereby avoiding data leakage. When solving the parameters of each node of the global model, the theoretical support comes from the solution of the mathematical overdetermined equations. The theory is relatively mature and can use the classical method to solve the least squares solution. The algorithm is simple and easy to implement. And when processing non-IID data, better results can be obtained than the FedAvg algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0043] Figure 1 Architecting a federated learning system.

[0044] Figure 2 This is a flowchart of the overall execution of the federated learning convolutional neural network model aggregation of the present invention.

[0045] Figure 3 This is a flowchart for executing the aggregation steps of the federated learning convolutional neural network model aggregation method of the present invention.

[0046] Figure 4 This is the architecture of the federated learning of the present invention. DETAILED DESCRIPTION

[0047] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0048] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0049] Federated learning is defined as follows: In the process of machine learning, each participant can use the data of other parties for joint modeling. The parties do not need to share data resources, that is, joint data training is carried out without leaving the local area to establish a shared machine learning model. Federated learning is a machine learning method that can ensure that data does not leave the local area and jointly establish a model with data from multiple parties to apply to all data. A feasible way of federated learning is to pass model parameters in a federated network and aggregate the parameters of multiple parties to a central server for aggregation. In federated learning, the data of all parties are retained locally, without leaking privacy or violating regulations; multiple participants jointly establish a virtual shared model with data and benefit from it together; the identity and status of each participant in the federated learning system are equal; the modeling effect of federated learning is the same as or not much different from the effect of modeling the entire data set in one place; in the case of misaligned user features, the effect of knowledge transfer can also be achieved by exchanging encrypted parameters between data. The architecture of the federated learning system consists of three parts, such as Figure 1 shown.

[0050] Part 1: Encrypted sample alignment. Since the user groups of the two companies do not completely overlap, the system uses encrypted user sample alignment technology to confirm the common users of both parties without revealing their respective data, and does not expose non-overlapping users, so as to combine the characteristics of these users for modeling.

[0051] Part 2: Encrypted model training. After determining the common user group, the data can be used to train the machine learning model. In order to ensure the confidentiality of the data during the training process, it is necessary to use a third-party collaborator C for encrypted training. Taking the linear regression model as an example, the training process can be divided into the following 4 steps (such as Figure 1 shown):

[0052] Step 1: Collaborator C distributes the public key to A and B to encrypt the data that needs to be exchanged during the training process.

[0053] Step 2: A and B interact in encrypted form to calculate the intermediate results of the gradient.

[0054] Step 3: A and B perform calculations based on the encrypted gradient values ​​respectively, while B calculates the loss based on its label data and summarizes the results to C. C calculates the total gradient value by summarizing the results and decrypts it.

[0055] Step 4: C sends the decrypted gradient back to A and B respectively, and A and B update the parameters of their respective models based on the gradient.

[0056] The above steps are iterated until the loss function converges, thus completing the entire training process. During the sample alignment and model training process, the data of A and B are retained locally, and the data interaction during training will not lead to data privacy leakage. Therefore, the two parties can achieve cooperative training models with the help of federated learning.

[0057] Part 3: Effect incentives. A major feature of federated learning is that it solves the problem of why different institutions should join the federation for joint modeling. That is, after the model is established, the effect of the model will be reflected in practical applications and recorded in a permanent data recording mechanism (such as blockchain). The institutions that provide more data will obtain better model effects, and the model effect depends on the contribution of the data provider to themselves and others. The effects of these models will be distributed to various institutions for feedback on the federation mechanism, and continue to incentivize more institutions to join this data federation. The implementation of the above three parts takes into account the privacy protection and effects of joint modeling among multiple institutions, and also considers rewarding institutions that contribute more data with a consensus mechanism. Therefore, federated learning is a "closed-loop" learning mechanism.

[0058] The present invention is mainly used for the second part of the federated learning system framework: model encryption training. After each independent model is uploaded to the central server C, the central server C solves the optimal value of each node parameter of the global model when aggregating each independent model.

[0059] like Figure 2 As shown, the present invention provides a method for aggregating a federated learning convolutional neural network model. Each user uses their own data to perform training locally, obtains a model suitable for their own data, and uploads their own model to a central server. Then, using encryption-based user sample alignment technology (such as RSA), the common users of each party are confirmed without disclosing their own data, and non-overlapping users are not exposed, so as to combine the features of these users for modeling. The method specifically includes:

[0060] S1. Install the initialized model on a user terminals, where a is an integer not less than 2, and the initialized model installed on each user terminal is the same convolutional neural network model, wherein the convolution kernel size of the convolutional neural network model is k*k, the number of channels is 3, corresponding to R, G, and B respectively, and the convolutional neural network model has a total of e convolution layers, and the i-th convolution layer contains ei three-channel convolution kernels.

[0061] S2. Each user terminal uses the local database to perform distributed training on the model, thereby obtaining a user model.

[0062] S3, encrypt each user model and upload it to the central server for aggregation to construct an overdetermined set of equations. Specifically including:

[0063] S301, the central server uniformly obtains the jth convolution kernel in the i-th convolution layer from the h-th user model, denoted as c hij , where h is not greater than a, i is not greater than e, and j is not greater than e i , then c hij It contains three channels r, g, and b respectively. The three channels have three matrices, which are recorded as (r pq ) k*k ,(g pq ) k*k , (b pq ) k*k The three-channel convolution kernel is split into rows and concatenated to form a column vector with 3*k rows. 2 :

[0064] (r 11 、r 12 、r 13 ...r 1k 、r 21 、r 22 ....r k1...r kk , g 11 , g 12 ... kk ...b 11 , b 12 ...b kk ) T

[0065] The above vector is denoted as w hii .

[0066] S302: Perform the convolution kernel operation described in S301 on a users to obtain w 1ij 、w 2ii ... aij , concatenate these column vectors into a column vector by row, denoted as w ij , then w ij The number of rows is 3*k 2 *a.

[0067] S303, the central server generates a random number input matrix D of size m*n as the model input, and the part of the data of the matrix D that participates in the convolution kernel operation for the lth time is also a three-channel matrix, which contains three channels r, g, and b respectively. The three channels have three matrices respectively, and are similarly recorded as (r pq ′) k*k , (g pq ′) k*k ,(b pq ′) k*k , the same as step S302, the three-channel convolution kernel is split into rows and concatenated to form a row vector with 3*k columns 2 :

[0068] r′ 11 , r′ 12 , r′ 13 ...r′ 1k , r′ 21 , r′ 22 ...r′ k1 ...r′ kk , g′ 11 , g′ 12 ...g′ kk , b′ 11 , b′ 12 ...b′ kk

[0069] The above vector is denoted as d1.

[0070] S304. After (m-2)*(n-2) transformation operations as described in S303, the data multiplied by the random matrix D and the convolution kernel each time can be transformed to obtain the following row vector:

[0071] d1, d2...d (m-2)(n-2)

[0072] Concatenate the above row vectors row by row to form matrix A:

[0073] A=[d1、d2...d (m-2)(n-2) ] T

[0074] The number of rows in matrix A is equal to the number of times the convolution kernel moves in a convolution operation plus one, that is, (m-2)*(n-2), and the number of columns is equal to the data length after a three-channel convolution kernel is one-dimensionalized, that is, 3*k 2 .

[0075] S305, the central server concatenates a identical matrices A into a matrix with (m-2)*(n-2) rows and 3*k columns. 2 *a, and obtain the matrix F of size 3*k from S302 2 *a matrix w with 1 row and 1 column ij Construct the equation. Calculate B = F*w ij , the size of B is (m-2)*(n-2) rows and 1 column.

[0076] S306 , solve B=F*W, and obtain the size of matrix B as (m-2)*(n-2) rows and 1 column.

[0077] The central server uses the obtained matrix B to construct the overdetermined equation system AX=B.

[0078] S4. Solving the overdetermined equations can obtain a one-dimensional global model parameter X. Expand X according to the inverse operation of the one-dimensionalization operation in S3 to obtain the i-th convolution kernel of the e-th convolution layer.

[0079] Furthermore, other convolution kernels of the global model are solved according to steps S2-S4.

[0080] S5. The central server transmits the global model parameters back to each client, and each client updates the parameters of its own model according to the global model parameters.

[0081] Specifically, all the corresponding convolution kernels are added to the convolutional neural network and integrated into a joint model. The central server transmits the parameters of each convolution kernel of the global model back to each user, and each user updates the parameters of their own model based on the parameters.

[0082] S6. Iterate steps S2-S5 until the loss function converges or reaches a predetermined number of iterations, completing the training process.

[0083] Using the trained global model for detection will achieve better model results for users who provide a large amount of data.

[0084] The present invention is applied to the field of federated learning. The process of federated learning is divided into two parts: autonomous and joint. Autonomous part: First, two or more participants install the initialized model on their respective terminals, and each participant has the same model. After that, the participants can use local data to train the model. Since the participants have different data, the models trained by the final terminals also have different model parameters. Joint part: Different model parameters will be uploaded to the cloud at the same time, the cloud will complete the aggregation and update of the model parameters, and return the updated parameters to the participants' terminals, and each terminal will start the next iteration. The above procedure will be repeated until the entire training process converges.

[0085] Convolutional neural network is a type of feedforward neural network with deep structure and convolution operation. It is one of the representative algorithms of deep learning. Its input layer can process multi-dimensional data. Commonly, the input layer of a one-dimensional convolutional neural network receives a one-dimensional or two-dimensional array, where the one-dimensional array is usually time or spectrum sampling; the two-dimensional array may contain multiple channels; the input layer of a two-dimensional convolutional neural network receives a two-dimensional or three-dimensional array; the input layer of a three-dimensional convolutional neural network receives a four-dimensional array. Since convolutional neural networks are widely used in the field of computer vision, many studies presuppose three-dimensional input data, i.e., two-dimensional pixels and RGB channels on a plane, when introducing their structure.

[0086] The hidden layer of a convolutional neural network includes three common structures: convolutional layer, pooling layer, and fully connected layer. The function of the convolutional layer is to extract features from the input data. It contains multiple convolution kernels. Each element of the convolution kernel corresponds to a weight coefficient and a bias, similar to a neuron in a feedforward neural network. Each neuron in the convolutional layer is connected to multiple neurons in a similar area in the previous layer. The size of the area depends on the size of the convolution kernel, which is called the "receptive field", which is similar to the receptive field of visual cortical cells. When the convolution kernel is working, it will regularly scan the input features, perform matrix element multiplication and sum the input features in the receptive field, and superimpose the bias. The convolution kernel in the convolutional layer contains a weight coefficient, while the pooling layer does not. In the traditional fedavg algorithm, the weights of the convolution kernels of different models are averaged.

[0087] like Figure 4As shown, federated learning is to upload different model parameters to the server at the same time, the server will complete the aggregation and update of the model parameters, and return the updated parameters to the terminals of the participants, and each terminal will start the next iteration. The present invention can be used in the medical field. Taking IBM's supercomputer system Watson as an example, the training data Watson used should contain the characteristics of diseases, gene sequences, medical reports, test results and academic papers. But in fact, without a stable data source, most data face the problem of label loss. Since medical data is difficult to collect, insufficient data and labels will lead to poor performance of machine learning models. Assuming that medical institutions around the world are united by sharing their data, they will then have a large enough data set to train models better than before. However, due to the restrictions of various privacy protection clauses, the data of these medical institutions cannot be interoperable.

[0088] After applying federated learning, each medical institution can collect patient data separately, train personalized models, and upload the models and random number matrices generated based on local data to the central server. Then, according to the present invention, a global model applicable to all data is obtained on the central server. On the one hand, since multiple medical institutions jointly collect patient data, which leads to an increase in training data and the problem of label loss, transfer learning can also be applied to fill in the missing labels, thereby expanding the data set and greatly improving the performance of the model; on the other hand, the present invention has a solid theoretical basis and excellent performance, so the accuracy of the obtained model is improved compared to the federated average algorithm, which is of great significance for auxiliary diagnosis.

[0089] The present invention also discloses a federated learning convolutional neural network model aggregation device, comprising:

[0090] An initialization unit is used to install the initialized model on a user terminals, where a is an integer not less than 2, and the initialized model installed on each user terminal is the same convolutional neural network model, wherein the convolution kernel size of the convolutional neural network model is k*k, the number of channels is 3, corresponding to R, G, and B respectively, and the convolutional neural network model has a total of e convolutional layers, and the i-th convolutional layer contains e i A three-channel convolution kernel;

[0091] A distributed training unit, which is used to perform distributed training on the model using a local database at each user end, thereby obtaining a user model;

[0092] An overdetermined equation group construction unit, which is used to encrypt each user model and upload it to a central server for aggregation to construct an overdetermined equation group;

[0093] A parameter solving unit, which is used to solve the overdetermined equations to obtain global model parameters;

[0094] A feedback unit, which is used to transmit the global model parameters back to each user terminal through the central server, and each user terminal updates the parameters of its own model according to the global model parameters;

[0095] The training unit is used to terminate the training process when it is judged that the loss function converges or reaches a predetermined number of iterations.

[0096] The present invention also discloses a storage medium, which includes a stored program, wherein when the program is run, any of the above-mentioned federated learning convolutional neural network model aggregation methods is executed.

[0097] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0098] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0099] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0100] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0101] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0102] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0103] 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A federated learning convolutional neural network model aggregation method, characterized in that: include: S1. Install the initialized model on a user terminals, where a is an integer not less than 2. The initialized model installed on each user terminal is the same convolutional neural network model, wherein the convolutional kernel size of the convolutional neural network model is k*k, the number of channels is 3, corresponding to R, G, and B respectively, and the convolutional neural network model has a total of e convolutional layers, and the i-th convolutional layer contains e i A three-channel convolution kernel; S2, each user terminal uses the local database to perform distributed training on the model, thereby obtaining a user model; S3, encrypting each user model and uploading it to the central server for aggregation to construct an overdetermined set of equations, wherein encrypting each user model and uploading it to the central server for aggregation includes: S301, the central server uniformly obtains the jth convolution kernel in the i-th convolution layer from the h-th user model, denoted as c hij , where h is not greater than a, i is not greater than e, and j is not greater than e i , then c hij Contains three matrices corresponding to the three channels, respectively, denoted as (r pq ) k*k ,(g pq ) k*k ,(b pq ) k*k , split the three-channel convolution kernel into rows and concatenate them into a column vector w hij : (r 11 、r 12 、r 13 …r 1k 、r 21 、r 22 …r k1 …r kk , g 11 , g 12 …g kk …b 11 , b 12 …b kk ) T Then hij The number of rows is 3*k 2 , S302: Perform the convolution kernel operation described in S301 on a users to obtain w 1ij 、w 2ij …w aij , concatenate these column vectors into a column vector by row, denoted as w ij Then ij The number of rows is 3*k 2 *a, S303, the central server generates a random number input matrix D of size m*n as the model input, and includes three matrices corresponding to the three channels in the partial data of the matrix D participating in the convolution kernel operation for the first time, which are recorded as (r pq ′) k*k ,(g pq ′) k*k ,(b pq ′) k*k , the three-channel convolution kernel is split into rows and concatenated to form a row vector d l : r′ 11 、r′ 12 、r′ 13 …r′ 1k 、r′ 21 、r′ 22 …r′ k1 …r′ kk 、g′ 11 、g′ 12 …g′ kk 、b′ 11 、b′ 12 …b′ kk Then d l The number of columns is 3*k 2 , S304, after (m-2)*(n-2) transformation operations as described in S303, the data multiplied by the random matrix D and the convolution kernel each time is transformed to obtain the following row vector: d1、d2…d (m-2)(n-2) Concatenate the above row vectors row by row to form matrix A: A=[d1、d2…d (m-2)(n-2) ] T The number of rows of matrix A is (m-2)*(n-2) and the number of columns is 3*k 2 , S305, the central server concatenates a identical matrices A into a matrix with (m-2)*(n-2) rows and 3*k columns. 2 *a's matrix F, w obtained in S302 ij Concatenate by rows to get the matrix W, the size of W is 3*k 2 *a row 1 column, S306, solving B=F*W, and obtaining a size of the matrix B of (m-2)*(n-2) rows and 1 column; Constructing an overdetermined system of equations includes: constructing an overdetermined system of equations AX=B according to a matrix B; S4, solving the overdetermined equations to obtain global model parameters; S5. The central server transmits the global model parameters back to each user terminal, and each user terminal updates the parameters of its own model according to the global model parameters; S6. Iterate steps S2-S5 until the loss function converges or reaches a predetermined number of iterations, completing the training process.

2. A federated learning convolutional neural network model aggregation method according to claim 1, characterized in that: S4 solves the overdetermined equations to obtain global model parameters, including: Solving the overdetermined system of equations to obtain a one-dimensional global model parameter X; By expanding X according to the inverse operation of the one-dimensionalization operation in S3, we can obtain the i-th convolution kernel of the e-th convolution layer.

3. The method for aggregating a federated learning convolutional neural network model according to claim 1, characterized in that: S4 solves the overdetermined equations to obtain global model parameters, and further includes: Follow steps S2-S4 to solve other convolution kernels of the global model.

4. A federated learning convolutional neural network model aggregation device, characterized in that: include: An initialization unit is used to install the initialized model on a user terminals, where a is an integer not less than 2, and the initialized model installed on each user terminal is the same convolutional neural network model, wherein the convolution kernel size of the convolutional neural network model is k*k, the number of channels is 3, corresponding to R, G, and B respectively, and the convolutional neural network model has a total of e convolutional layers, and the i-th convolutional layer contains e i A three-channel convolution kernel; A distributed training unit, which is used to perform distributed training on the model using a local database at each user end, thereby obtaining a user model; The overdetermined equation group construction unit is used to encrypt each user model and upload it to the central server for aggregation to construct an overdetermined equation group. The encryption of each user model and uploading it to the central server for aggregation includes: S301, the central server uniformly obtains the jth convolution kernel in the i-th convolution layer from the h-th user model, denoted as c hij , where h is not greater than a, i is not greater than e, and j is not greater than e i , then c hij Contains three matrices corresponding to the three channels, respectively, denoted as (r pq ) k*k ,(g pq ) k*k ,(b pq ) k*k , split the three-channel convolution kernel into rows and concatenate them into a column vector w hij : (r 11 、r 12 、r 13 …r 1k 、r 21 、r 22 …r k1 …r kk , g 11 , g 12 …g kk …b 11 , b 12 …b kk ) T Then hij The number of rows is 3*k 2 , S302: Perform the convolution kernel operation described in S301 on a users to obtain w 1ij 、w 2ij …w aij , concatenate these column vectors into a column vector by row, denoted as w ij Then ij The number of rows is 3*k 2 *a, S303, the central server generates a random number input matrix D of size m*n as the model input, and includes three matrices corresponding to the three channels in the partial data of the matrix D participating in the convolution kernel operation for the first time, which are recorded as (r pq ′) k*k ,(g pq ′) k*k ,(b pq ′) k*k , the three-channel convolution kernel is split into rows and concatenated to form a row vector d l : r′ 11 、r′ 12 、r′ 13 …r′ 1k 、r′ 21 、r′ 22 …r′ k1 …r′ kk 、g′ 11 、g′ 12 …g′ kk 、b′ 11 、b′ 12 …b′ kk Then d l The number of columns is 3*k 2 , S304, after (m-2)*(n-2) transformation operations as described in S303, the data multiplied by the random matrix D and the convolution kernel each time is transformed to obtain the following row vector: d1、d2…d (m-2)(n-2) Concatenate the above row vectors row by row to form matrix A: A=[d1、d2…d (m-2)(n-2) ] T The number of rows of matrix A is (m-2)*(n-2) and the number of columns is 3*k 2 , S305, the central server concatenates a identical matrices A into a matrix with (m-2)*(n-2) rows and 3*k columns. 2 *a's matrix F, w obtained in S302 ij Concatenate by rows to get the matrix W, the size of W is 3*k 2 *a row 1 column, S306, solving B=F*W, and obtaining a size of the matrix B of (m-2)*(n-2) rows and 1 column; Constructing an overdetermined system of equations includes: constructing an overdetermined system of equations AX=B according to a matrix B; A parameter solving unit, which is used to solve the overdetermined equations to obtain global model parameters; A feedback unit, which is used to transmit the global model parameters back to each user terminal through the central server, and each user terminal updates the parameters of its own model according to the global model parameters; The training unit is used to terminate the training process when it is judged that the loss function converges or reaches a predetermined number of iterations.

5. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the federated learning convolutional neural network model aggregation method described in any one of claims 1 to 3 is executed.