Classification model training, data classification method, device and computer equipment

By obtaining the training sample set, determining the reference classification model and performing feature fusion, and adjusting the classification model parameters, the problem of low classification accuracy in traditional technology is solved, and more accurate data feature extraction and classification results are achieved.

CN115130539BActive Publication Date: 2024-11-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210421701.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-21
Publication Date
2024-11-08
Estimated Expiration
2042-04-21

AI Technical Summary

Technical Problem

In traditional technology, the classification model blindly trained based on training samples leads to low classification accuracy and the inability to effectively extract data features.

Method used

By obtaining the training sample set, at least two reference classification models are determined, feature fusion is performed based on the class-center features, and the initial classification model parameters are adjusted until the convergence conditions are met to obtain a more accurate target classification model.

Benefits of technology

The classification accuracy of the model and the classification accuracy of the data are improved, and more accurate classification results are achieved through more accurate feature distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115130539B_ABST
    Figure CN115130539B_ABST
Patent Text Reader

Abstract

The present application relates to a classification model training, data classification method, device, computer equipment, storage medium and computer program product. The present application relates to artificial intelligence technology. The method comprises: determining at least two reference classification models from a first target classification model and a second target classification model set obtained by training based on a training sample set; the second target classification model and the first target classification model included in the second target classification model set are feature space aligned; the reference sample features obtained by inputting the same training sample into each reference classification model are fused to obtain the target sample features; the training sample is input into a third initial classification model to obtain the training sample features, and the model parameters of the third initial classification model are adjusted based on the target sample features and the training sample features corresponding to the same training sample until the target convergence conditions are met to obtain the third target classification model. The use of this method can improve the classification accuracy of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a classification model training, a data classification method, an apparatus, a computer device, a storage medium and a computer program product. Background Art

[0002] With the development of computer technology, machine learning has emerged. Machine learning is a multi-disciplinary interdisciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.

[0003] In traditional technology, supervised training is usually performed directly on the classification model to be trained based on the training samples to obtain the trained classification model. However, the knowledge learned by blind training based on the training samples is limited, which easily leads to low classification accuracy of the trained model. Summary of the invention

[0004] Based on this, it is necessary to provide a classification model training, data classification method, device, computer equipment, computer-readable storage medium and computer program product that can improve the classification accuracy of the model in response to the above technical problems.

[0005] A classification model training method. The method comprises:

[0006] Acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples;

[0007] Determine at least two reference classification models from a first target classification model and a second target classification model set obtained by training based on the training sample set; in the second target classification model included in the second target classification model set, class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent position information of the training labels in the feature space;

[0008] Input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and fuse the reference sample features corresponding to the same training sample to obtain target sample features corresponding to each training sample;

[0009] The training sample set is input into a third initial classification model to obtain training sample features corresponding to each training sample, and based on the target sample features and training sample features corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence conditions are met to obtain a third target classification model.

[0010] A classification model training device. The device comprises:

[0011] A training sample set acquisition module is used to acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples;

[0012] A reference classification model determination module, used to determine at least two reference classification models from a first target classification model and a second target classification model set obtained by training based on the training sample set; in the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space;

[0013] A feature fusion module is used to input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and to fuse each reference sample feature corresponding to the same training sample to obtain target sample features corresponding to each training sample;

[0014] The third target classification model determination module is used to input the training sample set into the third initial classification model to obtain the training sample features corresponding to each training sample, and adjust the model parameters of the third initial classification model based on the target sample features and training sample features corresponding to the same training sample until the target convergence conditions are met to obtain the third target classification model.

[0015] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps described in the above-mentioned classification model training method when executing the computer program.

[0016] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above-mentioned classification model training method.

[0017] A computer program product includes a computer program, and when the computer program is executed by a processor, the steps described in the above-mentioned classification model training method are implemented.

[0018] A data classification method. The method comprises:

[0019] Acquire data to be classified, input the data to be classified into a third target classification model, and obtain target features corresponding to the data to be classified;

[0020] Determine a classification result corresponding to the data to be classified based on the target feature;

[0021] The training process of the third target classification model is as follows:

[0022] Acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples;

[0023] Determine at least two reference classification models from a first target classification model and a second target classification model set obtained by training based on the training sample set; in the second target classification model included in the second target classification model set, class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent position information of the training labels in the feature space;

[0024] Input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and fuse the reference sample features corresponding to the same training sample to obtain target sample features corresponding to each training sample;

[0025] The training sample set is input into a third initial classification model to obtain training sample features corresponding to each training sample, and based on the target sample features and training sample features corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence conditions are met to obtain a third target classification model.

[0026] A data classification device. The device comprises:

[0027] A data acquisition module, used to acquire data to be classified, input the data to be classified into a third target classification model, and obtain target features corresponding to the data to be classified;

[0028] A classification result determination module, used to determine the classification result corresponding to the data to be classified based on the target feature;

[0029] The training process of the third target classification model is as follows:

[0030] Acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples;

[0031] Determine at least two reference classification models from a first target classification model and a second target classification model set obtained by training based on the training sample set; in the second target classification model included in the second target classification model set, class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent position information of the training labels in the feature space;

[0032] Input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and fuse the reference sample features corresponding to the same training sample to obtain target sample features corresponding to each training sample;

[0033] The training sample set is input into a third initial classification model to obtain training sample features corresponding to each training sample, and based on the target sample features and training sample features corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence conditions are met to obtain a third target classification model.

[0034] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above data classification method when executing the computer program.

[0035] A computer-readable storage medium stores a computer program, which implements the steps of the above data classification method when executed by a processor.

[0036] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the steps of the above-mentioned data classification method are implemented.

[0037] The above-mentioned classification model training, data classification method, device, computer equipment, storage medium and computer program product obtain a training sample set, which includes training samples and training labels corresponding to the training samples. At least two reference classification models are determined from the first target classification model and the second target classification model set obtained by training based on the training sample set. In the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space. The training sample set is input into each reference classification model to obtain the reference sample features corresponding to each training sample, and the reference sample features corresponding to the same training sample are integrated to obtain the target sample features corresponding to each training sample. The training sample set is input into the third initial classification model to obtain the training sample features corresponding to each training sample, and the model parameters of the third initial classification model are adjusted based on the target sample features and training sample features corresponding to the same training sample until the target convergence conditions are met to obtain the third target classification model. In this way, the class center feature is used to represent the position of the training label in the feature space. The class center features in the second target classification model are obtained from the first target classification model. Therefore, the second target classification model and the first target classification model are feature space aligned, and the feature space distribution of the second target classification model and the first target classification model are consistent. The reference classification models determined from the first target classification model and the second target classification model are also feature space aligned. The reference classification models aligned in feature space are complementary models, and there is complementarity between the extracted features. Furthermore, by combining multiple reference classification models for feature fusion and using the fused target sample features to train the third initial classification model, the third initial classification model can learn a more accurate feature distribution of the fused features, so that the trained third target classification model can extract more accurate data features of the input data, and more accurate classification results can be obtained based on more accurate data features, thereby improving the classification accuracy of the model and the classification accuracy of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 An application environment diagram of a classification model training method and a data classification method in one embodiment;

[0039] Figure 2 A schematic diagram of a flow chart of a classification model training method in one embodiment;

[0040] Figure 3 is a schematic diagram of feature fusion in one embodiment;

[0041] Figure 4A schematic diagram of a process of training a first target classification model and a second target classification model in one embodiment;

[0042] Figure 5A A schematic diagram of a process of training a first target classification model in one embodiment;

[0043] Figure 5B A schematic diagram of a process of training a second target classification model in one embodiment;

[0044] Figure 6 A schematic diagram of a process of training a third target classification model in one embodiment;

[0045] Figure 7 is a flow chart of a data classification method in one embodiment;

[0046] Fig. 8A A schematic diagram of model training and model deployment in one embodiment;

[0047] Figure 8B A schematic diagram of a process of performing knowledge distillation on a small recognition network in one embodiment;

[0048] Figure 8C A schematic diagram of a process of model deployment in one embodiment;

[0049] Fig. 9 is a structural block diagram of a classification model training device in one embodiment;

[0050] Fig.10 is a structural block diagram of a data classification device in one embodiment;

[0051] Fig.11 is an internal structure diagram of a computer device in one embodiment;

[0052] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] It is understood that the terms "first", "second", etc. used in this application can be used in this article to describe various data, but these data are not limited by these terms. These terms are only used to distinguish one data from another data. For example, without departing from the scope of this application, the first target classification model can be referred to as the second target classification model, and similarly, the second target classification model can be referred to as the first target classification model. Both the first target classification model and the second target classification model are target classification models, but they are not the same target classification model.

[0055] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0056] The solution provided in the embodiments of the present application involves artificial intelligence computer vision technology, machine learning and other technologies, which are specifically described by the following embodiments:

[0057] The classification model training method and data classification method provided in the embodiments of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers or a cloud server.

[0058] Both the terminal and the server can be used independently to execute the classification model training method and the data classification method provided in the embodiments of the present application.

[0059] For example, the server obtains a training sample set locally, and the training sample set includes training samples and training labels corresponding to the training samples. The server determines at least two reference classification models from the first target classification model and the second target classification model set obtained by training based on the training sample set. Among them, in the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space. The server inputs the training sample set into each reference classification model to obtain the reference sample features corresponding to each training sample, and fuses the reference sample features corresponding to the same training sample to obtain the target sample features corresponding to each training sample. The server inputs the training sample set into the third initial classification model to obtain the training sample features corresponding to each training sample, and adjusts the model parameters of the third initial classification model based on the target sample features and training sample features corresponding to the same training sample until the target convergence condition is met to obtain the third target classification model.

[0060] The server obtains the data to be classified, inputs the data to be classified into a third target classification model, obtains target features corresponding to the data to be classified, and determines a classification result corresponding to the data to be classified based on the target features.

[0061] The terminal and the server can also be used together to execute the classification model training method and data classification method provided in the embodiments of the present application.

