Cross-sample federated classification modeling method and device, storage medium, and electronic device

Through the cross-sample federated classification modeling method based on neural networks and knowledge distillation, the problem of neural network training under the constraints of data privacy and communication complexity is solved, the effect of efficient training of artificial neural networks in federated scenarios is achieved, and computing resources are reduced and communication costs.

CN113408209BActive Publication Date: 2024-10-01TONGDUN NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110718810.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-28
Publication Date
2024-10-01
Estimated Expiration
2041-06-28

AI Technical Summary

Technical Problem

Under the constraints of data privacy and communication complexity, it is difficult for existing technologies to effectively train artificial neural networks, especially in scenarios where data is scattered in different organizations. It is difficult to ensure training effects and reduce computing resources and communication costs.

Method used

A cross-sample federated classification modeling method based on neural network and knowledge distillation is adopted. By obtaining label standard information and local training data, the structure is customized and parameters are initialized, the predicted label vector is trained and knowledge distilled, and the soft label vector is sent for federated training. , ensuring data privacy and reducing communication costs.

Benefits of technology

While ensuring data privacy, artificial neural networks are trained by sharing data to reduce computing resources and communication costs, improve training effects, prevent model overfitting or underfitting, and achieve better classification capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113408209B_ABST
    Figure CN113408209B_ABST
Patent Text Reader

Abstract

The present disclosure belongs to the field of federated learning technology, and relates to a cross-sample federated classification modeling method and device based on neural networks and knowledge distillation, a storage medium, and an electronic device. The method includes: obtaining label standard information to be formulated for the federated classification modeling task, and performing structural customization and parameter initialization processing on the local neural network model of the federated classification modeling task; training the local neural network model to obtain a predicted label vector, and performing knowledge distillation processing on the predicted label vector to obtain a soft label vector; obtaining the federated modeling parameters corresponding to the federated classification modeling task, and sending the local soft label vector of each category to the coordinator; receiving the federated label vector returned by the coordinator, and continuing to train the local neural network model to complete the training and obtain a federated classification modeling model. The present disclosure ensures data privacy and uses the "knowledge" provided by the data of all federated participants to obtain a better federated classification modeling model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of federated learning technology, and in particular to a cross-sample federated modeling method and device based on neural network and knowledge distillation, a storage medium, and an electronic device. Background Art

[0002] With the deepening of deep learning research and the development of computer equipment, artificial neural networks are widely used in the field of computer artificial intelligence. In order to ensure that the trained artificial neural network has good performance, a large amount of data is usually required for training.

[0003] However, in some scenarios, the training data is scattered among different organizations or institutions. For data privacy reasons, it is impossible to meet the training needs of artificial neural networks through data sharing. Even if artificial neural networks can be trained through shared data, the requirements for communication and transmission complexity of training data are difficult to meet, and the training effect of artificial neural networks cannot be guaranteed.

[0004] In view of this, the present invention proposes a cross-sample federated classification modeling method and device based on neural network and knowledge distillation. Summary of the invention

[0005] The purpose of the present disclosure is to provide a cross-sample federated classification modeling method, device, computer-readable storage medium and electronic device based on neural network and knowledge distillation, which is conducive to ensuring the data privacy of each federation participant, that is, training the artificial neural network through shared data, while meeting the communication and transmission complexity requirements of the training data, and ensuring the training effect of the artificial neural network.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to a first aspect of an embodiment of the present invention, a cross-sample federated classification modeling method based on a neural network and knowledge distillation is provided, the method comprising:

[0008] Obtain label standard information to be formulated for the federated classification modeling task, and perform structure customization and parameter initialization processing on the local neural network model for the federated classification modeling task according to the label standard information and local training data;

[0009] Training the local neural network model to obtain a predicted label vector of the local training data, and performing knowledge distillation processing on the predicted label vector to obtain a local soft label vector for each category;

[0010] Acquire a federated modeling parameter corresponding to the federated classification modeling task, and send the local soft label vector of each category to the coordinator according to the federated modeling parameter;

[0011] Receive the federal label vector returned by the coordinator according to the soft label vector, and continue to train the local neural network model according to the federal label vector and the local training data to complete the training and obtain a federal classification modeling model.

[0012] In an exemplary embodiment of the present invention,

[0013] The step of training the local neural network model to obtain a predicted label vector of the local training data includes:

[0014] Acquire original training data for training the federated classification modeling task, and perform label alignment and data filtering on the original training data to obtain local target training data;

[0015] The local neural network model is trained using the local target training data to obtain a predicted label vector of the local target training data.

[0016] In an exemplary embodiment of the present invention, the step of training the local neural network model using the local target training data to obtain a predicted label vector of the local target training data includes:

[0017] Performing data division on the local target training data to obtain a local training data set, and performing data division on the local training data set to obtain multiple groups of data to be trained;

[0018] The local neural network model is iteratively trained using multiple groups of the data to be trained to obtain a predicted label vector of the local target training data.

[0019] In an exemplary embodiment of the present invention,

[0020] The performing knowledge distillation processing on the predicted label vector to obtain a local soft label vector for each category includes:

[0021] Acquire a temperature parameter related to knowledge distillation, and perform knowledge distillation calculation on the predicted label vector of the local training data and the temperature parameter to obtain a distillation vector of the predicted label of the local training data;

[0022] The distillation vectors of the predicted labels of the local training data of the same category are averaged to obtain a soft label vector for each local category.

[0023] In an exemplary embodiment of the present invention,

[0024] The federated modeling parameters include the number of federated training rounds, and the local neural network model is continuously trained according to the federated label vector and the local training data to complete the training to obtain a federated classification modeling model, including:

[0025] Acquire label data corresponding to the local training data, and perform loss calculation on the predicted label vector and the label data to obtain a first loss value;

[0026] Performing loss calculation on the predicted label vector and the federal label vector to obtain a second loss value, and updating the local neural network model according to the first loss value and the second loss value;

[0027] The updated local neural network model continues to be trained until the number of training times of the neural network model reaches the number of federal training rounds, thereby obtaining a trained federal classification modeling model.

[0028] In an exemplary embodiment of the present invention,

[0029] The federated modeling parameters include communication frequency conditions;

[0030] The sending the local soft label vector of each category to the coordinator according to the federated modeling parameter includes:

[0031] When the training process of the local neural network model meets the communication frequency condition, the soft label vector of each category of the local model is sent to the coordinator.

