Training method, device, equipment, medium and program product of classification model

CN117216550BActive Publication Date: 2026-09-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310869852.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-14
Publication Date
2026-09-15
Estimated Expiration
2043-07-14

AI Technical Summary

Technical Problem

[0004]然而,相关技术中的长尾学习方法主要是基于类别的先验知识(即训练数据集中属于某一类别的样本数量)设计了固定的类别平衡策略,相当于默认了模型对分类任务的学习困难度与样本数量呈负相关关系,而实际上其并非绝对的负相关关系

Benefits of technology

[0020] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the training method for the classification model described in any of the above embodiments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216550B_ABST
    Figure CN117216550B_ABST
Patent Text Reader

Abstract

The application discloses a kind of training method, device, equipment, medium and program product of classification model, it is related to artificial intelligence field.The method comprises: determining the first loss value corresponding to sample data based on category label and first classification prediction result, the first loss value of the sample data corresponding to K categories is respectively generalized constraint, to obtain second loss value, by second loss value to first classification model is trained, and second classification model is obtained;Sample data is input into second classification model and is classified and predicted, to obtain second classification prediction result;Determine the third loss value corresponding to sample data based on category label and second classification prediction result, by third loss value to second classification model is trained, and target classification model is obtained.Through the first stage of training, common characteristics capable of eliminating category bias are learned, to alleviate the category preference problem brought by unbalanced distribution even long tail distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and in particular to a method, apparatus, device, medium, and program product for training a classification model. Background Technology

[0002] Long-tailed distribution refers to a skewed distribution in the training dataset, where a few classes (the head classes) contain a large number of samples, while most classes (the tail classes) have very few samples. In data classification tasks, long-tailed learning methods aim to learn unbiased models for each class on a long-tailed training dataset.

[0003] One related technique is the long-tail learning method, which assigns different weights to different categories when calculating the model loss during training. For example, the weight of a category is determined based on the number of samples belonging to that category in the training dataset. The number of samples and the weight are negatively correlated, meaning that lower weights are given to head categories and higher weights to tail categories, in order to eliminate the model's bias towards different categories.

[0004] However, long-tail learning methods in related technologies mainly employ fixed class balancing strategies based on prior knowledge of categories (i.e., the number of samples belonging to a certain category in the training dataset). This implicitly assumes a negative correlation between the learning difficulty of the model for classification tasks and the number of samples, when in reality, this is not an absolute negative correlation. In other words, long-tail learning methods in related technologies cannot learn feature representations that eliminate class bias based on the actual categories in the sample dataset, thus failing to ensure that the trained model can maintain high classification accuracy across all categories. Summary of the Invention

[0005] This application provides a method, apparatus, device, medium, and program product for training a classification model. The technical solution is as follows:

[0006] On the one hand, a method for training a classification model is provided, the method comprising:

[0007] Obtain a sample dataset, which includes multiple sample data labeled with category labels, and the multiple sample data correspond to K categories, where K is an integer greater than 1;

[0008] The sample data is input into the first classification model for classification prediction to obtain the first classification prediction result. The first classification prediction result is used to indicate the first probability that the sample data belongs to each of the K categories.

[0009] Based on the category label and the first classification prediction result, a first loss value corresponding to the sample data is determined. A generalization constraint is applied to the first loss value of the sample data corresponding to the K categories to obtain a second loss value. The first classification model is trained using the second loss value to obtain a second classification model.

[0010] The sample data is input into the second classification model for classification prediction to obtain a second classification prediction result. The second classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories.

[0011] Based on the category label and the second classification prediction result, a third loss value is determined for the sample data. The second classification model is then trained using the third loss value to obtain a target classification model, which is used to predict the category of the data.

[0012] On the other hand, a training apparatus for a classification model is provided, the apparatus comprising:

[0013] The acquisition module is used to acquire a sample dataset, which includes multiple sample data labeled with category labels. The multiple sample data correspond to K categories, where K is an integer greater than 1.

[0014] The prediction module is used to input the sample data into the first classification model for classification prediction and obtain the first classification prediction result. The first classification model is used to perform the binary classification task corresponding to the K categories respectively. The first classification prediction result is used to indicate the first probability that the sample data belongs to each of the K categories.

[0015] The training module is used to determine the first loss value corresponding to the sample data based on the category label and the first classification prediction result, apply generalization constraints to the first loss values ​​of the sample data corresponding to the K categories respectively to obtain the second loss value, and train the first classification model with the second loss value to obtain the second classification model;

[0016] The prediction module is further configured to input the sample data into the second classification model for classification prediction, and obtain a second classification prediction result. The second classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories.

[0017] The training module is further configured to determine a third loss value corresponding to the sample data based on the category label and the second classification prediction result, and to train the second classification model using the third loss value to obtain a target classification model, which is used to predict the category of the data.

[0018] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the training method of the classification model as described in any of the above embodiments.

[0019] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement a training method for a classification model as described in any of the above embodiments.

[0020] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the training method for the classification model described in any of the above embodiments.

[0021] The beneficial effects of the technical solutions provided in this application include at least the following:

[0022] The first classification model is trained in two stages based on the sample dataset: In the first stage, the model learns the common features among the various classification tasks, i.e., it is trained using a second loss value with generalization constraints to obtain a second classification model with balanced classification ability for samples of each class; In the second stage, the model learns the dissimilar features among the various classification tasks, i.e., it is trained using a third loss value to adjust the classification ability of the second classification model for samples of each class. When the samples in the sample dataset exhibit an imbalanced distribution or even a long-tailed distribution, the training method of the classification model provided in this application learns common features that can eliminate class bias through the first stage of training, thereby alleviating the class bias problem caused by imbalanced distribution or even long-tailed distribution; Subsequently, the classification ability of the second classification model for samples of each class is optimized through the second stage of training, so that the trained target classification model can also have a high classification accuracy in each class. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of an implementation environment provided by an exemplary embodiment of this application;

[0025] Figure 2 This is a flowchart of a training method for a classification model provided in an exemplary embodiment of this application;

[0026] Figure 3 This is a flowchart of a training method for a classification model provided in another exemplary embodiment of this application;

[0027] Figure 4 This is a schematic diagram of the model structure provided in an exemplary embodiment of this application;

[0028] Figure 5 This is a flowchart of a training method for a classification model provided in yet another exemplary embodiment of this application;

[0029] Figure 6 This is a flowchart of a training method for a classification model provided in another exemplary embodiment of this application;

[0030] Figure 7 This is a structural block diagram of a training apparatus for a classification model provided in an exemplary embodiment of this application;

[0031] Figure 8 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] In this application, the terms "first" and "second" are used to distinguish between identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first" and "second", nor is there any limitation on the quantity or execution order.

[0034] First, a brief introduction to the terms used in the embodiments of this application will be given.

[0035] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0036] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained model technology, operating / interactive systems, and mechatronics. Among these, pre-trained models, also known as large-scale models or foundational models, can be widely applied to downstream tasks across various AI fields after fine-tuning. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0037] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instruction-based learning. Pre-trained models are the latest development in deep learning, integrating all of these techniques.

[0038] The solutions provided in this application involve artificial intelligence technologies such as computer vision, speech processing, natural language processing, and machine learning / deep learning, which are specifically illustrated in the following embodiments.

[0039] In related technologies, a long-tail learning method is provided, which assigns different weights to different categories when calculating the model loss during training. For example, the weight of a category is determined based on the number of samples belonging to that category in the training dataset, with a negative correlation between the number of samples and the weight. That is, lower weights are given to head categories and higher weights to tail categories to eliminate model bias. However, the long-tail learning method in related technologies mainly designs a fixed class balancing strategy based on prior knowledge of the categories (i.e., the number of samples belonging to a certain category in the training dataset). This is equivalent to assuming that the learning difficulty of the model for the classification task is negatively correlated with the number of samples, but in reality, it is not an absolute negative correlation. In other words, the long-tail learning method in related technologies cannot learn feature representations that can eliminate class bias based on the actual categories in the sample dataset, thus failing to ensure that the trained model can have high classification accuracy across all categories.

[0040] When the samples in the sample dataset exhibit an imbalanced distribution or even a long-tailed distribution, the training method of the classification model provided in this application learns common features that can eliminate class bias through the first stage of training, thereby alleviating the class bias problem caused by the imbalanced or long-tailed distribution. Subsequently, the classification ability of the second classification model for samples under each category is optimized through the second stage of training, so that the trained target classification model can also have a high classification accuracy under each category. The training method of the classification model provided in this application can be applied to at least one of various classification scenarios, such as drug characteristic prediction, image classification, and text classification.