[0062] For example, the server obtains a training sample set from the terminal, and determines at least two reference classification models from the first target classification model and the second target classification model obtained by training based on the training sample set. The server inputs the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and fuses each reference sample feature corresponding to the same training sample to obtain target sample features corresponding to each training sample. The server inputs the training sample set into the third initial classification model to obtain training sample features corresponding to each training sample, and adjusts the model parameters of the third initial classification model based on the target sample features and training sample features corresponding to the same training sample until the target convergence condition is met to obtain the third target classification model.

[0063] The server may send the third target classification model to the terminal. The terminal obtains the data to be classified, inputs the data to be classified into the third target classification model, obtains the target features corresponding to the data to be classified, and determines the classification result corresponding to the data to be classified based on the target features.

[0064] In one embodiment, Figure 2 As shown, a classification model training method is provided, and the method is applied to a computer device as an example. The computer device can be the above-mentioned Figure 1 The terminal 102 or the server 104 in FIG. Figure 2 ,The classification model training method includes the following steps:

[0065] Step S202, obtaining a training sample set; the training sample set includes training samples and training labels corresponding to the training samples.

[0066] The training sample refers to a sample of a known category, which is used to train the classification model. The training label corresponding to the training sample is used to indicate the category corresponding to the training sample. The training sample set includes multiple training samples, and each training sample has a corresponding training label.

[0067] It can be understood that different training sample sets can be generated in different fields, and the classification model corresponding to the specific field can be trained based on the training sample set corresponding to the specific field. For example, in the image field, the training samples can be images of known categories, and the image classification model is trained based on the images of known categories. In the text field, the training samples can be texts of known categories, and the text classification model is trained based on the texts of known categories. In the speech field, the training samples can be speech of known categories, and the speech classification model is trained based on the speech of known categories. The training samples can be data of types such as video, image, text, speech, etc., and accordingly, the classification model can be a video classification model, an image classification model, a text classification model, a speech classification model, etc.

[0068] Furthermore, in a certain field, different training sample sets can be generated according to segmented application scenarios, and the classification model corresponding to the specific application scenario can be trained based on the training sample set corresponding to the specific application scenario. For example, in the face recognition scenario in the image field, the training samples can be face images of known categories, and the face classification model can be trained based on face images of known categories. In the vehicle recognition scenario in the image field, the training samples can be vehicle images of known categories, and the vehicle classification model can be trained based on vehicle images of known categories.

[0069] Step S204, determine at least two reference classification models from the first target classification model and the second target classification model set obtained by training based on the training sample set; in the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space.

[0070] Among them, the second target classification model set includes at least one second target classification model. The first target classification model and the second target classification model are trained classification models. The first target classification model is obtained by training based on the training sample set, and the first target classification model includes class center features corresponding to various training labels. The class center feature is used to represent the position information of the training label in the feature space, and the determination of the class center feature indicates the determination of the position of the training label in the feature space. The class center feature refers to the statistical center of the sample features corresponding to each sample belonging to the same training label, and the sample feature is obtained by the model extracting features from the sample. The class center feature is a model parameter of the classification model, which is trained and updated together with the classification model. It can be understood that the model parameters will be adjusted during model training, so that the sample features and feature space extracted by the model will change. The feature space refers to the space where the sample features exist. The distribution of each class center feature in the feature space can reflect the distribution of the sample feature set corresponding to various training labels in the feature space. After the model training is completed, the sample features corresponding to different training labels are usually located in different areas in the feature space, and the sample features corresponding to the same training label are usually located in the same area in the feature space. That is, the model already has the ability to distinguish features and can effectively classify data.

[0071] The second target classification model is also trained based on the training sample set, but the class center features corresponding to the various training labels in the second target classification model are obtained from the first target classification model. That is, although the first target classification model and the second target classification model are different models, the class center features of the first target classification model and the second target classification model are consistent, and the first target classification model and the second target classification model are aligned in feature space. Different models aligned in feature space can be considered as complementary models, any one of which can help improve the performance of another model, and any one model can supplement the knowledge learned by another model. It can be understood that if the second target classification model set includes at least two second target classification models, although each second target classification model is a different model, the class center features between each second target classification model are also consistent, and each second target classification model is aligned in feature space.

[0072] Specifically, the computer device can obtain a training sample set locally or from other devices, obtain a first target classification model and a second target classification model set trained based on the training sample set, determine a reference classification model from the first target classification model and the second target classification model set, and use the reference classification model to assist in the training of a third initial classification model, and finally train a third target classification model with higher classification accuracy.

[0073] In one embodiment, the reference classification model is determined in any one of the following ways:

[0074] At least two second target classification models are obtained from the second target classification model set as reference classification models; and at least one second target classification model from the first target classification model and the second target classification model set is obtained as a reference classification model.

[0075] Specifically, when determining at least two reference classification models from the first target classification model and the second target classification model set, the computer device may determine the reference classification model only from each second target classification model, or may determine the reference classification model from the first target classification model and the second target classification model. The second target classification models are also feature-space aligned, so the computer device may obtain at least two second target classification models from each second target classification model as reference classification models. The first target classification model and the second target classification model are feature-space aligned, so the computer may also obtain the first target classification model as a reference classification model, and obtain at least one second target classification model in the second target classification model set as a reference classification model.

[0076] Step S206, input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and fuse each reference sample feature corresponding to the same training sample to obtain target sample features corresponding to each training sample.

[0077] The reference sample features are sample features obtained by extracting features from the training sample using the reference classification model. The target sample features are obtained by fusion of the reference sample features corresponding to the same training sample. The reference sample features corresponding to the same training sample are extracted by different reference classification models.

[0078] Specifically, the reference classification models are models that are aligned in feature space and are complementary models. Each reference classification model can be considered as a single sampling point of the input data. Therefore, fusing the sample features extracted by each reference classification model can obtain more accurate sample features. Using the fused features to train the third initial classification model can improve the classification accuracy of the trained model.

[0079] The computer device can input the training samples in the training sample set into each reference classification model to obtain the reference sample features corresponding to each training sample. The same training sample has reference sample features extracted by each reference classification model, that is, the same training sample has multiple reference sample features. The computer device can perform feature fusion on the reference sample features corresponding to the same training sample to obtain the target sample features, and finally obtain the target sample features corresponding to each training sample.

[0080] In one embodiment, reference Figure 3 There are six reference classification models. By inputting a training sample into the six reference classification models respectively, reference sample feature 1, reference sample feature 2, reference sample feature 3, reference sample feature 4, reference sample feature 5 and reference sample feature 6 can be obtained. The target sample feature can be obtained by fusing the reference sample features corresponding to the training sample. During fusion, the arithmetic mean of the reference sample features can be used as the target sample feature, or the weighted average of the reference sample features can be used as the target sample feature. Among them, the weight corresponding to each reference sample feature can be customized or determined based on the prediction accuracy of each reference classification model. The higher the prediction accuracy, the greater the corresponding weight. The prediction accuracy is calculated based on the training label corresponding to the test sample and the prediction label obtained by inputting the test sample into the reference classification model.

[0081] Step S208, input the training sample set into the third initial classification model to obtain the training sample features corresponding to each training sample, and adjust the model parameters of the third initial classification model based on the target sample features and training sample features corresponding to the same training sample until the target convergence conditions are met to obtain the third target classification model.

[0082] The initial classification model refers to the classification model to be trained, and the target classification model refers to the trained classification model. The third initial classification model refers to the third classification model to be trained. The third target classification model refers to the trained third classification model. The training sample features are sample features obtained by extracting features from the training samples using the third initial classification model.

[0083] Specifically, the target sample features obtained after fusion are relatively accurate sample features. The training goal of the third initial classification model is to make the training sample features close to the target sample features, so that the trained third target classification model can also extract relatively accurate sample features.

[0084] The computer device may input the training samples in the training sample set into the third initial classification model to obtain the training sample features corresponding to each training sample, and then adjust the model parameters of the third initial classification model based on the difference between the target sample features and the training sample features corresponding to the same training sample until the target convergence condition is met to obtain the third target classification model. The computer device may generate loss information based on the difference between the target sample features and the training sample features corresponding to the same training sample, and adjust the model parameters of the third initial classification model by back propagation based on the loss information until the target convergence condition is met to obtain the third target classification model. The computer device may generate loss information based on a loss function, and the loss function may be a loss function commonly used in model training or a custom loss function.

[0085] Among them, the target convergence condition can be at least one of the conditions such as the loss information is less than a preset threshold, the number of model iterations is greater than a preset number, etc.

[0086] In one embodiment, the computer device can determine the initial training sample from the training sample set, input the initial training sample into the third initial classification model, obtain the training sample feature, adjust the model parameters of the third initial classification model based on the target sample feature and the training sample feature corresponding to the initial training sample, obtain the third intermediate classification model, use the next training sample as the new initial training sample, use the third intermediate classification model as the new third initial classification model, return to the step of inputting the initial training sample into the third initial classification model, and obtain the training sample feature to perform iterative training, and continuously adjust the model parameters until the target convergence condition is met to obtain the third target classification model. For example, if in a certain round of training, the loss information calculated based on the training sample feature and the reference sample feature is less than a preset threshold, the adjustment of the model parameters is stopped, and the classification model obtained by the latest adjustment is used as the third target classification model. If the number of model iterations after a certain round of training is greater than the preset number, the classification model obtained by the latest adjustment is used as the third target classification model. It can be understood that there can be at least one initial training sample obtained in each round of training.

[0087] In one embodiment, the model scales of the first target classification model, the second target classification model, and the third target classification model may be the same or different.