[0032] In an exemplary embodiment of the present invention,

[0033] The performing structure customization processing and parameter initialization processing on the local neural network model according to the label standard information and the local training data includes:

[0034] Determining standard structure information of the local neural network model, and customizing the structure of the local neural network model according to the standard structure information to obtain network structure information of the local neural network model;

[0035] Perform parameter initialization processing on the local neural network model.

[0036] According to a second aspect of an embodiment of the present invention, a federated classification modeling device based on a neural network and knowledge distillation is provided, the device comprising:

[0037] A model definition module is configured to obtain label standard information to be formulated for a federated classification modeling task, and perform structure customization and parameter initialization processing on a local neural network model for the federated classification modeling task according to the label standard information and local training data;

[0038] A model training module is configured to train the local neural network model to obtain a predicted label vector of the local training data, and perform knowledge distillation processing on the predicted label vector to obtain a local soft label vector for each category;

[0039] A vector sending module, configured to obtain a federated modeling parameter corresponding to the federated classification modeling task, and send the local soft label vector of each category to the coordinator according to the federated modeling parameter;

[0040] The training completion module is configured to receive the federal label vector returned by the coordinator based on the soft label vector, and continue to train the local neural network model based on the federal label vector and the local training data to complete the training and obtain a federal classification modeling model.

[0041] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor and a memory; wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the cross-sample federated classification modeling method based on neural network and knowledge distillation in any of the above exemplary embodiments is implemented.

[0042] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the cross-sample federated classification modeling method based on neural network and knowledge distillation in any of the above exemplary embodiments is implemented.

[0043] It can be seen from the above technical solutions that a cross-sample federated classification modeling method, device, computer storage medium, and electronic device based on neural network and knowledge distillation in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:

[0044] In the method and apparatus provided by the exemplary embodiments of the present disclosure, the local neural network model is customized in structure and initialized in parameters, which can effectively prevent the local neural network model from overfitting or underfitting. Furthermore, when the local neural network model is trained locally, the predicted label vector is processed by knowledge distillation, and the classification ability generated by the amount of training data of other neural network models is learned, which greatly reduces the computing resources and achieves better training effect. In addition, during the training process, only the soft label vector and the federal label vector need to be transmitted with the coordinator, so the communication cost and transmission cost can also be reduced. That is, the artificial neural network is trained through shared data, and the training effect of the artificial neural network is guaranteed while meeting the communication and transmission complexity requirements of the training data.

[0045] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0047] Figure 1 A schematic diagram of a process flow of a cross-sample federated classification modeling method based on a neural network and knowledge distillation in an exemplary embodiment of the present disclosure is schematically shown;

[0048] Figure 2 A schematic diagram schematically illustrates a node diagram of a neural network model in an exemplary embodiment of the present disclosure;

[0049] Figure 3 A schematic diagram schematically showing nodes of a neural network model with a complex structure in an exemplary embodiment of the present disclosure;

[0050] Figure 4 The structure diagram of the convolutional neural network in the exemplary embodiment of the present disclosure is schematically shown;

[0051] Figure 5 A flowchart schematically illustrates a method for participants in a federated classification modeling task to perform structure customization and parameter initialization processing in an exemplary embodiment of the present disclosure;

[0052] Figure 6 A flowchart schematically illustrating a method for training a local neural network model in an exemplary embodiment of the present disclosure;

[0053] Figure 7 A schematic diagram schematically illustrates a flow chart of a method for training a local neural network model using target training data in an exemplary embodiment of the present disclosure;

[0054] Figure 8 A schematic diagram schematically illustrates a flow chart of a method for knowledge distillation processing in an exemplary embodiment of the present disclosure;

[0055] Fig. 9 A flowchart schematically illustrates a method for each participant of a federated modeling task to continue training a local neural network model in an exemplary embodiment of the present disclosure;

[0056] Fig.10 A schematic diagram of a process flow of a cross-sample federated classification modeling method based on a neural network and knowledge distillation in an application scenario in an exemplary embodiment of the present disclosure is schematically shown;

[0057] Fig.11 A schematic diagram schematically illustrates the network structure of participant A in an application scenario in an exemplary embodiment of the present disclosure;

[0058] Fig.12 A schematic diagram schematically illustrates the network structure of participant B in an application scenario in an exemplary embodiment of the present disclosure;

[0059] Fig.13 A schematic diagram schematically illustrates a network structure of a participant C in an application scenario in an exemplary embodiment of the present disclosure;

[0060] Fig.14 A schematic diagram of the structure of a cross-sample federated classification modeling device based on a neural network and knowledge distillation in an exemplary embodiment of the present disclosure is schematically shown;

[0061] Fig.15 A schematic diagram of the structure of an electronic device for implementing cross-sample federated classification modeling based on neural network and knowledge distillation in an exemplary embodiment of the present disclosure is schematically shown;

[0062] Fig.16 A schematic diagram of the structure of a computer-readable storage medium for implementing cross-sample federated classification modeling based on neural networks and knowledge distillation in an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0063] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0064] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.

[0065] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.

[0066] In response to the problems existing in the related technology, the present disclosure proposes a cross-sample federated classification modeling method based on neural network and knowledge distillation, and provides a graphical user interface through a first terminal device, which displays at least part of the game scene. Figure 1 A flowchart of a cross-sample federated classification modeling method based on neural network and knowledge distillation is shown. Figure 1 As shown in FIG, the cross-sample federated classification modeling method based on neural network and knowledge distillation includes at least the following steps:

[0067] Step S110. Obtain label standard information to be formulated for the federated classification modeling task, and customize the structure and initialize parameters of the local neural network model of the federated classification modeling task based on the label standard information and local training data.

[0068] Step S120: Train the local neural network model to obtain the predicted label vector of the local training data, and perform knowledge distillation on the predicted label vector to obtain a soft label vector for each local category.

[0069] Step S130: Obtain federated modeling parameters corresponding to the federated classification modeling task, and send the local soft label vector of each category to the coordinator according to the federated modeling parameters.

[0070] Step S140. Receive the federal label vector returned by the coordinator based on the soft label vector, and continue to train the local neural network model based on the federal label vector and local training data to complete the training and obtain a federal classification modeling model.

[0071] Repeat iterative steps S120 to S140 to complete the training and obtain the federated classification modeling model.

