A method and system for improving imbalanced classification models.

By designing a hierarchical classification model, the problem of imbalanced multi-class classification is solved, the classification effect and accuracy are improved, and the robustness and generalization ability of the model are enhanced.

CN116304919BActive Publication Date: 2026-04-21XIAMEN MEIYA PICO INFORMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAMEN MEIYA PICO INFORMATION CO LTD
Filing Date
2023-01-11
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In imbalanced multi-class classification problems, existing technologies are prone to overfitting and over-reliance on a minority of samples, resulting in unsatisfactory classification performance and poor robustness and generalization ability.

Method used

A hierarchical classification model is adopted, which combines and groups categories through data analysis. The group classification model and the sub-category classification model are used for layer-by-layer training and prediction to improve the robustness and generalization ability of the model.

Benefits of technology

In cases of imbalanced samples, it significantly improves classification accuracy by approximately 10% to 30%, enhancing the model's robustness and generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304919B_ABST
    Figure CN116304919B_ABST
Patent Text Reader

Abstract

This invention proposes a method and system for improving a classification model for imbalanced multi-class samples, comprising: a training step, which involves analyzing the acquired training data, combining and grouping categories according to the data volume of each category and preset data grouping and partitioning rules, and further using the group classification model and the sub-category classification model of each group in a hierarchical classification model for layer-by-layer classification training; and a prediction step, which involves first loading the group classification model and the sub-category classification model of each group, then inputting the prediction data into the group classification model for classification prediction to determine the group label of each group, and then selecting the corresponding sub-category classification model according to the group label for final sub-category prediction. By improving the framework structure of the classification model, the classification effect is improved, solving the multi-class problem under imbalanced samples, improving classification effect and accuracy, and simultaneously enhancing the robustness and generalization ability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of multi-class classification of samples, and specifically relates to a method and system for improving a classification model with imbalanced multi-class samples. Background Technology

[0002] In practical applications, scenarios with imbalanced sample distribution are frequently encountered. Imbalanced sample distribution means that the minority class samples contain too few features, making it difficult to extract patterns from them. Even if a classification model is obtained, it is prone to over-reliance on the limited data samples, leading to overfitting problems. Furthermore, when the model is applied to new data, its accuracy and robustness will be very poor.

[0003] When performing text multi-class classification, common methods include upsampling / downsampling or adjusting the penalty weights for positive and negative samples to address the problem of unbalanced sample distribution leading to poor classification model performance. However, regardless of the method used, there are still situations where the model's classification performance is not ideal, and its robustness and generalization ability are poor.

[0004] The commonly used upsampling method in the industry achieves sample balance by increasing the number of minority samples in the classification. However, this method has the drawback of potentially leading to overfitting and overgeneralization problems due to the limited features of minority samples. Downsampling, on the other hand, achieves sample balance by reducing the number of minority samples in the classification. However, this method also has a significant drawback: it loses some crucial information from the majority samples, causing the model to perform worse in recognizing these lost majority samples, resulting in poorer generalization performance. Combining upsampling and downsampling can alleviate some data distribution issues, but the drawbacks still persist.

[0005] The idea behind addressing imbalanced classification by adjusting the penalty weights for positive and negative samples involves assigning different weights to classes with varying numbers of samples during the algorithm's implementation. Generally, smaller classes have higher weights, while larger classes have lower weights, which are then used for calculation and modeling. For example, weighted cross-entropy loss functions like Focalloss can be used. However, in practice, these methods are not very effective. For instance, Focalloss performs poorly in identifying difficult samples, is easily affected by noise, and its hyperparameters are difficult to choose.

[0006] In view of this, it is very meaningful to propose a method and system for improving the classification model of imbalanced multi-class samples. Summary of the Invention

[0007] To address the shortcomings in classification performance and accuracy of existing multi-class classification models with imbalanced samples, this invention provides a method and system for improving multi-class classification models with imbalanced samples, thereby resolving the aforementioned technical deficiencies.

[0008] In a first aspect, the present invention proposes a method for improving a classification model with imbalanced multi-class samples, the method comprising the following steps:

[0009] The training steps involve analyzing the acquired training data, combining and grouping categories according to the amount of data in each category and the preset data grouping and division rules, and then using the group classification model and the sub-category classification model in the hierarchical structure classification model to perform layer-by-layer classification training.

[0010] The prediction process involves first loading the group classification model and the sub-category classification model for each group, then inputting the prediction data into the group classification model for classification prediction to determine the group label for each group, and finally selecting the corresponding sub-category classification model based on the group label to perform the final sub-category prediction.