[0088] In the above classification model training method, a training sample set is obtained, and the training sample set includes training samples and training labels corresponding to the training samples. At least two reference classification models are determined from a first target classification model and a second target classification model set obtained by training based on the training sample set. In the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space. The training sample set is input into each reference classification model to obtain the reference sample features corresponding to each training sample, and the reference sample features corresponding to the same training sample are fused to obtain the target sample features corresponding to each training sample. The training sample set is input into a third initial classification model to obtain the training sample features corresponding to each training sample, and based on the target sample features and training sample features corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence conditions are met to obtain the third target classification model. In this way, the class center feature is used to represent the position of the training label in the feature space. The class center features in the second target classification model are obtained from the first target classification model. Therefore, the second target classification model and the first target classification model are feature space aligned, and the feature space distribution of the second target classification model and the first target classification model are consistent. The reference classification models determined from the first target classification model and the second target classification model are also feature space aligned. The reference classification models aligned in feature space are complementary models, and there is complementarity between the extracted features. Furthermore, by combining multiple reference classification models for feature fusion and using the fused target sample features to train the third initial classification model, the third initial classification model can learn a more accurate feature distribution of the fused features, so that the trained third target classification model can extract more accurate data features of the input data, and more accurate classification results can be obtained based on more accurate data features, thereby improving the classification accuracy of the model and the classification accuracy of the data.

[0089] In one embodiment, reference Figure 4 Before determining at least two reference classification models from the first target classification model and the second target classification model set obtained by training based on the training sample set, the classification model training method further includes:

[0090] Step S402: Based on the training sample set, the first initial classification model is trained to obtain a first target classification model.

[0091] The first initial classification model refers to the first classification model to be trained, and the first target classification model refers to the first classification model that has been trained.

[0092] Specifically, the computer device may first train a first target classification model based on a training sample set, and then train a second target classification model based on the first target classification model and the training sample set.

[0093] The computer device can input the training samples in the training sample set into the first initial classification model to obtain the first prediction labels corresponding to each training sample, and adjust the model parameters of the first initial classification model based on the training labels and prediction labels corresponding to the same training samples until the first convergence condition is met to obtain the first target classification model.

[0094] Step S404, obtaining target class center features corresponding to various training labels respectively from the first target classification model, and generating at least one second initial classification model aligned with the feature space of the first target classification model; the class center features corresponding to various training labels respectively in the second initial classification model are the corresponding target class center features.

[0095] Step S406, based on the training sample set, perform model training on at least one second initial classification model to obtain at least one second target classification model, and each second target classification model constitutes a second target classification model set; the third initial classification model keeps the center features of each class unchanged during model training.

[0096] The target class center feature refers to the class center feature obtained from the trained model and is the class center feature that is no longer adjusted. The second initial classification model refers to the second classification model to be trained. The second target classification model refers to the trained second classification model.

[0097] Specifically, the computer device performs supervised training on the first initial classification model based on the training sample set to obtain a second target classification model, and the second target classification model includes target class center features corresponding to various training labels. Furthermore, in order to align the feature spaces of the first target classification model and the second target classification model, the computer device can first generate at least one second initial classification model that is aligned with the feature space of the first target classification model, and then perform model training on each second initial classification model based on the training sample set to obtain each second target classification model, and each second target classification model constitutes a second target classification model set.

[0098] When generating the second initial classification model, the computer device can obtain the target class center features corresponding to various training labels from the first target classification model, and use the target class center features corresponding to various training labels as the class center features corresponding to various training labels in the second initial classification model, thereby obtaining a second initial classification model that is aligned with the feature space of the first target classification model. During the training process, the class center features corresponding to various training labels in the second initial classification model are not updated. Since the class center features remain unchanged during model training, it can be ensured that the feature space distribution of each second initial classification model is consistent during training, and each second target classification model finally obtained through training is still feature space aligned, and each second target classification model is also feature space aligned with the first target classification model.

[0099] In one embodiment, the training methods of the second initial classification model and the first initial classification model may be the same or different, and the loss functions used by the two may be the same or different.

[0100] In one embodiment, in order to ensure the diversity of the model, when generating the second initial classification model, the parameters in the second initial classification model except the class center feature can be randomly initialized, so that the initial model parameters between each second initial classification model are different. In one embodiment, the loss functions between different second target classification models can be different to further ensure the diversity of the model.

[0101] In one embodiment, in order to improve the model training speed, the other model parameters of the first target classification model except the class center feature can also be adjusted to obtain the second initial classification model. Since the first target classification model is a converged model, fine-tuning the model parameters of the first target classification model to generate the second initial classification model can effectively improve the convergence speed of the second initial classification model. It can be understood that different second initial classification models can correspond to different adjustment ranges. In one embodiment, the loss functions corresponding to the first target classification model and the second target classification model can be different to ensure that the first target classification model and the second target classification model finally trained are different models.

[0102] In the above embodiment, the first target classification model is first trained, and then the target class center features are obtained from the first target classification model as the class center features of the second initial classification model. The class center features are kept unchanged when training the second initial classification model, thereby ensuring that the trained second target classification model and the first target classification model are models with aligned feature spaces.

[0103] In one embodiment, based on the training sample set, the first initial classification model is trained to obtain a first target classification model, including:

[0104] The training samples in the training sample set are input into the first initial classification model; the model parameters of the first initial classification model include initial class center features corresponding to various training labels respectively; the current sample features corresponding to the current training sample are extracted, and based on the current sample features and the initial class center features, the first prediction label corresponding to the current training sample is obtained; based on the first prediction label and the training label corresponding to the same training sample, the model parameters of the first initial classification model are adjusted until the first convergence condition is met, and the first target classification model is obtained.

[0105] The initial class center feature refers to the class center feature to be adjusted. It can be understood that the initial model parameters in the first initial classification model can be randomly initialized or manually set.

[0106] Specifically, when training the first initial classification model, the computer device can input training samples in the training sample set into the first initial classification model, and the first initial classification model outputs a first prediction label corresponding to the training sample. The computer device generates loss information based on the difference between the first prediction label and the training label corresponding to the same training sample, and performs back propagation based on the loss information to adjust the model parameters of the first initial classification model until the first convergence condition is met to obtain the first target classification model.

[0107] Among them, similar to the target convergence condition, the first convergence condition can be at least one of the conditions such as the loss information is less than a preset threshold, the number of model iterations is greater than a preset threshold, etc.

[0108] The current training sample is used as an example to illustrate the internal data processing process of the model. The current training sample refers to any training sample in the training sample set. After the current training sample is input into the first initial classification model, the first initial classification model extracts the sample features corresponding to the current training sample to obtain the current sample features, obtains the center features of each initial class, and fuses the current sample features and the center features of each initial class to obtain the first prediction label corresponding to the current training sample.

[0109] In one embodiment, the prediction probability that the current training sample belongs to various training labels can be calculated based on the current sample feature and each initial class center feature, and the first prediction label corresponding to the current training sample can be obtained based on each prediction probability. In one embodiment, the feature distance between the current sample feature and each initial class center feature can be calculated, and the prediction probability can be obtained based on the feature distance. It can be understood that the smaller the feature distance, the greater the prediction probability.

[0110] In the above embodiment, a first prediction label corresponding to the training sample can be obtained based on the sample features extracted from the training sample and the features of each initial class center. The first prediction label can reflect which label the model predicts the training sample belongs to. Based on the first prediction label and the training label corresponding to the same training sample, the model parameters of the first initial classification model are adjusted, so that the first prediction label can gradually approach the training label, and finally a first target classification model with higher prediction accuracy is obtained through training.

[0111] In one embodiment, based on the training sample set, model training is performed on at least one second initial classification model to obtain at least one second target classification model, including:

[0112] The training sample set is sampled to obtain multiple training sample subsets, a target sample subset is determined from each training sample subset, a candidate classification model is determined from each third initial classification model, and the candidate classification model is used as the current classification model; the target training sample in the target sample subset is input into the current classification model to obtain the initial sample features corresponding to each target training sample; feature angle information is calculated based on the initial sample features corresponding to the target training sample and each class center feature, and the target loss is obtained based on the feature angle information corresponding to each target training sample and the angle compensation parameter corresponding to the candidate classification model; the model parameters corresponding to the current classification model are adjusted based on the target loss to obtain an intermediate classification model; the next training sample subset is used as the target sample subset, the intermediate classification model is used as the current classification model, and the step of inputting the target training sample in the target sample subset into the current classification model to obtain the initial sample features corresponding to each target training sample is executed until the second convergence condition is met to obtain the second target classification model corresponding to the candidate classification model.

[0113] The initial sample feature is the sample feature obtained by extracting the features of the target training sample by the current classification model. The feature angle information is used to characterize the angle information between the initial sample feature corresponding to the training sample and the center feature of each class. The angle compensation parameter is used to adjust the feature angle information to generate loss information, which can improve the model's ability to distinguish between classes.

[0114] Specifically, when training the second initial classification model, the computer device may iteratively train the second initial classification model to obtain the second target classification model. The computer device may sample the training sample set to obtain multiple training sample subsets, and iteratively train the second initial classification model based on each training sample subset to obtain the second target classification model.

[0115] When sampling, a preset number of training samples can be selected from the training sample set to form a training sample subset. Multiple training sample subsets can be obtained after multiple selections, and each selection can obtain a training sample subset. It can be understood that the training samples in different training sample subsets may or may not be repeated.

[0116] When performing iterative training, a model can be randomly selected from each second initial classification model as a candidate classification model, and the candidate classification model can be used as the current classification model. A training sample subset can be randomly selected from each training sample subset as a target sample subset, and the current classification model is trained based on the target sample subset to obtain an intermediate classification model. The next training sample subset is used as a new target sample subset, and the intermediate classification model is used as a new current classification model. The new current classification model is trained based on the new target sample subset to obtain a new intermediate classification model. The training is iteratively performed until the second convergence condition is met, and finally the second target classification model corresponding to the candidate classification model is obtained. Afterwards, the computer device can obtain the next model from each second initial classification model as a new candidate classification model, and repeat the above process to obtain the second target classification model corresponding to the new candidate classification model. It can be understood that the training method of each second initial classification model is the same, and the second target classification model corresponding to each second initial classification model can be finally trained with reference to the above training method. Of course, the training sample subsets used to train different second initial classification models can be the same or different.