[0041] It is worth noting that the above application scenarios are merely illustrative examples. The training method of the classification model provided in this embodiment can also be applied to other scenarios, and this application embodiment does not limit it.

[0042] Secondly, the implementation environment involved in the embodiments of this application will be described. The training method of the classification model provided in the embodiments of this application can be implemented by the terminal alone, by the server, or by the terminal and the server through data interaction. The embodiments of this application do not limit this. Optionally, the method of training the classification model by interaction between the terminal and the server will be used as an example for description.

[0043] This is illustrative; please refer to it. Figure 1 The implementation environment involves a terminal 110 and a server 120, which are connected via a communication network 130.

[0044] In some embodiments, terminal 110 has a data acquisition function, wherein the data acquired by terminal 110 includes at least one of multiple data types such as text, image, audio, and video. After acquiring the data, terminal 110 preprocesses the data according to the type of the candidate classification model to be trained. For example, if the candidate classification model is a text model, all acquired data is converted into text type, and the converted text data is classified to form a sample dataset for training the candidate text classification model.

[0045] In this embodiment, the terminal 110 classifies the text data, that is, labels the text data with category tags. Optionally, the method of labeling the category tags includes at least one of the following: manual labeling, labeling through a classification model, and manual adjustment after labeling through a classification model. This application embodiment does not limit this.

[0046] Optionally, the terminal 110 can also directly obtain an existing dataset labeled with category labels as a sample dataset; or, obtain an existing dataset labeled with category labels, preprocess the data in the dataset (e.g., data augmentation, data filtering, etc.), and then use the preprocessed dataset as a sample dataset.

[0047] Optionally, terminal 110 sends the sample dataset to server 120 via communication network 130. Server 120 is configured with a first classification model to be trained, used to train the target classification model. After server 120 obtains the sample dataset, it inputs the sample data in the sample dataset into the first classification model 121 for classification prediction, obtaining the first classification prediction result. Based on the category label and the first classification prediction result, it determines the first loss value corresponding to the sample data, and applies generalization constraints to the first loss values ​​of the sample data corresponding to K categories, obtaining the second loss value. The first classification model 121 is trained using the second loss value to obtain the second classification model 122.

[0048] Subsequently, the sample data from the sample dataset is input into the second classification model 122 for classification prediction, obtaining the second classification prediction result. Based on the category label and the second classification prediction result, a third loss value corresponding to the sample data is determined. The second classification model 122 is then trained using the third loss value to obtain the target classification model 123. The target classification model 123 is used to predict the category of the data and obtain the category prediction result.

[0049] Optionally, the terminal 110 sends the sample dataset to the server 120. After the server 120 trains the target classification model 123, the terminal 110 sends the data to be classified to the server 120, so that the server 120 uses the target classification model 123 to predict the category of the data to be classified and obtain the category prediction result.

[0050] In an optional embodiment, when the server 120 or the terminal 110 executes the above-described classification model training method alone, the server 120 or the terminal 110 obtains the sample dataset on its own and obtains the trained target classification model 123, etc., for class prediction of the data to be classified by training the first classification model 121 configured by itself.

[0051] It is worth noting that the aforementioned terminals include, but are not limited to, mobile terminals such as mobile phones, tablets, portable laptops, smart voice interaction devices, smart home appliances, and in-vehicle terminals, and can also be desktop computers, etc. This application does not limit these possibilities.

[0052] It is worth noting that server 120 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0053] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Based on the cloud computing business model, cloud technology encompasses network technology, information technology, integration technology, management platform technology, and application technology. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to a backend system for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing. Optionally, server 120 can also function as a node in a blockchain system.

[0054] It should be noted that this application may display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user-related data (e.g., sample datasets). These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their relevant data is being collected. This ensures that the application only begins the steps for collecting user-related data after receiving confirmation from the user regarding the prompt interface or pop-up; otherwise (i.e., without receiving confirmation from the user), the steps for collecting user-related data end, meaning no user-related data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0055] Based on the above introduction to terminology and application scenarios, the training method of the classification model provided in this application will be explained, taking the application of this method to a server as an example. Figure 2 As shown, the method includes the following steps 210 to 250.

[0056] Step 210: Obtain the sample dataset.

[0057] The sample dataset includes multiple sample data labeled with category labels, and the multiple sample data correspond to K categories, where K is an integer greater than 1.

[0058] Optionally, the sample data in the sample dataset includes at least one of text data, image data, audio data, video data, etc. The specific content of the sample data is determined by the prediction function of the classification model to be trained (i.e., the first classification model below). For example, if the classification model to be trained is used for natural image classification, then the sample data is natural images; if the classification model to be trained is used for SMS recognition, then the sample data is SMS text, etc.

[0059] The category labels mentioned above are used to indicate the category to which the sample data belongs, that is, the actual category of the sample data.

[0060] Optionally, multiple sample data in the sample dataset may exhibit an unbalanced distribution.

[0061] Imbalanced distribution refers to an imbalance in the distribution of sample data across different categories within a sample dataset. For example, in a sample dataset, there are 1000 samples in category A, 500 samples in category B, and 200 samples in category C.

[0062] Optionally, the unbalanced distribution may include a long-tailed distribution.

[0063] In deep learning, a long-tail distribution refers to a skewed distribution of sample data in a dataset, where a few categories (i.e., head categories) contain a large number of samples, while most categories (i.e., tail categories) have very few samples.

[0064] The classification model training method provided in this application aims to train an unbiased model using a sample dataset, enabling it to achieve high classification accuracy across all categories. The specific training method for this unbiased model is described in the following embodiments.

[0065] Step 220: Input the sample data into the first classification model for classification prediction to obtain the first classification prediction result.

[0066] The first classification prediction result is used to indicate the first probability that the sample data belongs to each of the K categories.

[0067] For illustration, assume there are K categories, including category a, category b, and category c; when sample data A is input into the first classification model, the first classification prediction result can be [0.7, 0.2, 0.1], which means that the probability of sample data A belonging to category a is 0.7, the probability of belonging to category b is 0.2, and the probability of belonging to category c is 0.1.

[0068] This application does not limit the model structure of the first classification model. Illustratively, the first classification model is an initial network model, or it is obtained by adjusting the model parameters of the initial network model. Optionally, if the initial network model includes a backbone network and a classifier, then the first classification model also includes a backbone network and a classifier. When the first classification model is obtained by adjusting the model parameters of the initial network model, the network parameters of the backbone network included in the first classification model are different from those of the backbone network included in the initial network model; the network parameters of the classifier included in the first classification model are also different from those of the classifier included in the initial network model.

[0069] The backbone network is used to extract the sample feature representations corresponding to the sample data, and the classifier is used to predict the first probability of the sample data belonging to each of the K categories based on the sample feature representations.

[0070] Optionally, the backbone network can be at least one of convolutional neural networks, transform networks, long short-term memory (LSTM) networks, graph neural networks (GNNs), etc.

[0071] Optionally, when the first classification model includes a backbone network and a classifier, the sample data is input into the first classification model, and the backbone network in the first classification model extracts features from the sample data to obtain the sample feature representation corresponding to the sample data; the classifier performs classification prediction on the sample feature representation to obtain the first classification prediction result.

[0072] In some embodiments, data is collected from the sample dataset to obtain p sample data to form a first subsample dataset, where the p sample data correspond to K categories, and p is a positive integer less than or equal to K; the sample data in the first subsample dataset is input into a first classification model for classification prediction to obtain the first classification prediction results corresponding to the p sample data respectively.

[0073] To illustrate, the first classification prediction results corresponding to these p sample data are taken as a batch of data to complete one iteration of training of the first classification model.

[0074] Step 230: Determine the first loss value corresponding to the sample data based on the category label and the first classification prediction result. Apply generalization constraints to the first loss values ​​of the sample data corresponding to the K categories to obtain the second loss value. Train the first classification model with the second loss value to obtain the second classification model.

[0075] The first loss value is used to characterize the difference between the category label and the first classification prediction result.

[0076] Optionally, the first loss value includes at least one of the following: a loss value determined based on the relative entropy loss function, a loss value determined based on the cross-entropy loss function, and a loss value determined based on the softmax loss function. This application embodiment does not limit this.

[0077] Optionally, the generalization constraint refers to constraining the dispersion among multiple loss values. After constraint, the dispersion among multiple loss values ​​will be reduced, that is, the second loss value is used to characterize the dispersion of the first loss value for multiple sample data corresponding to the K categories.