[0011] Preferably, in the training step, the grouped data is input into the group classification model with the group as the label unit for the first layer training;

[0012] Meanwhile, the data within each group are input into their respective sub-category classification models for the second layer training;

[0013] The training of each group classification model is carried out simultaneously and in parallel, and finally the trained classification models of each layer and each group are saved.

[0014] Preferably, the category combination and grouping based on the preset data grouping and partitioning rules must simultaneously satisfy the following:

[0015] Category data of the same magnitude are grouped together.

[0016] The amount of data in each group is similar.

[0017] A further preferred approach is to assume that, after data analysis, the data needs to be divided into k groups, with c being the number of categories in each group. k If we express this as an expression, then the total number of samples in the k-th group is:

[0018]

[0019] Where, Count k C represents the total number of samples in the k-th group. i c represents the number of samples of the i-th category in the k-th group. k Let c represent the number of categories in the k-th group, and satisfy the condition c. k≥1;

[0020] Assume the total number of training data samples is C. total Then we have:

[0021]

[0022] Among them, C total Count represents the total number of training data samples, k represents the number of groups, and Count is the total number of training data samples. k Let k represent the total number of samples in the k-th group, and satisfy the condition k≥1.

[0023] More preferably, the hierarchical classification model includes:

[0024] The first-layer group classification model is mainly used for training classification on the divided groups. The training labels are group labels G. k One group corresponds to one group tag, G k Let k represent the group label of the k-th group, and satisfy the condition k≥1;

[0025] The second layer consists of sub-classification models for each group: these are primarily used for training classification of each sub-category within each group, with the training labels being the category labels of each sub-category. One category corresponds to one category label. Represents the c-th element in the k-th group. k One label, c k Then it represents the number of categories in the k-th group, and satisfies condition c. k ≥1.

[0026] Preferably, the group classification model in the first layer and the sub-category classification models in the second layer are both trained and evaluated using FastText classification.

[0027] More preferably, the prediction step also includes a final unified aggregation calculation of the sub-category labels to obtain the final predicted category result;

[0028] In the unified aggregation calculation, one sub-category label corresponds to one real multi-category label.

[0029] Secondly, this invention also proposes a system for improving a classification model with imbalanced multi-class samples, the system comprising:

[0030] Data acquisition and analysis module: used to acquire training data and perform data analysis;

[0031] Category combination and grouping module: used to combine and group categories based on the amount of data in each category and preset data grouping and division rules;

[0032] Hierarchical Classification Model Module: Used to perform layer-by-layer classification training using the group classification model and the sub-category classification model of each group in the hierarchical classification model;

[0033] Hierarchical model prediction module: It is used to first input the prediction data into the group classification model for classification prediction to determine the group label of each group, and then select the corresponding sub-category classification model according to the group label;

[0034] Aggregation Calculation Module: Used to perform unified aggregation calculation on sub-category labels to obtain the final predicted category result.

[0035] Thirdly, embodiments of the present invention provide an electronic device, including: one or more processors; and a storage device for storing 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 as described in any implementation of the first aspect.

[0036] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.

[0037] Compared with the prior art, the beneficial results of the present invention are as follows:

[0038] (1) The technical solution of the present invention provides an improved multi-level multi-class classification model structure framework, which aims to improve the classification effect by improving the framework structure of the classification model, and ensure that the model has better robustness and stronger generalization ability, solve the multi-class problem when the samples are imbalanced, improve the classification effect and accuracy, and at the same time improve the robustness and generalization ability of the model.

[0039] (2) In the case of imbalanced multi-class classification, the technical solution of the present invention is adopted. After grouping according to the amount of data, a two-layer hierarchical classification model is then carried out to form a multi-class model framework, which solves the pain point problem of imbalanced multi-class samples.

[0040] (3) In practice, the results are significantly better than simply using upsampling or undersampling, adjusting sample penalty weights, or directly using multi-class classification. Accuracy can be improved by approximately 10% to 30% in different scenarios, while also exhibiting better robustness and generalization ability. Therefore, the solution of this invention has excellent technical effects, practical value, and application prospects. Attached Figure Description

[0041] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and, together with the description, serve to explain the principles of the invention. Other embodiments and many anticipated advantages of the embodiments will be readily recognized as they become better understood through reference to the following detailed description. Elements in the drawings are not necessarily to scale. The same reference numerals refer to corresponding similar parts.