[0117] When training the current classification model based on the target sample subset, the computer device can input the target training samples in the target sample subset into the current classification model respectively, extract the sample features of the target training samples through the current classification model, and obtain the initial sample features corresponding to each target training sample in the target sample subset. Then, the computer device calculates the angle information between the initial sample features and the class center features based on the initial sample features and the class center features corresponding to the same target training sample, obtains the feature angle information corresponding to each target training sample, calculates the target loss based on the feature angle information corresponding to each target training sample and the angle compensation parameters corresponding to the candidate classification model, and finally back-propagates based on the target loss to update the model parameters corresponding to the current classification model, and obtains the intermediate classification model. Among them, each second initial classification model has a corresponding angle compensation parameter, and the angle compensation parameters corresponding to different second initial classification models can be different, so as to ensure that each second target classification model obtained by the final training is a different model, and the diversity of the model is ensured.

[0118] In one embodiment, the characteristic angle information can be adjusted based on the angle compensation parameter to obtain target information, each target information is normalized, and the target loss is obtained based on each normalized target information.

[0119] It is understandable that the first initial classification model may also be trained with reference to the above-mentioned method of training the second initial classification model to obtain the first target classification model.

[0120] In the above embodiment, the second initial classification model is iteratively trained to obtain the second target classification model. In any round of training, feature angle information is calculated based on the initial sample features corresponding to the training samples of this round and the features of each class center. The target loss is calculated based on the feature angle information corresponding to each training sample and the angle compensation parameters corresponding to the second initial classification model. The model parameters are adjusted based on the target loss, which can improve the feature differentiation ability of the model and quickly train to obtain the second target classification model. Each second initial classification model has a corresponding angle compensation parameter, which can ensure that the second target classification models obtained through training are different models.

[0121] In one embodiment, feature angle information is calculated based on the initial sample features corresponding to the target training sample and the features of each class center, and the target loss is obtained based on the feature angle information corresponding to each target training sample and the angle compensation parameters corresponding to the candidate classification model, including:

[0122] The training label corresponding to the current target training sample is used as the target training label, and the target angle information corresponding to the current target training sample is obtained based on the initial sample features corresponding to the current target training sample and the class center features corresponding to the target training label. The reference angle information corresponding to the current target training sample is obtained based on the initial sample features corresponding to the current target training sample and the class center features corresponding to other training labels. The target angle information and the reference angle information corresponding to the current target training sample are used as the feature angle information corresponding to the current target training sample. The target angle information and the reference angle information corresponding to the same target training sample are adjusted based on the angle compensation parameter to obtain the target feature information and the reference feature information. The initial loss is obtained based on the target feature information and the reference feature information corresponding to the same target training sample. The target loss is obtained based on the initial losses corresponding to each target training sample.

[0123] The current target training sample refers to any one of the target training samples. The target feature information is obtained by adjusting the target angle information based on the angle compensation parameter, and the reference feature information is obtained by adjusting the reference angle information based on the angle compensation parameter.

[0124] Specifically, the feature angle information corresponding to any target training sample includes the target angle information and reference angle information corresponding to the target training sample. The target angle information is obtained based on the initial sample feature corresponding to the target training sample and the class center feature corresponding to the training label of the target training sample. The reference angle information is obtained based on the initial sample feature corresponding to the target training sample and the class center feature corresponding to other training labels except the training label of the target training sample. Specifically, the feature angle between the initial sample feature corresponding to the current target training sample and the class center feature corresponding to the target training label can be calculated as the target angle, and the target angle information can be obtained based on the target angle. The target angle can be used as the target angle information, or the target angle can be converted to obtain the target angle information, for example, the target angle can be obtained by performing cosine processing on the target angle. Specifically, the feature angle between the initial sample feature corresponding to the current target training sample and the class center feature except the target training label can be calculated as the reference angle, and the reference angle information can be obtained based on the reference angle. The determination of the reference angle information is similar to the determination of the target angle information.

[0125] When calculating the loss, the computer device can adjust the target angle information and reference angle information corresponding to the same target training sample based on the angle compensation parameter to obtain the target feature information and reference feature information. Each target training sample has its own corresponding target feature information and reference feature information, and then calculate the initial loss based on the target feature information and reference feature information corresponding to the same target training sample to obtain the initial loss corresponding to each target training sample. For example, the target feature information can be normalized based on the reference feature information to obtain the initial loss. Normalization is used to map the target feature information to a preset range, thereby unifying the numerical range of the target feature information corresponding to each target training sample for data calculation. Finally, the computer device obtains the target loss based on the initial losses corresponding to each target training sample. For example, the average loss of each initial loss can be calculated as the target loss, and the median value of each initial loss can be used as the target loss.

[0126] In one embodiment, the angle compensation parameter includes a first parameter and a second parameter. The target angle information corresponding to the target training sample can be adjusted based on the first parameter and the second parameter in the angle compensation parameter to obtain the target feature information. The reference angle information corresponding to the target training sample can be adjusted based on the first parameter in the angle compensation parameter to obtain the reference feature information. The first parameter is used to additively adjust the angle information, and the second parameter is used to multiplicatively adjust the angle information. Additive adjustment refers to adjustment by addition, and multiplicative adjustment refers to adjustment by multiplication.

[0127] In one embodiment, the target loss is calculated as follows:

[0128]

[0129] Among them, L loss represents the target loss, and N represents the number of target training samples. It represents the target angle corresponding to the i-th target training sample. The target angle is the feature angle between the initial sample feature corresponding to the i-th target training sample and the class center feature corresponding to the training label of the i-th target training sample. Represents the target feature information corresponding to the i-th target training sample. j It represents the reference angle corresponding to the i-th target training sample. The reference angle is the feature angle between the initial sample feature corresponding to the i-th target training sample and the center feature of other classes. represents the reference feature information corresponding to the i-th target training sample. k represents the number of categories of training labels. i Represents the training label of the i-th target training label. s, m1, and m2 represent angle adjustment parameters. m1 and m2 can increase the interval between the regions occupied by different training labels in the feature space to improve the category distinction. The cos value interval was originally [0,1]. The value of this interval is too small to effectively distinguish the difference. s can increase the cos value by s times, which helps to improve the difference of feature distribution and increase the convergence speed.

[0130] In the above embodiment, the feature angle information corresponding to the target training sample includes target angle information and reference angle information. The target angle information can reflect the distance between the sample feature and the category center feature corresponding to the true label, and the reference angle information can reflect the distance between the sample feature and the category center feature corresponding to the wrong label. Based on the angle compensation parameter, the target angle information and the reference angle information corresponding to the same target training sample are adjusted respectively to obtain the target feature information and the reference feature information. The angle compensation parameter can penalize the target angle information and the reference angle information to increase the influence of the target angle information and the reference angle information. The initial loss is obtained based on the target feature information and the reference feature information corresponding to the same target training sample, and the target loss is obtained based on the initial losses corresponding to each target training sample. The model parameters are adjusted based on such a target loss, which can enhance the feature discrimination of the model and improve the classification accuracy of the model.

[0131] In one embodiment, a first target classification model is first trained, and then a second target classification model is trained based on the first target classification model. Figure 5A The training process of the first initial classification model is described. The training process of the first initial classification model is mainly divided into a training data preparation module, an identification network unit module, a category center storage module, a loss function calculation module, and a loss function optimization module.

[0132] (a) Training data preparation module: During the training process, this module obtains training samples, combines the obtained training samples into training sample subsets and sends them to the deep network unit (i.e., the first initial classification model) for processing.

[0133] (b) Basic recognition network unit module: This module extracts features from training samples. This module usually has a structure of a convolutional neural network (CNN), which includes operations such as convolution calculation, nonlinear activation function (Relu) calculation, and pooling calculation. Taking the training sample as an image as an example, this module can extract spatial features from the image, and the output feature map retains the spatial structure information of the image.

[0134] (c) Category center storage module: The data stored in this module are the category center features corresponding to each training label in the training data, and its shape is (d×m), where d is the feature dimension and m is the number of categories of training labels in the training data. The probability values ​​of the training samples belonging to various training labels can be obtained by performing matrix operations on the features extracted by the recognition network unit module. The probability values ​​of the training samples belonging to various training labels form a probability vector (also called a predicted label).

[0135] (d) Loss function calculation module: This module uses the probability vector corresponding to the training sample and the training label of the training sample as the input of the loss function to calculate the loss information loss. The loss function can be a classification type loss function, such as the softmax function, margin-softmax function, etc., or other types of loss functions can be used.

[0136] (e) Loss function optimization module: This module trains and optimizes the entire network based on gradient descent, such as stochastic gradient descent, stochastic gradient descent with momentum, Adam (Adaptive Moment Estimate, momentum-based algorithm and adaptive learning rate-based algorithm), Adagard (Adaptive Gradient, adaptive learning rate optimization algorithm), etc. Repeat (a) to (d) during training until the training results meet the training termination conditions. The conditions for terminating model training are generally set to the number of iterations meeting the set value, or the loss calculated by the loss function is less than the set value to complete the model training.

[0137] refer to Figure 5BThis section describes the training process of the second initial classification model. To ensure that the features extracted by the reference classification model can be directly integrated, it is necessary to align the feature spaces of the first classification model and the second classification model. Therefore, in the process of training the second initial classification model, it is necessary to use Figure 5A The class center storage module in the training process of the second initial classification model is not updated. Since the class center features of the training model are fixed during training, the feature space distribution of the first classification model and the second classification model can be consistent during training.

[0138] The training process of the second initial classification model is mainly divided into training data preparation module, complementary recognition network unit module, category center storage module, loss function calculation module, random seed control module, loss hyperparameter control module, and loss function optimization module.

[0139] (1) Training data preparation module: The functions of this module are Figure 5A The training data preparation module in is consistent.

[0140] (2) Complementary recognition network unit module: The function of this module is Figure 5A The basic recognition network units in are consistent.

[0141] (3) Category center storage module: The function of this module is the same as Figure 5A The data in this module is from Figure 5A It is obtained from the category center storage module after training.

[0142] (4) Loss function calculation module: The function of this module is the same as Figure 5A The loss function calculation module in is consistent.

[0143] During the training process, only the parameters of the complementary recognition network unit module are updated, while the category center storage module only provides gradient calculation and does not participate in the parameter update process.