[0078] In some embodiments, based on the category labels corresponding to the sample data, the first loss value corresponding to the sample data is classified to obtain K loss sets corresponding to each category, wherein the k'th loss set includes the first loss value of the sample data corresponding to the k'th category; the dispersion of the k'th loss set is determined according to the dispersion of the first loss value in the k'th loss set; and the second loss value is obtained based on the dispersion corresponding to each of the K loss sets.

[0079] Optionally, the average dispersion of the dispersion corresponding to the K loss sets is calculated, and the average dispersion is used as the second loss value.

[0080] Illustratively, indicators for measuring dispersion include at least one of variance, standard deviation, range, interquartile range, mean deviation, and heterogeneity ratio, but the embodiments of this application are not limited to this.

[0081] Among them, variance is the sum of the squares of the differences between each loss value and the average loss value, divided by the total number of loss values. The square root of the variance is the standard deviation. Range is the difference between the maximum and minimum loss values. Interquartile range is the difference between the upper and lower quartiles of the loss values. Mean range is the sum of the absolute values ​​of the differences between each loss value and the average loss value, divided by the total number of loss values. The heterogeneity ratio is the ratio of the number of non-mode values ​​to the total number of loss values, that is, the proportion of the loss values ​​other than the mode in the population. The mode indicates the loss value that occurs most frequently.

[0082] Let's take standard deviation, a measure of dispersion, as an example for illustration.

[0083] Calculate the standard deviation of the first loss value in the k'-th loss set, and use the standard deviation as the dispersion; calculate the average standard deviation of the standard deviations corresponding to the K loss sets, and use the average standard deviation as the second loss value.

[0084] An illustrative example of a loss function used to calculate the second loss value based on the standard deviation of the loss set. As shown in Formula 1 above, it will not be repeated here.

[0085] After determining the second loss value, the first classification model is trained based on the second loss value; training stops when the number of training iterations for the first classification model reaches a preset number, or when the second loss value determined by the trained classification model is less than or equal to the preset loss value. The first classification model obtained at the time of training stop is used as the second classification model.

[0086] Indicatively, when the second classification model trained based on the second loss value makes classification predictions for data in any of the K categories, the difference *c* between its predicted and actual classification results will stably be distributed around a dynamically determined *c*. That is, the second classification model at this point has the ability to classify data in each category, and this ability is balanced across all categories.

[0087] Step 240: Input the sample data into the second classification model for classification prediction to obtain the second classification prediction result.

[0088] The second classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories.

[0089] Since the second classification model is obtained by updating the model parameters of the first classification model, the model structures of the first classification model and the second classification model are the same.

[0090] Optionally, the second classification model includes a backbone network and a classifier, wherein the backbone network is used to extract the sample feature representation corresponding to the sample data, and the classifier is used to predict the second probability of the sample data belonging to each of the K categories based on the sample feature representation.

[0091] Optionally, the sample data is input into the second classification model, and the backbone network in the second classification model is used to extract features from the sample data to obtain the sample feature representation corresponding to the sample data; the classifier is used to perform classification prediction on the sample feature representation to obtain the second classification prediction result.

[0092] In some embodiments, data is collected from the sample dataset to obtain q sample data to form a second subsample dataset, where the q sample data correspond to K categories, and q is a positive integer less than or equal to K; the sample data in the second subsample dataset is input into the second classification model for classification prediction to obtain the second classification prediction results corresponding to the q sample data respectively.

[0093] To illustrate, the second classification prediction results corresponding to these q sample data are used as a batch of data to complete one iteration of training of the second classification model.

[0094] The values ​​of p and q mentioned above can be the same or different; that is, when training the first classification model and training the second classification model, the amount of data sampled from the sample dataset can be the same or different. Optionally, when training the first classification model and training the second classification model, the content of the data sampled from the sample dataset can be the same or different.

[0095] Step 250: Determine the third loss value corresponding to the sample data based on the category label and the second classification prediction result, and train the second classification model with the third loss value to obtain the target classification model.

[0096] Among them, the target classification model is used to predict the category of the data.

[0097] The third loss value mentioned above is used to characterize the difference between the category label and the second classification prediction result.

[0098] Optionally, the third loss value includes at least one of the following: a loss value determined based on the relative entropy loss function, a loss value determined based on the cross-entropy loss function, and a loss value determined based on the softmax loss function. This embodiment of the application does not limit the specific loss value. It should be noted that the loss function used in calculating the first and third loss values ​​is the same.

[0099] After determining the third loss value, the second classification model is trained based on the third loss value. Training stops when the number of training iterations for the second classification model reaches a preset number, or when the third loss value determined by the trained classification model is less than or equal to the preset loss value. The second classification model obtained at the point of training stop is taken as the target classification model.

[0100] In summary, the classification model training method provided in this application provides a two-stage training method for a first classification model based on a sample dataset: In the first stage, the model learns the common features among various classification tasks, i.e., it is trained using a second loss value with generalization constraints to obtain a second classification model with balanced classification ability for samples of each category; In the second stage, the model learns the differential features among various classification tasks, i.e., it is trained using a third loss value to adjust the classification ability of the second classification model for samples of each category. When the samples in the sample dataset exhibit an imbalanced distribution or even a long-tailed distribution, the classification model training method provided in this application learns common features that can eliminate category bias through the first stage of training, thereby alleviating the category bias problem caused by imbalanced distribution or even long-tailed distribution; Subsequently, the second stage of training optimizes the classification ability of the second classification model for samples of each category, so that the trained target classification model can also have a high classification accuracy in each category.

[0101] The method provided in this application classifies the sample data based on the category labels corresponding to the sample data, obtaining a loss set corresponding to each category, and determines a second loss value based on the dispersion of the loss sets corresponding to each category. When the second classification model trained based on the second loss value performs classification prediction on data under any category, the difference c between its predicted classification result and the actual classification result will be stably distributed around a dynamically determined c*. That is, the ability of the second classification model to classify data of each category is balanced, thereby improving the generalization of the finally trained model.

[0102] The method provided in this application embodiment allows the aforementioned index for measuring the degree of dispersion to be implemented as the standard deviation of each loss included in the loss set, thereby improving the accuracy of dynamically determined c*.

[0103] As can be seen from the above, the purpose of training the first classification model in this application is to learn common features that can eliminate class bias. However, in the process of learning the common features corresponding to the sample dataset with a long tail distribution, the update gradient of the tail class is submerged by the update of the head class, which results in the common features being unable to better represent the various classes in a balanced way.

[0104] In some optional embodiments, a multi-objective optimization algorithm is applied to the training process of the first classification model to alleviate the phenomenon that the update gradient of the tail category is overwhelmed by the update of the head category, thereby providing a better representation of common features for each category corresponding to the long-tailed distributed dataset.

[0105] In multi-objective optimization algorithms, assuming there are N tasks, their corresponding differentiable loss functions are as follows: The weighted loss for N targets is ω∈Ω, where Ω is the probability simplex defined on [N] (i.e., ω1+…+ω). N =1), ω i Let be the weights of the differentiable loss function corresponding to the i-th task. If for any i, If Θ′ is Pareto dominant, then Θ′ is said to be Pareto dominant; and Pareto optimal Θ is Θ′ that does not exist that satisfies the above relation. The set of all Θs that satisfy Pareto optimality is called the Pareto set.

[0106] When multi-objective optimization algorithms are applied to multi-task learning, they achieve shared feature extraction across tasks through feature extraction networks and task-specific optimization through task-specific branches. However, long-tail learning models do not have task-specific optimization branches; they only have a single classifier shared across all categories, thus multi-objective optimization algorithms cannot be directly used. The classification model training method provided in this application addresses this issue by designing a shared feature extraction module and a task-specific optimization module in the training time dimension rather than the network structure dimension. Specifically, the classification model training method provided in this application only uses multi-objective optimization algorithms for the first E epochs of training.

[0107] In this embodiment, the training objective of the first classification model (i.e., the first E epochs) is to find a Pareto optimal set of gradient weights through a finite number of iterations. This set includes the weight coefficients for updating the gradients for each class. The model parameters are updated using the weighted gradients, thereby resolving the gradient inconsistencies between classes.

[0108] The multi-objective optimization algorithm includes at least one of the following: Emperor Penguin Optimizer (EPO), Conflict-Averse Gradient Descent for Multi-task Learning (CAGrad), and Multiple Gradient Descent Algorithm (MGDA). This application does not limit the specific algorithm used.