[0072] In an exemplary embodiment of the present disclosure, the participants can first customize the structure and initialize the parameters of their own neural network model, which can effectively prevent the overfitting and underfitting of the model. Furthermore, the data transmission and communication between the participants and the coordinator only include soft label vectors and federal label vectors, which greatly reduces the communication and transmission costs. In addition, the communication content does not require additional encryption and decryption calculations, which accelerates the training rate and communication rate of the neural network model and ensures the data security of the participants. In addition, the communication content does not need to be stored centrally, thereby reducing the requirements for resource storage. Then, the neural network model is continued to be trained according to the federal label vector, and the participants use other participants as teacher networks. When the amount of training data locally is small or the network structure is simple, the classification ability of the teacher network can be learned, which is better than the performance of the neural network model obtained by independent training using only the local data. Finally, the participants only need to train locally, reducing the amount of computing resources.

[0073] The following is a detailed description of each step of the neural network model training method.

[0074] In step S110, label standard information to be formulated for the federated classification modeling task is obtained, and the local neural network model of the federated classification modeling task is customized in structure and initialized in parameters based on the label standard information and local training data.

[0075] In the exemplary embodiments of the present disclosure, an artificial neural network (ANN), which may be referred to as a NN, is a mathematical or computational model that mimics the structure and function of a biological neural network. A NN is composed of nodes connected together, wherein a single node mimics a biological neuron, receives a single or multiple inputs, and generates an output.

[0076] Figure 2 A node diagram of a neural network model is shown, such as Figure 2 As shown, the neural network model is composed of 3 input nodes and 1 output node.

[0077] Furthermore, multiple nodes can form complex neural networks with different structures according to different connection methods. Figure 3 A node diagram of a complex structured neural network model is shown, such as Figure 3 As shown in the figure, the complex neural network model consists of 4 input layers, 2 intermediate layers and 1 output layer, with a total of 10 nodes.

[0078] With the deepening of deep learning research and the development of computing devices, convolutional neural networks (CNNs) have been widely used in fields such as computer vision. Convolutional neural networks are neural networks that contain both convolution calculations and deep structures.

[0079] A typical convolutional neural network consists of convolutional layers, pooling layers, and fully connected layers. The convolutional layers are usually responsible for extracting local features in the image, the pooling layers are used to reduce the magnitude of parameters, and the fully connected layers are similar to neural network layers, outputting the desired results.

[0080] Figure 4 A schematic diagram of the structure of a convolutional neural network is shown in Figure 2. Figure 4 As shown in the figure, the neural network model includes 1 convolution layer, 1 pooling layer and 2 fully connected layers.

[0081] The labeling standards formulated for the federated classification modeling task can be formulated by the initiator of the federated classification modeling task. In the federated classification modeling task, the participants are all data providers who request to join this federated classification modeling task; the initiator is one of the participants, and there is only one initiator in a federated classification modeling task; the coordinator is negotiated and confirmed by all participants before the initiation of the federated classification modeling task, and can be one of the participants or an institution or organization outside the participants, and there is only one coordinator in a federated classification modeling task.

[0082] Therefore, the label standard information is the label standard information formulated by the initiator. The label standard information defines the classification categories in the federated classification modeling task and the unified labels of each category. In addition, the initiator can make a federated modeling request to other participants in the federated classification modeling task, and send the label standard information to the participants who agree to join the federated classification modeling task, so as to require all participants who agree to participate in the federated classification modeling task to perform labeling and training according to the label standard formulated by the initiator.

[0083] In an alternative embodiment, Figure 5 A flow chart showing a method for participants in federated classification modeling to perform structure customization and parameter initialization processing is shown in FIG. Figure 5As shown, the method includes at least the following steps: in step S510, the standard structure information of the neural network model is determined, and the local neural network model is customized according to the standard structure information to obtain the network structure information of the local neural network model. Each participant can customize the structure of the local neural network model according to the amount of local data and label standard information.

[0084] The local neural network structure customization is based on the standard structure information, that is, when it contains the necessary neural network model structure, the nodes and number of layers of each layer are specified by itself. However, in the process of specification, it must be followed that the number of nodes in the output layer of the last layer must be equal to the number of classification categories that can be defined in the label standard information.

[0085] When the local data of the participant is large and there are many classification categories defined in the label standard information, a relatively complex neural network model can be defined to obtain a neural network model with higher accuracy; when the local data of the participant is small, a simple neural network model can be defined to prevent the model from underfitting.

[0086] For example, the network structure information of the neural network model obtained by structure customization may be that the neural network model includes 2 convolutional layers, 2 pooling layers and 2 fully connected layers.

[0087] In step S520, the parameters of the local neural network model are initialized.

[0088] After obtaining the network structure information, the network structure can also be initialized. The parameter initialization process is to initialize the weights of each layer of the local neural network model, which can be selected by each participant according to the neural network model.

[0089] In this exemplary embodiment, through structure customization and parameter initialization processing, participants can make independent settings according to their own circumstances to prevent the model from underfitting, and can also set up a neural network model with higher accuracy, ensuring the subsequent training effect.

[0090] In step S120, the local neural network model is trained to obtain a predicted label vector of the local training data, and the predicted label vector is subjected to knowledge distillation processing to obtain a soft label vector for each local category.

[0091] In an exemplary embodiment of the present disclosure, the training of the local neural network model of each participant in the federated classification modeling task is mainly through calculating the error between the network output and the true label of the input data, and back-propagating the error to iteratively update the parameters in the network, so that the network output is as close as possible to the true label of the input data. In the prediction process, when unlabeled data is input into the trained network structure, the neural network can output the label prediction value of the data.

[0092] In an alternative embodiment, Figure 6 A flow chart of a method for training a local neural network model is shown, such as Figure 6 As shown, the method includes at least the following steps: In step S610, original training data for training the federated classification modeling task is obtained, and label alignment and data filtering are performed on the original training data to obtain local target training data.

[0093] The original training data is stored locally at each participant and is in line with the data for this federated classification modeling task. In addition, in order to avoid processing irrelevant data, label alignment and data filtering can be performed on the original training data.

[0094] Specifically, participants can label the original training data within the labeling standard, and the labeling method can be in accordance with the provisions of this labeling standard.