[0144] (5) Random seed control module: This module randomly initializes the second initial classification model and controls the inconsistency of the initialization random seeds of each second initial classification model to enrich the diversity of the model.

[0145] (6) Loss hyperparameter control module: This module controls the loss function, which is Since the class center direction of the training data is fixed, the direction vector of each training label in space can be determined. It can be understood that the sample features of the training samples are clustered around the space of the direction vector of the training label, and its distance s from the origin expresses the quality of the training sample. In order to ensure the diversity and complementarity of the model, the diversity of the constraints of the training samples in space can be ensured by adjusting s and m, thereby promoting the model to learn complementary knowledge. Therefore, the loss hyperparameter control module can control the configuration of s and m, and the configurations of different second initial classification models are inconsistent.

[0146] (7) Loss function optimization module: The function of this module is the same as Figure 5A The loss function optimization module in is consistent.

[0147] Finally, different second target classification models (also called complementary models) can be trained. Since the feature spaces of each model are aligned, the features between the models can be directly fused.

[0148] In one embodiment, Figure 6 As shown, based on the target sample features and the training sample features corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence condition is met, and the third target classification model is obtained, including:

[0149] Step S602, obtaining the target class center feature corresponding to the current training sample from the reference classification model, and obtaining the reference label corresponding to the current training sample based on the target sample feature and the target class center feature corresponding to the current training sample.

[0150] Step S604, obtaining the initial class center feature corresponding to the current training sample from the third initial classification model, and obtaining the second prediction label corresponding to the current training sample based on the training sample feature and the initial class center feature corresponding to the current training sample.

[0151] Step S606, based on the reference label and the second predicted label corresponding to the same training sample, adjust the model parameters of the third initial classification model until the target convergence condition is met, thereby obtaining a third target classification model.

[0152] Specifically, in addition to using feature constraints to constrain the distance between the reference classification model and the third initial classification model, label information can also be introduced to use labels to constrain the distance between the reference classification model and the third initial classification model. The computer device can obtain a reference label corresponding to the training sample based on the target sample feature corresponding to the training sample, and obtain a second predicted label corresponding to the training sample based on the training sample feature corresponding to the training sample. The reference label is the fusion prediction result of multiple reference classification models. Since the reference classification model is a trained model, the reference label can be considered to be a relatively accurate result. Therefore, the reference label is used as a supervisory signal. The second predicted label is the prediction result of the third initial classification model. The training goal of the third initial classification model is to make the second predicted label close to the reference label, so as to finally train and obtain the third target classification model.

[0153] The current training sample refers to any training sample. When determining the reference label, the target class center feature corresponding to the current training sample can be obtained from any reference classification model, and the reference label corresponding to the current training sample can be obtained based on the target sample feature and the target class center feature corresponding to the current training sample. When determining the second predicted label, the initial class center feature corresponding to the current training sample can be obtained from the third initial classification model, and the second predicted label corresponding to the current training sample can be obtained based on the training sample feature and the initial class center feature corresponding to the current training sample. It can be understood that the determination process of the reference label and the second predicted label can refer to the determination process of the first predicted label in the aforementioned embodiment.

[0154] After obtaining the reference label and the second predicted label, the computer device can generate loss information based on the difference between the reference label and the second predicted label corresponding to the same training sample, and perform backpropagation based on the loss information to adjust the model parameters of the third initial classification model until the target convergence conditions are met to obtain the third target classification model.

[0155] In one embodiment, a computer device can determine an initial training sample from a training sample set, determine a reference label corresponding to the initial training sample, input the initial training sample into a third initial classification model to obtain a second prediction label, adjust the model parameters of the third initial classification model based on the target sample features and the second prediction label corresponding to the initial training sample to obtain a third intermediate classification model, use the next training sample as a new initial training sample, use the third intermediate classification model as a new third initial classification model, return to the step of inputting the initial training sample into the third initial classification model to obtain the second prediction label to perform iterative training, and continuously adjust the model parameters until the target convergence conditions are met to obtain the third target classification model.

[0156] In one embodiment, the difference between the reference label and the second predicted label corresponding to the same training sample may be calculated by using KL distance (Kullback-Leibler Divergence, also known as relative entropy).

[0157] In the above embodiment, in addition to using the feature constraint reference to the distance between the classification model and the third initial classification model, the label constraint reference to the distance between the classification model and the third initial classification model can also be used to allow the third initial classification model to learn the knowledge of the reference classification model and obtain a third target classification model with higher classification accuracy.

[0158] In one embodiment, the model scales of the first target classification model and the second target classification model are greater than the model scale of the third target classification model.

[0159] Specifically, the model scale is used to characterize the size of the model. The model scales of the first target classification model and the second target classification model are larger than the model scale of the third target classification model, that is, the first target classification model and the second target classification model are large models, and the third target classification model is a small model. The model scale can be determined based on at least one of the calculation amount, parameter amount, memory usage, etc. of the model.

[0160] The classification model training method of the present application can be applied to knowledge distillation, and knowledge distillation is performed on a small model by fusing features of multiple large models. Knowledge distillation uses the knowledge learned by the large model to guide the training of the small model, so that the small model has performance comparable to that of the large model, but the model size is greatly reduced, thereby achieving model compression and acceleration. Specifically, multiple large models that have been trained and aligned in feature space are obtained, and the sample features extracted by the large model from the same training sample are fused. Each large model can be considered as a sampling point of the training sample. Using multiple large models for feature fusion can obtain a more accurate feature distribution of the training sample. Based on the feature distribution, knowledge distillation is performed on the small model, and the feature distribution of the small model can be constrained to be consistent with the fused feature. Therefore, the classification accuracy of the small model obtained by distillation is higher than the classification accuracy of the small model obtained by directly training the training sample.

[0161] In the above embodiment, the model scales of the first target classification model and the second target classification model are larger than the model scale of the third target classification model, so that the third target classification model has not only high classification accuracy but also high classification efficiency.

[0162] In one embodiment, when the first target classification model, the second target classification model and the third target classification model are face recognition models, the third target classification model is used to extract image features corresponding to the input image, and the image features are used for identity recognition.

[0163] Specifically, in the face recognition application scenario, the first target classification model, the second target classification model and the third target classification model can be face recognition models, and the models are used to recognize faces in images. The third target classification model trained by the classification model training method of the present application is used to extract image features corresponding to the input image, and the image features corresponding to the input image are used for identity recognition to determine the identity information of the object in the input image. Among them, the input image can be a face image containing face information.

[0164] In one embodiment, the first image may be input into the third target classification model to obtain the first image feature corresponding to the first image, the second image may be input into the third target classification model to obtain the second image feature corresponding to the second image, the first image feature and the second image feature may be compared, and whether the first image and the second image are images corresponding to the same object may be determined based on the comparison result. For example, the feature similarity of the first image feature and the second image feature may be calculated, and if the feature similarity is greater than a preset similarity, it is determined that the first image and the second image are images corresponding to the same object.

[0165] In one embodiment, the image features corresponding to the facial image of a known object can be extracted as candidate image features through the third target classification model, and each candidate image feature has a corresponding object identifier. The object identifier is used to identify the object corresponding to the facial image, and can specifically include a character string of at least one of letters, numbers and symbols. For example, the work number or contact number of the object can be used as the object identifier. If a facial image to be identified whose identity information is to be determined is obtained, the image features corresponding to the facial image to be identified are extracted through the third target classification model, and the image features corresponding to the facial image to be identified are matched with each candidate image feature respectively, and the identity information corresponding to the facial image to be identified is determined according to the matching results. For example, the feature similarity between the image features corresponding to the facial image to be identified and each candidate image feature can be calculated, and the candidate image feature corresponding to the maximum feature similarity is used as the target image feature, and the object identifier corresponding to the target image feature is obtained as the identity information corresponding to the facial image to be identified.

[0166] In one embodiment, compared with the model scale of the third target classification model, the first target classification model and the second target classification model may be face recognition models with larger model scales.

[0167] In the above embodiments, the classification model training method of the present application can be applied to face recognition tasks to improve the accuracy of face recognition.

[0168] In one embodiment, Figure 7 As shown, a data classification method is provided, and the method is applied to a computer device as an example. The computer device can be the above-mentioned Figure 1The terminal 102 or the server 104 in FIG. Figure 7 , the data classification method includes the following steps

[0169] Step S702, obtaining the data to be classified, inputting the data to be classified into the third target classification model, and obtaining the target features corresponding to the data to be classified.

[0170] Among them, the training process of the third target classification model is as follows: obtain a training sample set; the training sample set includes training samples and training labels corresponding to the training samples; determine at least two reference classification models from the first target classification model and the second target classification model set obtained by training based on the training sample set; in the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space; input the training sample set into each reference classification model to obtain the reference sample features corresponding to each training sample, and fuse the reference sample features corresponding to the same training sample to obtain the target sample features corresponding to each training sample; input the training sample set into the third initial classification model to obtain the training sample features corresponding to each training sample, and adjust the model parameters of the third initial classification model based on the target sample features and training sample features corresponding to the same training sample until the target convergence conditions are met to obtain the third target classification model.

[0171] It can be understood that the specific training process of the first target classification model, the second target classification model and the third target classification model can refer to the various embodiments of the aforementioned classification model training method, which will not be repeated here.

[0172] Step S704: determining the classification result corresponding to the data to be classified based on the target feature.

[0173] The data to be classified refers to data for which the classification result is to be determined. The classification model can be a video classification model, an image classification model, a text classification model, a voice classification model, etc., and accordingly, the data to be classified can be data of the type of video, image, text, voice, etc.

[0174] Specifically, the computer device can determine the classification result corresponding to the data to be classified through the model. The computer device can obtain the data to be classified locally or from other devices, input the data to be classified into the third target classification model, extract the target features corresponding to the data to be classified through the third target classification model, and finally determine the classification result corresponding to the data to be classified based on the target features. The reference classification models are complementary models, and the extracted features are complementary. The target sample features obtained by fusing the sample features extracted by the reference classification models for the same training sample are features with higher accuracy. The initial sample features extracted by the third initial classification model are constrained by the target sample features, and the third initial classification model is trained to learn the target sample features, so that the third target classification model finally trained can extract data features that are relatively accurate for the input data, so that the accurate classification results corresponding to the data to be classified can be obtained based on the target features extracted by the third target classification model.