[0109] The training method of the classification model provided in this application embodiment is illustrated illustratively using the CAGrad algorithm as an example. Figure 3 As shown above, Figure 2 The illustrated embodiment can also be implemented as steps 310 to 350, and step 230 can also be implemented as steps 331 to 333.

[0110] Step 310: Obtain the sample dataset.

[0111] The sample dataset includes multiple sample data labeled with category labels, and the multiple sample data correspond to K categories, where K is an integer greater than 1.

[0112] Optionally, multiple sample data in the sample dataset may exhibit an imbalanced distribution or a long-tailed distribution.

[0113] Indicatively, a sample dataset can be defined as follows: Where, x i Let y represent the i-th sample data. i Let represent the class label of the i-th sample data, and n represent the number of samples in the sample dataset. Assume T train The n sample data points in the dataset correspond to a total of K categories. Let C be the set of these K categories. train ={c1, c2, ..., c K}, where c1, c2, ..., c K Let K represent the number of categories from the 1st to the Kth, where K is the number of categories. Let the set of the number of samples in each category of the sample dataset be denoted as . in, This represents the number of sample data points corresponding to each of the first to the kth categories. When the sample dataset exhibits a long-tailed distribution, let... and

[0114] The training method for the classification model provided in this application aims to utilize T train Train a model F with parameter Θ Θ This ensures that it maintains high classification accuracy across all categories. Specifically, a test dataset can be defined. Where, x j Let y represent the j-th test data. j Let represent the class label of the j-th test data point, and m represent the number of test data points in the test dataset. Assume T... test The m sample data in the dataset correspond to a total of K categories. Let C be the set of K categories. test ={c1, c2, ..., c K}, where c1, c2, ..., c K Let K represent the number of categories from the 1st to the Kth, where K is the number of categories. Let the set of test data for each category in the test dataset be denoted as . in, This represents the number of test data points corresponding to each of the first to the kth categories. When the test dataset has a uniform distribution, let... When using T test As model F Θ When using the test dataset, T test For testing model F Θ Regarding the accuracy of its classification in each category.

[0115] Model F Θ The specific training methods are described in the examples below.

[0116] Step 320: During the first E iterations, the sample data is input into the first classification model for classification prediction to obtain the first classification prediction result.

[0117] The first classification prediction result indicates the first probability that the sample data belongs to each of the K categories. E is an integer greater than 1.

[0118] The classification model training method provided in this application includes two training phases. The first training phase consists of the first E epochs. An epoch is an important concept in the training process of a neural network model. Simply put, an epoch is equivalent to training (or iterating) once using all the sample data in the sample dataset (or a sampled subset of the dataset). When a complete sample dataset passes through the neural network model once and returns once, that is, one forward propagation and one backward propagation are performed, this process is called an epoch.

[0119] Optionally, in one epoch, from T train Randomly sample a batch of sample data Training is performed, where p is the number of sampled data points, and x... i Let y be the i-th sample data in sample data B. i For x i Category labels. The data is input into the first classification model, which predicts the first classification results for each of the p sample data.

[0120] Optionally, the first classification model in this application embodiment can be implemented as any one of the following long-tail learning models: an algorithm based on Imbalanced Classification via Major-to-minor Translation (M2m), an algorithm based on Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss (LDAM-DRW), or a Mixup Shifted Label-Aware Smoothing model (MiSLAS). This application embodiment does not limit the specific model to this one.

[0121] This is illustrative; please refer to it. Figure 4 It shows a schematic diagram of the model structure of a first classification model, such as Figure 4 As shown, the first classification model 410 consists of a backbone network f θ and classifier If the classification is formed by connecting multiple elements, then the first classification model is denoted as... Where θ represents the network parameters of the backbone network. Here, θ represents the network parameters of the classifier, Θ represents the model parameters of the first classification model, and θ and Included within Θ.

[0122] In the first E epochs, a batch of sample data randomly sampled from the sample dataset is input into the first classification model 410. The backbone network extracts features from the sample data to obtain the sample feature representations corresponding to the sample data. The classifier performs classification prediction on the sample feature representations to obtain the first classification prediction result.

[0123] Step 331: Determine the first loss value corresponding to the sample data based on the category label and the first classification prediction result, and apply generalization constraints to the first loss values ​​of the sample data corresponding to the K categories to obtain the second loss value.

[0124] The first loss value is used to characterize the difference between the category label and the first classification prediction result.

[0125] As an illustration, the loss function used to calculate the first loss value differs in different long-tail learning models. Here, we take the cross-entropy loss function as an example for explanation. That is, after obtaining the first classification prediction result of sample data A, we obtain the category label of sample data A, calculate the cross-entropy loss between the first classification prediction result and the category label of sample data A, and use the cross-entropy loss as the first loss value corresponding to sample data A.

[0126] Optionally, the generalization constraint refers to the constraint on the degree of dispersion among multiple loss values, that is, the second loss value is used to characterize the degree of dispersion of the first loss value of multiple sample data corresponding to the K categories respectively.

[0127] To illustrate, using standard deviation as an example to measure dispersion, the formula for calculating the second loss value is shown in Formula 1 below:

[0128] Formula 1:

[0129] Where K represents the number of categories; Std(.) is the standard deviation function; Let represent the set of first loss values ​​corresponding to the sample data belonging to class k' in a batch of sample data. Formula 1 means that after calculating the standard deviation of the set of first loss values ​​corresponding to the sample data in each class, the average of the standard deviations is calculated, and this average is the second loss value.

[0130] Step 332: Apply flattening constraints to the first loss values ​​of the sample data corresponding to the K categories to obtain the fourth loss value.

[0131] Optionally, the flattening constraint refers to constraining the flatness of the surfaces corresponding to multiple first loss values. When the surface of the loss function is relatively flat, the gradient is smaller, and the step size during parameter updates is also smaller. This can avoid oscillations or divergence caused by excessively large parameter updates, enabling the first classification model to converge more stably. The flatter surface of the loss function corresponding to the multiple first loss values ​​after constraint improves the convergence of the model; that is, the fourth loss value is used to characterize the convergence of the first classification model.

[0132] To illustrate, let's take the CAGrad algorithm, a multi-objective optimization algorithm, as an example. The convergence of the CAGrad algorithm is shown in Formula 2 below:

[0133] Formula 2:

