Long tail learning classification method and device based on decision boundary perception
By introducing a decision boundary awareness mechanism and sample filtering into generative long-tail learning, high-value samples are generated and screened, solving the problems of fuzzy decision boundaries and sample screening in long-tail data training, and improving the classification accuracy of tail categories and the overall training robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAMEN UNIV
- Filing Date
- 2026-03-24
- Publication Date
- 2026-07-31
AI Technical Summary
Existing generative long-tail learning methods are easily affected by the head category when trained on long-tail data, resulting in blurred decision boundaries and difficulty in effectively selecting beneficial generated samples, which affects the classification accuracy of the tail category.
By introducing a decision boundary awareness mechanism during the diffusion generation process, high-value samples close to the decision boundary are generated and screened. Combined with class prototype distance and confidence filtering, abnormal samples are eliminated, forming high-quality near-boundary generated samples for retraining the classifier.
It significantly reduces feature overlap between categories, improves classification accuracy of tail categories, forms compact and stable category clusters, enhances overall training robustness, and demonstrates good versatility and accuracy improvement across various network structures.
Smart Images

Figure CN122493095A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine learning and computer vision technology, and particularly to a long-tail learning classification method based on decision boundary awareness, a long-tail learning classification device based on decision boundary awareness, a computer-readable storage medium, and a computer device. Background Technology
[0002] In tasks such as image classification and object recognition, traditional deep learning methods typically assume that the number of samples in each category is roughly balanced. Under this premise, the classifier trained can learn the decision boundary well and achieve high accuracy on the test set.
[0003] However, in practical applications, datasets often exhibit a clear "long-tail distribution" characteristic, meaning that a few head class samples are plentiful while a large number of tail class samples are extremely scarce. Classifiers trained directly on such data have the following problems: (1) The decision boundary is clearly biased towards the head class, and tail class samples are easily misclassified as head classes, resulting in a significant decrease in tail class accuracy; (2) The distribution of each class in the feature space is extremely uneven, the tail class features are sparse, and there is a lack of effective samples near the class boundary, making it difficult for the model to learn the accurate decision boundary.
[0004] To alleviate the scarcity of tail samples, numerous methods based on reweighting, resampling, and generative modeling have been proposed in existing technologies. Among these, the use of generative models such as diffusion models to supplement tail category samples has received considerable attention in recent years. A typical approach is to first train a diffusion generative model on long-tail data, and then use a "head-to-tail class transfer" method to transfer the prior knowledge of the head category to the tail category to enrich the tail distribution.
[0005] However, existing generative long-tail learning methods still have the following shortcomings: On the one hand, the diffusion model itself is strongly influenced by the head class under long-tail training. Simple head-tail transfer strategies are prone to cross-class feature leakage in the latent space, causing different classes to overlap in the feature space, which in turn exacerbates the blurring of the decision boundary. On the other hand, among the large number of generated samples, it is difficult to distinguish which samples are beneficial to the decision boundary and which samples will destroy the original discriminative ability of the classifier. There is a lack of effective generated sample filtering and utilization mechanisms.
[0006] Therefore, how to design a "decision boundary awareness" generation and training method in long-tail learning scenarios, which can both supplement the tail category samples in terms of quantity and sharpen the decision boundary and reduce the feature overlap between categories in terms of structure, is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0007] This invention aims to at least partially solve one of the technical problems in the aforementioned technologies. To this end, one objective of this invention is to propose a long-tail learning classification method based on decision boundary awareness. This method improves overall classification performance, particularly the classification accuracy of tail categories, by generating and filtering high-value samples close to the decision boundary, without altering the privacy and labeling of the original data.
[0008] A second objective of this invention is to provide a computer-readable storage medium.
[0009] The third objective of this invention is to provide a computer device.
[0010] The fourth objective of this invention is to propose a long-tail learning classification device based on decision boundary awareness.
[0011] To achieve the above objectives, a first aspect of this invention proposes a long-tail learning classification method based on decision boundary awareness. This method includes the following steps: obtaining a training dataset, wherein the training dataset includes input samples and corresponding class labels; training a diffusion generation model using the training dataset to minimize noise prediction loss and optimize the diffusion generation model to obtain a noise prediction network; training a classifier using the training dataset, mitigating class bias through a cross-entropy loss with logarithmic adjustment to obtain a base classifier; inputting the input samples into the noise prediction network, and adding random noise at intermediate time points during the diffusion process to obtain intermediate noise samples; using the intermediate noise samples as the starting point and the class labels corresponding to the input samples as conditions, iteratively performing forward diffusion within time steps to obtain samples closer to the edge. The input samples are used to generate near-boundary noise samples. The input samples are then fed into a base classifier to obtain class prediction probabilities. The class with the highest prediction probability score is selected as the target class. Starting with the noise samples near the boundary and using the target class as a condition, an iterative reverse denoising process without classifier guidance is employed to generate near-boundary samples. Geometric filtering based on class prototype distance and discriminant space matching filtering based on confidence and credibility are applied to these near-boundary generated samples to obtain high-quality near-boundary generated samples. The base classifier is then retrained using these high-quality near-boundary generated samples to obtain a trained long-tail classification model. Finally, the target image to be classified is acquired and input into the trained long-tail classification model to obtain the class prediction result corresponding to the target image.
[0012] The long-tail learning classification method based on decision boundary awareness proposed in this invention has the following advantages: (1) By explicitly introducing a decision boundary awareness mechanism during the diffusion generation process, the generated samples are concentrated in the category boundary region. While supplementing the tail category samples, it effectively alleviates the problem of decision boundary ambiguity and significantly reduces the feature overlap between categories; (2) Through the category prototype distance filtering branch, this application can remove abnormal generated samples that deviate too much from the target category prototype in the feature space, reduce tail category feature drift and outliers, and help form a more compact and stable category cluster; (3) Through the confidence and credibility joint filtering branch, this application can identify and remove harmful generated samples that are seriously mismatched with the classifier's discrimination space, avoid such samples from further destroying the decision boundary during retraining, and improve the overall training robustness; (4) The decision boundary awareness generation framework of this application has good universality and pluggability. It can be used in combination with various existing long-tail learning baseline methods and different network backbone structures. It can achieve improvements in overall accuracy and tail category accuracy on multiple standard long-tail benchmark datasets.
[0013] In addition, the long-tail learning classification method based on decision boundary awareness proposed in the above embodiments of the present invention may also have the following additional technical features: Optionally, geometric filtering of the near-boundary generated sample set by class prototype distance includes: extracting normalized features of all input samples using a base classifier, and calculating the feature prototype vector of each class based on the normalized features of all input samples; inputting the near-boundary generated samples into the base classifier to obtain the corresponding normalized features, and calculating the cosine distance between them and the feature prototype vector; constructing a distance acceptance interval for each class based on a preset ratio parameter to remove outlier samples whose distance falls outside the distance acceptance interval.
[0014] Optionally, the near-boundary generated samples are subjected to discriminative space matching filtering based on confidence and credibility, including: inputting the near-boundary generated samples after geometric filtering by class prototype distance into the base classifier to obtain the predicted probabilities of each class; using the target class probability as the confidence of the sample in the target class, using the difference between the maximum predicted probability and the second largest predicted probability as the credibility, setting a threshold based on the number of samples of each class in the training dataset, and removing a near-boundary generated sample when it is predicted with high confidence that it is neither the original class nor the target class.
[0015] Optionally, the high-quality near-boundary generated samples are used to retrain the base classifier to obtain a trained long-tail classification model, including: using the high-quality near-boundary generated samples as auxiliary training samples and merging them with the original training dataset to form an extended dataset; and retraining or fine-tuning the base classifier on the extended dataset to obtain a trained long-tail classification model.
[0016] To achieve the above objectives, a second aspect of the present invention provides a computer-readable storage medium storing a decision boundary-aware long-tail learning classification program thereon, which, when executed by a processor, implements the decision boundary-aware long-tail learning classification method as described above.
[0017] To achieve the above objectives, a third aspect of the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the long-tail learning classification method based on decision boundary awareness as described above.
[0018] To achieve the above objectives, a fourth aspect of the present invention proposes a long-tail learning classification device based on decision boundary awareness, comprising: an acquisition module for acquiring a training dataset, wherein the training dataset includes input samples and corresponding class labels; a first training module for training a diffusion generation model using the training dataset to optimize the diffusion generation model by minimizing noise prediction loss, thereby obtaining a noise prediction network; a second training module for training a classifier using the training dataset, mitigating class bias through a cross-entropy loss with logarithmic adjustment, thereby obtaining a base classifier; and a sample noise-adding module for inputting the input samples into the noise prediction network and adding random noise at intermediate time points during the diffusion process to obtain intermediate noise samples, and iteratively performing forward diffusion within time steps using the intermediate noise samples as the starting point and the class labels corresponding to the input samples as conditions, to obtain samples close to the boundary. The system comprises the following modules: a noise sample module; a perceptual sample denoising module, which inputs the input sample into a base classifier to obtain the predicted class probability, selects the easily confused class with the highest predicted probability score as the target class, and uses the noise sample near the boundary as a starting point and the target class as a condition to perform classifier-free reverse denoising iteration to obtain near-boundary generated samples; a sample filtering module, which performs geometric filtering based on class prototype distance and discriminant space matching filtering based on confidence and credibility on the near-boundary generated samples to obtain high-quality near-boundary generated samples; a third training module, which retrains the base classifier using high-quality near-boundary generated samples to obtain a trained long-tail classification model; and a target classification module, which acquires the target image to be classified and inputs the target image to be classified into the trained long-tail classification model to obtain the class prediction result corresponding to the target image to be classified. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the long-tail learning classification method based on decision boundary awareness according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the process for generating edge-aware auxiliary training samples according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the data cleaning process according to an embodiment of the present invention; Figure 4 This is a block diagram of a long-tail learning classification device based on decision boundary awareness according to an embodiment of the present invention. Detailed Implementation
[0020] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0021] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the invention to those skilled in the art.
[0022] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0023] refer to Figure 1 As shown, the long-tail learning classification method based on decision boundary awareness in this embodiment of the invention includes the following steps: S101, Obtain the training dataset, which includes input samples and their corresponding class labels.
[0024] S102, a diffusion generation model is trained using the training dataset, and the diffusion generation model is optimized to minimize the noise prediction loss, so as to obtain the noise prediction network.
[0025] S103 uses the training dataset to train a classifier, and alleviates class bias by using cross-entropy loss with logarithmic adjustment to obtain the base classifier.
[0026] In other words, a long-tailed distribution training dataset with class labels is obtained, which includes both head and tail class samples; a diffusion generation model is trained on this dataset to obtain a noise prediction network for image generation; at the same time, a classifier is trained as the base model for subsequent feature extraction and classification. The classifier can use a loss function with logarithmic adjustment to alleviate the class bias caused by the long-tailed distribution.
[0027] As an example, for ease of formula description, the following symbols are defined: The training set is denoted as ,in, For the input sample, For category labels, The total number of categories. The number of samples in each class is Long-tail distribution refers to different categories The differences are significant. The diffusion generation model has a time step count of [number missing]. Noise scheduling is , , The noise prediction network is denoted as... The classifier is denoted as Its penultimate layer features are The output logits is .
[0028] Specifically, obtain a long-tailed distribution training dataset with class labels. This dataset includes both head category samples (the categories with a larger number of samples) and tail category samples (the categories with a smaller number of samples).
[0029] The diffusion generation model is trained using the standard discrete-time diffusion model, and its forward noise addition process is as follows:
[0030] Its closed form is:
[0031]
[0032] The diffusion generation model is trained by minimizing the noise prediction error, with the loss function being:
[0033] in, The above formula is used for sampling. For category condition labels.
[0034] Long-tail classifier training: based on the same training set Training classifier Output the logit vector for each category. , among which, the The class logit is To mitigate the head class bias caused by the long-tail distribution, a logit-adjusted loss is used, for example:
[0035] in, It can be taken as the first Prior probability of a class , To adjust the temperature coefficient, a classifier is obtained after training for subsequent feature extraction and filtering. .
[0036] S104. Input the input sample into the noise prediction network and add random noise at intermediate time points during the diffusion process to obtain intermediate noise samples. Starting from the intermediate noise samples, perform forward diffusion iteratively within the time step with the category label corresponding to the input samples as the condition to obtain noise samples close to the boundary.
[0037] In other words, for each source sample in the training set, random noise is directly added at the middle of the diffusion time step to obtain an intermediate noise sample. Then, in the forward diffusion process conditioned on the original class of the source sample, the conditional noise output by the noise prediction network is used to update the sample in multiple steps, gradually weakening the significant class features, so that the sample moves towards the decision boundary in the feature space, thereby obtaining a noise sample close to the decision boundary.
[0038] As an example, for each source sample in the training set First, it is placed at the midpoint of the diffusion time step. Random noise is directly added to obtain intermediate noise samples. Specifically, random noise is sampled from a standard Gaussian distribution. Utilizing the midpoint time step Constructing intermediate noise samples:
[0039] This operation pushes the original sample into an intermediate noisy state, making it easier to modify the deep class features later. Then, with Starting with the aforementioned source category labels As a condition, at time step (in Iterative forward diffusion is performed within the current time step: Source category conditional noise is obtained based on the noise prediction network.
[0040] The sample state is updated in the form of forward diffusion. (The aforementioned closed-form formula can be used, with...) (Replacing pure random noise), thereby gradually eliminating overly obvious class features while maintaining the overall structure, allowing samples to move closer to the decision boundary in the feature space.
[0041] After the above After conditional noise addition, a batch of noise samples close to the source class decision boundary can be obtained. Its semantics are relatively neutral, making it more suitable for subsequent "tag changing" operations.
[0042] S105: Input the input sample into the base classifier to obtain the predicted class probability, and select the easily confused class with the highest predicted probability score as the target class. Starting with the noisy sample near the boundary, and using the target class as a condition, use the unguided reverse denoising iteration to obtain the near-boundary generated sample.
[0043] In other words, the source samples are input into the base classifier to obtain the prediction scores of each category. Several candidate categories with the highest prediction scores are selected to form a candidate set, and the category with the highest score or the most easily confused category is selected as the target category. Then, starting with the noisy samples near the boundary, and using the target category as a condition, a diffusion reverse denoising process that combines unconditional guidance and conditional guidance is used to perform multi-step denoising generation, resulting in near-boundary generated samples that have both the original semantics and the target category features.
[0044] As an example, the source sample Input classifier , thus obtaining the logit vector and the corresponding category probability
[0045]
[0046] Sort the categories by probability from highest to lowest, and select the top k categories to form a candidate set.
[0047] in, To stabilize the weight hyperparameters; then from the set The category with the highest score or the most easily confused category is selected as the target category. .
[0048] In the denoising stage, the "noise sample near the boundary" obtained from S104 is used. Starting with the target category As a condition, noise is estimated using the standard Classifier-free Guidance (CFG) form:
[0049] in, For unconditional noise prediction, To guide the strength coefficient. At each time step Above, a clean sample is reconstructed using the reverse update formula:
[0050]
[0051] By from Iterate to 0 to obtain generated samples that possess both original semantic and target category features and are located near the decision boundary. Its label is the target category .
[0052] S106 performs geometric filtering based on class prototype distance and discriminant space matching filtering based on confidence and credibility on near-boundary generated samples to obtain high-quality near-boundary generated samples.
[0053] As an example, geometric filtering of the near-boundary generated sample set by class prototype distance includes: extracting normalized features of all input samples using a base classifier, and calculating the feature prototype vector of each class based on the normalized features of all input samples; inputting the near-boundary generated samples into the base classifier to obtain the corresponding normalized features, and calculating the cosine distance between them and the feature prototype vector; constructing a distance acceptance interval for each class based on a preset ratio parameter to remove outlier samples whose distance falls outside the distance acceptance interval.
[0054] In other words, the features of each category of samples in the training set are extracted using a base classifier, and the feature prototype vector of each category is calculated after normalization. Samples generated near the boundary are input into the classifier to obtain their normalized features, and the cosine distance between them and the target category prototype is calculated. For each category, the distance acceptance interval of the category is constructed based on the maximum and minimum distances of the generated samples of that category, combined with a preset ratio parameter. When the distance between the generated sample and the target category prototype falls outside the acceptance interval, it is judged as an abnormal prototype distance sample and removed.
[0055] As a specific implementation, a trained base classifier is used. Features of each category in the training set are extracted, normalized, and then the feature prototype vector for each category is calculated. Geometric filtering is then applied to the generated samples based on this vector. For any sample... Let the classifier features be... The normalized features are:
[0056] For the All training samples of the class First, calculate the average characteristic:
[0057] Normalization yields the prototype vector for this category.
[0058] Next, samples are generated near the boundary. Input to classifier to obtain normalized features , and the target category prototype (in The cosine distance between them is defined as:
[0059] in This is the inner product; a larger value indicates that the product is further away from the feature center of that category. Finally, for each target category... Calculate the maximum distance from all generated samples of this category to the prototype. minimum distance And define the acceptance interval for this category based on the long-tail distribution characteristics. ,in To set a smaller proportionality parameter, extreme outliers and samples that are too far / too close to the boundary are removed. When a generated sample... If the distance falls outside the acceptable range, it is identified as an abnormal sample of the prototype distance and is removed.
[0060] As an example, discriminative space matching filtering based on confidence and credibility is performed on near-boundary generated samples, including: inputting the near-boundary generated samples after geometric filtering by class prototype distance into the base classifier to obtain the predicted probabilities of each class; using the target class probability as the confidence of the sample in the target class, using the difference between the maximum predicted probability and the second largest predicted probability as the credibility, setting a threshold based on the number of samples of each class in the training dataset, and removing a near-boundary generated sample when it is predicted with high confidence that it is neither the original class nor the target class.
[0061] In other words, the basic classifier is used to perform forward prediction on the generated samples near the boundary to obtain the predicted probabilities of each category; the target category probability is used as the confidence of the sample in the target category, and the difference between the highest and second highest predicted probabilities is used as the confidence; the threshold is adaptively set according to the number of samples of each category in the training dataset. When a generated sample is predicted with high confidence as neither the original category nor the target category, it is determined that the sample is seriously mismatched with the feature space of the classifier and is removed from the generated sample set.
[0062] As a specific implementation, in addition to the prototype distance filtering, the confidence and credibility output by the classifier are used to perform a second filtering on the generated samples to further remove samples that are seriously mismatched with the classifier's discrimination space.
[0063] Generate samples Input classifier , thus obtaining the logit vector And category probabilities:
[0064]
[0065] Let the target category be ,definition:
[0066]
[0067]
[0068] in, This is the "perturbation category" with the second highest probability after the highest probability category. The credibility is defined as:
[0069] To mitigate the impact of long-tail bias in filtering, for each category Based on its sample size Set class condition threshold For example, you can choose to use any Monotonically increasing function (The specific function form can be determined according to the actual system configuration). When a certain generated sample In the classifier, it is incorrectly predicted as neither the original class nor the target class, and the corresponding incorrect prediction is... and At the same time, it is higher than the threshold of the corresponding category. If the sample is found to be severely mismatched with the classifier's feature space, it is removed from the generated sample set. After prototype distance filtering and confidence-credibility filtering, a batch of high-quality near-boundary generated samples with reasonable geometric positions and consistent with the classifier's discrimination space can be obtained.
[0070] S107 uses high-quality near-boundary generated samples to retrain the base classifier to obtain a well-trained long-tail classification model.
[0071] As an example, the base classifier is retrained using high-quality near-boundary generated samples to obtain a trained long-tail classification model. This includes: using high-quality near-boundary generated samples as auxiliary training samples and merging them with the original training dataset to form an extended dataset; and retraining or fine-tuning the base classifier on the extended dataset to obtain a trained long-tail classification model.
[0072] In other words, the near-boundary generated samples after the above dual-branch filtering are used as auxiliary training samples and merged with the original long-tail training dataset to form an extended dataset. The classifier is then retrained or fine-tuned on this extended dataset to restore and sharpen the decision boundary in long-tail learning, improve the classification accuracy of tail categories, and reduce the feature overlap between categories.
[0073] As a specific implementation, the near-boundary generated samples after the above dual-branch filtering are used as auxiliary training samples and merged with the original long-tail training dataset to form an extended dataset. The classifier is then retrained or fine-tuned on this extended dataset to restore and sharpen the decision boundary in long-tail learning.
[0074] Let the set of all retained generated samples and their target labels be denoted as . Then the expanded dataset is .exist Continue to optimize the classifier parameters The aforementioned logit adjustment loss can continue to be used, i.e. By supplementing the decision boundary with high-quality generated samples, the classifier obtains richer supervision signals at the decision boundary between the head and tail classes.
[0075] S108: Obtain the target image to be classified and input it into the trained long-tail classification model to obtain the category prediction result corresponding to the target image.
[0076] In other words, the image to be classified is input into a trained long-tail classification model. After feature extraction and prediction by a fully connected layer, the predicted probabilities of each category are obtained, and the category label with the highest probability is taken as the category prediction result corresponding to the target image.
[0077] In summary, this application proposes a decision boundary-aware long-tail learning classification method. By explicitly introducing a decision boundary awareness mechanism during the diffusion generation process, the generated samples are concentrated in the class boundary region. This effectively alleviates the ambiguity of the decision boundary while supplementing the tail class samples, significantly reducing the feature overlap between classes. Through the class prototype distance filtering branch, this application can remove abnormal generated samples that deviate too much from the target class prototype in the feature space, reducing tail class feature drift and outliers, which is conducive to forming more compact and stable class clusters. Through the confidence and credibility joint filtering branch, this application can identify and remove harmful generated samples that are seriously mismatched with the classifier's discrimination space, preventing such samples from further damaging the decision boundary during retraining and improving the overall training robustness. The decision boundary-aware generation framework of this application has good versatility and pluggability, and can be used in conjunction with various existing long-tail learning baseline methods and different network backbone structures. It can achieve improvements in overall accuracy and tail class accuracy on multiple standard long-tail benchmark datasets.
[0078] To verify the performance of the long-tail learning classification method based on decision boundary awareness proposed in this application, a specific implementation method is described in detail.
[0079] Example 1: Long-tailed image classification based on residual network classifier In this embodiment, publicly available long-tail image classification datasets such as CIFAR-10-LT and CIFAR-100-LT can be used as training and testing data. The long-tail distribution of the training set is constructed according to a preset imbalance factor. The classifier backbone network can adopt ResNet-32 or other residual network structures, and the loss function adopts cross-entropy with logit adjustment to alleviate the head class bias caused by the long-tail distribution. The diffusion generation model can adopt a discrete-time step conditional diffusion model, and the forward noise scheduling and backward denoising processes can be implemented based on existing diffusion models.
[0080] like Figure 2 As shown, during the training phase, the diffusion generation model and classifier are first trained on the original long-tail training data to obtain the base model. Then, following steps S104 and S105, boundary-aware conditional noise addition and denoising operations are performed on the samples in the training set to generate a batch of near-boundary generated samples close to the decision boundary. Next, following step S106, a two-branch filtering process is performed on the generated samples based on the class prototype distance and confidence / credibility, retaining high-quality samples that have a positive impact on the decision boundary, such as... Figure 3 As shown; finally, these samples are merged with the original training samples to obtain an expanded training set, and the classifier is retrained or fine-tuned to obtain the final long-tail classification model.
[0081] During the testing phase, the retrained classifier was used to predict the test set images. Compared with the baseline results when the method of this application was not used, it can be observed that the overall classification accuracy and the tail category accuracy are improved to varying degrees. At the same time, the visualization results based on feature projection show that the distribution of each category in the feature space is more separated and the decision boundary is clearer. The experimental results on the Cifar100-LT dataset and the Cifar10-LT dataset are shown in Table 1 and Table 2, respectively.
[0082] Table 1
[0083] Table 2
[0084] Example 2: Extension based on visual Transformer classifier In this embodiment, the classifier backbone is replaced with a Vision Transformer structure, while the remaining diffusion model training, boundary-aware generation, and dual-branch filtering processes are basically the same as in Embodiment 1. Experiments show that, under different network backbone structures, the method of this application can also improve the classification performance of the overall and tail categories on long-tail datasets, verifying the universality and portability of the proposed solution. The accuracy results on Cifar100-LT and Cifar10-LT are shown in Tables 3 and 4.
[0085] Table 3
[0086] Table 4
[0087] In addition, the present invention also proposes a computer-readable storage medium storing a decision boundary-aware long-tail learning classification program thereon, which, when executed by a processor, implements the decision boundary-aware long-tail learning classification method as described above.
[0088] In addition, this invention also proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the long-tail learning classification method based on decision boundary awareness as described above.
[0089] Figure 4 This is a block diagram of a long-tail learning classification device based on decision boundary awareness according to an embodiment of the present invention. Figure 4As shown, the device includes: an acquisition module 10, a first training module 20, a second training module 30, a sensor sample noise-adding module 40, a sensor sample noise-removing module 50, a sample filtering module 60, a third training module 70, and a target classification module 80.
[0090] The system includes the following modules: Module 10 acquires a training dataset, which includes input samples and their corresponding class labels; Module 20 trains a diffusion generation model using the training dataset to minimize noise prediction loss and optimize the model to obtain a noise prediction network; Module 30 trains a classifier using the training dataset, mitigating class bias through log-adjusted cross-entropy loss to obtain a base classifier; Module 40 inputs the input samples into the noise prediction network and adds random noise at intermediate time points during the diffusion process to obtain intermediate noise samples. Starting from these intermediate noise samples, forward diffusion is iteratively performed within each time step, using the class labels corresponding to the input samples as conditions, to obtain noise samples near the boundary; Module 50 denoising the input samples... The input sample is fed into the base classifier to obtain the predicted class probability, and the easily confused class with the highest predicted probability score is selected as the target class. Starting with noisy samples near the boundary and using the target class as a condition, an iterative reverse denoising process without classifier guidance is adopted to obtain near-boundary generated samples. The sample filtering module 60 is used to perform geometric filtering based on class prototype distance and discriminant space matching filtering based on confidence and credibility on the near-boundary generated samples to obtain high-quality near-boundary generated samples. The third training module 70 is used to retrain the base classifier using high-quality near-boundary generated samples to obtain a trained long-tail classification model. The target classification module 80 is used to acquire the target image to be classified and input the target image to be classified into the trained long-tail classification model to obtain the class prediction result corresponding to the target image to be classified.
[0091] It should be noted that the foregoing explanation of the embodiment of the decision boundary-aware long-tail learning classification method also applies to the decision boundary-aware long-tail learning classification device of this embodiment, and will not be repeated here.
[0092] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0093] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0094] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0095] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0096] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0097] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0098] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
[0099] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0100] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0101] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0102] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0103] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A long tail learning classification method based on decision boundary perception, characterized in that, Includes the following steps: Obtain a training dataset, wherein the training dataset includes input samples and corresponding class labels; A diffusion generation model is trained using a training dataset, and the diffusion generation model is optimized to minimize the noise prediction loss, thereby obtaining a noise prediction network. A classifier is trained using the training dataset, and class bias is mitigated by cross-entropy loss with log adjustment to obtain the base classifier; The input sample is fed into the noise prediction network, and random noise is added at intermediate time points during the diffusion process to obtain intermediate noise samples. Starting from the intermediate noise samples, forward diffusion is iteratively performed within the time step based on the category label corresponding to the input sample to obtain noise samples near the boundary. The input sample is fed into the base classifier to obtain the predicted class probability, and the easily confused class with the highest predicted probability score is selected as the target class. Starting with the noise sample near the boundary and using the target class as a condition, the inverse denoising iteration without classifier guidance is used to obtain the near boundary generated sample. Geometric filtering based on class prototype distance and discriminant space matching filtering based on confidence and credibility are performed on the near-boundary generated samples to obtain high-quality near-boundary generated samples. The base classifier is retrained using the high-quality near-boundary generated samples to obtain a trained long-tail classification model. The target image to be classified is acquired and input into the trained long-tail classification model to obtain the category prediction result corresponding to the target image.
2. The decision boundary perception based long tail learning classification method of claim 1, wherein, Geometric filtering of the near-boundary generated sample set by class prototype distance includes: The normalized features of all input samples are extracted using a base classifier, and the feature prototype vector of each category is calculated based on the normalized features of all input samples. The near-boundary generated samples are input into the base classifier to obtain the corresponding normalized features, and the cosine distance between them and the feature prototype vector is calculated. The distance acceptance interval for each category is constructed according to the preset ratio parameter to remove outlier samples whose distance falls outside the distance acceptance interval.
3. The decision boundary perception based long tail learning classification method of claim 1, wherein, The near-boundary generated samples are subjected to discriminative spatial matching filtering based on confidence and credibility, including: Near-boundary generated samples after geometric filtering by class prototype distance are input into the base classifier to obtain the predicted probabilities of each class. The confidence level of a sample in the target class is taken as the probability of the target class, and the confidence level is taken as the difference between the highest and second highest predicted probabilities. A threshold is set based on the number of samples of each class in the training dataset. When a sample generated near the boundary is predicted with high confidence as neither the original class nor the target class, it is removed.
4. The decision boundary perception based long tail learning classification method of claim 1, wherein, The base classifier is retrained using the high-quality near-boundary generated samples to obtain a trained long-tail classification model, including: The high-quality near-boundary generated samples are used as auxiliary training samples and merged with the original training dataset to form an extended dataset. The base classifier is retrained or fine-tuned on the extended dataset to obtain a trained long-tail classification model.
5. A computer readable storage medium, characterized in that, It stores a decision boundary-aware long-tail learning classification program, which, when executed by the processor, implements the decision boundary-aware long-tail learning classification method as described in any one of claims 1-4.
6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the long-tail learning classification method based on decision boundary awareness as described in any one of claims 1-4.
7. A long-tail learning classification device based on decision boundary awareness, characterized in that, include: An acquisition module is used to acquire a training dataset, wherein the training dataset includes input samples and corresponding class labels; The first training module is used to train the diffusion generation model using the training dataset, optimize the diffusion generation model to minimize the noise prediction loss, and obtain the noise prediction network. The second training module is used to train a classifier using the training dataset, mitigating class bias through cross-entropy loss with log adjustment to obtain a base classifier. The perceptual sample noise addition module is used to input the input sample into the noise prediction network and add random noise at intermediate time points during the diffusion process to obtain intermediate noise samples. Starting from the intermediate noise samples, forward diffusion is iteratively performed within the time step based on the category label corresponding to the input samples to obtain noise samples near the boundary. The perceptual sample denoising module is used to input the input sample into the base classifier to obtain the category prediction probability, and select the easily confused category with the highest prediction probability score as the target category. Starting from the noise sample near the boundary and using the target category as a condition, the module uses an unguided reverse denoising iteration to obtain the near-boundary generated sample. The sample filtering module is used to perform geometric filtering based on class prototype distance and discriminant space matching filtering based on confidence and credibility on the near-boundary generated samples to obtain high-quality near-boundary generated samples. The third training module is used to retrain the base classifier using high-quality near-boundary generated samples to obtain a well-trained long-tail classification model. The target classification module is used to acquire the target image to be classified and input the target image to be classified into the trained long-tail classification model to obtain the category prediction result corresponding to the target image to be classified.