[0175] In one embodiment, a computer device may input the data to be classified into a third target classification model, extract target features corresponding to the data to be classified through the third target classification model, determine the classification result corresponding to the data to be classified based on the target features corresponding to the data to be classified through the third target classification model, and the third target classification model finally outputs the classification result corresponding to the data to be classified.

[0176] In one embodiment, the computer device may input the data to be classified into the third target classification model, extract the target features corresponding to the data to be classified through the third target classification model, and the third target classification model outputs the target features corresponding to the data to be classified. Subsequently, the target features corresponding to the data to be classified are matched with the candidate features corresponding to the candidate data of the known category to determine the classification result corresponding to the data to be classified.

[0177] In the above data classification method, a training sample set is obtained, and the training sample set includes training samples and training labels corresponding to the training samples. At least two reference classification models are determined from a first target classification model and a second target classification model set obtained by training based on the training sample set. In the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space. The training sample set is input into each reference classification model to obtain the reference sample features corresponding to each training sample, and the reference sample features corresponding to the same training sample are fused to obtain the target sample features corresponding to each training sample. The training sample set is input into a third initial classification model to obtain the training sample features corresponding to each training sample, and based on the target sample features and training sample features corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence conditions are met to obtain the third target classification model. In this way, the class center feature is used to represent the position of the training label in the feature space. The class center features in the second target classification model are obtained from the first target classification model. Therefore, the second target classification model and the first target classification model are feature space aligned, and the feature space distribution of the second target classification model and the first target classification model are consistent. The reference classification models determined from the first target classification model and the second target classification model are also feature space aligned. The reference classification models aligned in feature space are complementary models, and there is complementarity between the extracted features. Furthermore, by combining multiple reference classification models for feature fusion and using the fused target sample features to train the third initial classification model, the third initial classification model can learn a more accurate feature distribution of the fused features, so that the trained third target classification model can extract more accurate data features of the input data, and more accurate classification results can be obtained based on more accurate data features, thereby improving the classification accuracy of the model and the classification accuracy of the data.

[0178] In one embodiment, determining a classification result corresponding to the data to be classified based on the target feature includes:

[0179] Calculate the similarity between the target feature and each candidate feature in the feature library; based on the similarity, determine similar features from each candidate feature; and obtain the classification result based on the category labels corresponding to the similar features.

[0180] Specifically, when determining the classification result, the computer device may match the target feature with each candidate feature in the feature library, and determine the classification result according to the matching result. The computer device may calculate the similarity between the target feature and each candidate feature in the feature library, each candidate feature has a corresponding category label, and determine similar features from each candidate feature based on the similarity, and use the candidate feature corresponding to the maximum similarity as the similar feature, and use the category label corresponding to the similar feature as the final classification result.

[0181] In one embodiment, each candidate feature may be extracted in advance. In one embodiment, the candidate feature may be obtained by inputting candidate data of known categories into any target classification model.

[0182] In the above embodiment, the classification result can be quickly determined through feature matching.

[0183] In a specific embodiment, the classification model training method and data classification method of the present application can be applied to face recognition tasks. At present, in mobile face recognition systems used in actual scenarios such as security, payment, and access control, very high requirements are placed on the running time and accuracy of face recognition models. It is required to obtain a higher recognition accuracy with as little inference time as possible. In order to meet the time requirement, a small network is usually required as a recognition inference model in this scenario. However, directly using a large amount of data to train a small network usually does not obtain a model that meets the accuracy requirements. This is because the small network has a small fitting ability, and it will fall into the local minimum of the constraint function during training, and then begin to oscillate and cannot be further optimized.

[0184] The present application proposes a method of using multiple large models to fuse and then perform knowledge distillation on the small model to optimize the small model and improve the accuracy of face recognition. The feature distribution extracted by the large model is transferred to the small model by knowledge distillation, which can prompt the small model to jump out of the local minimum point. First, the large model is trained with face image data, and then multiple large models that complement it are trained. The fusion of multiple models can obtain more accurate image features, and finally the fused features are used to perform knowledge distillation on the small model. As the training proceeds, the features extracted by the small model will gradually converge to be consistent with the distribution of the fused features. Since the data distribution extracted by the fused features is more accurate than the data distribution obtained by directly training the small model, the small model finally trained by the present application has a higher face recognition accuracy than the small model obtained by direct training.

[0185] refer to Fig. 8A, the method of the present application is mainly divided into two stages, the network module training stage and the network module deployment stage. In the network module training stage, the large recognition network (which can be called a large model) is first trained using the face data of known identities, and then the complementary model (complementary model can also be called a large recognition network) aligned with the feature space of the large model is trained. Finally, multiple large recognition networks are combined to fuse the image features, and the fused features are used to perform distillation training on the small model (which can also be called a small recognition network). In the module deployment stage, only the trained small model needs to be deployed, and it becomes a complete face recognition system in conjunction with the feature comparison search module. It can be understood that the structure of the small recognition network is similar to that of the large recognition network, but the number of parameters of the small recognition network is much smaller than that of the large recognition network, and the time required for forward reasoning of the small recognition network is shorter.

[0186] Specifically, the training process of the large recognition network in the network module training phase can be referred to Figure 5A The process of training complementary models by aligning feature space can be referred to Figure 5B , I will not go into details here.

[0187] refer to Figure 8B ,The training process of the small recognition network includes the ,training data preparation module, the small recognition network unit module, the large recognition ,network unit module, the feature fusion calculation module, the knowledge ,distillation loss function calculation module and the knowledge distillation objective ,function optimization module.

[0188] (a) Training data preparation module: The function of this module is the same as Figure 5A The training data preparation module in is the same as that in . The data it reads is face image data.

[0189] (b) Small recognition network unit module: The small recognition network corresponding to this module has a similar structure to the large recognition network, but the number of parameters is much smaller than that of the large recognition network, and the time required for forward reasoning is shorter. The small recognition network unit extracts features from the input image and obtains feature F X .

[0190] (c) Large recognition network unit module: This module includes the trained large recognition networks. Each large recognition network extracts features from the input image and obtains features. 1 ~fea n (i.e., feature 1 to feature n).

[0191] (d) Feature fusion calculation module: This module fuses the features extracted by the large recognition network. The fusion formula is as follows:

[0192]

[0193] (e) Knowledge distillation loss function calculation module: Generally, the cosine similarity loss function is used. The function of this module is to evaluate the feature F extracted by the small network unit module. X And the fusion feature F Y The similarity between . The loss function is as follows:

[0194] L f =||F X -F Y || 2

[0195] (f) Knowledge distillation loss function optimization module: This module optimizes the training of the entire network based on the gradient descent method. Repeat (a) to (e) during training until the training results meet the training termination conditions. The conditions for terminating model training are generally set to the number of iterations meeting the set value, or the loss calculated by the knowledge distillation loss function is less than the set value to complete the model training.

[0196] The network module deployment phase mainly combines and deploys the small recognition network trained in the network module training phase with other modules to form a complete solution. Figure 8C The image acquisition input module collects the face images to be recognized, enters the recognition network module (including the small recognition network) to extract features, and then enters the feature comparison search module for recognition. The small recognition network is derived from the knowledge transfer of the large recognition network with stronger expression ability. The feature distribution extracted by the small recognition network is highly similar to that of the large recognition network, so it has a higher recognition accuracy.

[0197] In this embodiment, the method of the present application can improve the face recognition accuracy of a small recognition network, making it adaptable to various complex application scenarios.

[0198] It can be understood that the classification model training method and data classification method of the present application can be applied not only to face recognition tasks, but also to other image recognition and classification tasks, such as vehicle recognition tasks based on vehicle images, and can also be applied to recognition and classification tasks of other types of data, such as text classification tasks, speech classification tasks, video classification tasks, etc.

[0199] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0200] Based on the same inventive concept, the embodiments of the present application also provide a classification model training device for implementing the classification model training method involved above and a data classification device for implementing the data classification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more classification model training device embodiments provided below can refer to the limitations on the classification model training method above, and the specific limitations in one or more data classification device embodiments can refer to the limitations on the data classification method above, which will not be repeated here.

[0201] In one embodiment, Fig. 9 As shown, a classification model training device is provided, including: a training sample set acquisition module 902, a reference classification model determination module 904, a feature fusion module 906 and a third target classification model determination module 908, wherein:

[0202] The training sample set acquisition module 902 is used to acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples.

[0203] The reference classification model determination module 904 is used to determine at least two reference classification models from the first target classification model and the second target classification model set obtained by training based on the training sample set; in the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space.

[0204] The feature fusion module 906 is used to input the training sample set into each reference classification model to obtain the reference sample features corresponding to each training sample, and to fuse the reference sample features corresponding to the same training sample to obtain the target sample features corresponding to each training sample.

[0205] The third target classification model determination module 908 is used to input the training sample set into the third initial classification model to obtain the training sample features corresponding to each training sample, and adjust the model parameters of the third initial classification model based on the target sample features and training sample features corresponding to the same training sample until the target convergence conditions are met to obtain the third target classification model.

[0206] In the above classification model training device, the class center feature is used to represent the position of the training label in the feature space, and each class center feature in the second target classification model is obtained from the first target classification model. Therefore, the second target classification model and the first target classification model are feature space aligned, and the feature space distribution of the second target classification model and the first target classification model is consistent. Each reference classification model determined from the first target classification model and the second target classification model is also feature space aligned. Each reference classification model aligned in feature space is a complementary model, and there is complementarity between the extracted features. Furthermore, by combining multiple reference classification models for feature fusion and using the fused target sample features to train the third initial classification model, the third initial classification model can learn a more accurate feature distribution of the fused features, so that the trained third target classification model can extract more accurate data features of the input data, and a more accurate classification result can be obtained based on more accurate data features, thereby improving the classification accuracy of the model and the classification accuracy of the data.