[0095] In addition, the original data may also include other types of data, and other types of data do not participate in this federal classification modeling task. When the original training data provided by the participant contains other training data except the label standard, the target training data can be obtained by deleting the data of this type from the original data of the participant, that is, filtering out meaningless training data. When all the original training data of the participant are not within the categories defined by the label standard, it indicates that the participant is an invalid participant of this federal classification modeling task and needs to withdraw from this federal classification modeling task to avoid invalid participants from participating in this federal classification modeling task.

[0096] In step S620, the local neural network model is trained using the local target training data to obtain a predicted label vector of the local training data.

[0097] In an alternative embodiment, Figure 7 A flow chart of a method for training a local neural network model using target training data is shown, as Figure 7 As shown, the method at least includes the following steps: in step S710, data division is performed on the local target training data to obtain a local training data set, and data division is performed on the local training data set to obtain multiple groups of data to be trained.

[0098] Each participant can divide the target training data into two parts: training data set and verification data set. For example, the target training data can be divided into training data set and verification data set in a ratio of 4:1.

[0099] Furthermore, the training data set may be divided into multiple groups of training data. Specifically, the entire training sample is divided into several batches (batches / a batch of samples), and the batch size (batch size, the size of each batch of samples) of the batch can be set by the participants.

[0100] In step S720, the local neural network model is iteratively trained using multiple groups of data to be trained to obtain a predicted label vector of the local target training data.

[0101] After obtaining multiple sets of data to be trained, the data to be trained can be input into the neural network model to obtain the predicted label vector of the corresponding data.

[0102] In this exemplary embodiment, the training of the neural network model can be achieved through the target training data. The data of the participants are all locally involved in the model training. There is no need to disclose information such as data and labels to any other organization or institution, thereby ensuring the data security and privacy information of each participant.

[0103] After obtaining the predicted label vector of the local training data, the predicted label vector can also be subjected to knowledge distillation to obtain a local soft label vector.

[0104] In this exemplary embodiment, Figure 8 A flow chart of the knowledge distillation processing method is shown as follows: Figure 8 As shown, the method includes at least the following steps: in step S810, a temperature parameter related to knowledge distillation is obtained, and knowledge distillation calculation is performed on the predicted label vector and the temperature parameter of the local training data to obtain a distillation vector of the predicted label of the local training data.

[0105] This temperature parameter is used for subsequent knowledge distillation calculations and can be set by yourself.

[0106] Knowledge distillation refers to the use of the soft labels (Soft Target) output by the teacher network (Teacher Network) as part of the input of the student network (Student Network) error calculation to guide the training of the student network, so that the student network can achieve the same capabilities as the complex teacher network with a simple small network structure, and achieve the same or equivalent results as the complex large teacher network, thereby realizing knowledge transfer and compression of complex models.

[0107] Among them, soft labels include probability data obtained after the teacher network processes the input sample data. In essence, they are prediction data obtained by the teacher network based on the sample data. In knowledge distillation, this prediction data can be used to train the student network. Its properties are close to the label data, but it is different from the real label, so it is called a soft label.

[0108] In the neural network structure, the Softmax layer is usually used to express the output results in the form of probability. For example, the output vector of the neural network is [3,0,-3]. Substitute each element in the output vector into the Softmax calculation formula:

[0109] q i =exp(Z i ) / ∑ j exp(Z j ) (1)

[0110] After calculation using formula (1), the conversion value obtained is approximately [0.95, 0.0476, 0.0024], which means that the probability that the vector belongs to the first category, the second category, and the third category is 0.95, 0.0476, and 0.0024 respectively.

[0111] Furthermore, when the temperature parameter is set, the output vector and the temperature parameter can be calculated by knowledge distillation according to formula (2):

[0112] q i =exp(Z i / T) / ∑ j exp(Z j / T) (2)

[0113] Among them, T is the temperature parameter, q i is the sample distillation vector. The sample distillation vector has a higher entropy value, can provide more information and a smaller gradient variance, so it is easier to train than the original teacher network and has a higher learning efficiency.

[0114] Since the sample distillation vector has a value between 0 and 1, the larger the value of T, the more moderate the distribution of the sample distillation vector between 0 and 1, that is, the "softer" the sample distillation vector is, the more the teacher network can guide the student network. This is because it is equivalent to adding disturbances in the transfer learning process, making the student network more effective when learning from others and having stronger generalization ability, which is a strategy to suppress overfitting.

[0115] For example, when T=3, the converted sample distillation vector is approximately [0.663, 0.246, 0.091], which is a probability distribution that is "softer" than [0.95, 0.0476, 0.0024]. Therefore, during the student network training process, the teacher network can be allowed to use a higher temperature T to output a "softer" distribution, so that the output of the student model is close to the teacher network, thereby extracting the knowledge in the teacher network, which is called knowledge distillation.

[0116] In step S820, the distillation vectors of the predicted labels of the local training data of the same category are averaged to obtain a soft label vector for each local category.

[0117] After obtaining the sample distillation vector, the distillation vectors of the sample prediction labels of the target training data of the same class with the true label can be averaged to obtain the soft label vector of the target training data of the class. The average value calculation can be a general evaluation calculation, or a weighted average calculation, or can be calculated according to the actual situation, which is not particularly limited in this exemplary embodiment.

[0118] In this exemplary embodiment, each participant is regarded as the teacher network of other participants by using knowledge distillation calculation to guide the model training of other participants in the subsequent training process. Even if the training data of the participant is less or the network structure is simpler, the classification ability of the teacher network of other participants can be learned, which is better than the performance of the model trained by only using the data of the participant. Moreover, when the training data categories of the participant are incomplete, such as the lack of a certain type of data, the model of the participant can also learn the classification ability of the missing category, which completes the ability training of the model training, making the trained network model complete and accurate, and the effect is excellent.

[0119] In step S130, a federated modeling parameter corresponding to the federated classification modeling task is obtained, and the local soft label vector of each category is sent to the coordinator according to the federated modeling parameter.

[0120] In the exemplary embodiment of the present disclosure, knowledge federation aims to ensure that the participants exchange the "knowledge" in the data without leaving the local area, so as to establish a model that fully utilizes the data of each participant and achieve the purpose of "data is available but invisible, and knowledge is co-created and shared".

[0121] Here, "knowledge" can be understood as information transmitted between the server or terminal of the participant and the terminal or server of the coordinator. For example, the "knowledge" in the terminal or server of the participant can be extracted or calculated based on local sample data.