[0134] in, This represents the weighted loss before the update. It can represent the updated weighted loss; α is the learning rate; c∈[0,1], c is a hyperparameter; g0(Θ t ) represents the average gradient; d * (Θ t The direction of optimization obtained by the CAGrad algorithm is shown in the above equation. It can be seen that the convergence of the CAGrad algorithm is controlled by H. Therefore, reducing H helps improve the convergence of the CAGrad algorithm. Improving the convergence of the CAGrad algorithm means improving the convergence of the first classification model.

[0135] In some embodiments, H is constrained by the Sharpness-Aware Minimization (SAM) algorithm. Illustratively, the optimization objective of the SAM algorithm is shown in Equation 3 below:

[0136] Formula 3:

[0137] Where ρ is a constant greater than 0, ∈(Θ) is a small perturbation, and Equation 3 means minimizing the model loss while maximizing ∈(Θ).

[0138] Alternatively, ∈(Θ) is obtained by approximation using a first-order Taylor expansion. The calculation formula is shown in Formula 4 below:

[0139] Formula 4:

[0140] Among them, Viewed as causing loss Minimize the maximum ∈(Θ), Used to represent gradient calculation; ρ is a constant greater than 0.

[0141] In summary, the above analysis shows that by adding a perturbation to the parameters of the first classification model to obtain a new model, and then measuring the predictive ability of this model for the sample data, if the model still performs well, it indicates good model stability. A model's stability and convergence are related. If a model produces large output changes when the input data changes slightly (i.e., poor stability), it may oscillate or become unstable during training, leading to difficulty in convergence or failure to converge. Conversely, if a model produces small output changes when the input data changes slightly (i.e., good stability), it has good convergence during training.

[0142] Optionally, based on the first loss values ​​of the sample data corresponding to the K categories, a first update gradient is determined; based on the first update gradient, a perturbation parameter is determined; the model parameters of the first classification model are perturbed according to the perturbation parameter to obtain a perturbed classification model; the sample data is input into the perturbed classification model for classification prediction to obtain a perturbed classification prediction result; based on the category label and the perturbed classification prediction result, the perturbed loss value corresponding to the sample data is determined, and the perturbed classification prediction result is used to indicate the perturbation probability of the sample data belonging to each of the K categories; based on the perturbed loss values ​​of the sample data corresponding to the K categories, a fourth loss value is determined.

[0143] To illustrate, after calculating the first loss value corresponding to multiple sample data in the first classification model in a single iteration, the average loss value among the multiple loss values ​​is calculated. Based on this average loss value, the update gradient is calculated, which is the first update gradient.

[0144] The first update gradient is used to determine the perturbation parameters for the model parameters of the first classification model. The calculation formula for the perturbation parameters can be found in Formula 4 above. The calculated value is the first update gradient. By perturbing the model parameters of the first classification model with perturbation parameters, a perturbed classification model is obtained. The model parameters of this perturbed classification model are the model parameters after perturbing the model parameters of the first classification model with perturbation parameters.

[0145] Subsequently, the sample data corresponding to each of the K categories are input into the perturbation classification model to obtain the perturbation classification prediction results. Based on the difference between the category labels and the perturbation classification prediction results, the perturbation loss value corresponding to the sample data is determined.

[0146] Schematic diagram of the loss function used to calculate the above disturbance loss value. As shown in Formula 5 below:

[0147] Formula 5:

[0148] in, These are the aforementioned disturbance parameters. The calculation formula can be found in Formula 4 above. The corresponding loss function and The corresponding loss functions are consistent; that is The corresponding loss function is the same as the loss function corresponding to the first and second loss values ​​mentioned above.

[0149] In other words, The corresponding loss function refers to the loss function in the long-tail learning model selected in this application. The corresponding loss function includes at least one of the relative entropy loss function, cross-entropy loss function, softmax loss function, etc., and the embodiments of this application do not limit it.

[0150] Optionally, after calculating the perturbation loss values ​​of the sample data corresponding to the K categories respectively, the average value of the perturbation loss values ​​of the sample data corresponding to the K categories is determined as the fourth loss value; or, the weighted average value of the perturbation loss values ​​of the sample data corresponding to the K categories is determined as the fourth loss value, etc., and the embodiments of this application do not limit this.

[0151] Optionally, the weighting coefficients of the perturbation loss values ​​of the sample data corresponding to the K categories are dynamically determined during the training process.

[0152] Step 333: Train the first classification model using the second loss value and the fourth loss value to obtain the second classification model.

[0153] To illustrate, the average of the second and fourth loss values ​​is calculated, or the weighted average of the second and fourth loss values ​​is calculated, to obtain the fusion loss value; the first classification model is trained based on the fusion loss value to obtain the second classification model.

[0154] Optionally, when calculating the weighted average of the second and fourth loss values, the weight coefficients corresponding to the second and fourth loss values ​​are dynamically determined during the training process.

[0155] Optionally, based on the fused loss value of the second loss value and the fourth loss value, a gradient set is determined, which includes candidate update gradients corresponding to K categories respectively; the weight coefficients of each candidate update gradient in the gradient set are determined; the candidate update gradients are weighted and summed based on the weight coefficients to obtain the second update gradient; the model parameters of the first classification model are updated using the second update gradient to obtain the second classification model.

[0156] Indicatively, candidate update gradients belonging to each category are calculated by fusing the loss value and the loss function, resulting in a gradient set. When training the first classification model using this gradient set, the gradient descent process of the candidate update gradients for each category is considered as a multi-objective optimization problem in the aforementioned multi-objective optimization algorithm. Therefore, the weights of the candidate update gradients for each category can be calculated using the Pareto optimal weight calculation method in multi-objective optimization algorithms. Taking the CAGrad algorithm as an example, the formula for calculating the weight coefficients of each candidate update gradient in the gradient set is shown in Formula 6 below:

[0157] Formula Six: φ=c 2 ||g0|| 2

[0158] To illustrate, we solve Formula 6 to obtain the set of candidate update gradient weight coefficients ω = {ω1, ω2, ..., ω} for each category when F(ω) reaches its minimum value. K The candidate update gradient for each category is g. i , i∈{1,2,...,K}, where K is the number of classes; g0 is the average gradient. c∈[0,1], where c is a hyperparameter.

[0159] Based on the above formula six, the set of candidate update gradient weight coefficients for each category, ω = {ω1, ω2, ..., ω...}, is obtained. KAfter that, the candidate update gradients for each category are weighted and summed according to the weight coefficients corresponding to the candidate update gradients for each category, to obtain g. ω This is the second update gradient; the model parameters of the first classification model are updated using the second update gradient to obtain the second classification model.

[0160] Optionally, the model parameters of the first classification model are updated using the second update gradient and the average update gradient to obtain the second classification model.

[0161] The average update gradient refers to the average value of the candidate update gradients for each category in the gradient set.

[0162] The formula for updating the model parameters of the first classification model using the second update gradient and the average update gradient is illustrated in Formula 7 below:

[0163] Formula 7:

[0164] Where g0 is the average update gradient, g ω The second update gradient, i.e., the update gradient of each category after weighted fusion, is φ = c. 2 ||g0|| 2 c∈[0,1], where c is a hyperparameter; α is the learning rate.

[0165] Step 340: In the iteration process after the Eth iteration, the sample data is input into the second classification model for classification prediction to obtain the second classification prediction result.

[0166] The second classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories.

[0167] Indicative, such as Figure 4 As shown, the second classification model 420 includes a backbone network and a classifier.

[0168] After E+1 epochs (including E+1 epochs), multiple sample data from the sample dataset are input into the second classification model 420. The backbone network extracts features from the sample data to obtain the sample feature representations corresponding to the sample data. The classifier performs classification prediction on the sample feature representations to obtain the second classification prediction results.

[0169] Step 350: Determine the third loss value corresponding to the sample data based on the category label and the second classification prediction result, and train the second classification model with the third loss value to obtain the target classification model.

[0170] Among them, the target classification model is used to predict the category of the data.

[0171] After determining the third loss value, the second classification model is trained based on the third loss value. Training stops when the number of training iterations for the second classification model reaches a preset number, or when the third loss value determined by the trained classification model is less than or equal to the preset loss value. The second classification model obtained at the point of training stop is taken as the target classification model.

[0172] Based on the above analysis, the training objective of the second classification model is to learn the differential features between various classification tasks. In some embodiments, the training process of the second classification model can be divided into two stages. In the first stage, unweighted training is performed, allowing the model to learn initial differential features and making preliminary global adjustments to the classification accuracy of each category. In the second stage, weighted training is performed, allowing the model to learn further optimized differential features and making further local adjustments to the classification accuracy of each category. Using a combination of global and local adjustments allows the model to learn the differential features of each category more accurately.

[0173] Optionally, based on the difference between the category label and the second classification prediction result, a third loss value corresponding to the sample data is determined; the second classification model is trained using the average loss value of the third loss values ​​corresponding to multiple sample data to obtain a candidate classification model; the sample data is input into the candidate classification model for classification prediction to obtain a candidate classification prediction result, which is used to indicate the candidate probability of the sample data belonging to each of the K categories; based on the difference between the category label and the candidate classification prediction result, a fifth loss value corresponding to the sample data is determined; the candidate classification model is trained using the weighted loss value of the fifth loss values ​​corresponding to multiple sample data to obtain the target classification model.

[0174] In summary, the classification model training method provided in this application provides a two-stage training method for a first classification model based on a sample dataset: In the first stage, the model learns the common features among various classification tasks, i.e., it is trained using a second loss value with generalization constraints to obtain a second classification model with balanced classification ability for samples of each category; In the second stage, the model learns the differential features among various classification tasks, i.e., it is trained using a third loss value to adjust the classification ability of the second classification model for samples of each category. When the samples in the sample dataset exhibit an imbalanced distribution or even a long-tailed distribution, the classification model training method provided in this application learns common features that can eliminate category bias through the first stage of training, thereby alleviating the category bias problem caused by imbalanced distribution or even long-tailed distribution; Subsequently, the second stage of training optimizes the classification ability of the second classification model for samples of each category, so that the trained target classification model can also have a high classification accuracy in each category.

[0175] The method provided in this application applies a flattening constraint to the first loss value of the sample data corresponding to K categories to obtain a fourth loss value; the first classification model is trained using the second and fourth loss values ​​to obtain a second classification model, thereby improving the model's generalization ability and convergence.

[0176] The method provided in this application involves perturbing the model parameters of a first classification model according to perturbation parameters to obtain a perturbed classification model; inputting sample data into the perturbed classification model for classification prediction to obtain perturbed classification prediction results; determining the perturbed loss value corresponding to the sample data based on the category labels and the perturbed classification prediction results; and determining a fourth loss value based on the perturbed loss values ​​of the sample data corresponding to K categories. By adding perturbations to the model to affect its stability, the model learns to classify and predict sample data under perturbed conditions, thereby improving the model's convergence by enhancing its stability.

[0177] The method provided in this application, during the training process of the first classification model, applies a multi-objective learning algorithm to determine the weights of the update gradients of each category during training, thereby alleviating the problem of conflicting category update gradients.

[0178] In illustrative terms, the classification model training method provided in this application addresses the issue of imbalanced or even long-tailed distributions in the training sample dataset used in deep learning scenarios. It utilizes a multi-objective optimization algorithm to achieve dynamic gradient balancing among categories, mitigating the phenomenon where the update gradients of a minority category are overwhelmed by the updates of the majority category. This provides better feature representations for each category in imbalanced / long-tailed tasks. This application introduces a multi-objective optimization algorithm to resolve the gradient conflict between categories, which can universally enhance any imbalanced / long-tailed learning method.

[0179] The design principles of the second loss (hereinafter referred to as the class collapse loss) involved in the model training of the first E epochs are explained below:

[0180] The generalization bound formula for the long-tail learning model based on multi-objective optimization algorithm is shown in Formula 8 below:

[0181] Formula 8:

[0182] in For generalization error, For training error, This represents a family of functions that can map inputs to outputs, where M is the Lipschitz constant. For the extended Rademacher complexity, ω is the class weight coefficient. and Both are weighted losses, where ωk represents the weight coefficient of the k'th category, and δ is a constant.

[0183] in, The calculation formula is shown in Formula Nine below:

[0184] Formula Nine:

[0185] in σ i Let be an independent and identically distributed random variable whose values ​​are {-1, +1}, and h be the hypothesis space. Let l be the set of hypothesis spaces, and let l be the loss function (i.e., the loss function in any long-tail learning model, which is not limited here). For sample data and their corresponding labels, m k’ ω represents the number of sample data in a sampling batch. k’ This represents the weight coefficient of the k'th category.

[0186] Formula 8 holds with a probability of 1-δ, and the upper bound of the loss for each class is less than or equal to M. Therefore, according to Formula 8, the generalization error can be constrained by limiting the generalization bound. Constraining the generalization bound can be achieved by simultaneously constraining the training error. And the Lipschitz constant M is realized. Then, the category collapse loss (i.e., the first loss) as shown in Formula 1 above can be designed.

[0187] It should be noted that the first classification model provided in this application embodiment can be implemented as any long-tail learning model, and this application embodiment does not limit it. For illustrative purposes, an example is given where the first classification model is implemented as a long-tail learning model based on the LDAM-DRW algorithm. Figure 5 As shown above, Figure 2 Steps 210 to 230 of the training process of the first classification model in the illustrated embodiment can also be implemented as steps 510 to 539; as shown Figure 6 As shown above, Figure 2 The training process of the second classification model in the illustrated embodiment, corresponding to steps 240 to 250, can also be implemented as steps 541 to 556.

[0188] Step 510: Obtain the sample dataset.

[0189] The sample dataset includes multiple sample data labeled with category labels, and the multiple sample data correspond to K categories, where K is an integer greater than 1.

[0190] Optionally, multiple sample data in the sample dataset may exhibit an imbalanced distribution or a long-tailed distribution.

[0191] Step 521: During the e-th iteration of the previous E iterations, collect m sample data from the sample dataset to form the first subsample dataset.

[0192] Optionally, within one epoch, samples from a long-tailed distribution are used. (where n is the number of sample data in the sample dataset, and n sample data correspond to K categories) Randomly sample a batch of sample data. Training is performed, where m is the number of sample data points, and x... i For the i-th sample data, y i For x i The category labels are given, and m sample data correspond to K categories.

[0193] Step 522: Input the m sample data from the first subsample dataset into the first classification model for classification prediction, and obtain the first classification prediction results corresponding to the m sample data respectively.

[0194] Optionally, the first classification model includes a backbone network and a classifier.

[0195] Indicative, The data is input into the first classification model, and the backbone network extracts features from the sample data to obtain the sample feature representations corresponding to the sample data. The classifier then performs classification prediction on the sample feature representations to obtain the first classification prediction results.

[0196] The first classification prediction result is used to indicate the first probability that the sample data belongs to each of the K categories.

[0197] Step 531: Based on the difference between the category label and the first classification prediction result, determine the first loss value corresponding to each of the m sample data.

[0198] To illustrate, we will use the first classification model implemented as a long-tail learning model based on the LDAM-DRW algorithm as an example. The loss function for calculating the first loss value in the LDAM-DRW algorithm is shown in Formula 10 below:

[0199] Formula 10:

[0200] Where (x, y) represents the sample data input to the model and its corresponding class label, F Θ This refers to the first classification model, where Θ represents the model parameters; z y It is the output value of the y-th class obtained after the sample x with label y is processed by the model; C is a hyperparameter, n is the number of samples in a batch dataset, and K is the number of classes corresponding to the samples in a batch dataset. j This represents the number of samples in the training set that belong to class j.

[0201] From the above formula, it can be seen that, excluding Δ j In this case, Equation 10 is the cross-entropy loss function, and L LDAM By z y Become z y -Δ y With the outputs of other classes remaining unchanged, when the model's output is z... y +Δ y At that time, L LDAM The value of z is the same as the output of the model. y The values ​​of the cross-entropy loss function are the same (i.e., z) y +Δ y -Δ y =z y In other words, the LDMA algorithm aims to output a higher value (Δ) for the correct class than the original value. y To achieve the best classification results.

[0202] Step 532: Classify the first loss values ​​corresponding to the m sample data according to the category labels corresponding to the m sample data respectively, and obtain the loss set corresponding to the K categories respectively.

[0203] The k'th loss set includes the first loss value of the sample data corresponding to the k'th category.

[0204] Step 533: Calculate the standard deviation of the first loss value in the k'th loss set, determine the average standard deviation of the standard deviations corresponding to the K category sets, and use the average standard deviation as the second loss value.

[0205] To illustrate, calculate the standard deviation of the first loss value in the k'-th loss set; calculate the average standard deviation of the standard deviations corresponding to the K loss sets, and use the average standard deviation as the second loss value.

[0206] Step 534: Determine the average loss value of the first loss value corresponding to each of the m sample data, and determine the first gradient value corresponding to the first classification model based on the average loss value.

[0207] The formula for calculating the average loss value is shown in Formula 11 below as an illustration:

[0208] Formula 11:

[0209] in, Let m represent the set of sample data for one batch of the above sampling. The number of sample data, L LDAM ((x, y); F Θ The calculation formula for ) can be found in Formula 10 above, and will not be repeated here.

[0210] After calculating the average loss, the first gradient value, denoted as g, can be calculated using the backpropagation algorithm. S .

[0211] Step 535: Based on the first gradient value, calculate the perturbation parameters, and perturb the model parameters of the first classification model according to the perturbation parameters to obtain the perturbation classification model.

[0212] The model parameters of the perturbation classification model are obtained by perturbing the model parameters of the first classification model based on the perturbation parameters.

[0213] As an illustration, the process of calculating the perturbation parameters based on the first gradient value can be referred to in Formula 4, where... The value of is the first gradient value, and the perturbation parameter is .

[0214] Step 536: Input the m sample data from the first subsample dataset into the perturbation classification model for classification prediction, obtain the perturbation classification prediction results corresponding to the m sample data respectively, and determine the perturbation loss value corresponding to the m sample data respectively based on the difference between the category label and the perturbation classification prediction results.

[0215] The perturbation classification prediction result is used to indicate the perturbation probability of the sample data belonging to each of the K categories.

[0216] To illustrate, sample data corresponding to K categories are input into the perturbation classification model to obtain perturbation classification prediction results. Based on the difference between the category labels and the perturbation classification prediction results, the perturbation loss value corresponding to the sample data is determined.

[0217] The loss function for calculating the disturbance loss value is Equation 10 above, where F Θ The parameter Θ in the original text becomes the parameter after perturbation, i.e.

[0218] Step 537: Take the average loss value of the disturbance loss values ​​corresponding to the m sample data as the fourth loss value.

[0219] To illustrate, the average of m disturbance loss values ​​is calculated and used as the fourth loss value.

[0220] Step 538: Determine the gradient set based on the sum of the second and fourth loss values.

[0221] The gradient set includes the updated gradient values ​​corresponding to K categories.

[0222] To illustrate, the sum of the second and fourth loss values ​​is calculated to obtain the fusion loss value. Then, the update gradient values ​​corresponding to the K categories are calculated using the backpropagation algorithm. The gradient set is denoted as G = {g1, g2, ..., g...} K}, where g K This represents the update gradient value corresponding to the Kth category.

