A loss function calculation method for dynamically recovering the importance of large categories in imbalanced learning
By dynamically adjusting the loss function of the importance of major categories, the problem of low small class recognition performance in class imbalanced data of deep neural network models is solved, the model performance and generalization capabilities are improved, and parameter debugging is simplified.
Patent Information
- Application Number
- CN202111556763.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-18
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-12-18
AI Technical Summary
Existing deep neural network models are used to process class imbalance data, especially small classes have low recognition performance, resulting in limited applications in the real world.
A loss function calculation method for dynamic recovery of the importance of major categories is proposed by unbalanced learning. By dynamically adjusting the importance of major categories, use the loss function CEDRMC(p,y,i)=-log(pt)·αt_drmc(y,i ), where αt_drmc(y,i)=Init(y)·Active(1/Rest(y)·Grad(i)), controls the importance of major categories, improves the cost-sensitive loss function, and reduces the Sensitivity of hyperparameters.
It significantly improves the performance of the deep neural network model, improves the ability to identify subclasses, enhances the generalization ability of the model, and simplifies training parameter debugging, alleviates the problems of under-representation and over-representation of categories.
Smart Images

Figure CN114638983B
Abstract
Description
Technical Field
[0001] The present invention relates to machine learning, and in particular to a method for calculating a loss function for dynamically restoring the importance of major categories in imbalanced learning. Background Art
[0002] Class imbalance refers to the imbalance in the number of classes in the data. In the past few years, with the continuous development of machine learning, deep artificial neural networks have made great progress. Deep neural network models are always trained on carefully designed datasets, which are usually balanced in distribution. However, in the real world, class imbalanced data is prevalent in real training scenarios due to the different frequencies of objects, events, and behaviors. If there is no correction mechanism during the training process, the unbalanced features in the dataset will lead to low recognition performance of the deep neural network model for small classes. With the widespread application of deep learning, how to learn high-performance models from datasets with class imbalance or long-tail distribution has become an urgent problem to be solved.
[0003] There are currently some methods to solve the class imbalance problem, which can be divided into data-based methods and algorithm-based methods. Among data-based methods, a common way is to resample the training data by oversampling small classes, undersampling large classes, or a combination of them, but this will change the distribution of the data. Another way is a collection of classifiers, each of which is trained from different samples of the original dataset. In recent years, in order to better learn the distribution of the dataset, researchers have also expanded the dataset by sample generation to improve the performance of the model. Among algorithm-based methods, cost-sensitive functions are often widely used, which directly or indirectly emphasize / suppress the importance of small / large classes by introducing costs (weights) for each class or each sample, thereby solving the problem of imbalanced learning. Compared with data-based methods, this type of method is intuitive and easier to implement, and is widely used in deep learning. Summary of the invention
[0004] 1. A loss function calculation method for dynamically restoring the Importance of Majority Class (DRMC) in imbalanced learning can be used in imbalanced learning of visual classification models based on deep learning. First, the importance of major classes is suppressed, and then the importance of major classes is gradually restored. The calculation formula of the loss function based on this method is:
[0005] CE DRMC (p,y,i)=-log(p t )·α t_drmc (y,i), (4)
[0006] Wherein, p∈[0,1] is the class prediction probability of the sample, y is the label value of the sample, i is the number of training iterations, and p t is the predicted probability of the true category of the sample, the -log(p t )· is the cross entropy loss, the α t_drmc It is a dynamic cost function, which consists of 4 parts and is defined as follows:
[0007] α t_drmc (y,i)=Init(y)·Acti(1 / Rest(y)·Grad(i)), (5)
[0008] Among them, Init(y) is the initial cost function that suppresses the importance of the major categories, Rest(y) is the cost recovery function, Grad(·) is the progressively increasing function, and Acti(·) is the activation function. Rest(y), Grad(·) and Acti(·) jointly control the importance of restoring the major categories.
[0009] For formula (5), Init(y) and Rest(y) are class-level cost functions.
[0010] For formula (5), the activation function Acti(·) is:
[0011]
[0012] Wherein, x∈(-∞,+∞).
[0013] For formula (5), the asymptotic function Grad(.) is:
[0014] Grad(i)=i / M, (7)
[0015] Where M is the maximum number of training iterations
[0016] The beneficial effects of the present invention are:
[0017] The method of the present invention is a loss function calculation method for dynamically restoring the importance of large categories in imbalanced learning. It first suppresses the importance of large categories and then gradually restores the importance of large categories. Using our method, we can significantly improve the performance of deep neural network models by improving existing classic and popular loss functions, and show good generalization ability on multiple existing loss functions.
[0018] The performance of the existing cost-sensitive loss function for imbalanced learning is sensitive to hyperparameters. After using our method to improve the existing cost-sensitive loss function, it is insensitive to hyperparameters, thereby facilitating the debugging of parameters during training.
[0019] Existing deep neural network models are often trained on balanced distribution data sets, and the classification performance is low for small classes. With the implementation of deep learning technology in real life, the unbalanced data that is prevalent in the real world has increasingly become a bottleneck limiting the performance and application of deep learning. The present invention improves the existing unbalanced learning method to address this problem and has broad application prospects.
[0020] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a summary of the present invention;
[0022] Figure 2 It is the dynamic change process of the major category costs proposed in the embodiment of the present invention;
[0023] Figure 3 It is a comparison of the effects of DRMCs in the embodiment of the present invention and the existing methods on the ILSO salient instance segmentation dataset;
[0024] Figure 4 It is a quantitative comparison of the performance of DRMCs in the embodiment of the present invention and the existing methods on the Instance-MSRA1000 salient instance segmentation dataset;
[0025] Figure 5 It is a qualitative comparison of the performance of DRMCs in the embodiment of the present invention and the existing methods on the PASCAL VOC 2012 AUGMENT variant semantic segmentation dataset;
[0026] Figure 6 is the change process of MIoU when using DBENS and BENS for training on PASCAL VOC 2012 AUGMENT variant in the embodiment of the present invention (%);
[0027] Figure 7 It is a qualitative comparison of the performance of DRMCs in the embodiment of the present invention and the existing methods on the anthrax spore-1600 data set;
[0028] Figure 8 is the change process (%) of MIoU when using BENS and DBENS for training on the anthrax spore-1600 dataset in an embodiment of the present invention; DETAILED DESCRIPTION
[0029] The following will be combined with the embodiment and Figure 2-8The concept, specific steps and technical effects of the present invention are clearly and completely described to fully understand the purpose, features and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. The equivalent transformations or substitutions in functions, methods or structures made by ordinary technicians in the field according to these implementations are all within the protection scope of the present invention.
[0030] The present invention is implemented in two typical visual tasks, one of which is the salient object detection subtask of image salient instance segmentation, and the other is the image semantic segmentation task. Salient instance segmentation is to segment the salient area and identify each instance, which has a wide range of applications, such as accurate image editing and weakly supervised segmentation. It includes two consecutive subtasks: salient object detection and salient segmentation. In the salient segmentation stage, the samples used for training are class-balanced, but in the salient object detection stage, there is an extreme class imbalance between salient boxes and non-salient boxes (the class frequency ratio is about 1:1000). In addition, there are a large number of recommended boxes that have a certain degree of saliency but are considered to be non-salient boxes. This makes the distribution of non-salient boxes very complex. In this embodiment, unbalanced learning of a deep neural network model is performed on the salient object detection subtask. In the embodiment of the present invention, LSIO dataset (G. Li, Y. Xie, L. Lin and Y. Yu, "Instance-Level Salient Object Segmentation," in Proceedings of the IEEE International Conference on Computer Vision, pp. 247-256, 2017) is used for salient instance segmentation. In addition, a new dataset (named Instance-MSRA1000) is established in the embodiment of the present invention, which is obtained by pixel-wise annotation of each instance in the public dataset MSRA1000 for salient object detection. The embodiment of the present invention uses this dataset to test the generalization ability of the trained model.
[0031] Image semantic segmentation is to assign a semantic label to each pixel in an image, which has a wide range of applications, such as scene understanding and autonomous driving. In the embodiment of the present invention, image semantic segmentation is performed on two public datasets: PASCAL VOC2012 AUGMENT variant and Anthrax spores-1600 dataset. PASCAL VOC 2012 AUGMENT is the most popular dataset for image semantic segmentation. It contains 10,582 images for training and 1,449 images for testing. Because the original dataset is class-balanced, the embodiment of the present invention makes a class-unbalanced variant of the original dataset. It consists of the most challenging chair class and non-chair class. The frequency ratio of small classes to large classes is about 1:100. The Anthrax Spores-1600 dataset consists of 1,600 anthrax spore images (1,400 for training and 200 for testing), which are taken with a microscope at 400 times magnification. On average, there are about 50 anthrax spores per image, with a frequency ratio of about 1:50. Each pixel is labeled as either anthrax spore or background.
[0032] This embodiment provides a method for calculating the loss function for dynamically restoring the importance of major categories in unbalanced learning in classification tasks based on deep learning: first suppress the importance of major categories, and then gradually restore the importance of major categories. In the present invention, the importance of categories is represented by a cost function. The calculation formula of the loss function based on dynamically restoring the importance of major categories is:
[0033] CE DRMC (p,y,i)=CE(p,y)·α t_drmc (y,i), (1)
[0034] where α t_drmc (y,i) is the cost function. CE(p,y) is the standard cross entropy loss, defined as:
[0035]
[0036] Where y is the label value, which can be 0 (background class) or 1 (object class), and p∈[0,1] is the predicted probability of the object class. For convenience, in the embodiment of the present invention, CE(p,y)=CE(p t )=-log(p t ), where p t is the predicted probability of the true class, defined as:
[0037]
[0038] Therefore, formula (1) can be expressed as:
[0039] CE DRMC (p,y,i)=-log(pt )·α t_drmc (y,i), (4)
[0040] The cost function α of the present invention t_drmc (y,i) consists of 4 parts, defined as follows
[0041] α t_drmc (y,i)=Init(y)·Acti(1 / Rest(y)·Grad(i)), (5)
[0042] Where i is the number of training iterations, and the activation function Acti(·) is:
[0043]
[0044] Wherein, x∈(-∞,+∞).
[0045] The gradual function Grad(.) is:
[0046] Grad(i)=i / M, (7)
[0047] Where M is the maximum number of training iterations.
[0048] For formula (5), Init(y) represents the initial cost function for suppressing the importance of large categories, which can be set to a traditional cost function, and Rest(y) represents the cost recovery function, which can still be set to a traditional cost function. The present invention provides three embodiments, respectively setting the initial function Init(y) and the recovery function Rest(y) in three different ways, thereby obtaining three new losses: dynamic balance-cross-entropy based on class frequencies (DBCEF), dynamic constrained-focal-loss (DCFL) and dynamic balance-cross-entropy based on the effective number of samples (DBENS). The specific embodiments are described as follows.
[0049] Embodiment 1
[0050] In cost-sensitive imbalanced learning, balance-cross-entropybased on class frequencies (BCEF) is widely used. By setting a cost α for the cross entropy loss tTo balance the importance between classes (R. Fan, M. M. Cheng, Q. Hou, T. J. Mu, J. Wang, and SM Hu, "S4Net: SingleStage Salient-Instance Segmentation," in Proceedings of the IEEE International Conference on Computer Vision, pp. 6096-6105, 2019), defined as:
[0051] BCE(p,y)=-α t log(p t ), (8)
[0052] Among them, α t It is often set as the inverse function of the class frequency. It is defined as:
[0053]
[0054] Among them, n min and n maj are the number of samples of the object class and the background class respectively. In the embodiment of the present invention, it is assumed that the target object class is a small class.
[0055] In the embodiment of the present invention, the initial cost function Init(y) in formula (5) is set to α t_bcef (y), the recovery function Rest(y) is:
[0056] Rest(y)=α t _ wbcef (y) = α t_bcef (y) / k, (10)
[0057] Among them, k is the recovery coefficient, which controls the degree of recovery of the importance of major categories.
[0058] The above Init(y) and Rest(y) are combined with formulas (6) and (7) to obtain the dynamic equilibrium cross entropy DBCEF based on class frequency. In the initial stage of training, the importance of large categories is reduced according to the class frequency ratio. As the training progresses, the importance of large categories gradually recovers, and the degree of recovery is controlled by k.
[0059] Embodiment 2
[0060] In imbalanced learning, the constrained-focal-loss (CFL) is based not only on the frequency ratio but also on the difficulty ratio between classes (Y.Zhao, F.Lin, S.Liu, Z.Hu, H.Li and Y.Bai, “Constrained-Focal-Loss Based Deep Learning for Segmentation of Spores,” IEEE Access, pp.165029-165038, 2019), which is defined as:
[0061] CFL(p,y)=-log(p t )·α t_cfl (y), (11)
[0062] in
[0063]
[0064] In this embodiment, Init(y) and Rest(y) in formula (5) are set to the above α t_cfl (y), that is:
[0065] Init(y)=Rest(y)=α t_cfl (y) (13)
[0066] The above Init(y) and Rest(y) are combined with formulas (6) and (7) to obtain the dynamic constrained focal loss (DCFL). In the initial stage of training, the importance of the large category is restricted and reduced according to the category frequency ratio. The degree of restriction is controlled by the constraint parameter β. As the training progresses, the importance of the large category is gradually fully restored.
[0067] Embodiment 3
[0068] The literature (Y.Cui, M.Jia, T.Lin, Y.Song, S.Belongie, "Class-Balanced Loss Based on Effective Number of Samples," in IEEE Conference on Computer Vision and Pattern Recognition, pp.9268-9277, 2019) proposed a balance cross entropy based on the effective number of samples (BENS) based on sampling theory:
[0069] BENS(p,y)=-log(pt )·α t_bens (y), (14)
[0070]
[0071] Where n(y) is the total number of samples. When γ is equal to 0, the BENS method is actually CE, and when γ is close to 1, the BENS method is close to BCEF.
[0072] In this embodiment, Init(y) and Rest(y) in formula (5) are set to the above α t_bens (y), defined as
[0073]
[0074] The above Init(y) and Rest(y) are combined with formulas (6) and (7) to obtain the dynamic balanced cross entropy DBENS based on the effective number of samples. In the initial stage of training, the importance of the large category is restricted and reduced according to the category frequency ratio. The degree of restriction is controlled by the overlap parameter γ. As the training progresses, the importance of the large category is gradually fully restored.
[0075] The loss functions obtained in the three embodiments of the present invention are applied to comparative experiments. For convenience, the loss functions obtained in the embodiments of the present invention are referred to as DRMCs.
[0076] Compared with traditional costs, the costs proposed in the embodiments of the present invention are dynamic functions of training iterations. Figure 2 The change process of the cost is shown. The cost function consists of two piecewise sub-functions (for clear expression, the embodiment of the present invention assumes that the frequency ratio of the class in each batch is fixed). The first sub-function is a constant function, and the second sub-function is a linearly increasing function. The difference between the three cost functions lies in the critical point of the piecewise sub-function and the slope of the linear increasing function. In the early stages of training, the cost of the large class is a very small value. In the later stages of training, the cost is an increasing function of training iterations. In this way, the importance of the large class can be gradually restored, which meets the dynamic demand for the degree of class importance during training. Using DRMC, the over-representation of small classes can be alleviated to a certain extent, and the importance of large classes will not be overly suppressed. In addition, in the later stages of training, the features of rare samples in large classes also have the opportunity to be learned into the model. Therefore, better classification capabilities can be achieved.
[0077] In the experiment of image salient object detection in the embodiment of the present invention, S4net is used as the basic network, and DRMCs are used to learn the classification of salient boxes and non-salient boxes. The embodiment of the present invention compares the DRMCs of the embodiment of the present invention with existing cost-sensitive losses, including OHEM (A.Shrivastava,A.Gupta,R.Girshick,“Training Region-based Object Detectors with Online Hard Example Mining,”in IEEE Conference onComputer Vision and Pattern Recognition,2016,pp.761-769,2016), FL (TYLin,P.Goyal,R.Girshick,K.He,and P.Dollar,“Focal Loss for Dense Object Detection,”in IEEE Conference on Computer Vision and Pattern Recognition,pp.2980-2988,2017), BCEF (R.Fan,MMCheng,Q.Hou,TJMu,J.Wang,and SMHu,“S4Net:Single StageSalient-Instance Segmentation,”in Proceedings ofthe IEEE InternationalConference on Computer Vision, pp.6096-6105, 2019), PF (J.Du, et.al, Parameter-FreeLoss for Class-Imbalanced Deep Learning, IEEE Transactions on Neural Networks and Learning Systems, 2021), CFL (Y.Zhao, F.Lin, S.Liu, Z.Hu, H.Li and Y.Bai, "Constrained-Focal-Loss Deep Based Learning for Segmentation of Spores,” IEEEAccess, pp.165029-165038, 2019) and BENS (Y.Cui, M.Jia, T.Lin, Y.Song, S.Belongie, "Class-Balanced Loss Based on Effective Number of Samples," in IEEE Conference on Computer Vision and Pattern Recognition, pp.9268-9277, 2019). These methods are proposed in salient target detection, object detection, image classification or semantic segmentation (FL is an instance-level cost-sensitive method, OHEM can be regarded as a combination of instance-level and class-level methods, and others belong to class-level cost-sensitive methods). The embodiments of the present invention use MAP0.5 (average precision when MIoU is greater than 0.5) and MAP0.7 to evaluate these methods. The embodiments of the present invention demonstrate the quantitative and qualitative results in detail. In particular, the embodiments of the present invention compare the impact of hyperparameters on the model performance between the dynamic losses (DBCEF / DCFL / DBENS) of the embodiments of the present invention and their corresponding static losses (BCEF / CFL / BENS). .
[0078] As shown in Table 1, among the existing methods, BCEF and OHEM perform better than other methods. For mAP0.5, BCEF is the best among the existing methods, while the three losses DRMCs in the embodiment of the present invention are significantly better than BCEF, among which DCFL exceeds BCEF by 1.4 percentage points. For mAP0.7, the three losses in the embodiment of the present invention are higher than the existing best performance (65.6% of OHEM).
[0079] Table 1. Comparison of mAP between DRMCs and existing methods on the ILSO dataset. (%)
[0080]
[0081] Figure 3 The three loss DRMCs of the embodiment of the present invention are compared with the existing methods. When using FL, a large number of non-significant boxes are mistakenly identified as salient boxes. In comparison, using OHEM, the error of misidentifying non-significant boxes as salient boxes is very obvious (see the 3rd and 4th images). For BCEF, it is very obvious to misclassify salient boxes as non-significant boxes (see the 1st and 3rd images) or misclassify non-significant boxes as salient boxes (see the 3rd and 4th images). For BENS and CFL, the main problem is the misidentification of salient boxes. As for DRMCs (the last 3 columns), these misclassification phenomena occur less frequently. The embodiment of the present invention attributes the advantages of DRMCs to the fact that the method of dynamically recovering the importance of large categories strikes a good balance between under-representation and over-representation of categories.
[0082] In order to illustrate the impact of hyperparameters on performance, the embodiment of the present invention compares the performance of DRMCs (DBCEF, DCFL and DBENS) with their basic methods (BCEF, CFL and BENS) when using the same hyperparameters, as shown in Table 2.
[0083] Table 2. Comparison of mAP of DRMCs and its basic methods on ILSO dataset. (%). (The methods marked with * are the methods of the present invention. Italics indicate the best performance of a certain method. Bold words indicate the best performance of DRMC method and its basic methods. k is the recovery parameter in BCEF and DBCEF, β is the constraint parameter in CFL and DCFL, and γ is the overlap parameter in BENS and DBENS.)
[0084]
[0085] The advantage of DBCEF over BCEF is clear. DBCEF outperforms BCEF regardless of the value of k. Specifically, when k = 0.5, DBCEF outperforms BCEF by 1.1 and 1.6 points for mAP0.5 and mAP0.5, respectively. The advantage of DCFL over CFL is also clear, regardless of its value of β. In particular, when β = 1.05, DCFL gains 2.0 and 2.7 points for mAP0.5 and mAP0.5, respectively. Similar comparisons can be seen for DBENS and BENS. When = γ 0.9999999, DBENS outperforms BENS by 1.3 and 2.5 points in mAP0.5 and mAP0.5, respectively. Therefore, DRMC's approach improves on existing class-level cost-sensitive methods without method and hyperparameter limitations.
[0086] In order to evaluate the generalization ability of the features learned in the above models, the embodiments of the present invention use these models to reason about Instance-MSRA1000. Compared with the available datasets, Instance-MSRA1000 has two obvious characteristics: (1) for most images, only one significant instance is included; (2) the background in Instance-MSRA1000 is more complex than that of the salient object detection dataset (i.e., the distribution of non-salient boxes is more complex). The quantitative and qualitative comparisons are shown in Tables 3 and 4, respectively. Figure 4 middle.
[0087] As can be seen from Table 3, when DBCEF is compared with its base method (BCEF), DBCEF outperforms BCEF. In addition, DCFL outperforms CFL by 0.5 and 1.1 points in Map0.5 and mAP0.7, respectively. Compared with BENS, DBENS improves by 1.5 points in mAP0.7. These improvements show that the model trained with DRMCs of the embodiment of the present invention has better generalization ability.
[0088] Table 3. Comparison of mAP between the method of the embodiment of the present invention and the existing method on the Instance-MSRA1000 dataset (%).
[0089]
[0090] from Figure 4 It can be seen that the main problem of the existing methods is the misidentification of non-salient boxes. This is because the non-salient classes in Instance-MSRA1000 are more complex than the aforementioned datasets, and the non-salient class features in the trained model cannot well represent the non-salient classes in the Instance-MSRA1000 dataset. In comparison, the detection and segmentation results of DRMCs (the last 3 columns) have been significantly improved, indicating that the features obtained in the model trained using the DRMC method have better generalization characteristics.
[0091] In the image semantic segmentation experiment, the embodiment of the present invention uses DeepLabv3+ as the basic network and uses MIoU (Mean Intersection over Union of the predicted set and the ground-truth set) to evaluate the performance of the method. The embodiment of the present invention compares the method of the embodiment of the present invention with existing cost-sensitive methods for image semantic segmentation, such as CE, FL, BCEF, PF, CFL and BENS (CE and FL are instance-level methods, and the others are class-level methods). In particular, the embodiment of the present invention compares in detail the DCFL of the embodiment of the present invention and its basic method CFL, as well as the DBENS of the embodiment of the present invention and its basic method BENS.
[0092] Table 4 shows the quantitative comparison between the proposed method and the existing methods. For the class-level methods, using DRMCs always leads to improved performance. Each method of the embodiment of the present invention outperforms its base method. DBCEF, DCFL, and DBENS outperform their corresponding base methods by 1.2, 0.9, and 2.3 points, respectively. Among all the methods, DBENS performs best with an MIoU of 70.6%.
[0093] Table 4. MIoU comparison (%) between DRMCs and state-of-the-art cost-sensitive imbalanced learning methods on PASCAL VOC 2012 AUGMENT variant.
[0094]
[0095] Figure 5 Qualitative comparison of DRMCs with existing methods is shown. For FL, CFL, and BENS, some target pixels are misclassified (see Figure 1 st and Figure 4 th), some background pixels are also misclassified (see Figure 2 nd), which means over-representation of small classes and under-representation of large classes. In contrast, the DCFL and DBENS methods significantly alleviate this problem (see Figure 2 nd), especially comparing BENS and DBENS, which means there is a better class-feature balance in the models trained with DRMCs.
[0096] Table 5. MIoU comparison (%) of DCFL and CFL with different constraint parameters on PASCAL VOC 2012 AUGMENT variant.
[0097]
[0098] Table 6. MIoU comparison (%) between DBENS and BENS under different overlap parameters γ on PASCAL VOC 2012 AUGMENT variants.
[0099]
[0100] In order to verify the effectiveness of DRMC, the embodiment of the present invention specifically compares the performance of the model using DRMC and not using DRMC under different hyperparameters, as shown in Tables 5 and 6 (the initial cost is calculated based on the average frequency ratio of large categories to small categories in the data set).
[0101] For DCFL and CFL, the embodiment of the present invention adjusts the constraint parameter β in the range of [1.5, 3.5] (the corresponding initial cost range is approximately [3.1, 13.6]). It can be seen that no matter what the parameter value β is, the MIoU of the model trained with DCFL is always higher than that trained with CFL. For DBENS and BENS, the embodiment of the present invention adjusts the overlap parameter γ in the range of [0.99995, 0.999999] (the corresponding initial cost range is about [1.5, 29.7]. It can be seen that no matter what the value of γ of DBENS is, DBENS is significantly better than BENS. When γ is 0.99999, DBEN performs best, with MIoU 2.6 points higher than BENS. More importantly, within the same hyperparameter range, the performance fluctuation range of DBENS is smaller than that of its base method. For example, when γ is in the range of [0.99995, 0.999998], the performance fluctuation range of BENS is 6.9, while the performance fluctuation range of DBENS is 2.0. Therefore, DBENS is insensitive to hyperparameters. This phenomenon can be explained by the fact that for DBENS, the dynamic recovery mechanism leaves a lot of room for the adjustment of training parameters, and then using DRMCs, the initial cost (determined by the hyperparameters) is less important than using those static methods.
[0102] In order to observe the dynamic changes of the model during the training process, the embodiment of the present invention tests the MIoU of the model on the test data set, such as Figure 6 As shown. In general, the MIoU curve of the model trained with DBENS is smoother than that of the model trained with BENS. It is worth noting that in the later stage of training, the embodiment of the present invention can see that there is a significant difference in the MIoU curve between DBENS and BENS. For BENS, the performance gradually decreases, especially when the value of the overlap parameter γ is large. For DBENS, under the same condition γ, overfitting of the model and the resulting performance degradation hardly occur.
[0103] The embodiment of the present invention also conducts experiments on the anthrax spore-1600 dataset. Table 7 shows the quantitative comparison between the method of the embodiment of the present invention and the existing methods. It can be seen that DBCEF, DCFL and DBENS are significantly better than their basic methods. Among all the methods, DBENS performs the best, reaching MIoU 91.7%.
[0104] Table 7. MIoU comparison (%) between DRMCs and existing cost-sensitive imbalanced learning methods on the Anthrax Spore-1600 dataset.
[0105]
[0106] Figure 7The qualitative comparison between the method of the present invention and the existing methods is shown. For instance-level methods, such as CE and FL, the main problem is that object pixels are incorrectly classified as background pixels, so the segmented objects are easily incomplete, as shown by the ellipse marks in the 3rd and 4th rows. For category-level methods, such as CFL and BENS, there are two obvious problems in the segmentation results. First, the area of the target in the segmentation result is generally larger than the area of the real target; second, when two targets are close but separated from each other, they are easily identified as one target, as shown by the ellipse marks in the 5th and 6th rows. Therefore, CFL and BENS cannot classify pixels around the object contour well (rare samples in large categories). Using the DRMCs of the embodiments of the present invention, these problems are greatly alleviated, as shown in the 7th and 8th rows.
[0107] Table 8 compares the performance of the model with and without DRMC under different hyperparameters. . The constraint parameter β is in the range of [1.5, 3.25], and the initial cost is approximately in the range of [3.3, 18.6]. It can be seen that DCFL is significantly better than CFL regardless of the parameter value β. The MIoU of CFL ranges from 86.4 to 91.0. While the MIoU of DCFL ranges from 89.8 to 91.3. Therefore, DCFL has a higher minimum MIOU, a higher maximum MIOU, and a smaller MIOU range. Table 9 shows the performance comparison of BENS and DBENS. The overlap parameter is set in the range of [0.γ999989, 0.9999999], and the initial cost is approximately in the range of [1.07, 29.24]. It can be seen that the comparison results are similar to those of DCFL and CFL. First, DBENS is significantly better than BENS regardless of the value γ of DBENS. Second, within the same parameter range γ, BENS’s MIoU ranges from 79.8 to 89.2, with a range of 9.1, while DBENS’s MIoU ranges from 91.1 to 91.7, with a range of 0.6.
[0108] Table 8. MIoU comparison (%) of CFL and DCFL with different constraint parameters on the β-anthrax spore-1600 dataset.
[0109]
[0110] Table 9. MIoU comparison (%) between BENS and DBENS under different γ overlap parameters on the anthrax spore-1600 dataset.
[0111]
[0112]
[0113] In order to observe the dynamic changes of model performance during training, we test the MIoU of the model on the test dataset. Figure 8 Figure 2 shows the changing trend of MIoU during the training iterations. In general, the MIoU curves of the models trained with DBENS are smoother than those trained with BENS. In the later stages of training (25,000 to 30,000 iterations), the MIoU of BENS did not continue to increase or decreased slightly; while the MIoU of DBENS continued to increase. In particular, when γ is set to 0.9999999, although the performance is low in the early stages of training, the MIoU tends to high performance in the later stages of training. We attribute this advantage of DBENS to the fact that the recovery mechanism of DRMC provides a lot of room for parameter adjustment during training.
[0114] From Tables 5, 6, 8, 9 and Figure 6 ,8, the embodiment of the present invention can conclude that the use of DRMC can bring about significant performance improvement. In addition, compared with the existing methods, the method using DRMC has stable performance and a small performance fluctuation range, so DRMC can facilitate the adjustment of hyperparameters.
[0115] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is limited by the attached claims rather than the above description, so it is intended to include all changes within the meaning and scope of the equivalent elements of the claims in the present invention. Although the principle of the present invention is described in detail above in conjunction with the preferred embodiments of the present invention, it should be understood by those skilled in the art that the above embodiments are only explanations of the exemplary implementation of the present invention, and are not limitations on the scope of the present invention. The details in the embodiments do not constitute limitations on the scope of the present invention. Without departing from the spirit and scope of the present invention, any obvious changes such as equivalent transformations, simple substitutions, etc. based on the technical solution of the present invention fall within the scope of protection of the present invention.
Claims
1. A loss function calculation method for dynamically recovering the importance of large categories in imbalanced learning, It is characterized in that It is implemented in two typical visual tasks, one of which is the salient object detection subtask of image salient instance segmentation, and the other is the image semantic segmentation task; salient instance segmentation is to segment the salient region and identify each instance, including two consecutive subtasks: salient object detection and salient segmentation; In the salient segmentation stage, the samples used for training are class-balanced. In the salient object detection stage, there is an extreme class imbalance between salient boxes and non-salient boxes, with a class frequency ratio of 1:1000. Imbalanced learning of deep neural network models for the salient object detection subtask; The unbalanced learning of the deep neural network model for the salient object detection subtask specifically includes: First, suppress the importance of large categories, and then gradually restore the importance of large categories. The calculation formula of the loss function based on this method is: CE DRMC (p,y,i)=-log(p t )·α t_drmc (y,i), (4) Wherein, p∈[0,1] is the class prediction probability of the sample, y is the label value of the sample, i is the number of training iterations, and p t is the predicted probability of the true category of the sample, the -log(p t )· is the cross entropy loss, the α t_drmc It is a dynamic cost function, which consists of 4 parts and is defined as follows: a t_drmc (y,i)=Init(y)·Acti(1 / Rest(y)·Grad(i)), (5) Wherein, Init(y) is the initial cost function for suppressing the importance of major categories, Rest(y) is the cost recovery function, Grad(·) is the progressively increasing function, Acti(·) is the activation function, and Rest(y), Grad(·) and Acti(·) jointly control the importance of restoring major categories; For formula (5), Init(y) and Rest(y) are the existing category-level cost functions; For formula (5), the activation function Acti(·) is: Wherein, x∈(-∞,+∞); For formula (5), the asymptotic function Grad(.) is: Grad(i)=i / M, (7) Where M is the maximum number of training iterations.