[0122] According to the characteristics of data distribution of each participant, knowledge federation can be divided into cross-feature federation, cross-sample federation and composite federation. Among them, cross-sample federation means that the data of each training party has the same characteristics, but the samples of each party participating in modeling are independent, and each training party has label data corresponding to its own samples.

[0123] The purpose of cross-sample federated modeling is to make full use of the samples and label data of all training parties without leaving the local data, and obtain a federated model that is better than the model trained only with local data.

[0124] In order to realize the knowledge federation among all the participants, the initiator can determine the parameters related to this knowledge federation, that is, the federation modeling parameters. The federation modeling parameters can include the number of federation training rounds and the communication frequency conditions.

[0125] The number of federated training rounds is called Epoch. When a complete data set passes through the neural network once and returns once, this process is called an epoch. In other words, all training samples undergo one forward propagation and one backward propagation in the neural network. In simpler terms, an epoch is the process of training all training samples once.

[0126] The communication frequency condition specifies the frequency and conditions of the knowledge distillation process and the communication between the participants. For example, the communication frequency condition may be that the knowledge distillation process and communication are performed once per Epoch.

[0127] In an optional embodiment, the federated modeling parameters include a communication frequency condition. When the training process of the local neural network model meets the communication frequency condition, the soft label vector of each local category is sent to the coordinator.

[0128] Each participant sends the local soft label vector to the coordinator for communication. Therefore, the local soft label vector can be sent only when the training process of the neural network model meets the communication frequency condition.

[0129] After receiving the soft label vectors sent by each participant according to the communication frequency conditions, the coordinator can calculate the soft label vectors of each participant to obtain the federal label vector of each participant. The federal label vector of each participant is the average of the corresponding category soft label vectors provided by other participants except itself.

[0130] Furthermore, the coordinator sends the federated label vector of each participant to the corresponding participant.

[0131] In step S140, the receiving coordinator returns the federal label vector according to the soft label vector, and continues to train the local neural network model according to the federal label vector and the local training data to complete the training and obtain the federal classification modeling model.

[0132] In an exemplary embodiment of the present disclosure, after the coordinator calculates the federal label vector corresponding to each participant, the federal label vector may be returned to the participant, so that the participant may receive the corresponding federal label vector for subsequent training.

[0133] In an optional embodiment, the federated modeling parameters include the number of federated training rounds. Fig. 9 A flowchart of a method for each participant in a federated classification modeling task to continue training a local neural network model is shown, such as Fig. 9 As shown, the method includes at least the following steps: In step S910, label data corresponding to local training data is obtained, and loss calculation is performed on the predicted label vector and the label data to obtain a first loss value.

[0134] It is worth noting that training a Batch is an Iteration. To complete an iteration, the parameters in the neural network model are iterated through the error between the output vector and the actual label data, so that the output vector of the neural network model is as close as possible to the input data, so as to obtain a trained neural network model.

[0135] Therefore, each participant in the federated classification modeling obtains the label data corresponding to the local target training data, and the label data is the true label of the target training data.

[0136] Furthermore, the first loss value of the output vector and the label data can be calculated according to formula (3):

[0137]

[0138] Formula (3) is the cross entropy loss function. Cross entropy is an important concept in Shannon's information theory, which is mainly used to measure the difference information between two probability distributions. In information theory, cross entropy is the difference information between two probability distributions p and q, where p represents the true distribution and q represents the untrue distribution. In the same set of events, the untrue distribution q is used to represent the average number of bits required for an event to occur.

[0139] Cross entropy can be used as a loss function in machine learning. p represents the distribution of true labels, and q represents the distribution of predicted labels of the trained model. The cross entropy loss function can measure the similarity between p and q. Another advantage of using cross entropy as a loss function is that when using the sigmoid function during gradient descent, the problem of the learning rate decrease of the mean square error loss function can be avoided. This is because the speed of the learning rate decrease can be controlled by the output error.

[0140] In addition, the method of performing loss calculation on the output vector and label data to obtain the first loss value can also be implemented using formula (3), or other calculation methods can be used, which is not specifically limited in this exemplary embodiment.

[0141] In step S920, loss calculation is performed on the predicted label vector and the federal label vector to obtain a second loss value, and the local neural network model is updated according to the first loss value and the second loss value.

[0142] Specifically, the loss calculation can be performed on the output vector and the federal label vector to obtain the second loss value. The calculation method can refer to formula (3) or other methods can be used. This exemplary embodiment does not make any special limitation on this.

[0143] Furthermore, each federated classification modeling participant uses the first loss value and the second loss value as loss errors for updating the local neural network model to update the parameters of the local neural network model.

[0144] In step S930, the updated local neural network model continues to be trained until the number of training times of the neural network model reaches the number of federal training rounds, thereby obtaining a trained federal classification modeling model.

[0145] After the update of the neural network model is completed, the iterative training of the neural network model is completed. In addition, the number of training times of the neural network model can be increased by one.

[0146] Furthermore, each federated classification modeling participant can continue to train the updated local neural network model. Similarly, as with the first training of the local neural network model, the prediction label vectors to be trained must be processed for knowledge distillation, and the coordinator must communicate with the coordinator to update the federated label vectors of the party, and the neural network model must be updated again.

[0147] In the process of continuously counting the number of training times of the neural network model, when the number of training times of the neural network model reaches the number of federal training rounds, it indicates that the federal classification modeling task is completed, that is, the iterative training of the neural network model is completed, and each participant can obtain the trained neural network model and exit the training.

[0148] In this exemplary embodiment, by updating the neural network model through the loss value, a trained neural network model can be iteratively trained, and the training of multiple neural network models can be completed at the same time. The training method is more flexible, and the multiple neural network models can influence each other by using the federal label vector, so the modeling effect is better.

[0149] The cross-sample federated classification modeling method based on neural network and knowledge distillation in the embodiment of the present disclosure is described in detail below in conjunction with an application scenario.

[0150] Fig.10 The flowchart of the cross-sample federated modeling method based on neural network and knowledge distillation in the application scenario is shown as follows: Fig.10 As shown, in step S1010, the initiator initiates the task and formulates label standards.

[0151] The initiator of the federated classification modeling task can formulate the labeling standards for the federated classification modeling task. In the federated classification modeling task, the participants are all data providers who request to join this federated classification modeling task; the initiator is one of the participants, and there is only one initiator in a federated classification modeling task; the coordinator is negotiated and confirmed by all participants before the federated classification modeling task is initiated. It can be one of the participants or a single person from an institution or organization outside the participants, and there is only one coordinator in a federated classification modeling task.

