Sample data category identification method, identification model, and training method therefor
Through the combination of multi-branch model integration and inverse distribution model, the problem of recognition model deviation caused by uneven distribution of training set data is solved, and the recognition accuracy of all categories is improved, especially the recognition ability of small sample categories.
Patent Information
- Application Number
- PCT/CN2024/079578
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-02
- Filing Date
- 2024-03-01
- Publication Date
- 2024-09-06
AI Technical Summary
In the existing technology, due to the uneven distribution of data in the training set, the recognition model is easily biased towards multi-sample categories during the training process, resulting in low recognition accuracy for few-sample categories.
Using a multi-branch model integration method, the training set is divided into multiple attention category subsets. Each branch model focuses on one subset and is trained through a preset loss function. The classifier parameters of the branch model are adjusted to improve the classification of few samples. The recognition ability of categories, combined with the inverse distribution model, eliminates recognition bias outside the subset of focused categories.
It improves the recognition accuracy of the recognition model for all categories, reduces the data imbalance, enhances the model's ability to recognize categories with few samples, and improves the overall recognition effect.
Smart Images

Figure CN2024079578_06092024_PF_FP
Abstract
Description
Sample data category identification method, identification model and training method thereof
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on the application with CN application number 202310226153.7 and application date March 2, 2023, and claims its priority. The disclosed content of the CN application is hereby introduced as a whole into this application. Technical Field
[0003] The present disclosure relates to the technical field of data classification, and in particular to a method for identifying a sample data category, a recognition model, and a training method thereof. Background Art
[0004] When using recognition models to identify the categories of sample data, most machine learning models are trained using training sets with a specific distribution. However, the distribution of the training set can affect the training of the recognition model. The recognition model will have better recognition capabilities for categories with a large number of samples in the training set.
[0005] In some common cases, the minority class samples make up the majority of the training set, while the majority class samples make up a smaller portion. This data distribution can lead to biased model training, causing the model to favor the recognition of the majority class and neglect the recognition accuracy of the minority class.
[0006] Summary of the Invention
[0007] In view of this, the embodiments of the present disclosure provide a training set recognition method, a recognition model and a training method thereof to solve the problem in the prior art that the recognition model has poor recognition accuracy due to uneven distribution of training set data.
[0008] According to the first aspect, an embodiment of the present disclosure provides a method for identifying sample data categories, the method comprising: inputting an input sample to be identified into a recognition model, wherein the multiple recognition models are obtained by integrating multiple sub-models, the multiple sub-models include multiple branch models, the branch models are trained using a preset loss function through the full data of the training set, each branch model focuses on a subset of focus categories corresponding to each branch model in the full data, and the focus category subset is at least one category among the multiple categories in the full data; according to the output of the recognition model, identifying the category to which the input sample belongs.
[0009] In combination with the first aspect, in the first embodiment of the first aspect, before the input sample to be identified is input into the training recognition model, the method also includes: dividing the full data into focus category subsets corresponding to the multiple branch models according to the number of the multiple branch models, wherein the multiple branch models correspond one-to-one to the focus category subsets, and the number of samples in each focus category subset is within a preset sample number range; training the multiple branch models according to the full data, and during the training process, training the branch models through a preset loss function; integrating the multiple branch models to obtain a recognition model.
[0010] In combination with the first aspect, in the second embodiment of the first aspect, the multiple sub-models also include: an inverse distribution model, and the method also includes: based on the full amount of data, training the inverse distribution model through a preset loss function, wherein the preset loss function is determined by the inverse distribution coefficient; integrating the inverse distribution model and multiple branch models to obtain the recognition model.
[0011] In combination with the first aspect, in the third embodiment of the first aspect, based on the full data, the inverse distribution model is trained through a preset loss function, including: determining the boundary distance between the category of the target sample label and the target category based on the logarithm of the ratio of the number of samples of the target category to the number of samples of the target sample label, and the inverse distribution coefficient; and adjusting the interval boundary of the category identified by the inverse distribution model based on the boundary distance.
[0012] In combination with the first aspect, in the fourth embodiment of the first aspect, the multiple sub-models are trained using a preset loss function in the following manner: a loss function is created based on the classifier output data and first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and second adjustment data corresponding to the target category of the sub-model, wherein the target sample label is one of the multiple sample labels of the input sample, and the target category is one of the multiple categories in the full data; the sub-model is trained using the loss function until the model converges.
[0013] In combination with the fourth embodiment of the first aspect, in the fifth embodiment of the first aspect, before creating the loss function based on the classifier output data and first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and second adjustment data corresponding to the target category of the sub-model, the method also includes: calculating the first adjustment data based on the first adjustment function and the classifier output data corresponding to the target sample label; calculating the second adjustment data based on the second adjustment function and the classifier output data corresponding to the target category; the first adjustment function and the second adjustment function are the same function.
[0014] In combination with the fourth embodiment of the first aspect, in the sixth embodiment of the first aspect, training the sub-model through a preset loss function includes: determining the boundary distance between the category of the target sample label and the target category based on the difference between the first adjustment data and the second adjustment data; and adjusting the interval boundary of the category recognized by the sub-model based on the boundary distance.
[0015] In combination with the sixth embodiment of the first aspect, in the seventh embodiment of the first aspect, determining the boundary distance between the category of the target sample label and the target category based on the difference between the first adjustment data and the second adjustment data includes at least one of the following: in response to the target category and the target sample label both belonging to the focus category subset of the branch model, the boundary distance is determined based on the ratio of the number of samples of the target category to the number of samples of the sample label, and taking the logarithm; in response to the target category not belonging to the focus category subset of the branch model, the target sample label belongs to the focus category subset, and the boundary distance is determined based on the logarithm of the ratio of the maximum number of samples in each category in the training set to the number of samples of the target sample label, wherein the boundary distance is greater than 0; in response to the target category belonging to the focus category subset of the branch model, the target sample label does not belong to the focus category subset, and the boundary distance is determined based on the logarithm of the ratio of the maximum number of samples in each category in the training set, wherein the boundary distance is less than 0; in response to the target category and the target sample label both not belonging to the focus category subset of the branch model, the boundary distance is determined to be 0.
[0016] In combination with the sixth embodiment of the first aspect, in the eighth embodiment of the first aspect, adjusting the interval boundary of the category recognized by the sub-model according to the boundary distance includes: adjusting the weights of the category corresponding to the target category and the target sample label according to the boundary distance to adjust the interval boundary of the category recognized by the sub-model.
[0017] In combination with the eighth embodiment of the first aspect, in the ninth embodiment of the first aspect, after the weights of the categories corresponding to the target category and the target sample label are adjusted according to the boundary distance to train the category intervals of the focus category subset, the method also includes: during the iteration process of the branch model, according to the adjusted weights of the categories corresponding to the target category and the target sample label, adjusting the classifier parameters of the branch model, wherein the weights are the classifier parameters of the branch model, and the adjusted weights make the classifier pay more attention to the focus category subset; performing iterative training according to the adjusted classifier parameters; in response to reaching the preset iteration termination condition, completing the training of the branch model; in response to not reaching the preset iteration termination condition, continuing to select target categories and target sample labels to continue training the branch model.
[0018] According to the second aspect, an embodiment of the present disclosure provides a method for training a recognition model of a sample data category, the method comprising: obtaining multiple branch models by training with a preset loss function using the full data of a training set, wherein each branch model focuses on a subset of focus categories corresponding to each branch model in the full data, and the focus category subset is at least one category among multiple categories in the full data; integrating multiple sub-models including the multiple branch models to obtain a recognition model, wherein the recognition model is used to identify the input sample and determine the category to which the input sample belongs.
[0019] According to the third aspect, an embodiment of the present disclosure provides a recognition model for sample data categories, including: multiple sub-models, and an integration module; the multiple sub-models include multiple branch models, and the branch models are trained based on the full data of the training set using a preset loss function, and each of the branch models focuses on a subset of focus categories corresponding to each branch model in the full data, and the focus category subset is at least one category among the multiple categories in the training set; the integration module is connected to the outputs of the multiple sub-models, and is used to integrate the output data of the multiple sub-models to obtain the final recognition result.
[0020] According to a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which is used to store a program, wherein the program executes the method for identifying a sample data category or the method for training a recognition model for a sample data category described in any one of the embodiments of the first aspect above.
[0021] According to the fifth aspect, an embodiment of the present disclosure provides a computer terminal comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for identifying the sample data category or the method for training the recognition model of the sample data category described in any one of the embodiments of the first aspect above.
[0022] According to the sixth aspect, an embodiment of the present disclosure provides a computer program, comprising: instructions, which, when executed by a processor, enable the processor to execute the method for identifying a sample data category described in any one of the embodiments of the first aspect above, or the method for training a recognition model for a sample data category. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:
[0024] FIG1 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure;
[0025] FIG2 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure;
[0026] FIG3 shows a schematic diagram of a sample data category identification network structure according to an embodiment of the present disclosure;
[0027] FIG4 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure;
[0028] FIG5 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure;
[0029] FIG6( a ) shows a schematic diagram of adjusting the category weight according to the boundary distance when the target sample label belongs to the focus category subset in an embodiment of the present disclosure;
[0030] FIG6( b ) shows a schematic diagram of adjusting the category weight according to the boundary distance when the target sample label does not belong to the focused category subset according to an embodiment of the present disclosure;
[0031] FIG7 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure;
[0032] FIG8 shows a flow chart of a method for training a recognition model of a sample data category according to an embodiment of the present disclosure;
[0033] FIG9 shows a schematic diagram of a recognition model for sample data categories according to an embodiment of the present disclosure;
[0034] FIG10 shows a schematic diagram of a computer terminal according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0036] As mentioned earlier, the sample data of minority categories in the training set occupy the majority, while the number of samples of majority categories occupies a small part, which leads to deviation in model training, making the model biased towards the recognition of multi-sample categories, thereby ignoring the recognition accuracy of minority sample categories.
[0037] This will lead to a bias in the recognition ability of the model when training the recognition model, and the recognition accuracy of the obtained recognition model is low. In this regard, a better technical solution is needed.
[0038] The training set can be a dataset with a certain distribution. Generally speaking, natural datasets are not evenly distributed across multiple categories. More common is a long-tail distribution of data, that is, a few categories have a large number of samples, which are called head categories, while most categories have a small number of samples, which are called tail categories.
[0039] Typically, the number of samples in the head category differs by several times, or even dozens or even hundreds of times, from the number of samples in the tail category. Due to this large disparity in sample numbers between different categories, long-tail data, during normal model training, often results in a model with better recognition capabilities for the head category and poorer recognition capabilities for the tail category, or even inability to effectively recognize data samples in the tail category.
[0040] Many methods in related technologies alleviate the recognition problem of long-tail data and improve recognition accuracy on uniform test sets. These methods primarily employ specific methods during recognition model training to ensure that the model has good recognition capabilities across all categories of long-tail data. These methods specifically fall into the following three categories:
[0041] The first category is category rebalancing, which mainly involves two aspects: one is undersampling the multi-sample category or oversampling the small-sample category, and the other is weighting different categories or samples.
[0042] The second category is the method of splitting the representation model and the classification model to avoid the impact of rebalancing on the representation model.
[0043] The third category is the integration method, which uses different branch models and fuses the results of different branch models to improve the recognition effect of long-tail data. The specific approach is to input different local data into different branches and then fuse them. This can reduce the imbalance. However, the branches trained with different local data are in different feature spaces, and how to fuse different feature spaces is a difficult problem.
[0044] To this end, this embodiment proposes a method for identifying sample data categories, which mainly adopts the method of multi-branch model integration to further improve the fusion effect by enriching the diversity of the category subsets that different branch models focus on. The input data of each branch model is the full data of the training set, so that the feature space of each branch can be kept consistent to facilitate subsequent fusion. By designing the loss function, different branch models can focus on different category subsets. In this way, each branch model will reduce the imbalance of the data and improve the recognition effect of each branch model for the category subset it focuses on. Finally, by fusing different branch models, the recognition model has a good recognition effect on all categories in the training set, thereby improving the overall recognition effect.
[0045] In some embodiments, the training set is first divided into multiple category subsets based on the number of branch models. Each of these category subsets is then assigned to each branch model as the corresponding category subset of interest. The category subsets of interest for the multiple branch models do not overlap; the category subsets of interest for all branch models together constitute all categories in the training set. This ensures that all categories in the training set are effectively trained, and the resulting recognition model exhibits good recognition capabilities for all categories in the training set.
[0046] A loss function is constructed based on the adjustment function. The loss function is determined by the ratio of the output data of the input sample to the total output data of each category. Depending on whether the input sample and different categories belong to the subset of categories of interest of the branch model, different adjustment methods are set according to the adjustment function to train the subset of categories of interest of the branch model. In other words, the branch model's attention to different categories is adjusted.
[0047] Based on the adjustment function and the sample labels of the input samples, that is, the classifier output data corresponding to the target sample labels, the output data of the input samples is constructed. Based on the adjustment function and the output data of the classifiers corresponding to each category, the total output data of each category is constructed. This enables the loss function to adjust the attention of different categories within and outside the subset of the focus category according to the number of samples.
[0048] By modifying the loss function, we can determine the deflection distance between the target class and the target class, also known as the boundary distance. Using this boundary distance, we adjust the weights between the target class and the target class, thereby adjusting the boundary between classes. This allows the branching model to focus more on optimizing the recognition of classes within the corresponding subset of classes.
[0049] Training a branching model requires input from the full training set. Using a constructed loss function, the branching model's ability to specifically improve category recognition within a subset of focused categories can be improved. By integrating multiple branching models, a recognition model with high recognition capabilities for all categories is ultimately obtained.
[0050] Furthermore, considering that neither the target sample label nor the target category belongs to the branch model's subset of focused categories, the imbalance in the number of samples across categories can lead to recognition bias in the branch model for categories outside the subset of focused categories. To mitigate this bias, this embodiment also provides an inverse distribution model, which is trained and optimized using the full data set of the training set.
[0051] The sample data category identification method and the sample data category identification model training method provided in this specification can be applied to a computer system or a processing module in a computer system with data computing and data communication functions. The sample data category identification model training method provided in this specification can be applied to electronic devices installed in a computer system.
[0052] The electronic device may include a notebook, a desktop computer, a smart phone, a smart wearable device (virtual reality glasses, smart watches, etc.), a tablet computer, etc. Of course, the training method of the recognition model of the sample data category provided in this specification can also be applied to the application running in the above-mentioned electronic device. For example, the recognition method of the sample data category and the training method of the recognition model of the sample data category can be applied to a browser with an instant messaging function, and can also be applied to an instant messaging software.
[0053] In some embodiments, the training set may be an image dataset, the recognition model may be an image recognition model, and an image may be a data sample. Multiple image categories in the training set may be pre-classified, and the sample data category recognition method of this embodiment can effectively identify the category to which a particular image belongs.
[0054] FIG1 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure. As shown in FIG1 , according to a first aspect, an embodiment of the present disclosure provides a method for identifying a sample data category, the method comprising the following steps:
[0055] Step S101: Input the input sample to be identified into the recognition model, wherein the recognition model is obtained by integrating multiple sub-models, wherein the multiple sub-models include multiple branch models, and the branch models are trained using the full data of the training set using a preset loss function. Each branch model focuses on a corresponding subset of interest categories in the full data, and the interest category subset is at least one category among multiple categories in the full data;
[0056] Step S102: Identify the category to which the input sample belongs based on the output of the recognition model.
[0057] Because the branching model is trained using the full training set data using a preset loss function, it has high recognition capabilities for a subset of focused categories. The recognition model, resulting from the integration of multiple branching models, has good recognition capabilities for all categories in the training set. Using this recognition model to identify input samples achieves higher recognition accuracy.
[0058] The number of the above-mentioned multiple branch models is two or more. In some embodiments, before inputting the input sample to be identified into the trained recognition model, the method further includes: dividing the full amount of data of the training set into focus category subsets corresponding to the multiple branch models according to the number of branch models, wherein the branch models correspond one-to-one to the focus category subsets, and the number of samples in each focus category subset is within a preset sample number range, so that the number of samples contained in each focus category subset is approximately the same.
[0059] It should be noted that, in some embodiments, the subsets of attention categories corresponding to the various branch models have no intersection, and the union of the subsets of attention categories corresponding to multiple branch models constitutes the full data of the training set.
[0060] When partitioning the entire training set, you can sort all categories based on the number of samples in each category, grouping multiple categories with similar sequences into the same focused category subset. This ensures that the number of samples across multiple categories in the same focused category subset is as evenly distributed as possible, avoiding large differences in the number of samples across multiple categories within the same focused category subset, which could lead to discrepancies in recognition performance for different categories in the branch model trained on the focused category subset.
[0061] In some embodiments, in this embodiment, the full amount of data is divided. On the basis of dividing the subsets of categories of interest according to the number of branch models, it is necessary to consider not only the number of samples in the subsets of categories of interest, but also the distribution of the number of samples in the categories of interest. For example, there are two branch models, and the full amount of data in the training set has 10 categories. The number of samples of each category can be combined to divide the top 3 categories into one subset, and the bottom 7 categories into another subset. In this way, the imbalance of the data in each subset will be significantly reduced, which is conducive to the branch model to achieve targeted recognition optimization for each subset.
[0062] Then, multiple branch models are trained based on the full data of the training set. During the training process, the branch models are trained through a preset loss function so that the branch models focus on the corresponding subset of attention categories; after the training of multiple branch models is completed, the multiple branch models are integrated to obtain a recognition model.
[0063] The above steps utilize an integration approach with multiple branch models. By diversifying the subsets of categories that each branch model focuses on, the recognition accuracy of the fused model is improved. Each branch model receives the full training set as input, and the loss function is designed to ensure that different branch models focus on different subsets of categories.
[0064] By dividing the full data of the training set into focus category subsets corresponding to multiple branch models, the distribution imbalance of the data in the focus category subset corresponding to each branch model will be reduced compared to the distribution imbalance of the full data of the training set, thereby improving the recognition effect of the branch model in the focus category subset, and finally improving the overall recognition effect by fusing different branches.
[0065] Due to the uneven distribution of the training set data mentioned above, when training the recognition model in the related art, the recognition model will be more biased towards the category with a larger number of samples, which will lead to a lower overall recognition accuracy of the recognition model. Compared with the method of using multiple branch models in the related art and inputting different local data into different branch models for post-training fusion, the embodiment of the present disclosure uses full data input into the branch model, and through the design of the loss function, different branch models are made to focus on different category subsets. This will reduce the imbalance of data in the focused category subsets, improve the recognition effect in the corresponding category subsets, and at the same time have a better fusion effect, thereby having better recognition performance.
[0066] By feeding the full data into the branch models, each branch model resides in the same feature space, facilitating subsequent integration and fusion of multiple branch models, improving fusion effectiveness. Compared to scenarios where branch models reside in different feature spaces, the recognition results of each branch model in the same feature space for its respective subset of focused categories can be more effectively integrated into the recognition model.
[0067] By presetting the corresponding loss function, each branch model can focus on the corresponding focus category subset of the branch model, so that the branch model has better recognition ability for the categories in the focus category subset. Finally, the recognition model obtained through integrated fusion has better recognition ability for all data categories.
[0068] The above method divides the entire training set data into subsets of focused categories corresponding to multiple branch models. The subsets of focused categories are obtained by dividing the number of branch models based on the number of categories and samples in the training set. During the training of the branch models, the loss function can be set to enable the branch models to have better recognition capabilities for multiple categories in the subset of focused categories. Therefore, the set of multiple categories corresponding to the branch models can be called the subset of focused categories, and the branch models can also be said to focus on multiple categories of the subset of focused categories.
[0069] Since the branch models are trained with the full data of the training set, during the training process of the branch models, the boundary intervals of each category in the training set can also be adjusted accordingly by using the setting of the loss function.
[0070] In some embodiments, the aforementioned adjustment of the boundary intervals of each category in the training set can adjust the boundary category intervals of the focused category subset, that is, the boundary intervals of the starting category and the boundary intervals of the ending category that constitute the focused category subset. The boundary intervals of different categories within the focused category subset can also be adjusted. The boundary intervals of different categories outside the focused category subset can also be adjusted.
[0071] The full data includes multiple categories of the training set and samples of each category. Each branch model corresponds to a subset of the focus categories, and the number of samples in each subset of the focus categories is within the preset sample number range.
[0072] The number of samples of the category subset that each branch model focuses on is within the preset sample number range, so that each branch model can focus on an appropriate number of samples during training, so that the final training results and recognition accuracy of different branch models can be guaranteed to be basically consistent, which is convenient for subsequent integration and ensures the overall recognition accuracy of the integrated recognition model.
[0073] The entire data of the training set is input into the branch model for training to ensure that the feature spaces of different branch models are consistent, to facilitate the fusion of branch models after subsequent training is completed, and to further improve the recognition effect of sample data of all categories in the training set.
[0074] During the training process, the branch model is optimized within the category range of the focus category subset based on a preset loss function. The above loss function is set to make the classifier of the branch model pay more attention to the corresponding focus category subset. The specific content of the loss function will be explained later.
[0075] The loss function can be used to optimize the boundary interval of the focus category subset, and then update the classifier parameters of the branch model, so that the classifier of the branch model has better recognition ability for the categories of the focus category subset.
[0076] The subset of attention categories here is at least one category among multiple categories in the training set, usually multiple categories.
[0077] An accurate and efficient loss function is set for each branch model, ensuring that even after the full data set is fed into different branch models, the branch models still maintain good recognition capabilities for data categories within the subset of categories of interest. After training multiple branch models, they are integrated to form a recognition model. Because the multiple branch models reside in the same feature space, the integration achieves a good fusion effect, resulting in good recognition capabilities for all data categories in the training set.
[0078] FIG2 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure. As shown in FIG2 , the multiple sub-models further include an inverse distribution model. The method further includes:
[0079] Step S201: Based on the full data, the inverse distribution model is trained using a preset loss function, wherein the preset loss function is determined by the inverse distribution coefficient;
[0080] Step S202: Integrate the inverse distribution model and multiple branch models to obtain a recognition model.
[0081] The aforementioned multiple branch models focus on different category subsets respectively. However, during the optimization process, data outside the category subset corresponding to each branch model also participates in the training of the branch model, which will cause the branch model to have recognition bias in categories outside the category subset.
[0082] In order to solve this problem, the embodiment of the present disclosure sets up an inverse distribution model, determines the preset loss function through the inverse distribution coefficient, and trains the inverse distribution model using the full data of the training set to weaken the recognition bias of each branch model in categories outside the corresponding focus category subset, thereby further improving the recognition accuracy of the integrated recognition model.
[0083] It should be noted that it is understandable that the subset of attention categories corresponding to the inverse distribution model includes all categories in the training set.
[0084] In some embodiments, the sub-model of the recognition model includes two branch models and an inverse distribution model.
[0085] FIG3 shows a schematic diagram of the network structure of the sample data category recognition model according to an embodiment of the present disclosure. The overall network structure is shown in FIG3. First, f θ Represents the model parameters of the backbone network corresponding to each sub-model, Ψ θ Represents the model parameters of each sub-model.
[0086] It should be noted that the backbone networks corresponding to the various sub-models can be the same or independent. For example, the backbone networks corresponding to the various sub-models have the same network structure but different network parameters, or the backbone networks corresponding to the various sub-models have the same network structure and network parameters. This disclosure does not limit this.
[0087] In the disclosed embodiments, a recognition model submodel comprising two branch models and an inverse distribution model is used as an example. Each branch model focuses on a different subset of interest categories during training. The number of branch models can vary depending on the number of divided subsets of interest categories, or can be pre-set.
[0088] In order to show the effect of this embodiment, the bi-norm values of the weights of the classifiers of different branch models are shown in the form of a bar chart in Figure 3. The larger the bi-norm value, the better the optimization for this category. It can be seen that different branches do focus on different category subsets.
[0089] In some embodiments, based on the full amount of data, training the inverse distribution model through a preset loss function includes: determining the boundary distance between the category of the target sample label and the target category based on the ratio of the number of samples of the target category to the number of samples of the target sample label, taking the logarithm, and the inverse distribution coefficient; and adjusting the interval boundary of the category identified by the inverse distribution model based on the boundary distance.
[0090] The boundary distance is calculated by the inverse distribution coefficient, and the inverse distribution model is trained so that the inverse distribution model can effectively weaken the recognition bias of the branch model for categories outside the subset of focus categories.
[0091] FIG4 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure. As shown in FIG4 , training a sub-model using a preset loss function includes:
[0092] Step S401, creating a loss function based on the classifier output data corresponding to the target sample label of the sub-model and the first adjustment data, the classifier output data corresponding to the target category of the sub-model and the second adjustment data, wherein the target sample label is one of multiple sample labels of the input sample, and the target category is one of multiple categories in the training set;
[0093] Step S402: Train the sub-model using the loss function until the sub-model converges.
[0094] In some embodiments, before creating the loss function based on the classifier output data of the sub-model in the target sample label and the first adjustment data, and the classifier output data of the sub-model in the target category and the second adjustment data, the method also includes: calculating the first adjustment data based on the first adjustment function and the classifier output data of the target sample label; calculating the second adjustment data based on the second adjustment function and the classifier output data of the target category.
[0095] The first adjustment data is calculated according to the first adjustment function, and the second adjustment data is calculated according to the second adjustment function, so as to create a loss function according to the first adjustment data and the second adjustment data. The loss function with the first adjustment data and the second adjustment data is used to optimize the recognition ability of the recognition model for the subset of the focus category.
[0096] In some embodiments, the first adjustment function and the second adjustment function may be the same adjustment function. In this embodiment, a logarithmic function log() is used as the adjustment function. For the first adjustment data and the second adjustment data, the same logarithmic function is used as the adjustment function, but the corresponding input data are different.
[0097] For the k-th sub-model, the following loss function is used:
[0098] In the formula, p(x i ,k) represents the input sample x i In the loss function of the kth sub-model, v yi Represents the input sample x i The sample label y i The corresponding classifier output, v j represents the output of the classifier for class j, and T() represents the adjustment function.
[0099] The above loss function p(x i ,k) Based on the input sample x iOutput data and total output data for categories 1 to C In some embodiments, the ratio of the adjustment function T() and the input sample x is determined. i The sample label y i , that is, the target sample label y i The corresponding classifier output data v yi , construct the output data of the input sample According to the adjustment function T() and the classifier output data v of each category j j , construct the output data of each category j Construct the total output data based on the output data of each category
[0100] The output data of the input sample is, the input sample x i The sample label y i The corresponding classifier output v yi , and the input sample x i The first adjustment data T(k,y i ) as the exponent, with base e as the result.
[0101] The output data of the jth category is, the classifier output v corresponding to the jth category j , and the second adjustment data T(k,j) of the j-th category are used as the exponent, and the result is obtained with e as the base.
[0102] Both the first adjustment data and the second adjustment data can be calculated by the adjustment function T().
[0103] Where n j Represents the number of samples in the jth category, n max represents the maximum number of samples in all categories, K represents the total number of sub-models, C k represents the subset of attention categories of the kth sub-model, τ represents the inverse distribution coefficient, where τ>1.
[0104] In some embodiments, according to the first adjustment function and the second adjustment function, each sub-model increases the recognition weight of categories belonging to the subset of categories of interest, or decreases the recognition weight of categories not belonging to the subset of categories of interest.
[0105] In some embodiments, the process for calculating the first adjusted data based on the first adjustment function and the classifier output data corresponding to the target sample label is the same as the process for calculating the second adjusted data based on the second adjustment function and the classifier output data corresponding to the target category. For ease of presentation, the process for calculating the second adjusted data based on the second adjustment function and the classifier output data corresponding to the target category is described in detail below.
[0106] Calculating the second adjustment data based on the classifier output data corresponding to the second adjustment function and the target category includes: for the case where the sub-model is a branch model, when the target category belongs to the focus category subset of the branch model, taking the logarithm of the number of samples of the target category to determine the second adjustment data.
[0107] According to the second adjustment function, for the branch model, when the target category belongs to the subset of the focus category, it is adjusted according to its sample number, so that the branch model is more biased towards identifying the target category when the sample number of the target category is smaller.
[0108] If the target category does not belong to the subset of categories targeted by the branching model, the second adjustment data is determined by taking the logarithm of the maximum number of samples in each category in the training set, where the maximum number of samples is the number of samples in the category with the most samples among the multiple categories in the training set. If the target category does not belong to the subset of categories targeted by the branching model, the maximum number of samples is used for adjustment, so that the branching model weakens the recognition optimization of the target category during the training process.
[0109] In the case where the sub-model is an inverse distribution model, the second adjustment data is determined based on the logarithm of the number of samples of the target category and the inverse distribution coefficient. In some embodiments, within the scope of the full amount of data, during the inverse distribution model training process, the optimization strength of its recognition ability for a certain category is inversely correlated with the number of samples of a certain category, that is, the inverse distribution is achieved from the perspective of the loss function. Among them, the inverse distribution coefficient is greater than 1, and the setting of the inverse distribution coefficient can be used to further enhance the optimization strength of the inverse distribution model's recognition ability for categories with a smaller number of samples in the full amount of data during the training process.
[0110] For the branching model, deviations will occur when identifying categories outside its corresponding subset of focused categories. However, using the loss function determined in the above manner to train and optimize the inverse distribution model can effectively alleviate the recognition bias of the branching model for categories outside the subset of focused categories.
[0111] FIG5 shows a flow chart of a method for identifying sample data according to an embodiment of the present disclosure. As shown in FIG5 , training a sub-model using a preset loss function includes:
[0112] Step S501, determining the boundary distance between the category of the target sample label and the target category based on the difference between the first adjustment data and the second adjustment data;
[0113] Step S502: adjusting the interval boundary of the category identified by the sub-model according to the boundary distance.
[0114] Through the above steps, the boundary distance function is calculated according to the first adjustment function and the second adjustment function, and the boundary distance is calculated according to the boundary distance function, so that the boundary distance is calculated quickly and accurately, and the efficiency of data processing and calculation is improved.
[0115] With the above loss function p(x i ,k) as an example, by dividing the numerator and denominator by e, T(k,y i ) power, the above loss function is transformed into the following formula:
[0116] In the denominator of formula (1), the first adjustment data T(k, y) is subtracted from the second adjustment data T(k, j) i ), denoted as M(y i ,j,k), as the boundary distance function.
[0117] In some embodiments, the boundary distance is determined based on the boundary distance function, and the branch model is trained so that the branch model places more emphasis on identifying target categories with fewer samples in the focus category subset or categories corresponding to target sample labels. Alternatively, the branch model places more emphasis on categories corresponding to target sample labels belonging to the focus category subset. This also allows the inverse distribution model to effectively eliminate bias caused by categories outside the focus category subset. This overall approach allows the branch model to place greater emphasis on identifying categories within the focus category subset.
[0118] In some embodiments, calculating the boundary distance according to the boundary distance function includes: for the case where the sub-model is a branch model, when the target category and the target sample label both belong to the focus category subset of the branch model, the boundary distance is determined based on the ratio of the number of samples of the target category to the number of samples of the sample label, and taking the logarithm.
[0119] According to the boundary distance function, for the branch model, when the target category and the category corresponding to the target sample label both belong to the subset of the focus category, adjustment is made according to the ratio of their sample numbers, and the recognition of the target category or the category corresponding to the target sample label is given more emphasis, so that the branch model is more inclined to the recognition of the target category or the category corresponding to the target sample label with a smaller number during the learning process.
[0120] When the target category does not belong to the subset of the attention category of the branch model, and the target sample label belongs to the subset of the attention category, the boundary distance is determined by taking the logarithm of the ratio of the maximum number of samples in each category in the training set to the number of samples of the target sample label, where the boundary distance is greater than or equal to 0.
[0121] When the target category does not belong to the subset of the focus category, and the category corresponding to the target sample label belongs to the subset of the focus category, the boundary distance is determined by taking the logarithm of the ratio of the maximum number of samples in each category in the training set to the number of samples of the target sample label. The boundary distance is greater than or equal to 0, so that the branch model is more biased towards the category corresponding to the target sample label belonging to the subset of the focus category.
[0122] When the target category belongs to the subset of the attention category of the branch model and the target sample label does not belong to the subset of the attention category, the boundary distance is determined by taking the logarithm of the ratio of the number of samples of the target category to the maximum number of samples of each category in the training set, where the boundary distance is less than or equal to 0.
[0123] When the target category belongs to the subset of the attention category and the target sample label does not belong to the subset of the attention category, the boundary distance is determined by taking the logarithm of the ratio of the number of samples of the target category to the maximum number of samples of each category in the training set. The boundary distance is less than or equal to 0, which makes the branch model more biased towards the target category belonging to the subset of the attention category.
[0124] In the case that neither the target category nor the target sample label belongs to the attention category subset of the branch model, the boundary distance is determined to be 0.
[0125] When the target category and the target sample label do not belong to the subset of the branch model's focus category, the boundary distance is determined to be 0. At this time, the branch model is more biased towards the category with a larger number of samples, which is the original ability of the branch model.
[0126] For the case where the sub-model is an inverse distribution model, the boundary distance is determined based on the ratio of the number of samples of the target category to the number of samples of the target sample label, taking the logarithm, and the inverse distribution coefficient.
[0127] For the inverse distribution model, the ratio of the number of samples of the target category to the number of samples of the target sample label and the inverse distribution coefficient are adjusted so that the inverse distribution model can effectively weaken the deviation caused by categories outside the subset of the focus category.
[0128] FIG7 shows a flow chart of a method for identifying a sample data category according to an embodiment of the present disclosure. As shown in FIG7 , based on step S402, this embodiment adjusts the interval boundary of the category identified by the sub-model according to the boundary distance, including:
[0129] Step S701 : adjusting the weights of the target category and the category corresponding to the target sample label according to the boundary distance, so as to adjust the interval boundary of the category recognized by the sub-model.
[0130] The sub-model includes a classifier, which in some examples may include a fully connected layer. The class weights in the fully connected layer of the sub-model classifier are adjusted based on the boundary distance so that the classifier is more biased towards identifying categories in the corresponding subset of the focused categories.
[0131] Figure 6 shows the decision boundary of the branch model in different scenarios. The decision boundary is used to distinguish the interval boundary of the category recognized by the branch model. If the decision boundary shifts, the corresponding interval boundary will also change. Among them, Figure 6(a) shows the target sample label y i The corresponding category belongs to C k In the case of yi =cosθ j , the dotted line +m and the dotted line -m respectively indicate that the target category j belongs to C k There are three cases of decision boundaries when the dotted line + m' indicates that the target category j does not belong to C k The decision boundary when , in extreme cases, the dotted line cosθ will also occur yi =cosθ j The decision boundary of ; Figure 6(b) shows the target sample label y i The corresponding category does not belong to C k In the case of , the dotted line -m represents the decision boundary when the target category j belongs to Ck. In extreme cases, the dotted line cosθ will also occur yi =cosθ j The decision boundary of yi =cosθ j Indicates that the target category j does not belong to C k The decision boundary when .
[0132] In some embodiments, FIG6(a) also shows a schematic diagram of adjusting the category weight according to the boundary distance when the target sample label of the embodiment of the present disclosure belongs to the subset of the category of interest; FIG6(b) also shows a schematic diagram of adjusting the category weight according to the boundary distance when the target sample label of the embodiment of the present disclosure does not belong to the subset of the category of interest; w in FIG6(a) and FIG6(b) yi The classifier of the k-branch model is used to identify y i The weight of the corresponding category, w j Refers to the weight of the classifier of the k-branch model when identifying the j target category. i ,j,k) represents the boundary distance between two categories and determines the bias of the interface between the two categories. As shown in Figure 6(a) and Figure 6(b),
[0133] 1. The M function of formula (2) (also known as M(y i ,j,k) function), Equation 2-1 represents when the target sample label y i and target category j both belong to C k In the case of, the value of M function, C k That is, the subset of categories that the k-th branch model focuses on.
[0134] If the number of samples of target category j is n j Greater than the target sample label y i The number of samples n yi , then the value of the M function is greater than 0, and the category with fewer samples will be optimized more. Specifically, in the process of branch model training, more emphasis is placed on the recognition optimization of the category with fewer samples. The interface between the two categories is shown as the dotted line + m in Figure 6(a). For the target sample label y i The corresponding categories have better optimization.
[0135] If the number of samples of target category j is n j Less than the target sample label y i The number of samples n yi , then the value of the M function is less than 0, and the interface between the two categories is shown as the dotted line -m in Figure 6(a), which has better optimization for the target category.
[0136] Regardless of whether the emphasis is on optimizing the recognition of the category corresponding to the target sample label or optimizing the recognition of the target category, it is all about optimizing the recognition of the subset of categories of interest of the branch model.
[0137] If the number of samples of target category j is n j Equal to the target sample label y i The number of samples n yi , then the value of the M function is equal to 0. At this time, the dividing line is in the middle of the two categories. The optimization at this time depends on the number of samples of the two categories themselves. That is, the optimization intensity of these two categories during training is positively correlated with the number of samples of the categories. The dividing line between the two categories is the dotted line cosθ in Figure 6(a). yi =cosθ j shown.
[0138] 2. The M function of formula (2) (also known as M(y i ,j,k) function), Equation 2-2 represents when the target sample label y i Belongs to C k , target category j does not belong to C k In the case of , the value of the M function. If the target sample label y i The number of samples n yiLess than the maximum number of samples in each category in the training set n max , this situation is also a high probability situation, then the value of the 2-2 formula of the M function is greater than 0, and the interface at this time is shown as the dotted line +m' in Figure 6(a). For the target sample label y i The corresponding category has better optimization, and in this case the target sample label y i The corresponding category belongs to C k , indicating that the focus is on optimizing C k Categories within.
[0139] In some embodiments, the target sample label y i The number of samples n yi Equal to the maximum number of samples in each category in the training set n max , then the value of the 2-2 formula of the M function is equal to 0. At this time, the dividing line is in the middle of the two categories. The optimization at this time depends on the number of samples in the two categories themselves. The dividing line between the two categories is the dotted line cosθ in Figure 6(a). yi =cosθ j shown.
[0140] 3. The M function of formula (2) (also known as M(y i ,j,k) function), Equation 2-3 represents when the target sample label y i Not C k , target category j belongs to C k In the case of , the value of the M function. If the number of samples of target category j is n j Less than the maximum number of samples in each category in the training set n max , this situation is also a high probability situation, then the value of the 2-3 formula of the M function is less than 0, and the interface is shown as the dotted line -m in Figure 6(b). At this time, the target category j belongs to C k , so it is still optimized C k Categories within.
[0141] In some embodiments, the number of samples n of target category j j Equal to the maximum number of samples in each category in the training set n max , then the value of Equation 2-3 of the M function is equal to 0. At this time, the dividing line is in the middle of the two categories. The optimization at this time depends on the number of samples in the two categories themselves. The dividing line between the two categories is the dotted line cosθ in Figure 6(b). yi =cosθ j shown.
[0142] 4. The M function of formula (2) (also known as M(y i ,j,k) function), Equation 2-4 represents when the target sample label y iand target category j does not belong to C k In the case of , the value of M function. n max With n max The ratio is 1, then the value of the M function 2-4 is 0, and the interface is the dotted line cosθ in Figure 6(b) yi =cosθ j As shown, the dividing line is in the middle of the two categories, and the optimization at this time depends on the number of samples in the two categories themselves.
[0143] In summary, the loss function of this embodiment focuses on optimizing the subset of attention categories C of the branch model. k This enables the branch model to have better recognition ability for data categories within the subset of the focus category.
[0144] It can be seen that when the boundary distance is different, the boundary of the target category or the category corresponding to the target sample label is offset, and the weight of the target category and the category corresponding to the target sample label is adjusted.
[0145] Based on the boundary distance, the weights of the categories corresponding to the target sample labels and the target categories can be adjusted to adjust the category intervals of the focus category subset. This allows for greater focus on the data categories in the focus category subset corresponding to the branch model during training optimization.
[0146] In some embodiments, after adjusting the weights of the categories corresponding to the target categories and target sample labels according to the boundary distance to adjust the category intervals of the focus category subset, the method further includes: in the branch model iteration process, adjusting the classifier parameters of the branch model according to the adjusted weights of the categories corresponding to the target categories and target sample labels, wherein the weights are the classifier parameters of the branch model, and the adjusted weights make the classifier pay more attention to the focus category subset; performing iterative training according to the adjusted classifier parameters; completing the training of the branch model when the preset iteration termination condition is reached; and continuing to select the target categories and target sample labels to continue training the branch model when the preset iteration termination condition is not reached.
[0147] The above-mentioned preset iteration termination condition may be that the number of iterations reaches a preset number, or the loss value reaches a preset threshold, etc. When the preset iteration termination condition is that the loss value reaches the preset threshold, the classifier output data corresponding to the target category and target sample label, as well as the loss value of the loss function in this iteration, are calculated based on the adjusted weights; when the loss value reaches the preset loss threshold, the training of the branch model is completed, and a branch model focusing on the subset of the focus category is obtained; when the loss value does not reach the preset loss threshold, the target category and target sample label are continued to be selected to continue training the branch model.
[0148] After obtaining the adjusted weights, the classifier of the branch model can be adjusted to train the branch model. The adjusted weights are then used to calculate the classifier output data of subsequent input samples and the loss value of the loss function in this iteration.
[0149] It should be noted that when calculating the classifier output data of the input sample using the adjusted weights, the adjusted weights can be multiplied by the input sample x to obtain the output data.
[0150] The loss value is used to determine whether the training of the branch model is completed. When the loss value reaches the preset loss threshold, the training of the branch model is completed, and a branch model that focuses on the subset of the focus category is obtained; when the loss value does not reach the preset loss threshold, the target category and target sample label are continued to be selected to continue training the branch model.
[0151] Based on the adjusted weights, the classifier parameters are adjusted, and the branch model is iteratively trained using the full data of the input training set until the loss value of the loss function reaches the preset loss threshold. This allows the trained branch model to have a bias towards recognizing the subset of the categories of interest.
[0152] Accordingly, please refer to FIG8 , which shows a flow chart of a method for training a recognition model for sample data recognition according to an embodiment of the present disclosure. The embodiment of the present disclosure provides a method for training a recognition model for sample data recognition, the method comprising:
[0153] Step S801: multiple branch models are trained using a preset loss function using the full data of the training set, wherein each branch model focuses on a corresponding subset of focus categories in the full data, and the focus category subset is at least one category among multiple categories in the full data;
[0154] Step S802 : Integrate multiple sub-models including multiple branch models to obtain a recognition model, wherein the recognition model is used to recognize the input sample and determine the category to which the input sample belongs.
[0155] The above steps utilize an ensemble of multiple sub-models, leveraging the diversity of the subsets of categories they focus on to improve the recognition accuracy of the fused recognition model. Each branch in the sub-model receives the full training set as input. By designing the loss function, different branches focus on different subsets of categories. This reduces data imbalance and improves recognition performance for that subset. Ultimately, the fusion of these branches improves overall recognition performance.
[0156] In some embodiments, obtaining multiple branch models by training the full data of the training set using a preset loss function includes: dividing the full data into focus category subsets corresponding to the multiple branch models according to the number of branch models, wherein the branch models correspond one-to-one to the focus category subsets, and the number of samples in each focus category subset is within a preset sample number range; training the multiple branch models based on the full data, and during the training process, training the branch models using a preset loss function to obtain multiple branch models.
[0157] The multi-branch model integration method is adopted to improve the recognition accuracy of the fused recognition model by focusing on the diversity of category subsets of multiple different branch models.
[0158] In some embodiments, the multiple sub-models also include: an inverse distribution model, and the method also includes: training the inverse distribution model based on the full amount of data through a preset loss function, wherein the preset loss function is determined by the inverse distribution coefficient; integrating the multiple sub-models including the multiple branch models to obtain the recognition model includes: integrating the inverse distribution model and the multiple branch models to obtain the recognition model.
[0159] The anti-distribution model is used to eliminate the deviations of multiple branch models in categories outside the focus category subset, so that the recognition accuracy of the final fused recognition model is higher.
[0160] In some embodiments, based on the full amount of data, training the inverse distribution model through a preset loss function includes: determining the boundary distance between the category of the target sample label and the target category based on the ratio of the number of samples of the target category to the number of samples of the target sample label, taking the logarithm, and the inverse distribution coefficient; and adjusting the interval boundary of the category identified by the inverse distribution model based on the boundary distance.
[0161] The boundary distance is calculated by the inverse distribution coefficient, and the inverse distribution model is trained so that the inverse distribution model can effectively weaken the deviation caused by categories outside the focus category subset.
[0162] In some embodiments, during the training process, the branch model is trained using a preset loss function to obtain multiple branch models, including: creating a loss function based on the classifier output data and first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and second adjustment data corresponding to the target category of the sub-model, wherein the target sample label is one of multiple sample labels of the input sample, and the target category is one of multiple categories in the full data; the sub-model is trained using the loss function until the model converges.
[0163] A loss function is created by combining the first adjustment data and the second adjustment data, and a boundary distance is calculated. The interval boundary of the category recognized by the sub-model is adjusted according to different values of the boundary distance.
[0164] In some embodiments, before creating the loss function based on the classifier output data and first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and second adjustment data corresponding to the target category of the sub-model, the method also includes: calculating the first adjustment data based on the first adjustment function and the classifier output data corresponding to the target sample label; calculating the second adjustment data based on the second adjustment function and the classifier output data corresponding to the target category; the first adjustment function and the second adjustment function are the same function.
[0165] The first adjustment data is calculated according to the first adjustment function, and the second adjustment data is calculated according to the second adjustment function, so as to create a loss function according to the first adjustment data and the second adjustment data. The loss function with the first adjustment data and the second adjustment data is used to adjust the weights of different categories and optimize the recognition model's recognition ability for the subset of focus categories.
[0166] In some embodiments, training the sub-model using a preset loss function includes: determining the boundary distance between the category of the target sample label and the target category based on the difference between the first adjustment data and the second adjustment data; and adjusting the interval boundary of the category identified by the sub-model based on the boundary distance.
[0167] The distance between the target sample label category and the target category is determined based on the first adjustment data and the second adjustment data, and the sub-model is trained based on the boundary distance, so that the branch model is more biased towards identifying categories within the focus category subset.
[0168] In some embodiments, determining the boundary distance between the category of the target sample label and the target category based on the difference between the first adjustment data and the second adjustment data includes: for the case where the sub-model is a branch model, when the target category and the target sample label both belong to the focus category subset of the branch model, the boundary distance is determined based on the ratio of the number of samples of the target category to the number of samples of the sample label, and taking the logarithm; when the target category does not belong to the focus category subset of the branch model, and the target sample label belongs to the focus category subset, the boundary distance is determined based on the ratio of the maximum number of samples of each category in the training set to the number of samples of the target sample label, and taking the logarithm, wherein the boundary distance is greater than 0; when the target category belongs to the focus category subset of the branch model, and the target sample label does not belong to the focus category subset, the boundary distance is determined based on the ratio of the number of samples of the target category to the maximum number of samples of each category in the training set, and taking the logarithm, wherein the boundary distance is less than 0; when neither the target category nor the target sample label belongs to the focus category subset of the branch model, the boundary distance is determined to be 0.
[0169] Based on the boundary distance function, the branch model is made to place greater emphasis on identifying target categories with fewer samples within the category subset or the category corresponding to the target sample label. Alternatively, it is made to place greater emphasis on the category corresponding to the target sample label belonging to the category subset of interest. This combination makes the branch model place greater emphasis on identifying categories within the category subset of interest.
[0170] In some embodiments, adjusting the interval boundary of the category identified by the sub-model according to the boundary distance includes: adjusting the weights of the category corresponding to the target category and the target sample label according to the boundary distance to adjust the interval boundary of the category identified by the sub-model.
[0171] The class weight of the classifier is adjusted according to the boundary distance, so that the classifier can recognize the categories of the focus category subset based on the boundary distance.
[0172] In some embodiments, after adjusting the weights of the categories corresponding to the target categories and target sample labels according to the boundary distance to adjust the category intervals of the focus category subset, the method further includes: during the iteration process of the branch model, adjusting the classifier parameters of the branch model according to the adjusted weights of the categories corresponding to the target categories and target sample labels, wherein the weights are the classifier parameters of the branch model, and the adjusted weights make the classifier pay more attention to the focus category subset; performing iterative training according to the adjusted classifier parameters; completing the training of the branch model when the preset iteration termination condition is met; and continuing to select the target categories and target sample labels to continue training the branch model when the preset iteration termination condition is not met.
[0173] Based on the adjusted weights, the classifier parameters are adjusted, and the branch model is iteratively trained using the full data of the input training set until the preset iteration termination condition is reached. This allows the trained branch model to have a bias towards recognizing the subset of categories of interest.
[0174] Accordingly, please refer to Figure 9, which shows a schematic diagram of the recognition model of the sample data type of an embodiment of the present disclosure. The embodiment of the present disclosure provides a recognition model of the sample data type, and the system includes: multiple sub-models 91, and an integration module 92; the system is described in detail below.
[0175] The multiple sub-models 91 include multiple branch models 911, which are trained using a preset loss function based on the full data of the training set. Each branch model focuses on a corresponding subset of focus categories in the full data, and the focus category subset is at least one category among the multiple categories in the training set.
[0176] The integration module 92 is connected to the outputs of the multiple sub-models 91 and is used to integrate the output data of the multiple sub-models to obtain the final recognition result.
[0177] Utilizing the aforementioned recognition model, the recognition accuracy of the fused recognition model is improved by diversifying the subsets of categories that are focused on by different sub-models. Each branch model receives the full training set as input, and through the design of the loss function, different branches focus on different subsets of categories. This reduces data imbalance in each branch model, improving recognition performance for that subset. Ultimately, the fusion of different branches improves overall recognition performance.
[0178] In some embodiments, when multiple branch models are trained using a preset loss function based on the full data of the training set: according to the number of branch models, the full data is divided into focus category subsets corresponding to the multiple branch models, wherein the branch models correspond one-to-one to the focus category subsets, and the number of samples in each focus category subset is within a preset sample number range; multiple branch models are trained based on the full data, and during the training process, the branch models are trained using a preset loss function.
[0179] In some embodiments, the multiple sub-models further include an inverse distribution model, which is trained based on the full data using a preset loss function, where the loss function of the inverse distribution model is determined by an inverse distribution coefficient. When integrating the multiple sub-models including the multiple branch models to obtain the recognition model, the inverse distribution model is integrated with the multiple branch models to obtain the recognition model.
[0180] In some embodiments, when the inverse distribution model is trained based on the full amount of data using a preset loss function: the boundary distance between the category of the target sample label and the target category is determined based on the ratio of the number of samples of the target category to the number of samples of the target sample label, and the logarithm and the inverse distribution coefficient; based on the boundary distance, the interval boundary of the category identified by the inverse distribution model is adjusted.
[0181] In some embodiments, when the sub-model is trained using a preset loss function: a loss function is created based on the classifier output data and first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and second adjustment data corresponding to the target category of the sub-model, wherein the target sample label is one of multiple sample labels of the input sample, and the target category is one of multiple categories in the full data; the sub-model is trained using the loss function until the model converges.
[0182] In some embodiments, before creating the loss function, based on the classifier output data and first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and second adjustment data corresponding to the target category of the sub-model, the first adjustment data is calculated based on the first adjustment function and the classifier output data corresponding to the target sample label; the second adjustment data is calculated based on the second adjustment function and the classifier output data corresponding to the target category; the first adjustment function and the second adjustment function are the same function.
[0183] In some embodiments, when the sub-model is trained using a preset loss function: the boundary distance between the category of the target sample label and the target category is determined based on the difference between the first adjustment data and the second adjustment data; and the interval boundary of the category recognized by the sub-model is adjusted based on the boundary distance.
[0184] In some embodiments, when determining the boundary distance between the category of the target sample label and the target category based on the difference between the first adjustment data and the second adjustment data: for the case where the sub-model is a branch model, when the target category and the target sample label both belong to the focus category subset of the branch model, the boundary distance is determined based on the ratio of the number of samples of the target category to the number of samples of the sample label, and taking the logarithm; when the target category does not belong to the focus category subset of the branch model, and the target sample label belongs to the focus category subset, the boundary distance is determined based on the ratio of the maximum number of samples of each category in the training set to the number of samples of the target sample label, and taking the logarithm, wherein the boundary distance is greater than 0; when the target category belongs to the focus category subset of the branch model, and the target sample label does not belong to the focus category subset, the boundary distance is determined based on the ratio of the number of samples of the target category to the maximum number of samples of each category in the training set, and taking the logarithm, wherein the boundary distance is less than 0; when neither the target category nor the target sample label belongs to the focus category subset of the branch model, the boundary distance is determined to be 0.
[0185] In some embodiments, when adjusting the interval boundary of the category identified by the sub-model based on the boundary distance: the weights of the category corresponding to the target category and the target sample label are adjusted based on the boundary distance to adjust the interval boundary of the category identified by the sub-model.
[0186] In some embodiments, after adjusting the weights of the categories corresponding to the target categories and target sample labels according to the boundary distance to adjust the category intervals of the focus category subset, during the iteration process of the branch model, the classifier parameters of the branch model are adjusted according to the adjusted weights of the categories corresponding to the target categories and target sample labels, wherein the weights are the classifier parameters of the branch model, and the adjusted weights make the classifier pay more attention to the focus category subset; iterative training is performed according to the adjusted classifier parameters; when the preset iteration termination conditions are met, the training of the branch model is completed; when the preset iteration termination conditions are not met, the target categories and target sample labels continue to be selected to continue training the branch model.
[0187] The above-mentioned network detection device includes a processor and a memory. The above-mentioned sub-model 91 and the integrated module 92 can be stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0188] The processor contains a core, which retrieves the corresponding program unit from the memory. One or more cores can be set up. When improving network transmission efficiency, multi-dimensional network data from the client of the network to be tested is obtained and attributed to determine the location and cause of network anomalies, thereby targetedly improving and improving the network, achieving more efficient and rapid optimization of network transmission.
[0189] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0190] An embodiment of the present disclosure provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements a training method for a recognition model of a sample data type or a network detection and display method.
[0191] Figure 10 shows a schematic diagram of a computer terminal according to an embodiment of the present disclosure. As shown in Figure 10, an embodiment of the present application provides a computer terminal 1000, which includes a processor 1002, a memory 1004, and a program stored in the memory and executable on the processor.
[0192] In the present application, the technical solutions in the above embodiments can all be applied to the computer terminal 1000 shown in Figure 10. The computer terminal 1000 may include one or more (only one is shown in the figure) processors 1002 (the processor 1002 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission module 1006 for communication functions. It will be understood by those skilled in the art that the structure shown in Figure 10 is only for illustration and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 1000 may also include more or fewer components than those shown in Figure 10, or have a configuration different from that shown in Figure 10.
[0193] The memory 1004 can be used to store software programs and modules of application software. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004. The memory 1004 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1004 may further include memory remotely located relative to the processor 1002. These remote memories can be connected to the computer terminal 1000 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0194] Transmission device 1006 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of computer terminal 1000. In one embodiment, transmission device 1006 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 1006 may be a radio frequency (RF) module configured to communicate with the Internet wirelessly.
[0195] The steps of implementing the above-mentioned method for identifying sample data types when the processor executes the program are as follows:
[0196] The input sample to be identified is input into the recognition model, wherein the recognition model is obtained by integrating multiple sub-models, and the multiple sub-models include multiple branch models. The branch model is trained by using the full data of the training set using a preset loss function. Each branch model focuses on the corresponding focus category subset in the full data, and the focus category subset is at least one category among the multiple categories in the full data; according to the output of the recognition model, the category to which the input sample belongs is identified.
[0197] Because the branching model is trained using the full training set data using a preset loss function, it has high recognition capabilities for a subset of focused categories. The recognition model, resulting from the integration of multiple branching models, has good recognition capabilities for all categories in the training set. Using this recognition model to identify input samples achieves higher recognition accuracy.
[0198] In some embodiments, before inputting the input sample to be identified into the training recognition model, the method also includes: dividing the full data into focus category subsets corresponding to multiple branch models according to the number of branch models, wherein the branch models correspond one-to-one to the focus category subsets, and the number of samples in each focus category subset is within a preset sample number range; training multiple branch models based on the full data, and during the training process, training the branch models through a preset loss function; integrating multiple branch models to obtain a recognition model.
[0199] A multi-branch model ensemble approach leverages the diversity of multiple branch models to improve the recognition accuracy of the fused recognition model. Each branch model receives the full training set data as input. By designing the loss function, different branches focus on different subsets of the categories of interest. This reduces data imbalance and improves recognition performance for that subset of categories. Ultimately, the fusion of different branches improves overall recognition performance.
[0200] In some embodiments, the multiple sub-models also include: an inverse distribution model, and the method also includes: training the inverse distribution model based on the full amount of data through a preset loss function, wherein the preset loss function is determined by the inverse distribution coefficient; integrating the inverse distribution model and multiple branch models to obtain a recognition model.
[0201] The anti-distribution model is used to eliminate the deviations of multiple branch models in categories outside the focus category subset, so that the recognition accuracy of the final fused recognition model is higher.
[0202] In some embodiments, based on the full amount of data, training the inverse distribution model through a preset loss function includes: determining the boundary distance between the category of the target sample label and the target category based on the ratio of the number of samples of the target category to the number of samples of the target sample label, taking the logarithm, and the inverse distribution coefficient; and adjusting the interval boundary of the category identified by the inverse distribution model based on the boundary distance.
[0203] The boundary distance is calculated by the inverse distribution coefficient, and the inverse distribution model is trained so that the inverse distribution model can effectively eliminate the deviation caused by categories outside the subset of focus categories.
[0204] In some embodiments, training the sub-model through a preset loss function includes: creating a loss function based on the classifier output data and first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and second adjustment data corresponding to the target category of the sub-model, wherein the target sample label is one of multiple sample labels of the input sample, and the target category is one of multiple categories in the full data; training the sub-model through the loss function until the model converges.
[0205] A loss function is created by combining the first adjustment data and the second adjustment data, and a boundary distance is calculated. The interval boundary of the category recognized by the sub-model is adjusted according to different values of the boundary distance.
[0206] In some embodiments, before creating the loss function based on the classifier output data and first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and second adjustment data corresponding to the target category of the sub-model, the method also includes: calculating the first adjustment data based on the first adjustment function and the classifier output data corresponding to the target sample label; calculating the second adjustment data based on the second adjustment function and the classifier output data corresponding to the target category; the first adjustment function and the second adjustment function are the same function.
[0207] The first adjustment data is calculated according to the first adjustment function, and the second adjustment data is calculated according to the second adjustment function, so as to create a loss function according to the first adjustment data and the second adjustment data. The loss function with the first adjustment data and the second adjustment data is used to adjust the weights of different categories and optimize the recognition model's recognition ability for the subset of focus categories.
[0208] In some embodiments, training the sub-model using a preset loss function includes: determining the boundary distance between the category of the target sample label and the target category based on the difference between the first adjustment data and the second adjustment data; and adjusting the interval boundary of the category identified by the sub-model based on the boundary distance.
[0209] The distance between the target sample label category and the target category is determined based on the first adjustment data and the second adjustment data, and the sub-model is trained based on the boundary distance, so that the branch model is more biased towards identifying categories within the focus category subset.
[0210] In some embodiments, determining the boundary distance between the category of the target sample label and the target category based on the difference between the first adjustment data and the second adjustment data includes: when the target category and the target sample label both belong to the focus category subset of the branch model, determining the boundary distance based on the ratio of the number of samples of the target category to the number of samples of the sample label, and taking the logarithm; when the target category does not belong to the focus category subset of the branch model, and the target sample label belongs to the focus category subset, determining the boundary distance based on the ratio of the maximum number of samples of each category in the training set to the number of samples of the target sample label, and taking the logarithm, wherein the boundary distance is greater than 0; when the target category belongs to the focus category subset of the branch model, and the target sample label does not belong to the focus category subset, determining the boundary distance based on the ratio of the number of samples of the target category to the maximum number of samples of each category in the training set, and taking the logarithm, wherein the boundary distance is less than 0; when neither the target category nor the target sample label belongs to the focus category subset of the branch model, determining the boundary distance to be 0.
[0211] Based on the boundary distance function, the branch model is made to place greater emphasis on identifying target categories with fewer samples within the category subset or the category corresponding to the target sample label. Alternatively, it is made to place greater emphasis on the category corresponding to the target sample label belonging to the category subset of interest. This combination makes the branch model place greater emphasis on identifying categories within the category subset of interest.
[0212] In some embodiments, adjusting the interval boundary of the category identified by the sub-model according to the boundary distance includes: adjusting the weights of the category corresponding to the target category and the target sample label according to the boundary distance to adjust the interval boundary of the category identified by the sub-model.
[0213] The class weight of the classifier is adjusted according to the boundary distance, so that the classifier can recognize the categories of the focus category subset based on the boundary distance.
[0214] In some embodiments, after adjusting the weights of the categories corresponding to the target categories and target sample labels according to the boundary distance to train the category intervals of the focus category subset, the method also includes: in the branch model iteration process, adjusting the classifier parameters of the branch model according to the adjusted weights of the categories corresponding to the target categories and target sample labels, wherein the weights are the classifier parameters of the branch model, and the adjusted weights make the classifier pay more attention to the corresponding focus category subset; performing iterative training according to the adjusted classifier parameters; completing the training of the branch model when the preset iteration termination condition is met; and continuing to select the target categories and target sample labels to continue training the branch model when the preset iteration termination condition is not met.
[0215] Based on the adjusted weights, the classifier parameters are adjusted, and the branch model is iteratively trained using the full data of the input training set until the preset iteration termination condition is reached. This allows the trained branch model to have a bias towards recognizing the subset of categories of interest.
[0216] When the processor executes the program, it can also implement the steps of the training method of the recognition model of the training set mentioned above:
[0217] A method for training a recognition model of a training set, the method comprising: obtaining a plurality of branch models by training with a preset loss function using the full data of the training set, wherein each branch model focuses on a corresponding subset of focus categories in the full data, and the focus category subset is at least one category among the multiple categories in the full data; integrating a plurality of sub-models including the plurality of branch models to obtain a recognition model, wherein the recognition model is used to identify an input sample and determine the category to which the input sample belongs.
[0218] The multi-branch model integration method is adopted to improve the recognition accuracy of the fused recognition model by focusing on the diversity of category subsets of multiple different branch models.
[0219] The present application also provides a computer program product, which, when executed on a device for processing job monitoring data, is suitable for executing a program initialized with any of the above method steps.
[0220] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0221] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.
[0222] These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable job monitoring data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable job monitoring data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.
[0223] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable job monitoring data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0224] These computer program instructions can also be loaded onto a computer or other programmable job monitoring data processing device, so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0225] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0226] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0227] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0228] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0229] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0230] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
[0231] Although the embodiments of the present disclosure have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for identifying a sample data category, comprising: Inputting the input sample to be identified into the recognition model, wherein the recognition model is obtained by integrating multiple sub-models, wherein the multiple sub-models include multiple branch models, and the multiple branch models are trained by using the full data of the training set using a preset loss function, and each branch model focuses on a subset of the focus categories corresponding to each branch model in the full data, and the focus category subset is at least one category among the multiple categories in the full data; According to the output of the recognition model, the category to which the input sample belongs is identified.
2. The recognition method according to claim 1, before inputting the input sample to be recognized into the recognition model, further comprising: According to the number of the multiple branch models, the full amount of data is divided into focus category subsets corresponding to the multiple branch models, wherein the multiple branch models correspond to the focus category subsets one by one, and the number of samples in each focus category subset is within a preset sample number range; The plurality of branch models are trained according to the full amount of data, and during the training process, the branch models are trained using the preset loss function; The multiple branch models are integrated to obtain the recognition model.
3. The identification method according to claim 1, wherein: The multiple sub-models also include: an anti-distribution model, The identification method further comprises: Based on the full amount of data, the inverse distribution model is trained by the preset loss function, wherein the preset loss function is determined by the inverse distribution coefficient; The inverse distribution model and the multiple branch models are integrated to obtain the recognition model.
4. The identification method according to claim 3, wherein: The training of the anti-distribution model based on the full amount of data by using the preset loss function includes: Determine the boundary distance between the category of the target sample label and the target category according to the logarithm of the ratio of the number of samples of the target category to the number of samples of the target sample label and the inverse distribution coefficient; According to the boundary distance, the interval boundary of the category identified by the inverse distribution model is adjusted.
5. The identification method according to claim 1, wherein: The multiple sub-models are trained by the preset loss function in the following manner: Creating a loss function according to the classifier output data corresponding to the target sample label of the sub-model and the first adjustment data, the classifier output data corresponding to the target category of the sub-model and the second adjustment data, wherein the target sample label is one of multiple sample labels of the input sample, and the target category is one of multiple categories in the full amount of data; The sub-model is trained using the loss function.
6. The identification method according to claim 5, wherein: Before creating a loss function based on the classifier output data and the first adjustment data corresponding to the target sample label of the sub-model, and the classifier output data and the second adjustment data corresponding to the target category of the sub-model, the method further includes: Calculating the first adjustment data according to the first adjustment function and the classifier output data corresponding to the target sample label; Calculating the second adjustment data according to the second adjustment function and the classifier output data corresponding to the target category; The first adjustment function and the second adjustment function are the same function.
7. The identification method according to claim 5, wherein: The multiple sub-models are trained by the preset loss function in the following manner: Determining a boundary distance between the category of the target sample label and the target category according to a difference between the first adjustment data and the second adjustment data; According to the boundary distance, the interval boundary of the category identified by the sub-model is adjusted.
8. The identification method according to claim 7, wherein: Determining the boundary distance between the category of the target sample label and the target category according to the difference between the first adjustment data and the second adjustment data includes at least one of the following: In response to the target category and the target sample label both belonging to the focus category subset of the branch model, the boundary distance is determined by taking a logarithm of a ratio of the number of samples of the target category to the number of samples of the sample label; In response to the target category not belonging to the subset of interest categories of the branch model, the target sample label belongs to the subset of interest categories, and the boundary distance is determined according to the logarithm of the ratio of the maximum number of samples of each category in the training set to the number of samples of the target sample label, wherein the boundary distance is greater than 0; In response to the target category belonging to the subset of the focus category of the branch model, the target sample label does not belong to the subset of the focus category, determining the boundary distance according to the logarithm of the ratio of the number of samples of the target category to the maximum number of samples of each category in the training set, wherein the boundary distance is less than 0; In response to the fact that neither the target category nor the target sample label belongs to the focus category subset of the branch model, the boundary distance is determined to be 0.
9. The identification method according to claim 7, wherein: The adjusting the interval boundary of the category identified by the sub-model according to the boundary distance includes: The weights of the target category and the category corresponding to the target sample label are adjusted according to the boundary distance to adjust the interval boundary of the category recognized by the sub-model.
10. The recognition method according to claim 9, after adjusting the weights of the target category and the category corresponding to the target sample label according to the boundary distance, further comprising: During the iteration of the branch model, adjusting the classifier parameters of the branch model according to the adjusted weights of the target category and the category corresponding to the target sample label, wherein the weights are the classifier parameters of the branch model, and the adjusted weights make the classifier pay more attention to the subset of the category of interest; Perform iterative training based on the adjusted classifier parameters; In response to reaching a preset iteration termination condition, completing the training of the branch model; In response to the preset iteration termination condition not being met, continue to select target categories and target sample labels to continue training the branch model.
11. A method for training a recognition model of a sample data category, comprising: A plurality of branch models are obtained by training the full amount of data of the training set using a preset loss function, wherein each branch model focuses on a subset of focus categories corresponding to each branch model in the full amount of data, and the subset of focus categories is at least one category among the multiple categories in the full amount of data; A plurality of sub-models including the plurality of branch models are integrated to obtain a recognition model, wherein the recognition model is used to recognize an input sample and determine the category to which the input sample belongs.
12. A model for identifying a sample data category, comprising: Multiple sub-models, and integrated modules; The multiple sub-models include multiple branch models, the branch models are trained according to the full data of the training set using a preset loss function, each of the branch models focuses on a subset of focus categories corresponding to each of the branch models in the full data, and the focus category subset is at least one category among the multiple categories in the training set; The integration module is connected to the outputs of the multiple sub-models and is used to integrate the output data of the multiple sub-models to obtain the final recognition result.
13. A computer-readable storage medium for storing a program, wherein: The program executes the method for identifying the sample data category according to any one of claims 1 to 10, or the method for training a recognition model for the sample data category according to claim 11.
14. A computer terminal comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein: When the one or more programs are executed by the one or more processors, the one or more processors implement the method for identifying the sample data category described in any one of claims 1 to 10, or the method for training a recognition model for the sample data category described in claim 11.
15. A computer program comprising: Instructions, when executed by a processor, cause the processor to execute the method for identifying the sample data category according to any one of claims 1 to 10, or the method for training a recognition model for the sample data category according to claim 11.
Citation Information
Patent Citations
Unbalanced data classification method based on boundary upsampling
CN105975993A
An unbalanced data classification method based on adaptive weighted Bagging-GBDT
CN109086412A
Short text classification method and system based on multi-model integration
CN111078876A
Image retrieval method of single-model multi-branch structure
CN111125396A
Face recognition and attribute classification method based on multi-task convolutional neural network
CN111814706A
Cited By
Image processing device and method based on fluorescence microscope acquisition
CN119559069A
Multipath channel DOA estimation method based on heterogeneous attention double-branch neural network
CN121283805A
Day and night composite high temperature feature identification method based on temperature time sequence data
CN122817980A