[0207] In one embodiment, the classification model training device further includes:

[0208] The first model training module is used to perform model training on the first initial classification model based on the training sample set to obtain a first target classification model.

[0209] The initial model generation module is used to obtain the target class center features corresponding to various training labels from the first target classification model, and generate at least one second initial classification model aligned with the feature space of the first target classification model; the class center features corresponding to various training labels in the second initial classification model are the corresponding target class center features.

[0210] The second model training module is used to perform model training on at least one second initial classification model based on a training sample set to obtain at least one second target classification model, and each second target classification model constitutes a second target classification model set; the third initial classification model keeps the center features of each class unchanged during model training.

[0211] In one embodiment, the first model training module is also used to input the training samples in the training sample set into the first initial classification model; the model parameters of the first initial classification model include initial class center features corresponding to various training labels respectively; extract the current sample features corresponding to the current training sample, and obtain the first prediction label corresponding to the current training sample based on the current sample features and the initial class center features; based on the first prediction label and training label corresponding to the same training sample, adjust the model parameters of the first initial classification model until the first convergence condition is met to obtain the first target classification model.

[0212] In one embodiment, the second model training module is also used to sample the training sample set to obtain multiple training sample subsets, determine a target sample subset from each training sample subset, determine a candidate classification model from each third initial classification model, and use the candidate classification model as the current classification model; input the target training sample in the target sample subset into the current classification model to obtain the initial sample features corresponding to each target training sample; calculate the feature angle information based on the initial sample features corresponding to the target training sample and each class center feature, and obtain the target loss based on the feature angle information corresponding to each target training sample and the angle compensation parameters corresponding to the candidate classification model; adjust the model parameters corresponding to the current classification model based on the target loss to obtain an intermediate classification model; use the next training sample subset as the target sample subset, use the intermediate classification model as the current classification model, return to the step of inputting the target training sample in the target sample subset into the current classification model to obtain the initial sample features corresponding to each target training sample, until the second convergence condition is met, and the second target classification model corresponding to the candidate classification model is obtained.

[0213] In one embodiment, the second model training module is also used to use the training label corresponding to the current target training sample as the target training label, obtain the target angle information corresponding to the current target training sample based on the initial sample features corresponding to the current target training sample and the class center features corresponding to the target training label, obtain the reference angle information corresponding to the current target training sample based on the initial sample features corresponding to the current target training sample and the class center features corresponding to other training labels, and use the target angle information and reference angle information corresponding to the current target training sample as the feature angle information corresponding to the current target training sample; adjust the target angle information and reference angle information corresponding to the same target training sample based on the angle compensation parameter to obtain target feature information and reference feature information, and obtain the initial loss based on the target feature information and reference feature information corresponding to the same target training sample; and obtain the target loss based on the initial losses corresponding to each target training sample.

[0214] In one embodiment, the reference classification model determination module is further used to obtain at least two second target classification models from the second target classification model set as reference classification models. The reference classification model determination module is further used to obtain at least one second target classification model from the first target classification model and the second target classification model set as a reference classification model.

[0215] In one embodiment, the model scales of the first target classification model and the second target classification model are greater than the model scale of the third target classification model.

[0216] In one embodiment, when the first target classification model, the second target classification model and the third target classification model are face recognition models, the third target classification model is used to extract image features corresponding to the input image, and the image features are used for identity recognition.

[0217] In one embodiment, Fig.10 As shown, a data classification device is provided, including: a data acquisition module 1002 and a classification result determination module 1004, wherein:

[0218] The data acquisition module 1002 is used to acquire the data to be classified, input the data to be classified into the third target classification model, and obtain the target features corresponding to the data to be classified.

[0219] The classification result determination module 1004 is used to determine the classification result corresponding to the data to be classified based on the target feature.

[0220] The training process of the third target classification model is as follows: obtain a training sample set; the training sample set includes training samples and training labels corresponding to the training samples; determine at least two reference classification models from the first target classification model and the second target classification model set obtained by training based on the training sample set; in the second target classification model included in the second target classification model set, the class center features corresponding to various training labels are obtained from the first target classification model, and the class center features are used to represent the position information of the training labels in the feature space; input the training sample set into each reference classification model to obtain the reference sample features corresponding to each training sample, and fuse the reference sample features corresponding to the same training sample to obtain the target sample features corresponding to each training sample; input the training sample set into the third initial classification model to obtain the training sample features corresponding to each training sample, and adjust the model parameters of the third initial classification model based on the target sample features and training sample features corresponding to the same training sample until the target convergence conditions are met to obtain the third target classification model.

[0221] In the above-mentioned data classification device, the class center feature is used to represent the position of the training label in the feature space, and each class center feature in the second target classification model is obtained from the first target classification model. Therefore, the second target classification model and the first target classification model are feature space aligned, and the feature space distribution of the second target classification model and the first target classification model is consistent. Each reference classification model determined from the first target classification model and the second target classification model is also feature space aligned. Each reference classification model aligned in feature space is a complementary model, and there is complementarity between the extracted features. Furthermore, by combining multiple reference classification models for feature fusion and using the fused target sample features to train the third initial classification model, the third initial classification model can learn a more accurate feature distribution of the fused features, so that the trained third target classification model can extract more accurate data features of the input data, and a more accurate classification result can be obtained based on more accurate data features, thereby improving the classification accuracy of the model and the classification accuracy of the data.

[0222] In one embodiment, the classification result determination module is further used to calculate the similarity between the target feature and each candidate feature in the feature library; based on the similarity, determine similar features from each candidate feature; and obtain the classification result based on the category labels corresponding to the similar features.

[0223] Each module in the above classification model training device or data classification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0224] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for training data such as a sample set, a first target classification model, a second target classification model and a third target classification model. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a classification model training method or a data classification method is implemented.

[0225] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a classification model training method or a data classification method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0226] Those skilled in the art will understand that Fig.11 , 12The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0227] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0228] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0229] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0230] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0231] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0232] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0233] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A classification model training method, It is characterized in that The method comprises: Acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples; Determine at least two reference classification models from a first target classification model trained based on the training sample set and a second target classification model set trained based on the training sample set; in the first target classification model, class center features corresponding to various training labels are obtained through training; in the second target classification model included in the second target classification model set, class center features corresponding to various training labels are obtained from the first target classification model and remain unchanged during the training process; the class center feature refers to the statistical center of the sample features extracted by the first target classification model from each training sample belonging to the same training label, and the class center feature is used to represent the position information of the training label in the feature space; the second target classification model is a model obtained by sampling the training sample set to obtain multiple training sample subsets, determining a target sample subset from each training sample subset, and training based on the target sample subset; Input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and fuse the reference sample features corresponding to the same training sample to obtain target sample features corresponding to each training sample; Inputting the training sample set into a third initial classification model to obtain training sample features corresponding to each training sample, and adjusting model parameters of the third initial classification model based on target sample features and training sample features corresponding to the same training sample until a target convergence condition is met, thereby obtaining a third target classification model; When the first target classification model, the second target classification model and the third target classification model are face recognition models, the third target classification model is used to extract image features corresponding to the input image, and the image features are used for identity recognition.

2. The method according to claim 1, It is characterized in that Before determining at least two reference classification models from the first target classification model and the second target classification model set obtained by training based on the training sample set, the method further includes: Based on the training sample set, performing model training on the first initial classification model to obtain the first target classification model; Obtain target class center features corresponding to various training labels respectively from the first target classification model, and generate at least one second initial classification model aligned with the feature space of the first target classification model; the class center features corresponding to various training labels respectively in the second initial classification model are the corresponding target class center features; Based on the training sample set, the at least one second initial classification model is trained to obtain at least one second target classification model, and each second target classification model constitutes the second target classification model set; the third initial classification model keeps the center features of each class unchanged during model training.

3. The method according to claim 2, It is characterized in that The step of performing model training on the first initial classification model based on the training sample set to obtain the first target classification model includes: Inputting the training samples in the training sample set into the first initial classification model; the model parameters of the first initial classification model include initial class center features corresponding to various training labels respectively; Extracting a current sample feature corresponding to the current training sample, and obtaining a first prediction label corresponding to the current training sample based on the current sample feature and each initial class center feature; Based on the first prediction label and the training label corresponding to the same training sample, the model parameters of the first initial classification model are adjusted until the first convergence condition is met, thereby obtaining the first target classification model.

4. The method according to claim 2, It is characterized in that The performing model training on the at least one second initial classification model based on the training sample set to obtain at least one second target classification model comprises: Sampling the training sample set to obtain a plurality of training sample subsets, determining a target sample subset from each of the training sample subsets, determining a candidate classification model from each of the third initial classification models, and using the candidate classification model as a current classification model; Input the target training samples in the target sample subset into the current classification model to obtain the initial sample features corresponding to each target training sample; Calculating feature angle information based on initial sample features corresponding to the target training sample and features of each class center, and obtaining target loss based on feature angle information corresponding to each target training sample and angle compensation parameters corresponding to the candidate classification model; Adjust the model parameters corresponding to the current classification model based on the target loss to obtain an intermediate classification model; The next training sample subset is used as the target sample subset, and the intermediate classification model is used as the current classification model. The step of inputting the target training samples in the target sample subset into the current classification model to obtain the initial sample features corresponding to each target training sample is returned to execution until the second convergence condition is met to obtain the second target classification model corresponding to the candidate classification model.

5. The method according to claim 4, It is characterized in that The calculating of feature angle information based on the initial sample features corresponding to the target training samples and the features of each class center, and obtaining the target loss based on the feature angle information corresponding to each target training sample and the angle compensation parameters corresponding to the candidate classification model, include: Taking the training label corresponding to the current target training sample as the target training label, obtaining the target angle information corresponding to the current target training sample based on the initial sample feature corresponding to the current target training sample and the class center feature corresponding to the target training label, obtaining the reference angle information corresponding to the current target training sample based on the initial sample feature corresponding to the current target training sample and the class center feature corresponding to other training labels, and taking the target angle information and the reference angle information corresponding to the current target training sample as the feature angle information corresponding to the current target training sample; Based on the angle compensation parameter, target angle information and reference angle information corresponding to the same target training sample are respectively adjusted to obtain target feature information and reference feature information, and initial loss is obtained based on the target feature information and reference feature information corresponding to the same target training sample; The target loss is obtained based on the initial losses respectively corresponding to the target training samples.