[0223] Step 539: Update the model parameters of the first classification model according to the gradient set. After E iterations, the second classification model is obtained.

[0224] For illustrative purposes, the method for updating the model parameters of the first classification model based on the gradient set can be found in step 333, which will not be repeated here.

[0225] Step 541: During the f-th iteration from the E-th to the F-th iteration, m sample data are collected from the sample dataset to form the second subsample dataset.

[0226] Where F is an integer greater than E, and f is an integer less than or equal to F and greater than E.

[0227] Illustratively, within one epoch, from a sample dataset with a long-tailed distribution (where n is the number of sample data in the sample dataset, and n sample data correspond to K categories) Randomly sample a batch of sample data. Training is performed, where m is the number of sample data points, and x... i For the i-th sample data, y i For x i The category labels are given, and m sample data correspond to K categories.

[0228] Step 542: Input the m sample data from the second subsample dataset into the second classification model for classification prediction, obtain the second classification prediction results corresponding to the m sample data respectively, and determine the third loss value corresponding to the m sample data respectively based on the difference between the category label and the second classification prediction results.

[0229] The second classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories.

[0230] As an illustration, the formula for calculating the third loss value can be found in Formula 10 above, where F Θ The parameter Θ in the model becomes the model parameter of the second classification model.

[0231] Step 551: Determine the average loss value of the third loss value corresponding to each of the m sample data, and determine the second gradient value corresponding to the second classification model based on the average loss value.