[0042] Figure 1 This is an exemplary device architecture diagram in which an embodiment of the present invention can be applied;

[0043] Figure 2 This is a flowchart illustrating the method for improving the imbalanced classification model for multi-class samples according to an embodiment of the present invention.

[0044] Figure 3 This is a schematic diagram of the overall structure of the improved multi-class imbalanced classification model method according to an embodiment of the present invention.

[0045] Figure 4 The flowchart illustrates the category combination and grouping process in the method for improving the imbalanced multi-class classification model according to an embodiment of the present invention.

[0046] Figure 5 The diagram shows the structure of the hierarchical classification model in the method for improving the imbalanced multi-class classification model according to an embodiment of the present invention.

[0047] Figure 6 This is a structural diagram of the hierarchical model prediction in the method for improving the imbalanced classification model of multi-class samples according to an embodiment of the present invention.

[0048] Figure 7 A schematic diagram of the system structure of the improved multi-class imbalanced classification model according to an embodiment of the present invention;

[0049] Figure 8 This is a schematic diagram of the structure of a computer device suitable for implementing electronic devices according to embodiments of the present invention. Detailed Implementation

[0050] In the following detailed description, reference is made to the accompanying drawings, which form part of the detailed description and are illustrated by specific illustrative embodiments in which the invention may be practiced. In this regard, directional terms such as “top,” “bottom,” “left,” “right,” “up,” “down,” etc., are used with reference to the orientation of the described figures. Because components of the embodiments can be positioned in several different orientations, directional terms are used for illustrative purposes and are by no means limiting. It should be understood that other embodiments may be utilized or logical changes may be made without departing from the scope of the invention. Therefore, the following detailed description should not be taken in a limiting sense, and the scope of the invention is defined by the appended claims.

[0051] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0052] Figure 1 An exemplary system architecture 100 for processing information, or for processing information, to which embodiments of the present invention can be applied, is shown.

[0053] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0054] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0055] Terminal devices 101, 102, and 103 can be various electronic devices with communication functions, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0056] Server 105 can be a server that provides various services, such as a background information processing server that processes verification request information sent by terminal devices 101, 102, and 103. The background information processing server can analyze and process the received verification request information and obtain processing results (such as verification success information used to indicate that the verification request is a valid request).

[0057] It should be noted that the information processing method provided in the embodiments of the present invention is generally executed by server 105, and correspondingly, the device for processing information is generally disposed in server 105. Furthermore, the information sending method provided in the embodiments of the present invention is generally executed by terminal devices 101, 102, and 103, and correspondingly, the device for sending information is generally disposed in terminal devices 101, 102, and 103.

[0058] It should be noted that a server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules (for example, used to provide distributed services), or as a single software program or multiple software modules; no specific limitations are made here.

[0059] When performing text multi-class classification, common methods include upsampling / downsampling or adjusting the penalty weights for positive and negative samples to address the problem of unbalanced sample distribution leading to poor classification model performance. However, regardless of the method used, there are still situations where the model's classification performance is not ideal, and its robustness and generalization ability are poor.

[0060] The technical solution of this invention aims to improve classification performance by refining the framework structure of the classification model, and to ensure that the model has better robustness and stronger generalization ability.

[0061] The technical solution of this invention modifies the classification model at the level, significantly improving model performance, particularly in multi-class classification problems, while ensuring robustness and enhanced generalization ability. To this end, the invention improves the solution in three steps: data category combination and hierarchical structure classification model design, and hierarchical model prediction, classification, and aggregation calculation.

[0062] 1) Category Combination and Grouping: Data analysis is performed on the training samples to determine the amount of data in each category. Based on this data volume, the data in each category is combined and grouped. The general principle for grouping is to group categories with similar order of magnitude together, and to ensure that the total amount of data in each group is approximately the same.

[0063] 2) Hierarchical Classification Model: Based on the data after combination and grouping, common classification algorithms (such as FastText classification) are used to perform layer-by-layer classification training. The first layer is the group classification model, and the second layer is the classification model for each subcategory within the group; the classification models of different layers are obtained and saved.

[0064] 3) Hierarchical model prediction: A hierarchical model is used for prediction and classification, and the classification results are then aggregated to obtain the final classification prediction result. That is, the first-level group classification model predicts which group a class belongs to, and then the sub-classification model within that group predicts which sub-category it belongs to, thus obtaining the final classification result.

