Data classification method and apparatus, device, medium, and program product
By performing feature extraction and target type detection in the neural network model, the misclassification problem of out-of-distribution data is solved by the classification model, the classification accuracy and robustness are improved, and the accurate processing of diversified categories of data is achieved.
Patent Information
- Application Number
- PCT/CN2024/101356
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-26
- Filing Date
- 2024-06-25
- Publication Date
- 2025-01-02
AI Technical Summary
Existing neural network models cannot accurately process the diversified categories in actual data in classification tasks, resulting in low classification accuracy, especially insufficient detection capabilities for samples outside the distribution, resulting in misclassification.
By obtaining the data to be processed, performing feature extraction and using the target type detection characteristics of the classification model, determining whether the data type is a preset target type, avoiding forcibly classifying input data that does not belong to the target type, and improving classification accuracy and distribution beyond the classification Data detection capability.
It improves the category judgment ability and classification accuracy of the input data, avoids misclassification of out-of-distribution data by the classification model, reduces the training cost and model deviation, and improves the robustness of the classification model.
Smart Images

Figure CN2024101356_02012025_PF_FP_ABST
Abstract
Description
Data classification method, device, equipment, medium and program product
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 26, 2023, with application number 202310764282.1 and invention name “Data classification method, device, equipment, medium and program product”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present disclosure relates to the field of computer technology, and in particular to a data classification method, apparatus, device, medium, and program product. Background Art
[0003] When deploying neural network models in real-world applications, they face challenges such as the sheer diversity of real-world data. When performing classification tasks based on neural networks, they often only classify input into predefined categories. However, the actual input may not necessarily fall into these categories. For example, a neural network classification model trained on a cat and dog dataset will still output a classification of cat or dog when fed an image of an elephant. Clearly, the output of either cat or dog is incorrect, making existing classification models incapable of accurate classification, resulting in low data classification accuracy.
[0004] Summary of the Invention
[0005] The present disclosure proposes a data classification method, apparatus, device, storage medium and program product to solve the technical problem of low accuracy of data classification to a certain extent.
[0006] In a first aspect of the present disclosure, a data classification method is provided, comprising: acquiring data to be processed; performing feature extraction on the data to be processed to obtain data features; determining the type of the data to be processed based on the data features and target type detection characteristics of a classification model, wherein the type of the data to be processed includes a target type and a non-target type, and the classification model is used for classifying the target type.
[0007] In a second aspect of the present disclosure, a data classification device is provided, comprising: an acquisition module for acquiring data to be processed; a feature module for extracting features from the data to be processed to obtain data features; and a model module for determining the type of the data to be processed based on the data features and the target type detection characteristics of a classification model, wherein the type of the data to be processed includes a target type and a non-target type, and the classification model is used to classify the target type.
[0008] In a third aspect of the present disclosure, an electronic device is provided, 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, and the programs include instructions for executing the method according to the first aspect or the second aspect.
[0009] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium containing a computer program is provided. When the computer program is executed by one or more processors, the processors execute the method described in the first aspect or the second aspect.
[0010] In a fifth aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method described in the first aspect.
[0011] From the above description, it can be seen that the data classification method, device, equipment, medium and program product provided by the present disclosure determine whether the type of the data to be processed is the target type corresponding to the classification model through the classification model, which can avoid the problem of the classification model classifying any input data into the target type, resulting in a decrease in classification accuracy, improve the ability to judge the category of the input data, and further improve the accuracy of classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] FIG1 is a schematic diagram of a data classification architecture according to an embodiment of the present disclosure.
[0014] FIG2 is a schematic diagram of the hardware structure of an exemplary electronic device according to an embodiment of the present disclosure.
[0015] FIG3 is a schematic flowchart of a data classification method according to an embodiment of the present disclosure.
[0016] FIG4 is a schematic diagram showing the principles of classification model training according to an embodiment of the present disclosure.
[0017] FIG5 is a schematic diagram of a data classification device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0019] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the described object changes, the relative position relationship may also change accordingly.
[0020] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0021] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested 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 electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0022] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0023] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0024] FIG1 shows a schematic diagram of a data classification architecture according to an embodiment of the present disclosure. Referring to FIG1 , the 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 may be connected via a wired or wireless network 130. The server 110 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, security services, and CDN.
[0025] Terminal 120 can be implemented in hardware or software. For example, when implemented in hardware, terminal 120 can be any electronic device with a display screen that supports page display, including but not limited to smartphones, tablet computers, e-book readers, laptop computers, 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 or software modules (such as software or software modules used to provide distributed services), or it can be implemented as a single software or software module, and no specific limitations are given here.
[0026] It should be noted that the data classification method provided in the embodiments of the present application can be executed by the terminal 120 or by the server 110. It should be understood that the number of terminals, networks, and servers in FIG1 is for illustration only and is not intended to limit the same. Any number of terminals, networks, and servers may be used as required.
[0027] Figure 2 shows a schematic diagram of the hardware structure of an exemplary electronic device 200 provided by an embodiment of the present disclosure. As shown in Figure 2, 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 communicatively connected to each other within electronic device 200 via bus 210.
[0028] The processor 202 may be a central processing unit (CPU), a data classifier, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device (PLD), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or one or more integrated circuits. The processor 202 may be used to perform functions related to the technology described in this disclosure. In some embodiments, the processor 202 may also include multiple processors integrated into a single logical component. For example, as shown in FIG2 , the processor 202 may include multiple processors 202a, 202b, and 202c.
[0029] The memory 204 can be configured to store data (e.g., instructions, computer codes, etc.). As shown in Figure 2, the data stored in the memory 204 can include program instructions (e.g., program instructions for implementing the data classification method of the present disclosure embodiment) and data to be processed (e.g., the memory can store configuration files of other modules, etc.). The processor 202 can also access the program instructions and data stored in the memory 204, and execute the program instructions to operate on the data to be processed. The memory 204 can include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 204 can include a random access memory (RAM), a read-only memory (ROM), an optical disc, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.
[0030] The network module 206 can be configured to provide the electronic device 200 with communication with other external devices via a network. The 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)), a cellular network, the Internet, or a combination thereof. It will be appreciated that the type of network is not limited to the specific examples above. In some embodiments, the network module 206 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, and the like.
[0031] The peripheral interface 208 can be configured to connect the electronic device 200 to one or more peripheral devices to implement information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touchpad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.
[0032] The bus 210 can be configured to transmit information between the various components of the electronic device 200 (e.g., the processor 202, the memory 204, the network module 206, and the peripheral interface 208), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.
[0033] It should be noted that although the architecture of the electronic device 200 shown above only includes the processor 202, the memory 204, the network module 206, the peripheral interface 208, and the bus 210, in a specific implementation, the architecture of the electronic device 200 may also include other components necessary for normal operation. In addition, those skilled in the art will understand that the architecture of the electronic device 200 may also include only the components necessary to implement the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0034] Out-of-distribution data refers to samples that are different from the categories in the classification network's training dataset. For example, if the image categories in the training dataset are "cat" and "dog," then an image of an elephant is an out-of-distribution sample relative to the training dataset. Out-of-distribution detection refers to the classification network's ability 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, for a "cat" and "dog" binary classification problem, the classifier gives a probability that the input image belongs to a cat or a dog, and the sum of these probabilities is 1. Therefore, if an image of an elephant is input, the classifier might give a result of 40% cat and 60% dog, which is obviously unreasonable. The goal of out-of-distribution detection is to enable the model to recognize out-of-distribution samples by rejecting the input from a category outside the closed set, rather than forcing the classification with a high confidence score.
[0035] Traditional approaches to out-of-distribution sample detection primarily include: One approach involves collecting as many out-of-distribution samples as possible—data whose classification information does not overlap with the training data. A binary classifier is then trained using the training data (positive samples) and the collected out-of-distribution data (negative samples) to determine whether a new input sample is in-distribution. This approach is expensive to collect data, requires data cleaning, and requires a large amount of data, making it difficult to complete in a short period of time with minimal manpower or cost. Another approach involves constructing out-of-distribution features in the feature space. This involves constructing a feature distribution function for the training data and sampling from its edges to obtain feature points with low probability density as out-of-distribution samples. This allows for the training of an in-distribution / out-of-distribution feature classifier to determine whether features in the input image are out-of-distribution samples. The feature distribution constructed by this approach differs from the true feature distribution, and the deviation between the two is often difficult to effectively assess and measure. This can result in the collection of perceived edge samples, which may not actually be edge samples but rather meaningless noise. Consequently, this approach fails to effectively improve model performance and may even lead to model failure and performance degradation due to excessive feature deviation in the sampled features. Therefore, how to improve the out-of-distribution data detection capability of the classification model and improve the accuracy of data classification has become a technical problem that needs to be solved urgently.
[0036] In view of this, embodiments of the present disclosure provide a data classification method, apparatus, device, storage medium, and program product. By using a classification model to determine whether the type of data to be processed is the target type corresponding to the classification model, the classification model can avoid the problem of reduced classification accuracy caused by the classification model classifying all input data as the target type. This improves the ability to detect out-of-distribution data in input data and further enhances classification accuracy.
[0037] Specifically, for the data to be processed, it can be determined whether the data to be processed belongs to the preset target type of the classification model. When the classification model faces the data to be processed of a category that does not exist in the training set, it outputs a lower confidence level, and thus makes a judgment of rejecting recognition based on the confidence level. It can be seen that the classification model according to the embodiment of the present disclosure can not only perform the classification task but also determine whether the input data is an out-of-distribution sample. Compared with the prior art that directly forces classification for 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.
[0038] Referring to Figure 3 , which shows a schematic flow chart of a data classification method according to an embodiment of the present disclosure, the data classification method 300 in Figure 3 may further include the following steps.
[0039] In step S310, data to be processed is obtained.
[0040] The data to be processed may include text, audio, or image data. It can be uploaded locally or retrieved via the network. Classification of the data to be processed can include text, audio, or image classification, such as identifying the language of text, identifying the owner of a voice, or detecting faces.
[0041] In step S320, feature extraction is performed on the data to be processed to obtain data features.
[0042] Specifically, feature extraction can be performed on the data to be processed based on a convolutional network. For example, if the data to be processed is an image, feature extraction can be performed on the image to obtain 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.
[0043] 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 a target type and a non-target type. The classification model is used to classify the target type.
[0044] The target type detection feature can refer 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 type A, type B, or type C, then the corresponding target type of the classification model is type A, type B, or type C. Non-target types can refer to types other than type A, type B, or type C, such as type D.
[0045] 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:
[0046] determining whether the data feature belongs to a target feature corresponding to the target type based on the target type detection characteristic of the classification model;
[0047] In response to the data feature being a non-target feature, the type of the to-be-processed data is determined to be the non-target type.
[0048] In some embodiments, determining the type of the data to be processed based on the data feature and the target type detection characteristics of the classification model includes: in response to the data feature being a target feature, determining the type of the data to be processed to be the target type.
[0049] In some embodiments, determining whether the data feature belongs to the target feature of the target type based on the target type detection characteristics of the classification model includes: calculating the target confidence that the data feature belongs to the target feature based on the classification model; determining whether the target confidence is less than a preset threshold; and determining that the data feature belongs to the non-target feature in response to the out-of-distribution confidence being less than the preset threshold.
[0050] Among them, the target feature can refer to the sample feature within the distribution that can be used to determine the target type based on the feature, and the non-target feature can refer to the sample feature outside the distribution that does not belong to the target type. Specifically, the target confidence (for example, the probability of belonging to the target feature) of the data feature can be calculated through the classification model. If the target confidence is greater than or equal to the preset threshold, it means that the data feature is the target feature; if the target confidence is less than the preset threshold, it means that the data feature is a non-target feature.
[0051] In some embodiments, the classification model includes a binary classification network and a multi-classification network, and the method further includes: training the multi-classification network based on training samples to classify the target type; and training the binary classification network based on the foreground features and background features of the training samples to determine whether the type of the data to be processed is the target type.
[0052] Among them, the binary classification network of the classification model can be used to determine whether the data to be processed belongs to the target type of the classification model, that is, whether it belongs to the in-distribution sample of the classification model. The multi-classification network can be used to further determine the specific type of the data to be processed, that is, which target type of the classification model it belongs to. Both the binary classification network and the multi-classification network are trained using the same training samples. Compared with the existing technology, there is no need to collect as many out-of-distribution samples as possible and clean the data, nor is there any need to invest any human labeling costs, which reduces the training cost and improves the training efficiency of the classification model. In addition, the binary classification network uses the background information of the real image as the out-of-distribution sample feature, rather than artificially generated, so there is no bias, which can significantly improve the model's out-of-distribution sample detection ability. Using only existing data significantly improves the classification robustness of the classification model, so that when the classification model sees samples of unfamiliar categories, it will refuse to judge, rather than misclassifying with extremely high confidence like traditional classification models.
[0053] Specifically, taking the image as the data to be processed as an example, a convolutional neural network can be used to downsample the input image to obtain the corresponding feature map. In a convolutional neural network, since the receptive field (convolution kernel size) is limited, the feature at each position in the feature map still corresponds to an image block in the original image. That is to say, without feature fusion, the feature vector in the feature map is local, and it only contains the information of a local image block in the original image, rather than the information of the entire image. Based on the locality of the above-mentioned convolutional neural network, the classification network head can be used to sample features within the distribution (i.e., target features or foreground features) and outside the distribution (i.e., background features) from the feature vector, and use these features to train a binary classification network, which can determine whether the image is an in-distribution sample or an out-of-distribution sample.
[0054] Refer to Figure 4, which shows a schematic diagram of the classification model training of an embodiment of the present disclosure. In Figure 4, a self-supervised sampling scheme can be used to train the out-of-distribution discriminant branch, such as an OOD head with a CLS head that injects a supervisory signal of in-distribution / out-of-distribution samples. Specifically, the input image is sampled based on a convolutional neural network, and the size of the feature map of the last layer is C×H×W, where C is the number of channels of the feature map and H×W is the size of the feature map. The input of the classification head of the multi-classification network is a feature vector of length C, and the output is the confidence (M) of each category label. When the classification is actually performed, the feature map C×H×W is averaged in the last two dimensions, that is, a pooling operation is performed to obtain a vector of length C, so that the classification result of the image is obtained using the classification head of the multi-classification network. At this time, the feature map can be kept without pooling, and its dimension is still C×H×W. Then, at each position, there is a feature vector of length C. These feature vectors are classified using the classification head of the multi-classification network, and then H×W classification results (classification confidence) can be obtained. For example:
[0055] Where yi represents the classification confidence of image feature i, γ represents the preset threshold for in-distribution features, and 1-γ represents the preset threshold for out-of-distribution features. yi = 0 indicates that image feature i is out-of-distribution, yi = 1 indicates that image feature i is in-distribution, and yi - N / A indicates that image feature i is not used to train the binary classification network.
[0056] Among these classification confidences, if it is greater than or equal to a preset threshold (for example, γ = 95%), it is determined to be an in-distribution feature; if it is less than a preset threshold (for example, 1-γ = 5%), it is determined to be an out-of-distribution feature, that is, a background feature. In this way, out-of-distribution image features and in-distribution image features can be obtained. These image features can be used to train a binary classification network to determine whether the input image feature is an in-distribution feature. The input of this binary classification network is the image feature, and the output is the confidence that the image feature is an in-distribution feature.
[0057] In some embodiments, training the binary classification network based on the foreground features and background features of the training sample includes: calculating a first confidence that the foreground features belong to the target type and a second confidence that the background features belong to the target type based on the binary classification network; calculating a first loss function of the binary classification network based on the first confidence and the second confidence; and adjusting the binary classification weight parameters of the binary classification network based on the first loss function to minimize the first loss function.
[0058] In some embodiments, the multi-classification network is trained based on training samples to classify the target type, including: extracting features from the training samples to obtain sample features; calculating the multi-classification confidence that the sample features belong to the target type based on the multi-classification network; calculating the second loss function of the multi-classification network based on the multi-classification confidence; and adjusting the multi-classification weight parameters of the multi-classification network based on the second loss function to minimize the second loss function.
[0059] The first loss function and the second loss function may be cross entropy loss functions.
[0060] In some embodiments, method 300 further includes: determining that the type of the data to be processed is a target type based on the target type detection characteristics of the data features and the classification model; and classifying the data features into the target type based on the classification model to obtain a classification result of the data to be processed.
[0061] In practical applications, if the binary classification network determines that the sample is in-distribution, the classification judgment is performed; if the binary classification network determines that the sample is out-of-distribution, the classification judgment is rejected. For example, if the classification model can be classified as type A, type B, or type C, the binary classification network can determine whether the input data belongs to type A, type B, or type C. If it does not belong, the multi-classification network can refuse to perform specific classification. If it does belong, the multi-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.
[0062] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.
[0063] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0064] Based on the same technical concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a data classification device, see Figure 5, the data classification device includes: an acquisition module, used to acquire the data to be processed; a feature module, used to extract features of the data to be processed to obtain data features; a model module, 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, and the classification model is used to classify the target type.
[0065] For the convenience of description, the above devices are described as being functionally divided into various modules. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0066] The apparatus of the above embodiment is used to implement the corresponding data classification method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0067] Based on the same technical concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the data classification method described in any of the above embodiments.
[0068] The computer-readable media of this embodiment include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0069] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the data classification method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0070] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Within the scope of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0071] In addition, to simplify the description and discussion, and so as not to obscure the embodiments of the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, devices may be shown in the form of block diagrams to avoid obscuring the embodiments of the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be fully within the purview of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0072] Although the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0073] The embodiments of the present disclosure are 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 the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A data classification method, the method comprising: Get the data to be processed; Extracting features from the data to be processed to obtain data features; 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 a target type and a non-target type, and the classification model is used for classifying the target type.
2. The method according to claim 1, wherein 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: Determining whether the data feature belongs to a target feature corresponding to the target type based on the target type detection characteristic of the classification model; In response to the data feature being a non-target feature, determining the type of the to-be-processed data to be the non-target type; In response to the data feature belonging to the target feature, the type of the to-be-processed data is determined to be the target type.
3. The method according to claim 2, wherein: Judging whether the data feature belongs to the target feature of the target type based on the target type detection characteristic of the classification model includes: Calculating the target confidence that the data feature belongs to the target feature based on the classification model; Determining whether the target confidence is less than a preset threshold; In response to the out-of-distribution confidence being less than the preset threshold, it is determined that the data feature belongs to the non-target feature.
4. The method according to claim 1, wherein The classification model includes a binary classification network and a multi-classification network, and the method further includes: Training the multi-classification network based on training samples to classify the target types; And the binary classification network is trained based on the foreground features and background features of the training samples to determine whether the type of the data to be processed is the target type.
5. The method according to claim 4, wherein: Training the binary classification network based on the foreground features and background features of the training samples includes: Calculating a first confidence that the foreground feature belongs to the target type and a second confidence that the background feature belongs to the target type based on the binary classification network; Calculate the first loss function of the binary classification network based on the first confidence and the second confidence number; The binary classification weight parameters of the binary classification network are adjusted based on the first loss function to minimize the first loss function.
6. The method according to claim 1, wherein: Training the multi-classification network based on the training samples to classify the target types includes: Extracting features from the training samples to obtain sample features; Calculating the multi-classification confidence that the sample feature belongs to the target type based on the multi-classification network; Calculating a second loss function of the multi-classification network based on the multi-classification confidence; The multi-classification weight parameters of the multi-classification network are adjusted based on the second loss function to minimize the second loss function.
7. The method according to claim 1, further comprising: Determining the type of the data to be processed as a target type based on the data features and the target type detection characteristics of the classification model; The target type is classified into the data features based on the classification model to obtain a classification result of the data to be processed.
8. A data classification device, comprising: An acquisition module is used to acquire data to be processed; A feature module, used for extracting features from the data to be processed to obtain data features; A 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 a target type and a non-target type, and the classification model is used to classify the target type.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program. 10 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to claim 1 .
11. A computer program product, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Neural network training method, neural network construction method, image processing method and image processing device
CN110580487A
Medical image recognition method, device and equipment and storage medium
CN112016634A
Image type identification method and device, equipment, medium and product
CN114708539A
Image classification method, electronic equipment, storage medium and program product
CN114743043A
Image data classification method and device and electronic equipment
CN116188853A
