Classification model training method, classification method, device and equipment
By training the sub-classification model and the total classification model, combining the probability value differences between the sub-category and the total category, the problems of multi-label categories incomplete and labeling errors in multi-label classification are solved, and the classification accuracy of the multi-classification model is improved.
Patent Information
- Application Number
- CN201910901232.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-23
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2039-12-11
AI Technical Summary
During the multi-label classification process, when the multi-label category is incomplete or sample labeling is wrong during the training process, the training multi-classification model leads to inaccurate classification, reducing the classification accuracy of the information to be classified.
By obtaining subclass samples, total classification samples and multi-class samples, train subclass models, total classification models and multi-class models respectively, use the probability value difference of subcategory and total category to train multi-class models to reduce noise impact and improve classification accuracy Spend.
It effectively improves the classification accuracy of information to be classified, reduces the impact of subcategory incomplete subcategory or sample labeling errors on multi-classification models, and ensures the accuracy of classification results.
Smart Images

Figure CN110781919B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to classification technology in the field of artificial intelligence, and in particular to a classification model training method, a classification method, a device and equipment. Background Art
[0002] Information classification includes single-label classification and multi-label classification. Single-label classification refers to the classification of information to be classified corresponding to only one category label, while multi-label classification refers to the classification of information to be classified corresponding to multiple different category labels at the same time. Since the information to be classified generally has multiple semantics, multi-label classification of the information to be classified can mine more semantic information corresponding to the information to be classified, and the classification granularity is fine and the classification effect is good.
[0003] When performing multi-label classification on information to be classified, features are usually extracted first, and then the probability values of the information to be classified belonging to each category are determined based on the extracted features and the trained multi-classification model. Finally, each probability value is compared with the corresponding preset probability values to determine the category to which the information to be classified belongs. However, in the above-mentioned multi-label classification process, if the trained multi-classification model has incomplete multi-label categories or incorrect sample annotations during the training process, the classification of the trained multi-classification model will be inaccurate, and therefore the classification accuracy of the information to be classified will be low. Summary of the invention
[0004] The embodiments of the present invention provide a classification model training method, a classification method, a device and an apparatus, which can improve the accuracy of classifying information to be classified.
[0005] The technical solution of the embodiment of the present invention is achieved as follows:
[0006] An embodiment of the present invention provides a classification model training method, comprising:
[0007] Obtain sub-classification samples, total classification samples and multi-classification samples; the sub-classification samples are sample pairs of classification information and sub-classification results, the total classification samples are sample pairs of sub-classification results and total classification results, and the multi-classification samples are sample pairs of classification information, sub-classification results and total classification results;
[0008] The sub-classification samples are used to continuously train the original sub-classification model until the difference between the predicted probability value of the sub-classification and the sub-classification result in the sub-classification samples meets the first training cutoff condition, thereby obtaining a sub-classification model; the sub-classification model is used to determine the probability value of the sub-classification of the classification information;
[0009] The total classification samples are used to continuously train the original total classification model until the difference between the predicted probability value of the total category and the total classification result in the total classification samples meets the second training cutoff condition, thereby obtaining a total classification model; the total classification model is used to determine the probability value of the total category of the sub-classification result; the sub-category belongs to the total category;
[0010] The multi-classification samples are used to continuously train the original multi-classification model until the difference between the predicted probability value of the sub-classification and the sub-classification result in the multi-classification samples, as well as the difference between the predicted probability value of the total class and the total classification result in the multi-classification samples, meet the third training cutoff condition, thereby obtaining a multi-classification model; the original multi-classification model is constructed by connecting the sub-classification model and the total classification model; the multi-classification model is used to determine the probability value of the sub-classification and the probability value of the total class of the classification information.
[0011] In the above scheme, after obtaining the multi-classification model, the method further includes:
[0012] When a new multi-classification sample is obtained, the multi-classification model is optimized based on the new multi-classification sample to perform classification using the optimized multi-classification model.
[0013] An embodiment of the present invention provides a classification method based on a classification model, the method comprising:
[0014] When the information to be classified is obtained, the information to be classified is classified using a multi-classification model to obtain a sub-classification probability value and a total classification probability value;
[0015] The multi-classification model is obtained by training based on a model for determining a probability value of a sub-class and a model for determining a probability value of a total class, and the multi-classification model is used to determine the probability value of the sub-class and the probability value of the total class of classification information, and the sub-class belongs to the total class;
[0016] When the total classification probability value is greater than a first total classification probability threshold, determining that the information to be classified belongs to a target total classification result of the total category, and determining a target classification result according to the target total classification result and the sub-classification probability value;
[0017] When the total classification probability value is not greater than the first total classification probability threshold, a target total classification result is obtained in which the information to be classified does not belong to the total category, and the target total classification result is used as the target classification result.
[0018] In the above scheme, after obtaining the target classification result, or after taking the target total classification result as the target classification result, the method further includes:
[0019] The target classification result is displayed through a display terminal.
[0020] In the above solution, when the information to be classified is obtained, the method further includes:
[0021] The information to be classified is classified using the optimized multi-classification model to obtain the sub-classification probability value and the total classification probability value; the optimized multi-classification model is a model obtained after optimizing the multi-classification model.
[0022] An embodiment of the present invention provides a classification device for a classification model, including:
[0023] A sample acquisition module, used to acquire sub-classification samples, total classification samples and multi-classification samples; the sub-classification samples are sample pairs of classification information and sub-classification results, the total classification samples are sample pairs of sub-classification results and total classification results, and the multi-classification samples are sample pairs of classification information, sub-classification results and total classification results;
[0024] A sub-classification model training module, used to continuously train the original sub-classification model using the sub-classification samples until the difference between the predicted sub-class probability value and the sub-classification result in the sub-classification samples meets a first training cutoff condition, thereby obtaining a sub-classification model; the sub-classification model is used to determine the probability value of the sub-classification of the classification information;
[0025] A general classification model training module is used to continuously train the original general classification model using the general classification samples until the difference between the predicted probability value of the general category and the general classification result in the general classification sample meets the second training cutoff condition, thereby obtaining a general classification model; the general classification model is used to determine the probability value of the general category of the sub-classification result; the sub-category belongs to the general category;
[0026] A multi-classification model training module is used to continuously train the original multi-classification model using the multi-classification samples until the difference between the predicted probability value of the sub-classification and the sub-classification result in the multi-classification samples, as well as the difference between the predicted probability value of the total category and the total classification result in the multi-classification samples, meet the third training cutoff condition, thereby obtaining a multi-classification model; the original multi-classification model is constructed by connecting the sub-classification model and the total classification model; the multi-classification model is used to determine the probability value of the sub-classification and the probability value of the total category of the classification information.
[0027] An embodiment of the present invention provides a classification device based on a classification model, comprising:
[0028] A classification module, for, when information to be classified is obtained, classifying the information to be classified using a multi-classification model to obtain a sub-classification probability value and a total classification probability value; wherein the multi-classification model is obtained by training based on a model for determining a probability value of a sub-classification and a model for determining a probability value of a total class, and the multi-classification model is used to determine the probability value of the sub-classification and the probability value of the total class of the classified information, and the sub-classification belongs to the total class;
[0029] A result determination module, configured to determine, when the total classification probability value is greater than a first total classification probability threshold, that the information to be classified belongs to a target total classification result of the total category, and determine the target classification result according to the target total classification result and the sub-classification probability value;
[0030] The result determination module is also used to obtain a target total classification result in which the information to be classified does not belong to the total category when the total classification probability value is not greater than the first total classification probability threshold, and use the target total classification result as the target classification result.
[0031] An embodiment of the present invention provides a classification model training device, including:
[0032] A first memory, used to store executable instructions;
[0033] The first processor is used to implement the classification model training method provided by an embodiment of the present invention when executing the executable instructions stored in the first memory.
[0034] An embodiment of the present invention provides a classification device based on a classification model, including:
[0035] A second memory, used for storing executable instructions;
[0036] The second processor is used to implement the classification method based on the classification model provided by the embodiment of the present invention when executing the executable instructions stored in the second memory.
[0037] An embodiment of the present invention provides a storage medium storing executable instructions for causing a processor to execute and implement the classification model training method provided by the embodiment of the present invention.
[0038] An embodiment of the present invention provides a storage medium storing executable instructions for causing a processor to execute the classification method based on the classification model provided by the embodiment of the present invention.
[0039] The embodiments of the present invention have the following beneficial effects: by using the difference between the predicted probability value of the sub-category and the sub-classification result in the multi-classification sample, as well as the difference between the predicted probability value of the total category and the total classification result in the multi-classification sample, the multi-classification model is jointly trained. Even if the sub-categories are incomplete or the samples are incorrectly labeled during the training process, only partial information of the differences corresponding to the sub-categories or samples is used to train the multi-classification model. Therefore, the influence of noise such as incomplete sub-categories or incorrect sample labeling on the trained multi-classification model can be reduced. Therefore, when the multi-classification model is used to classify the information to be classified, the information to be classified can be accurately classified, thereby improving the accuracy of the classification of the information to be classified. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is an optional architecture diagram of a classification system 100 provided in an embodiment of the present invention;
[0041] Figure 2a is a schematic diagram of the structure of a training server 200 provided in an embodiment of the present invention;
[0042] Figure 2b is a schematic diagram of the structure of a classification server 500 provided in an embodiment of the present invention;
[0043] Figure 3 It is an optional flow chart of the classification model training method provided by an embodiment of the present invention;
[0044] Figure 4 is a schematic diagram of an exemplary sub-classification model structure provided by an embodiment of the present invention;
[0045] Figure 5 is a schematic diagram of an exemplary general classification model structure provided by an embodiment of the present invention;
[0046] Figure 6 It is a schematic diagram of a process of training a multi-classification model provided by an embodiment of the present invention;
[0047] Figure 7 is a schematic diagram of an exemplary multi-classification model structure provided by an embodiment of the present invention;
[0048] Figure 8 is another optional flow chart of a classification method based on a classification model provided in an embodiment of the present invention;
[0049] Fig. 9 is a schematic diagram of an exemplary process of classification using a multi-classification model provided by an embodiment of the present invention;
[0050] Fig.10 It is another optional flow chart of the classification method based on the classification model provided in the embodiment of the present invention;
[0051] Fig.11 It is a schematic diagram of an exemplary classification process provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0053] In the following description, reference is made to “some embodiments” and “embodiments of the present invention,” which describe subsets of all possible embodiments, but it can be understood that “some embodiments” and “embodiments of the present invention” may be the same subsets or different subsets of all possible embodiments and may be combined with each other without conflict.
[0054] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein.
[0055] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meanings as those commonly understood by those skilled in the art of the present invention. The terms used in the embodiments of the present invention are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0056] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.
[0057] 1) Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0058] 2) Artificial neural network is a mathematical model that imitates the structure and function of biological neural networks. The exemplary structures of artificial neural networks in this article include feedforward (BP) neural networks and recurrent neural networks (RNN). The former is trained using the error back propagation algorithm. Artificial neural networks are used for function estimation or approximation, including input layers, intermediate layers and output layers. Each layer is composed of a large number of processing units interconnected. Each node uses an activation function to process the input data and output it to other nodes. Exemplary types of activation functions include threshold type, linear type and S growth curve (Sigmoid) type.
[0059] 2) Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills; reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning and inductive learning.
[0060] 3) Deep Learning (DL) is a new research direction in the field of machine learning. Deep learning is to learn the inherent laws and representation levels of sample data. The ultimate goal is to enable machines to have analytical learning capabilities like humans and to recognize data such as text, images, and sounds. Deep learning is a complex machine learning algorithm.
[0061] 4) Loss function, also known as cost function, is a function that maps the value of a random event or its related random variables into a non-negative real number to represent the "risk" or "loss" of the random event.
[0062] 5) Noise data refers to abnormal or erroneous data in the data, which may interfere with or have other negative impacts on people or models’ understanding of the overall data.
[0063] 6) Multi-label classification is relative to single-label classification. Assuming that the input of a model is the information to be classified, and the output is the category to which the information to be classified belongs; then single-label classification means that the information to be classified belongs to only one category (assuming there are N categories in total), while multi-label classification means that the information to be classified can belong to any K (K = 0, 1, 2, 3, ..., N) categories in N categories; in the embodiment of the present invention, multi-label classification is also called sub-classification, and single-label classification is also called general classification; that is, general classification refers to the classification process of determining whether the information to be classified belongs to a category (i.e., the general category, such as the violent and terrorist category); when a category includes multiple sub-categories (i.e., sub-categories, such as the violent and terrorist category includes the bloody category, the violent category, and the terrorist category), the classification process of determining which categories of the multiple sub-categories in the above-mentioned category the information to be classified belongs to is called sub-classification. In the embodiment of the present invention, classification refers to the process of performing sub-classification on the information to be classified, obtaining the sub-classification result, and then performing general classification judgment on the sub-classification result to obtain the classification result of the general classification.
[0064] 7) Residual, in artificial intelligence, refers to the difference between the actual value and the model input result value (fitted value).
[0065] 8) Classifier is a general term for methods of classifying samples in data mining, including decision trees, logistic regression, naive Bayes, neural networks and other algorithms; it refers to a classification function determined or a classification model constructed based on existing data, which can map data records in the database to one of the given categories.
[0066] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields; for example, common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless cars, autonomous driving, drones, robots, smart medical care and smart customer service; with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role; for example, artificial intelligence can also be applied in the field of information classification.
[0067] Here, it should be noted that artificial intelligence is a comprehensive technology in computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0068] In addition, artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0069] Generally speaking, when multi-label classification is performed on information to be classified, the features of the information to be classified are usually extracted manually, and the extracted features are classified based on the classification method of machine learning. For example, when the information to be classified is an image to be classified, the process of multi-label classification of the image to be classified is: manually extracting the image features of the image to be classified, such as gradient histogram, SIFT features and HOG features; and merging the extracted image features in a high-dimensional space by feature splicing and feature addition; then, using machine learning classification methods such as support vector machines, random forests and naive Bayes to classify the processed image features to obtain image classification results. However, in the above classification process, since the manually extracted features are not necessarily the features that are beneficial to multi-label classification, that is, the manually extracted features have a low correlation with the classification task; therefore, the expressive power of the manually extracted features is limited, and they cannot be applied to all situations, and have poor robustness; and when machine learning is applied to large-scale training data, the algorithm runs for a long time and has poor performance.
[0070] In addition, when multi-label classification is performed on the information to be classified, the features of the information to be classified can also be extracted based on deep learning, and the extracted features can be classified based on the classifier constructed by deep learning. For example, when the information to be classified is an image to be classified, the process of multi-label classification of the image to be classified is: extracting the image features of the image to be classified through a feature extraction model trained based on deep learning (for example, a convolutional neural network that can be adaptively learned), and performing dimensionality reduction processing on the extracted image features in space; then, a classifier composed of deep learning methods such as a feedforward neural network is used to classify the processed image features to obtain image classification results. However, in the above multi-label classification process, although the features extracted based on deep learning have been improved in feature expression ability, when the multi-classification model of the information to be classified is trained based on the features in the case of noise data in the sample, the classification results of the multi-classification model obtained are low in accuracy; and multi-label image classification corresponds to N categories and N thresholds corresponding to N categories, and the cost of setting or adjusting the N thresholds is large.
[0071] Based on this, the embodiments of the present invention provide a classification model training method, a classification method, a device and an apparatus, which can realize the classification of information to be classified based on artificial intelligence and improve the accuracy of the classification of information to be classified. In addition, the scheme provided by the embodiments of the present invention involves classification decision-making technology of artificial intelligence, such as model training for classification and classification using the trained model, etc., which will be described in detail below.
[0072] The following describes exemplary applications of the classification model training device and the classification device based on the classification model (hereinafter referred to as the classification device) provided by the embodiments of the present invention. The classification model training device provided by the embodiments of the present invention can be implemented as various types of user terminals such as smart phones, tablet computers, and laptop computers, and can also be implemented as a server; in addition, the classification device provided by the embodiments of the present invention can be implemented as various types of user terminals such as smart phones, tablet computers, and laptop computers, and can also be implemented as a server. The following describes exemplary applications when the classification model training device is implemented as a server and when the classification device is implemented as a server.
[0073] See also Figure 1 , Figure 1 It is an optional architectural diagram of the classification system 100 provided in an embodiment of the present invention. To support a classification application, the terminal 400 (terminal 400-1 and terminal 400-2 are shown as examples) is connected to the training server 200 (the server implemented by the classification model training device) and the classification server 500 (the server implemented by the classification device) through the network 300. The classification server 500 is connected to the training server 200. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0074] The terminal 400 is used to send classification samples (for example, classification samples, total classification samples and multi-classification samples in the embodiment of the present invention) to the training server 200 through the network 300, and to send information to be classified to the classification server 500 through the network 300; it is also used to receive the target classification result sent by the classification server 500 through the network 300, and display the target classification result in the graphical interface 410 (graphical interface 410-1 and graphical interface 410-2 are shown as examples). The training server 200 is used to receive the classification samples sent by the terminal 400 through the network 300, and use the classification samples to train the multi-classification model; the classification server 500 is used to receive the information to be classified sent by the terminal 400 through the network 300, and use the multi-classification model in the training server 200 to classify the information to be classified, obtain the target classification result, and finally send the target classification result to the terminal 400 through the network 300.
[0075] See also Figure 2a , Figure 2aFIG2 is a schematic diagram of the structure of a training server 200 provided in an embodiment of the present invention. The training server 200 shown in FIG2 includes: at least one first processor 210, a first memory 250, at least one first network interface 220, and a first user interface 230. The various components in the training server 200 are coupled together through a first bus system 240. It can be understood that the first bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in FIG2 , the first bus system 240 is used to connect the first bus system 240 to the first bus system 240. Figure 2a In the figure, various buses are labeled as a first bus system 240 .
[0076] The first processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0077] The first user interface 230 includes one or more first output devices 231 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The first user interface 230 also includes one or more first input devices 232, including user interface components that facilitate user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons and controls.
[0078] The first memory 250 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The first memory 250 described in the embodiment of the present invention is intended to include any suitable type of memory. The first memory 250 optionally includes one or more storage devices that are physically far away from the first processor 210.
[0079] In some embodiments, the first memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0080] The first operating system 251 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0081] A first network communication module 252, used to reach other computing devices via one or more (wired or wireless) first network interfaces 220, exemplary first network interfaces 220 include: Bluetooth, Wireless Fidelity (Wi-Fi), and Universal Serial Bus (USB), etc.;
[0082] A first display module 253 for enabling presentation of information (e.g., a user interface for operating peripherals and displaying content and information) via one or more first output devices 231 (e.g., a display screen, a speaker, etc.) associated with the first user interface 230;
[0083] The first input processing module 254 is configured to detect one or more user inputs or interactions from one of the one or more first input devices 232 and to translate the detected inputs or interactions.
[0084] In some embodiments, the classification model training device provided by the embodiments of the present invention can be implemented in software. Figure 2a A classification model training device 255 stored in the first memory 250 is shown, which may be software in the form of a program and a plug-in, etc., and includes the following software modules: a sample acquisition module 2551, a sub-classification model training module 2552, a general classification model training module 2553 and a multi-classification model training module 2554. The functions of each module will be described below.
[0085] See also Figure 2b , Figure 2b is a schematic diagram of the structure of a classification server 500 provided in an embodiment of the present invention, Figure 2b The classification server 500 shown includes: at least one second processor 510, a second memory 550, at least one second network interface 520 and a second user interface 530. The various components in the classification server 500 are coupled together via a second bus system 540. It can be understood that the second bus system 540 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the second bus system 540 is not described in detail. Figure 2b In the figure, various buses are labeled as a second bus system 540.
[0086] The second processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0087] The second user interface 530 includes one or more second output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The second user interface 530 also includes one or more second input devices 532, including user interface components that facilitate user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons and controls.
[0088] The second memory 550 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The second memory 550 described in the embodiment of the present invention is intended to include any suitable type of memory. The second memory 550 optionally includes one or more storage devices that are physically far away from the second processor 510.
[0089] In some embodiments, the second memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0090] The second operating system 551 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0091] A second network communication module 552, used to reach other computing devices via one or more (wired or wireless) second network interfaces 220, exemplary second network interfaces 520 include: Bluetooth, Wireless Fidelity (Wi-Fi), and Universal Serial Bus (USB);
[0092] a second display module 553 for enabling presentation of information (e.g., a user interface for operating peripherals and displaying content and information) via one or more second output devices 531 (e.g., a display screen, a speaker, etc.) associated with the second user interface 230;
[0093] The second input processing module 554 is used to detect one or more user inputs or interactions from one of the one or more second input devices 532 and translate the detected inputs or interactions.
[0094] In some embodiments, the classification device provided by the embodiments of the present invention can be implemented in software. Figure 2bA classification device (hereinafter referred to as classification device) 555 based on classification model training stored in the second memory 550 is shown, which can be software in the form of programs and plug-ins, etc., including the following software modules: a classification module 5551 and a result determination module 5552. The functions of each module will be explained below.
[0095] In other embodiments, the classification model training device and classification device provided by the embodiments of the present invention can be implemented in hardware. As an example, the classification model training device and classification device provided by the embodiments of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the classification method provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0096] Next, the classification model training method provided by the embodiment of the present invention will be described in combination with an exemplary application of the classification model training device provided by the embodiment of the present invention implemented as a training server.
[0097] See also Figure 3 , Figure 3 is an optional flow chart of the classification model training method provided by the embodiment of the present invention, which will be combined with Figure 3 The steps shown are explained.
[0098] S101, obtaining sub-classification samples, total classification samples and multi-classification samples; sub-classification samples are sample pairs of classification information and sub-classification results, total classification samples are sample pairs of sub-classification results and total classification results, and multi-classification samples are sample pairs of classification information, sub-classification results and total classification results.
[0099] It should be noted that the model for classification finally trained in the embodiment of the present invention needs to be obtained through three stages of model training. In these three stages, each stage uses samples corresponding to each stage for model training; therefore, the classification model training device needs to obtain three types of samples corresponding to the three stages, namely, sub-classification samples, total classification samples and multi-classification samples; wherein, the sub-classification samples are the training samples of the model in the first stage, the total classification samples are the training samples of the model in the second stage, and the multi-classification samples are the training samples in the third stage. In addition, the sub-classification samples are sample pairs of classification information and sub-classification results, the total classification samples are sample pairs of sub-classification results and total classification results, and the multi-classification samples are sample pairs of classification information, sub-classification results and total classification results; wherein, the classification information refers to information for determining the classification result using the model, the sub-classification result refers to the classification result of the sub-category of the classification information noted, and the total classification result refers to the classification result of the total category of the classification information noted; and the number of sub-categories is at least one, and the sub-categories belong to the total category.
[0100] Here, when the classification model training device obtains sub-classification samples, total classification samples and multi-classification samples, it can be obtained from other devices by interacting with other devices, or obtained from its own data storage module, or other acquisition methods, and the embodiments of the present invention do not specifically limit this. In addition, the classification information in the sub-classification samples and the classification information in the multi-classification samples can be the same or different; and the sub-classification results in the sub-classification samples and the sub-classification results in the total classification samples can be the same or different; and the total classification results in the total classification samples and the total classification results in the multi-classification samples can be the same or different.
[0101] S102. Using sub-classification samples, continuously train the original sub-classification model until the difference between the predicted probability value of the sub-classification and the sub-classification result in the sub-classification sample meets the first training cutoff condition, thereby obtaining a sub-classification model; the sub-classification model is used to determine the probability value of the sub-classification of the classification information; the sub-classification belongs to the total category.
[0102] In the embodiment of the present invention, after the classification model training device obtains the sub-classification sample, it builds a model to be trained for determining the probability value of the sub-classification of the classification information, that is, the original sub-classification model; thereafter, the sub-classification sample is used to train the original sub-classification model, and the first stage of model training begins. The training process is iterative, and the original sub-classification model is trained at the beginning, the second time is to train the original sub-classification model after the first training, the third time is to train the original sub-classification model after the second training..., and the original sub-classification model is continuously trained in sequence until the currently trained model predicts the sample information in the sub-classification sample, and the difference between the predicted probability value of the sub-classification and the sub-classification result in the sub-classification sample is less than or equal to the first training cutoff threshold, that is, when the first training cutoff condition is met, the training is stopped, and the trained model at this time is the sub-classification model.
[0103] It should be noted that the sub-classification samples are samples in the first stage of model training; the sub-classification model is a model obtained by iteratively training the original sub-classification model using the sub-classification samples, and is used to determine the probability value of the sub-category of the classification information.
[0104] S103. Using the total classification samples, continuously train the original total classification model until the difference between the predicted total category probability value and the total classification result in the total classification sample meets the second training cutoff condition, and obtain the total classification model; the total classification model is used to determine the total category probability value of the sub-classification result.
[0105] In an embodiment of the present invention, after the classification model training device obtains the total classification sample, it builds a model to be trained for determining the probability value of the total category of the classification information, that is, the original total classification model; thereafter, the total classification sample is used to train the original total classification model, and the second stage of model training begins. The training process is iterative, and the original total classification model is trained at the beginning, the second time is to train the original total classification model after the first training, the third time is to train the original total classification model after the second training..., and the original total classification model is continuously trained in sequence until the current trained model predicts the sub-classification results in the total classification sample, and the difference between the predicted total category probability value and the total classification result in the total classification sample is less than or equal to the second training cutoff threshold, that is, when the second training cutoff condition is met, the training is stopped, and the trained model at this time is the total classification model.
[0106] It should be noted that the total classification samples are the samples in the second stage of model training; the total classification model is a model obtained by iteratively training the original total classification model using the total classification samples, which is used to determine the probability value of the total category of the classification information.
[0107] It should also be noted that there is no order of execution for S102 and S103; that is, S102 can be used as the model training process of the first stage or as the model training process of the second stage, but when S102 is used as the model training process of the first stage, S103 is the model training process of the second stage, as described above; and when S103 is used as the model training process of the first stage, S102 is the model training process of the second stage; wherein, the process of training to obtain the sub-classification model and the process of training to obtain the general classification model remain unchanged.
[0108] S104. Using multi-classification samples, continuously training the original multi-classification model until the difference between the predicted probability value of the sub-classification and the sub-classification result in the multi-classification sample, as well as the difference between the predicted probability value of the total category and the total classification result in the multi-classification sample, meets the third training cutoff condition, thereby obtaining the multi-classification model; the original multi-classification model is constructed by connecting the sub-classification model and the total classification model; the multi-classification model is used to determine the probability value of the sub-classification and the probability value of the total category of the classification information.
[0109] In an embodiment of the present invention, after the training of the sub-classification model and the total classification model is completed, the sub-classification model and the total classification model are connected to form an original multi-classification model, and the construction of the model for determining the probability value of the sub-classification of the classification information and the probability value of the total category is completed. Thereafter, the original multi-classification model is trained using multi-classification samples to start the third stage of model training. The training process is iterative. The original multi-classification model is trained at the beginning, the original multi-classification model after the first training is trained for the second time, and the original multi-classification model after the second training is trained for the third time..., and the original multi-classification model is continuously trained in sequence until the current trained model predicts the classification information in the multi-classification sample. When the predicted probability value of the sub-classification is compared with the sub-classification result in the multi-classification sample, and the predicted probability value of the total category is compared with the total classification result in the multi-classification sample, the difference is less than or equal to the third training cutoff threshold, that is, when the third training cutoff condition is met, the training is stopped, and the trained model at this time is the multi-classification model.
[0110] It should be noted that the multi-classification samples are the samples in the third stage of model training; the multi-classification model is a model obtained by iteratively training the original multi-classification model using multi-classification samples, which is used to determine the probability values of subcategories of classification information and the probability values of total categories.
[0111] Here, the original multi-classification model may also be constructed by connecting the original sub-classification model and the original general classification model, and the embodiment of the present invention does not specifically limit this.
[0112] It can be understood that by connecting the sub-classification model and the general classification model to build the original multi-classification model, since the sub-classification model and the general classification model are trained models, the parameter information in the original multi-classification model is properly initialized, which is more conducive to the training of the multi-classification model and quickly enables the model to reach convergence balance.
[0113] It should also be noted that the original sub-classification model, the original total classification model and the original multi-classification model in the embodiments of the present invention are all deep learning models.
[0114] It can be understood that, on the one hand, since the multi-classification model trained by the embodiment of the present invention is trained based on two differences (the difference between the probability value of the sub-category and the sub-classification result in the multi-classification sample, and the difference between the predicted probability value of the total category and the total classification result in the multi-classification sample), the influence of noise data such as incomplete sub-categories or incorrect sample labeling information (sub-classification results and total classification results in the multi-classification sample) is reduced; therefore, the classification results output by the multi-classification model are highly accurate.
[0115] Further, in the embodiment of the present invention, the classification model training device in 102 uses the sub-classification samples to continuously train the original sub-classification model until the difference between the predicted sub-class probability value and the sub-classification result in the sub-classification sample meets the first training cutoff condition, and obtains the sub-classification model, including S1021-S1024:
[0116] S1021. Based on the original sub-classification model, sub-classify the classification information in the sub-classification sample and predict the first sub-classification prediction probability value.
[0117] In an embodiment of the present invention, the process of training the classification model training device to obtain the sub-classification model is iterative. During the first training process, the original sub-classification model is used to sub-classify the classification information in the sub-classification sample, and the predicted sub-classification probability value is the first sub-classification predicted probability value.
[0118] It should be noted that sub-classification refers to a processing operation of determining a probability value of a sub-category of classification information.
[0119] S1022. Obtain a first sub-classification difference between the first sub-classification prediction probability value and the sub-classification result in the sub-classification sample.
[0120] In an embodiment of the present invention, after the classification model training device obtains the first subclassification prediction probability value, it compares the first subclassification prediction probability value with the annotation information, that is, compares the first subclassification prediction probability value with the subclassification result in the subclassification sample, and the comparison result obtained is the first subclassification difference.
[0121] It should be noted that, since the number of subcategories is at least one, the first subcategories difference is a set of differences corresponding to each subcategory. In addition, the first subcategories difference represents the subcategories effect of the currently trained model.
[0122] For example, the difference corresponding to each sub-category in the first sub-category difference can be calculated using formula (1), which is as follows:
[0123] BCELoss(f x ,f y )=-f y log(f x )-(1-f y )log(1-f x ) (1)
[0124] Among them, BCELoss(f x ,f y ) is the difference corresponding to a subcategory in the first subcategory difference, f x The probability value of a subcategory in the predicted probability value of the first subcategory, f y It is the result (1 or 0) of a sub-category in the sub-classification result of the sub-classification sample.
[0125] S1023. Train the original sub-classification model using the first sub-classification difference and the sub-classification samples.
[0126] In an embodiment of the present invention, when the first sub-classification difference is not less than or equal to the first training cutoff threshold, that is, the first training cutoff condition is not met, the first sub-classification difference is used to adjust the parameter information of the original sub-classification model; then the adjusted original sub-classification model is used to sub-classify the classification information in the sub-classification sample, and the difference between the result of the sub-classification and the sub-classification result in the sub-classification sample is obtained, similar to the process of training the original sub-classification model using the first sub-classification difference, and iterative training is performed; that is, the first sub-classification difference and the sub-classification sample are used to train the original sub-classification model.
[0127] S1024: until the difference between the probability value of the subcategory of the subcategory sample predicted by the trained original subcategory model and the subcategory result in the subcategory sample satisfies the first training cutoff condition, a subcategory model is obtained.
[0128] In an embodiment of the present invention, during the iterative training of the original sub-classification model by the classification model training device, if the probability value of the subcategory of the sub-classification sample predicted by the trained original sub-classification model is compared with the sub-classification result in the sub-classification sample, and the difference obtained is less than or equal to the first training cutoff threshold, that is, when the first training cutoff condition is met, it indicates that the training of the model has reached a convergence equilibrium, and the training is stopped. At this time, the trained model is the sub-classification model.
[0129] join Figure 4 , Figure 4 is a schematic diagram of an exemplary sub-classification model structure provided by an embodiment of the present invention, such as Figure 4 As shown, the sub-classification model 4-1 includes a feature extraction model 4-11 (for example, "ResNet") and a multi-label classification model 4-12; wherein the feature extraction model 4-11 is used to obtain the features of the information to be classified, and input the extracted features into the multi-label classification model 4-12; and the multi-label classification model 4-12 is used to obtain the probability value corresponding to each sub-category based on the feature calculation, and a circle in 4-12 is a sub-category.
[0130] Further, in the embodiment of the present invention, the classification model training device in 103 uses the total classification samples to continuously train the original total classification model until the difference between the predicted total category probability value and the total classification result in the total classification sample meets the second training cutoff condition, and obtains the total classification model, including S1031-S1034:
[0131] S1031. Based on the original general classification model, the sub-classification results in the general classification samples are classified and the first general classification prediction probability value is predicted.
[0132] In an embodiment of the present invention, the process of training the classification model training device to obtain the general classification model is iterative. During the first training process, the original general classification model is used to perform general classification on the sub-classification results in the general classification samples, and the predicted probability value of the general classification is the first general classification prediction probability value.
[0133] It should be noted that the total classification refers to a processing operation of determining the probability value of the total category of the classification information.
[0134] S1032. Obtain the first total classification difference between the first total classification prediction probability value and the total classification result in the total classification sample.
[0135] In an embodiment of the present invention, after obtaining the first total classification prediction probability value, the classification model training device compares the first total classification prediction probability value with the annotation information, that is, compares the first total classification prediction probability value with the total classification result in the total classification sample, and the obtained comparison result is the first total classification difference. Here, the first total classification difference represents the total classification effect of the currently trained model.
[0136] For example, the first total classification difference can be calculated using formula (2), which is as follows:
[0137] Loss(c x ,c y )=-c y logc x(2)
[0138] Among them, Loss(c x ,c y ) is the first general classification difference, c x is the predicted probability value of the first total classification, c y is the total classification result (1 or 0) of the sub-classification sample.
[0139] S1033. Use the first total classification difference and the total classification samples to train the original total classification model.
[0140] In an embodiment of the present invention, when the first total classification difference is not less than or equal to the second training cutoff threshold, that is, the second training cutoff condition is not met, the first total classification difference is used to adjust the parameter information of the original total classification model; then the adjusted original total classification model is used to perform a total classification on the sub-classification results in the total classification samples, and the difference between the total classification result and the total classification result in the total classification sample is obtained, similar to the process of training the original total classification model using the first total classification difference, and the training is iterative; that is, the first total classification difference and the total classification samples are used to train the original total classification model.
[0141] S1034, until the difference between the probability value of the total category of the sub-classification samples predicted by the trained original total classification model and the total classification result of the total classification samples meets the second training cutoff condition, the total classification model is obtained.
[0142] In an embodiment of the present invention, during the iterative training of the original total classification model by the classification model training device, if the probability value of the total category of the total classification sample predicted by the trained original total classification model is compared with the total classification result in the total classification sample, and the difference obtained is less than or equal to the second training cutoff threshold, that is, when the second training cutoff condition is met, it indicates that the training of the model has reached a convergence equilibrium, and the training is stopped. At this time, the trained model is the total classification model.
[0143] join Figure 5 , Figure 5 is a schematic diagram of an exemplary general classification model structure provided by an embodiment of the present invention, such as Figure 5 As shown, the general classification model 5-1 is a model that calculates the probability value corresponding to the general category based on the sub-classification results, wherein 5-11 is the sub-category, and 5-12 is the general category and the non-general category.
[0144] Further, see Figure 6 , Figure 6 is a flow chart of a training multi-classification model provided by an embodiment of the present invention, such as Figure 6As shown, the training steps of the multi-classification model include: S1041-S1042, S10431-S10432 and S1044; in addition, in the embodiment of the present invention, the classification model training device in 103 uses multi-classification samples to continuously train the original multi-classification model until the difference between the predicted sub-class probability value and the sub-classification result in the multi-classification sample, and the difference between the predicted total class probability value and the total classification result in the multi-classification sample meet the third training cutoff condition, and the multi-classification model is obtained, including S1041-S1044:
[0145] S1041. Based on the original multi-classification model, classify the classification information in the multi-classification sample, and predict the second sub-classification prediction probability value and the second total classification prediction probability value.
[0146] In an embodiment of the present invention, the process of training a multi-classification model by a classification model training device is iterative. During the first training process, the original multi-classification model is used to classify the classification information in the multi-classification samples, and the predicted probability value of the sub-classification is the second sub-classification predicted probability value, and the predicted probability value of the total classification is the second total classification predicted probability value.
[0147] It should be noted that classification refers to a processing operation of determining the probability value of a subcategory of classification information and the probability value of a total category.
[0148] S1042. Obtain a second sub-class difference between the second sub-class prediction probability value and the sub-classification result in the multi-classification sample, and a second total classification difference between the second total classification prediction probability value and the total classification result in the multi-classification sample.
[0149] In an embodiment of the present invention, after the classification model training device obtains the second sub-classification prediction probability value and the second total classification prediction probability value, the second sub-classification prediction probability value and the second total classification prediction probability value are compared with the annotation information respectively, that is, the second sub-classification prediction probability value is compared with the sub-classification result in the multi-classification sample, and the second total classification prediction probability value is compared with the total classification result in the multi-classification sample; wherein, the comparison result of the second sub-classification prediction probability value and the sub-classification result in the multi-classification sample is the second sub-classification difference, and the comparison result of the second total classification prediction probability value and the total classification result in the multi-classification sample is the second total classification difference.
[0150] It should be noted that the second sub-classification difference and the second total classification difference represent the classification effect of the currently trained model.
[0151] S1043. Train the original multi-classification model using the second sub-classification difference, the second total classification difference, and the multi-classification samples.
[0152] In an embodiment of the present invention, when the difference combined by the second sub-classification difference and the second total classification difference is not less than or equal to the third training cutoff threshold, that is, the third training cutoff condition is not met, the second sub-classification difference and the second total classification difference are used to adjust the parameter information of the original multi-classification model; the adjusted original multi-classification model is then used to classify the classification information in the multi-classification sample, and the difference between the classification result and the sub-classification result and the total classification result in the multi-classification sample is obtained, similar to the process of training the original multi-classification model using the second sub-classification difference and the second total classification difference, and the training is iterative; that is, the second sub-classification difference, the second total classification difference and the multi-classification sample are used to train the original multi-classification model.
[0153] S1044. The multi-classification model is obtained until the difference between the probability value of the sub-class of the multi-classification sample predicted by the trained original multi-classification model and the sub-classification result in the multi-classification sample, as well as the difference between the probability value of the total class of the multi-classification sample predicted and the total classification result in the total classification sample, meets the third training cutoff condition.
[0154] In an embodiment of the present invention, during the iterative training of the original multi-classification model by the classification model training device, if the probability value of the subcategory of the multi-classification sample predicted by the trained original multi-classification model is compared with the probability value of the subcategory of the multi-classification sample, and the predicted probability value of the total category is compared with the total classification result in the multi-classification sample, the difference obtained is less than or equal to the third training cutoff threshold, that is, when the third training cutoff condition is met, it indicates that the training of the model has reached a convergence equilibrium, and the training is stopped. At this time, the trained model is the multi-classification model.
[0155] join Figure 7 , Figure 7 is a schematic diagram of an exemplary multi-classification model structure provided by an embodiment of the present invention, such as Figure 7 As shown, the multi-classification model 7-1 includes "ResNet" 7-11, a multi-label classification model 7-12 and a binary classification model 7-13; wherein, "ResNet" 7-11 is used to obtain the features of the information to be classified, and input the extracted features into the multi-label classification model 7-12; the multi-label classification model 7-12 is used to calculate the probability value corresponding to each subcategory based on the features, and input the probability value corresponding to each subcategory into the binary classification model 7-13, and a circle in the multi-label classification model 7-12 is a subcategory; the binary classification model 7-13 is used to calculate the probability value corresponding to the total category based on the probability value corresponding to each subcategory, and the circles in the binary classification model 7-13 are the total category and the non-total category.
[0156] Further, in the embodiment of the present invention, the classification model training device in S1043 uses the second sub-classification difference, the second total classification difference and the multi-classification samples to train the original multi-classification model, including S10431-S10432:
[0157] S10431. The sum of the product of the second sub-classification difference and the sub-classification difference weight and the product of the second general classification difference and the general classification difference weight is taken as the first loss function.
[0158] In an embodiment of the present invention, the classification model training device can obtain the sub-classification difference weight and the total classification difference weight in advance, or the classification model training device is pre-set with the sub-classification difference weight and the total classification difference weight for combining the second sub-classification difference and the second total classification difference; the combination process is to add the product of the second sub-classification difference and the sub-classification difference weight, and the product of the second total classification difference and the total classification difference weight; the result of the combination is the first loss function.
[0159] It should be noted that the sub-classification difference weight is smaller than the total classification difference weight. For example, the sub-classification difference weight is 0.01, and the total classification difference weight is 0.99. At this time, the first loss function is shown in formula (3):
[0160] Loss3=0.01*Loss1+0.99*Loss2 (3)
[0161] Among them, Loss3 is the first loss function, Loss1 is the second word classification difference, and Loss2 is the second total classification difference; and the difference corresponding to a subcategory in Loss1 is obtained in the same way as BCELoss(f x ,f y ) is obtained in the same way as Loss(c x ,c y ) is obtained in the same way as above, and can be obtained through the above formula (2).
[0162] It can be understood that by setting the sub-classification difference weight smaller than the total classification difference weight, the impact of noise data such as incomplete sub-categories or incorrect sample labeling information is reduced to a greater extent, further improving the classification accuracy of the multi-classification model.
[0163] S10432. Use the first loss function and multi-classification samples to train the original multi-classification model.
[0164] In an embodiment of the present invention, when the first loss function is not less than or equal to the third training cutoff threshold, that is, the third training cutoff condition is not met, the original multi-classification model is iteratively trained using the first loss function and multi-classification samples.
[0165] Further, in an embodiment of the present invention, the classification model training device in S10432 uses the first loss function and multi-classification samples to train the original multi-classification model, including: the classification model training device adjusts the parameter information of the original multi-classification model according to the first loss function; based on the adjusted original multi-classification model, classifies the classification information in the multi-classification samples, and predicts a third sub-classification prediction probability value and a third total classification prediction probability value; obtains the third sub-classification difference between the third sub-classification prediction probability value and the sub-classification result in the multi-classification sample, as well as the third total classification difference between the third total classification prediction probability value and the total classification result in the multi-classification sample, to obtain the second loss function; uses the second loss function and multi-classification samples to train the adjusted original multi-classification model.
[0166] That is to say, the classification model training device uses the method of obtaining the first loss function and uses the first loss function to adjust the parameter information of the original multi-model to implement the model training process, and iteratively trains to obtain the multi-classification model.
[0167] Furthermore, in an embodiment of the present invention, after the classification model training device in S104 obtains the multi-classification model, the classification model training method also includes S105: when a new multi-classification sample is obtained, the multi-classification model is optimized based on the new multi-classification sample to perform classification using the optimized multi-classification model.
[0168] In the embodiment of the present invention, after the classification model training device completes the training of the multi-classification model, it can also optimize the multi-classification model based on the new multi-classification samples by acquiring new multi-classification samples.
[0169] It should be noted that the process in which the classification model training device uses new multi-classification samples to optimize the multi-classification model to obtain the optimized multi-classification model is similar to the process in which the original multi-classification model is trained using multi-classification samples to obtain the multi-classification model. The embodiments of the present invention will not be repeated here.
[0170] In addition, in the embodiment of the present invention, after the classification model training device obtains the optimized multi-classification model, the optimized multi-classification model can be used for classification.
[0171] Furthermore, in an embodiment of the present invention, loss functions such as the first loss function and the second loss function are also used to obtain samples for targeted training models. Here, the first loss function is used for illustration: the classification model training device in S10431 uses the product of the second sub-classification difference and the sub-classification difference weight, plus the product of the second total classification difference and the total classification difference weight as the first loss function, and the classification method also includes: the classification model training device obtains the target multi-classification sample based on the first loss function; the feature difference between the target multi-classification sample and the multi-classification sample is lower than the feature difference threshold; based on the target multi-classification sample, the original multi-classification model is trained. In this way, the convergence of the multi-classification model can be accelerated.
[0172] That is to say, after the classification model training device obtains the first loss function, if the difference between the first loss function and the third training cutoff threshold is large (greater than the difference threshold), it indicates that the original multi-classification model trained at this time has poor classification effect on the current samples (multi-classification samples); at this time, the classification model training device can obtain more target samples (target multi-classification samples) similar to the current samples for targeted training, thereby improving the training efficiency of the multi-classification model.
[0173] Next, the classification method based on the classification model provided by the embodiment of the present invention will be described in combination with an exemplary application of the classification model training device provided by the embodiment of the present invention implemented as a classification model training server.
[0174] See also Figure 8 , Figure 8 is an optional flow chart of a classification method based on a classification model provided in an embodiment of the present invention, which will be combined with Figure 8 The steps shown are explained.
[0175] S106. When the information to be classified is obtained, the multi-classification model is used to classify the information to be classified to obtain a sub-classification probability value and a total classification probability value; wherein the multi-classification model is trained based on a model for determining a probability value of a sub-classification and a model for determining a probability value of a total category, and the multi-classification model is used to determine the probability value of a sub-classification and the probability value of a total category of the classified information, and the sub-classification belongs to the total category.
[0176] In the embodiment of the present invention, after the classification device completes the training of the multi-classification model, if the information to be classified is obtained, the multi-classification model can be used to classify the information to be classified, and the classification result obtained includes a sub-classification probability value and a total classification probability value. Here, the sub-classification probability value is the probability value of the sub-category corresponding to the information to be classified, and the total classification probability value is the probability value of the total category corresponding to the information to be classified.
[0177] It should be noted that the multi-classification model is trained based on a model for determining the probability value of a subcategory and a model for determining the probability value of a total category, and the multi-classification model is used to determine the probability value of a subcategory of classification information and the probability value of a total category, and the subcategory belongs to the total category.
[0178] S107. When the total classification probability value is greater than the first total classification probability threshold, determine that the information to be classified belongs to a target total classification result of the total category, and determine the target classification result according to the target total classification result and the sub-classification probability value.
[0179] In an embodiment of the present invention, the classification device can pre-acquire the first total classification probability threshold, or the classification device is pre-set with the first total classification probability threshold, which is used to determine whether the information to be classified belongs to the total category; the judgment process is to compare the total classification probability value with the first total classification probability threshold.
[0180] Here, one situation is that when the comparison result of the total classification probability value and the first total classification probability threshold is that the total classification probability value is greater than the first total classification probability threshold, it indicates that the information to be classified belongs to the total category, and thus the classification device determines that the information to be classified belongs to the target total classification result of the total category; at this time, the classification device further determines the target subcategory to which the information to be classified belongs, that is, determines the target classification result based on the target total classification result and the subclassification probability value.
[0181] S108. When the total classification probability value is not greater than the first total classification probability threshold, a target total classification result is obtained in which the information to be classified does not belong to the total category, and the target total classification result is used as the target classification result.
[0182] In an embodiment of the present invention, there is another situation for the comparison result of the total classification probability value and the first total classification probability threshold. When the comparison result of the total classification probability value and the first total classification probability threshold is that the total classification probability value is not greater than the first total classification probability threshold, it indicates that the information to be classified does not belong to the total category, and thus the classification device determines the target total classification result that the information to be classified does not belong to the total category; at this time, the target total classification result is the target classification result.
[0183] It can be understood that, by adopting the classification method provided in the embodiment of the present invention, it is only necessary to set a probability threshold corresponding to a total category, namely, the first total classification probability threshold, to obtain the classification result of the information to be classified, thereby reducing the resource consumption and time brought about by setting at least one probability threshold corresponding to a subcategory, and greatly saving the cost of manually setting the threshold.
[0184] Further, in the embodiment of the present invention, the multi-classification model includes a feature extraction model, a feature sub-classification model and a total classification model; at this time, the classification device in S106 uses the multi-classification model to classify the information to be classified, and obtains the sub-classification probability value and the total classification probability value, including S1061-S1063:
[0185] S1061. Extract features of the information to be classified based on a feature extraction model to obtain features to be classified.
[0186] In the embodiment of the present invention, the multi-classification model includes three sub-models, namely, a feature extraction model, a feature sub-classification model and a general classification model. The feature extraction model is used to extract features for classification from the information to be classified, that is, features to be classified; here, the features to be classified are the input data of the feature sub-classification model.
[0187] It should be noted that the feature extraction model and the feature sub-classification model are the sub-classification models mentioned above.
[0188] S1062. Subclassify the features to be classified according to the feature subclassification model to obtain subclassification probability values.
[0189] In an embodiment of the present invention, after the classification device obtains the features to be classified, the features to be classified are input into the feature sub-classification model for sub-classification, thereby obtaining the probability value of the sub-classification corresponding to the information to be classified, that is, the sub-classification probability value; here, the sub-classification probability value is the input data of the general classification model.
[0190] S1063. According to the general classification model, the sub-classification probability values are classified to obtain a general classification probability value.
[0191] In the embodiment of the present invention, after the classification device obtains the sub-classification probability value, according to the mapping relationship between the sub-classification probability value and the total classification probability value in the multi-classification model, by inputting the sub-classification probability value into the total classification model for total classification, the probability value of the total classification corresponding to the information to be classified, that is, the total classification probability value, can be obtained. At this time, the classification device uses the sub-classification probability value and the total classification probability value as the output result of the multi-classification model corresponding to the information to be classified.
[0192] See also Fig. 9 , Fig. 9 is a schematic diagram of an exemplary process of using a multi-classification model for classification provided by an embodiment of the present invention, such as Fig. 9As shown, the information to be classified is picture 9-1, and the multi-classification model 9-2 includes a feature extraction model 9-21, a feature sub-classification model 9-22 and a general classification model 9-23; picture 9-1 obtains the output result 9-3 through the multi-classification model 9-2, and the process is: picture 9-1 inputs the extracted features to be classified into the feature sub-classification model 9-22 through the feature extraction model 9-21, and the feature sub-classification model 9-22 uses the features to be classified as input data and outputs sub-classification probability values; at this time, the sub-classification probability values are input into the general classification model on the one hand, and on the other hand, are used as part of the information of the output result 9-3; then, the general classification model 9-23 uses the sub-classification probability values as input data and outputs the general classification probability values, and uses the general classification probability values as part of the information of the output result 9-3.
[0193] Further, in the embodiment of the present invention, the classification device in S1061 extracts the features of the information to be classified according to the feature extraction model to obtain the features to be classified, including S10611-S10612:
[0194] S10611. Obtain current mapping information of the current layer corresponding to the information to be classified, and current residual information between the previous layer and the current layer; the current layer is any layer of the feature extraction model.
[0195] In an embodiment of the present invention, the feature extraction model is expressed using residual learning technology, that is, the output result of each layer includes not only the mapping expression of the current layer, that is, the current mapping information, but also the residual function of the previous layer, that is, the current residual information.
[0196] S10612. Use the current mapping information and the current residual information as the output result of the current layer until the output result of the last layer of the feature extraction model is obtained, thereby obtaining the features to be classified.
[0197] In the embodiment of the present invention, after the classification device obtains the current mapping information and the current residual information of the current layer, it can determine that the output result of the current layer is the current mapping information and the current residual information. For example, if the mapping expression of the current layer is f(x), and the residual function of the previous layer is g(x), then the output result of the current layer is f(x)+g(x).
[0198] Here, when the classification device represents the output of each layer of the feature extraction model, it is obtained by combining the mapping expression of the current layer with the residual function of the previous layer.
[0199] It can be understood that each layer of the feature extraction model uses two parts, mapping expression and parameter function, to determine the output result, thereby avoiding being trapped in a local optimal solution, reducing the expression difficulty of the feature extraction model, and improving the accuracy of the output result.
[0200] Further, in the embodiment of the present invention, the total category includes a suspected total category and a determined total category; at this time, in S107, when the total classification probability value is greater than the first total classification probability threshold, the classification device determines that the information to be classified belongs to the target total classification result of the total category, including S1071-S1073:
[0201] S1071. When the total classification probability value is greater than the first total classification probability threshold, compare the total classification probability value with the second total classification probability threshold; the second total classification probability threshold is greater than the first total classification probability threshold.
[0202] In an embodiment of the present invention, the classification device can obtain the second total classification probability threshold in advance, or the classification device is pre-set with the second total classification probability threshold, which is used to determine whether the information to be classified belongs to the target category in the total category, that is, whether it belongs to the suspected total category or the determined total category. Therefore, when the classification device determines that the total classification probability value is greater than the first total classification probability threshold, that is, when determining the classification result that the information to be classified belongs to the total category, the total classification probability value is further compared with the second total classification probability value threshold.
[0203] Here, the second total classification probability threshold is greater than the first total classification probability threshold; for example, the first total classification probability threshold is 0.5, and the second total classification probability threshold is 0.8.
[0204] S1072. When the total classification probability value is less than or equal to the second total classification probability threshold, the result that the information to be classified belongs to the suspected total category is taken as the target total classification result.
[0205] In an embodiment of the present invention, when the classification device determines that the total classification probability value is less than or equal to the second total classification probability threshold, it is determined that the information to be classified belongs to a suspected total category in the total category, thereby obtaining a target total classification result characterizing that the information to be classified belongs to the suspected total category in the total category.
[0206] S1073. When the total classification probability value is greater than the second total classification probability threshold, the result that the information to be classified belongs to the determined total category is taken as the target total classification result.
[0207] In an embodiment of the present invention, when the classification device determines that the total classification probability value is greater than the second total classification probability threshold, it is determined that the information to be classified belongs to a certain total category in the total categories, thereby obtaining a target total classification result characterizing that the information to be classified belongs to the certain total category in the total categories.
[0208] It is easy to know that since the second total classification probability threshold is greater than the first total classification probability threshold, the larger the total classification probability threshold, the greater the possibility of determining that the information to be classified belongs to the result of determining the total category.
[0209] Further, in the embodiment of the present invention, the classification device in S107 determines the target classification result according to the target total classification result and the sub-classification probability value, including S1074-S1076:
[0210] S1074. Obtain the mean of the sub-classification probability values to obtain a sub-classification probability threshold.
[0211] In the embodiment of the present invention, after the classification device determines that the information to be classified belongs to the general category, or determines that the information to be classified belongs to a specific category in the general category (suspected general category and confirmed general category), it further determines the specific category in the subcategory to which the information to be classified belongs. Therefore, the information device needs to set a subcategory probability threshold to determine the belonging results of each category in the subcategory corresponding to the information to be classified. Here, the classification device uses the mean of the subcategory probability values as the subcategory probability threshold.
[0212] S1075. The category corresponding to the probability value of the sub-classification probability value that is greater than the sub-classification probability threshold is used as the target sub-category.
[0213] In the embodiment of the present invention, when the classification device obtains the sub-classification probability threshold, each probability value in the sub-classification probability value is compared with the sub-classification probability threshold, and the category corresponding to the probability value in the sub-classification probability value that is greater than the sub-classification probability threshold is obtained. At this time, the target sub-category is obtained. In other words, the target sub-category refers to the category to which the information to be classified in the sub-category belongs.
[0214] S1076. Use the target total classification result and the target sub-category as the target classification result.
[0215] In an embodiment of the present invention, after the classification device obtains the classification result of the general category to which the information to be classified belongs, that is, the target general classification result, and the result of the category to which the information to be classified belongs in the subcategory, that is, the target subcategory, the target general classification result and the target subcategory are taken together as the target classification result.
[0216] It can be understood that the classification device first determines the classification result that the information to be classified belongs to the general category based on the obtained probability value of the general category (the total classification probability value) and a pre-set probability threshold (the first total classification probability threshold); then, the classification device further determines the target subcategory to which the information to be classified belongs in the subcategory based on the information that the information to be classified belongs to the general category. The setting of the probability threshold is reduced, and the complexity of classification is reduced; at the same time, the classification device realizes the transfer of the classification task from the complex classification result corresponding to the subcategory to the simple classification result corresponding to the general category first and then the classification result corresponding to the subcategory by learning the relationship between the subcategory and the general category and modeling it, that is, the simplified optimization goal transfer of the complex task is realized.
[0217] Further, see Fig.10 ,based on Figure 8 , Fig.10 is another optional flow chart of the classification method based on the classification model provided in the embodiment of the present invention, which will be combined with Fig.10 The steps shown are described below, wherein S106-S108 refer to the above description.
[0218] S109: Display the target classification result through the display terminal.
[0219] In the embodiment of the present invention, after the classification device obtains the target classification result, the target classification result is displayed through the display terminal, so as to process the information to be classified through the displayed target classification result.
[0220] It should be noted that the display terminal may be a classification device or other devices. For example, when a request to classify the information to be classified is obtained from the terminal (other device), the target classification result is sent to the terminal for display.
[0221] In an embodiment of the present invention, after obtaining the information to be classified, when the model used for classification obtained by the classification device is an optimized multi-classification model, the classification device uses the optimized multi-classification model to classify the information to be classified to obtain sub-classification probability values and total classification probability values; the optimized multi-classification model is a model obtained after optimizing the multi-classification model.
[0222] It is understandable that the classification device improves the generalization ability of the optimized multi-classification model by continuously using new multi-classification samples to optimize and train the multi-classification model. On the other hand, when the optimized multi-classification model is used for classification, the accuracy of the classification result is further improved. The following will describe an exemplary application of an embodiment of the present invention in a practical application scenario.
[0223] See also Fig.11 , Fig.11 is an exemplary classification flow diagram provided by an embodiment of the present invention, such as Fig.11 As shown, the subcategories include five categories: bloody 11-11, shooting 11-12, violence 11-13, terror 11-14 and force 11-5; the general category includes one category: violent terrorism 11-21, and the category corresponding to violent terrorism 11-21 is non-violent terrorism 11-22, and violent terrorism 11-21 includes two categories: suspected 11-211 (suspected general category) and confirmed violent terrorism 11-212 (confirmed general category); the multi-classification model 11-3 includes "ResNet" 11-31, feature sub-classification model 11-32 and general classification model 11-33; the information to be classified is picture 11-4.
[0224] First, when classifying image 11-4, the image features (features to be classified) are extracted through "ResNet" 11-31; and the image features are classified through the feature sub-classification model 11-32 to obtain the sub-category probability values corresponding to the sub-categories: bloody 11-11: 0.1, shooting 11-12: 0, violence 11-13: 0.9, terror 11-14: 0.8 and force 11-5: 0.9; and the sub-category probability values are classified through the total classification model 11-33 to obtain the total category probability value corresponding to the total category 11-3: violent and terrorist 11-21: 0.6, and accordingly, the probability value corresponding to non-violent and terrorist 11-22 is 0.4.
[0225] Then, compare the violent terrorist 11-21: 0.6 with the first total classification probability threshold of 0.5. Since 0.6 is greater than 0.5, it is determined that the picture belongs to the violent terrorist 11-21; further compare the violent terrorist 11-21: 0.6 with the second total classification probability threshold of 0.8. Since 0.6 is less than 0.8, it is determined that the picture belongs to the suspected violent terrorist 11-211.
[0226] Then, the mean of the sub-category probability values: bloody 11-11: 0.1, shooting 11-12: 0, violence 11-13: 0.9, terror 11-14: 0.8 and force 11-5: 0.9 is calculated, that is, (0.1+0+0.9+0.8+0.9) / 5, and the sub-category probability threshold of 0.54 is obtained; and the sub-category probability values: bloody 11-11: 0.1, shooting 11-12: 0, violence 11-13: 0.9, terror 11-14: 0.8 and force 11-5: 0.9 are compared with the sub-category probability threshold of 0.54 respectively: since 0.1 is less than 0.54, 0 is less than 0.54, 0.9 is greater than 0.54, 0.8 is greater than 0.54, and 0.9 is greater than 0.54, the target sub-categories are determined to be violence 11-13, terror 11-14 and force 11-5. At this point, the target classification result of Picture 11-4 is obtained: Picture 11-4 is suspected of being a terrorist act, and belongs to violence, terror and force.
[0227] Finally, the target classification result is displayed by the display device, so that the image 11-4 is processed by the displayed target classification result. Since the classification device here determines that the image 11-4 is suspected of violent terrorism, the processing operation of the image 11-4 is to notify the reviewer to conduct manual review.
[0228] In summary, it can be understood that when the classification method provided by the embodiment of the present invention is applied to scenes such as television, live broadcast or regional monitoring, the pictures extracted from scenes such as television, live broadcast or regional monitoring are used as information to be classified, and the multi-classification model is used for classification, which can quickly determine whether it belongs to the classification result of violence and terrorism, and the accuracy of the classification result can be improved by 15%. In addition, when the classification device determines that the information to be classified is suspected of violence and terrorism, it is submitted to manual review, so that the reviewer only needs to further process the information to be classified suspected of violence and terrorism, reducing the workload of review.
[0229] The following is a description of an exemplary structure of the classification model training device 255 provided in an embodiment of the present invention implemented as a software module. In some embodiments, Figure 2a As shown, the software modules stored in the classification model training device 255 of the first memory 250 may include:
[0230] The sample acquisition module 2551 is used to acquire sub-classification samples, total classification samples and multi-classification samples; the sub-classification samples are sample pairs of classification information and sub-classification results, the total classification samples are sample pairs of sub-classification results and total classification results, and the multi-classification samples are sample pairs of classification information, sub-classification results and total classification results;
[0231] The sub-classification model training module 2552 is used to continuously train the original sub-classification model using the sub-classification samples until the difference between the predicted sub-classification probability value and the sub-classification result in the sub-classification samples meets the first training cutoff condition, thereby obtaining a sub-classification model; the sub-classification model is used to determine the sub-classification probability value of the classification information;
[0232] The general classification model training module 2553 is used to continuously train the original general classification model using the general classification samples until the difference between the predicted probability value of the general category and the general classification result in the general classification sample meets the second training cutoff condition, thereby obtaining a general classification model; the general classification model is used to determine the probability value of the general category of the sub-classification result; the sub-category belongs to the general category;
[0233] The multi-classification model training module 2554 is used to continuously train the original multi-classification model using the multi-classification samples until the difference between the predicted probability value of the sub-classification and the sub-classification result in the multi-classification samples, as well as the difference between the predicted probability value of the total category and the total classification result in the multi-classification samples, meet the third training cutoff condition, thereby obtaining a multi-classification model; the original multi-classification model is constructed by connecting the sub-classification model and the total classification model; the multi-classification model is used to determine the probability value of the sub-classification and the probability value of the total category of the classification information.
[0234] Furthermore, the sub-classification model training module 2552 is also used to sub-classify the classification information in the sub-classification sample based on the original sub-classification model, and predict a first sub-classification prediction probability value; obtain a first sub-classification difference between the first sub-classification prediction probability value and the sub-classification result in the sub-classification sample; use the first sub-classification difference and the sub-classification sample to train the original sub-classification model; until the difference between the probability value of the sub-category of the sub-classification sample predicted by the trained original sub-classification model and the sub-classification result in the sub-classification sample meets the first training cutoff condition, the sub-classification model is obtained.
[0235] Furthermore, the general classification model training module 2553 is also used to perform general classification on the sub-classification results in the general classification sample based on the original general classification model, and predict a first general classification prediction probability value; obtain a first general classification difference between the first general classification prediction probability value and the general classification result in the general classification sample; use the first general classification difference and the general classification sample to train the original general classification model; until the difference between the probability value of the general category of the sub-classification sample predicted by the trained original general classification model and the general classification result in the general classification sample meets the second training cutoff condition, the general classification model is obtained.
[0236] Furthermore, the multi-classification model training module 2554 is also used to classify the classification information in the multi-classification sample based on the original multi-classification model, and predict a second sub-classification prediction probability value and a second total classification prediction probability value; obtain a second sub-classification difference between the second sub-classification prediction probability value and the sub-classification result in the multi-classification sample, and a second total classification difference between the second total classification prediction probability value and the total classification result in the multi-classification sample; use the second sub-classification difference, the second total classification difference and the multi-classification sample to train the original multi-classification model; until the difference between the probability value of the sub-class of the multi-classification sample predicted by the trained original multi-classification model and the sub-classification result in the multi-classification sample, and the difference between the predicted probability value of the total class of the multi-classification sample and the total classification result in the total classification sample meet the third training cutoff condition, and the multi-classification model is obtained.
[0237] Furthermore, the multi-classification model training module 2554 is also used to take the sum of the product of the second sub-classification difference and the sub-classification difference weight and the product of the second total classification difference and the total classification difference weight as the first loss function; and use the first loss function and the multi-classification samples to train the original multi-classification model.
[0238] Furthermore, the multi-classification model training module 2554 is also used to adjust the parameter information of the original multi-classification model based on the first loss function; based on the adjusted original multi-classification model, classify the classification information in the multi-classification sample, and predict the third sub-classification prediction probability value and the third total classification prediction probability value; obtain the third sub-classification difference between the third sub-classification prediction probability value and the sub-classification result in the multi-classification sample, as well as the third total classification difference between the third total classification prediction probability value and the total classification result in the multi-classification sample, to obtain the second loss function; use the second loss function and the multi-classification sample to train the adjusted original multi-classification model.
[0239] An embodiment of the present invention provides a storage medium storing executable instructions, wherein executable instructions are stored. When the executable instructions are executed by a first processor, the first processor will execute the classification model training method provided by the embodiment of the present invention, for example, Figure 3 The classification model training method is shown.
[0240] The following further describes an exemplary structure of the classification device 555 provided in an embodiment of the present invention implemented as a software module. In some embodiments, Figure 2b As shown, the software modules stored in the classification device 555 of the second memory 550 may include:
[0241] The classification module 5551 is used for classifying the information to be classified by using a multi-classification model to obtain a sub-classification probability value and a total classification probability value when the information to be classified is obtained; wherein the multi-classification model is obtained by training based on a model for determining a probability value of a sub-classification and a model for determining a probability value of a total class, and the multi-classification model is used to determine the probability value of the sub-classification and the probability value of the total class of the classified information, and the sub-classification belongs to the total class;
[0242] A result determination module 5552 is used to determine, when the total classification probability value is greater than a first total classification probability threshold, that the information to be classified belongs to a target total classification result of the total category, and determine the target classification result according to the target total classification result and the sub-classification probability value;
[0243] The result determination module 5552 is further used to obtain a target total classification result in which the information to be classified does not belong to the total category when the total classification probability value is not greater than the first total classification probability threshold, and use the target total classification result as the target classification result.
[0244] Furthermore, the multi-classification model includes a feature extraction model, a feature sub-classification model and a general classification model. The classification module 5551 is also used to extract the features of the information to be classified based on the feature extraction model to obtain the features to be classified; sub-classify the features to be classified based on the feature sub-classification model to obtain the sub-classification probability values; and classify the sub-classification probability values based on the general classification model to obtain the general classification probability value.
[0245] Furthermore, the classification module 5551 is also used to obtain current mapping information of the current layer corresponding to the information to be classified, and current residual information of the previous layer and the current layer; the current layer is any layer of the feature extraction model; the current mapping information and the current residual information are used as the output result of the current layer until the output result of the last layer of the feature extraction model is obtained, thereby obtaining the features to be classified.
[0246] Furthermore, the total category includes suspected total categories and determined total categories, and the classification module 5551 is also used to compare the total classification probability value with a second total classification probability threshold when the total classification probability value is greater than the first total classification probability threshold; the second total classification probability threshold is greater than the first total classification probability threshold; when the total classification probability value is less than or equal to the second total classification probability threshold, the result that the information to be classified belongs to the suspected total category is used as the target total classification result; when the total classification probability value is greater than the second total classification probability threshold, the result that the information to be classified belongs to the determined total category is used as the target total classification result.
[0247] Furthermore, the result determination module 5552 is also used to obtain the mean of the sub-classification probability values to obtain a sub-classification probability threshold; to take the category corresponding to the probability value in the sub-classification probability value that is greater than the sub-classification probability threshold as the target sub-category; and to take the target total classification result and the target sub-category as the target classification result.
[0248] An embodiment of the present invention provides a storage medium storing executable instructions, wherein executable instructions are stored. When the executable instructions are executed by a second processor, the second processor will execute the classification model-based training method provided by an embodiment of the present invention, for example, Figure 8 The classification method based on the classification model is shown.
[0249] In some embodiments, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.
[0250] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0251] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0252] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0253] In summary, the embodiments of the present invention jointly train a multi-classification model by using the difference between the predicted probability value of the sub-category and the sub-classification result in the multi-classification sample, as well as the difference between the predicted probability value of the total category and the total classification result in the multi-classification sample. Even if the sub-categories are incomplete or the samples are incorrectly labeled during the training process, only partial information of the differences corresponding to the sub-categories or samples is used to train the multi-classification model; therefore, the impact of noise such as incomplete sub-categories or incorrect sample labeling on the trained multi-classification model can be reduced. Therefore, when the multi-classification model is used to classify the information to be classified, the information to be classified can be accurately classified, thereby improving the accuracy of the classification of the information to be classified.
[0254] The above description is only an embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.
Claims
1. A classification model training method, characterized in that: include: Obtain sub-classification samples, total classification samples and multi-classification samples; The sub-classification samples are sample pairs of classification images and sub-classification results, the total classification samples are sample pairs of sub-classification results and total classification results, and the multi-classification samples are sample pairs of classification images, sub-classification results and total classification results; The sub-classification samples are used to continuously train the original sub-classification model until the difference between the predicted probability value of the sub-classification and the sub-classification result in the sub-classification samples meets the first training cutoff condition, thereby obtaining a sub-classification model; the sub-classification model is used to determine the probability value of the sub-classification of the classified image; The total classification samples are used to continuously train the original total classification model until the difference between the predicted probability value of the total category and the total classification result in the total classification sample meets the second training cutoff condition, thereby obtaining the total classification model; The general classification model is used to determine the probability value of the general category of the sub-classification result; the sub-category belongs to the general category; The multi-classification samples are used to continuously train the original multi-classification model until the difference between the predicted probability value of the sub-classification and the sub-classification result in the multi-classification samples, and the difference between the predicted probability value of the total class and the total classification result in the multi-classification samples meet the third training cutoff condition, thereby obtaining a multi-classification model; the original multi-classification model is constructed by connecting the sub-classification model and the total classification model; The multi-classification model is used to determine the probability value of the sub-class and the probability value of the overall class of the classified image.
2. The method according to claim 1, characterized in that The sub-classification samples are used to continuously train the original sub-classification model until the difference between the predicted sub-class probability value and the sub-classification result in the sub-classification sample meets the first training cutoff condition, thereby obtaining the sub-classification model, including: Based on the original sub-classification model, sub-classify the classified images in the sub-classification samples to predict a first sub-classification prediction probability value; Obtaining a first sub-classification difference between the first sub-classification prediction probability value and the sub-classification result in the sub-classification sample; Using the first sub-classification differences and the sub-classification samples, training the original sub-classification model; The sub-classification model is obtained until the difference between the probability value of the sub-category of the sub-classification sample predicted by the trained original sub-classification model and the sub-classification result in the sub-classification sample meets the first training cutoff condition.
3. The method according to claim 1, characterized in that The method of using the total classification samples to continuously train the original total classification model until the difference between the predicted probability value of the total category and the total classification result in the total classification sample meets the second training cutoff condition, thereby obtaining the total classification model, comprises: Based on the original total classification model, the sub-classification results in the total classification samples are classified, and a first total classification prediction probability value is predicted; Obtaining a first total classification difference between the first total classification prediction probability value and the total classification result in the total classification sample; Using the first total classification difference and the total classification sample, training the original total classification model; The general classification model is obtained until the difference between the probability value of the general category of the sub-classification sample predicted by the trained original general classification model and the general classification result in the general classification sample meets the second training cutoff condition.
4. The method according to claim 1, characterized in that The multi-classification sample is used to continuously train the original multi-classification model until the difference between the predicted probability value of the sub-classification and the sub-classification result in the multi-classification sample, and the difference between the predicted probability value of the total class and the total classification result in the multi-classification sample meet the third training cutoff condition, thereby obtaining the multi-classification model, including: Based on the original multi-classification model, classify the classified images in the multi-classification samples to predict a second sub-classification prediction probability value and a second total classification prediction probability value; Obtaining a second sub-class difference between the second sub-class prediction probability value and the sub-class result in the multi-class sample, and a second total classification difference between the second total classification prediction probability value and the total classification result in the multi-class sample; Using the second sub-classification difference, the second total classification difference and the multi-classification sample, training the original multi-classification model; The multi-classification model is obtained until the difference between the probability value of the sub-class of the multi-classification sample predicted by the trained original multi-classification model and the sub-classification result in the multi-classification sample, as well as the difference between the probability value of the total class of the multi-classification sample predicted and the total classification result in the total classification sample, meet the third training cutoff condition.
5. The method according to claim 4, characterized in that The step of training the original multi-classification model by using the second sub-classification difference, the second total classification difference and the multi-classification sample comprises: The sum of the product of the second sub-class difference and the sub-class difference weight and the product of the second total class difference and the total class difference weight is used as the first loss function; The original multi-classification model is trained using the first loss function and the multi-classification samples.
6. The method according to claim 5, characterized in that The step of training the original multi-classification model by using the first loss function and the multi-classification samples includes: According to the first loss function, adjusting the parameter information of the original multi-classification model; Based on the adjusted original multi-classification model, classify the classified images in the multi-classification samples, and predict a third sub-classification prediction probability value and a third total classification prediction probability value; Obtaining a third sub-class difference between the third sub-class prediction probability value and the sub-classification result in the multi-classification sample, and a third total classification difference between the third total classification prediction probability value and the total classification result in the multi-classification sample, to obtain a second loss function; The adjusted original multi-classification model is trained using the second loss function and the multi-classification samples.
7. A classification method based on a classification model, characterized in that: The method comprises: When an image to be classified is obtained, the image to be classified is classified using a multi-classification model to obtain a sub-classification probability value and a total classification probability value; The multi-classification model is obtained by training based on a model for determining a probability value of a sub-class and a model for determining a probability value of a total class, and the multi-classification model is used to determine the probability value of the sub-class and the probability value of the total class of the classified image, and the sub-class belongs to the total class; When the total classification probability value is greater than a first total classification probability threshold, determining a target total classification result that the image to be classified belongs to the total category, and determining a target classification result according to the target total classification result and the sub-classification probability value; When the total classification probability value is not greater than the first total classification probability threshold, a target total classification result is obtained in which the image to be classified does not belong to the total category, and the target total classification result is used as the target classification result.
8. The method according to claim 7, characterized in that The multi-classification model includes a feature extraction model, a feature sub-classification model and a total classification model. The multi-classification model is used to classify the image to be classified to obtain a sub-classification probability value and a total classification probability value, including: Extracting features of the image to be classified according to the feature extraction model to obtain features to be classified; Sub-classifying the to-be-classified features according to the feature sub-classification model to obtain the sub-classification probability value; The sub-classification probability values are classified according to the general classification model to obtain the general classification probability value.
9. The method according to claim 8, characterized in that The step of extracting the features of the image to be classified based on the feature extraction model to obtain the features to be classified includes: Acquire current mapping information of a current layer corresponding to the image to be classified, and current residual information of a previous layer and the current layer; the current layer is any layer of the feature extraction model; The current mapping information and the current residual information are used as the output result of the current layer until the output result of the last layer of the feature extraction model is obtained, thereby obtaining the feature to be classified.
10. The method according to claim 7, characterized in that The total category includes a suspected total category and a determined total category, and when the total classification probability value is greater than a first total classification probability threshold, determining that the image to be classified belongs to the target total classification result of the total category includes: When the total classification probability value is greater than the first total classification probability threshold, comparing the total classification probability value with a second total classification probability threshold; the second total classification probability threshold is greater than the first total classification probability threshold; When the total classification probability value is less than or equal to the second total classification probability threshold, taking the result that the image to be classified belongs to the suspected total category as the target total classification result; When the total classification probability value is greater than the second total classification probability threshold, the result that the image to be classified belongs to the determined total category is taken as the target total classification result.
11. The method according to claim 7 or 10, characterized in that: Determining the target classification result according to the target total classification result and the sub-classification probability value includes: Obtaining the mean of the sub-classification probability values to obtain a sub-classification probability threshold; The category corresponding to the probability value greater than the sub-classification probability threshold among the sub-classification probability values is taken as the target sub-category; The target total classification result and the target sub-category are used as the target classification result.
12. A classification model training device, characterized in that: include: A sample acquisition module is used to acquire sub-classification samples, total classification samples and multi-classification samples; The sub-classification samples are sample pairs of classification images and sub-classification results, the total classification samples are sample pairs of sub-classification results and total classification results, and the multi-classification samples are sample pairs of classification images, sub-classification results and total classification results; A sub-classification model training module is used to continuously train the original sub-classification model using the sub-classification samples until the difference between the predicted probability value of the sub-classification and the sub-classification result in the sub-classification samples meets a first training cutoff condition, thereby obtaining a sub-classification model; the sub-classification model is used to determine the probability value of the sub-classification of the classified image; A total classification model training module is used to continuously train the original total classification model using the total classification samples until the difference between the predicted probability value of the total category and the total classification result in the total classification sample meets a second training cutoff condition, thereby obtaining a total classification model; The general classification model is used to determine the probability value of the general category of the sub-classification result; the sub-category belongs to the general category; A multi-classification model training module, used to continuously train the original multi-classification model using the multi-classification samples until the difference between the predicted probability value of the sub-classification and the sub-classification result in the multi-classification samples, and the difference between the predicted probability value of the total class and the total classification result in the multi-classification samples meet the third training cutoff condition, thereby obtaining a multi-classification model; the original multi-classification model is constructed by connecting the sub-classification model and the total classification model; The multi-classification model is used to determine the probability value of the sub-class and the probability value of the overall class of the classified image.
13. A classification device based on a classification model, characterized in that: include: A classification module, for, when an image to be classified is acquired, classifying the image to be classified using a multi-classification model to obtain a sub-classification probability value and a total classification probability value; wherein the multi-classification model is obtained by training based on a model for determining a probability value of a sub-classification and a model for determining a probability value of a total class, and the multi-classification model is used to determine the probability value of the sub-classification and the probability value of the total class of the classified image, and the sub-classification belongs to the total class; A result determination module is used to determine the target total classification result that the image to be classified belongs to the total category when the total classification probability value is greater than a first total classification probability threshold, and determine the target classification result according to the target total classification result and the sub-classification probability value; The result determination module is also used to obtain a target total classification result that the image to be classified does not belong to the total category when the total classification probability value is not greater than the first total classification probability threshold, and use the target total classification result as the target classification result.
14. A classification model training device, characterized in that: include: A first memory, used to store executable instructions; The first processor is configured to implement the method according to any one of claims 1 to 6 when executing the executable instructions stored in the first memory.
15. A classification device based on a classification model, characterized in that: include: A second memory, used for storing executable instructions; The second processor is configured to implement the method according to any one of claims 7 to 11 when executing the executable instructions stored in the second memory.