[0065] Based on the above three aspects, an improved multi-level multi-class classification model framework is designed to solve the multi-classification problem when the samples are imbalanced, improve the classification effect and accuracy, and enhance the robustness and generalization ability of the model.

[0066] Firstly, Figure 2 The embodiments of the present invention disclose a method for improving a classification model with imbalanced multi-class samples, such as... Figure 2 and Figure 3 As shown, the method includes the following steps:

[0067] S101, Training steps: After data analysis based on the acquired training data, class combinations and group divisions are performed according to the data volume of each category and the preset data grouping and division rules. Then, the group classification model and the sub-category classification model of each group in the hierarchical structure classification model are used to perform layer-by-layer classification training.

[0068] Specifically, the grouped data is input into the group classification model with the group as the label unit for the first layer of training; at the same time, the data within each group is input into its respective sub-category classification model for the second layer of training.

[0069] The training of each group classification model is carried out simultaneously and in parallel, and finally the trained classification models of each layer and each group are saved.

[0070] Furthermore, the category combination and grouping based on the preset data grouping and division rules must simultaneously meet the following requirements: category data of the same order of magnitude should be grouped into the same group; and the amount of data in each group should be similar.

[0071] S102. Prediction Step: First, load the group classification model and the sub-category classification model of each group. Then, input the prediction data into the group classification model for classification prediction to determine the group label of each group. Then, select the corresponding sub-category classification model according to the group label to perform the final sub-category prediction.

[0072] The technical solution of this invention completes the training and prediction of the model when multi-class samples are imbalanced through two stages: training and prediction. In practical use, the performance is significantly improved compared to using upsampling, adjusting sample penalty weights, or directly using multi-class classification. Accuracy can be improved by approximately 10% to 30% in different scenarios, while also exhibiting better robustness and generalization.

[0073] In a specific embodiment, refer to Figure 4 The flowchart shown illustrates the category combination and grouping process.

[0074] After analyzing the training data, the categories are combined and grouped according to the amount of data in each category. The basis for category combination and grouping is as follows:

[0075] 1) Group categories of data of the same magnitude together;

[0076] 2) The total amount of data in each group is approximately the same;

[0077] Both of the above criteria must be met simultaneously.

[0078] Specifically, assuming that after data analysis, the data needs to be divided into k groups, and the number of categories in each group is c. k If we express this as an expression, then the total number of samples in the k-th group is:

[0079]

[0080] In formula (1), Count k C represents the total number of samples in the k-th group. i c represents the number of samples of the i-th category in the k-th group. k Let c represent the number of categories in the k-th group, and satisfy the condition c. k ≥1.

[0081] Assume the total number of training data samples is C. total Then we have:

[0082]

[0083] In formula (2), C total Count represents the total number of training data samples, k represents the number of groups, and Count is the total number of training data samples. k Let k represent the total number of samples in the k-th group, and satisfy the condition k≥1.

[0084] Furthermore, refer to Figure 5 The diagram shows the hierarchical classification model structure.

[0085] The hierarchical classification model is mainly divided into two layers: the first layer is the group classification model; the second layer is the sub-category classification model corresponding to each group.

[0086] The first-layer group classification model is mainly used for training to classify the divided groups. The training labels are group labels G. k In this context, there is a one-to-one correspondence between groups and group labels, meaning one group corresponds to one group label. k Let k represent the group label of the k-th group, and satisfy the condition k≥1.

[0087] The second layer consists of sub-classification models for each group, primarily used for training classification of each sub-category within each group. The training labels are the category labels for each sub-category. Within each group, there is a one-to-one correspondence between categories and category labels; that is, one category corresponds to one category label. Represents the c-th element in the k-th group. k One label, c k Then it represents the number of categories in the k-th group, and satisfies condition c. k ≥1.

[0088] After data analysis, category combination, and grouping, the grouped training data is fed into the first and second layer classification models for training. Both the first layer group classification model and the second layer sub-category classification models can be trained and evaluated in parallel.

[0089] In the technical solution of this invention, both the group classification model in the first layer and the sub-category classification models in the second layer use FastText classification for training and evaluation. FastText is chosen as the baseline classification model because of its speed, good performance and effectiveness, ability to quickly process hundreds of millions of data points, and built-in word vector training.

[0090] Of course, in addition to the FastText classification model recommended in the technical solution of this invention, other classification models can also be adopted, such as: Word2Vec word vector and CatBoost classification, FastText word vector and CatBoost classification, TextCNN classification or TextRNN classification model, etc.