[0152] For example, institution A has images of dogs, cats, and cows. However, since the sample size of dogs and cows is 2,000, and the sample size of cats is 20,000, the number of cat samples is greater than that of dogs and cows. To train an image classification model for the three animals, we first need to establish a label standard, as shown in Table 1:

[0153] Table 1

[0154] category Label dog 0 cat 1 ox 2

[0155] After the label standard is formulated, the label standard information can be obtained. The label standard information defines that the classification categories in this federated classification modeling task include dogs, cats, and cows, and the label of dogs is 0, the label of cats is 1, and the label of cows is 2.

[0156] Furthermore, organization A sends a federated modeling request to organizations B, C, D, and E at the same time, among which organizations B, C, and D agree to join the federated modeling, and organization E refuses to join. Therefore, organization A sends the label standard information to organizations B, C, and D that agree to join the federated modeling.

[0157] In step S1020, the participant data is filtered and aligned with the tags.

[0158] Institutions A, B, C, and D collect images of dogs, cats, and cows defined in the label standard from their own data. The statistics of the relevant sample size (number of images) owned by each party are shown in Table 2:

[0159] Table 2

[0160]

[0161]

[0162] In addition, when the original training data provided by the participant contains other training data besides the label standard, the target training data can be obtained by deleting the data of this type from the original data of the participant, that is, the original training data is filtered to filter out meaningless training data. Therefore, other types of training data do not participate in this federated classification modeling task. Moreover, when all the original training data of the participant are not within the categories defined by the label standard, it indicates that the participant is an invalid participant of this federated classification modeling task and needs to withdraw from this federated classification modeling task.

[0163] Since institution D does not have any dog, cat, or cow image data, it withdraws from the participation. However, institutions A, B, and C unanimously agree to use institution D as the coordinator, and institution D agrees to join this federated classification modeling task as the coordinator. Therefore, during this training process, A, B, and C are participants, A is the task initiator, and D is the coordinator. Afterwards, institutions A and B label their dog, cat, and cow images as 0, 1, and 2 respectively according to the label standard, and institution C labels its cat and cow data as 1 and 2 according to the label standard.

[0164] In step S1030, the participants customize the neural network structure and parameter initialization method.

[0165] Participating institutions A, B, and C perform structural definition processing based on their own data volume and classification tasks to customize the neural network structure.

[0166] Fig.11 A schematic diagram showing the network structure of participant A in the application scenario is shown in FIG. Fig.11 As shown, the network structure information of participant A is that the neural network model consists of 1 convolutional layer, 1 pooling layer and 2 fully connected layers.

[0167] Fig.12 A schematic diagram showing the network structure of participant B in the application scenario is shown in FIG. Fig.12 As shown, the network structure information of participant B is that the neural network model consists of 2 convolutional layers, 2 pooling layers, and 3 fully connected layers.

[0168] Fig.13 A schematic diagram showing the network structure of participant C in the application scenario is shown in FIG. Fig.13 As shown, the network structure information of participant C is that the neural network model consists of 2 convolutional layers, 2 pooling layers, and 2 fully connected layers.

[0169] besides, Fig.11 , Fig.12 and Fig.13 The output layer of the network structure shown has 3 nodes, and the output values ​​represent the probabilities that the image samples are dogs, cats, and cows, respectively.

[0170] After obtaining the network structure information, the network structure information can also be subjected to parameter initialization processing. The parameter initialization processing is to set the weights of each layer of the neural network model, which can be selected by each participant according to the neural network model.

[0171] In step S1040, the participants perform local training based on the true labels and distill the category soft labels.

[0172] Participating institutions A, B and C divide the target training data of each category into training data sets and validation data sets at a ratio of 4:1 (of course, the specific ratio can be set according to the actual situation and is not limited here). Therefore, the sample data of each category in the training set and validation set of A, B and C are shown in Table 3:

[0173] Table 3

[0174]

[0175] Participants A, B, and C divide their training data sets into batches. For example, the data sizes of a training batch defined by parties A, B, and C are 32, 256, and 128, respectively.

[0176] In addition, the initiator A determines the federation modeling parameters, such as the number of federation training rounds for each participant is 10 epochs, the soft label communication frequency, that is, the communication frequency condition is to perform soft label distillation and communication once for each epoch. Further, the initiator A sends these parameters to the participants B, C and the coordinator D.

[0177] Then, participants A, B, and C each start iterative training of their local neural network models based on their own training data sets, calculate the training loss of each iteration based on the output vector of the local model and the true label of the training sample, backpropagate the loss, and update the parameters of the local model.

[0178] After the first round of training, the output vector of the first round of training and the corresponding temperature parameter are subjected to knowledge distillation calculation according to formula (2) to obtain the sample distillation vector.

[0179] Then, the distilled vectors of samples with label 0 are averaged to obtain the soft label vector of dog samples, and the distilled vectors of samples with label 1 are averaged to obtain the soft label vector of cat samples. Similarly, the distilled vectors of samples with label 2 are averaged to obtain the soft label vector of cattle samples.

[0180] For example, the soft label vectors calculated by participants A, B, and C for the dog, cat, and cow classes are [0.6, 0.3, 0.1], [0.4, 0.5, 0.1], and [0.2, 0.2, 0.6], respectively. Participants A, B, and C send the soft label vectors of each class of samples to the coordinator D, respectively.

[0181] In step S1050, it is determined whether the training of all participants is completed.

[0182] After each training session, the completion status of the training of each federated classification modeling participant is judged.

[0183] In step S1060, the coordinator calculates the federated soft label.

[0184] When the training completion status of all participants is determined to be that all participants have not completed the training, the coordinator may calculate the federated label vectors of each participant.

[0185] After receiving the soft label vectors of each type of samples sent by participants A, B, and C in the first round, organization D calculates the federal label vectors of participants A, B, and C respectively, and sends the A, B, and C federal label vectors to the corresponding participants A, B, and C.

[0186] For example, the cat federal label vector [0.35, 0.55 0.1] of participant C is the average of the cat label vectors [0.4, 0.5, 0.1] and [0.3, 0.6, 0.1] sent by parties A and B.

[0187] In step S1070, the participants perform local training based on the real labels and the federal soft labels; distilling the category soft labels.

