Joint learning method, system, node and storage medium
By performing incremental learning and model fusion in the joint learning system, and using knowledge distillation technology of soft targets and temperature parameters, the problem of decentralized training of neural networks under privacy and security regulations is solved, and efficient neural network training and model performance are achieved. promote.
Patent Information
- Application Number
- CN202010038486.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-14
- Publication Date
- 2024-09-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Under the premise of complying with privacy and security regulations, there are challenges in using dispersed training data and computing resources to train neural networks, especially in terms of data privacy protection. Traditional methods such as gradient update data may leak user information and occupy a large amount of communication resources. High, applicable scenarios are limited.
In the joint learning system, the central node sends the initial model to the computing node, the computing node performs incremental learning and returns the intermediate model, and the central node performs model fusion to generate an advanced model, using soft targets and temperature parameters to perform knowledge distillation and model fusion. Reduce communication volume and improve privacy protection.
It realizes the efficient use of distributed training data and computing resources to train neural networks while complying with privacy and security regulations, reducing communication resource occupation, improving model performance, and is suitable for multi-regional and heterogeneous model training scenarios.
Smart Images

Figure CN113191479B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence (AI), and in particular to a method, system, node and storage medium for joint learning. Background Art
[0002] AI is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, basic AI theory, etc.
[0003] With the emergence of large-scale data sets and the rapid development of computing power (such as the computing performance of NVIDIA graphics cards), deep learning, as one of the important algorithms in the field of artificial intelligence, has begun to show its amazing dominance in tasks such as data classification, object segmentation, and object detection. It has allowed people around the world to see the huge potential of artificial intelligence and has also given people beautiful visions of advanced technologies such as driverless cars, remote surgery, and scene understanding.
[0004] Artificial intelligence requires a large amount of data for training, and a large amount of data is often distributed on computing nodes in different locations. In traditional methods, training data is often obtained by large-scale collection and merging of data from various computing nodes, which also brings some data privacy issues. Especially after the formal implementation of the EU General Data Protection Regulation (GDPR), data privacy protection has become the focus of social attention. The previous large-scale collection and merging of data is no longer applicable to current legal regulations. How to use decentralized training data and computing resources to train neural networks while complying with privacy and security regulations (such as GDPR) has become an urgent problem to be solved. Summary of the invention
[0005] The present application provides a method, system, node and storage medium for joint learning, which can solve the problem of how to train a neural network using distributed training data and computing resources while complying with privacy and security regulations.
[0006] In a first aspect, a method for federated learning is provided, which is applied to a federated learning system, wherein the federated learning system includes one or more computing nodes and one or more central nodes, and the method includes the following steps:
[0007] The computing node receives a first primary model sent by the central node, wherein the first primary model is obtained after the central node trains the neural network according to the central database of the central node;
[0008] The computing node uses its local database to perform incremental learning on the first primary model to obtain a first intermediate model;
[0009] The computing node sends the first intermediate model to the central node, so that the central node performs model fusion on the received multiple first intermediate models to obtain a first high-level model.
[0010] In the above method, the trained first primary model is sent to multiple computing nodes through the central node. Each computing node can perform incremental learning on the first primary model according to the data in the local database, obtain multiple first intermediate models and return them to the central node, so that the central node can perform model fusion on the received multiple first intermediate models to obtain a trained first advanced model. The first advanced model learns the data features of the training data in the local database of each computing node, has excellent model performance, and solves the problem of using decentralized training data and computing resources to train neural networks while complying with privacy and security regulations.
[0011] In a possible implementation of the first aspect, the computing node uses its local database to perform incremental learning on the first primary model to obtain a first intermediate model, including: the computing node inputs the training data in the local database into the first network in the first primary model to obtain the output result of the first network, wherein the first primary model includes the first network and the first prediction function, and the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network; the computing node inputs the output result of the first network into the soft target prediction function to obtain a soft target of the training data in the local database, wherein the soft target prediction function is obtained according to a temperature parameter and the first prediction function, and the temperature parameter is used to make the soft target obtained by inputting the output result of the first network into the soft target prediction function not greater than the prediction value of the first primary model obtained by inputting the output result of the first network into the first prediction function; the computing node uses the local database to train the first intermediate network, and obtains a mixed loss function according to the soft target and the true label of the training data in the local database, wherein the network type of the first intermediate network is the same as the network type of the neural network; the computing node back-propagates the first intermediate network according to the mixed loss function to obtain the first intermediate model.
[0012] In a specific implementation, the first intermediate network includes a second network and a second prediction function. The second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network. The hybrid loss function is determined according to the first loss function and the second loss function. The first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network into the soft target prediction function after the computing node inputs the training data in the local database into the second network of the first intermediate network to obtain the output result of the second network and the soft target. The second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
[0013] It is understandable that in the traditional neural network training process, the data set is used to train the neural network, and the prediction results are adjusted according to the real labels of the data set during the training process. Therefore, it can be understood that the trained neural network model has learned the "knowledge" in the data set. In the above implementation, the pre-trained first primary model is used to predict the training data in the local database to obtain the soft target of each training data. During the training of the first intermediate network, the network parameters of the first intermediate network will be adjusted according to the real labels and soft targets at the same time. Therefore, it can be understood that the trained neural network model has not only learned the "knowledge" in the data set, but also learned the "knowledge" of the first primary model, thereby achieving the purpose of incremental learning.
[0014] In a possible implementation of the first aspect, the first high-level model is obtained after the central node obtains a multi-teacher fusion model based on multiple first intermediate models, and uses the central node's central database to perform incremental learning on the multi-teacher fusion model, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of multiple first intermediate models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first high-level model.
[0015] In the above implementation, a multi-teacher fusion model is obtained by splicing the feature vectors extracted from the fully connected layers of the first intermediate models after multiple incremental learning into one feature vector, and the multi-teacher fusion model is incrementally learned in combination with the central database of the central node, so that the final first high-level model not only learns the data features in the central database, but also learns the prediction capabilities of multiple first intermediate models, thereby achieving the purpose of fusing multiple first intermediate models into one first high-level model, and further realizing the problem of using scattered training data and computing resources to train neural networks. In addition, since the model structure of the first intermediate model is not limited during the model fusion process, when the computing node performs incremental learning, the first intermediate network structure used for training in combination with the local database can be free of any restrictions, making the application scenarios applicable to this application more extensive.
[0016] In a possible implementation of the first aspect, the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimensionality of the feature vectors extracted by the fully connected layers of m forward boosting models, the m forward boosting models are obtained based on multiple first intermediate models, the forward boosting model is a model that guides the basic model, and the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the test data in the central database is input into the multiple first intermediate models.
[0017] In the above implementation, by screening multiple first intermediate models, m positive improvement models that have a guiding role on the basic model are obtained. It can be understood that if the positive improvement model can guide the training of the basic model with the highest prediction accuracy in the first intermediate model, and the prediction accuracy of the basic model can be further improved, then the positive improvement model can definitely guide the training of the first advanced network that has not been trained with a training set, has only a simple neural network structure, or even does not have model prediction capabilities, and the prediction accuracy of the first advanced network can be improved, thereby reducing the number of models involved in the model fusion process, improving the efficiency of model fusion, and then improving the efficiency of joint learning.
[0018] In a possible implementation of the first aspect, the computing node sends the first intermediate model to the central node, so that the central node performs model fusion on the received multiple first intermediate models to obtain the first advanced model. The method also includes: when there is new data in the local database, the computing node receives the second primary model sent by the central node, wherein the second primary model is the first advanced model; the computing node performs incremental learning on the second primary model in combination with the new data to obtain the second intermediate model; the computing node sends the second intermediate model to the central node, so that the central node performs model fusion on the received multiple updated second intermediate models to obtain the second advanced model.
[0019] In the above implementation, when there is new data in the local database of the computing node, the first advanced model obtained in the previous training cycle can be used as the second primary model, and then joint learning in the second training cycle can be performed to obtain a second advanced model with better performance. It can be understood that in the joint learning method provided by the present application, within a training cycle, the central node can send the first primary model data to the computing node once, and the computing node can send the first intermediate model data to the central node once to complete the joint learning process, so that the number of communication resources occupied by the entire joint learning process is extremely small, making the application scenarios applicable to the present application more extensive.
[0020] In a possible implementation of the first aspect, one or more central nodes include a first central node and a second central node, the first central node and the second central node are deployed in different geographical areas, and the computing node receives the first primary model sent by the central node, including: the computing node receives the first primary model sent by the first central node; the computing node sends the first intermediate model to the central node, so that the central node performs model fusion on the received multiple first intermediate models to obtain a first advanced model, including: the computing node sends the first intermediate model to the second central node, so that the second central node performs model fusion on the received multiple first intermediate models to obtain a first advanced model.
[0021] In the above implementation, the central node for training the primary model and the central node for model fusion can be different central nodes or the same central node. The specific central node can be determined based on the actual situation of the application scenario, so that the application scenarios applicable to this application are more extensive.
[0022] In a second aspect, a method for joint learning is provided, which is applied to a joint learning system, wherein the joint learning system includes one or more computing nodes and one or more central nodes, and the method includes:
[0023] The central node sends a first primary model to the computing node, wherein the first primary model is obtained after the central node trains the neural network according to the central database of the central node;
[0024] The central node receives a first intermediate model sent by the computing node, wherein the first intermediate model is obtained after the computing node performs incremental learning on the first primary model using a local database of the computing node;
[0025] The central node performs model fusion on the received multiple first intermediate models to obtain a first high-level model.
[0026] In the above method, the trained first primary model is sent to multiple computing nodes through the central node. Each computing node can perform incremental learning on the first primary model according to the data in the local database, obtain multiple first intermediate models and return them to the central node, so that the central node can perform model fusion on the received multiple first intermediate models to obtain a trained first advanced model. The first advanced model learns the data features of the training data in the local database of each computing node, has excellent model performance, and solves the problem of using decentralized training data and computing resources to train neural networks while complying with privacy and security regulations.
[0027] In a possible implementation of the second aspect, the first intermediate model is that the computing node inputs the training data in the local database into the first network in the first primary model to obtain the output result of the first network, and inputs the output result of the first network into the soft target prediction function to obtain the soft target of the training data in the local database, and then uses the local database to train the first intermediate network, obtains a mixed loss function according to the soft target and the true label of the training data in the local database, and back-propagates the first intermediate network according to the mixed loss function to obtain the first intermediate model, wherein the first primary model includes a first network and a first prediction function, the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network, and the soft target prediction function is obtained according to the temperature parameter and the first prediction function, and the temperature parameter is used to make the soft target obtained by inputting the output result of the first network into the soft target prediction function not greater than the prediction value of the first primary model obtained by inputting the output result of the first network into the first prediction function.
[0028] In a specific implementation, the first intermediate network includes a second network and a second prediction function. The second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network. The hybrid loss function is determined according to the first loss function and the second loss function. The first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network into the soft target prediction function after the computing node inputs the training data in the local database into the second network of the first intermediate network to obtain the output result of the second network and the soft target. The second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
[0029] It is understandable that in the traditional neural network training process, the data set is used to train the neural network, and the prediction results are adjusted according to the real labels of the data set during the training process. Therefore, it can be understood that the trained neural network model has learned the "knowledge" in the data set. In the above implementation, the pre-trained first primary model is used to predict the training data in the local database to obtain the soft target of each training data. During the training of the first intermediate network, the network parameters of the first intermediate network will be adjusted according to the real labels and soft targets at the same time. Therefore, it can be understood that the trained neural network model has not only learned the "knowledge" in the data set, but also learned the "knowledge" of the teacher model, thereby achieving the purpose of incremental learning.
[0030] In a possible implementation of the second aspect, the central node performs model fusion on the received multiple first intermediate models to obtain a first high-level model, including: the central node obtains a multi-teacher fusion model based on the multiple first central models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the multiple first intermediate models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first high-level model; the central node uses the central database to perform incremental learning on the multi-teacher fusion model to obtain the first high-level model.
[0031] In the above implementation, a multi-teacher fusion model is obtained by splicing the feature vectors extracted from the fully connected layers of the first intermediate models after multiple incremental learning into one feature vector, and the multi-teacher fusion model is incrementally learned in combination with the central database of the central node, so that the final first high-level model not only learns the data features in the central database, but also learns the prediction capabilities of multiple first intermediate models, thereby achieving the purpose of fusing multiple first intermediate models into one first high-level model, and further realizing the problem of using scattered training data and computing resources to train neural networks. In addition, since the model structure of the first intermediate model is not limited during the model fusion process, when the computing node performs incremental learning, the first intermediate network structure used for training in combination with the local database can be free of any restrictions, making the application scenarios applicable to this application more extensive.
[0032] In a possible implementation of the second aspect, obtaining a multi-teacher fusion model based on multiple first intermediate models includes: the central node screens out a basic model and m forward improvement models from the multiple first intermediate models, wherein the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the central node inputs the test data in the central database into the multiple first intermediate models, and the forward improvement model is a model that guides the basic model; the central node obtains the multi-teacher fusion model based on the m forward improvement models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimensionality of the feature vectors extracted by the fully connected layers of the m forward improvement models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first advanced model.
[0033] In the above implementation, by screening multiple first intermediate models, m positive improvement models that have a guiding role on the basic model are obtained. It can be understood that if the positive improvement model can guide the training of the basic model with the highest prediction accuracy in the first intermediate model, and the prediction accuracy of the basic model can be further improved, then the positive improvement model can definitely guide the training of the first advanced network that has not been trained with a training set, has only a simple neural network structure, or even does not have model prediction capabilities, and the prediction accuracy of the first advanced network can be improved, thereby reducing the number of models involved in the model fusion process, improving the efficiency of model fusion, and then improving the efficiency of joint learning.
[0034] In a possible implementation of the second aspect, after the central node performs model fusion on the received multiple first intermediate models to obtain the first advanced model, the method also includes: the central node sends a second primary model to the computing node, so that the computing node performs incremental learning on the second primary model in combination with new data in the local database to obtain a second intermediate model, wherein the second primary model is a advanced model; the central node receives the second intermediate model sent by the computing node; the central node performs model fusion on the received multiple second intermediate models to obtain a second advanced model.
[0035] In the above implementation, when there is new data in the local database of the computing node, the first advanced model obtained in the previous training cycle can be used as the second primary model, and then joint learning in the second training cycle can be performed to obtain a second advanced model with better performance. It can be understood that in the joint learning method provided by the present application, within a training cycle, the central node can send the first primary model data to the computing node once, and the computing node can send the first intermediate model data to the central node once to complete the joint learning process, so that the number of communication resources occupied by the entire joint learning process is extremely small, making the application scenarios applicable to the present application more extensive.
[0036] In a possible implementation of the second aspect, one or more central nodes include a first central node and a second central node, and the central node sends a first primary model to a computing node, including: the first central node sends a first primary model to the computing node, wherein the first primary model is obtained by the first central node after training a neural network according to a central database of the first central node; the central node receives a first intermediate model sent by the computing node, including: the second central node receives the first intermediate model sent by the computing node; the central node performs model fusion on multiple received first intermediate models to obtain a first advanced model, including: the second central node performs model fusion on multiple received first intermediate models to obtain a first advanced model.
[0037] In the above implementation, the central node for training the primary model and the central node for model fusion can be different central nodes or the same central node. The specific central node can be determined based on the actual situation of the application scenario, so that the application scenarios applicable to this application are more extensive.
[0038] In a third aspect, a computing node is provided, which is applied to a joint learning system. The joint learning system includes one or more computing nodes and one or more central nodes. The computing node includes a receiving unit, a learning unit, and a sending unit.
[0039] The receiving unit is used to receive a first primary model sent by the central node, wherein the first primary model is obtained after the central node trains the neural network according to the central database of the central node;
[0040] The learning unit is used to perform incremental learning on the first primary model using the local database of the computing node to obtain a first intermediate model;
[0041] The sending unit is used to send the first intermediate model to the central node, so that the central node performs model fusion on the received multiple first intermediate models to obtain the first high-level model.
[0042] In a possible implementation of the third aspect, the learning unit is used to input the training data in the local database into the first network in the first primary model to obtain the output result of the first network, wherein the first primary model includes the first network and the first prediction function, and the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network; the learning unit is used to input the output result of the first network into the soft target prediction function to obtain the soft target of the training data in the local database, wherein the soft target prediction function is obtained according to the temperature parameter and the first prediction function, and the temperature parameter is used to make the soft target obtained by inputting the output result of the first network into the soft target prediction function not greater than the prediction value of the first primary model obtained by inputting the output result of the first network into the first prediction function; the learning unit is used to train the first intermediate network using the local database, and obtain a mixed loss function according to the soft target and the true label of the training data in the local database, wherein the network type of the first intermediate network is the same as the network type of the neural network; the learning unit is used to back propagate the first intermediate network according to the mixed loss function to obtain a trained first intermediate model.
[0043] In a possible implementation of the third aspect, the first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to an output result of the second network, the hybrid loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network into the soft target prediction function after the computing node inputs the training data in the local database into the second network of the first intermediate network to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
[0044] In a possible implementation of the third aspect, the first high-level model is obtained after the central node obtains the multi-teacher fusion model based on multiple first intermediate models, and uses the central database of the central node to perform incremental learning on the multi-teacher fusion model, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of multiple first intermediate models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first high-level model.
[0045] In a possible implementation of the third aspect, the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of m forward boosting models, the m forward boosting models are obtained based on multiple first intermediate models, the forward boosting model is a model that guides the basic model, and the basic model is the model with the highest prediction accuracy among multiple first intermediate models after the test data in the central database is input into multiple first intermediate models.
[0046] In a possible implementation of the third aspect, the receiving unit is also used to send the first intermediate model to the central node, so that the central node performs model fusion on the multiple received first intermediate models to obtain the first high-level model. Then, when there is new data in the local database, the receiving unit receives the second primary model sent by the central node, wherein the second primary model is the first high-level model; the learning unit is also used to perform incremental learning on the second primary model in combination with the new data to obtain the second intermediate model; the sending unit is also used to send the second intermediate model to the central node, so that the central node performs model fusion on the multiple updated second intermediate models received to obtain the second high-level model.
[0047] In a possible implementation of the third aspect, one or more central nodes include a first central node and a second central node, and the receiving unit is also used to receive a first primary model sent by the first central node; the sending unit is also used to send a first intermediate model to the second central node, so that the second central node performs model fusion on the received multiple first intermediate models to obtain a first advanced model.
[0048] In a fourth aspect, a central node is provided, which is applied to a joint learning system. The joint learning system includes one or more computing nodes and one or more central nodes. The central node includes a sending unit, a receiving unit and a fusion unit, wherein:
[0049] The sending unit is used to send a first primary model to the computing node, wherein the first primary model is obtained after the central node trains the neural network according to the central database of the central node;
[0050] The receiving unit is used to receive a first intermediate model sent by a computing node, wherein the first intermediate model is obtained after the computing node performs incremental learning on the first primary model using a local database of the computing node;
[0051] The fusion unit is used to perform model fusion on the received multiple first intermediate models to obtain a first high-level model.
[0052] In a possible implementation of the fourth aspect, the first intermediate model is that the computing node inputs the training data in the local database into the first network in the first primary model to obtain the output result of the first network, and inputs the output result of the first network into the soft target prediction function to obtain the soft target of the training data in the local database, and then uses the local database to train the first intermediate network, obtains a mixed loss function according to the soft target and the true label of the training data in the local database, and back-propagates the first intermediate network according to the mixed loss function to obtain the first intermediate model, wherein the first primary model includes a first network and a first prediction function, the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network, and the soft target prediction function is obtained according to the temperature parameter and the first prediction function, and the temperature parameter is used to make the soft target obtained by inputting the output result of the first network into the soft target prediction function not greater than the prediction value of the first primary model obtained by inputting the output result of the first network into the first prediction function.
[0053] In a possible implementation of the fourth aspect, the first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to an output result of the second network, the hybrid loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network into the soft target prediction function after the computing node inputs the training data in the local database into the second network of the first intermediate network to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
[0054] In a possible implementation of the fourth aspect, a fusion unit is used to obtain a multi-teacher fusion model based on multiple first intermediate models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the multiple first intermediate models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first advanced model; the fusion unit is used to perform incremental learning on the multi-teacher fusion model using a central database to obtain a first advanced model.
[0055] In a possible implementation of the fourth aspect, the first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to an output result of the second network, the hybrid loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network into the soft target prediction function after the computing node inputs the training data in the local database into the second network of the first intermediate network to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label of the training data in the local database.
[0056] In a possible implementation of the fourth aspect, the fusion unit is used to screen out a basic model and m forward improvement models from multiple first intermediate models, wherein the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the central node inputs the test data in the central database into the multiple first intermediate models, and the forward improvement model is a model that guides the basic model; the fusion unit is used to obtain a multi-teacher fusion model based on the m forward improvement models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the m forward improvement models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first advanced model.
[0057] In a possible implementation of the fourth aspect, the receiving unit is also used to receive a message sent by the computing node that new data exists in the local database of the computing node after performing model fusion on the multiple first intermediate models received to obtain the first advanced model; the sending unit is also used to send a second primary model to the computing node based on the message that new data exists in the local database, so that the computing node performs incremental learning on the second primary model in combination with the new data to obtain a second intermediate model, wherein the second primary model is an advanced model; the receiving unit is also used to receive the second intermediate model sent by the computing node; the fusion unit is also used to perform model fusion on the multiple second intermediate models received to obtain a second advanced model.
[0058] In a fifth aspect, a joint learning system is provided, the system comprising one or more central nodes as described in the second aspect and one or more computing nodes as described in the first aspect, the central node connecting the computing nodes.
[0059] In a sixth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on a computing device, cause the computing device to execute the method described in the first aspect and / or the second aspect.
[0060] In a seventh aspect, a computer program product is provided, comprising a computer program, which, when read and executed by a computing device, implements the method described in the first aspect and / or the second aspect.
[0061] In an eighth aspect, an electronic device is provided, comprising a processor and a memory, wherein the processor executes a code in the memory to implement the method described in the first aspect and / or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] 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 are briefly introduced below.
[0063] Figure 1 This is a schematic diagram of an artificial intelligence main framework provided by an embodiment of the present application;
[0064] Figure 2 is a structural diagram of a joint learning system provided in an embodiment of the present application;
[0065] Figure 3A-3C It is a flowchart of the joint learning method provided by the embodiment of the present application in an application scenario;
[0066] Figure 4 It is a flowchart of a joint learning method provided in an embodiment of the present application;
[0067] Figure 5 It is a schematic diagram of an incremental learning process provided by an embodiment of the present application;
[0068] Figure 6 It is a flow chart of a model fusion method provided in an embodiment of the present application;
[0069] Figure 7 It is a flowchart of a method for determining a positive improvement model provided in an embodiment of the present application;
[0070] Figure 8 It is a structural diagram of a multi-teacher fusion model provided in an embodiment of the present application;
[0071] Fig. 9 It is a structural diagram of a computing node provided by this application;
[0072] Fig.10 It is a structural schematic diagram of a central node provided by this application;
[0073] Fig.11 It is a schematic diagram of the hardware structure of a chip provided by this application;
[0074] Fig.12It is a structural schematic diagram of an electronic device provided by this application. DETAILED DESCRIPTION
[0075] The technical solutions in the embodiments of the present invention will be 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 are within the scope of protection of the present invention.
[0076] Figure 1 A schematic diagram of an artificial intelligence main framework is shown, which describes the overall workflow of the artificial intelligence system and is applicable to general artificial intelligence field requirements.
[0077] The following is an explanation of the above artificial intelligence theme framework from two dimensions: "intelligent information chain" (horizontal axis) and "IT value chain" (vertical axis).
[0078] The "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it can be a general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, data undergoes a condensed process of "data-information-knowledge-wisdom".
[0079] The "IT value chain" reflects the value that artificial intelligence brings to the information technology industry, from the underlying infrastructure of human intelligence, information (providing and processing technology implementation) to the system's industrial ecological process.
[0080] (1) Infrastructure:
[0081] The infrastructure provides computing power support for the artificial intelligence system, enables communication with the outside world, and supports it through the basic platform. It communicates with the outside world through sensors; computing power is provided by smart chips, such as central processing units (CPU), neural network processors (NPU), graphics processors (GPU), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) and other hardware acceleration chips; the basic platform includes distributed computing frameworks and networks and other related platform guarantees and support, which can include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to obtain data, and these data are provided to the smart chips in the distributed computing system provided by the basic platform for calculation.
[0082] (2) Data
[0083] The data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data of traditional devices, including business data of existing systems and perception data such as force, displacement, liquid level, temperature, and humidity.
[0084] (3) Data processing
[0085] Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
[0086] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.
[0087] Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formalized information to perform machine thinking and solve problems based on reasoning control strategies. Typical functions are search and matching.
[0088] Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as classification, sorting, and prediction.
[0089] (4) General ability
[0090] After the data has undergone the data processing mentioned above, some general capabilities can be further formed based on the results of the data processing, such as an algorithm or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0091] (5) Smart products and industry applications
[0092] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, which productizes intelligent information decision-making and realizes practical application. Its application areas mainly include: smart manufacturing, smart transportation, smart home, smart medical care, smart security, autonomous driving, safe cities, smart terminals, etc.
[0093] With the emergence of large-scale data sets and the rapid development of computing power (such as the computing performance of NVIDIA graphics cards), deep learning, as one of the important algorithms in the field of artificial intelligence, has begun to show its amazing dominance in tasks such as data classification, object segmentation, and object detection. In particular, the emergence of AlphaGo in 2016 has made people around the world see the huge potential of artificial intelligence, and has also made people have beautiful visions for advanced technologies such as unmanned driving, remote surgery, and scene understanding.
[0094] With the development of society, on the one hand, artificial intelligence has brought huge productivity, and on the other hand, it also requires a large amount of data for training. These training data are often generated by users in the process of using products, which involve some privacy data such as user frequency, usage time, and usage preferences. If these user data are collected uniformly on the server side and then trained on a large scale, it is easy for users to worry about the privacy of their personal data. Especially after the formal implementation of the GDPR, data privacy protection has become the focus of social attention. The previous large-scale collection and merging of data is no longer applicable to current legal regulations. How to use decentralized training data and computing resources to train neural networks under the premise of complying with privacy and security regulations (such as the GDPR) has become an urgent problem to be solved.
[0095] Federated Learning is a method proposed by Google to solve the above problems. It enables multiple client computing devices to train a shared prediction model in a collaborative manner. First, the server sends the initial model to the client computing device; second, the client computing device trains the initial model based on local data, and after the training is completed, the gradient update data of the trained initial model is sent to the server; then, the server integrates all the received gradient update data as an update of the model; finally, the updated model is sent to the client computing device again, and the above training process is repeated until the server model converges. This achieves the completion of model training without transmitting personal data, ensuring the security of user data.
[0096] However, the above method still has defects. In some cases, it still cannot solve the problem of using decentralized training data and computing resources to train neural networks while complying with privacy and security regulations. First, the gradient update data contains some original image information. Even if the gradient data is encrypted, there is still a possibility that the encrypted information may be cracked in some cases, and then there is a possibility of inferring the original data from the gradient update data. In other words, user information may still be leaked in some cases. Second, the client computing device is required to send gradient update data to the server many times until the server model converges. The transmission frequency is very high, which will occupy a large amount of communication resources, greatly limiting the application scenarios of this method. In other words, in some application scenarios with limited communication bandwidth, it is still impossible to solve the problem of using decentralized training data and computing resources to train neural networks while complying with privacy and security regulations. Third, since the final trained model is obtained by integrating the gradient update data sent by each client computing device, specifically, the gradient or weight of the same parameter will be accumulated and then averaged, each client computing device and the server must use exactly the same model structure parameters for training, and the training data used by each client computing device and the server must also be very similar independent and identically distributed data (IID). Otherwise, the updated gradient data will be very different due to the large data difference, resulting in the final model performance determined by accumulating and averaging the gradient or weight of the same parameter. In actual applications, if different client computing devices belong to different organizations, the model structure used by each client computing device cannot be guaranteed to be exactly the same, such as the number of iterations of the hyperparameter setting, the size of the input image parameters, etc., and the training data cannot be guaranteed to be independent and identically distributed data, which greatly limits the application scenarios of this method. In other words, in the application scenario where the client computing devices are managed by different organizations, this method still cannot solve the problem of using decentralized training data and computing resources to train neural networks under the premise of complying with privacy and security regulations.
[0097] In order to solve the above-mentioned problem of how to use decentralized training data and computing resources to train neural networks under the premise of complying with privacy and security regulations, this application provides a joint learning system. After the client computing device receives the initial model sent by the server, it can perform incremental learning on the initial model according to its own local data to obtain an incremental model, and transmit it to the server. The server obtains the model after joint learning through the model fusion algorithm. In this way, it is possible to use decentralized training data and computing resources to train neural networks under the premise of complying with privacy and security regulations.
[0098] The unit modules within the joint learning system provided in this application may also be divided into multiple types. Each module may be a software module or a hardware module, or may be partly a software module and partly a hardware module. This application does not limit this. Figure 2 is an exemplary division method, such as Figure 2 As shown, the joint learning system 100 includes a central node 110 and a computing node 120. The central node 110 may be the server mentioned above, and the computing node 120 may be the client computing device mentioned above. The functions of each node are described below.
[0099] The central node 110 may be individually set in a single terminal or server, or in a server cluster, or in a data center. When the central node 110 is set in a single terminal or server, the terminal or server may be set in any region of the world; when the central node 110 is set in a server cluster, the server cluster may be set in any region of the world; when the central node 110 is set in a data center, the central node 110 may be set in a region with sufficient power supply, low land price, and good cooling conditions. Of course, when factors such as cost are not considered, the central node 110 may also be set in any region of the world.
[0100] The computing node 120 may be individually set in a single server, or may be set in a server cluster, or may be set in a data center. When the computing node 120 is set in a single server, the server may be set in any region of the world; when the computing node 120 is set in a server cluster, the server cluster may be set in any region of the world; when the computing node 120 is set in a data center, the computing node 120 may be set in a region with sufficient power supply, low land price, and good cooling conditions. Of course, when factors such as cost are not considered, the computing node 120 may also be set in any region of the world.
[0101] The central node 110 and the computing node 120 may be respectively arranged in a plurality of different areas. For example, Figure 2 The central node 110 can be set in Nanshan District, Shenzhen City, computing node 1 can be set in Futian District, Shenzhen City, computing node 2 can be set in Baoan District, Shenzhen City, computing node 3 can be set in Longhua District, Shenzhen City, etc., which is not specifically limited here.
[0102] In a specific implementation, the central node 110 may include a central database 111, a model training module 112, and a model fusion module 113, wherein the central database 111 stores the training data of the local central node; the computing node 120 may include a local database 121 and an incremental learning module 122, wherein the local database 121 stores the training data of the local computing node. In an embodiment of the present application, the model training module 112 of the central node can use the central database 111 to train the first primary model, and encrypt it and send it to multiple computing nodes 120; the computing node 120 can use the incremental learning module 122 to combine the local database 121 to perform incremental learning on the first primary model, thereby generating a trained first intermediate model, and encrypt it and send it to the central node 110; finally, the model fusion module 113 of the central node 110 can perform model fusion through a model fusion algorithm based on the first intermediate model received from multiple computing nodes 120 and the data in the central database 111, thereby obtaining the final first advanced model. The first advanced model learns the data features of the training data in the local database of each computing node 120, and the model performance is very excellent.
[0103] Need to explain, Figure 2 Only one central node 110 and three computing nodes 120 are used as examples for illustration. In the specific implementation, the number of central nodes 110 can be one or more, and the number of computing nodes can also be one or more. The number of central nodes and computing nodes can be determined according to the actual situation, and this application does not make specific restrictions. Among them, when the number of central nodes 110 is multiple, the node for training and issuing the first primary model and the node for fusing multiple first intermediate models can be different central nodes 110. For example, central node 1 is located in Shenzhen City and is used to train the first primary model according to the central database of central node 1. Central node 2 is located in Shanghai and is used to perform model fusion on the first intermediate models sent by multiple computing nodes 120 according to the central database of central node 2 to obtain the final first advanced model. The above examples are for illustration only and do not constitute specific restrictions.
[0104] It can be understood that in the joint learning system provided by the present application, the central node only needs to send the initial model data to the computing node once, and the computing node only needs to send the first intermediate model data to the central node once. The entire system does not need to occupy too many communication resources. Moreover, since the initial model data and the first intermediate model data are both transmitted in encrypted form, and the model data is different from the gradient data, the model data cannot be restored to the original training data. Therefore, the joint system provided by the present application fully realizes the use of decentralized training data and computing resources to train neural networks while complying with privacy and security regulations.
[0105] The following describes the application scenarios to which the joint learning system provided in this application is applicable.
[0106] The joint learning system provided by the present application can be applied to the scenario of multi-region and multi-user joint learning. In this scenario, the data of each user cannot be gathered together for unified training due to privacy issues. For example, in the scenario of updating the intelligent image recognition model of mobile phone users, the album data of terminal users is privacy-sensitive data, but each terminal user has a small number of images. In addition, the usage habits of users are different, resulting in uneven distribution of data categories, which are not independent and identically distributed data. In this application scenario, considering the privacy issues of users, it is impossible to uniformly upload the album data in each mobile phone to the cloud for training, and considering the communication bandwidth / traffic cost issues, it is difficult to bear the huge communication volume brought by the traditional joint learning methods mentioned above. However, using the joint learning system provided by the present application, such as Figure 3A As shown, first, the cloud (central node 110) can use the album data in the cloud database (central database 111) to train multiple first primary models in advance and encrypt them; secondly, each user's mobile phone (computing node 120) can receive the first primary model from the cloud in idle time, and then perform incremental learning based on the album data in the user data (local database 121) in each mobile phone to obtain the first intermediate model. For details, please refer to Figure 3A The incremental learning process described by mobile phone 1 in the figure should be understood that the process of mobile phones 2 to N performing incremental learning to generate the first intermediate model based on the first primary model and the local database 121 is the same as that of mobile phone 1. Figure 3A Mobile phones 2 to N do not further describe this step; then, each user's mobile phone can encrypt the first intermediate model and send it to the cloud in idle time; finally, the cloud can fuse the received multiple first intermediate models through the model fusion algorithm, so as to obtain a first advanced model with better model performance than the first primary model and each first intermediate model. It can be understood that since each mobile phone can only perform incremental learning based on the local database 121, the first intermediate model trained in this way may not accurately identify certain categories because it lacks a part of the data, and the central node obtains the first advanced model after model fusion of multiple first intermediate models, and learns the album data features of each mobile phone. Therefore, the model performance of the first advanced model finally obtained is excellent, and it is fully realized that the neural network is trained using decentralized training data and computing resources under the premise of complying with privacy and security regulations. It should be understood that the above examples are only for illustration, and the present application can also be used in other multi-regional and multi-user joint learning scenarios, and the present application is not specifically limited.
[0107] The federated learning system provided by the present application can also be applied to federated learning scenarios for heterogeneous model training in multiple regions and for multiple users. Here, heterogeneous models refer to scenarios in which the hyperparameter settings of the training models of each computing node may be different, and the methods of training the models may be different. For example, each hospital has relatively little local cancer patient data, and the performance of the model trained using the local database 121 is very poor. Cancer patient data is highly privacy-sensitive data. In this application scenario, considering the privacy of cancer patients, it is impossible to uniformly upload the cancer patient data of each hospital to the cloud for training. Moreover, the systems used by each hospital are purchased by themselves, so the hyperparameter settings of the training models of each hospital may be different, and the methods of training the models are also different, and are not applicable to the traditional federated learning described above. However, using the federated learning system provided by the present application, such as Figure 3B As shown, the central hospital with strong computing power and the largest amount of tumor patient data can be used as the central node 110, and other hospitals can be used as computing nodes 120. First, the central hospital can use the tumor patient data in the central hospital's database (central database 111) to train multiple first primary models in advance and encrypt them; secondly, each hospital can choose whether to participate in joint learning according to its own situation. Hospitals that confirm to participate in joint learning can obtain the first primary model from the central hospital, and then perform energy enhancement learning based on the tumor data in their respective local databases 121 combined with the first primary model to obtain the first intermediate model. For details, please refer to Figure 3B The incremental learning process described by Hospital 1 is similar to that of Hospital 1. Similarly, the process of Hospitals 2 to N performing incremental learning to generate the first intermediate model based on the first primary model and the local database 121 is the same as that of Hospital 1. Figure 3B Chinese Medicine Hospital 2 to Hospital N did not further describe this step; then, each hospital can encrypt the first intermediate model and send it to the central hospital in its spare time; finally, the central hospital can fuse the multiple first intermediate models received through the model fusion algorithm to obtain a first advanced model with better model performance than the first primary model and each first intermediate model. It can be understood that since the central node obtains the first advanced model by fusing multiple first intermediate models, the problem that traditional joint learning cannot perform joint learning on heterogeneous models is solved. It should be understood that the above examples are for illustration only, and the present application can also be used in other joint learning scenarios of heterogeneous model training in multiple regions and multiple users, and the present application does not make specific limitations.
[0108] The joint learning system provided by the present application can also be applied to multi-region, multi-user, heterogeneous model training and scenarios with no communication bandwidth. Here, no communication bandwidth means that in this scenario, network communication between the computing node and the central node is impossible. For example, the video surveillance data used to train the face recognition network is often stored in the local database 121 of each public security bureau, and the video surveillance data involves the identity information of the user, which is highly private data. The public security bureaus in various places may not allow communication with each other. In this application scenario, considering the user privacy issue, it is impossible to aggregate the local video surveillance data of the public security bureaus in various cities for unified training; at the same time, the algorithm manufacturers cooperating with the public security bureaus in various provinces and cities are also different, which will result in different model architectures and hyperparameter settings for training the face recognition network of each public security bureau system. Therefore, it is not suitable for the traditional joint learning in the aforementioned content. Using the joint learning system provided by the present application, such as Figure 3C As shown, the provincial public security bureau with strong computing power and the largest amount of video surveillance data can be used as the central node 110, and other municipal public security bureaus (branches) or police stations can be used as computing nodes 120. First, the provincial public security bureau can use the video surveillance data in the database of the provincial public security bureau (central database 111) to train a number of first primary models in advance and encrypt them; secondly, each public security bureau can send staff to the provincial public security bureau to burn the first primary model into a CD, and then retrieve it to the public security bureau to which it belongs, so that each public security bureau can use the video surveillance data in its local database 121, combined with the first primary model to perform energy enhancement learning to obtain the first intermediate model. For details, please refer to Figure 3C The incremental learning process described by Public Security Bureau 1 in the figure is the same as that of Public Security Bureau 1. Similarly, the process of Public Security Bureau 2 to Public Security Bureau N performing incremental learning to generate the first intermediate model based on the first primary model and the local database 121 is the same as that of Public Security Bureau 1. Figure 3CPublic Security Bureau 2 to Public Security Bureau N did not further describe this step; then, each public security bureau can encrypt the first intermediate model and send staff to burn it into a CD, and send the burned CD to the Provincial Public Security Department; finally, the Provincial Public Security Department can use the model fusion algorithm to fuse the received multiple first intermediate models, so as to obtain a first advanced model with a model performance stronger than the first primary model and each first intermediate model. It can be understood that the traditional joint learning is that the computing node transmits gradient data to the central node, and it requires multiple iterations until the error converges. Therefore, the computing node needs to transmit gradient data to the central node many times. If there is no communication bandwidth, it will be completely impossible to use manual replacement. The joint learning system provided by this application is that the central node only sends the first primary model data to the computing node once, and the computing node only sends the first intermediate model data to the central node once. Therefore, the communication process between the central node and the computing node can be completely replaced by manual replacement in the application scenario without communication bandwidth, thereby solving the problem that joint learning cannot be performed in the application scenario without communication bandwidth. It should be understood that the above examples are for illustration only, and the present application can also be used in other joint learning scenarios of heterogeneous model training in multiple regions and multiple users, and the present application does not make specific limitations.
[0109] In conjunction with the accompanying drawings, the following detailed introduction is given to how the above-mentioned joint learning system provided by this application solves the problem of using distributed training data and computing resources to train neural networks while complying with privacy and security regulations.
[0110] like Figure 4 As shown, the present application provides a joint learning method, which is applied to a joint learning system, wherein the joint learning system includes one or more computing nodes and one or more central nodes, wherein the computing nodes are located at different geographical locations from the central nodes, and the method includes the following steps:
[0111] S301: The central node 110 sends a first primary model to the computing node 120, and the computing node 120 receives the first primary model sent by the central node, wherein the first primary model is obtained after the central node 110 trains the neural network according to the central database 111 of the central node 110.
[0112] In the embodiment of the present application, before step S301, the central node can use the local central database 111 to train the neural network to obtain a first primary model, where the neural network can be determined according to actual needs. Figure 3CIn the application scenario, the central node (Provincial Public Security Department) needs to train the neural network according to the monitoring data to obtain a face recognition model (i.e., the first primary model). At present, this aspect is very mature in the field of computer vision, and various face recognition network structures have been formed, such as Resnet, DenseNet, GoogleNet, etc. Therefore, the neural network can be selected according to actual needs. For example, the neural network can be Resnet50, and the first primary model can be obtained by training Resnet50 by the central node using the local central database 111. It should be understood that the above examples are only for illustration, and this application does not limit the specific structure of the network to be trained.
[0113] The following is a detailed explanation of the first primary model using the residual network Resnet as an example. Resnet is a special convolutional neural network (CNN). Similar to CNN, Resnet also includes convolutional layers, pooling layers, fully connected layers, and output layers. The convolutional layer is used to extract image features, such as contour features, color features, and texture features, etc. The pooling layer compresses the size of the output image to ensure the high compactness of the image features. The fully connected layer is used to linearly integrate the image features extracted by the convolutional layer and the pooling layer, and output the feature vector for classification. The output layer (or softmax layer) is used to input the feature vector extracted by the fully connected layer into a pre-set prediction function (Softmax), thereby obtaining a probability distribution and determining the final classification result.
[0114] However, Resnet is different from traditional CNN in that in addition to being connected layer by layer, for example, the first fully connected layer is connected to the second fully connected layer, the second fully connected layer is connected to the third fully connected layer, and the third fully connected layer is connected to the fourth fully connected layer (this is a data calculation path of a neural network, which can also be figuratively called neural network transmission). Resnet also has an additional direct branch, which is directly connected from the first fully connected layer to the fourth fully connected layer, that is, skipping the processing of the second and third fully connected layers, and transmitting the data of the first fully connected layer directly to the fourth fully connected layer for calculation. It should be noted that the feature vector output by the fully connected layer can be a feature vector of multiple dimensions, which can be set according to the actual situation. For example, a 256-dimensional feature vector can be output. In the subsequent calculation process, this 256-dimensional feature vector can represent the information contained in each face image. After the 256-dimensional vector is input into the softmax layer, the probability distribution of the category to which the input face image belongs can be obtained. For example, in a five-classification model, the output result of the output layer can be [0.1, 0.1, 0.1, 0.6, 0.1], that is, the prediction result shows that the category described by the face image is the fourth category. It should be understood that the above examples are for illustration only and do not constitute specific limitations.
[0115] Therefore, in the specific training process of Resnet of the above structure, each training data in the central database 111 can be input into the Resnet network, and the prediction results of each training data can be obtained by passing through the convolution layer, the pooling layer, the fully connected layer and the output layer in sequence. Because it is hoped that the prediction result of Resnet is as close as possible to the value that is really desired to be predicted, the weight vector of each layer of the neural network can be updated according to the difference between the two by comparing the prediction value of the current network and the target value that is really desired (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in Resnet). For example, if the prediction value of Resnet is high, the weight vector is adjusted to make it predict lower, and it is continuously adjusted until Resnet can predict the target value that is really desired (that is, the real label of the training data). Therefore, it is necessary to pre-define "how to compare the difference between the predicted value and the target value", which is the loss function (Loss Function) or the objective function (Objective Function), which are important equations for measuring the difference between the predicted value and the target value. Taking the loss function as an example, the higher the output value (Loss) of the loss function, the greater the difference. Therefore, in the training process of Resnet, the weight parameters can be continuously adjusted according to the LOSS between the output prediction result and the target value until the Loss is reduced to a certain threshold, thereby completing the training of the first primary model.
[0116] In an embodiment of the present application, the central node 110 may encrypt and compress the trained first primary model, and then send the encrypted and compressed first primary model to the computing node 120. It can be understood that in the joint learning method provided by the present application, model data rather than gradient data is transmitted between the central node 110 and the computing node 120, and the trained model data cannot restore the original training data. Therefore, at step S301, the trained model can be directly sent to each computing node 120, or the trained model can be encrypted and compressed using an encryption algorithm and a compression algorithm before transmission, thereby further enhancing the privacy protection function and reducing the amount of communication, wherein the encryption algorithm can be an RC6 encryption algorithm, a binary encryption algorithm, etc., and the compression algorithm can be an LZ4 (Lempel-Ziv-4-algorithm) compression algorithm, an LZMA (Lempel-Ziv-Markov chain-Algorithm) compression algorithm, etc., which are not specifically limited in the present application.
[0117] S302: The computing node 120 uses the local database 121 of the computing node 120 to perform incremental learning on the first primary model, thereby obtaining a first intermediate model.
[0118] In an embodiment of the present application, incremental learning can additionally learn data features in the local database on the basis of maintaining the original first primary model, so as to achieve the purpose of improving the performance of the first primary model and obtain the first intermediate model after incremental learning. The specific algorithms used in incremental learning include model fine-tuning, knowledge distillation (KD), etc., which are not specifically limited in this application. The specific implementation method of this step will be explained in detail in steps S3021-S3023 below.
[0119] S303: The computing node 120 sends the first intermediate model to the central node 110.
[0120] It can be understood that, referring to step S301, model data rather than gradient data is transmitted between the central node 110 and the computing node 120, and the trained model data cannot restore the original training data. Therefore, at step S303, the trained first intermediate model can be directly sent to the central node 110, or the trained first intermediate model can be encrypted and compressed using an encryption algorithm and a compression algorithm before being transmitted, thereby further enhancing the privacy protection function and reducing the communication volume. The encryption algorithm can be an RC6 encryption algorithm, a binary encryption algorithm, etc., and the compression algorithm can be an LZ4 compression algorithm, an LZMA compression algorithm, etc., which is not specifically limited in this application.
[0121] S304: The central node 110 performs model fusion on the received multiple first intermediate models to obtain a first high-level model.
[0122] In the specific implementation, the specific algorithms that can be used for model fusion may include multi-teacher demonstration method, voting, averaging, bagging, boosting, stacking, etc., which are not specifically limited in this application. The specific implementation method of this step will be explained in detail in steps S3041 to S3045 below.
[0123] In the embodiment of the present application, referring to the foregoing content, it can be known that in the case of multiple central nodes, step S301 and step S304 can be performed by two different central nodes. Specifically, the central node includes a first central node and a second central node, and the first central node and the second central node are deployed in different geographical areas. The computing node receives the first primary model sent by the central node, including: the computing node receives the first primary model sent by the first central node; the computing node sends the first intermediate model to the central node, including: the computing node sends the first intermediate model to the second central node. The central node sends the first primary model to the computing node, including: the first central node sends the first primary model to the computing node; the central node receives the first intermediate model sent by the computing node, including: the second central node receives the first intermediate model sent by the computing node; the central node performs model fusion on the received multiple first intermediate models to obtain the first advanced model, including: the second central node performs model fusion on the received multiple first intermediate models to obtain the first advanced model. It should be understood that in actual situations, the central node can be one node or two nodes, which can be determined according to the actual situation of the application scenario, and the present application does not specifically limit this.
[0124] In an embodiment of the present application, after the central node performs model fusion on the received multiple first intermediate models to obtain the first advanced model, the method further includes: the central node receives a message sent by the computing node that new data exists in the local database of the computing node; the central node sends a second primary model to the computing node based on the message that new data exists in the local database, wherein the second primary model is the first advanced model; the computing node performs incremental learning on the second primary model in combination with the new data to obtain a second intermediate model; the computing node sends the second intermediate model to the central node; the central node performs model fusion on the received multiple second intermediate models to obtain a second advanced model. In short, in the case where new data exists in the local database of the computing node, the first advanced model trained in step S304 can also be used as the second primary model, and steps S301-S304 are repeated to obtain a second advanced model with better performance.
[0125] It can be understood that the joint learning method provided by the present application solves the problem of using decentralized training data and computing resources to train neural networks under the premise of complying with privacy and security regulations, and shares the computing pressure on the computing nodes, thereby reducing the pressure on the central node, reducing the failure rate of the central node, and improving the efficiency of joint learning. During the entire joint learning process, the central node only needs to send model data to the computing node once, and the computing node only needs to send data to the central node once. The communication volume is very low. If the number of computing nodes S = 50, the number of iterations N = 10000, the model / gradient data size M = 50MB, the proportion of computing nodes participating in the training α = 30%, and the proportion after data compression β = 50%, the theoretical communication volume of the traditional joint learning method and the theoretical communication volume of the joint learning method provided by the present application can be shown in Table 1 below:
[0126] Table 1 Theoretical communication volume of traditional joint learning method and the joint learning method provided by this application
[0127] Federated Learning Methods Tradition This application Theoretical traffic formula T=2αSNβM T=2αSβM The amount of communication required for a complete federated learning 7.15TB 2.44GB
[0128] The communication volume required to complete the joint learning at one time refers to the total communication volume required for two communications: the central node 110 sends the trained first primary model to the computing node 120, and the computing node 120 sends the first intermediate model after incremental learning to the central node 110. As can be seen from the above table, the joint learning method provided by the present application can greatly reduce the amount of data communication. Compared with the traditional joint learning method, the application prospect of the joint learning method provided by the present application is more extensive.
[0129] The following takes the case where the first primary model is Resnet and the incremental learning method selected is knowledge distillation as an example to illustrate the specific process of the computing node 120 performing incremental learning according to the first primary model and the local database 121 in step S302.
[0130] In the traditional neural network training process, the neural network is trained using a data set, and the prediction results are adjusted according to the real labels of the data set during the training process. Therefore, it can be understood that the trained neural network model has learned the "knowledge" in the data set. In the embodiment of the present application, the training data in the local database is predicted using a pre-trained first primary model to obtain a soft target for each training data. During the training of the first intermediate network, the network parameters of the first intermediate network will be adjusted according to the real labels and soft targets at the same time. Therefore, it can be understood that the trained neural network model has not only learned the "knowledge" in the data set, but also learned the "knowledge" of the first primary model, thereby achieving the purpose of incremental learning.
[0131] Therefore, in the embodiment of the present application, the teacher model used in the knowledge distillation algorithm may be the first primary model sent by the central node 110 to the computing node 120, and the student model may be the first intermediate model generated after the computing node performs incremental learning, such as Figure 5 As shown, step S302 can be divided into the following steps:
[0132] S3021: The computing node inputs the training data in the local database into the first network in the first primary model to obtain an output result of the first network, wherein the first primary model includes a first network and a first prediction function, and the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network.
[0133] Referring to the above content, it can be seen that after the training data is input into the first primary model, it will pass through the input layer, convolution layer, pooling layer and fully connected layer in sequence. After the fully connected layer extracts the feature vector, it is input into the first prediction function (i.e., softmax) in the output layer to obtain the final prediction result. Therefore, the first network can include an input layer, a convolution layer, a pooling layer and a fully connected layer. In step S3021, the output result of the first network is the feature vector extracted by the fully connected layer of the first primary model.
[0134] S3022: The computing node inputs the output result of the first network into a soft target prediction function to obtain a soft target of the training data in the local database, wherein the soft target prediction function is obtained based on a temperature parameter and the first prediction function, and the temperature parameter is used to ensure that the soft target obtained by inputting the output result of the first network into the soft target prediction function is not greater than the predicted value of the first primary model obtained by inputting the output result of the first network into the first prediction function.
[0135] It is understandable that the computing node 120 inputs the feature vector extracted by the fully connected layer of the first primary model into the soft target prediction function to obtain the soft target of each training data, so that the training data in the local database 121 of the computing node 120 contains both the corresponding true label and the soft target. Among them, the soft target refers to the output result generated by the teacher network using the soft target prediction function, and the soft target prediction function is obtained based on the temperature parameter T (Temperature) and the first prediction function, and the soft target is used for the first intermediate network to learn the prediction ability of the first primary network. It is understandable that when using the knowledge distillation method for incremental learning, each data in the training data in the local database 121 is labeled with a true label, and the true label can be manually labeled or machine labeled, which is not specifically limited in this application.
[0136] The meaning of the temperature parameter T in knowledge distillation can be explained by the example of running. If an athlete runs with weights every time, then when he takes off the weights and runs normally, he will feel very relaxed and can also run faster than other athletes. Similarly, the temperature parameter T is the weight bag. For a teacher network with a complex structure, it can often get a good learning effect after training, but for a student network with a simple structure, it often cannot get a good learning effect after training. Therefore, in order to help the student network with a simple structure to learn, a temperature parameter T can be added to the softmax of the student network. After adding this temperature parameter, the wrong classification will be "magnified" after softmax, and the correct classification will be "reduced", that is, the difficulty of training is increased. Once T is reset to 1, the classification result will be very close to the classification effect of the teacher network. The soft target prediction function is the softmax containing the temperature parameter T, and the soft target refers to the output result generated by the teacher network using the soft target prediction function.
[0137] Specifically, the formula of the soft target prediction function can be:
[0138]
[0139] Where q is the soft target prediction value obtained by using the soft target prediction function after the training data is input into the model, z is the prediction value obtained by using softmax after the training data is input into the model, and T is the preset distillation learning temperature parameter. The prediction value obtained by softmax is a probability distribution. For example, in a 5-class classification problem, the true classification result of an input image is the 4th category, then the true label of this image can be y = [0, 0, 0, 1, 0]. When the prediction value obtained by the model's softmax is z = [0.1, 0.15, 0.05, 0.6, 0.1], if T = 5, the soft target prediction value can be z = [0.5, 0.51, 0.5, 0.53, 0.5]. Therefore, after adding the temperature parameter T to softmax, the probability distribution of the soft target prediction value q obtained is more moderate and uniform than the prediction value z obtained by softmax, and the neural network adjusts the weight parameters of the network model according to the gap between the predicted value and the true label. Therefore, the training difficulty can be increased by using the soft target predicted by the first primary model (teacher model) to guide the training of the first intermediate model (student model), so that the trained student model can have a higher accuracy of output value when predicted by softmax without the temperature parameter T. The above examples are for illustration only and do not constitute specific limitations.
[0140] S3023: The computing node 120 uses the local database 121 to train the first intermediate network, and obtains a mixed loss function according to the soft target and the true labels of the training data in the local database, wherein the network type of the first intermediate network is the same as the network type of the neural network.
[0141] Specifically, the first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network, the mixed loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network into the soft target prediction function after the computing node inputs the training data in the local database into the second network of the first intermediate network to obtain the output result of the second network and the soft target, the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
[0142] In a specific implementation, the intermediate network has the same network type as the first primary model, but the network structure may be different. Wherein, the network type may be a multi-layer perceptron (Multi-Layer Perceptron, MLP), a convolutional neural network (Convolutional Neural Networks, CNN), a recurrent neural network (Recurrent Neural Network, RNN), a graph neural network (Graph Neural Network, GNN) and a deep belief network (Deep Belief Nets, DBN), etc., which are not specifically limited in this application. Different network structures may refer to that although the first intermediate network and the first primary model are the same network type (such as CNN networks), the first intermediate network and the first primary model have different network layers, different channels (Channel) numbers, different optimization method selections, different training logics, different learning rates, different iterations or different regularization parameters, etc., which are not specifically limited in this application.
[0143] It is understandable that the first intermediate network, as a student network, can have a simpler network structure than the first primary model, such as fewer network layers, fewer iterations, etc. For example, the first primary model (teacher model) can be a residual neural network Resnet101 for face recognition, and the first intermediate model (student model) can be Resnet50 for face detection, wherein the number of network layers of the first primary model is 101, and the number of network layers of the first intermediate model is 50. It is understandable that selecting a first intermediate model with a simpler structure to perform incremental learning on the first primary model and the local database can greatly reduce the processing pressure of the computing nodes, so that the joint learning method provided in the present application can perform incremental learning on the first primary model on a mobile terminal to obtain the first intermediate model, and the application scenarios are more extensive.
[0144] Therefore, the specific process of step S3023 can be as follows Figure 5As shown, firstly, the data in the local database is input into the second network of the first intermediate network to generate the output result of the second network (i.e., the feature vector extracted by the fully connected layer of the first intermediate network), and then the data is input into the soft target prediction function containing the temperature parameter T to generate the soft target prediction value, and the first loss function L1 is generated according to the gap between the soft target prediction value and the soft target, and then the prediction value is generated according to the softmax without the temperature parameter T, and the second loss function L2 is generated according to the gap between the prediction value and the true label, and finally the mixed loss function L during the training of the first intermediate network is determined according to the first loss function L1 and the second loss function L2. Among them, the temperature parameter T of step S3023 is the same as the temperature parameter T of step S3021. In the specific implementation, the mixed loss function L can be the weighted average of the first loss function L1 and the second loss function L2, which can be specifically shown as formula (2):
[0145] L=γL1+(1-γ)L2 (2)
[0146] Among them, γ is the weighting coefficient. The larger the weighting coefficient γ is, the greater the influence of the first loss function L1 generated according to the gap between the soft target prediction value and the soft target on the mixed loss function L. Therefore, in the training process, a larger weighting coefficient γ can be selected in the early stage of training, which helps the student model to quickly imitate the teacher model to identify samples. A smaller weighting coefficient γ is selected in the later stage of training to allow the real label to help identify difficult samples, thereby improving the model performance of the student model while improving the training speed of the student model.
[0147] S3024: The computing node performs back propagation on the first intermediate network according to the hybrid loss function to obtain a trained first intermediate model.
[0148] In an embodiment of the present application, the first intermediate network is back-propagated according to the hybrid loss function L, and the model parameters of the first intermediate network are adjusted according to the hybrid loss function L until the output value of the hybrid loss function L reaches a preset threshold, thereby obtaining an incrementally learned first intermediate model.
[0149] It can be understood that the computing node 120 performs incremental learning through the above-mentioned knowledge distillation method, and the mixed loss function used to control the weight parameter adjustment of the first intermediate network is determined according to the first loss function and the second loss function, the first loss function is determined according to the soft target predicted by the first primary model, and the second loss function is determined according to the real label of the local database, so that the "knowledge" of the teacher network and the "knowledge" of the local data set are learned during the training process of the first intermediate model, and the purpose of incremental learning can be achieved. In addition, the computing node can select the first intermediate network with a simpler structure as the student network for knowledge distillation, which can greatly reduce the processing pressure of the computing node, so that the joint learning method provided by the present application can have a wider range of applications, and can even perform incremental learning on the first primary model on the mobile terminal to obtain a trained first intermediate model. In traditional joint learning, only the central node trains the model, so the computing pressure of the central node is very large. The joint learning method provided by the present application can also share the computing pressure on the computing node, thereby reducing the pressure on the central node, reducing the failure rate of the central node, and improving the efficiency of joint learning.
[0150] The following takes the example where the first primary model is Resnet, the incremental learning method is knowledge distillation, and the model fusion method is multi-teacher demonstration fusion method to explain the model fusion step of step S304 in detail.
[0151] The multi-teacher demonstration fusion method obtains a multi-teacher fusion model by splicing the feature vectors extracted from the fully connected layers of the first intermediate model after multiple incremental learning into one feature vector, and then uses the multi-teacher fusion model as the teacher model in the knowledge distillation algorithm, and the first high-level network as the student network in the knowledge distillation algorithm, and performs knowledge distillation on the first high-level network to obtain a trained first high-level model. During the training process, not only the real labels of the data set are used to adjust the prediction results of the first high-level model, but also the multi-teacher fusion model is used to predict the data set to obtain the soft target of each data, and the prediction results of the first high-level model are adjusted. Therefore, the trained first high-level model not only learns the "knowledge" in the data set, but also learns the "knowledge" of multiple teacher models (which are multiple first intermediate models), thereby achieving the purpose of model fusion.
[0152] like Figure 6 As shown, the specific process of fusing multiple first intermediate models to obtain the first high-level model in step S302 can be divided into the following steps:
[0153] S3041: The central node 110 selects a basic model and m positive improvement models from the multiple first intermediate models. The basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the central node inputs the test data in the central database into the multiple first intermediate models, and the positive improvement model is a model that guides the basic model.
[0154] It is understandable that if the forward improvement model can guide the training of the basic model with the highest prediction accuracy in the first intermediate model and further improve the prediction accuracy of the basic model, then the forward improvement model can definitely guide the training of the first advanced network that has not been trained with the training set, has only a simple neural network structure, or even has no model prediction ability, and improve the prediction accuracy of the first advanced network. Therefore, the method for obtaining the forward improvement model can be as follows: Figure 7 As shown:
[0155] First, the central node 110 converts other first intermediate models (such as Figure 6 The x-dimensional feature vector of the ith first intermediate model in the model is horizontally concatenated with the y-dimensional feature vector of the base model to obtain a concatenated feature vector, which is an x+y-dimensional feature vector, wherein the feature vector may be a feature vector extracted by a fully connected layer, which is used to input softmax to output the final probability distribution. For example, if the feature vector extracted by the fully connected layer of the ith first intermediate model is a 4-dimensional feature vector (1,1,1,1), and the feature vector extracted by the fully connected layer of the base model is an 8-dimensional feature vector (1,2,3,4,5,6,7,8), then after the two feature vectors are horizontally concatenated, a 12-dimensional feature vector (1,1,1,1,1,2,3,4,5,6,7,8) will be obtained.
[0156] Secondly, the concatenated feature vector is subjected to dimensionality reduction processing so that the dimension of the concatenated feature vector is consistent with the dimension of the feature vector extracted by the basic model. In other words, the concatenated x+y-dimensional feature vector is subjected to dimensionality reduction processing to obtain a y-dimensional feature vector. In a specific implementation, the concatenated feature vector can be subjected to dimensionality reduction processing by a principal component analysis algorithm (PCA), or by other dimensionality reduction algorithms, which are not specifically limited in this application.
[0157] Finally, the spliced feature vector is input into the softmax of the basic model to obtain the spliced prediction result, and the prediction accuracy of the x-th first intermediate model after feature splicing with the basic model is determined according to the prediction result. When the prediction accuracy after feature splicing is higher than the prediction accuracy of the basic model, the x-th first intermediate model is confirmed as a positive boosting model, and so on. m qualified positive boosting models can be screened out from the multiple first intermediate models.
[0158] It should be understood that Figure 7 The positive improvement model confirmation method shown is only for illustration. In a specific implementation, other methods may be used to screen multiple first intermediate models to determine a positive improvement model that can serve as a teacher model for the first high-level network. This application does not make any specific limitations.
[0159] It should be noted that step S3041 is used to select m models from the first intermediate model that are suitable as teacher models for knowledge distillation of the first advanced network, so that the structure of the multi-teacher fusion model can be reduced and the time required for training the first advanced model can be reduced. In the specific implementation, step S3041 can also be omitted, and multiple first intermediate models can be directly used as forward improvement models to execute step S3042. Whether step S3041 is executed can be confirmed based on actual conditions, and this application does not make specific limitations.
[0160] S3042: A multi-teacher fusion model is obtained based on m forward boosting models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the m forward boosting models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first advanced model.
[0161] For example, if Figure 8As shown, the multi-teacher fusion model can include m forward lifting models, and the multi-teacher fusion model can horizontally splice the x1-dimensional feature vector extracted by the fully connected layer of the first forward lifting model, the x2-dimensional feature vector extracted by the fully connected layer of the second forward lifting model, ..., and the xm-dimensional feature vector extracted by the fully connected layer of the mth forward lifting model, so as to obtain a (x1+x2+...+xm)-dimensional feature vector, and the multi-teacher fusion model will determine the prediction result of the input data according to the (x1+x2+...+xm)-dimensional feature vector. It should be understood that the multi-teacher fusion model composed of m forward lifting models will be used as a teacher model to perform knowledge distillation on the first high-level network in the knowledge distillation step of the next step S3043-step S3045, so as to obtain the final first high-level model, so that the trained first high-level model can not only learn the "knowledge" in the data set, but also learn the "knowledge" of the m forward lifting models, so as to achieve the purpose of model fusion.
[0162] S3043: Use the multi-teacher fusion model to predict the central database 111 to obtain the soft target of each training data. The definition and determination method of the soft target can refer to step S3021 in the above embodiment, which will not be elaborated here.
[0163] S3044: Use the central database to train the basic model to obtain the mixed loss function L. For details, please refer to step S3022 in the aforementioned content, which will not be elaborated here.
[0164] S3045: Back-propagate the first high-level network according to the hybrid loss function L to obtain a trained first high-level model. For details, please refer to step S3023 in the aforementioned content, which will not be elaborated here.
[0165] For example, if the joint learning system only includes one central node H and one computing node A, the central database of the central node H includes 670,000 IDs and 50 million images, and the local database of the computing node A includes 620,000 IDs and 6 million images. First, the first primary model H is trained using the local database, and the model structure can select the Resnet network in the aforementioned content; then the first primary model H is sent to the computing node A, and the computing node A can perform incremental learning on the first primary model H according to the local database (such as the knowledge distillation method described in steps S3021-S3024 in the aforementioned content) to obtain the first intermediate model A; then the computing node A can send the first intermediate model A after incremental learning to the central node H; finally, the central node H can perform model fusion on the first intermediate model A and the first primary model H (such as the multi-teacher teaching fusion method in steps S3041-S3045 in the aforementioned content) to obtain a model fused model H'. After testing the first primary model H, the first intermediate model A and the first advanced model H' using the test set of node H and node A, the test results are shown in Table 2 below:
[0166] Table 2 Test of face recognition model based on 1 central node and 1 computing node
[0167] Model Central node H test results Compute node A test results Average results Model H 92.29% 93.06% 92.68% Model A 91.72% 94.38% 93.05% Model H' 92.63% 93.56% 93.10%
[0168] It can be seen from the above table that the joint learning method provided in this application can not only solve the problem of using distributed training data and computing resources to train neural networks under the premise of complying with privacy and security regulations at a low communication cost, but also improve the model performance of the trained neural network.
[0169] In summary, the use of the joint learning method provided by this application not only solves the problem of using decentralized training data and computing resources to train neural networks under the premise of complying with privacy and security regulations, but also during the entire joint learning process, the central node can at least send the first primary model data to the computing node once, and the computing node can at least send the first intermediate model data to the central node once to complete the joint learning process, so that the number of communication resources occupied by the entire joint learning process is extremely small. In addition, since the server obtains the model after joint learning through the model fusion algorithm, when each computing node performs incremental learning, the first intermediate network structure used for training in combination with the local database can be free of any restrictions, making the application scenarios applicable to this application more extensive.
[0170] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, correspondingly, related equipment for cooperating in implementing the above scheme is also provided below.
[0171] Fig. 9 is a schematic diagram of a computing node 800 provided in the present application, wherein the computing node 800 is applied to Figure 2 In the joint learning system 100 shown, the computing node 800 may be the computing node 120 in the foregoing content, and the computing node includes a receiving unit 810, a learning unit 820, a sending unit 830, and a local database 840, wherein:
[0172] The receiving unit 810 is used to receive a first primary model sent by a central node, wherein the first primary model is obtained after the central node trains a neural network according to a central database of the central node;
[0173] The learning unit 820 is used to use the local database 840 of the computing node to perform incremental learning on the first primary model to obtain a first intermediate model, wherein the learning unit 820 can be Figure 2 In the incremental learning module 122 of the embodiment, the local database 840 may be Figure 2 The local database 121 in the embodiment;
[0174] The sending unit 830 is used to send the first intermediate model to the central node, so that the central node performs model fusion on the received multiple first intermediate models to obtain a first high-level model.
[0175] In an embodiment of the present application, the learning unit 820 is used to input the training data in the local database into the first network in the first primary model to obtain the output result of the first network, wherein the first primary model includes a first network and a first prediction function; the learning unit 820 is used to input the output result of the first network into a soft target prediction function to obtain a soft target of the training data in the local database, wherein the output result of the first network is input into the soft target prediction function to obtain a soft target of the training data in the local database, wherein the soft target prediction function is obtained according to a temperature parameter and the first prediction function, and the temperature parameter is used to make the soft target obtained by inputting the output result of the first network into the soft target prediction function not greater than the predicted value of the first primary model obtained by inputting the output result of the first network into the first prediction function; the learning unit 820 is used to train the first intermediate network using the local database, and obtain a mixed loss function according to the soft target and the true label of the training data in the local database, wherein the network type of the first intermediate network is the same as the network type of the neural network; the learning unit 820 is used to back propagate the first intermediate network according to the mixed loss function to obtain a trained first intermediate model.
[0176] In an embodiment of the present application, the first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network, the mixed loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network of the first intermediate network into the soft target prediction function after the computing node inputs the training data in the local database to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
[0177] In an embodiment of the present application, the first high-level model is obtained after the central node obtains a multi-teacher fusion model based on the multiple first intermediate models, and uses the central database of the central node to perform incremental learning on the multi-teacher fusion model, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the multiple first intermediate models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first high-level model.
[0178] In an embodiment of the present application, the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of m forward boosting models, and the m forward boosting models are obtained based on the multiple first intermediate models. The forward boosting model is a model that guides the basic model, and the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the test data in the central database is input into the multiple first intermediate models.
[0179] In an embodiment of the present application, the receiving unit 810 is also used to send the first intermediate model to the central node, so that the central node performs model fusion on the multiple first intermediate models received to obtain the first high-level model. Then, when there is new data in the local database, the receiving unit receives the second primary model sent by the central node, wherein the second primary model is the first high-level model; the learning unit 820 is also used to perform incremental learning on the second primary model in combination with the new data to obtain a second intermediate model; the sending unit 830 is also used to send the second intermediate model to the central node, so that the central node performs model fusion on the multiple updated second intermediate models received to obtain a second high-level model.
[0180] In an embodiment of the present application, the one or more central nodes include a first central node and a second central node, and the receiving unit 810 is also used to receive a first primary model sent by the first central node; the sending unit 830 is also used to send the first intermediate model to the second central node, so that the second central node performs model fusion on the received multiple first intermediate models to obtain a first advanced model.
[0181] Fig.10 is a schematic diagram of the structure of a central node 900 provided in the present application, wherein the central node 900 may be the central node 110 in the aforementioned content, such as Fig.10 As shown, the central node 900 can be applied to Figure 2 In the joint learning system 100 shown, the central node 900 includes a sending unit 910, a receiving unit 920, a fusion unit 930, and a central database 940, wherein:
[0182] The sending unit 910 is used to send a first primary model to the computing node, wherein the first primary model is obtained after the central node trains the neural network according to the central database 940 of the central node;
[0183] The receiving unit 920 is used to receive a first intermediate model sent by the computing node, wherein the first intermediate model is obtained by the computing node after performing incremental learning on the first primary model using a local database of the computing node;
[0184] The fusion unit 930 is used to perform model fusion on the received plurality of the first intermediate models to obtain a first high-level model. Figure 2 The model fusion module 113 in the embodiment, the central database 940 can be the central database 111 in the aforementioned content.
[0185] In an embodiment of the present application, the first intermediate model is that after the computing node inputs the training data in the local database into the first network in the first primary model to obtain the output result of the first network, and inputs the output result of the first network into the soft target prediction function to obtain the soft target of the training data in the local database, the first intermediate network is trained using the local database, a mixed loss function is obtained according to the soft target and the true label of the training data in the local database, and the first intermediate network is back-propagated according to the mixed loss function to obtain the first intermediate model, wherein the first primary model includes a first network and a first prediction function, the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network, and the soft target prediction function is obtained according to a temperature parameter and the first prediction function, and the temperature parameter is used to make the soft target obtained by inputting the output result of the first network into the soft target prediction function not greater than the prediction value of the first primary model obtained by inputting the output result of the first network into the first prediction function.
[0186] In an embodiment of the present application, the first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network, the mixed loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network of the first intermediate network into the soft target prediction function after the computing node inputs the training data in the local database to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
[0187] In an embodiment of the present application, the fusion unit 930 is used to obtain a multi-teacher fusion model based on the multiple first intermediate models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the multiple first intermediate models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first high-level model; the fusion unit 930 is used to use the central database 940 to perform incremental learning on the multi-teacher fusion model to obtain the first high-level model.
[0188] In an embodiment of the present application, the fusion unit 930 is used to screen out a basic model and m forward improvement models from multiple first intermediate models, wherein the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the central node inputs the test data in the central database 940 into the multiple first intermediate models, and the forward improvement model is a model that guides the basic model; the fusion unit 930 is used to obtain the multi-teacher fusion model based on the m forward improvement models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the m forward improvement models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first high-level model.
[0189] In an embodiment of the present application, the receiving unit 920 is also used to receive a message sent by the computing node that new data exists in the local database of the computing node after performing model fusion on the multiple first intermediate models received to obtain a first advanced model; the sending unit 910 is also used to send a second primary model to the computing node based on the message that new data exists in the local database, so that the computing node performs incremental learning on the second primary model in combination with the new data to obtain a second intermediate model, wherein the second primary model is the advanced model; the receiving unit 920 is also used to receive the second intermediate model sent by the computing node; the fusion unit 930 is also used to perform model fusion on the multiple second intermediate models received to obtain a second advanced model.
[0190] In an embodiment of the present application, the central node 900 includes a first central node and a second central node, the first central node and the second central node are deployed in different geographical areas, the first central node includes the sending unit 910, and the second central node includes the receiving unit 920 and the fusion unit 930.
[0191] It can be understood that the use of the joint learning method provided by this application not only solves the problem of using decentralized training data and computing resources to train neural networks under the premise of complying with privacy and security regulations, but also during the entire joint learning process, the central node only needs to send the first primary model data to the computing node once, and the computing node only needs to send the first intermediate model data to the central node once. The number of communication resources occupied by the entire joint learning process is extremely small. In addition, since the server obtains the model after joint learning through the model fusion algorithm, when each computing node performs incremental learning, the first intermediate network structure used for training in combination with the local database can be free of any restrictions, making the application scenarios applicable to this application more extensive.
[0192] See also Fig.11 , Fig.11 This is a chip hardware structure diagram provided by this application. The chip is an NPU chip, in which: Figure 2-Figure 8 In the embodiment, the algorithm of the neural network (such as the training of the first primary model, the knowledge distillation of the first intermediate model, and the model fusion algorithm of the first advanced model, etc.) can be found in Fig.11 The NPU chip shown is implemented in the figure.
[0193] like Fig.11 As shown, NPU 50 is mounted on the host CPU as a coprocessor, and tasks are assigned by the host CPU. The core part of NPU is the operation circuit 50, which controls the operation circuit 503 through the controller 504 to extract matrix data in the memory and perform multiplication operations.
[0194] In some implementations, the operation circuit 503 includes multiple processing units (Process Engine, PE) inside. In some implementations, the operation circuit 503 is a two-dimensional systolic array. The operation circuit 503 can also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the operation circuit 503 is a general-purpose matrix processor.
[0195] For example, assume there is an input matrix A, a weight matrix B, and an output matrix C. The operation circuit takes the corresponding data of matrix B from the weight memory 502 and caches it on each PE in the operation circuit. The operation circuit takes the matrix A data from the input memory 501 and performs matrix operation with matrix B, and the partial result or final result of the matrix is stored in the accumulator 508.
[0196] The unified memory 506 is used to store input data and output data. The weight data is directly transferred to the weight memory 502 through the direct memory access controller (DMAC) 505. The input data is also transferred to the unified memory 506 through the DMAC 505.
[0197] The bus interface unit (BIU) 510 is used for the interaction between the AXI (Advanced eXtensible Interface) bus and the DMAC 505 and the instruction fetch buffer (IFB) 509. Specifically, it is used for the instruction fetch buffer 509 to obtain instructions from the external memory, and it is also used for the storage unit access controller 505 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
[0198] DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 506 or to transfer weight data to the weight memory 502 or to transfer input data to the input memory 501.
[0199] The vector calculation unit 507 has multiple operation processing units, which further process the output of the operation circuit when necessary, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional / FC layer network calculations in neural networks, such as Pooling, Batch Normalization, Local Response Normalization, etc.
[0200] In some implementations, the vector calculation unit can 507 store the processed output vector to the unified memory 506. For example, the vector calculation unit 507 can apply a nonlinear function to the output of the operation circuit 503, such as a vector of accumulated values, to generate an activation value. In some implementations, the vector calculation unit 507 generates a normalized value, a merged value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 503, such as for use in a subsequent layer in a neural network.
[0201] The instruction fetch memory 509 connected to the controller 504 is used to store instructions used by the controller 504;
[0202] The unified memory 506, the input memory 501, the weight memory 502 and the instruction fetch memory 509 are all on-chip memories. The external memory is private to the NPU hardware architecture.
[0203] in, Figure 2 – Figure 8 In an embodiment, operations of each network layer of the first primary model, the first intermediate model, and the first advanced model may be performed by the matrix calculation unit 212 or the vector calculation unit 507 .
[0204] Fig.12 The structure diagram of an electronic device 1200 provided in an embodiment of the present application is shown in FIG. The electronic device 1200 may be a central node or a computing node in the foregoing content. Fig.12As shown, the electronic device 1200 includes: a processor 1210, a communication interface 1220, a memory 1230, a neural network processor 1240 and a bus 1250. Among them, the processor 1210, the communication interface 1220, the memory 1230 and the neural network processor 1240 can be interconnected through the internal bus 1250, and can also communicate through other means such as wireless transmission. The embodiment of the present application takes the connection through the bus 1250 as an example. The bus 1250 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 1250 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0205] The processor 1210 may be composed of one or more general-purpose processors, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 1210 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 1230, which enables the electronic device 1200 to provide a wide variety of services.
[0206] In the case where the electronic device 1200 is the central node in the aforementioned content, the processor 1210 may include a fusion unit, which may implement processing functions by calling the program code in the memory 1230, including Figure 2 The functions described in the model fusion module 113 and Fig.10 The functions described by the fusion unit 930 in the embodiment, for example, performing model fusion according to multiple first intermediate models to obtain a first high-level model, can be specifically used to execute steps S3041 to S3045 of the aforementioned method and its optional steps, and can also be used to execute Figure 6-Figure 8 The other steps described in the embodiment will not be described in detail here.
[0207] In the case where the electronic device 1200 is a computing node in the aforementioned content, the processor 1210 may include a learning unit, which may implement processing functions by calling program codes in the memory 1230, including Figure 2 The functions described in the incremental learning module 122 and Fig. 9 The functions described in the intermediate learning unit 820, for example, incrementally learning the first primary model according to the local database to obtain the first intermediate model, can be used to execute steps S3021 to S3023 of the aforementioned method and their optional steps, and can also be used to execute Figure 4-Figure 8 The other steps described in the embodiment will not be described in detail here.
[0208] The memory 1230 may include a volatile memory (Volatile Memory), such as a random access memory (Random Access Memory, RAM); the memory 1230 may also include a non-volatile memory (Non-Volatile Memory), such as a read-only memory (Read-Only Memory, ROM), a flash memory (Flash Memory), a hard disk drive (Hard Disk Drive, HDD) or a solid-state drive (SSD); the memory 1230 may also include a combination of the above types.
[0209] In the case where the electronic device 1200 is the central node in the foregoing content, the memory 1230 may store Figure 2 The central database 111 or Fig.10 The central database 940 in the embodiment includes training data and test data. The training data is used to train the first primary model, to fuse the model according to the multiple first intermediate models to obtain the first advanced model, etc. The test data is used to test the intermediate model to obtain the basic model with the highest prediction accuracy, etc. The memory 1230 can also store program code. The program code can be the code for training the first primary model, the code for compressing / decompressing the model, the code for fusing the model of the multiple first intermediate models, etc., and can also include other codes for executing Figure 2-Figure 8 The program codes of other steps described in the embodiment will not be described in detail here.
[0210] In the case where the electronic device 1200 is a computing node in the aforementioned content, the memory 1230 may store Figure 2 The local database 121 in the embodiment or Fig. 9The local database 840 in the embodiment includes training data for incremental learning of the first primary model to obtain the first intermediate model, etc.; the memory 1230 may also store application code. The program code may be incremental learning code, compression / decompression model code, etc., and may also include other codes for executing Figure 2-Figure 8 The program codes of other steps described in the embodiment will not be described in detail here.
[0211] The neural network processor 1240 can be used to execute various neural network algorithms (such as the training of the first primary model, the knowledge distillation of the first intermediate model, and the model fusion algorithm of the first high-level model, etc.) through the program code of the memory 1230 and the training data in the central database or the local database to execute at least a part of the method discussed herein. The hardware structure of the neural network processor 1240 can be specifically referred to in Fig.11 , I will not go into details here.
[0212] The communication interface 1220 can be a wired interface (such as an Ethernet interface), an internal interface (such as a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface) for communicating with other devices or modules.
[0213] Need to explain, Fig.12 This is only a possible implementation of the embodiment of the present application. In practical applications, the electronic device may also include more or fewer components, which is not limited here. Figure 2-Figure 8 The relevant explanations in the embodiments are not repeated here.
[0214] It should be understood that Fig.12 The electronic device shown may also be a computer cluster composed of multiple servers, which is not specifically limited in this application.
[0215] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a processor, Figure 2-Figure 8 The method flow shown is realized.
[0216] The present application also provides a computer program product. When the computer program product is run on a processor, Figure 2-Figure 8 The method flow shown is realized.
[0217] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center containing one or more available media sets. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD), or a semiconductor medium. The semiconductor medium may be an SSD.
[0218] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method of joint learning, characterized in that: Applied to a joint learning system, the joint learning system includes one or more computing nodes and one or more central nodes, the method includes: The computing node receives a first primary model sent by the central node, wherein the first primary model is obtained after the central node trains the neural network according to the central database of the central node; The computing node uses a local database of the computing node to perform incremental learning on the first primary model to obtain a first intermediate model; The computing node sends the first intermediate model to the central node, so that the central node performs model fusion on the received multiple first intermediate models to obtain a first advanced model, wherein the first advanced model is obtained after the central node obtains a multi-teacher fusion model based on the multiple first intermediate models, and uses the central database of the central node to perform incremental learning on the multi-teacher fusion model, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of m forward boosting models, the m forward boosting models are obtained based on the multiple first intermediate models, the forward boosting model is a model that guides the basic model, the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the test data in the central database is input into the multiple first intermediate models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first advanced model.
2. The method according to claim 1, characterized in that The computing node uses a local database of the computing node to perform incremental learning on the first primary model to obtain a first intermediate model, including: The computing node inputs the training data in the local database into the first network in the first primary model to obtain an output result of the first network, wherein the first primary model includes a first network and a first prediction function, and the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network; The computing node inputs the output result of the first network into a soft target prediction function to obtain a soft target of the training data in the local database, wherein the soft target prediction function is obtained according to a temperature parameter and the first prediction function, and the temperature parameter is used to ensure that the soft target obtained by inputting the output result of the first network into the soft target prediction function is not greater than a predicted value of the first primary model obtained by inputting the output result of the first network into the first prediction function; The computing node trains a first intermediate network using the local database, and obtains a mixed loss function according to the soft target and the true label of the training data in the local database, wherein the network type of the first intermediate network is the same as the network type of the neural network; The computing node performs back propagation on the first intermediate network according to the hybrid loss function to obtain the first intermediate model.
3. The method according to claim 2, characterized in that The first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network, the mixed loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network of the first intermediate network into the soft target prediction function after the computing node inputs the training data in the local database to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
4. The method according to any one of claims 1 to 3, characterized in that: The computing node sends the first intermediate model to the central node, so that the central node performs model fusion on the received multiple first intermediate models to obtain the first high-level model, and the method further includes: The computing node receives, when new data exists in the local database, a second primary model sent by the central node, wherein the second primary model is the first advanced model; The computing node performs incremental learning on the second primary model in combination with the new data to obtain a second intermediate model; The computing node sends the second intermediate model to the central node, so that the central node performs model fusion on the received multiple updated second intermediate models to obtain a second high-level model.
5. The method according to any one of claims 1 to 3, characterized in that: The one or more central nodes include a first central node and a second central node, the first central node and the second central node are deployed in different geographical areas, and the computing node receives the first primary model sent by the central node, comprising: The computing node receives a first primary model sent by a first central node; The computing node sends the first intermediate model to the central node, so that the central node performs model fusion on the received plurality of the first intermediate models to obtain a first high-level model, including: The computing node sends the first intermediate model to the second central node, so that the second central node performs model fusion on the received multiple first intermediate models to obtain a first high-level model.
6. A method of joint learning, characterized in that: Applied to a joint learning system, the joint learning system includes one or more computing nodes and one or more central nodes, the method includes: The central node sends a first primary model to the computing node, wherein the first primary model is obtained after the central node trains the neural network according to the central database of the central node; The central node receives a first intermediate model sent by the computing node, wherein the first intermediate model is obtained by the computing node after performing incremental learning on the first primary model using a local database of the computing node; The central node selects a basic model and m forward improvement models from the multiple first intermediate models, wherein the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the central node inputs the test data in the central database into the multiple first intermediate models, and the forward improvement model is a model that guides the basic model; The central node obtains a multi-teacher fusion model according to the m forward lifting models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the m forward lifting models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first advanced model; The central node uses the central database to perform incremental learning on the multi-teacher fusion model to obtain the first advanced model.
7. The method according to claim 6, characterized in that The first intermediate model is that the computing node inputs the training data in the local database into the first network in the first primary model to obtain the output result of the first network, and inputs the output result of the first network into the soft target prediction function to obtain the soft target of the training data in the local database, and then uses the local database to train the first intermediate network, obtains a mixed loss function according to the soft target and the true label of the training data in the local database, and back-propagates the first intermediate network according to the mixed loss function to obtain the first intermediate model, wherein the first primary model includes a first network and a first prediction function, the first prediction function is used to generate a predicted value of the first primary model according to the output result of the first network, and the soft target prediction function is obtained according to a temperature parameter and the first prediction function, and the temperature parameter is used to make the soft target obtained by inputting the output result of the first network into the soft target prediction function not greater than the predicted value of the first primary model obtained by inputting the output result of the first network into the first prediction function.
8. The method according to claim 7, characterized in that The first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network, the mixed loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network of the first intermediate network into the soft target prediction function after the computing node inputs the training data in the local database to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
9. The method according to any one of claims 6 to 8, characterized in that: After the central node performs model fusion on the received plurality of the first intermediate models to obtain a first high-level model, the method further includes: The central node sends a second primary model to the computing node, so that the computing node performs incremental learning on the second primary model in combination with new data in the local database to obtain a second intermediate model, wherein the second primary model is the advanced model; The central node receives the second intermediate model sent by the computing node; The central node performs model fusion on the received multiple second intermediate models to obtain a second high-level model.
10. The method according to any one of claims 6 to 8, characterized in that: The one or more central nodes include a first central node and a second central node, and the central node sending the first primary model to the computing node includes: The first central node sends a first primary model to the computing node, wherein the first primary model is obtained after the first central node trains a neural network according to a central database of the first central node; The central node receiving the first intermediate model sent by the computing node includes: The second central node receives the first intermediate model sent by the computing node; The central node performs model fusion on the received plurality of the first intermediate models to obtain a first advanced model, including: The second central node performs model fusion on the received multiple first intermediate models to obtain the first high-level model.
11. A computing node, characterized in that: Applied to a joint learning system, the joint learning system includes one or more computing nodes and one or more central nodes, the computing node includes a receiving unit, a learning unit and a sending unit, wherein: The receiving unit is used to receive a first primary model sent by a central node, wherein the first primary model is obtained after the central node trains a neural network according to a central database of the central node; The learning unit is used to perform incremental learning on the first primary model using the local database of the computing node to obtain a first intermediate model; The sending unit is used to send the first intermediate model to the central node, so that the central node performs model fusion on the received multiple first intermediate models to obtain a first advanced model, wherein the first advanced model is obtained after the central node obtains a multi-teacher fusion model based on the multiple first intermediate models, and uses the central database of the central node to perform incremental learning on the multi-teacher fusion model, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of m forward boosting models, the m forward boosting models are obtained based on the multiple first intermediate models, the forward boosting model is a model that guides the basic model, the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the test data in the central database is input into the multiple first intermediate models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first advanced model.
12. The node according to claim 11, characterized in that: The learning unit is used to input the training data in the local database into the first network in the first primary model to obtain the output result of the first network, wherein the first primary model includes a first network and a first prediction function, and the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network; The learning unit is used to input the output result of the first network into a soft target prediction function to obtain a soft target of the training data in the local database, wherein the soft target prediction function is obtained according to a temperature parameter and the first prediction function, and the temperature parameter is used to ensure that the soft target obtained by inputting the output result of the first network into the soft target prediction function is not greater than the predicted value of the first primary model obtained by inputting the output result of the first network into the first prediction function; The learning unit is used to train the first intermediate network using the local database, and obtain a mixed loss function according to the soft target and the true label of the training data in the local database, wherein the network type of the first intermediate network is the same as the network type of the neural network; The learning unit is used to perform back propagation on the first intermediate network according to the mixed loss function to obtain a trained first intermediate model.
13. The node according to claim 12, characterized in that: The first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network, the mixed loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network of the first intermediate network into the soft target prediction function after the computing node inputs the training data in the local database to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
14. The node according to any one of claims 11 to 13, characterized in that: The receiving unit is further configured to send the first intermediate model to the central node so that the central node performs model fusion on the received multiple first intermediate models to obtain a first advanced model. Then, when new data exists in the local database, the receiving unit receives a second primary model sent by the central node, wherein the second primary model is the first advanced model. The learning unit is further used to perform incremental learning on the second primary model in combination with the new data to obtain a second intermediate model; The sending unit is also used to send the second intermediate model to the central node, so that the central node performs model fusion on the received multiple updated second intermediate models to obtain a second high-level model.
15. The node according to any one of claims 11 to 13, characterized in that: The one or more central nodes include a first central node and a second central node, and the receiving unit is further used to receive a first primary model sent by the first central node; The sending unit is also used to send the first intermediate model to the second central node, so that the second central node performs model fusion on the received multiple first intermediate models to obtain a first high-level model.
16. A central node, characterized in that: Applied to a joint learning system, the joint learning system includes one or more computing nodes and one or more central nodes, the central node includes a sending unit, a receiving unit and a fusion unit, wherein: The sending unit is used to send a first primary model to the computing node, wherein the first primary model is obtained after the central node trains the neural network according to the central database of the central node; The receiving unit is used to receive a first intermediate model sent by the computing node, wherein the first intermediate model is obtained after the computing node performs incremental learning on the first primary model using a local database of the computing node; The fusion unit is used to select a basic model and m forward improvement models from the multiple first intermediate models, wherein the basic model is the model with the highest prediction accuracy among the multiple first intermediate models after the central node inputs the test data in the central database into the multiple first intermediate models, and the forward improvement model is a model that guides the basic model; The fusion unit is used to obtain a multi-teacher fusion model according to the m forward lifting models, wherein the feature vector extracted by the fully connected layer of the multi-teacher fusion model is obtained by concatenating and reducing the dimension of the feature vectors extracted by the fully connected layers of the m forward lifting models, and the feature vector extracted by the fully connected layer of the multi-teacher fusion model has the same dimension as the feature vector of the first advanced model; The fusion unit is used to use the central database to perform incremental learning on the multi-teacher fusion model to obtain the first advanced model.
17. The node according to claim 16, characterized in that: The first intermediate model is that after the computing node inputs the training data in the local database into the first network in the first primary model to obtain the output result of the first network, and inputs the output result of the first network into the soft target prediction function to obtain the soft target of the training data in the local database, the first intermediate network is trained using the local database, a mixed loss function is obtained according to the soft target and the true label of the training data in the local database, and the first intermediate network is back-propagated according to the mixed loss function to obtain the first intermediate model, wherein the first primary model includes a first network and a first prediction function, the first prediction function is used to generate a prediction value of the first primary model according to the output result of the first network, the soft target prediction function is obtained according to a temperature parameter and the first prediction function, and the temperature parameter is used to make the soft target obtained by inputting the output result of the first network into the soft target prediction function not greater than the prediction value of the first primary model obtained by inputting the output result of the first network into the first prediction function.
18. The node according to claim 17, characterized in that: The first intermediate network includes a second network and a second prediction function, the second prediction function is used to generate a prediction value of the first intermediate network according to the output result of the second network, the mixed loss function is determined according to the first loss function and the second loss function, the first loss function is determined by the difference between the soft target prediction value generated by inputting the output result of the second network of the first intermediate network into the soft target prediction function after the computing node inputs the training data in the local database to obtain the output result of the second network and the soft target, and the second loss function is determined by the difference between the prediction value generated by inputting the output result of the second network into the second prediction function and the true label.
19. The node according to any one of claims 16 to 18, characterized in that: The receiving unit is further configured to receive a message sent by the computing node indicating that new data exists in the local database of the computing node after the plurality of first intermediate models received are subjected to model fusion to obtain a first high-level model; The sending unit is further configured to send a second primary model to the computing node according to a message that new data exists in the local database, so that the computing node performs incremental learning on the second primary model in combination with the new data to obtain a second intermediate model, wherein the second primary model is the advanced model; The receiving unit is also used to receive the second intermediate model sent by the computing node; The fusion unit is also used to perform model fusion on the received multiple second intermediate models to obtain a second high-level model.
20. A joint learning system, characterized in that: The system comprises one or more central nodes as claimed in any one of claims 16 to 19 and one or more computing nodes as claimed in any one of claims 11 to 15.
21. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computing device, cause the computing device to perform the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Multi-level fusion document classification method and system based on deep learning
CN109492108A
Model compression method and device, electronic equipment and computer storage medium
CN109711544A
Transverse federated learning method, device and equipment and computer storage medium
CN110263936A
Model training method and device based on federated learning and server
CN110442457A
Federated deep learning method capable of adaptively protecting privacy
CN110443063A