[0091] Furthermore, the hierarchical model predicts the structure diagram, referring to... Figure 6 As shown.

[0092] Figure 6 China G k This represents the group label of the k-th group. Represents the c-th element in the k-th group. k One label, c k Then it represents the number of categories in the k-th group, satisfying the conditions k≥1 and c k ≥1.

[0093] During the prediction phase, the pre-trained group classification model (FastText classification model) and the individual sub-category classification models (FastText classification models) are loaded first.

[0094] After the model is loaded, the prediction data is first grouped and predicted using the first-layer group classification model (FastText classification model) to obtain the predicted group labels. Then, based on the group labels, the corresponding sub-category classification model (FastText classification model) is selected to predict the corresponding sub-category labels. Finally, the sub-category labels are uniformly aggregated and calculated to obtain the final predicted category results.

[0095] During unified aggregation calculations, each subcategory label corresponds one-to-one with the actual label. That is, one subcategory label corresponds to one actual multi-category label. For example: subcategory label t 11 Corresponding to the actual label t1 and the subcategory label t 12 Corresponding to the actual label t2 and subcategory label Corresponding real label t i-1 Subcategory tags Corresponding real label t i Among them, t i This represents the value of the i-th true label, where i is the number of labels, and i ≥ 3. This is applicable when there are 3 or more labels in a multi-category system.

[0096] In imbalanced multi-class classification scenarios, this invention addresses the pain point of imbalanced multi-class classification by grouping data based on volume and then implementing a two-layer hierarchical classification model. The technical solution employed in this invention significantly improves performance compared to simply using upsampling or adjusting sample penalty weights, or directly employing multi-class classification. Accuracy is improved by approximately 10% to 30% across different scenarios, while also exhibiting better robustness and generalization ability. Therefore, this invention demonstrates excellent technical effectiveness, practical value, and application prospects.

[0097] Secondly, embodiments of the present invention also disclose a system for improving a classification model with imbalanced multi-class samples, such as... Figure 7 As shown, the system includes: a data acquisition and analysis module 71, a category combination and grouping module 72, a hierarchical structure classification model module 73, a hierarchical model prediction module 74, and a aggregation calculation module 75.

[0098] In a specific embodiment, the data acquisition and analysis module 71 is used to acquire training data and perform data analysis; the category combination and grouping module 72 is used to combine and group categories according to the data volume of each category and the preset data grouping and division rules; the hierarchical structure classification model module 73 is used to perform layer-by-layer classification training using the group classification model and the sub-category classification model of each group in the hierarchical structure classification model; the hierarchical model prediction module 74 is used to first input the prediction data into the group classification model for classification prediction to determine the grouping label of each group, and then select the corresponding sub-category classification model according to the grouping label; the aggregation calculation module 75 is used to perform unified aggregation calculation on the sub-category labels to obtain the final predicted category result.

[0099] The following is for reference. Figure 8 It illustrates an electronic device suitable for implementing embodiments of the present invention (e.g., Figure 1 The diagram shows the structure of a computer device 800 (a server or terminal device). Figure 8 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0100] like Figure 8 As shown, the computer device 800 includes a central processing unit (CPU) 801 and a graphics processing unit (GPU) 802, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 803 or programs loaded from storage section 809 into random access memory (RAM) 806. Various programs and data required for the operation of device 800 are also stored in RAM 804. The CPU 801, GPU 802, ROM 803, and RAM 804 are interconnected via bus 805. Input / output (I / O) interface 806 is also connected to bus 805.

[0101] The following components are connected to I / O interface 806: an input section 807 including a keyboard, mouse, etc.; an output section 808 including an LCD, speakers, etc.; a storage section 809 including a hard disk, etc.; and a communication section 810 including a network interface card, such as a LAN card or modem. The communication section 810 performs communication processing via a network such as the Internet. A drive 811 may also be connected to I / O interface 806 as needed. A removable medium 812, such as a hard disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 811 as needed so that computer programs read from it can be installed into storage section 809 as needed.

[0102] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 810, and / or installed from removable medium 812. When the computer program is executed by central processing unit (CPU) 801 and graphics processing unit (GPU) 802, the functions defined in the methods of this invention are performed.

[0103] It should be noted that the computer-readable medium described in this invention can be a computer-readable signal medium, a computer-readable medium, or any combination thereof. A computer-readable medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or any combination thereof. More specific examples of a computer-readable medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution apparatus, device, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than a computer-readable medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution device, apparatus, or apparatus. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0104] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0105] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using dedicated hardware-based devices that perform the specified functions or operations, or using a combination of dedicated hardware and computer instructions.