[0188] Participants A, B, and C start the next round of training based on the federal label vector and local data sent by the coordinator D. The loss value of each batch training is composed of two parts: the first loss value between the output vector and the true label and the second loss value between the output vector and the federal label vector, and the parameters of the neural network model are updated.

[0189] When the next round of data training is completed, the soft labels of each type of samples are re-distilled and the updated soft labels are sent to agency D.

[0190] Repeat steps S1050-S1070 until all participants have completed 10 rounds of training, that is, the training ends after reaching the number of federal training rounds, and institutions A, B, and C all obtain trained neural network models.

[0191] In this application scenario, the cross-sample federated classification modeling method based on neural network model and knowledge distillation, in terms of privacy protection, is compared with the centralized machine learning method. The data of the participants are all locally involved in the training of the neural network model, and there is no need to disclose the data and label information of the party to other organizations or institutions. In addition, only the soft label vector of each category needs to be transmitted to the coordinator, and the soft label vector is a mean value, which will not disclose the true label of the training data of the participants. In short, there is no need to share data between the participants and between the participants and the coordinator, which ensures the data security of each participant.

[0192] In terms of resource requirements, compared with centralized machine learning methods, each participant only trains based on the local data volume during model training, and the computing resources of each participant are far lower than those required for centralized training. On the other hand, each participant only iterates and updates the model based on its own training data and federal label vectors. There is no need to centrally store the training data of all participants, and the storage resource requirements are also lower than the centralized storage method. Furthermore, there is no need to transmit the training data of each participant to other organizations or institutions. Each participant communicates with the coordinator only on the soft label vector of each category, and the communication content is relatively small, which greatly reduces the communication and transmission costs.

[0193] In terms of modeling effect, each participant can define the complexity of the neural network model according to the amount of training data of the party, which can effectively prevent the overfitting and underfitting of the model. In addition, each participant uses other participants as teacher networks. When the amount of training data locally is small or the network structure is simple, the classification ability of the teacher network can be learned, which is better than the performance of the neural network model trained only with the party's data. On the other hand, when the participant completes the sample categories, for example, when a certain type of sample is missing, the participant can also learn the classification ability of the missing category, which is more complete.

[0194] In terms of flexibility and mobility, all participants do not need to define the same neural network structure. Compared with other federated parameter aggregation schemes, this scheme is more flexible. In addition, during the federated classification modeling task, participants can apply to join or exit the federated modeling process at any time.

[0195] In terms of training rate and communication rate, compared with other federal parameter aggregation schemes, in this application scenario, each participant only needs to transmit and receive each type of federal label vector at the end of each round of training, and the content of the communication does not require additional encryption and decryption calculations, which greatly accelerates the training rate and communication rate of the neural network model.

[0196] By training the artificial neural network with the data shared in this solution, it is possible to meet the communication and transmission complexity requirements of the training data while ensuring the training effect of the artificial neural network.

[0197] In addition, in an exemplary embodiment of the present disclosure, a cross-sample federated classification modeling device based on neural network and knowledge distillation is also provided. Fig.14 The schematic diagram of the structure of the cross-sample federated classification modeling device based on neural network and knowledge distillation is shown as follows: Fig.14 As shown, the cross-sample federated classification modeling device 1400 based on neural network and knowledge distillation may include: a model definition module 1410, a model training module 1420, a vector sending module 1430 and a training completion module 1440.

[0198] in:

[0199] The model definition module 1410 is configured to obtain label standard information to be formulated for the federated classification modeling task, and perform structure customization and parameter initialization processing on the local neural network model for the federated classification modeling task according to the label standard information and local training data;

[0200] The model training module 1420 is configured to train the local neural network model to obtain a predicted label vector of the local training data, and perform knowledge distillation processing on the predicted label vector to obtain a local soft label vector for each category;

[0201] The vector sending module 1430 is configured to obtain a federated modeling parameter corresponding to the federated classification modeling task, and send the local soft label vector of each category to the coordinator according to the federated modeling parameter;

[0202] The training completion module 1440 is configured to receive the federal label vector returned by the coordinator based on the soft label vector, and continue to train the local neural network model based on the federal label vector and the local training data to complete the training and obtain a federal classification modeling model.

[0203] In an exemplary embodiment of the present invention, the step of training the local neural network model to obtain a predicted label vector of the local training data includes:

[0204] Acquire original training data for training the federated classification modeling task, and perform label alignment and data filtering on the original training data to obtain local target training data;

[0205] The local neural network model is trained using the local target training data to obtain a predicted label vector of the local target training data.

[0206] In an exemplary embodiment of the present invention, the step of training the local neural network model using the local target training data to obtain a predicted label vector of the local target training data includes:

[0207] Performing data division on the local target training data to obtain a local training data set, and performing data division on the training data set to obtain multiple groups of data to be trained;

[0208] The local neural network model is iteratively trained using multiple groups of the data to be trained to obtain a predicted label vector of the local target training data.

[0209] In an exemplary embodiment of the present invention,

[0210] The performing knowledge distillation processing on the predicted label vector to obtain a local soft label vector for each category includes:

[0211] Acquire a temperature parameter related to knowledge distillation, and perform knowledge distillation calculation on the predicted label vector of the local training data and the temperature parameter to obtain a distillation vector of the predicted label of the local training data;

[0212] The distillation vectors of the predicted labels of the local training data of the same category are averaged to obtain a soft label vector for each local category.

[0213] In an exemplary embodiment of the present invention,

[0214] The federated modeling parameters include the number of federated training rounds, and the local neural network model is continuously trained according to the federated label vector and the local training data to complete the training to obtain a federated classification modeling model, including:

[0215] Acquire label data corresponding to the local training data, and perform loss calculation on the predicted label vector and the label data to obtain a first loss value;

[0216] Performing loss calculation on the predicted label vector and the federal label vector to obtain a second loss value, and updating the local neural network model according to the first loss value and the second loss value;

[0217] The updated local neural network model continues to be trained until the number of training times of the neural network model reaches the number of federal training rounds, thereby obtaining a trained federal classification modeling model.

[0218] In an exemplary embodiment of the present invention,

[0219] The federated modeling parameters include communication frequency conditions;

[0220] The sending the local soft label vector of each category to the coordinator according to the federated modeling parameter includes:

[0221] When the training process of the local neural network model meets the communication frequency condition, the soft label vector of each category of the local model is sent to the coordinator.