6. The method according to claim 1, It is characterized in that The reference classification model is determined in any of the following ways: Acquire at least two second target classification models from the second target classification model set as reference classification models; At least one second target classification model in the set of the first target classification model and the second target classification model is obtained as a reference classification model.

7. The method according to claim 1, It is characterized in that The method of adjusting the model parameters of the third initial classification model based on the target sample features and the training sample features corresponding to the same training sample until the target convergence condition is met to obtain the third target classification model includes: Obtaining a target class center feature corresponding to the current training sample from the reference classification model, and obtaining a reference label corresponding to the current training sample based on the target sample feature and the target class center feature corresponding to the current training sample; Acquire an initial class center feature corresponding to the current training sample from the third initial classification model, and obtain a second prediction label corresponding to the current training sample based on the training sample feature and the initial class center feature corresponding to the current training sample; Based on the reference label and the second predicted label corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence condition is met, thereby obtaining the third target classification model.

8. The method according to claim 1, It is characterized in that The model scales of the first target classification model and the second target classification model are greater than the model scale of the third target classification model.

9. A data classification method, It is characterized in that The method comprises: Acquire data to be classified, input the data to be classified into a third target classification model, and obtain target features corresponding to the data to be classified; Determine a classification result corresponding to the data to be classified based on the target feature; The training process of the third target classification model is as follows: Acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples; Determine at least two reference classification models from a first target classification model trained based on the training sample set and a second target classification model set trained based on the training sample set; in the first target classification model, class center features corresponding to various training labels are obtained through training; in the second target classification model included in the second target classification model set, class center features corresponding to various training labels are obtained from the first target classification model and remain unchanged during the training process; the class center feature refers to the statistical center of the sample features extracted by the first target classification model from each training sample belonging to the same training label, and the class center feature is used to represent the position information of the training label in the feature space; the second target classification model is a model obtained by sampling the training sample set to obtain multiple training sample subsets, determining a target sample subset from each training sample subset, and training based on the target sample subset; Input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and fuse the reference sample features corresponding to the same training sample to obtain target sample features corresponding to each training sample; The training sample set is input into a third initial classification model to obtain training sample features corresponding to each training sample, and based on the target sample features and training sample features corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence conditions are met to obtain a third target classification model; when the first target classification model, the second target classification model and the third target classification model are face recognition models, the third target classification model is used to extract image features corresponding to the input image, and the image features are used for identity recognition.

10. The method according to claim 9, It is characterized in that The determining the classification result corresponding to the data to be classified based on the target feature includes: Calculate the similarity between the target feature and each candidate feature in the feature library; Based on the similarity, determining similar features from the candidate features; The classification result is obtained based on the category labels corresponding to the similar features.

11. A classification model training device, It is characterized in that The device comprises: A training sample set acquisition module is used to acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples; A reference classification model determination module, used to determine at least two reference classification models from a first target classification model trained based on the training sample set and a second target classification model set trained; in the first target classification model, class center features corresponding to various training labels are obtained through training, and in the second target classification model included in the second target classification model set, class center features corresponding to various training labels are obtained from the first target classification model and remain unchanged during the training process, and the class center feature refers to the statistical center of the sample features extracted by the first target classification model from each training sample belonging to the same training label, and the class center feature is used to represent the position information of the training label in the feature space; the second target classification model is a model obtained by sampling the training sample set to obtain multiple training sample subsets, determining a target sample subset from each training sample subset, and training based on the target sample subset; A feature fusion module is used to input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and to fuse each reference sample feature corresponding to the same training sample to obtain target sample features corresponding to each training sample; The third target classification model determination module is used to input the training sample set into the third initial classification model to obtain the training sample features corresponding to each training sample, and adjust the model parameters of the third initial classification model based on the target sample features and training sample features corresponding to the same training sample until the target convergence conditions are met to obtain the third target classification model; when the first target classification model, the second target classification model and the third target classification model are face recognition models, the third target classification model is used to extract image features corresponding to the input image, and the image features are used for identity recognition.

12. The device according to claim 11, It is characterized in that The device also includes: A first model training module, used to perform model training on a first initial classification model based on the training sample set to obtain the first target classification model; An initial model generation module is used to obtain target class center features corresponding to various training labels from the first target classification model, and generate at least one second initial classification model aligned with the feature space of the first target classification model; the class center features corresponding to various training labels in the second initial classification model are the corresponding target class center features; The second model training module is used to perform model training on the at least one second initial classification model based on the training sample set to obtain at least one second target classification model, and the respective second target classification models constitute the second target classification model set; the third initial classification model keeps the central features of each class unchanged during model training.

13. The device according to claim 12, It is characterized in that The first model training module is also used for: Inputting the training samples in the training sample set into the first initial classification model; the model parameters of the first initial classification model include initial class center features corresponding to various training labels respectively; Extracting a current sample feature corresponding to the current training sample, and obtaining a first prediction label corresponding to the current training sample based on the current sample feature and each initial class center feature; Based on the first prediction label and the training label corresponding to the same training sample, the model parameters of the first initial classification model are adjusted until the first convergence condition is met, thereby obtaining the first target classification model.

14. The device according to claim 12, It is characterized in that The second model training module is also used for: Sampling the training sample set to obtain a plurality of training sample subsets, determining a target sample subset from each of the training sample subsets, determining a candidate classification model from each of the third initial classification models, and using the candidate classification model as a current classification model; Input the target training samples in the target sample subset into the current classification model to obtain the initial sample features corresponding to each target training sample; Calculating feature angle information based on initial sample features corresponding to the target training sample and features of each class center, and obtaining target loss based on feature angle information corresponding to each target training sample and angle compensation parameters corresponding to the candidate classification model; Adjust the model parameters corresponding to the current classification model based on the target loss to obtain an intermediate classification model; The next training sample subset is used as the target sample subset, and the intermediate classification model is used as the current classification model. The step of inputting the target training samples in the target sample subset into the current classification model to obtain the initial sample features corresponding to each target training sample is returned to execution until the second convergence condition is met to obtain the second target classification model corresponding to the candidate classification model.

15. The device according to claim 14, It is characterized in that The second model training module is also used for: Taking the training label corresponding to the current target training sample as the target training label, obtaining the target angle information corresponding to the current target training sample based on the initial sample feature corresponding to the current target training sample and the class center feature corresponding to the target training label, obtaining the reference angle information corresponding to the current target training sample based on the initial sample feature corresponding to the current target training sample and the class center feature corresponding to other training labels, and taking the target angle information and the reference angle information corresponding to the current target training sample as the feature angle information corresponding to the current target training sample; Based on the angle compensation parameter, target angle information and reference angle information corresponding to the same target training sample are respectively adjusted to obtain target feature information and reference feature information, and initial loss is obtained based on the target feature information and reference feature information corresponding to the same target training sample; The target loss is obtained based on the initial losses respectively corresponding to the target training samples.

16. The device according to claim 11, It is characterized in that The reference classification model is determined in any of the following ways: Acquire at least two second target classification models from the second target classification model set as reference classification models; At least one second target classification model in the set of the first target classification model and the second target classification model is obtained as a reference classification model.

17. The device according to claim 11, It is characterized in that The third target classification model determination module is also used for: Obtaining a target class center feature corresponding to the current training sample from the reference classification model, and obtaining a reference label corresponding to the current training sample based on the target sample feature and the target class center feature corresponding to the current training sample; Acquire an initial class center feature corresponding to the current training sample from the third initial classification model, and obtain a second prediction label corresponding to the current training sample based on the training sample feature and the initial class center feature corresponding to the current training sample; Based on the reference label and the second predicted label corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence condition is met, thereby obtaining the third target classification model.

18. The device according to claim 11, It is characterized in that The model scales of the first target classification model and the second target classification model are greater than the model scale of the third target classification model.

19. A data classification device, It is characterized in that The device comprises: A data acquisition module, used to acquire data to be classified, input the data to be classified into a third target classification model, and obtain target features corresponding to the data to be classified; A classification result determination module, used to determine the classification result corresponding to the data to be classified based on the target feature; The training process of the third target classification model is as follows: Acquire a training sample set; the training sample set includes training samples and training labels corresponding to the training samples; Determine at least two reference classification models from a first target classification model trained based on the training sample set and a second target classification model set trained based on the training sample set; in the first target classification model, class center features corresponding to various training labels are obtained through training; in the second target classification model included in the second target classification model set, class center features corresponding to various training labels are obtained from the first target classification model and remain unchanged during the training process; the class center feature refers to the statistical center of the sample features extracted by the first target classification model from each training sample belonging to the same training label, and the class center feature is used to represent the position information of the training label in the feature space; the second target classification model is a model obtained by sampling the training sample set to obtain multiple training sample subsets, determining a target sample subset from each training sample subset, and training based on the target sample subset; Input the training sample set into each reference classification model to obtain reference sample features corresponding to each training sample, and fuse the reference sample features corresponding to the same training sample to obtain target sample features corresponding to each training sample; The training sample set is input into a third initial classification model to obtain training sample features corresponding to each training sample, and based on the target sample features and training sample features corresponding to the same training sample, the model parameters of the third initial classification model are adjusted until the target convergence conditions are met to obtain a third target classification model; when the first target classification model, the second target classification model and the third target classification model are face recognition models, the third target classification model is used to extract image features corresponding to the input image, and the image features are used for identity recognition.

20. The device according to claim 19, It is characterized in that The classification result determination module is also used for: Calculate the similarity between the target feature and each candidate feature in the feature library; Based on the similarity, determining similar features from the candidate features; The classification result is obtained based on the category labels corresponding to the similar features.

21. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.

22. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

23. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.