[0106] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be located in a processor.

[0107] In another aspect, the present invention also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to perform the method steps as described in the first aspect of the present invention.

[0108] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this invention.

Claims

1. A method for improving a classification model with imbalanced multi-class samples, characterized in that, The method includes the following steps: The training steps involve analyzing the acquired training data, combining and grouping categories according to the amount of data in each category and the preset data grouping and division rules, and then using the group classification model and the sub-category classification model in the hierarchical structure classification model to perform layer-by-layer classification training. The prediction process involves first loading the group classification model and the sub-category classification model for each group, then inputting the prediction data into the group classification model for classification prediction to determine the group label for each group, and finally selecting the corresponding sub-category classification model based on the group label to perform the final sub-category prediction. The hierarchical classification model includes: a first-layer group classification model, primarily used for training classification on the divided groups, with the training labels being group labels. One group corresponds to one group tag. Represents the group label of the k-th group, and satisfies the condition ; The sub-classification models corresponding to each group in the second layer are mainly used for classification training of each sub-category in each group, and the training labels are the category labels of each sub-category. One category corresponds to one category label. Indicates the kth group. A tag, Then it represents the number of categories in the k-th group, and satisfies the condition. .

2. The method for improving the imbalanced classification model of multi-class samples according to claim 1, characterized in that, In the training step, the grouped data is input into the group classification model with the group as the label unit for the first layer training; Meanwhile, the data within each group are input into their respective sub-category classification models for the second layer training; The training of each group classification model is carried out simultaneously and in parallel, and finally the trained classification models of each layer and each group are saved.

3. The method for improving the imbalanced classification model of multi-class samples according to claim 1, characterized in that, According to the preset data grouping and partitioning rules, the following conditions must be met simultaneously when performing category combination and grouping: Category data of the same magnitude are grouped together. The difference in the total sample size for each group shall not exceed ±20% of the average total sample size for each group.

4. The method for improving the imbalanced classification model of multi-class samples according to claim 3, characterized in that, Suppose that after data analysis, the data needs to be divided into k groups, and the number of categories in each group is... If we express this as an expression, then the total number of samples in the k-th group is: ; in, This represents the total number of samples in the k-th group. This represents the number of samples in the i-th category within the k-th group. Let represent the number of categories in the k-th group, and satisfy the condition. ; Assume the total number of training data samples is Then we have: ; in, The total number of training data samples is represented by k, and the number of groups is represented by k. Let $k$ represent the total number of samples in the $k$-th group, and $k$ satisfy the condition $k = \frac{\ ... .

5. The method for improving the imbalanced classification model of multi-class samples according to claim 1, characterized in that, The group classification model in the first layer and the sub-category classification models in the second layer both use FastText classification for training and evaluation.

6. The method for improving the imbalanced classification model of multi-class samples according to claim 5, characterized in that, The prediction step also includes a final unified aggregation calculation of the sub-category labels to obtain the final predicted category result. In the unified aggregation calculation, one sub-category label corresponds to one real multi-category label.

7. A system for improving a classification model with imbalanced multi-class samples, characterized in that, The system includes: Data acquisition and analysis module: used to acquire training data and perform data analysis; Category combination and grouping module: used to combine and group categories based on the amount of data in each category and preset data grouping and division rules; Hierarchical classification model module: This module is used to perform layer-by-layer classification training using the group classification model and the sub-category classification models of each group within the hierarchical classification model. The hierarchical classification model includes the first layer, the group classification model, which is primarily used for training classification on the divided groups. The training labels are the group labels. One group corresponds to one group tag. Represents the group label of the k-th group, and satisfies the condition The second layer consists of sub-classification models corresponding to each group. These models are primarily used for training classification of each sub-category within each group, with the training labels being the category labels of each sub-category. One category corresponds to one category label. Indicates the kth group. A tag, Then it represents the number of categories in the k-th group, and satisfies the condition. ; Hierarchical model prediction module: It is used to first input the prediction data into the group classification model for classification prediction to determine the group label of each group, and then select the corresponding sub-category classification model according to the group label; Aggregation Calculation Module: Used to perform unified aggregation calculation on sub-category labels to obtain the final predicted category result.

8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Visibility hierarchical prediction model based on correlation analysis and data equalization

    CN111832230A

  • Bioinformatics data classification method and system based on optimal multi-class balanced sampling

    CN114974431A