Data classification method, apparatus, device, medium, and program product
Patent Information
- Application Number
- CN202310764282.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-06-26
AI Technical Summary
Existing neural network classification models cannot accurately classify input data without predefined categories, resulting in low classification accuracy.
By acquiring the features of the data to be processed and utilizing the target type detection characteristics of the classification model, it is possible to determine whether the data is of the target type or not. This includes training binary classification networks and multi-classification networks to improve the detection capability of out-of-distribution samples and avoid misclassification.
It improves the accuracy of data classification, reduces training costs and the probability of misclassification, and enhances the robustness of the model.
Smart Images

Figure CN116776122B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a data classification method, apparatus, device, medium, and program product. Background Technology
[0002] When deployed in real-world applications, neural network models face challenges such as the highly diverse categories of real-world data. When performing classification tasks, neural networks often can only categorize inputs into predefined classes; however, the actual input may not belong to those classes. For example, a neural network classification model trained on a cat and dog dataset might still output either "cat" or "dog" when given an image of an elephant as input. Clearly, this is an incorrect result, demonstrating that existing classification models cannot accurately classify data, leading to low classification accuracy. Summary of the Invention
[0003] This disclosure proposes a data classification method, apparatus, device, storage medium, and program product to address, to some extent, the technical problem of low accuracy in data classification.
[0004] In a first aspect, this disclosure provides a data classification method, including:
[0005] Obtain the data to be processed;
[0006] Data features are obtained by extracting features from the data to be processed;
[0007] The type of the data to be processed is determined based on the data features and the target type detection characteristics of the classification model. The type of the data to be processed includes target type and non-target type. The classification model is used for the classification of the target type.
[0008] A second aspect of this disclosure provides a data classification apparatus, comprising:
[0009] The acquisition module is used to acquire data to be processed.
[0010] The feature module is used to extract features from the data to be processed to obtain data features;
[0011] The model module is used to determine the type of the data to be processed based on the data features and the target type detection characteristics of the classification model. The type of the data to be processed includes target type and non-target type. The classification model is used for the classification of the target type.
[0012] A third aspect of this disclosure provides an electronic device, characterized in that it includes one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, the programs including instructions for performing the method according to the first or second aspect.
[0013] A fourth aspect of this disclosure provides a non-volatile computer-readable storage medium comprising a computer program that, when executed by one or more processors, causes the processors to perform the method described in the first or second aspect.
[0014] A fifth aspect of this disclosure provides a computer program product including computer program instructions that, when executed on a computer, cause the computer to perform the method described in the first aspect.
[0015] As can be seen from the above, the data classification method, apparatus, device, medium, and program product provided in this disclosure determine whether the type of the data to be processed is the target type corresponding to the classification model through a classification model. This avoids the problem of classification model classifying any input data into the target type, which leads to a decrease in classification accuracy. It improves the ability to judge the category of input data and further improves the accuracy of classification. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this disclosure or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of the data classification architecture according to an embodiment of the present disclosure.
[0018] Figure 2 This is a schematic diagram of the hardware structure of an exemplary electronic device according to an embodiment of the present disclosure.
[0019] Figure 3 This is a schematic flowchart illustrating a data classification method according to an embodiment of the present disclosure.
[0020] Figure 4 This is a schematic diagram illustrating the principle of training a classification model according to an embodiment of this disclosure.
[0021] Figure 5 This is a schematic diagram of a data classification device according to an embodiment of the present disclosure. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0023] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this disclosure should have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms "first," "second," and similar terms used in the embodiments of this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0024] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0025] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0026] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0027] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0028] Figure 1 A schematic diagram of a data classification architecture according to an embodiment of this disclosure is shown. (See reference...) Figure 1The data classification architecture 100 may include a server 110, a terminal 120, and a network 130 providing a communication link. The server 110 and the terminal 120 can be connected via a wired or wireless network 130. The server 110 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, security services, and CDN.
[0029] Terminal 120 can be implemented in hardware or software. For example, when terminal 120 is implemented in hardware, it can be various electronic devices with a display screen and support page display, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. When terminal 120 is implemented in software, it can be installed in the electronic devices listed above; it can be implemented as multiple software programs or software modules (e.g., software programs or software modules used to provide distributed services) or as a single software program or software module, without specific limitations.
[0030] It should be noted that the data classification method provided in this application embodiment can be executed by the terminal 120 or by the server 110. It should be understood that... Figure 1 The number of terminals, networks, and servers shown is for illustrative purposes only and is not intended to be a limitation. Any number of terminals, networks, and servers can be used depending on implementation needs.
[0031] Figure 2 A schematic diagram of the hardware structure of an exemplary electronic device 200 provided in an embodiment of this disclosure is shown. For example... Figure 2 As shown, the electronic device 200 may include: a processor 202, a memory 204, a network module 206, a peripheral interface 208, and a bus 210. The processor 202, memory 204, network module 206, and peripheral interface 208 are interconnected within the electronic device 200 via the bus 210.
[0032] Processor 202 may be a Central Processing Unit (CPU), a data classifier, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or one or more integrated circuits. Processor 202 can be used to perform functions related to the techniques described in this disclosure. In some embodiments, processor 202 may also include multiple processors integrated as a single logic component. For example, such as... Figure 2 As shown, processor 202 may include multiple processors 202a, 202b and 202c.
[0033] Memory 204 can be configured to store data (e.g., instructions, computer code, etc.). Figure 2 As shown, the data stored in memory 204 may include program instructions (e.g., program instructions for implementing the data classification method of this disclosure embodiment) and data to be processed (e.g., the memory may store configuration files of other modules, etc.). Processor 202 may also access the program instructions and data stored in memory 204 and execute the program instructions to operate on the data to be processed. Memory 204 may include volatile storage devices or non-volatile storage devices. In some embodiments, memory 204 may include random access memory (RAM), read-only memory (ROM), optical disk, magnetic disk, hard disk, solid-state drive (SSD), flash memory, memory stick, etc.
[0034] Network module 206 can be configured to provide communication with other external devices to electronic device 200 via a network. This network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, Near Field Communication (NFC), etc.), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the specific examples described above. In some embodiments, network module 306 may include any combination of any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc.
[0035] The peripheral interface 208 can be configured to connect the electronic device 200 to one or more peripheral devices to enable information input and output. For example, peripheral devices may include input devices such as keyboards, mice, touchpads, touch screens, microphones, and various sensors, as well as output devices such as displays, speakers, vibrators, and indicator lights.
[0036] Bus 210 can be configured to transfer information between various components of electronic device 200 (e.g., processor 202, memory 204, network module 206, and peripheral interface 208), such as internal buses (e.g., processor-memory bus), external buses (USB port, PCI-E bus), etc.
[0037] It should be noted that although the architecture of the above-described electronic device 200 only shows the processor 202, memory 204, network module 206, peripheral interface 208, and bus 210, in specific implementations, the architecture of the electronic device 200 may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the architecture of the above-described electronic device 200 may only include the components necessary for implementing the embodiments of this disclosure, and does not necessarily include all the components shown in the figures.
[0038] Out-of-distribution data refers to samples whose categories differ from those in the training dataset of a classification network. For example, if the training dataset contains images categorized as "cat" and "dog," then an image with an "elephant" as the main subject is an out-of-distribution sample relative to the training dataset. Out-of-distribution detection refers to the ability of a classification network to detect and identify out-of-distribution samples. Specifically, a classifier set on a closed set can only provide confidence scores for each category within the closed set and cannot effectively handle samples outside the closed set. For example, in a binary classification problem of "cat" and "dog," the classifier gives the probability that the input image belongs to a cat or a dog, and the sum of these probabilities is 1. However, if the input is an image of an "elephant," the classifier might give a result of 40% for cat and 60% for dog, which is clearly unreasonable. The goal of out-of-distribution detection is to give the model the ability to identify out-of-distribution samples, refusing to classify samples from outside the closed set of categories, rather than forcibly classifying them with high confidence scores.
[0039] Traditional approaches to out-of-distribution sample detection primarily include two methods: One involves collecting as many out-of-distribution samples as possible—data whose category information does not overlap with the training set. A binary classifier is then trained using the training data (positive samples) and the collected out-of-distribution samples (negative samples) to determine whether a new input sample is within the distribution. This method is costly in terms of data collection, requiring data cleaning and a large data volume, making it impossible to complete quickly and cost-effectively. Another approach involves constructing out-of-distribution features in the feature space. This is done by constructing the feature distribution function of the training data and sampling along its edges to obtain feature points with low probability density as out-of-distribution samples. This allows training a classifier with both in-distribution and out-of-distribution features to determine whether the features of the input image are out-of-distribution samples. However, the feature distribution constructed in this method differs from the true feature distribution, and this deviation is often difficult to effectively assess and measure. This can lead to the collection of samples considered to be edge samples, which may actually be meaningless noise. Therefore, this method fails to improve model performance and may even cause model failure and performance degradation due to excessive feature bias. Therefore, improving the out-of-distribution data detection capability of classification models and enhancing the accuracy of data classification have become urgent technical problems to be solved.
[0040] In view of this, embodiments of this disclosure provide a data classification method, apparatus, device, storage medium, and program product. By determining whether the type of the data to be processed is the target type corresponding to the classification model through a classification model, the problem of decreased classification accuracy caused by the classification model classifying all input data into the target type can be avoided. This improves the ability to detect out-of-distribution data of the input data and further improves the accuracy of classification.
[0041] Specifically, for the data to be processed, it can be determined whether the data belongs to the preset target type of the classification model. When the classification model encounters data of a category that does not exist in the training set, it outputs a lower confidence score, and then makes a rejection decision based on this confidence score. Therefore, the classification model according to the embodiments of this disclosure can not only perform classification tasks but also determine whether the input data is an out-of-distribution sample. Compared with the prior art, which directly and forcibly classifies any input data, it can avoid misclassification of input data that does not belong to the target type of the classification model, thereby improving the accuracy of data classification.
[0042] See Figure 3 , Figure 3 A schematic flowchart of a data classification method according to an embodiment of the present disclosure is shown. Figure 3 In this context, the data classification method 300 may further include the following steps.
[0043] In step S310, the data to be processed is obtained.
[0044] The data to be processed can include text, audio, or image data. It can be uploaded locally or obtained via the network. Classifying the data can involve categorizing text, audio, or images, such as identifying the language of the text, identifying the speaker of the audio, or detecting faces.
[0045] In step S320, feature extraction is performed on the data to be processed to obtain data features.
[0046] Specifically, features can be extracted from the data to be processed based on convolutional networks. For example, if the data to be processed is an image, features can be extracted from the image to obtain the corresponding image features. Correspondingly, if the data to be processed is audio, the data features can be audio features; if the data to be processed is text, the data features can be text features.
[0047] In step S330, the type of the data to be processed is determined based on the data features and the target type detection characteristics of the classification model. The type of the data to be processed includes target type and non-target type. The classification model is used for the classification of the target type.
[0048] The target type detection characteristic refers to the ability to detect out-of-distribution samples. A classification model can be used to classify its input data. For example, if a classification model can determine that the input is of type A, type B, or type C, then the target type corresponding to the classification model is type A, type B, or type C. Non-target types can refer to different types other than type A, type B, or type C, such as type D.
[0049] In some embodiments, determining the type of the data to be processed based on the data features and the target type detection characteristics of the classification model includes:
[0050] Based on the target type detection characteristics of the classification model, determine whether the data feature belongs to the target feature corresponding to the target type;
[0051] In response to the fact that the data feature belongs to a non-target feature, the type of the data to be processed is determined to be the non-target type.
[0052] In some embodiments, determining the type of the data to be processed based on the data features and the target type detection characteristics of the classification model includes:
[0053] In response to the data feature belonging to the target feature, the type of the data to be processed is determined to be the target type.
[0054] In some embodiments, determining whether a data feature belongs to the target type based on the target type detection characteristics of the classification model includes:
[0055] Calculate the target confidence score of the data feature belonging to the target feature based on the classification model;
[0056] Determine whether the target confidence level is less than a preset threshold;
[0057] In response to the out-of-distribution confidence level being less than the preset threshold, the data feature is determined to belong to the non-target feature.
[0058] Here, target features refer to in-distribution sample features that can determine the target type, while non-target features refer to out-of-distribution sample features that do not belong to the target type. Specifically, for data features, a classification model can be used to calculate the target confidence score (e.g., the probability of belonging to the target feature). If the target confidence score is greater than or equal to a preset threshold, it indicates that the data feature belongs to the target feature; if the target confidence score is less than the preset threshold, it indicates that the data feature belongs to a non-target feature.
[0059] In some embodiments, the classification model includes a binary classification network and a multi-class classification network, and the method further includes:
[0060] The multi-classification network is trained based on the training samples to classify the target type; and the binary classification network is trained based on the foreground and background features of the training samples to determine whether the type of the data to be processed is the target type.
[0061] The binary classification network in the classification model determines whether the data to be processed belongs to the target type of the model, i.e., whether it is an in-distribution sample. The multi-class classification network further determines the specific type of the data to be processed, i.e., which target type of the model it belongs to. Both the binary and multi-class classification networks are trained using the same training samples. Compared with existing technologies, this eliminates the need to collect as many out-of-distribution samples as possible, clean the data, or invest in any manual annotation, thus reducing training costs and improving the training efficiency of the classification model. Furthermore, the binary classification network uses background information from real images as out-of-distribution sample features, rather than artificially created ones, thus eliminating bias and significantly improving the model's out-of-distribution sample detection capability. Using only existing data significantly improves the classification robustness of the model, enabling it to reject samples of unfamiliar categories, rather than misclassifying them with extremely high confidence as traditional classification models do.
[0062] Specifically, taking an image as the data to be processed as an example, a convolutional neural network (CNN) can be used to downsample the input image to obtain the corresponding feature map. In a CNN, since the receptive field (kernel size) is finite, the feature at each location in the feature map still corresponds to a patch in the original image. That is, without feature fusion, the feature vector in the feature map is localized; it only contains information from a local patch in the original image, not information from the entire image. Based on this locality of CNNs, a classification network head can be used to sample in-distribution (i.e., target features or foreground features) and out-of-distribution (i.e., background features) features from the feature vector, and these features can be used to train a binary classification network. This binary classification network can determine whether an image is an in-distribution or out-of-distribution sample.
[0063] See Figure 4 , Figure 4 A schematic diagram illustrating the principle of classification model training according to an embodiment of the present disclosure is shown. Figure 4 In this context, a self-supervised sampling scheme can be used to train the out-of-distribution (OOD) branch, such as an OOD head that injects supervision signals from in-distribution / out-of-distribution samples using a CLS head. Specifically, the input image is sampled based on a convolutional neural network, with the last layer's feature map having dimensions C×H×W, where C is the number of channels and H×W is the feature map's dimensions. The multi-class network's classification head takes a feature vector of length C as input and outputs the confidence scores (M) for each class label. During actual classification, the feature map C×H×W is averaged across the latter two dimensions (pooling), resulting in a vector of length C. This allows the multi-class network's classification head to obtain the image's classification result. Alternatively, pooling can be omitted, maintaining the feature map's dimensions as C×H×W. In this case, each location will have a feature vector of length C. The multi-class network's classification head can then classify these feature vectors, yielding H×W classification results (classification confidence scores). For example:
[0064]
[0065] Where yi represents the classification confidence of image feature i, γ represents the preset threshold for belonging to in-distribution features, and 1-γ represents the preset threshold for belonging to out-of-distribution features. yi=0 indicates that image feature i is an out-of-distribution feature, yi=1 indicates that image feature i is an in-distribution feature, and yi-N / A indicates that image feature i is not used to train the binary classification network.
[0066] Of these classification confidence scores, if a score is greater than or equal to a preset threshold (e.g., γ = 95%), it is determined to be an in-distribution feature; if it is less than a preset threshold (e.g., 1 - γ = 5%), it is determined to be an out-of-distribution feature, i.e., a background feature. This yields both in-distribution and out-of-distribution image features. These image features can be used to train a binary classification network to determine whether an input image feature is an in-distribution feature. The input to this binary classification network is the image feature, and the output is the confidence score of whether the image feature belongs to the in-distribution feature.
[0067] In some embodiments, training the binary classification network based on the foreground and background features of the training samples includes:
[0068] Based on the binary classification network, calculate the first confidence level that the foreground feature belongs to the target type, and the second confidence level that the background feature belongs to the target type;
[0069] The first loss function of the binary classification network is calculated based on the first confidence level and the second confidence level;
[0070] The binary classification weight parameters of the binary classification network are adjusted based on the first loss function to minimize the first loss function.
[0071] In some embodiments, training the multi-classification network based on training samples to classify the target type includes:
[0072] Feature extraction is performed on the training samples to obtain sample features;
[0073] Calculate the multi-class confidence score of the sample feature belonging to the target type based on the multi-class network;
[0074] Calculate the second loss function of the multi-class network based on the multi-class confidence score;
[0075] The multi-class weight parameters of the multi-class network are adjusted based on the second loss function to minimize the second loss function.
[0076] The first loss function and the second loss function can be the cross-entropy loss function.
[0077] In some embodiments, method 300 further includes:
[0078] Based on the data features and the target type detection characteristics of the classification model, the type of the data to be processed is determined as the target type;
[0079] Based on the classification model, the data features are classified according to the target type to obtain the classification result of the data to be processed.
[0080] In practical applications, if the binary classification network determines that the sample is within the distribution, a class classification is performed; if the binary classification network determines that the sample is out of the distribution, a class classification is rejected. For example, if a classification model can classify data into type A, type B, or type C, the binary classification network can determine whether the input data belongs to one of these types. If it does not, the multi-class classification network will refuse to perform a specific classification. If it does, the multi-class classification network can calculate the confidence level of the input data belonging to type A, type B, or type C, and determine the type with the highest confidence level as the classification result for the input data.
[0081] It should be noted that the method of this disclosure embodiment can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of this disclosure embodiment, and the multiple devices will interact with each other to complete the method described.
[0082] It should be noted that the above description describes some embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0083] Based on the same technical concept, corresponding to any of the above embodiments, this disclosure also provides a data classification device, see [link to relevant documentation]. Figure 5 The data classification device includes:
[0084] The acquisition module is used to acquire data to be processed.
[0085] The feature module is used to extract features from the data to be processed to obtain data features;
[0086] The model module is used to determine the type of the data to be processed based on the data features and the target type detection characteristics of the classification model. The type of the data to be processed includes target type and non-target type. The classification model is used for the classification of the target type.
[0087] For ease of description, the above apparatus is described in terms of its functions, divided into various modules. Of course, in implementing this disclosure, the functions of each module can be implemented in one or more software and / or hardware.
[0088] The apparatus of the above embodiments is used to implement the corresponding data classification method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0089] Based on the same technical concept, corresponding to the methods of any of the above embodiments, this disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the data classification method as described in any of the above embodiments.
[0090] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0091] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the data classification method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0092] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this disclosure (including the claims) is limited to these examples; within the framework of this disclosure, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this disclosure as described above, which are not provided in detail for the sake of brevity.
[0093] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this disclosure, the provided drawings may or may not show well-known power / ground connections to integrated circuit (IC) chips and other components. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this disclosure, and this also takes into account the fact that the details of implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this disclosure will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuitry) have been set forth to describe exemplary embodiments of this disclosure, it will be apparent to those skilled in the art that the embodiments of this disclosure may be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0094] Although this disclosure has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0095] This disclosure is intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A data classification method, the method comprising: Obtain the data to be processed; Data features are obtained by extracting features from the data to be processed; Based on the data features and the target type detection characteristics of the classification model, the type of the data to be processed is determined. The type of the data to be processed includes target type and non-target type. The classification model is used for classifying the target type and detecting the non-target type. The target type detection characteristics are used to determine whether the type of the data to be processed is the target type. The classification model includes a binary classification network and a multi-class classification network. The multi-class classification network is trained based on training samples to classify the target type. The binary classification network is trained based on the foreground and background features of the training samples to determine whether the type of the data to be processed is the target type based on the target type detection characteristics. The foreground features characterize features in the training samples whose classification confidence is greater than or equal to a preset threshold, and the background features characterize features in the training samples whose classification confidence is less than the preset threshold. The classification confidence is obtained by classifying the features of the training samples based on the classification head of the multi-classification network.
2. The method according to claim 1, wherein, The type of the data to be processed is determined based on the data features and the target type detection characteristics of the classification model, including: Based on the target type detection characteristics of the classification model, determine whether the data feature belongs to the target feature corresponding to the target type; In response to the fact that the data feature belongs to a non-target feature, the type of the data to be processed is determined to be the non-target type; In response to the data feature belonging to the target feature, the type of the data to be processed is determined to be the target type.
3. The method according to claim 2, wherein, Determining whether a data feature belongs to the target type based on the target type detection characteristics of the classification model includes: Calculate the target confidence score of the data feature belonging to the target feature based on the classification model; Determine whether the target confidence level is less than a preset threshold; In response to the target confidence level being less than the preset threshold, the data feature is determined to belong to the non-target feature.
4. The method according to claim 1, wherein, The binary classification network is trained based on the foreground and background features of the training samples, including: Based on the binary classification network, calculate the first confidence level that the foreground feature belongs to the target type, and the second confidence level that the background feature belongs to the target type; The first loss function of the binary classification network is calculated based on the first confidence level and the second confidence level; The binary classification weight parameters of the binary classification network are adjusted based on the first loss function to minimize the first loss function.
5. The method according to claim 1, wherein, The multi-classification network is trained based on training samples to classify the target type, including: Feature extraction is performed on the training samples to obtain sample features; Calculate the multi-class confidence score of the sample feature belonging to the target type based on the multi-class network; Calculate the second loss function of the multi-class network based on the multi-class confidence score; The multi-class weight parameters of the multi-class network are adjusted based on the second loss function to minimize the second loss function.
6. The method according to claim 1, further comprising: Based on the data features and the target type detection characteristics of the classification model, the type of the data to be processed is determined as the target type; Based on the classification model, the data features are classified according to the target type to obtain the classification result of the data to be processed.
7. A data classification device, comprising: The acquisition module is used to acquire data to be processed. The feature module is used to extract features from the data to be processed to obtain data features; The model module is used to determine the type of the data to be processed based on the data features and the target type detection characteristics of the classification model. The type of the data to be processed includes target type and non-target type. The classification model is used to classify the target type and detect the non-target type. The target type detection characteristics are used to determine whether the type of the data to be processed is the target type. The classification model includes a binary classification network and a multi-class classification network. The multi-class classification network is trained based on training samples to classify the target type. The binary classification network is trained based on the foreground and background features of the training samples to determine whether the type of the data to be processed is the target type based on the target type detection characteristics. The foreground features characterize features in the training samples whose classification confidence is greater than or equal to a preset threshold, and the background features characterize features in the training samples whose classification confidence is less than the preset threshold. The classification confidence is obtained by classifying the features of the training samples based on the classification head of the multi-classification network.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as claimed in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 6.
10. A computer program product comprising computer program instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Target classification method and device and readable storage medium
CN111091140A
Image classification method and device, electronic equipment and computer readable storage medium
CN112163110A
Image type identification method and device, equipment, medium and product
CN114708539A
Image classification method, electronic equipment, storage medium and program product
CN114743043A
