Data classification method and device and storage medium
Through the training students' models, the output characteristics and prediction results of the teacher model are optimized to solve the problem of large burdens of burden in the data classification of deep neural networks, and realize the efficient approach event of small devices and the prediction of far away from the incident prediction. judge.
Patent Information
- Application Number
- CN202310898593.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2025-01-21
AI Technical Summary
Existing deep neural networks (DNNs) have a high computational burden due to over-parameterization in data classification tasks, and knowledge distillation technology is difficult to effectively realize prediction and judgment of close events and away events on small devices.
Process the data to be classified through the trained student model, use the category prediction features and classification prediction results output by the teacher network sub-model in the teacher model and the second classifier to train the student model, and optimize the student model to achieve the same goal as the teacher model Close performance.
The demand for resource requirements required to classify the use of large models or multiple models for data classification has been reduced, and the generalization and classification efficiency of the student model can be improved. It can effectively carry out forecast judgments to approach events and stay away from events.
Smart Images

Figure CN119337192A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a data classification method, device and storage medium. Background Art
[0002] In recent years, deep neural networks (DNNs) have achieved great success in various fields. It is precisely because of the over-parameterization of deep neural networks that they have excellent generalization performance. In order to improve the performance of algorithms in specific scenarios, either a model with a very large number of parameters is trained, or multiple models with weaker effects are integrated. Both solutions increase the scale of the model and generate a large computational burden. The current solution is mostly to select a DNN model of appropriate scale based on the performance of the terminal equipment in the deployment environment.
[0003] Under the guidance of the idea of knowledge distillation, the feature representation "knowledge" learned by the complex and strong learning network is distilled and passed to the network with small parameters and weak learning ability, so as to achieve the same or close effect as the large model while maintaining the faster reasoning speed of the small model. When the small model after knowledge distillation is applied to data classification, it can improve the efficiency of data classification and reduce the demand for resources. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a data classification method, device and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a data classification method is provided, comprising: obtaining data to be classified; calling a student model for classification processing, and inputting the data to be classified into the student model, and extracting category features of the data to be classified by a student network sub-model of the student model; inputting the category features into a first classifier in the student model to obtain a classification result of the data to be classified; and the student model is trained based on the category prediction features output by the teacher network sub-model in the teacher model and the classification prediction result output by the second classifier of the teacher model.
[0006] In one embodiment, the student model is trained based on the category features output by the teacher network sub-model in the teacher model and the classification prediction results output by the second classifier of the teacher model in the following manner: inputting the training data into the teacher network sub-model in the teacher model to obtain the teacher model category prediction features, and inputting the teacher model category prediction features into the second classifier of the teacher model to obtain the second category label output by the teacher model; determining the second category loss based on the second category label and the true category label of the training data, and performing training constraints on the teacher network sub-model and the second classifier based on the second category loss to obtain a training optimized teacher network sub-model and a training optimized second classifier; training the student model based on the optimized teacher model category prediction features output by the training optimized teacher sub-network model and the optimized second category label output by the training optimized second classifier to obtain a trained student model.
[0007] In one embodiment, the student model is trained based on the optimized teacher model category prediction features output by the trained optimized teacher sub-network model and the optimized second category label output by the trained optimized second classifier to obtain a trained student model, including: inputting the training data into the student network sub-model in the student model to obtain the student model category prediction features, and inputting the student model category prediction features into the first classifier of the student model to obtain the first category label output by the student model; determining the adversarial loss based on the student model category prediction features and the optimized teacher model category prediction features, and determining the first category loss based on the optimized second category label and the first category label; and performing training constraints on the student network sub-model and the first classifier of the student model based on the first category loss and the adversarial loss to obtain a trained student model.
[0008] In one embodiment, the training constraints on the student network sub-model of the student model and the first classifier based on the first category loss and the adversarial loss include: based on the adversarial loss, training constraints on the discriminator to obtain a trained optimized discriminator; inputting the student model category prediction features and the optimized teacher model category prediction features into the trained optimized discriminator to obtain the optimized adversarial loss output by the trained optimized discriminator; based on the optimized adversarial loss, training constraints on the student network sub-model of the student model and the first classifier.
[0009] In one embodiment, the data to be classified includes approaching events or moving away events, the category prediction features output by the teacher network sub-model, and the classification prediction results output by the second classifier of the teacher model include approaching events or moving away events.
[0010] According to the second aspect of the embodiments of the present disclosure, there is provided a data classification device, characterized in that it includes: a receiving module for acquiring data to be classified; a processing module for calling a student model for classification processing, and inputting the data to be classified into the student model, and extracting category features of the data to be classified by the student network sub-model of the student model; inputting the category features into the first classifier in the student model to obtain a classification result of the data to be classified; the student model is trained based on the category prediction features output by the teacher network sub-model in the teacher model, and the classification prediction result output by the second classifier of the teacher model.
[0011] In one embodiment, the student model is trained based on the category features output by the teacher network sub-model in the teacher model and the classification prediction results output by the second classifier of the teacher model in the following manner: inputting the training data into the teacher network sub-model in the teacher model to obtain the teacher model category prediction features, and inputting the teacher model category prediction features into the second classifier of the teacher model to obtain the second category label output by the teacher model; determining the second category loss based on the second category label and the true category label of the training data, and performing training constraints on the teacher network sub-model and the second classifier based on the second category loss to obtain a training optimized teacher network sub-model and a training optimized second classifier; training the student model based on the optimized teacher model category prediction features output by the training optimized teacher sub-network model and the optimized second category label output by the training optimized second classifier to obtain a trained student model.
[0012] In one embodiment, the processing module trains the student model based on the optimized teacher model category prediction features output by the training optimized teacher sub-network model and the optimized second category label output by the training optimized second classifier to obtain a trained student model in the following manner: input the training data into the student network sub-model in the student model to obtain the student model category prediction features, and input the student model category prediction features into the first classifier of the student model to obtain the first category label output by the student model; determine the adversarial loss based on the student model category prediction features and the optimized teacher model category prediction features, and determine the first category loss based on the optimized second category label and the first category label; perform training constraints on the student network sub-model and the first classifier of the student model based on the first category loss and the adversarial loss to obtain a trained student model.
[0013] In one embodiment, the processing module performs training constraints on the student network sub-model and the first classifier of the student model based on the first category loss and the adversarial loss in the following manner: based on the adversarial loss, the discriminator is trained and constrained to obtain a trained optimized discriminator; the student model category prediction features and the optimized teacher model category prediction features are input into the trained optimized discriminator to obtain an optimized adversarial loss output by the trained optimized discriminator; based on the optimized adversarial loss, the student network sub-model and the first classifier of the student model are trained and constrained.
[0014] In one embodiment, the data to be classified includes approaching events or moving away events, the category prediction features output by the teacher network sub-model, and the classification prediction results output by the second classifier of the teacher model include approaching events or moving away events.
[0015] According to a third aspect of an embodiment of the present disclosure, a data classification device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to: execute the data classification method described in the first aspect or any one of the implementations of the first aspect.
[0016] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the data classification method described in the first aspect or any one of the implementations of the first aspect.
[0017] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: using a trained student model to process data to be classified reduces the resource requirements for using a large model or multiple models for data classification; the trained student model can classify multiple types of data, has higher versatility, and has a wide range of applications.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0020] Figure 1a It is a flowchart of an image recognition model compression method based on knowledge distillation technology according to an exemplary embodiment.
[0021] Figure 1bIt is a schematic diagram of cross entropy calculation in an image recognition model compression method based on knowledge distillation technology according to an exemplary embodiment.
[0022] Figure 2 The figure is a flow chart of a data classification method according to an exemplary embodiment.
[0023] Figure 3a It is a flowchart of performing student model training based on teacher model optimization according to an exemplary embodiment.
[0024] Figure 3b is a schematic diagram of an optimized teacher model according to an exemplary embodiment.
[0025] Figure 3c It is a schematic diagram of a teacher model structure according to an exemplary embodiment.
[0026] Figure 4 It is a flow chart of optimizing a student model according to an exemplary embodiment.
[0027] Figure 5 The figure is a flowchart showing an optimization discriminator according to an exemplary embodiment.
[0028] Figure 6 The figure is a schematic diagram showing a method of determining a loss according to an exemplary embodiment.
[0029] Figure 7 The invention is a block diagram of a data classification device according to an exemplary embodiment.
[0030] Figure 8 The invention is a block diagram of a device for data classification according to an exemplary embodiment. DETAILED DESCRIPTION
[0031] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.
[0032] Knowledge distillation is a model compression method. Model compression methods such as parameter clipping, precision conversion, and neural network structure search will destroy the structure of the original model, that is, they will damage the knowledge learned by the original model from the data. Knowledge distillation protects the knowledge learned in the original model through distillation, and then transfers this knowledge to the compressed model. Although the compressed model is much smaller than the original model, it can also learn the same knowledge.
[0033] Analogous to the human learning process, in knowledge distillation, the model to be compressed is called the teacher neural network (Teacher Model), and the model after compression is called the student neural network (Student Model). In general, the size of the teacher neural network is much larger than that of the student neural network. In knowledge distillation, the student model is trained according to the teacher model so that the performance of the student model is close to that of the teacher model. In the process of training the student model, the training effect of the student model will also be affected due to different training methods.
[0034] In related technologies, the idea of adversarial learning can be introduced, with adversarial generative networks as the model framework, the student model as the generator, the teacher model provides real samples and introduces the "teaching assistant" mechanism as the discriminator. The type of knowledge in adversarial distillation adopts feature-based knowledge, and the transferred knowledge is set as the feature map of the middle layer of the network and the output result of the classification layer. The generator generates knowledge information according to the setting of the knowledge type, and uses the "teaching assistant" system to determine whether the information generated by the generator is the information generated by the teacher model. This allows the student network to learn the data distribution of the knowledge generated in the teacher network. Figure 1a FIG. 1 is a flow chart showing a method for compressing an image recognition model based on knowledge distillation technology according to an exemplary embodiment. Figure 1a As shown, the collected data is processed by the adversarial generative network to generate synthetic data with category labels, and the collected data and the synthetic data are merged to obtain a comprehensive data set with category labels. The category labels are used for category feature recognition of the neural network model. The same data in the comprehensive data set is input into the teacher model and the student model respectively, and the corresponding feature map (feature map) and soft target (soft label, representing the probability distribution of the category) are output by the student model and the teacher model respectively. The feature map is output from the middle layer of the network, and the soft target is output from the classification layer. In adversarial distillation, the teacher model is used as a discriminator and the student model is used as a generator. The adversarial loss is obtained by adversarial distillation based on the feature map output by the teacher model and the feature map output by the student model. The adversarial loss represents the difference between the feature map output by the student model and the feature map output by the teacher model. The soft target output by the teacher model and the soft target output by the student model are calculated by KL divergence (Kullback-LeiblerDivergence) loss, and merged with the adversarial loss to obtain the total loss. The KL divergence loss is used to compare the proximity of two probability distributions. According to the total loss, the weighted minimized loss function is obtained by stochastic gradient updating, and the parameters of the student model are adjusted according to the minimized loss function until the performance parameters of the student model reach the expected level.
[0035] In the above-mentioned image recognition model compression method based on knowledge distillation technology, the teacher model is a trained model, while the student model is an untrained model. There is a big gap between the two in their ability to extract input data features, so the teacher model cannot provide efficient guidance to the student model. After training, the performance gap between the student model and the teacher model is large. In addition, the cross entropy needs to be calculated between the soft target obtained by the student model and the soft target obtained by the teacher model, and the cross entropy also needs to be calculated between the soft target obtained by the student model and the true label of the input data. The adversarial loss also needs to be calculated based on the feature map output by the student model. Figure 1b FIG. 1 is a schematic diagram showing cross entropy calculation in an image recognition model compression method based on knowledge distillation technology according to an exemplary embodiment. Figure 1b As shown, the data is input into the teacher model and the student model respectively, and the soft targets corresponding to the teacher model and the student model are outputted through softmax (the layer used for classification tasks in the neural network). The soft targets corresponding to the teacher model and the soft targets corresponding to the student model are subjected to KL divergence loss, and the soft targets corresponding to the student model and the hard targets (real labels, representing a probability distribution) of the input data are subjected to cross entropy loss calculation. Because the teacher model is well-trained, the values of the above two cross entropies are not much different, and both cross entropies require hyperparameters to measure their importance, which increases the difficulty of model training during multiple training processes. In addition, the above method is only used for image recognition, and feature maps need to be extracted for adversarial loss calculation.
[0036] When a large model is needed to predict and judge approaching events and moving away events, it is impossible to predict and judge approaching events and moving away events through the methods in the above-mentioned related technologies. Approaching events are events that are less different from the preset situation, and the prediction probability is greater; moving away events are events that are more different from the preset situation, and the prediction probability is smaller. And because the use of large models for prediction and judgment requires high resource usage, it is not easy to implement on small devices.
[0037] In view of this, a data classification method is provided in the embodiment of the present disclosure. The trained student model is used to classify the data to be processed, which reduces the cost, and can classify multiple categories of data, not limited to a specific category of data. In addition, the performance of the trained student model and the teacher model in the embodiment of the present disclosure is closer, which improves the efficiency of the student model in performing data classification tasks.
[0038] A data classification method is provided in the embodiment of the present disclosure, which can achieve the use of a trained small student model to make corresponding predictions and judgments when a large model is needed to predict and judge approaching events and far-away events, so as to distinguish approaching events from far-away events. This can solve the problem of excessive resource usage when the above-mentioned large model is used to predict and judge approaching events and far-away events.
[0039] The following describes how to perform data classification using a data classification method provided in an embodiment of the present disclosure.
[0040] Figure 2 is a flow chart of a data classification method according to an exemplary embodiment. Figure 2 As shown, the data classification method includes the following steps:
[0041] In step S11, data to be classified is obtained.
[0042] In the disclosed embodiment, the data to be classified is data that needs to be classified, and the data to be classified is obtained and used for subsequent student model to perform data classification.
[0043] In step S12, the student model for classification processing is called, and the data to be classified is input into the student model, and the category features of the data to be classified are extracted by the student network sub-model of the student model.
[0044] In the disclosed embodiment, the student model for classification processing is a trained student model, and the student model can extract corresponding category features according to the input data to be classified for classification. The student model includes a student network sub-model and a first classifier.
[0045] In step S13, the category features are input into the first classifier in the student model to obtain the classification result of the data to be classified.
[0046] In the disclosed embodiment, the student model predicts the category features through the first classifier, and obtains the classification results corresponding to the data to be classified according to the prediction results of the category features by the first classifier.
[0047] In one implementation, the student model may determine the data category with the highest probability in the prediction results of the data to be classified as the classification result of the corresponding classification data.
[0048] In one embodiment, when performing a classification task, the data to be classified is output with corresponding category features by the student network sub-model in the trained student model. The corresponding category features are input into the first classifier in the student model, and the first classifier predicts the category of the feature graph and outputs the corresponding prediction results. The trained student model classifies the input data to be classified according to the prediction results. The data to be classified may be images, sounds or other types of data. The category features may be category features obtained from feature graphs, sound features or other types of data.
[0049] In the disclosed embodiment, the student model used for classification processing is obtained by training the optimized teacher model. The following describes how to obtain the trained student model while optimizing the teacher model.
[0050] Figure 3a It is a flowchart of performing student model training based on teacher model optimization according to an exemplary embodiment.
[0051] In step S21, the training data is input into the teacher network sub-model in the teacher model to obtain the teacher model category prediction features, and the teacher model category prediction features are input into the second classifier of the teacher model to obtain the second category label output by the teacher model.
[0052] In the disclosed embodiment, the training data is processed data with real labels. The real labels represent the category probability distribution of the training data. For example, the training data can be image data, in which case the probability of image data in the real label is 1, and the probability of other types of data is 0.
[0053] In the disclosed embodiment, the teacher model includes a teacher network sub-model and a second classifier. The teacher model category prediction feature is the corresponding data feature extracted for identifying the training data. The second category label is the category probability value, which represents the probability distribution of which category the input training data belongs to after being determined according to the data features.
[0054] In step S22, based on the second category label and the true category label of the training data, the second category loss is determined, and based on the second category loss, the teacher network sub-model and the second classifier are trained with constraints to obtain a trained optimized teacher network sub-model and a trained optimized second classifier.
[0055] In the disclosed embodiment, the second category loss represents the difference between the second category label and the real category label of the training data. The larger the second category loss value, the smaller the difference, and the smaller the second loss value, the larger the difference. The size of the difference represents the performance of the teacher model at this time. The smaller the difference, the higher the performance of the teacher model, and the larger the difference, the lower the performance of the teacher model. The training constraint is to adjust the parameters of the teacher network sub-model and the second classifier to improve the performance of the teacher model.
[0056] In step S23, the student model is trained based on the optimized teacher model category prediction features output by the training optimized teacher sub-network model and the optimized second category label output by the training optimized second classifier to obtain a trained student model.
[0057] In the disclosed embodiment, the student model is trained by using the optimized second category label output by the optimized teacher model to achieve the optimization of the student model, and finally obtain the student model for classification processing.
[0058] Figure 3b is a schematic diagram of an optimized teacher model according to an exemplary embodiment.
[0059] like Figure 3b As shown, X y is the processed training data with real labels, and y is the input X y The corresponding true category label. T The teacher network sub-model T is based on the input X y The extracted features corresponding to the training data. For the classifier C T According to F T The class labels after making the prediction. The optimized classifier C T The optimized category label is obtained by predicting the features output by the optimized teacher network sub-model.
[0060] In one embodiment, if Figure 3b As shown, the teacher network sub-model obtains the features F of the corresponding training data according to the input training data T , and F T Input classifier C T , get the category label corresponding to the input training data according to The category loss is calculated by the real label y corresponding to the input training data, and the category loss L is obtained. cls_T According to L cls_TThe teacher network sub-model and classifier are optimized to obtain the optimized teacher network sub-model and classifier. Then the training data is input into the optimized teacher network sub-model to obtain the optimized features F corresponding to the training data. T , at this time F T The optimized F T . The optimized F T Through the optimized classifier C T Perform prediction processing to obtain optimized category labels in, Used for optimization training of student models.
[0061] In one implementation, the teacher network sub-model T and the classifier C T The second category label output according to the input data Xy Then the category loss is calculated with the true label y of the input data Xy according to the following formula ①:
[0062] L cls_T (T,C T ,X y ,y)=-∑[ylogC T (T(X y ))]……………………… Formula ①
[0063] Where L cls_T (T,C T ,X y ,y) is the class probability value output by the teacher model The category loss with the true label y, C T (T(X y ))for By minimizing L cls_T (T,C T ,X y ,y) to adjust the teacher model parameters and reduce the difference between the teacher output prediction results and the true labels of the training data, thereby improving the teacher model performance and obtaining the optimized teacher model.
[0064] In one implementation, the teacher model may be optimized one or more times to obtain optimized category labels after one or more optimizations, and the student model may be optimized and trained based on the optimized category labels after one or more optimizations.
[0065] Figure 3c It is a schematic diagram of a teacher model structure according to an exemplary embodiment.
[0066] like Figure 3cThe teacher model shown includes a teacher network sub-model and a second classifier, and the teacher model includes a pooling layer, a convolution layer, a fully connected layer, and a softmax layer. FT is a category prediction feature that can be obtained by the teacher network sub-model according to the input data.
[0067] In one implementation, the teacher model may use a Vgg16 network structure or other types of neural network structures.
[0068] In one implementation, the teacher network sub-model can extract features from the training data and obtain category prediction features. Figure 3c As shown in the figure, the teacher network sub-model of the teacher model can determine the weight information from the training data through the convolution layer and generate the convolution kernel. The convolution kernel represents the features extracted from the input training data. After the convolution kernel is obtained through the convolution layer, it is processed through the pooling layer to obtain a 112×112×128 convolution kernel, and then the features are gradually mapped to 56×56×248, 28×28×512, and 14×14×512 convolution kernels through multiple convolution layers, and finally a 7×7×512 feature FT is obtained. The FT is input into the second classifier, and the second category label is obtained through the fully connected layer. The second category label can be used to optimize the teacher model and the student model. Among them, the convolution kernels of the sizes of 112×112×128, 56×56×248, 28×28×512, and 14×14×512 can also be convolution kernels of other sizes according to the actual network structure, and the feature FT of 7×7×512 can also be of other sizes, which can be changed according to the actual application scenario.
[0069] In one embodiment, if Figure 3c As shown, the input training data may be images, audio, video or other types of data, and the categories in the category features corresponding to the output of the teacher network sub-model may include image features, audio features, video features or other types of features.
[0070] In one embodiment, if Figure 3c As shown, when the teacher model generates the second category label based on the training data, it is not necessary to pass Figure 3c The softmax layer in directly outputs the second category label, that is, directly outputs the second category label through the fully connected layer.
[0071] In one implementation, the image data can be input into the teacher model, and the image features and second category labels corresponding to the input image data are obtained respectively through the teacher network sub-model and the second classifier in the teacher model, and the second category loss is obtained according to the second category label and the real label of the input image. The teacher model is optimized according to the image features and second category losses corresponding to the input image data to improve the classification and recognition ability of the teacher model for the image data, and a trained optimized teacher model is obtained. The input image data is input into the trained optimized teacher model after the classification and recognition ability of the image data is improved, and the optimized image features and optimized second category labels corresponding to the input image data are output through the above process. The student model is trained and constrained by the optimized image features and optimized second category labels corresponding to the input image data, thereby improving the image classification and recognition ability of the student model. Among them, the input data can be other types of data other than image data, such as audio, video or other types of data, to improve the classification and recognition ability of the teacher model for audio, video or other types of data, and then improve the classification and recognition ability of the student model for audio, video or other types of data, so as to improve the ability of the student model to classify data.
[0072] In the disclosed embodiment, the data output by the optimized teacher model is used to optimize the student model. The following describes how to optimize the student model.
[0073] Figure 4 It is a flow chart of optimizing a student model according to an exemplary embodiment.
[0074] In step S31, the training data is input into the student network sub-model in the student model to obtain the student model category prediction features, and the student model category prediction features are input into the first classifier of the student model to obtain the first category label output by the student model.
[0075] In the disclosed embodiment, the student model is an untrained student model, and the student model category prediction features and the first category label are determined through the student model for subsequent determination of the adversarial loss and the first category loss, respectively.
[0076] In step S32, the adversarial loss is determined based on the student model category prediction features and the optimized teacher model category prediction features, and the first category loss is determined based on the optimized second category label and the first category label.
[0077] In the disclosed embodiment, the optimized teacher model category prediction feature is the teacher model category prediction feature obtained by the teacher model after one or more optimizations based on the input training data.
[0078] In the disclosed embodiment, the adversarial loss characterizes the difference between the category prediction features of the student model and the category prediction features of the optimized teacher model, and indirectly characterizes the performance gap between the teacher model and the student model. The larger the adversarial loss value, the smaller the performance gap between the teacher model and the student model, and the smaller the adversarial loss value, the larger the performance gap between the teacher model and the student model. The first category loss characterizes the difference in category probability distribution between different categories between the category prediction features obtained by the student based on the input data and the category prediction features of the optimized teacher model.
[0079] In step S33, training constraints are performed on the student network sub-model and the first classifier of the student model based on the first category loss and the adversarial loss to obtain a trained student model.
[0080] In the disclosed embodiment, the student network sub-model and the first classifier of the student model are subjected to training constraints, that is, the parameters of the student model are adjusted, so as to optimize the student model. The trained student model is the student model used for classification processing.
[0081] In one implementation, the student model may be optimized one or more times before optimizing the teacher model.
[0082] In one implementation, a student model before training can select a model with lower performance. For example, the student network sub-model in the student model can use 4 layers of convolution to extract 7×7×512-sized category prediction features from the input data, and then make a judgment through the first classifier. The student network sub-model in the student model can also use other types of network structures to achieve the purpose of obtaining input data features.
[0083] In one implementation, the network structure of the first classifier in the student model can be 2 layers of convolution + 1 layer of fully connected layer, mapping the 7×7×512 features to a vector of 1×the number of categories. Among them, the vector of 1×the number of categories is the first category label output by the student model in the above embodiment. The network structure of the first classifier can also use other types of network structures according to actual needs.
[0084] In one implementation, the student network sub-model S and the classifier C S According to the input data X y Output the first category label Then, the optimized teacher network sub-model T and classifier C T According to the input data X y Output second category label Calculate the category loss according to the following formula ②, and adjust the student network sub-model S and classifier C according to the loss value S The network parameter weight distribution is:
[0085]
[0086] in, For the same training data, the class loss between the second class label output by the teacher module and the first class label output by the student model is optimized. S (S(X y )) is the first category label output by the student model
[0087] In one implementation, the following formula ③ can be used to determine the same input data X y , the feature F output by the student network sub-model S S And the feature F output by the optimized teacher network sub-model T T Distributed adversarial loss:
[0088] L I (S,D,X y ,F T )=∑[log(D(F T ))]+∑[log(1-D(S(X y ))]………Formula ③
[0089] Among them, L I (S,D,X y ,F T ) is the adversarial loss between the output features of the student network sub-model and the output features of the teacher network sub-model, (D(F T )) is the category prediction feature F output by the optimized teacher network sub-model T T , D(S(X y ) is the category prediction feature F output by the student network sub-model S S .
[0090] In one implementation, the student model can be optimized in combination with the above formula ② and formula ③ to obtain an optimized student model.
[0091] In the disclosed embodiment, after optimizing the student model or the teacher module, the discriminator is also optimized. The following describes how to optimize the discriminator.
[0092] Figure 5 The figure is a flowchart showing an optimization discriminator according to an exemplary embodiment.
[0093] In step S41, based on the adversarial loss, the discriminator is trained with constraints to obtain a trained optimized discriminator.
[0094] In the disclosed embodiment, the discriminator adjusts its own parameters according to the adversarial loss to obtain an optimized trained optimized discriminator.
[0095] In step S42, the student model category prediction features and the optimized teacher model category prediction features are input into the trained optimized discriminator to obtain the optimized adversarial loss output by the trained optimized discriminator.
[0096] In the disclosed embodiment, the optimized adversarial loss is the result obtained after training the optimized discriminator to judge the difference in category probability distribution between the student model category prediction features and the optimized teacher model category prediction features, characterizing the difference in category probability distribution between different categories of the student model category prediction features and the optimized teacher model category prediction features.
[0097] In step S43, based on optimizing the adversarial loss, training constraints are imposed on the student network sub-model and the first classifier of the student model.
[0098] In the disclosed embodiment, the training optimization discriminator is a trained discriminator, and after the teacher model or the student model is trained and constrained, the discriminator is also trained and optimized. The training optimization discriminator constrains the student model according to the optimized adversarial loss.
[0099] In one embodiment, for optimizing the feature F output by the teacher network sub-model T T , the discriminator expects to output an adversarial loss value close to 1, for the feature F output by the student network sub-model S S , the discriminator expects to output an adversarial loss value close to 0. Therefore, according to formula ③, by maximizing L I (S,D,X y ,F T ) to adjust the parameters of the discriminator, that is, by minimizing -L I (S,D,X y ,F T ) to adjust the parameters of the discriminator.
[0100] In one implementation, the discriminator may map a feature of size 7x7x512 to a feature of size 7x7x1 through three convolutional layers, and then obtain a probability prediction value through a fully connected layer. The network structure of the discriminator may be other types of network structures, in which the features may be mapped through the convolutional layers.
[0101] In one implementation, the discriminator can obtain probability prediction values corresponding to the category prediction features output by the optimized teacher model and the category prediction features output by the student model, and obtain corresponding adversarial losses based on the probability prediction values.
[0102] Figure 6 The figure is a schematic diagram showing a method of determining a loss according to an exemplary embodiment.
[0103] In one embodiment, if Figure 6 As shown in the figure, the same data Xy is input into the student network sub-model S and the optimized teacher network sub-model T respectively, and the category prediction feature Fs output by the student network sub-model S and the category prediction feature F output by the optimized teacher network sub-model T are obtained respectively. T . T Input optimized classifier C T Get optimized second category label And according to And the true label y of the input data Xy gets the category loss L cls_T (T,C T ,X y ,y), which is the second category loss in the above embodiment. cls_T (T,C T ,X y ,y) is used to optimize the teacher model. The discriminator D is based on Fs and F T Get the adversarial loss L I , which is the first adversarial loss in the above embodiment. I Used for optimization of the discriminator D and the student model. The classifier Cs in the student model obtains the first category label according to Fs And according to and the optimized second category label output by the teacher model Get the category loss That is, the first category loss in the above embodiment. Used to optimize the student model.
[0104] In one embodiment, the discriminator D is based on Fs and F T After determining the adversarial loss, the discriminator D will be optimized according to the adversarial loss. The optimized discriminator D can be calculated based on Fs and F T The determined adversarial loss is used to optimize the student model.
[0105] In one implementation, after the discriminator determines the adversarial loss, one or more optimizations may be performed.
[0106] In one implementation, by combining formula ② and formula ③, the following formula ④ can be obtained to optimize the training of the student model:
[0107]
[0108] in, is the category loss in formula ②, L I (S,D,X y ,F T ) is the adversarial loss in formula ③, λ I is a hyperparameter used to measure the category loss Lcls_S and adversarial loss L I In optimizing the student network sub-model S and classifier C S The weight of the parameter. To optimize the student network sub-model S and classifier C S The network parameters are used to optimize the student model. I And two formulas are used to optimize the student model.
[0109] In one embodiment, a teacher model, a student model, a discriminator and training data for training are determined, wherein the training data is processed data with real labels, the teacher model includes a teacher network sub-model and a second classifier, and the student model includes a student network sub-model and a first classifier. The training data is input into the teacher model, the teacher network sub-model outputs the teacher model category prediction feature corresponding to the input data, and the second classifier outputs the second category label corresponding to the teacher model category prediction feature according to the teacher model category prediction feature. The second category loss is obtained according to the second category label and the real label of the output training data, and the teacher network sub-model and the second classifier are trained and optimized by minimizing the loss value of the second category loss, thereby obtaining a training optimized teacher model. The input training data is input into the training optimized teacher model, and the above process is repeated to output the optimized teacher model category prediction feature and the optimized second label obtained by the teacher network sub-model and the second classifier after training optimization. Among them, the teacher model that outputs the optimized second label can be a teacher model after one or more optimizations. The training data is input into the student module, the student model category prediction feature is obtained by the output of the student network sub-model, and the first category label is obtained by the output of the first classifier according to the student model category prediction feature. According to the student model category prediction feature and the optimized teacher model category prediction feature, the corresponding adversarial loss is obtained through the discriminator, and the first category loss is obtained according to the optimization of the second label and the first label. Among them, the student model category prediction feature can be the student model category prediction feature output by the student model after one or more optimizations. The discriminator is optimized by maximizing the loss value of the adversarial loss to obtain a trained optimized discriminator. The optimized discriminator obtains the optimized adversarial loss according to the optimized teacher model category prediction feature and the student model category prediction feature. Among them, the discriminator can be optimized once after each training optimization of the teacher model or the student model. According to the optimized adversarial loss and the first category loss, the student network sub-model and the first classifier in the student model are trained and optimized, thereby optimizing the student model. Through one or more optimizations of the student model in the above process, the trained student model is finally obtained as the student model for classification processing. Among them, the training optimization of the teacher model and the training optimization of the student model can be performed alternately according to needs. After obtaining the data to be classified, the student model for classification processing can be called to extract the category features corresponding to the data to be classified through the student network sub-model of the student model in the student model. The first classifier in the student model determines the classification result of the data to be classified based on the category features corresponding to the data to be classified.
[0110] In one embodiment, the classification of the data to be classified and the training data can be the classification of the same type of data. For example, when the data to be classified is a picture, and the classification task is to identify the object in the image, the student model will output the corresponding image classification recognition result, and classify the picture differently or the same. The above-mentioned student model classification process can also be used for the classification processing of audio, video or other types of data.
[0111] In one embodiment, the classification of the data to be classified and the training data can be the classification of different types of data. For example, when the data to be classified includes pictures and audio, the pictures and audio can be distinguished and identified by the student model. The above-mentioned student model classification process can also be used for multiple types of data classification processing between audio, video or other types of data.
[0112] In one embodiment, the data to be classified includes approaching events and distant events, the data to be classified includes approaching events or distant events, the category prediction features output by the teacher network sub-model, and the classification prediction results output by the second classifier of the teacher model include approaching events or distant events.
[0113] Among them, whether it is an approach event or a distance event is determined by the classification task requirements and the training task requirements.
[0114] In one embodiment, the classification of the data to be classified and the training data can be the classification of the far-away events and the approaching events. For example, when a larger model is needed to classify the data containing the approaching event A and the far-away event B, the data containing the approaching event A and the far-away event B are input into a small trained student model. If it is necessary to determine the approaching event, the student model outputs A, at which time the predicted probability of A is the largest, characterizing A as a close event to the input data. If it is necessary to determine the far-away event, the student model outputs B, at which time the predicted probability of B is large, characterizing B as a far-away event from the input data. When it is necessary to determine the far-away event and the approaching event respectively, the student model can output A and B and determine the corresponding event type. Among them, A and B in the above-mentioned embodiment are all events of any type, and can also be other types of events that need to be classified and judged in other quantities, and the far-away events and the approaching events are classified according to the actual task requirements.
[0115] In one implementation, approach events and distance events may be used as input training data, and the student model may be trained through the training process in the above embodiment to improve the student's ability to judge and classify approach events and distance events, and ultimately obtain a trained student model.
[0116] In one implementation, the teacher model is a larger model and the student model is a smaller model. The larger model has a more complex architecture and stronger initial performance. The smaller model has a simpler architecture and weaker initial performance.
[0117] In one implementation, when a larger model is needed for large-scale classification prediction, multiple small trained student models can be obtained through the process of training the student model in the disclosed embodiment. By using one or more small trained student models, it is possible to replace the scenario where a larger model is needed for classification prediction, and achieve the same classification prediction effect as the larger model, thereby reducing resource usage and electronic equipment configuration requirements.
[0118] The data classification method in the disclosed embodiment updates the parameters of the teacher model and the student model during the training process to avoid poor performance of the student model due to the large gap in the feature extraction capabilities of the teacher model and the student model. In addition, by using multiple loss functions, the difference between the output results of the student model and the output results of the teacher model can be calculated for the input data of a specific task. It is not limited to the analysis of a single type of data and can achieve the classification of multiple types of data. By using a student model close to the performance of the teacher model for data classification, resource usage is reduced and data classification efficiency is improved.
[0119] Based on the same concept, the embodiment of the present disclosure also provides a data classification device.
[0120] It is understandable that the data classification device provided by the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0121] Figure 7 is a block diagram of a data classification device according to an exemplary embodiment. Figure 7 The device includes a receiving module 101 and a processing module 102.
[0122] The receiving module 101 is configured to obtain data to be classified.
[0123] The processing module 102 is configured to call the student model for classification processing, and input the data to be classified into the student model, and the student network sub-model of the student model extracts the category features of the data to be classified; the category features are input into the first classifier in the student model to obtain the classification results of the data to be classified.
[0124] In one implementation provided by the embodiments of the present disclosure, the student model is trained based on the category features output by the teacher network sub-model in the teacher model and the classification prediction results output by the second classifier of the teacher model in the following manner: the training data is input into the teacher network sub-model in the teacher model to obtain the category prediction features of the teacher model, and the category prediction features of the teacher model are input into the second classifier of the teacher model to obtain the second category label output by the teacher model; based on the second category label and the true category label of the training data, the second category loss is determined, and based on the second category loss, the teacher network sub-model and the second classifier are trained with constraints to obtain a training optimized teacher network sub-model and a training optimized second classifier; based on the optimized teacher model category prediction features output by the training optimized teacher sub-network model and the optimized second category label output by the training optimized second classifier, the student model is trained to obtain a trained student model.
[0125] In one implementation provided by the embodiments of the present disclosure, the processing module 102 trains the student model based on the optimized teacher model category prediction features output by the training optimized teacher sub-network model and the optimized second category label output by the training optimized second classifier to obtain a trained student model in the following manner: input the training data into the student network sub-model in the student model to obtain the student model category prediction features, and input the student model category prediction features into the first classifier of the student model to obtain the first category label output by the student model; determine the adversarial loss based on the student model category prediction features and the optimized teacher model category prediction features, and determine the first category loss based on the optimized second category label and the first category label; perform training constraints on the student network sub-model and the first classifier of the student model based on the first category loss and the adversarial loss to obtain a trained student model.
[0126] In one implementation provided by an embodiment of the present disclosure, the processing module 102 performs training constraints on the student network sub-model and the first classifier of the student model based on the first category loss and the adversarial loss in the following manner: based on the adversarial loss, the discriminator is trained and constrained to obtain a trained optimized discriminator; the student model category prediction features and the optimized teacher model category prediction features are input into the trained optimized discriminator to obtain the optimized adversarial loss output by the trained optimized discriminator; based on the optimized adversarial loss, the student network sub-model and the first classifier of the student model are trained and constrained.
[0127] In one implementation provided by the present disclosure, the data to be classified includes approaching events or moving away events, the category prediction features output by the teacher network sub-model, and the classification prediction results output by the second classifier of the teacher model include approaching events or moving away events.
[0128] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0129] Figure 8 2 is a block diagram of a device 200 for data classification according to an exemplary embodiment. For example, the device 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0130] Reference Figure 8 , the device 200 may include one or more of the following components: a processing component 202 , a memory 204 , a power component 206 , a multimedia component 208 , an audio component 210 , an input / output (I / O) interface 212 , a sensor component 214 , and a communication component 216 .
[0131] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.
[0132] The memory 204 is configured to store various types of data to support operations on the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0133] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 200.
[0134] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0135] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC), and when the device 200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 204 or sent via the communication component 216. In some embodiments, the audio component 210 also includes a speaker for outputting audio signals.
[0136] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0137] The sensor assembly 214 includes one or more sensors for providing various aspects of the status assessment of the device 200. For example, the sensor assembly 214 can detect the open / closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, the sensor assembly 214 can also detect the position change of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200 and the temperature change of the device 200. The sensor assembly 214 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 214 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0138] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0139] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0140] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, and the instructions can be executed by the processor 220 of the device 200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0141] It is to be understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.
[0142] It is further understood that the terms "first", "second", etc. are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a specific order or degree of importance. In fact, the expressions "first", "second", etc. can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.
[0143] It can be further understood that, unless otherwise specified, “connection” includes a direct connection without other components between the two, and also includes an indirect connection with other components between the two.
[0144] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order shown or in a serial order, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0145] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0146] It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.
Claims
1. A data classification method, characterized in that: include: Obtain data to be classified; Calling a student model for classification processing, and inputting the data to be classified into the student model, and extracting the category features of the data to be classified by the student network sub-model of the student model; Inputting the category feature into the first classifier in the student model to obtain the classification result of the data to be classified; The student model is trained based on the category prediction features output by the teacher network sub-model in the teacher model and the classification prediction results output by the second classifier of the teacher model.
2. The data classification method according to claim 1, characterized in that: The student model is trained based on the category features output by the teacher network sub-model in the teacher model and the classification prediction results output by the second classifier of the teacher model in the following manner: Input the training data into the teacher network sub-model in the teacher model to obtain the teacher model category prediction feature, and input the teacher model category prediction feature into the second classifier of the teacher model to obtain the second category label output by the teacher model; Based on the second category label and the true category label of the training data, determine the second category loss, and perform training constraints on the teacher network sub-model and the second classifier based on the second category loss to obtain a training optimized teacher network sub-model and a training optimized second classifier; Based on the optimized teacher model category prediction features output by the training optimized teacher sub-network model and the optimized second category label output by the training optimized second classifier, the student model is trained to obtain a trained student model.
3. The data classification method according to claim 2, characterized in that: The method of training the student model based on the optimized teacher model category prediction feature output by the training optimized teacher subnetwork model and the optimized second category label output by the training optimized second classifier to obtain a trained student model includes: Input the training data into the student network sub-model in the student model to obtain a student model category prediction feature, and input the student model category prediction feature into the first classifier of the student model to obtain a first category label output by the student model; Determining an adversarial loss based on the student model category prediction feature and the optimized teacher model category prediction feature, and determining a first category loss based on the optimized second category label and the first category label; Based on the first category loss and the adversarial loss, training constraints are performed on the student network sub-model and the first classifier of the student model to obtain a trained student model.
4. The data classification method according to claim 3, characterized in that: The training constraints on the student network sub-model and the first classifier of the student model based on the first category loss and the adversarial loss include: Based on the adversarial loss, the discriminator is trained with constraints to obtain a trained optimized discriminator; Inputting the student model category prediction feature and the optimized teacher model category prediction feature into the training optimization discriminator to obtain the optimized adversarial loss output by the training optimization discriminator; Based on the optimized adversarial loss, training constraints are imposed on the student network sub-model of the student model and the first classifier.
5. The data classification method according to claim 1, characterized in that: The data to be classified includes approaching events or moving away events, the category prediction features output by the teacher network sub-model, and the classification prediction results output by the second classifier of the teacher model include approaching events or moving away events.
6. A data classification device, characterized in that: include: A receiving module, used for obtaining data to be classified; A processing module, used for calling a student model for classification processing, and inputting the data to be classified into the student model, and extracting the category features of the data to be classified by the student network sub-model of the student model; Inputting the category feature into the first classifier in the student model to obtain the classification result of the data to be classified; The student model is trained based on the category prediction features output by the teacher network sub-model in the teacher model and the classification prediction results output by the second classifier of the teacher model.
7. The data classification device according to claim 6, characterized in that: The student model is trained based on the category features output by the teacher network sub-model in the teacher model and the classification prediction results output by the second classifier of the teacher model in the following manner: Input the training data into the teacher network sub-model in the teacher model to obtain the teacher model category prediction feature, and input the teacher model category prediction feature into the second classifier of the teacher model to obtain the second category label output by the teacher model; Based on the second category label and the true category label of the training data, determine the second category loss, and perform training constraints on the teacher network sub-model and the second classifier based on the second category loss to obtain a training optimized teacher network sub-model and a training optimized second classifier; Based on the optimized teacher model category prediction features output by the training optimized teacher sub-network model and the optimized second category label output by the training optimized second classifier, the student model is trained to obtain a trained student model.
8. The data classification device according to claim 7, characterized in that: The processing module trains the student model based on the optimized teacher model category prediction feature output by the training optimized teacher subnetwork model and the optimized second category label output by the training optimized second classifier to obtain a trained student model in the following manner: Input the training data into the student network sub-model in the student model to obtain a student model category prediction feature, and input the student model category prediction feature into the first classifier of the student model to obtain a first category label output by the student model; Determining an adversarial loss based on the student model category prediction feature and the optimized teacher model category prediction feature, and determining a first category loss based on the optimized second category label and the first category label; Based on the first category loss and the adversarial loss, training constraints are performed on the student network sub-model and the first classifier of the student model to obtain a trained student model.
9. The data classification device according to claim 8, characterized in that: The processing module performs training constraints on the student network sub-model and the first classifier of the student model based on the first category loss and the adversarial loss in the following manner: Based on the adversarial loss, the discriminator is trained with constraints to obtain a trained optimized discriminator; Inputting the student model category prediction feature and the optimized teacher model category prediction feature into the training optimization discriminator to obtain the optimized adversarial loss output by the training optimization discriminator; Based on the optimized adversarial loss, training constraints are imposed on the student network sub-model of the student model and the first classifier.
10. The data classification device according to claim 6, characterized in that: The data to be classified includes approaching events or moving away events, the category prediction features output by the teacher network sub-model, and the classification prediction results output by the second classifier of the teacher model include approaching events or moving away events.
11. A data classification device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: execute the data classification method described in any one of claims 1 to 5.
12. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions in the storage medium are executed by the processor of the terminal, the terminal is enabled to execute the data classification method described in any one of claims 1 to 5.