Data classification method, classification model training method and related device
Through federated learning and pseudo-label training methods, the classification accuracy of small sample data is improved, the problem of low accuracy of existing small sample classification learning is solved, and efficient classification results using pseudo-label training in federated learning are realized.
Patent Information
- Application Number
- CN202411058638.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-12-27
AI Technical Summary
The accuracy of existing small sample classification learning is low, making it difficult to effectively improve the accuracy of the classification results of small sample data.
The global classification model is trained using federated learning, and the sample data of pseudo-labels is trained. The data to be classified is processed through the local model on the participant side, and the parameters are gradually adjusted until the preset conditions are met to improve the accuracy of the classification results.
Through federated learning and pseudo-label training, the classification results accuracy of small sample data is improved and the cost of training with real tags is saved.
Smart Images

Figure CN119202815A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data classification method, a classification model training method and related devices. Background Art
[0002] Small sample learning is a method of machine learning that focuses on effective learning with limited sample size to complete the given target task requirements. However, the accuracy of existing small sample classification learning is low. Therefore, how to improve the accuracy of classification results of small sample data has become one of the problems to be solved. Summary of the invention
[0003] The main technical problem solved by the present application is to provide a data classification method, a classification model training method and related devices, which can improve the accuracy of classification results of small sample data.
[0004] To solve the above technical problems, the first aspect of the present application provides a data classification method, which includes: obtaining data to be classified; using the local model of the participating end to process the data to be classified to obtain the classification result of the global classification model for the data to be classified; wherein the local model of the participating end is a global classification model or a part of the global classification model, the global classification model is trained using federated learning, and the global classification model is trained using at least sample data with pseudo labels.
[0005] To solve the above-mentioned technical problems, the second aspect of the present application provides a classification model training method, which includes: using the local model of the participating end to process the sample data located at the participating end to obtain the sample processing result of the participating end; receiving the first local parameter information about the local model of the participating end sent by the intermediate end, wherein the intermediate end is used to obtain the current first global parameter information of the global classification model, the local model of the participating end includes various parts of the global classification model or is a part of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating end and the corresponding pseudo-label; adjusting the parameters of the local model of the participating end according to the first local parameter information, and repeating the above-mentioned training process until the preset conditions are met to obtain a trained global classification model, and the parameters of the local model of each participating end are updated based on the parameters of the trained global classification model.
[0006] To solve the above technical problems, the third aspect of the present application provides a classification model training method, the method comprising: receiving local training information sent by each participating terminal; determining the current global parameter information of the global classification model based on the local training information; determining the first local parameter information about the local model of each participating terminal based on the current global parameter information of the global classification model, and sending the first local parameter information of each participating terminal to each participating terminal; repeating the above training process until the preset conditions are met to obtain a trained global classification model, and the parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model; wherein, in the case where the local model of each participating terminal contains various parts of the global classification model, the first local parameter information of each participating terminal is the global parameter information, and the local training information of the participating terminal is the first local parameter information of the participating terminal based on the first local parameter information of the participating terminal. The second local parameter information of the local model is determined by a sample classification result and a pseudo-label of the sample data, the first sample classification result is obtained by the participating end using the local model of the participating end to process the sample data, and the global parameter information is obtained by aggregating the second local parameter information of each participating end; when the local model of each participating end is a part of the global classification model, the first local parameter information of each participating end is part of the parameter information about the local model of the participating end in the global parameter information, the local training information of the participating end is the sample processing result obtained by the participating end using the local model of the participating end to process the sample data, the global parameter information is the parameter information of the global classification model determined by the second sample classification result and the pseudo-label of the sample data, and the second sample classification result is obtained by post-processing by the post-processing module of the global classification model based on the sample processing results of each participating end.
[0007] To solve the above-mentioned technical problems, the fourth aspect of the present application provides a data classification device, which includes: an acquisition module and a classification module, wherein the acquisition module is used to acquire the data to be classified; the classification module is used to process the data to be classified using the local model of the participating end to obtain the classification result of the global classification model for the data to be classified; wherein the local model of the participating end is a global classification model or a part of the global classification model, the global classification model is trained using federated learning, and the global classification model is trained using at least sample data with pseudo labels.
[0008] To solve the above technical problems, the fifth aspect of the present application provides a classification model training device, which includes a processing module, a first receiving module, a parameter adjustment module and a first repetition module, wherein the processing module is used to use the local model of the participating end to process the sample data located at the participating end to obtain the sample processing result of the participating end; the first receiving module receives the first local parameter information about the local model of the participating end sent by the intermediate end, wherein the intermediate end is used to obtain the current first global parameter information of the global classification model, the local model of the participating end includes various parts of the global classification model or is a part of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating end and the corresponding pseudo-label; the parameter adjustment module is used to adjust the parameters of the local model of the participating end according to the first local parameter information; the first repetition module is used to repeatedly execute the above training process until the preset conditions are met to obtain the trained global classification model, and the parameters of the local model of each participating end are updated based on the parameters of the trained global classification model.
[0009] In order to solve the above technical problems, the sixth aspect of the present application provides a classification model training device, which includes a second receiving module, a global parameter module, a local parameter module and a second repetition module, the second receiving module is used to receive local training information sent by each participating terminal; the global parameter module is used to determine the current global parameter information of the global classification model based on the local training information; the local parameter module is used to determine the first local parameter information about the local model of each participating terminal based on the current global parameter information of the global classification model, and send the first local parameter information of each participating terminal to each participating terminal, so that each participating terminal adjusts the parameters of the local model of the participating terminal according to the first local parameter information; the second repetition module is used to repeatedly execute the above training process until the preset conditions are met to obtain a trained global classification model, and the parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model; wherein, the local model of each participating terminal contains each part of the global classification model In the case of classification, the first local parameter information of each participating terminal is global parameter information, the local training information of the participating terminal is the second local parameter information of the local model determined by the participating terminal based on the first sample classification result and the pseudo-label of the sample data, the first sample classification result is obtained by the participating terminal using the local model of the participating terminal to process the sample data, and the global parameter information is obtained by aggregating the second local parameter information of each participating terminal; in the case where the local model of each participating terminal is part of the global classification model, the first local parameter information of each participating terminal is part of the parameter information about the local model of the participating terminal in the global parameter information, the local training information of the participating terminal is the sample processing result obtained by the participating terminal using the local model of the participating terminal to process the sample data, the global parameter information is the parameter information of the global classification model determined by the second sample classification result and the pseudo-label of the sample data, and the second sample classification result is obtained by the post-processing module of the global classification model based on the sample processing results of each participating terminal.
[0010] To solve the above technical problems, the seventh aspect of the present application provides an electronic device, which includes a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the methods provided in the first, second and third aspects above.
[0011] To solve the above technical problems, the eighth aspect of the present application provides a computer-readable storage medium, which is used to store program instructions, and the program instructions can be executed to implement the methods of the first, second and third aspects as described above.
[0012] The beneficial effects of the present application are as follows: Different from the prior art, the present application obtains data to be classified; uses the local model of the participating end to process the data to be classified, so as to obtain the classification result of the global classification model for the data to be classified; wherein, the local model of the participating end is a global classification model or a part of a global classification model, and the global classification model is trained by federated learning, and the global classification model is obtained by training at least sample data with pseudo labels. The problem of a small number of samples can be solved by training the global classification model with federated learning, and the accuracy of the classification results of small sample data can be improved by using sample data with pseudo labels for training during the training process; and compared with supervised training using the real labels of the sample data, training using sample data with pseudo labels can also save costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a flowchart of an implementation method of a data classification method provided by the present application;
[0014] Figure 2 It is a flowchart of an implementation method of a pseudo-label determination process provided by the present application;
[0015] Figure 3 It is a flowchart of an implementation method of a classification model training method provided by the present application;
[0016] Figure 4 It is a flowchart of another implementation method of the classification model training method provided by the present application;
[0017] Figure 5 It is a schematic diagram of the framework structure of an implementation method of a data classification device provided by the present application;
[0018] Figure 6 It is a schematic diagram of the framework structure of an implementation method of a classification model training device provided by the present application;
[0019] Figure 7 It is a schematic diagram of the framework structure of another embodiment of the classification model training device provided by the present application;
[0020] Figure 8 It is a schematic diagram of the framework structure of an embodiment of an electronic device provided by the present application;
[0021] Fig. 9 It is a schematic diagram of the framework structure of an implementation scheme of a computer-readable storage medium provided in this application. DETAILED DESCRIPTION
[0022] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] It should be noted that in the embodiments of the present application, there are descriptions involving "first", "second", etc., which are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0024] In the description of the application, the meaning of "multiple" is at least two, for example, two, three, etc., unless otherwise clearly and specifically limited. In the embodiment of the present application, all directional indications (such as up, down, left, right, front, back ...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their deformations are intended to cover non-exclusive inclusions. For example, the process, method, system, product or equipment comprising a series of steps or units is not limited to the steps or units listed, but optionally also includes the steps or units not listed, or optionally also includes other steps or units inherent to these processes, methods, products or equipment.
[0025] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0026] See also Figure 1 , Figure 1 : is a flow chart of an implementation method of a data classification method provided by the present application, the method comprising:
[0027] S11: Obtain data to be classified.
[0028] In one embodiment, the data to be classified may be local data of the participating terminal. According to whether the local data of the participating terminal is complete, it is determined that the local model of the participating terminal is a global classification model or a part of the global classification model. If the local data of the participating terminal is complete, it is determined that the local model of the participating terminal is a global classification model; if the local data of the participating terminal is incomplete, it is determined that the local model of the participating terminal is a part of the global classification model.
[0029] For example, a group of data including the name, age, gender, and educational background of user A is the data to be classified corresponding to user A. If the local data of a participating terminal includes the name, age, gender, and educational background data of user A, it means that the local data of the participating terminal is complete; if the local data of a participating terminal only includes the name, age, and gender of user A, but does not include the educational background data of user A, it means that the local data of the participating terminal is incomplete, and it is necessary to obtain the local data of other participating terminals to form a set of data to be classified. The local data of other participating terminals should include the educational background data of user A.
[0030] S12: Use the local model of the participating end to process the data to be classified, so as to obtain the classification result of the global classification model on the data to be classified.
[0031] In one embodiment, the local model of the participating terminal is a global classification model, the data to be classified is input into the local model of the participating terminal, the local model of the participating terminal processes the model to be classified, and outputs the classification result of the data to be classified.
[0032] In another embodiment, the local model of the participating terminal is part of the global classification model, the data to be classified is input into the local model of the participating terminal, the local model of the participating terminal processes the data to be classified, and sends the processing result to the intermediate model, and the intermediate model obtains the classification result of the data to be classified based on the processing results corresponding to the local models of multiple participating terminals. The local model of each participating terminal processes its local data to obtain the corresponding processing result.
[0033] In this embodiment, the global classification model is trained by federated learning, and the global classification model is obtained by training at least with sample data with pseudo labels. Depending on the training data, the global classification model can be trained by horizontal federated learning or vertical federated learning. In one embodiment, there are multiple participating terminals in the federated learning, each of which has a local model, and the local model of each participating terminal is a global classification model or a part of the global classification model. Specifically, in the horizontal federated learning process, the local model of each participating terminal is a global classification model; in the vertical federated learning process, the local model of each participating terminal is a part of the global classification model.
[0034] Among them, federated learning is an advanced machine learning method that aims to address the challenges of data privacy and decentralization. In traditional machine learning, data is usually concentrated on a central server for model training, but this may involve the leakage of sensitive information. Federated learning solves this problem by pushing the model training process to local devices (such as smartphones, sensors, or medical devices). In federated learning, the model on the local device is trained on local data, and then only the update of the model parameters is transmitted to the central server instead of the original data. This protects the privacy of the user because the original data does not leave the local device. The central server integrates information based on the model parameter updates from multiple devices and continuously improves the global model. This process is repeated in multiple rounds until the model converges on the entire federated network.
[0035] In the above method, the data to be classified is obtained; the local model of the participating end is used to process the data to be classified, so as to obtain the classification result of the global classification model for the data to be classified; wherein, the local model of the participating end is a global classification model or a part of a global classification model, and the global classification model is trained by federated learning, and the global classification model is obtained by training at least sample data with pseudo labels. The problem of small number of samples can be solved by training the global classification model with federated learning, and the accuracy of the classification result of small sample data can be improved by using sample data with pseudo labels for training during the training process; and compared with supervised training using the real labels of the sample data, training using sample data with pseudo labels is equivalent to unsupervised training, which can save costs.
[0036] In one embodiment, the training process of the global classification model includes: using the local model of the participating end to process the sample data located at the participating end to obtain the sample processing result of the participating end; receiving the first local parameter information about the local model of the participating end sent by the intermediate end, wherein the intermediate end is used to obtain the current first global parameter information of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating end and the corresponding pseudo label; adjusting the parameters of the local model of the participating end according to the first local parameter information, and repeating the training process until the preset conditions are met to obtain the trained global classification model, and the parameters of the local model of each participating end are updated based on the parameters of the trained global classification model. Among them, the sample processing result of the participating end can be the classification result of the sample data, or it can be the sample feature of the sample data.
[0037] In a specific implementation, the local data of the local model of each participating terminal is complete, that is, the features used by the local models of each participating terminal are consistent, and the local models of each participating terminal are global classification models. The sample data located at the participating terminal is input into the participating terminal, and the participating terminal processes the sample data to obtain the first sample classification result of the sample data; wherein, when the participating terminal processes the sample data for the first time, the parameters used by the participating terminal to process the sample data to obtain the first sample classification result are sent to the participating terminal by the intermediate terminal. Based on the pseudo-label corresponding to the first sample classification result and the sample data, the second local parameter information about the local model of the participating terminal is determined, and the second local parameter information is sent to the intermediate terminal. The second local parameter can be the feature parameter of the local model of the participating terminal or the descending gradient of the model training. The first global parameter information obtained by the receiving intermediate terminal by aggregating the second local parameter information sent by each participating terminal is used as the first local parameter information. The parameters of the local model of the participating terminal are adjusted according to the first local parameter information, that is, the second local parameter information of the local model of the participating terminal is adjusted according to the first local parameter information, and new second local parameter information is obtained, that is, a new local model of the participating terminal is obtained. The local model of the new participating terminal is then used to repeatedly process the sample data located at the participating terminal to obtain a new sample processing result and its subsequent steps, until the preset conditions are met to obtain a trained global classification model. The parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model.
[0038] In one embodiment, the preset condition may be that the model converges or the number of training rounds reaches a preset number. Taking the preset condition that the number of training rounds reaches a preset number as an example, if the preset number is 10, the first global parameter information obtained by the 10th aggregation of the intermediate end may be received, and the parameters of the local model of the participating end may be adjusted according to the first local parameter information in the first global parameter information obtained by the 10th aggregation to obtain a global classification model.
[0039] In other embodiments, the sample data includes sample data of multiple tasks, and the multiple tasks may be multiple scenario tasks, such as classification tasks adapted to different scenarios. The sample data of each task includes sample data of multiple categories. In the present application, the sample data of multiple categories may be sample data with multiple different pseudo labels. The training of the global classification model includes stage training for each task respectively. In the stage training of each task, each participating end and the intermediate end uses the sample data of the task for iterative training to obtain a global classification model that completes the stage training of the task.
[0040] Specifically, in the stage training of each task, the following steps are performed for each participating end: the participating end uses the sample data located at the participating end and corresponding to the current task to process and obtain the sample processing result corresponding to the current task; the participating end sends the sample processing result corresponding to the current task to the intermediate end.
[0041] The intermediate end obtains the first global parameter information based on the sample processing results corresponding to the current task sent by each participating end, and sends the first global parameter information to each participating end as the first local parameter information of each participating end. Each participating end adjusts the parameters of its local model based on the first global parameter information and repeats the training process until the preset conditions are met.
[0042] When the stage training of all tasks is completed, the second global parameter information sent by the intermediate end is obtained, wherein the second global parameter information is obtained based on the final first global parameter information of the global classification model corresponding to each task; the local model of the participating end is adjusted using the second global parameter information to obtain the trained local model of the participating end. The second global parameter information is the ratio of the sum of the statistical parameter information of each task to the sum of the data volume of each task of each participating end, and the statistical parameter information of the task is the product of the final first global parameter information of the global classification model corresponding to the task and the sum of the data volume of each participating end about the task. The second global parameter information is as shown in the following formula.
[0043]
[0044] Among them, M is the second global parameter information, M j is the final first global parameter information of the global classification model corresponding to the jth task, is the sum of the data volume of each participating end regarding the jth task, n ij represents the number of sample data of the jth task of the i-th participant, It is the sum of the statistical parameter information of each task.
[0045] In the above implementation, after the last training of the stage training of each task is completed, the parameters of the local model of the participating end may not be adjusted according to the first local parameter information in the first global parameter information obtained from the last training. Instead, after the stage training of all tasks is completed, the first global parameter information obtained from the last training of the global classification model corresponding to each task is aggregated to obtain the second global parameter information, and the second global parameter information is used to adjust the parameters of the local model of the participating end to obtain the trained local model of the participating end. Taking the preset condition that the number of training rounds reaches the preset number as an example, if the preset number is 10, during the stage training of the current task, after the intermediate end aggregates and obtains the first global parameter information for the 10th time, the stage training of the current task is ended and the stage training of the next task is started.
[0046] In one embodiment, the intermediate end may include multiple classification learners, each classification learner corresponds to a task. For example, when performing stage training for task A, the classification learner M1 at the intermediate end is used to obtain the current first global parameter information of the global classification model; when performing stage training for task B, the classification learner M2 at the intermediate end is used to obtain the current first global parameter information of the global classification model.
[0047] In a specific implementation, the sample data of each task includes query data and support data. During the stage training process corresponding to the task, the sample data located at the participating end is processed using the local model of the participating end to obtain the sample processing result of the participating end, including: finding the current query data from the query data belonging to the task in the participating end, and finding the current support data from the support data belonging to the task in the participating end; wherein the current query data and the current support data belong to the same category, that is, the current query data and the current support data have the same pseudo-label. The current query data, the current support data, and the pseudo-label of the current support data are input into the local model of the participating end, so that the local model of the participating end outputs the first sample classification result of the current query data with reference to the current support data and the pseudo-label of the current support data.
[0048] After obtaining the first sample classification result, the second local parameter information about the local model of the participating end is determined based on the difference between the first sample classification result of the current query data and the pseudo label of the current query data, and the difference between the current query data and the current support data. In one embodiment, a prototype loss function may be used to determine the loss, and the parameters of the local model of the participating end are adjusted based on the loss to obtain the second local parameter information of the local model of the participating end. The prototype loss function is shown in the following formula.
[0049]
[0050] Among them, L proto represents the loss determined by the prototype loss function; y i is the pseudo label of the current query data; n represents the number of query data; d(x,p i ) represents the difference between the current query data and the current support data, which may be the distance between the feature vector of the current query data and the feature vector of the current support data in the feature space; It is a normalization term used to convert distance into probability. The smaller the distance, the greater the probability.
[0051] In another specific implementation, the data used by the local models of each participating terminal is incomplete, that is, the features used by the local models of each participating terminal are inconsistent, the local models of each participating terminal are all part of the global classification model, and the intermediate terminal is provided with a post-processing module in the global classification model; the first global parameter information is obtained by the intermediate terminal based on the second sample classification result of the sample data and the corresponding pseudo-label, the second sample classification result is obtained by the intermediate terminal using the post-processing module based on the sample processing results of each participating terminal, and the first local parameter information is the parameter information about the local model in the first global parameter information.
[0052] Specifically, the local model of the participating end processes the sample data located at the participating end to obtain the sample processing result of the participating end, where the processing can be feature extraction, and the sample processing result can be the sample feature of the sample data. The participating end sends the sample feature to the intermediate end, and the intermediate end uses the post-processing module to process based on the sample features sent by each participating end to obtain the second sample classification result. Specifically, the intermediate end fuses the sample features to obtain the fused sample feature, and classifies based on the fused sample feature to obtain the second sample classification result. The first global parameter information is obtained using the second sample classification result and the corresponding pseudo label, and the first global parameter information includes parameter information about the local model of each participating end, from which the parameter information of the local model of each participating end is obtained to obtain the first local parameter information corresponding to each participating end, and the first local parameter information corresponding to each participating end is sent to the local model of each participating end, so as to adjust the parameters of the local model of each participating end using the first local parameter information corresponding to each participating end. The sample data located at the participating end and the subsequent steps are repeatedly executed until the preset conditions are met to obtain the trained global classification model.
[0053] Among them, the intermediate end performs classification based on the fused sample features to obtain the second sample classification result, including: the intermediate end directly uses the fused sample features to predict and obtain the second sample classification result, and at this time, based on the difference between the second sample classification result and the corresponding pseudo-label, the first global parameter information can be determined. In other embodiments, the intermediate end performs classification based on the fused sample features to obtain the second sample classification result, including: the intermediate end uses the fused sample features, other fused sample features belonging to the same category as the fused sample features, and pseudo-labels corresponding to other fused sample features to predict the second sample classification result of the fused sample features; at this time, the first global parameter information is determined based on the difference between the second sample classification result and the pseudo-label corresponding to the fused sample features, and the difference between the fused sample features and other fused sample features.
[0054] In one embodiment, the sample data includes sample data of multiple tasks; the training of the global classification model includes multi-stage training for each task respectively, and in the stage training of each task, each participating end and the intermediate end uses the sample data of the task for iterative training to obtain a global classification model that completes the stage training of the task, and after completing the stage training corresponding to each task, the second global parameter information sent by the intermediate end is obtained, wherein the second global parameter information is obtained based on the last first global parameter information of the global classification model corresponding to each task. At this time, the second global parameter information is as follows.
[0055]
[0056] Among them, n ij represents the number of sample data of the jth task of the ith participant. In vertical federated learning, it also represents the sum of the data of each participant on the jth task. is the sum of the statistical parameter information of each task, M is the second global parameter information, M j It is the final first global parameter information of the global classification model corresponding to the j-th task.
[0057] The above method, by aggregating the last first global parameter information of the global classification model corresponding to each task, can fully consider the local parameters of the local models of each participating end, and realize the global optimization of the global classification model. Through such central aggregation, the optimized model finally obtained has better performance and generalization ability, thereby more comprehensively capturing the characteristics and patterns of the data. The final global classification model can more accurately reflect the distribution of actual data during prediction, thereby improving the accuracy of the prediction.
[0058] See also Figure 2 , Figure 2 : is a flowchart of an implementation method of a pseudo label determination process provided by the present application. The pseudo label determination process includes:
[0059] S21: Extract features from the sample data of the participating terminals respectively to obtain feature extraction results for each sample data.
[0060] In one embodiment, for each sample data of the participating end, any existing feature extraction method can be used to extract features from each sample data to obtain feature extraction results of each sample data. It can be understood that when performing feature extraction, data that can represent the essential features of the sample data should be extracted. For each participating end in federated learning, feature extraction can be performed on the sample data of each participating end.
[0061] S22: Based on the feature extraction results of each sample data, determine the similarity between any two sample data in the feature space.
[0062] In one embodiment, the similarity of any two sample data can be determined by K-reciprocal Jaccard Distance (KRJD) distance measurement. In a specific embodiment, each sample data is used as the target sample data, and based on the feature extraction results of each sample data, a preset number of sample data close to the target sample data in the feature space is obtained to form a sample data set of the target sample data; at least based on the overlap between the sample data sets of any two sample data, the similarity of any two sample data in the feature space is determined. In one embodiment, the greater the overlap between the sample data sets of any two sample data, the higher the similarity of any two sample data in the feature space; in another embodiment, obtaining the overlap between the sample data sets of any two sample data is equivalent to obtaining the intersection of the sample data sets of any two sample data, and then determining the union of the sample data sets of any two sample data, obtaining the difference between the preset value and the ratio of the intersection and the union, and determining the similarity of any two sample data in the feature space. Specifically, the similarity of any two sample data in the feature space can be determined with reference to the following formula.
[0063] R(z,k)={z j |(z j ∈N(z,k))∩(z∈N(z j ,k))}
[0064]
[0065] Among them, R(z,k) is the sample data set of sample data z, J ij Represents two sample data z i and sample data z j K-reciprocal Jaccard distance (KRJD), J ij It is a value between 0 and 1, which is used to quantify the dissimilarity between two sample data in the feature space. The smaller the value, the more similar the two sample data are; the larger the value, the greater the difference between the two sample data.
[0066] In other implementations, the similarity between any two sample data may also be determined based on the cosine similarity between the feature extraction results of any two sample data.
[0067] S23: Perform clustering based on similarity to obtain clustering results.
[0068] In one embodiment, a DBSCAN (Density-Based Spatial Clustering of Applications with Noise) density-based clustering algorithm can be used to cluster data points in the feature space. DBSCAN can identify clusters of any shape and can identify and process noise points. In a specific embodiment, the maximum distance between two sample data in the feature space that is considered to be in the same neighborhood and the minimum number of points for an area to be considered dense can be set, and clustering can be performed based on the similarity between any two sample data.
[0069] Specifically, the clustering result can be obtained by referring to the following formula.
[0070]
[0071] in, represents the clustering result between any two sample data, ∈ represents the maximum distance between two sample data in the feature space that is considered to be in the same neighborhood, ms represents the minimum number of points that an area is considered to be dense, and J represents the distance between two sample data z i and sample data z j K-reciprocal Jaccard distance.
[0072] S24: Assign the same pseudo label to sample data belonging to the same category to obtain a pseudo label for each sample data.
[0073] Among them, the pseudo label can be a label, a letter, or a number, and the pseudo label is not the real sample label. The pseudo label of each category of sample data can be assigned by the device.
[0074] In this implementation, the pseudo labels of each sample data may be obtained by a global classification model. After the global classification model obtains the sample data, it may process the sample data in the manner provided in this embodiment to obtain the pseudo labels of the sample data.
[0075] In other embodiments, in order to further improve the accuracy of the global classification model, the pseudo-label may be updated after the parameter adjustment of the local model of the participating terminal is performed according to the first local parameter information each time or part of the times. For example, the pseudo-label may be updated after the parameter adjustment of the local model of the participating terminal is performed once; the updated pseudo-label is used to obtain new first global parameter information, and the local model of the participating terminal is adjusted once according to the first local parameter information in the new first global parameter information, and the pseudo-label is updated again, and this cycle is repeated until the preset condition is met.
[0076] For another example, after adjusting the parameters of the local model of the participating terminal for a certain number of times, the pseudo label can be updated; using the updated pseudo label, new first global parameter information can be obtained, and after adjusting the parameters of the local model of the participating terminal for a certain number of times according to the first local parameter information in the new first global parameter information, the pseudo label can be updated again, and the cycle is repeated until the preset condition is met. The number of times can be 2, 3, 4, etc., which is not limited here.
[0077] The process of updating the pseudo-label includes: processing the sample data of the participating end using the local model with adjusted parameters of the participating end to obtain the reference sample processing result; and updating the pseudo-label of the sample data based on the reference sample classification result.
[0078] In one implementation, the local model is a global classification model, the reference sample processing result is a reference sample classification result, and the reference sample classification result is used as an updated pseudo label.
[0079] In another embodiment, the local model is part of the global classification model, the reference sample processing result is the sample feature obtained by extracting the sample data, the sample feature is sent to the middle end, and the middle end processes the sample feature using the post-processing module to obtain the reference sample classification result. Please refer to the above description for the steps of processing the sample feature by the middle end using the post-processing module, which will not be repeated here.
[0080] In the present application, in order to avoid information leakage, the interactive data between each participating end and the intermediate end can be encrypted, that is, the sample processing result, the first global parameter information and the second global parameter information can all be encrypted.
[0081] In a specific implementation, the global classification model is trained using horizontal federated learning, and the specific training process includes:
[0082] For each participating terminal, the following steps are performed: determine the pseudo-label of the sample data located at the participating terminal, construct multiple scenario tasks, each scenario task contains multiple sample data, and the multiple sample data belong to different pseudo-labels; the same or different sample data can exist in each scenario task. The multiple sample data in each scenario task are divided into query data and support data. The current query data in the query data of the current scenario task, the current support data in the support data of the current scenario task, and the pseudo-label of the current support data are input into the local model of the participating terminal, wherein the current query data and the current support data have the same pseudo-label, and the local model of the participating terminal outputs the first sample classification result of the current query data, and uses the prototype loss function based on the difference between the first sample classification result and the pseudo-label of the current query data, and the difference between the current query data and the current support data, to determine the second local parameter information about the local model of the participating terminal. The participating terminal sends the second local parameter information to the intermediate terminal.
[0083] The middle end obtains the second local parameter information sent by each participating end in the federated learning, and each second local parameter information corresponds to the same scenario task. Aggregate each second local parameter information to obtain the first global parameter information, which is the first local parameter information of the local model of each participating end. Send the first global parameter information to each participating end.
[0084] The local model of each participating terminal adjusts its own parameters to the first global parameter information, and re-executes the current query data in the query data of the current scenario task, the current support data in the support data of the current scenario task, and the pseudo-label of the current support data into the local model of the participating terminal and subsequent steps until the preset conditions are met, the training of the current scenario task is completed, and the training of the next scenario task is started until all scenario tasks are trained.
[0085] After all scenario tasks are trained, the middle end averages the first global parameter information obtained from the last training of each scenario task to obtain the second global parameter information, and sends the second global parameter information to each participating end. The local model of each participating end adjusts its own parameters to the second global parameter information to obtain the trained local model of each participating end. Among them, the trained local model of any participating end is a global classification model.
[0086] In another specific implementation, the global classification model is trained using vertical federated learning, and the specific training process includes:
[0087] For each participating terminal, the following steps are performed: determine the pseudo labels of the sample data at the participating terminal, construct multiple scenario tasks, each scenario task contains multiple sample data, and the multiple sample data belong to different pseudo labels; input the current query data in the query data of the current scenario task into the local model of the participating terminal, and the local model of the participating terminal outputs the feature extraction result of the current query data. The participating terminal sends the feature extraction result of the current query data to the intermediate terminal.
[0088] The middle end obtains each feature extraction result sent by each participating end in the federated learning, and each feature extraction result corresponds to the same scenario task and the same pseudo-label. Aggregate each feature extraction result to obtain the aggregated feature, and use the aggregated feature to obtain the second sample classification result; based on the second sample classification result and the corresponding pseudo-label, obtain the first global parameter information, the first global parameter information includes the first local parameter information of each participating end, send the first local parameter information of each participating end to each participating end respectively, use each first local parameter information to adjust the parameters of the local model of each participating end, and repeat the input of the current query data in the query data of the current scenario task into the local model of the participating end and its subsequent steps until the preset conditions are met, the training of the current scenario task is completed, and the training of the next scenario task is started until all scenario tasks are trained.
[0089] After all scenario tasks are trained, the middle end averages the first global parameter information obtained from the last training of each scenario task to obtain the second global parameter information, and sends each second local parameter information in the second global parameter information to each participating end, and each participating end uses each second local parameter information to adjust the parameters of the local model of each participating end to obtain the trained local model of each participating end. Among them, the trained local models of each participating end are all part of the global classification model, and the trained local models of each participating end and the middle end together constitute the global classification model.
[0090] See also Figure 3 , Figure 3 : is a flow chart of an implementation method of a classification model training method provided by the present application, the method comprising:
[0091] S31: Process the sample data at the participating end using the local model of the participating end to obtain the sample processing result of the participating end.
[0092] S32: Receive first local parameter information about the local model of the participating end sent by the intermediate end.
[0093] Among them, the intermediate end is used to obtain the current first global parameter information of the global classification model, the local model of the participating end contains various parts of the global classification model or is a part of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating end and the corresponding pseudo-label.
[0094] S33: Adjust the parameters of the local model of the participating terminal according to the first local parameter information, and repeat the above training process until the preset conditions are met to obtain a trained global classification model. The parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model.
[0095] This implementation can be performed by each participating terminal, that is, each participating terminal processes the sample data located locally, receives the first local parameter information sent by the intermediate terminal, and updates the parameters of the local model according to the first local parameter information. Please refer to the above description for the specific implementation of this implementation, which will not be repeated here.
[0096] See also Figure 4 , Figure 4 It is a flow chart of another embodiment of the classification model training method provided by the present application, and the method comprises:
[0097] S41: receiving local training information sent by each participating terminal.
[0098] S42: Based on the local training information, determine the current global parameter information of the global classification model.
[0099] S43: Based on the current global parameter information of the global classification model, determine the first local parameter information about the local model of each participating terminal, and send the first local parameter information of each participating terminal to each participating terminal, so that each participating terminal adjusts the parameters of the local model of the participating terminal according to the first local parameter information.
[0100] S44: Repeat the above training process until the preset conditions are met to obtain a trained global classification model, and the parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model.
[0101] Among them, when the local model of each participating terminal contains various parts of the global classification model, that is, the local model of each participating terminal is a global classification model, the first local parameter information of each participating terminal is global parameter information, and the local training information of the participating terminal is the second local parameter information of the local model determined by the participating terminal based on the first sample classification result and the pseudo-label of the sample data. The first sample classification result is obtained by the participating terminal processing the sample data using the local model of the participating terminal, and the global parameter information is obtained by aggregating the second local parameter information of each participating terminal.
[0102] In the case where the local model of each participating terminal is part of the global classification model, the first local parameter information of each participating terminal is partial parameter information about the local model of the participating terminal in the global parameter information, the local training information of the participating terminal is the sample processing result obtained by the participating terminal using the local model of the participating terminal to process the sample data, the sample processing result may be the sample feature of the sample data, the global parameter information is the parameter information of the global classification model determined by using the second sample classification result and the pseudo-label of the sample data, and the second sample classification result is obtained by post-processing the post-processing module of the global classification model based on the sample processing results of each participating terminal.
[0103] This implementation can be executed by the middle end. For the specific implementation of this implementation, please refer to the above description and will not be repeated here.
[0104] See also Figure 5 , Figure 5 It is a schematic diagram of the framework structure of an implementation scheme of a data classification device provided in this application.
[0105] The data classification device 50 includes an acquisition module 51 and a classification module 52. The acquisition module 51 is used to acquire the data to be classified; the classification module 52 is used to process the data to be classified using the local model of the participating end to obtain the classification result of the global classification model for the data to be classified; wherein the local model of the participating end is the global classification model or a part of the global classification model, the global classification model is trained using federated learning, and the global classification model is trained using at least sample data with pseudo labels.
[0106] In one embodiment, there are multiple participating terminals in federated learning, each of which has a local model, and the local model of each participating terminal is a global classification model or a part of the global classification model; the data classification device 50 also includes a training module, and for each participating terminal, the training module is used to use the local model of the participating terminal to process the sample data located at the participating terminal to obtain the sample processing result of the participating terminal; receive the first local parameter information about the local model of the participating terminal sent by the intermediate terminal, wherein the intermediate terminal is used to obtain the current first global parameter information of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating terminal and the corresponding pseudo-label; adjust the parameters of the local model of the participating terminal according to the first local parameter information, and repeat the training process until the preset conditions are met to obtain a trained global classification model, and the parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model.
[0107] In one embodiment, the local models of each participating terminal use consistent features and are all global classification models, and the sample processing result is the first sample classification result of the sample data; after the sample data located at the participating terminal is processed using the local model of the participating terminal to obtain the sample processing result of the participating terminal, the training module is also used to determine the second local parameter information about the local model of the participating terminal based on the first sample classification result of the participating terminal and the corresponding pseudo-label, and send the second local parameter information to the intermediate terminal, wherein the first global parameter information is obtained by the intermediate terminal aggregating the second local parameter information sent by each participating terminal, and the first global parameter information is used as the first local parameter information.
[0108] In one embodiment, the sample data includes sample data of multiple tasks, and the sample data of each task includes query data and support data; the training of the global classification model includes stage training for each task respectively, and in the stage training of each task, each participating end and the intermediate end uses the sample data of the task to perform iterative training to obtain a global classification model that completes the stage training of the task; the training module is also used to find out the current query data from the query data belonging to the task in the participating end, and to find out the current support data from the support data belonging to the task in the participating end; the current query data, the current support data and the pseudo-label of the current support data are input into the local model of the participating end, so that the local model of the participating end outputs the first sample classification result of the current query data with reference to the current support data and the pseudo-label of the current support data; the training module can also determine the second local parameter information about the local model of the participating end based on the difference between the first sample classification result of the participating end and the pseudo-label of the current query data, and the difference between the current query data and the current support data.
[0109] In one embodiment, the features used by the local models of each participating terminal are inconsistent and are all part of the global classification model. The intermediate terminal is provided with a post-processing module in the global classification model; the first global parameter information is obtained by the intermediate terminal based on the second sample classification result of the sample data and the corresponding pseudo-label, and the second sample classification result is obtained by the intermediate terminal using the post-processing module based on the sample processing results of each participating terminal, and the first local parameter information is the parameter information about the local model in the first global parameter information.
[0110] In one embodiment, the sample data includes sample data of multiple tasks; the training of the global classification model includes multi-stage training for each task respectively, and in the stage training of each task, each participating end and the intermediate end uses the sample data of the task to perform iterative training to obtain a global classification model that completes the stage training of the task; after completing the stage training corresponding to each task, the training module is also used to obtain the second global parameter information sent by the intermediate end, wherein the second global parameter information is obtained based on the final first global parameter information of the global classification model corresponding to each task; the local model of the participating end is adjusted using the second global parameter information to obtain the trained local model of the participating end.
[0111] In one embodiment, the second global parameter information is the ratio of the sum of the statistical parameter information of each task to the sum of the data volume of each task of each participating end, and the statistical parameter information of the task is the product of the last first global parameter information of the global classification model corresponding to the task and the sum of the data volume of each participating end about the task.
[0112] In one embodiment, the data classification device 50 also includes a pseudo-label determination module, which is used to perform feature extraction on the sample data of the participating terminals respectively to obtain feature extraction results of each sample data; based on the feature extraction results of each sample data, determine the similarity between any two sample data in the feature space; perform clustering based on the similarity to obtain clustering results; assign the same pseudo-label to sample data belonging to the same category to obtain a pseudo-label for each sample data.
[0113] In one embodiment, the pseudo-label determination module is also used to take each sample data as the target sample data, and based on the feature extraction results of each sample data, obtain a preset number of sample data that are close to the target sample data in the feature space to form a sample data set of the target sample data; and determine the similarity of any two sample data in the feature space based on at least the overlap between the sample data sets of any two sample data.
[0114] In one embodiment, the data classification device 50 also includes a pseudo-label updating module. After each or partial execution of parameter adjustment of the local model of the participating terminal according to the first local parameter information, the pseudo-label updating module is used to process the sample data of the participating terminal using the local model of the participating terminal after parameter adjustment to obtain a reference sample processing result; based on the reference sample classification result, the pseudo-label of the sample data is updated, wherein, when the local model is a global classification model, the reference sample classification result is the reference sample processing result, and when the local model is part of the global classification model, the reference sample classification result is obtained by post-processing the post-processing module of the global classification model based on the reference sample processing result.
[0115] See also Figure 6 , Figure 6 It is a schematic diagram of the framework structure of an implementation scheme of a classification model training device provided in this application.
[0116] The classification model training device in this embodiment can be a first classification model training device 60, which includes a processing module 61, a first receiving module 62, a parameter adjustment module 63 and a first repetition module 64. The processing module 61 is used to use the local model of the participating end to process the sample data located at the participating end to obtain the sample processing result of the participating end; the first receiving module 62 is used to receive the first local parameter information about the local model of the participating end sent by the intermediate end, wherein the intermediate end is used to obtain the current first global parameter information of the global classification model, the local model of the participating end includes various parts of the global classification model or is a part of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating end and the corresponding pseudo-label; the parameter adjustment module 63 is used to adjust the parameters of the local model of the participating end according to the first local parameter information; the first repetition module 64 is used to repeatedly execute the above training process until the preset conditions are met to obtain the trained global classification model, and the parameters of the local model of each participating end are updated based on the parameters of the trained global classification model.
[0117] See also Figure 7 , Figure 7 It is a schematic diagram of the framework structure of another embodiment of the classification model training device provided in this application.
[0118] The classification model training device in this embodiment can be a second classification model training device 70, which includes a second receiving module 71, a global parameter module 72, a local parameter module 73 and a second repetition module 74. The second receiving module 71 is used to receive local training information sent by each participating terminal; the global parameter module 72 is used to determine the current global parameter information of the global classification model based on the local training information; the local parameter module 73 is used to determine the first local parameter information about the local model of each participating terminal based on the current global parameter information of the global classification model, and send the first local parameter information of each participating terminal to each participating terminal, so that each participating terminal adjusts the parameters of the local model of the participating terminal according to the first local parameter information; the second repetition module 74 is used to repeatedly execute the above training process until the preset conditions are met to obtain a trained global classification model, and the parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model.
[0119] Among them, in the case where the local model of each participating terminal includes parts of the global classification model, the first local parameter information of each participating terminal is the global parameter information, the local training information of the participating terminal is the second local parameter information of the local model determined by the participating terminal based on the first sample classification result and the pseudo-label of the sample data, the first sample classification result is obtained by the participating terminal using the local model of the participating terminal to process the sample data, and the global parameter information is obtained by aggregating the second local parameter information of each participating terminal; in the case where the local model of each participating terminal is a part of the global classification model, the first local parameter information of each participating terminal is part of the parameter information about the local model of the participating terminal in the global parameter information, the local training information of the participating terminal is the sample processing result obtained by the participating terminal using the local model of the participating terminal to process the sample data, the global parameter information is the parameter information of the global classification model determined by the second sample classification result and the pseudo-label of the sample data, and the second sample classification result is obtained by the post-processing module of the global classification model based on the sample processing results of each participating terminal.
[0120] See also Figure 8 , Figure 8 It is a schematic diagram of the framework structure of an embodiment of an electronic device provided in the present application.
[0121] The electronic device 80 includes a memory 81 and a processor 82 coupled to each other, the memory 81 stores program instructions, and the processor 82 is used to execute the program instructions stored in the memory 81 to implement the steps of any of the above method implementations. In a specific implementation scenario, the electronic device 80 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 80 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0122] Specifically, the processor 82 is used to control itself and the memory 81 to implement the steps of any of the above-mentioned method implementation methods. The processor 82 can also be called a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip with signal processing capabilities. The processor 82 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 82 can be implemented by an integrated circuit chip.
[0123] See also Fig. 9 , Fig. 9 It is a schematic diagram of the framework structure of an implementation method of a computer-readable storage medium provided in this application.
[0124] The computer-readable storage medium 90 stores program instructions 91 , and when the program instructions 91 are executed by a processor, they are used to implement the steps of any of the above-mentioned method implementations.
[0125] The computer-readable storage medium 90 may specifically be a medium that can store computer programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the computer program. The server may send the stored computer program to other devices for execution, or may also execute the stored computer program itself.
[0126] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0127] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0131] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0132] The above are only implementation methods of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A data classification method, characterized in that: include: Obtain data to be classified; The data to be classified is processed using the local model of the participating terminal to obtain the classification result of the global classification model on the data to be classified; wherein the local model of the participating terminal is the global classification model or a part of the global classification model, the global classification model is trained using federated learning, and the global classification model is trained using at least sample data with pseudo labels.
2. The method according to claim 1, characterized in that There are multiple participating terminals in the federated learning, each of which has a local model, and the local model of each participating terminal is the global classification model or a part of the global classification model; The training process of the global classification model includes: For each of the participating terminals, the sample data located at the participating terminal is processed using the local model of the participating terminal to obtain the sample processing result of the participating terminal; Receiving first local parameter information about the local model of the participating end sent by the intermediate end, wherein the intermediate end is used to obtain the current first global parameter information of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating end and the corresponding pseudo label; The parameters of the local models of the participating terminals are adjusted according to the first local parameter information, and the training process is repeated until the preset conditions are met to obtain the trained global classification model. The parameters of the local models of each participating terminal are updated based on the parameters of the trained global classification model.
3. The method according to claim 2, characterized in that The local models of the participating terminals use the same features and are all the global classification models, and the sample processing result is the first sample classification result of the sample data; After the sample data at the participant terminal is processed by the local model of the participant terminal to obtain the sample processing result of the participant terminal, the method further includes: Based on the first sample classification result of the participating end and the corresponding pseudo-label, second local parameter information about the local model of the participating end is determined, and the second local parameter information is sent to the intermediate end, wherein the first global parameter information is obtained by aggregating the second local parameter information sent by each of the participating ends by the intermediate end, and the first global parameter information is used as the first local parameter information.
4. The method according to claim 3, characterized in that The sample data includes sample data of multiple tasks, and the sample data of each task includes query data and support data; the training of the global classification model includes stage training for each task respectively, and in the stage training of each task, each participating terminal and the intermediate terminal performs iterative training using the sample data of the task to obtain a global classification model that completes the stage training of the task; In the stage training process corresponding to the task, the sample data located at the participant terminal is processed by using the local model of the participant terminal to obtain the sample processing result of the participant terminal, including: Finding the current query data from the query data belonging to the task in the participating terminal, and finding the current support data from the support data belonging to the task in the participating terminal; Inputting the current query data, the current support data, and the pseudo-label of the current support data into the local model of the participating end, so that the local model of the participating end outputs a first sample classification result of the current query data with reference to the current support data and the pseudo-label of the current support data; The determining, based on the first sample classification result of the participating terminal and the corresponding pseudo label, second local parameter information about the local model of the participating terminal includes: Based on the difference between the first sample classification result of the participating terminal and the pseudo label of the current query data, and the difference between the current query data and the current support data, second local parameter information about the local model of the participating terminal is determined.
5. The method according to claim 2, characterized in that: The features used by the local models of each participating end are inconsistent and are all part of the global classification model. The intermediate end is provided with a post-processing module in the global classification model; the first global parameter information is obtained by the intermediate end based on the second sample classification result of the sample data and the corresponding pseudo-label, and the second sample classification result is obtained by the intermediate end by post-processing based on the sample processing results of each participating end using the post-processing module, and the first local parameter information is the parameter information about the local model in the first global parameter information.
6. The method according to any one of claims 2 to 5, characterized in that: The sample data includes sample data of multiple tasks; the training of the global classification model includes multi-stage training for each task respectively, and in the stage training of each task, each participating terminal and the intermediate terminal uses the sample data of the task to perform iterative training to obtain a global classification model that completes the stage training of the task; The training process of the global classification model also includes: After completing the stage training corresponding to each task, obtaining the second global parameter information sent by the intermediate end, wherein the second global parameter information is obtained based on the last first global parameter information of the global classification model corresponding to each task; The second global parameter information is used to adjust the parameters of the local model of the participating terminal to obtain a trained local model of the participating terminal.
7. The method according to claim 6, characterized in that The second global parameter information is the ratio of the sum of the statistical parameter information of each task to the sum of the data volume of each task of each participating terminal. The statistical parameter information of the task is the product of the last first global parameter information of the global classification model corresponding to the task and the sum of the data volume of each participating terminal regarding the task.
8. The method according to any one of claims 2 to 5, characterized in that: The method further comprises: Performing feature extraction on the sample data of the participating terminals respectively to obtain feature extraction results of each sample data; Based on the feature extraction results of each of the sample data, determine the similarity between any two of the sample data in the feature space; Perform clustering based on the similarity to obtain a clustering result; The same pseudo label is assigned to the sample data belonging to the same category to obtain a pseudo label for each sample data.
9. The method according to claim 8, characterized in that The determining the similarity between any two sample data in the feature space based on the feature extraction results of each sample data includes: Taking each sample data as target sample data respectively, and based on the feature extraction results of each sample data, obtaining a preset number of sample data close to the target sample data in the feature space to form a sample data set of the target sample data; The similarity between the arbitrary two sample data in the feature space is determined based at least on the overlap between the sample data sets of the arbitrary two sample data.
10. The method according to any one of claims 2 to 5, characterized in that: After performing the parameter adjustment of the local model of the participating terminal according to the first local parameter information each time or part of the times, the method further includes: Processing the sample data of the participant terminal using the local model whose parameters have been adjusted by the participant terminal to obtain a reference sample processing result; Based on the reference sample classification result, the pseudo label of the sample data is updated, wherein, when the local model is the global classification model, the reference sample classification result is the reference sample processing result, and when the local model is a part of the global classification model, the reference sample classification result is obtained by post-processing by the post-processing module of the intermediate end based on the reference sample processing result.
11. A classification model training method, characterized in that: include: Processing the sample data at the participating end using the local model of the participating end to obtain the sample processing result of the participating end; Receiving first local parameter information about the local model of the participating end sent by the intermediate end, wherein the intermediate end is used to obtain the current first global parameter information of the global classification model, the local model of the participating end includes various parts of the global classification model or is a part of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating end and the corresponding pseudo label; The parameters of the local models of the participating terminals are adjusted according to the first local parameter information, and the above training process is repeated until the preset conditions are met to obtain the trained global classification model. The parameters of the local models of each participating terminal are updated based on the parameters of the trained global classification model.
12. A classification model training method, characterized in that: include: Receive local training information sent by each participating terminal; Based on the local training information, determining current global parameter information of the global classification model; Determine first local parameter information about the local model of each of the participating terminals based on the current global parameter information of the global classification model, and send the first local parameter information of each of the participating terminals to each of the participating terminals, so that each of the participating terminals adjusts the parameters of the local model of the participating terminals according to the first local parameter information; Repeat the above training process until the preset conditions are met to obtain the trained global classification model, and the parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model; Wherein, in the case where the local model of each participating terminal includes various parts of the global classification model, the first local parameter information of each participating terminal is the global parameter information, the local training information of the participating terminal is the second local parameter information of the local model determined by the participating terminal based on the first sample classification result and the pseudo label of the sample data, the first sample classification result is obtained by the participating terminal using the local model of the participating terminal to process the sample data, and the global parameter information is obtained by aggregating the second local parameter information of each participating terminal; In the case where the local model of each participating terminal is a part of the global classification model, the first local parameter information of each participating terminal is partial parameter information about the local model of the participating terminal in the global parameter information, the local training information of the participating terminal is the sample processing result obtained by the participating terminal using the local model of the participating terminal to process the sample data, the global parameter information is the parameter information of the global classification model determined by using the second sample classification result and the pseudo-label of the sample data, and the second sample classification result is obtained by post-processing the post-processing module of the global classification model based on the sample processing results of each participating terminal.
13. A data classification device, characterized in that: include: An acquisition module, used to acquire data to be classified; A classification module is used to process the data to be classified using the local model of the participating terminal to obtain the classification result of the global classification model on the data to be classified; wherein the local model of the participating terminal is the global classification model or a part of the global classification model, the global classification model is trained using federated learning, and the global classification model is trained using at least sample data with pseudo labels.
14. A classification model training device, characterized in that: include: A processing module, used to process the sample data located at the participating end using the local model of the participating end to obtain the sample processing result of the participating end; A first receiving module receives first local parameter information about the local model of the participating end sent by the intermediate end, wherein the intermediate end is used to obtain the current first global parameter information of the global classification model, the local model of the participating end includes various parts of the global classification model or is a part of the global classification model, the first global parameter information includes the first local parameter information, and the determination of the first global parameter information is related to the sample processing results of each participating end and the corresponding pseudo label; A parameter adjustment module, used for adjusting the parameters of the local model of the participating terminal according to the first local parameter information; The first repetition module is used to repeatedly execute the above training process until the preset conditions are met to obtain the trained global classification model, and the parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model.
15. A classification model training device, characterized in that: include: A second receiving module is used to receive local training information sent by each participating terminal; A global parameter module, used to determine current global parameter information of the global classification model based on the local training information; A local parameter module, used to determine first local parameter information about the local model of each of the participating terminals based on the current global parameter information of the global classification model, and send the first local parameter information of each of the participating terminals to each of the participating terminals, so that each of the participating terminals adjusts the parameters of the local model of the participating terminals according to the first local parameter information; A second repetition module is used to repeatedly execute the above training process until a preset condition is met to obtain the trained global classification model, and the parameters of the local model of each participating terminal are updated based on the parameters of the trained global classification model; Wherein, in the case where the local model of each participating terminal includes various parts of the global classification model, the first local parameter information of each participating terminal is the global parameter information, the local training information of the participating terminal is the second local parameter information of the local model determined by the participating terminal based on the first sample classification result and the pseudo label of the sample data, the first sample classification result is obtained by the participating terminal using the local model of the participating terminal to process the sample data, and the global parameter information is obtained by aggregating the second local parameter information of each participating terminal; In the case where the local model of each participating terminal is a part of the global classification model, the first local parameter information of each participating terminal is partial parameter information about the local model of the participating terminal in the global parameter information, the local training information of the participating terminal is the sample processing result obtained by the participating terminal using the local model of the participating terminal to process the sample data, the global parameter information is the parameter information of the global classification model determined by using the second sample classification result and the pseudo-label of the sample data, and the second sample classification result is obtained by post-processing the post-processing module of the global classification model based on the sample processing results of each participating terminal.
16. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores program instructions, and the processor is configured to execute the program instructions to implement the method according to any one of claims 1 to 12.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the method according to any one of claims 1 to 12.