[0232] To illustrate, the average of m third loss values ​​is calculated and used as the average loss value. After obtaining the average loss value, the second gradient value can be calculated using the backpropagation algorithm.

[0233] Step 552: Update the model parameters of the second classification model according to the second gradient value. After FE iterations, the candidate classification model is obtained.

[0234] Optionally, the parameters for updating the model parameters of the second classification model based on the second gradient value are shown in Formula XII below:

[0235] Formula 12:

[0236] Among them, L S This represents the average loss value. This represents the calculated second gradient value. α is the learning rate, and Θ is the model parameter of the second classification model.

[0237] Step 553: In the t-th iteration after F iterations, collect m sample data from the sample dataset to form the third subsample dataset.

[0238] Where t is an integer greater than F.

[0239] Illustratively, within one epoch, from a sample dataset with a long-tailed distribution (where n is the number of sample data in the sample dataset, and n sample data correspond to K categories) Randomly sample a batch of sample data. Training is performed, where m is the number of sample data points, and x... i For the i-th sample data, y i For x i The category labels are given, and m sample data correspond to K categories.

[0240] It should be noted that the number of samples m in the first, second, and third subsample datasets can be the same or different; the content of the samples in the first, second, and third subsample datasets can be the same or different.

[0241] Step 554: Input the m sample data from the third subsample dataset into the candidate classification model for classification prediction, and obtain the third classification prediction results corresponding to the m sample data respectively. Based on the difference between the category label and the second classification prediction results, determine the fifth loss value corresponding to the m sample data respectively.

[0242] The third classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories.

[0243] As an illustration, the formula for calculating the fifth loss value can be referenced from Formula 10 above, where F Θ The parameter Θ in the model becomes the model parameter of the candidate classification model.

[0244] Step 555: Determine the weighted average of the fifth loss values ​​corresponding to the m sample data, and determine the third gradient value corresponding to the candidate classification model based on the weighted average.

[0245] As an illustration, the formula for calculating the weighted average is shown in Formula Thirteen below:

[0246] Formula Thirteen:

[0247] Where m is the number of samples in the third subsample dataset, and (x, y) represents the sample data and its corresponding sample label. F is the reciprocal of the number of samples labeled y, which is the weight corresponding to the fifth loss value; Θ L represents the candidate classification model. LDAM ((x, y); F Θ The calculation formula is the same as the calculation formula for the fifth loss value, which can be found in Formula 10 above.

[0248] After obtaining the weighted average value, the third gradient value can be calculated using the backpropagation algorithm.

[0249] Step 556: Update the model parameters of the candidate classification model based on the third gradient value to obtain the target classification model.

[0250] Optionally, the method for updating the model parameters of the candidate classification model based on the third gradient value can be referenced in Formula Fourteen:

[0251] Formula Fourteen:

[0252] Among them, F θ Refers to the model parameters of the candidate classification model. The reciprocal of the number of samples labeled y is the weight corresponding to the fifth loss value. This represents the third gradient value. α is the learning rate.

[0253] In summary, the training method for the classification model provided in this application embodiment: (1) enhances existing long-tail learning models from a novel perspective, namely, by using a multi-objective optimization algorithm to alleviate the problem of gradient contradiction in class updates, which has universality. (2) provides a basic solution for various imbalance problems, thereby providing a guarantee for the practical implementation of deep learning systems. It should be noted that the training method for the classification model provided in this application embodiment is aimed at general imbalance / long-tail learning problems and can be applied to various tasks, that is, not limited to classification tasks.

[0254] The following uses an image classification task as an example to illustrate the image classification model trained using the training method provided in this application. This image classification model is trained using the training method provided in any of the above embodiments. The method for image classification using this image classification model includes: acquiring a target image. The target image can be any image data. Illustratively, the target image can be image data from a few-sample domain. The target image is input into the image classification model to extract its image feature representation. Based on the image feature representation, the category of the target image is predicted to obtain the category corresponding to the target image.

[0255] Figure 7This is a structural block diagram of a training apparatus for a classification model provided in an exemplary embodiment of this application, as shown below. Figure 7 As shown, the device includes the following parts:

[0256] The acquisition module 700 is used to acquire a sample dataset, which includes multiple sample data labeled with category labels, and the multiple sample data correspond to K categories, where K is an integer greater than 1;

[0257] Prediction module 710 is used to input the sample data into a first classification model for classification prediction and obtain a first classification prediction result. The first classification model is used to perform binary classification tasks corresponding to the K categories respectively. The first classification prediction result is used to indicate the first probability that the sample data belongs to each of the K categories.

[0258] The training module 720 is used to determine the first loss value corresponding to the sample data based on the category label and the first classification prediction result, apply generalization constraints to the first loss values ​​of the sample data corresponding to the K categories respectively to obtain the second loss value, and train the first classification model with the second loss value to obtain the second classification model.

[0259] The prediction module 710 is further configured to input the sample data into the second classification model for classification prediction to obtain a second classification prediction result, wherein the second classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories;

[0260] The training module 720 is further configured to determine a third loss value corresponding to the sample data based on the category label and the second classification prediction result, and to train the second classification model using the third loss value to obtain a target classification model, which is used to predict the category of the data.

[0261] In some embodiments, the training module 720 is configured to:

[0262] Based on the category labels corresponding to the sample data, the first loss value corresponding to the sample data is classified to obtain the loss sets corresponding to the K categories respectively, wherein the k'th loss set includes the first loss value of the sample data corresponding to the k'th category;

[0263] The dispersion of the k'th loss set is determined based on the dispersion of the first loss value in the k'th loss set.

[0264] The second loss value is obtained based on the discreteness corresponding to the K loss sets.

[0265] In some embodiments, the training module 720 is configured to:

[0266] Calculate the standard deviation of the first loss value in the k'th loss set, and use the standard deviation as the dispersion.

[0267] In some embodiments, the training module 720 is configured to:

[0268] Calculate the average dispersion of the dispersion corresponding to the K loss sets respectively, and use the average dispersion as the second loss value.

[0269] In some embodiments, the training module 720 is configured to:

[0270] A flattening constraint is applied to the first loss value of the sample data corresponding to the K categories to obtain the fourth loss value;

[0271] The first classification model is trained using the second loss value and the fourth loss value to obtain the second classification model.

[0272] In some embodiments, the training module 720 is configured to:

[0273] Based on the first loss value of the sample data corresponding to the K categories, the first update gradient is determined;

[0274] Based on the first update gradient, determine the perturbation parameters;

[0275] The model parameters of the first classification model are perturbed according to the perturbation parameters to obtain a perturbed classification model;

[0276] The sample data is input into a perturbation classification model for classification prediction to obtain perturbation classification prediction results. Based on the category label and the perturbation classification prediction results, the perturbation loss value corresponding to the sample data is determined. The perturbation classification prediction results are used to indicate the perturbation probability of the sample data belonging to each of the K categories.

[0277] The fourth loss value is determined based on the perturbation loss values ​​of the sample data corresponding to the K categories.

[0278] In some embodiments, the training module 720 is configured to:

[0279] Based on the fused loss value of the second loss value and the fourth loss value, a gradient set is determined, which includes candidate update gradients corresponding to the K categories respectively;

[0280] Determine the weight coefficients of each candidate update gradient in the gradient set;

[0281] The candidate update gradients are weighted and summed based on the weight coefficients to obtain the second update gradient.

[0282] The second classification model is obtained by updating the model parameters of the first classification model using the second update gradient.

[0283] In some embodiments, the training module 720 is configured to:

[0284] Based on the difference between the category label and the second classification prediction result, a third loss value corresponding to the sample data is determined:

[0285] The second classification model is trained by averaging the third loss values ​​corresponding to the multiple sample data to obtain a candidate classification model;

[0286] The sample data is input into the candidate classification model for classification prediction to obtain candidate classification prediction results. The candidate classification prediction results are used to indicate the candidate probability of the sample data belonging to each of the K categories.

[0287] Based on the difference between the category label and the candidate classification prediction result, a fifth loss value corresponding to the sample data is determined:

[0288] The candidate classification model is trained by weighting the fifth loss value corresponding to the multiple sample data to obtain the target classification model.

[0289] In summary, the training apparatus for the classification model provided in this application performs two-stage training on the first classification model based on the sample dataset: In the first stage, the model learns the common features between various classification tasks, that is, it trains the first classification model using a second loss value with generalization constraints to obtain a second classification model with balanced classification ability for samples of each category; In the second stage, the model learns the differential features between various classification tasks, that is, it trains the second classification model using a third loss value to adjust the classification ability of the second classification model for samples of each category. When the samples in the sample dataset exhibit an imbalanced distribution or even a long-tailed distribution, the training method of the classification model provided in this application learns common features that can eliminate category bias through the first stage of training, thereby alleviating the category bias problem caused by the imbalanced distribution or even the long-tailed distribution; Subsequently, the second stage of training optimizes the classification ability of the second classification model for samples of each category, so that the trained target classification model can also have a high classification accuracy in each category.

[0290] It should be noted that the classification model training device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the classification model training device and the classification model training method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0291] Figure 8 This illustration shows a structural block diagram of a computer device 800 provided in an exemplary embodiment of this application. The computer device 800 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The computer device 800 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.