[0222] In an exemplary embodiment of the present invention,

[0223] The performing structure customization processing and parameter initialization processing on the local neural network model according to the label standard information and the local training data includes:

[0224] Determining standard structure information of the local neural network model, and customizing the structure of the local neural network model according to the standard structure information to obtain network structure information of the local neural network model;

[0225] Perform parameter initialization processing on the local neural network model.

[0226] The specific details of the above-mentioned cross-sample federated classification modeling device 1400 based on neural network and knowledge distillation have been described in detail in the training method of the corresponding neural network model, so they will not be repeated here.

[0227] It should be noted that although several modules or units of a cross-sample federated classification modeling device 1400 based on neural network and knowledge distillation are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0228] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0229] Refer to the following Fig.15 15 to 16. An electronic device 1500 according to such an embodiment of the present invention is described. Fig.15The electronic device 1500 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0230] like Fig.15 As shown, the electronic device 1500 is in the form of a general computing device. The components of the electronic device 1500 may include, but are not limited to: the at least one processing unit 1510, the at least one storage unit 1520, a bus 1530 connecting different system components (including the storage unit 1520 and the processing unit 1510), and a display unit 1540.

[0231] The storage unit stores program codes, which can be executed by the processing unit 1510, so that the processing unit 1510 executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.

[0232] The storage unit 1520 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1521 and / or a cache memory unit 1522 , and may further include a read-only memory unit (ROM) 1523 .

[0233] The storage unit 1520 may also include a program / utility 1524 having a set (at least one) of program modules 1525, such program modules 1525 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0234] Bus 1530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0235] The electronic device 1500 may also communicate with one or more external devices 1700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1500, and / or communicate with any device that enables the electronic device 1500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1550. Furthermore, the electronic device 1500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1560. As shown, the network adapter 1540 communicates with other modules of the electronic device 1500 via a bus 1530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0236] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.

[0237] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible embodiments, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0238] refer to Fig.16 As shown, a program product 1600 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0239] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0240] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0241] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0242] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0243] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A cross-sample federated classification modeling method based on neural network and knowledge distillation, characterized in that: The method comprises: Obtain label standard information to be formulated for the federated classification modeling task, and perform structure customization and parameter initialization processing on the local neural network model of the federated classification modeling task according to the label standard information and local training data; Acquire original training data for training the federated classification modeling task, and perform label alignment and data filtering on the original training data to obtain local target training data; train the local neural network model using the local target training data to obtain a predicted label vector of the local target training data; Acquire a temperature parameter related to knowledge distillation, and perform knowledge distillation calculation on the predicted label vector of the local training data and the temperature parameter to obtain a distillation vector of the predicted label of the local training data; perform average value calculation on the distillation vectors of the predicted labels of the local training data of the same category to obtain a soft label vector of each local category; Acquire a federated modeling parameter corresponding to the federated classification modeling task, and send the local soft label vector of each category to the coordinator according to the federated modeling parameter; Receive the federal label vector returned by the coordinator according to the soft label vector, obtain the label data corresponding to the local training data, and perform loss calculation on the predicted label vector and the label data to obtain a first loss value; perform loss calculation on the predicted label vector and the federal label vector to obtain a second loss value, and update the local neural network model according to the first loss value and the second loss value; continue to train the updated local neural network model until the number of training times of the neural network model reaches the number of federal training rounds, and obtain a trained federal classification modeling model; wherein the federal classification modeling model is used for image classification.

2. The cross-sample federated classification modeling method based on neural network and knowledge distillation according to claim 1 is characterized in that: The step of training the local neural network model using the local target training data to obtain a predicted label vector of the local target training data includes: Performing data division on the local target training data to obtain a local training data set, and performing data division on the local training data set to obtain multiple groups of data to be trained; The local neural network model is iteratively trained using multiple groups of the data to be trained to obtain a predicted label vector of the local target training data.

3. The cross-sample federated classification modeling method based on neural network and knowledge distillation according to claim 1 is characterized in that: The federated modeling parameters include communication frequency conditions; The sending the local soft label vector of each category to the coordinator according to the federated modeling parameter includes: When the training process of the local neural network model meets the communication frequency condition, the soft label vector of each category of the local model is sent to the coordinator.

4. The cross-sample federated classification modeling method based on neural network and knowledge distillation according to any one of claims 1 to 3, characterized in that: The performing structure customization processing and parameter initialization processing on the local neural network model according to the label standard information and the local training data includes: Determining standard structure information of the local neural network model, and customizing the structure of the local neural network model according to the standard structure information to obtain network structure information of the local neural network model; Perform parameter initialization processing on the local neural network model.

5. A cross-sample federated classification modeling device based on neural network and knowledge distillation, characterized in that: include: A model definition module is configured to obtain label standard information to be formulated for the federated classification modeling task, and perform structure customization and parameter initialization processing on the local neural network model of the federated classification modeling task according to the label standard information and local training data; A model training module is configured to obtain original training data for training the federated classification modeling task, and perform label alignment and data filtering on the original training data to obtain local target training data; The local neural network model is trained using the local target training data to obtain a predicted label vector of the local target training data; a temperature parameter related to knowledge distillation is obtained, and knowledge distillation calculation is performed on the predicted label vector of the local training data and the temperature parameter to obtain a distillation vector of the predicted label of the local training data; an average value is calculated for the distillation vectors of the predicted labels of the local training data of the same category to obtain a soft label vector of each local category; A vector sending module, configured to obtain a federated modeling parameter corresponding to the federated classification modeling task, and send the local soft label vector of each category to the coordinator according to the federated modeling parameter; The training completion module is configured to receive the federal label vector returned by the coordinator based on the soft label vector, obtain the label data corresponding to the local training data, and perform loss calculation on the predicted label vector and the label data to obtain a first loss value; perform loss calculation on the predicted label vector and the federal label vector to obtain a second loss value, and update the local neural network model according to the first loss value and the second loss value; continue to train the updated local neural network model until the number of training times of the neural network model reaches the number of federal training rounds, and obtain a trained federal classification modeling model; wherein the federal classification modeling model is used for image classification.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the cross-sample federated classification modeling method based on neural network and knowledge distillation as described in any one of claims 1 to 4.

7. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the cross-sample federated classification modeling method based on neural network and knowledge distillation as described in any one of claims 1-4 by executing the executable instructions.