[0292] Typically, computer device 800 includes a processor 801 and a memory 802.

[0293] Processor 801 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 801 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 801 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 801 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 801 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0294] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 802 are used to store at least one instruction, which is executed by the processor 801 to implement the training method of the classification model provided in the method embodiments of this application.

[0295] In some embodiments, the computer device 800 may also optionally include other components, as those skilled in the art will understand. Figure 8 The structure shown does not constitute a limitation on the computer device 800, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0296] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, which may be a computer-readable storage medium included in the memory described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a terminal. The computer-readable storage medium stores at least one instruction, at least one program segment, a code set, or an instruction set. The at least one instruction, the at least one program segment, the code set, or the instruction set is loaded and executed by the processor to implement the training method for any of the classification models described in the above embodiments.

[0297] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0298] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0299] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for training a classification model, characterized in that, The method includes: Obtain a sample dataset, which includes multiple sample data labeled with category labels, the multiple sample data corresponding to K categories, where K is an integer greater than 1; the sample data includes sample image data; The sample data is input into the first classification model for classification prediction to obtain the first classification prediction result. The first classification prediction result is used to indicate the first probability that the sample data belongs to each of the K categories. Based on the category label and the first classification prediction result, a first loss value corresponding to the sample data is determined. A generalization constraint is applied to the first loss value of the sample data corresponding to the K categories to obtain a second loss value. The first classification model is trained using the second loss value to obtain a second classification model. The sample data is input into the second classification model for classification prediction to obtain a second classification prediction result. The second classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories. Based on the category label and the second classification prediction result, a third loss value is determined for the sample data. The second classification model is then trained using the third loss value to obtain a target classification model, which is used to predict the category of image data.

2. The method according to claim 1, characterized in that, The generalization constraint applied to the first loss value of the sample data corresponding to the K categories to obtain the second loss value includes: Based on the category labels corresponding to the sample data, the first loss value corresponding to the sample data is classified to obtain the loss sets corresponding to the K categories respectively, wherein the k'th loss set includes the first loss value of the sample data corresponding to the k'th category; The dispersion of the k'th loss set is determined based on the dispersion of the first loss value in the k'th loss set. The second loss value is obtained based on the discreteness corresponding to the K loss sets.

3. The method according to claim 2, characterized in that, Determining the dispersion of the k'-th loss set based on the dispersion of the first loss value in the k'-th loss set includes: Calculate the standard deviation of the first loss value in the k'th loss set, and use the standard deviation as the dispersion.

4. The method according to claim 2, characterized in that, The process of obtaining the second loss value based on the discreteness corresponding to the K loss sets includes: Calculate the average dispersion of the dispersion corresponding to the K loss sets respectively, and use the average dispersion as the second loss value.

5. The method according to any one of claims 1 to 4, characterized in that, The step of training the first classification model using the second loss value to obtain the second classification model includes: A flattening constraint is applied to the first loss value of the sample data corresponding to the K categories to obtain the fourth loss value; The first classification model is trained using the second loss value and the fourth loss value to obtain the second classification model.

6. The method according to claim 5, characterized in that, The flattening constraint applied to the first loss value of the sample data corresponding to the K categories yields the fourth loss value, including: Based on the first loss value of the sample data corresponding to the K categories, the first update gradient is determined; Based on the first update gradient, determine the perturbation parameters; The model parameters of the first classification model are perturbed according to the perturbation parameters to obtain a perturbed classification model; The sample data is input into the perturbation classification model for classification prediction to obtain perturbation classification prediction results. Based on the category label and the perturbation classification prediction results, the perturbation loss value corresponding to the sample data is determined. The perturbation classification prediction results are used to indicate the perturbation probability of the sample data belonging to each of the K categories. The fourth loss value is determined based on the perturbation loss values ​​of the sample data corresponding to the K categories.

7. The method according to claim 5, characterized in that, The step of training the first classification model using the second loss value and the fourth loss value to obtain the second classification model includes: Based on the fused loss value of the second loss value and the fourth loss value, a gradient set is determined, the gradient set including candidate update gradients corresponding to the K categories respectively; Determine the weight coefficients of each candidate update gradient in the gradient set; The candidate update gradients are weighted and summed based on the weight coefficients to obtain the second update gradient. The second classification model is obtained by updating the model parameters of the first classification model using the second update gradient.

8. The method according to any one of claims 1 to 4, characterized in that, The step of determining a third loss value corresponding to the sample data based on the category label and the second classification prediction result, and training the second classification model using the third loss value to obtain the target classification model includes: Based on the difference between the category label and the second classification prediction result, a third loss value corresponding to the sample data is determined; The second classification model is trained by averaging the third loss values ​​corresponding to the multiple sample data to obtain a candidate classification model; The sample data is input into the candidate classification model for classification prediction to obtain candidate classification prediction results. The candidate classification prediction results are used to indicate the candidate probability of the sample data belonging to each of the K categories. Based on the difference between the category label and the candidate classification prediction result, a fifth loss value corresponding to the sample data is determined; The candidate classification model is trained by weighting the fifth loss value corresponding to the multiple sample data to obtain the target classification model.

9. A training device for a classification model, characterized in that, The device includes: The acquisition module is used to acquire a sample dataset, which includes multiple sample data labeled with category labels, the multiple sample data corresponding to K categories, where K is an integer greater than 1; the sample data includes sample image data; The prediction module is used to input the sample data into the first classification model for classification prediction and obtain the first classification prediction result. The first classification prediction result is used to indicate the first probability that the sample data belongs to each of the K categories. The training module is used to determine the first loss value corresponding to the sample data based on the category label and the first classification prediction result, apply generalization constraints to the first loss values ​​of the sample data corresponding to the K categories respectively to obtain the second loss value, and train the first classification model with the second loss value to obtain the second classification model; The prediction module is further configured to input the sample data into the second classification model for classification prediction, and obtain a second classification prediction result. The second classification prediction result is used to indicate the second probability that the sample data belongs to each of the K categories. The training module is further configured to determine a third loss value corresponding to the sample data based on the category label and the second classification prediction result, and to train the second classification model using the third loss value to obtain a target classification model, which is used to predict the category of image data.

10. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to implement the training method for the classification model as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the training method for the classification model as described in any one of claims 1 to 8.

12. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the training method for the classification model as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Classification model training method and device, equipment, storage medium and program product

    CN114330499A

  • Text classification method and device, model training method and device and electronic equipment

    CN116049412A